diff --git a/CHECKSUMS.txt b/CHECKSUMS.txt index fadb49a479387695af3cee4a3f2191efd793128f..57c47b46626071e38cdb89a997d80097b9ce6680 100644 --- a/CHECKSUMS.txt +++ b/CHECKSUMS.txt @@ -1,28 +1,28 @@ -Cover Charge v0.3.12.142: web apps, plus the Cover Charge for Display tablet app for Android (downloads/android/, its SHA-256 is in downloads/android/SHA256.txt). No phone APKs were built for v0.1.2 to v0.3.12.142. +Cover Charge v0.3.12.144: web apps, plus the Cover Charge for Display tablet app for Android (downloads/android/, its SHA-256 is in downloads/android/SHA256.txt). No phone APKs were built for v0.1.2 to v0.3.12.144. SHA-256 of each web app's start page, service worker, manifest and logo: -4d829d044e5bfc6151e99792c40e92fcb52dd7e8bffebc3f7d1fb68146cc9e7c owner-app/index.html -44f7dddfd571e44bde9e4895228bbeb5c3ef619f6790bdf408710999a41ff302 owner-app/sw.js +6d1f13e8c91b6a6bd386ae1d3a023f093242b56ceca5c8847a161deed7ad1356 owner-app/index.html +0450161e47b3c131cc49f7c18dada222e7c4cc782ea1e59fbd544e16b13cd49e owner-app/sw.js e305c44d11a9c25f37372f3fa4d329d4ffb04df2edee6e7b4b9ac91f3875ac67 owner-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 owner-app/brand-logo.png -5c0826667f7c53309e730304ad2fb0562702e2ea6db779356018144f79fb9dda staff-app/index.html -8815429d8caa2c06c33069320208417df004351043f751c096bd2853da693523 staff-app/sw.js +8112f8379ffe708a7aa7f93f704e2915ef356d18ecefd1a90c7ed9828ade5746 staff-app/index.html +afeae72aae3b8659e8cad5e363f1b4a29e9ee7520060f36029da7e3966ff5435 staff-app/sw.js bd1d310ebf8e2a80808e100c41fb7fe1c4369d3026478f3ad8eececaeadaf4ac staff-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 staff-app/brand-logo.png -955d963d8096892c46c460f14e47b9e5d4aa4c169b8fd632c405811682b9b618 customer-app/index.html -c0f40c339e553c229d0399e81adb77ab50bc2c761b3b24d418576635383c23a4 customer-app/sw.js +ab8e4584745166d90c3d6c6a9fa8fc3a109a1b9ec989008dd56f770b1f5fa43a customer-app/index.html +cd88e3eb8813d7e1d7b83debabb4d25a220650fc01247fbd6b5c913575f8383c customer-app/sw.js 3bfb1fd10cc13f09ca6be65c461e1f6b5750ae51a3ece12e079750b2a066052e customer-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 customer-app/brand-logo.png -508e0b4c887d28960ef996e44b0b2b1c842d39966f1bff3160c775fcde298976 display-app/index.html -96ab1636adc59f6cba61b23efd8dff680b12c20d769ccd572a2ea823bc337892 display-app/sw.js +31e965812525846ec4eb9712e7c2f5f44039d537a239736610e836b44318ed15 display-app/index.html +24f1e25184ed9df2935b78c19f05d5a8027623d95cf7aa30e2744983bce1a932 display-app/sw.js 35e2721b86eb1ae1605e55bee64177adcee72f4e53a24ac417d19ea2873434a1 display-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 display-app/brand-logo.png -d7263ae4badb781f4ecf752c3696f8dab22e9fb4472a63dac93d8be22c67ba52 chef-app/index.html -eb5d5be02b6c54442481fdeaa3b9972e9901b70d7a662358a2c6f2284d6d19d7 chef-app/sw.js +69b510fecfc258a388c2c48498e7edc94aa96b9e032b1027696ea195afbaea05 chef-app/index.html +e82ce39f982e2fec061fe873d18c3bf73e2ae9ae16c92d226bfe3b7a9df7878a chef-app/sw.js 97ed43decde8a888e22b7411e13a2122c6f8b9944cf38b2e28e8f62ef2e25397 chef-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 chef-app/brand-logo.png -b315ab137d98920c8bfbef3fa28c6ca001b69a63cdd68ba36c311c147ea38305 car-app/index.html -1d23bbfebf45e51a727de456c5a60c776ea2695e25fe8e53697875c83260d8d7 car-app/sw.js +520725bd92e708312f4fb0a7a5df797f9f28fbe68f64996ef903b9b157e67ab5 car-app/index.html +805f04ea1cff12869aa94a1bd933dfec06367dee14fa18444fb423de6400aa5a car-app/sw.js 091b9f96d36153d270b44dbf458aa99e4fd5e2f127769d030436fcd1d51e724a car-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 car-app/brand-logo.png fb1f73283c30e03612191eb339980b1b4922f3929cc60fa4780340c53d6434f1 car.html diff --git a/car-app/_expo/static/js/web/bundle.js b/car-app/_expo/static/js/web/bundle.js index 6c329d964231303ac55e51fcd462e82f373a929f..8e71477700f994762720737c924239570d041afb 100644 --- a/car-app/_expo/static/js/web/bundle.js +++ b/car-app/_expo/static/js/web/bundle.js @@ -6,7 +6,7 @@ var __BUNDLE_START_TIME__=globalThis.nativePerformanceNow?nativePerformanceNow() __d(function(g,r,i,a,m,e,d){"use strict";r(d[0]),r(d[1])},0,[1,19]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";var e,t=_r(d[0]),o=_r(d[1]),a=_r(d[2]),n=_r(d[3]),i=_r(d[4]),c=(e=i)&&e.__esModule?e:{default:e};if(t.PITCH){const e=o.restaurants.find(e=>'anchorage'===e.id);e&&Object.assign(e,{name:n.PITCH_VENUE.name,tagline:n.PITCH_VENUE.tagline,location:n.PITCH_VENUE.location,phone:n.PITCH_VENUE.phone,website:n.PITCH_VENUE.website,hoursNote:'Kitchen (food) hours. The closing time is last food orders.',fictional:!1}),e&&(e.settings={...e.settings,whatsapp:'07700 900123'});for(const e of c.default.areas)delete e.best;for(let e=a.ROSTER.length-1;e>=0;e--){const t=n.PITCH_TEAM[a.ROSTER[e].id];t?(Object.assign(a.ROSTER[e],{name:t.name,job:t.job,hourlyPence:t.hourlyPence,...t.dept?{dept:t.dept}:{},...null!=t.salaried?{salaried:t.salaried}:{}}),delete a.ROSTER[e].nickname):a.ROSTER.splice(e,1)}if('undefined'!=typeof document){const e=t=>{if(3===t.nodeType){const e=t.nodeValue??'',o=(0,n.pitchText)(e);return void(o!==e&&(t.nodeValue=o))}if(1!==t.nodeType)return;const o=t;if('INPUT'===o.tagName||'TEXTAREA'===o.tagName){const e=o,t=(0,n.pitchText)(e.value);t!==e.value&&(e.value=t);const a=e.getAttribute('placeholder');if(a){const t=(0,n.pitchText)(a);t!==a&&e.setAttribute('placeholder',t)}}for(const e of['aria-label','title']){const t=o.getAttribute(e);if(t){const a=(0,n.pitchText)(t);a!==t&&o.setAttribute(e,a)}}o.childNodes.forEach(e)},t=()=>{e(document.body),document.title=(0,n.pitchText)(document.title),new MutationObserver(t=>{for(const o of t)'characterData'===o.type?e(o.target):o.addedNodes.forEach(e),'attributes'===o.type&&e(o.target);document.title=(0,n.pitchText)(document.title)}).observe(document.body,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:['value','placeholder','aria-label']}),document.addEventListener('input',e=>{e.target},!0)};document.body?t():document.addEventListener('DOMContentLoaded',t)}}},1,[2,3,15,17,18]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PITCH",{enumerable:!0,get:function(){return n}});const n=(['anchorage','souters','kirkmichael','wildings','kirkton','abbotsford','greenside',"3idiots","cecchinis","mrbasrais","yasmins","williewastles","rupeeroom","smokinggoat","pizzaioli","drunkencoo"].includes("anchorage"),!1)},2,[]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return t.GREENSIDE_RESTAURANT}}),Object.defineProperty(e,"ABBOTSFORD_RESTAURANT",{enumerable:!0,get:function(){return n.ABBOTSFORD_RESTAURANT}}),Object.defineProperty(e,"KIRKTON_RESTAURANT",{enumerable:!0,get:function(){return o.KIRKTON_RESTAURANT}}),Object.defineProperty(e,"WILDINGS_RESTAURANT",{enumerable:!0,get:function(){return s.WILDINGS_RESTAURANT}}),Object.defineProperty(e,"KIRKMICHAEL_RESTAURANT",{enumerable:!0,get:function(){return c.KIRKMICHAEL_RESTAURANT}}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return R}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);const u={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:16,bookingSlotMinutes:15,deposit:{...r(d[6]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},h={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},f={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},b={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},p=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:f,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...u,orderAtTable:!1,pay:h,cashUpRecord:[...l.ANCHORAGE_CASH_UP]},sections:[]},{id:'saltmarsh',name:'The Venue',tagline:'FICTIONAL demo restaurant \u2014 shows multi-tenancy',location:'Port Ailsa (fictional town)',fictional:!0,kitchenHours:{0:['12:00','20:00'],1:['12:00','20:00'],2:['12:00','20:00'],3:['12:00','20:00'],4:['12:00','21:00'],5:['12:00','21:00'],6:['12:00','21:00']},settings:{...u,slotCap:4,stampTarget:6,stampReward:'Free side',capacityPerHour:30},sections:['Small plates','Mains','Puddings']},{id:'brae',name:'Brae Bakehouse',tagline:'FICTIONAL demo caf\xe9 \u2014 shows multi-tenancy',location:'Kilbrae (fictional village)',fictional:!0,kitchenHours:{0:['09:00','16:00'],1:['09:00','16:00'],2:['09:00','16:00'],3:['09:00','16:00'],4:['09:00','16:00'],5:['09:00','20:00'],6:['09:00','20:00']},settings:{...u,slotCap:5,slotMinutes:15,stampTarget:10,stampReward:'Free coffee & cake',capacityPerHour:24,bookingCoversPerSlot:10},sections:['Bakes','Lunch','Hot drinks']}],A={by:'Fictional demo',at:'2026-10-26'},T=(t,n,o,s,c,l,u,h,f=[])=>({id:n,restaurantId:t,section:o,name:s,description:c,price:l,allergens:u,prepMins:h,dietary:f,soldOut:!1,signOff:A}),R=[T('saltmarsh','s-beets','Small plates','Roast beetroot & whipped feta','Fictional dish for the demo.',750,{milk:'contains',treenuts:'may'},6,['V']),T('saltmarsh','s-squid','Small plates','Salt & pepper squid','Fictional dish for the demo.',850,{molluscs:'contains',gluten:'contains'},7),T('saltmarsh','s-hake','Mains','Pan-roast hake, mussel broth','Fictional dish for the demo.',1950,{fish:'contains',molluscs:'contains',milk:'contains',celery:'contains'},15),T('saltmarsh','s-risotto','Mains','Wild mushroom risotto','Fictional dish for the demo.',1600,{milk:'contains',celery:'contains',sulphites:'contains'},16,['V']),T('saltmarsh','s-cranachan','Puddings','Cranachan','Fictional dish for the demo.',700,{milk:'contains',gluten:'contains'},3,['V']),T('brae','b-scone','Bakes','Cheese scone','Fictional dish for the demo.',350,{gluten:'contains',milk:'contains',eggs:'contains'},2,['V']),T('brae','b-caramel','Bakes','Millionaire\u2019s shortbread','Fictional dish for the demo.',300,{gluten:'contains',milk:'contains',soya:'may'},1,['V']),T('brae','b-toastie','Lunch','Ham & mustard toastie','Fictional dish for the demo.',750,{gluten:'contains',milk:'contains',mustard:'contains'},6),T('brae','b-soup','Lunch','Lentil soup & bread','Fictional dish for the demo.',600,{gluten:'contains',celery:'contains'},4,['VG']),T('brae','b-flat','Hot drinks','Flat white','Fictional dish for the demo.',330,{milk:'contains'},2,['V'])]},3,[4,8,9,10,12,13,14]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return t.GREENSIDE_RESTAURANT}}),Object.defineProperty(e,"ABBOTSFORD_RESTAURANT",{enumerable:!0,get:function(){return n.ABBOTSFORD_RESTAURANT}}),Object.defineProperty(e,"KIRKTON_RESTAURANT",{enumerable:!0,get:function(){return o.KIRKTON_RESTAURANT}}),Object.defineProperty(e,"WILDINGS_RESTAURANT",{enumerable:!0,get:function(){return s.WILDINGS_RESTAURANT}}),Object.defineProperty(e,"KIRKMICHAEL_RESTAURANT",{enumerable:!0,get:function(){return c.KIRKMICHAEL_RESTAURANT}}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return R}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);const u={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:20,bookingSlotMinutes:15,deposit:{...r(d[6]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},h={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},f={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},b={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},p=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:f,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...u,orderAtTable:!1,pay:h,cashUpRecord:[...l.ANCHORAGE_CASH_UP],bookingCoversPerStart:15,bookingPartiesPerStart:4,onlinePartyMin:1,onlinePartyMax:8,bookingNoticeMins:15,autoAcceptUpTo:8},sections:[]},{id:'saltmarsh',name:'The Venue',tagline:'FICTIONAL demo restaurant \u2014 shows multi-tenancy',location:'Port Ailsa (fictional town)',fictional:!0,kitchenHours:{0:['12:00','20:00'],1:['12:00','20:00'],2:['12:00','20:00'],3:['12:00','20:00'],4:['12:00','21:00'],5:['12:00','21:00'],6:['12:00','21:00']},settings:{...u,slotCap:4,stampTarget:6,stampReward:'Free side',capacityPerHour:30},sections:['Small plates','Mains','Puddings']},{id:'brae',name:'Brae Bakehouse',tagline:'FICTIONAL demo caf\xe9 \u2014 shows multi-tenancy',location:'Kilbrae (fictional village)',fictional:!0,kitchenHours:{0:['09:00','16:00'],1:['09:00','16:00'],2:['09:00','16:00'],3:['09:00','16:00'],4:['09:00','16:00'],5:['09:00','20:00'],6:['09:00','20:00']},settings:{...u,slotCap:5,slotMinutes:15,stampTarget:10,stampReward:'Free coffee & cake',capacityPerHour:24,bookingCoversPerSlot:10},sections:['Bakes','Lunch','Hot drinks']}],A={by:'Fictional demo',at:'2026-10-26'},T=(t,n,o,s,c,l,u,h,f=[])=>({id:n,restaurantId:t,section:o,name:s,description:c,price:l,allergens:u,prepMins:h,dietary:f,soldOut:!1,signOff:A}),R=[T('saltmarsh','s-beets','Small plates','Roast beetroot & whipped feta','Fictional dish for the demo.',750,{milk:'contains',treenuts:'may'},6,['V']),T('saltmarsh','s-squid','Small plates','Salt & pepper squid','Fictional dish for the demo.',850,{molluscs:'contains',gluten:'contains'},7),T('saltmarsh','s-hake','Mains','Pan-roast hake, mussel broth','Fictional dish for the demo.',1950,{fish:'contains',molluscs:'contains',milk:'contains',celery:'contains'},15),T('saltmarsh','s-risotto','Mains','Wild mushroom risotto','Fictional dish for the demo.',1600,{milk:'contains',celery:'contains',sulphites:'contains'},16,['V']),T('saltmarsh','s-cranachan','Puddings','Cranachan','Fictional dish for the demo.',700,{milk:'contains',gluten:'contains'},3,['V']),T('brae','b-scone','Bakes','Cheese scone','Fictional dish for the demo.',350,{gluten:'contains',milk:'contains',eggs:'contains'},2,['V']),T('brae','b-caramel','Bakes','Millionaire\u2019s shortbread','Fictional dish for the demo.',300,{gluten:'contains',milk:'contains',soya:'may'},1,['V']),T('brae','b-toastie','Lunch','Ham & mustard toastie','Fictional dish for the demo.',750,{gluten:'contains',milk:'contains',mustard:'contains'},6),T('brae','b-soup','Lunch','Lentil soup & bread','Fictional dish for the demo.',600,{gluten:'contains',celery:'contains'},4,['VG']),T('brae','b-flat','Hot drinks','Flat white','Fictional dish for the demo.',330,{milk:'contains'},2,['V'])]},3,[4,8,9,10,12,13,14]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_UUID",{enumerable:!0,get:function(){return n.GREENSIDE_UUID}}),Object.defineProperty(e,"GREENSIDE_BOOKING_PHONE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"GREENSIDE_VENUE_HOURS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"GREENSIDE_KITCHEN_HOURS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return u}});var n=r(d[0]);const t='tel:01655889685',o={0:['10:00','00:00'],1:null,2:null,3:['10:00','23:00'],4:['10:00','23:00'],5:['10:00','00:00'],6:['10:00','00:00']},s={0:['10:00','20:00'],1:null,2:null,3:['10:00','20:00'],4:['10:00','20:00'],5:['10:00','21:00'],6:['10:00','21:00']},u={id:'greenside',name:'The Greenside Restaurant',tagline:'Restaurant \xb7 Wood Fired Pizza \xb7 Maybole',location:'5 Greenside, Maybole, South Ayrshire KA19 7DG',address:'5 Greenside, Maybole, South Ayrshire KA19 7DG',phone:'01655 889685',email:'info@thegreensiderestaurant.co.uk',emailNeedsConfirmation:!0,website:'thegreensiderestaurant.co.uk',fictional:!1,cashOnly:!0,kitchenHours:s,venueHours:o,hoursNote:'Closed Monday and Tuesday. Venue Wednesday and Thursday 10:00\u201323:00, Friday to Sunday 10:00\u201300:00. Kitchen Wednesday, Thursday and Sunday 10:00\u201320:00; Friday and Saturday 10:00\u201321:00. Cash only.',sections:[],settings:{slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!0,bookingCoversPerSlot:0,stampTarget:8,stampReward:'',stampMinSpend:0,capacityPerHour:0,walkInShare:0,turnMins:75,orderAtTable:!1,showTakeaway:!1,shortName:'The Greenside',reserveStock:!1,tableRequests:!0,deposit:{on:!1,perPersonPence:null,fromParty:null,refundable:null,cutoffHours:null,needsConfirmation:!0,wixLinksOn:!1,policy:'Deposit policy needs confirmation. Deposits and payments are off. Requests need a manager to confirm.'}}}},4,[5]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VENUE_RID",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ISOLATED_VENUE_IDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"IS_GREENSIDE",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"GREENSIDE_UUID",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"IS_ABBOTSFORD",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ABBOTSFORD_UUID",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"IS_KIRKTON",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"KIRKTON_UUID",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"IS_QUEUED_VENUE",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"IS_SOUTERS",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"IS_WILDINGS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"IS_KIRKMICHAEL",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"IS_ISOLATED_VENUE",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"SOUTERS_UUID",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"KIRKMICHAEL_UUID",{enumerable:!0,get:function(){return U}}),Object.defineProperty(e,"WILDINGS_UUID",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"VENUE_UUID",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"venueKey",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"venueIdentityAllowed",{enumerable:!0,get:function(){return D}});var n=r(d[0]);const t="anchorage".toLowerCase().replace(/[^a-z0-9-]/g,'')||'anchorage',c={"3idiots":"59766322-119e-4036-a18a-f6909f60a8d2",cecchinis:"596c6f7e-9797-4e16-84fe-db4a99fa1bdc",mrbasrais:"5d500571-e205-4ead-bb58-60e986b6f40e",yasmins:"f43f20ad-55d0-4008-88c8-7738dc1698df",williewastles:"6abc2793-93ab-4e23-a705-b4011a5cc011",rupeeroom:"78bff97d-5f07-440a-bb99-f6a6118da7a3",smokinggoat:"cd985ff5-2443-458d-ac8b-342d553628cf",pizzaioli:"35f870fc-772c-4aad-bb9e-09a9a16bc925",drunkencoo:"f500ef12-b405-438b-9671-e54289bec5dd",abbotsford:'24624ea5-d1e3-4182-b0d1-73402b8a1532',kirkton:'e0afad1d-cbc1-414a-add6-92e47d302139',greenside:'1bc2a056-2ef6-4585-abfd-b7d21c84f215',souters:'41ce63ca-ae46-432d-a5ba-25e1b801e64d',kirkmichael:'43c8da91-b8b8-4ce9-9ab7-f00c84c5f4f6',wildings:'47f86b36-4c99-466a-be9c-30eb3d79f1e1'},b='greenside'===t,u=c.greenside,f='abbotsford'===t,o=c.abbotsford,l='kirkton'===t,s=c.kirkton,I=(0,n.isQueuedVenue)(t),O='souters'===t,p='wildings'===t,y='kirkmichael'===t,E=Object.prototype.hasOwnProperty.call(c,t),_=c.souters,U=c.kirkmichael,S=c.wildings,j=c[t],P=n=>E?`cc-venue:${t}:${n}`:n,D=(c,b)=>!E||c===j&&b===(0,n.queuedDatabaseSlug)(t)},5,[6]); __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"queuedVenues",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"isQueuedVenue",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"queuedDatabaseSlug",{enumerable:!0,get:function(){return o}}),_e.queuedRestaurant=function(e){const t=n[e];if(!t)throw Error('Unknown venue');const s=t.kitchenSessionsByDay??t.hours.sessionsByDay,o=Object.fromEntries(Array.from({length:7},(e,t)=>[t,s?.[t]?.length?[s[t][0][0],s[t][s[t].length-1][1]]:null]));return{id:e,name:t.name,location:t.address,address:t.address,phone:t.phone||'',email:t.email||'',website:t.website||'',fictional:!1,tagline:'Restaurant',kitchenHours:o,...s?{kitchenSessionsByDay:s}:{},hoursNeedsConfirmation:!0,hoursNote:t.hours.note,sections:[],settings:{slotMinutes:15,slotCap:0,bufferMins:0,leadMins:0,takeawayPaused:!0,bookingCoversPerSlot:0,stampTarget:0,stampReward:'',stampMinSpend:0,capacityPerHour:0,walkInShare:0,turnMins:0,orderAtTable:!1,showTakeaway:!1,shortName:t.name,reserveStock:!1,tableRequests:!0,deposit:{on:!1,perPersonPence:null,fromParty:null,refundable:null,cutoffHours:null,needsConfirmation:!0,wixLinksOn:!1,policy:'Deposit terms to confirm. No payment is taken for requests.'}}}};var e,t=r(d[0]);const n=((e=t)&&e.__esModule?e:{default:e}).default,s=e=>Object.prototype.hasOwnProperty.call(n,e),o=e=>s(e)?n[e].databaseSlug:e},6,[7]); @@ -1092,7 +1092,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},1009,[34,1010]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},1010,[1007,978,1011]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},1011,[1007]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.142'},1012,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.144'},1012,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:h}=await r.select();c&&s(c,h);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},h='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,h.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),h}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),h={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:h})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},1013,[1014,1015,934,978,1010]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},1015,[978]); @@ -1193,11 +1193,11 @@ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{ __d(function(_g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.saveBookingTables=$,_e.TablePicker=function({rid:e,booking:u,name:p,turnBase:k=90,onClose:v,onSaved:w,onPickOnPlan:T}){const C=(0,b.usePlan)(e),L=(0,c.useBookings)(e),[S,W]=(0,t.useState)(()=>(0,b.tablesOf)((0,h.tableKey)((0,b.tablesOf)(u.table)))),P=(0,t.useMemo)(()=>(0,h.pickGroups)(C),[C]),z=L.filter(e=>e.date===u.date),O=(0,h.seatsOf)(C,S),D=(0,h.seatLine)(O.total,u.partySize),I=(0,h.pickClashes)(u,S,z,k),B=e=>(0,h.pickClashes)(u,[e],z,k)[0]?.with,M=(0,h.tableKey)(S)!==(0,h.tableKey)((0,b.tablesOf)(u.table)),N=(0,f.useBlocks)(e=>e.blocks),R=(0,f.blockAt)(N,e,u.date,u.time),_=e=>W(s=>(0,h.toggleTable)(s,e)),Y=async s=>{try{await $(e,u,s),w?.((0,h.savedWords)(p,u.partySize,s,(0,h.seatsOf)(C,s).total)),v()}catch(e){w?.(`Couldn\u2019t save tables for ${p}: ${String(e?.message??e).slice(0,120)}`)}},G=(0,x.jsxs)(n.default,{style:{gap:8},children:[(0,x.jsxs)(n.default,{testID:"table-pick-total",accessible:!0,accessibilityLabel:`${(0,h.tablesWords)(S)} picked. ${D.text}.`,children:[(0,x.jsx)(y.T,{size:18,weight:"semibold",colour:g.colours.goldLight,children:(0,h.tablesWords)(S)}),(0,x.jsx)(y.T,{size:17,colour:g.colours.text,children:D.text})]}),R?(0,x.jsx)(n.default,{testID:"table-pick-pause",accessible:!0,accessibilityLabel:`Note. New bookings are paused ${R.from} to ${R.to}${R.reason?` (${R.reason})`:''}. You can still assign tables to this booking.`,style:{padding:10,borderRadius:10,borderWidth:1,borderColor:g.colours.goldMuted},children:(0,x.jsxs)(y.T,{size:16,colour:g.colours.goldLight,children:["New bookings paused ",R.from,"\u2013",R.to,R.reason?` \xb7 ${R.reason}`:'',". You can still save tables for this booking."]})}):null,I.length?(0,x.jsx)(n.default,{testID:"table-pick-clash",accessible:!0,accessibilityLabel:`Warning. ${(0,h.clashWords)(I)} You can still save.`,style:{padding:10,borderRadius:10,borderWidth:1,borderColor:g.colours.gold},children:(0,x.jsxs)(y.T,{size:16,weight:"semibold",colour:g.colours.goldLight,children:[(0,h.clashWords)(I)," You can still save."]})}):null,(0,x.jsxs)(y.Row,{gap:8,wrap:!0,children:[(0,x.jsx)(y.Button,{testID:"table-pick-save",label:I.length?'Save anyway':'Save tables',disabled:!M||!S.length,accessibilityLabel:`${I.length?'Save anyway, ':'Save, '}${(0,h.tablesWords)(S)} for ${p}. ${D.text}.${I.length?` ${(0,h.clashWords)(I)}`:''}`,onPress:()=>Y(S),style:[j,{flexGrow:1}]}),(0,b.tablesOf)(u.table).length?(0,x.jsx)(y.Button,{testID:"table-pick-clear",kind:"secondary",label:"Clear table",accessibilityLabel:`Clear table, take ${(0,h.tablesWords)((0,b.tablesOf)(u.table)).toLowerCase()} off ${p}`,onPress:()=>Y([]),style:j}):null,(0,x.jsx)(y.Button,{testID:"table-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",onPress:v,style:j})]})]});return(0,x.jsxs)(y.Sheet,{visible:!0,onClose:v,title:`Tables \xb7 ${u.time} ${p} \xb7 ${u.partySize} Covers`,maxWidth:760,testID:"table-picker",footer:G,children:[(0,x.jsx)(s.TableNumberWarning,{plan:C}),(0,x.jsx)(y.T,{size:16,colour:g.colours.text,children:"Tap one table, or several to join them. Tap again to take one off."}),T?(0,x.jsx)(y.Button,{kind:"secondary",testID:"table-pick-on-plan",label:"Pick on the table plan",accessibilityLabel:`Pick on the table plan instead, for ${p}`,onPress:()=>T(S),style:j}):null,P.map(e=>(0,x.jsxs)(n.default,{style:{gap:6},accessibilityLabel:e.area,children:[(0,x.jsx)(y.T,{size:15,weight:"semibold",colour:g.colours.gold,children:e.area}),(0,x.jsx)(y.Row,{gap:8,wrap:!0,children:e.tables.map(e=>{const s=S.includes(e.name),t=B(e.name);return(0,x.jsxs)(o.default,{testID:`table-pick-${e.name}`,accessibilityRole:"checkbox",accessibilityState:{checked:s},'aria-checked':s,accessibilityLabel:(0,h.pickA11y)(e.name,e.seats,s,t),onPress:()=>_(e.name),style:({pressed:e})=>({minWidth:92,minHeight:64,paddingHorizontal:10,paddingVertical:6,borderRadius:12,alignItems:'center',justifyContent:'center',borderWidth:s?2:1,borderColor:s?g.colours.gold:t?g.colours.goldMuted:g.colours.hairline,borderStyle:t&&!s?'dashed':'solid',backgroundColor:s?g.colours.gold:e?g.colours.tilePressed:g.colours.tile}),children:[(0,x.jsx)(y.T,{size:18,weight:"semibold",colour:s?g.colours.onGold:g.colours.text,children:(0,l.tableNumbers)(e.name)}),(0,x.jsxs)(y.T,{size:14,colour:s?g.colours.onGold:g.colours.muted,children:[e.seats," seats",t?' \xb7 booked':'']})]},e.name)})})]},e.area)),P.length?null:(0,x.jsx)(y.Muted,{children:"No tables on the plan yet. Add them in Setup \u203a Table plan."})]})};var s=r(d[0]),l=r(d[1]),t=r(d[2]),o=e(r(d[3])),n=e(r(d[4])),c=r(d[5]),b=r(d[6]),u=r(d[7]),h=r(d[8]),g=r(d[9]),p=r(d[10]),y=r(d[11]),k=r(d[12]),f=r(d[13]),x=r(d[14]);const j={minHeight:56};async function $(e,s,l){const t=(0,h.tableKey)(l),o=(0,b.tablesOf)(s.table);await c.repo.bookings.update(s.id,(0,u.tablePatch)(t||null)),'seated'===s.status&&s.date===(0,p.venueYmd)(new Date)&&(o.filter(e=>!(0,b.tablesOf)(t).includes(e)).forEach(s=>b.useFloor.getState().setLive(e,s,{stage:void 0,dirty:!0})),t&&(0,k.resetTableLive)(e,t))}},1110,[1111,860,34,402,102,874,1021,1109,1112,821,858,794,1113,1018,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.TableNumberWarning=function({plan:u}){const c=(0,n.numberClashes)(u.tables),o=[...new Set([...c.acrossAreas,...u.tables.filter(n=>c.sameArea.has(n.name)).map(n.tableNumber)])];return o.length?(0,l.jsxs)(t.T,{testID:"duplicate-table-numbers",size:16,colour:s.colours.goldLight,children:["Duplicate table numbers: ",o.join(', '),". Kept unchanged. Ask a manager to check the areas before assigning."]}):null},r(d[0]);var n=r(d[1]),s=r(d[2]),t=r(d[3]),l=r(d[4])},1111,[34,859,821,794,25]); __d(function(_g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"byNum",{enumerable:!0,get:function(){return s}}),e.tableKey=o,e.toggleTable=function(t,n){return t.includes(n)?t.filter(t=>t!==n):a(o([...t,n]))},e.seatsOf=function(t,n){const a={};for(const s of n)a[s]=t.tables.find(t=>t.name===s)?.maxSeats??0;return{per:a,total:Object.values(a).reduce((t,n)=>t+n,0)}},e.seatLine=function(t,n){const a=Math.max(0,n-t);return{text:`${t} ${1===t?'seat':'seats'} for ${l(n)}${a?`: ${a} short`:''}`,short:a,fits:0===a&&t>0}},e.pickClashes=function(t,l,u,c=90){if(!l.length)return[];const f={...t,table:o(l)},b=[];for(const s of u)if(s.id!==t.id&&s.date===t.date&&!['cancelled','noshow','finished'].includes(s.status)&&(0,n.startOf)(f)<(0,n.endOf)(s,c)&&(0,n.startOf)(s)<(0,n.endOf)(f,c))for(const t of a(s.table))l.includes(t)&&b.push({table:t,with:s});return b.sort((t,n)=>s(t.table,n.table))},e.clashWords=function(n){return n.map(n=>`${(0,t.tableNumbers)(n.table)} has ${n.with.walkIn?'a walk-in':(n.with.name||'a booking').replace(' (example)','')} at ${n.with.time}`).join('. ')+(n.length?'.':'')},e.tablesWords=u,e.pickA11y=function(n,a,s,l){return`Table ${(0,t.tableNumbers)(n)}, ${a} ${1===a?'seat':'seats'}${s?', selected':''}${l?`, has ${l.walkIn?'a walk-in':l.name} at ${l.time}`:''}`},e.pickGroups=function(t){return t.areas.map(n=>({area:n.name,tables:t.tables.filter(t=>t.areaId===n.id).map(t=>({name:t.name,seats:t.maxSeats})).sort((t,n)=>s(t.name,n.name))})).filter(t=>t.tables.length)},e.savedWords=function(t,n,a,s){return a.length?`${t}, ${l(n)}: ${u(a)} (${s} seats).`:`${t}: table taken off.`},e.tableActions=function(t,n){const s=a(t.table);if(['cancelled','noshow'].includes(t.status))return[];const o=[s.length?{id:'assign',label:'Change table',a11y:`Change table for ${n}, ${l(t.partySize)}, now ${u(s).toLowerCase()}. You can pick several tables to join.`}:{id:'assign',label:'Assign table',a11y:`Assign table for ${n}, ${l(t.partySize)}. You can pick several tables to join.`}];s.length&&o.push({id:'clear',label:'Clear table',a11y:`Clear table for ${n}, take ${u(s).toLowerCase()} off this booking`});return o},e.dragTables=function(t,n,s){if(!s||'__none'===s||s===n)return null;const l=a(t);if(l.includes(s))return null;return o('__none'!==n&&l.includes(n)?l.map(t=>t===n?s:t):[s])};var t=r(d[0]),n=r(d[1]);const a=t=>t?t.split('+').map(t=>t.trim()).filter(Boolean):[],s=(t,n)=>t.localeCompare(n,'en-GB',{numeric:!0}),l=t=>`${t} ${1===t?'person':'people'}`;function o(t){return[...new Set(t.map(t=>String(t).trim()).filter(Boolean))].sort(s).join('+')}function u(n){const s=a(o(n));return s.length?(0,t.tableListNumbers)(s):'No table'}},1112,[860,1095]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return O}}),_e.useTableNames=N,_e.resetTableLive=M,_e.seatBookingNow=F,_e.finishBookingNow=async function(e,t){await f.repo.bookings.setStatus(t.id,'finished'),(0,S.tablesOf)(t.table).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=L,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return R}}),_e.TablePicker=W,_e.WalkInSheet=E,_e.WalkInMatchPrompt=H,_e.AssignTableSheet=_,_e.undoNotice=Y,_e.NewBookingSheet=U,_e.useFrontDoor=function(e,t){const[s,o]=(0,r.useState)(!1),[l,a]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>d({b:e}),combineTables:e=>d({b:e,combine:!0}),elements:(0,B.jsxs)(B.Fragment,{children:[s?(0,B.jsx)(E,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,B.jsx)(U,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,n.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,x.niceDate)((0,x.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,B.jsx)(_,{booking:i.b,combine:i.combine,onClose:()=>d(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=e(r),u=_r(_d[8]),c=e(_r(_d[9])),b=e(_r(_d[10])),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),w=_r(_d[18]),T=_r(_d[19]),S=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),D=_r(_d[23]),I=_r(_d[24]),$=_r(_d[25]),P=_r(_d[26]),z=_r(_d[27]),B=_r(_d[28]);const O=Array.from({length:12},(e,t)=>String(t+1));function N(e){const t=(0,S.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function M(e,t){(0,S.tablesOf)(t).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}async function F(e,t){await f.repo.bookings.setStatus(t.id,'seated'),M(e,t.table)}function L(e,t){const s=(0,f.useBookings)(e),o=(0,f.useOrders)(e),l=N(e),a=(0,S.useFloor)(t=>t.live[e])??{},i=(0,S.usePlan)(e),n=(0,v.useBlocks)(e=>e.blocks),r=(0,x.ymd)(t),d=(0,v.closedAreasAt)(n,e,r,(0,x.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,S.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,x.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const R=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function W({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:d}){const u=Object.keys(e),[h,p]=(0,r.useState)(0),f=i?6:8,y=i?64:o?92:76,k=h?Math.max(3,Math.floor((h+f)/(y+f))):0,x=k?Math.floor((h-f*(k-1))/k):y,w=new Set(n??[]),v=a?(0,S.tablesOf)(a)[0]:null;return(0,B.jsx)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:f},testID:"table-picker",onLayout:e=>p(Math.floor(e.nativeEvent.layout.width)),children:u.map(o=>{const a=e[o],n=t===o||!!d?.includes(o),r=w.has(o),u=v===o&&!n,h=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,B.jsxs)(c.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${d?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${r?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:x,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?j.colours.gold:a.busy?j.colours.red:j.colours.ok,backgroundColor:n?j.colours.goldTint:a.busy?j.colours.redBg:j.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,B.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,B.jsx)(T.T,{weight:"bold",size:22,colour:n?j.colours.goldLight:j.colours.text,children:(0,l.tableNumbers)(o)}),r?(0,B.jsx)(b.default,{testID:"best-table",style:{backgroundColor:j.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,B.jsx)(T.T,{size:11,weight:"bold",colour:j.colours.onGold,children:"BEST"})}):null]}),(0,B.jsx)(T.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:h})]},o)})})}const A=[1,2,3,4,5,6,7,8];function E({onClose:e,onSeated:a,wide:i,initialTable:y}){const{rid:w,r:C,now:D}=(0,p.useCtx)(15e3),I=L(w,D),[$,P]=(0,r.useState)(2),[O,N]=(0,r.useState)(!1),[R,E]=(0,r.useState)(y??null),_=(0,S.usePlan)(w),Y=(0,f.useBookings)(w),U=(0,v.useBlocks)(e=>e.blocks),q=(0,v.closedAreasAt)(U,w,(0,x.ymd)(D),(0,x.hm)(D)),Q=d.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(_,Y.filter(e=>e.date===(0,x.ymd)(D)),e,$,D,(0,k.turnFor)($,C.settings.turnMins),90,void 0,{closed:q})?.table??null},[_,Y,I,$,q.size,D.getTime()]);(0,r.useEffect)(()=>{R&&(0,S.tablesOf)(R).some(e=>'Closed'===I[e]?.label)&&E(null)},[R,q.size]);const[V,G]=(0,r.useState)(!1),[K,X]=(0,r.useState)(''),J=(e,t=String(e),s=()=>{N(!1),P(e)})=>{const o='9+'===t?O:!O&&$===e;return(0,B.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?j.colours.gold:'transparent'},children:(0,B.jsx)(T.T,{weight:"bold",size:22,colour:o?j.colours.onGold:j.colours.gold,children:t})},t)},Z=(0,B.jsx)(s.PartySizeInput,{value:$,onChange:P,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),ee=(0,B.jsxs)(b.default,{style:{gap:8,width:i?256:void 0},children:[(0,B.jsx)(T.T,{weight:"semibold",children:"How many people?"}),(0,B.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[A.map(e=>J(e)),J(9,'9+',()=>{N(!0),P(e=>e>=9?e:9)})]}),O?Z:null]}),[te,se]=(0,r.useState)(!1),[oe,le]=(0,r.useState)(null),ae=async(t=R,s=!1)=>{if(!te){if(!s){const e=(0,z.bookingsNearWalkIn)(Y,D,$);if(e.length)return void le({at:t,list:e})}se(!0);try{const s=await f.repo.bookings.seatWalkIn(w,$,t??void 0,K);M(w,t??void 0),a(s),e()}finally{se(!1)}}},ie=async(t,s)=>{if(!te){se(!0);try{const o=s??t.table??null;o&&o!==t.table&&await f.repo.bookings.assignTable(t.id,o),await F(w,{...t,table:o??void 0}),(0,n.notify)({id:`seated:${t.id}`,testID:'walkin-match-toast',timeoutMs:5e3,icon:'\u2713',title:`${t.name} seated \xb7 ${t.partySize} \xb7 ${o?(0,l.tableNumbers)(o):'table to assign'} (booking ${t.ref})`}),le(null),e()}finally{se(!1)}}},ne=(0,B.jsxs)(b.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,B.jsxs)(T.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(T.T,{weight:"semibold",children:["Table ",(0,B.jsx)(T.T,{colour:j.colours.muted,size:14,children:"(optional)"})]}),R?(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>E(null)}):null]}),(0,B.jsx)(W,{use:I,value:R,onPick:e=>{I[e]&&!I[e].busy?ae(e):E(R===e?null:e)},big:i,dense:i,best:Q,bestSet:(0,u.bestTables)(_)}),(0,B.jsxs)(T.Muted,{children:["Tap a free table to seat them there",Q&&!R?` (suggested for ${$}: ${(0,l.tableNumbers)(Q)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,x.hm)(D)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,B.jsx)(T.Button,{label:`Seat walk-in \xb7 ${$} ${1===$?'person':'people'}${R?` \xb7 ${(0,l.tableNumbers)(R)}`:''}`,disabled:te,onPress:()=>{ae()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,B.jsxs)(T.Row,{gap:16,style:{alignItems:'flex-start'},children:[ee,ne]}):(0,B.jsxs)(B.Fragment,{children:[ee,ne]}),(0,B.jsxs)(T.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[V?(0,B.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:K,onChangeText:X,style:[T.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>G(!0)}),(0,B.jsx)(b.default,{style:{flex:1,minWidth:220},children:(0,B.jsxs)(T.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==h.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]}),oe?(0,B.jsx)(H,{list:oe.list,busy:te,onYes:e=>{ie(e,oe.at)},onNo:()=>{const e=oe.at;le(null),ae(e,!0)},onClose:()=>le(null)}):null]})}function H({list:e,busy:t,onYes:s,onNo:o,onClose:a}){return(0,B.jsx)(T.Sheet,{visible:!0,onClose:a,title:"Booked party?",maxWidth:720,testID:"walkin-match",children:(0,B.jsxs)(b.default,{style:{gap:14},children:[e.map((e,o)=>(0,B.jsxs)(b.default,{testID:`walkin-match-${o}`,style:{gap:12,padding:16,borderRadius:16,borderWidth:2,borderColor:j.colours.gold,backgroundColor:'#15130F'},children:[(0,B.jsx)(b.default,{accessibilityRole:"header",accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:26,weight:"bold",colour:j.colours.goldLight,testID:"walkin-match-question",children:(0,z.walkInMatchQuestion)(e)})}),e.table?(0,B.jsxs)(T.T,{size:17,colour:j.colours.text,children:["Booked table ",(0,l.tableNumbers)(e.table)," \xb7 ",e.ref]}):(0,B.jsx)(T.T,{size:17,colour:j.colours.text,children:e.ref}),(0,B.jsx)(T.Button,{label:"Yes, seat booking",testID:"walkin-match-yes",disabled:t,accessibilityLabel:`Yes, seat ${e.name}'s booking, ${e.partySize} people`,onPress:()=>s(e),style:{minHeight:64}})]},e.id)),(0,B.jsx)(T.Button,{kind:"secondary",label:"No, new walk-in",testID:"walkin-match-no",disabled:t,onPress:o,style:{minHeight:64}})]})})}function _({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,p.useCtx)(15e3),n=L(o,i),c=(0,S.usePlan)(o),h=(0,f.useBookings)(o),y=(0,S.tablesOf)(e.table),w=d.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,y.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),v=d.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(w).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(c,h.filter(e=>e.date===(0,x.ymd)(i)),t,e.partySize,i,(0,k.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[c,h,w,e.partySize,i.getTime()]),[C,D]=(0,r.useState)(!!s||y.length>1),[I,$]=(0,r.useState)(y),P=e=>c.tables.find(t=>t.name===e)?.maxSeats??0,z=I.reduce((e,t)=>e+P(t),0),O=I.length>0&&z{const l=(0,S.joinTables)(s);await f.repo.bookings.assignTable(e.id,l);y.filter(e=>!s.includes(e)).forEach(t=>S.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&M(o,l),t()},F=C?(0,B.jsxs)(b.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,B.jsx)(b.default,{accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:17,weight:"semibold",colour:j.colours.text,children:I.length?`${(0,S.tablesLabel)((0,S.joinTables)(I))} \xb7 ${z} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,B.jsx)(b.default,{testID:"combine-short",children:(0,B.jsxs)(T.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-z," more needed. Add another table."]})}):null,(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,B.jsxs)(T.Row,{gap:8,wrap:!0,children:[(0,B.jsx)(T.Button,{label:"Done",testID:"combine-done",disabled:!I.length,accessibilityLabel:I.length?`Done, save ${(0,S.tableCardLabel)((0,S.joinTables)(I))}`:'Done',onPress:()=>N(I)}),(0,B.jsx)(T.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,B.jsx)(b.default,{style:{gap:8},testID:"assign-table-tip",children:(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`${C?'Combine tables':'Assign table'} \xb7 ${R(e)}`,testID:"assign-table-sheet",footer:F,children:[v&&!C?(0,B.jsx)(b.default,{testID:"assign-suggested",children:(0,B.jsxs)(T.T,{size:16,weight:"semibold",colour:j.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,S.tableCardLabel)(v)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(v)]})}):null,C?null:(0,B.jsx)(T.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>D(!0)}),(0,B.jsx)(W,{use:w,best:C?null:v,bestSet:(0,u.bestTables)(c),picked:C?I:void 0,onPick:C?e=>$(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await N([e])}})]})}function Y(e){(0,n.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${R(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>f.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function U({date:e,onClose:t,wide:n,onSaved:d}){const{rid:u,r:c,now:h,role:z,meId:O}=(0,p.useCtx)(6e4),N=(0,x.ymd)(h),[M,F]=(0,r.useState)(ee.blocks),[W,A]=(0,r.useState)(!1),[E,H]=(0,r.useState)(''),[_,Y]=(0,r.useState)(2),[U,q]=(0,r.useState)(null),[Q,V]=(0,r.useState)(''),[G,K]=(0,r.useState)(''),[X,J]=(0,r.useState)(''),[Z,ee]=(0,r.useState)('phone'),[te,se]=(0,r.useState)((0,D.emptyNeeds)()),oe=(0,D.needsMissing)(te),[le,ae]=(0,r.useState)(null),ie=(0,S.usePlan)(u),ne=(0,P.dogSetUp)(ie),re=!0===te.dog&&ne,de=te.dog?te.dogs:0,ue=(0,x.parseYmd)(M),ce=(0,k.turnFor)(_,c.settings.turnMins),be=L.filter(e=>e.date===M),he=e=>(0,k.freeTablesAt)(ie,be,_,new Date(`${M}${(0,l.tableNumbers)(e)}:00`),ce,c.settings.turnMins,{dog:!0,closed:(0,v.closedAreasAt)(R,u,M,e)}),ge=re&&U?he(U):[];(0,r.useEffect)(()=>{ae(null)},[re,U,_]);const pe=(0,y.bookingSlots)(c,ue,e=>L.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),_,M===(0,x.ymd)(h)?h:(0,x.addMins)(ue,0)),me=(0,w.ukPhone)(G),[fe,ye]=(0,r.useState)(!1),ke=U?pe.find(e=>e.time===U):void 0,xe=ke&&ke.left<_?{left:Math.max(0,ke.left),time:ke.time}:null,je=U?(0,v.blockAt)(R,u,M,U):void 0,we='staff'!==z,Te=!!U&&!(0,D.dogTimeOk)(c,L,M,U,de),Se=!oe.length&&E.trim().length>=2&&!!U&&(!xe||fe)&&(0,o.validParty)(_)&&me.ok&&(0,w.emailOk)(X)&&(!je||we&&W)&&(!re||ge.length>0)&&!Te,ve=te.wheelchair>0||te.stepFree;return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,x.niceDate)(ue)}`,maxWidth:n?760:void 0,testID:"booking-sheet",children:[(0,B.jsx)(D.FirstQuestions,{rid:u,value:te,onChange:se,party:_,audience:"staff"}),te.dog&&!ne?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,B.jsx)(C.BookingDatePicker,{r:c,today:h,value:M,onChange:e=>{e!==M&&(F(e),q(null),A(!1))}}),(0,B.jsxs)(T.Row,{gap:6,children:[(0,B.jsx)(T.Chip,{label:"Phone",selected:'phone'===Z,onPress:()=>ee('phone')}),(0,B.jsx)(T.Chip,{label:"In person",selected:'in-person'===Z,onPress:()=>ee('in-person')})]}),(0,B.jsx)(T.Field,{label:"Name",value:E,onChangeText:H,placeholder:"e.g. Reid",testID:"nb-name"}),(0,B.jsx)(T.Field,{label:"Mobile or phone number (needed)",value:G,onChangeText:K,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!me.ok&&G?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:me.error}):null,(0,B.jsx)(T.Field,{label:"Email (optional)",value:X,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,w.emailOk)(X)?null:(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,B.jsxs)(b.default,{style:{gap:6,alignItems:'center'},children:[(0,B.jsx)(T.T,{center:!0,children:"Covers"}),(0,B.jsx)(s.PartySizeInput,{value:_,onChange:e=>{Y(e),ye(!1)},label:"Covers",testID:"nb-party"})]}),(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:pe.map(e=>{const t=re&&e.available&&!he(e.time).length||!(0,D.dogTimeOk)(c,L,M,e.time,de);return(0,B.jsx)(T.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,v.blockAt)(R,u,M,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':e.left>0?`${e.left} left`:'Full',disabled:(e.past??!e.available)||t,selected:U===e.time,onPress:()=>{q(e.time),A(!1),ye(!1)}},e.time)})}),xe?(0,B.jsxs)(b.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overCapacityNote)(_,xe.left,xe.time)}),(0,B.jsx)(T.Chip,{label:fe?'Booking over the limit: on':'Book anyway (over the limit)',selected:fe,onPress:()=>ye(e=>!e),testID:"nb-over-ok"})]}):null,re&&U?(0,B.jsxs)(b.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,B.jsxs)(T.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,B.jsxs)(T.T,{size:13,colour:j.colours.muted,children:["(",ie.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),ge.length?(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:ge.slice(0,10).map((e,t)=>(0,B.jsx)(T.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${ve&&(0,P.accessibleSetUp)(ie)&&!(0,P.isAccessible)(ie,e.table)?' \xb7 not step-free':''}`,selected:(le??ge[0].table)===e.table,onPress:()=>ae(e.table)},e.table))}):(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["No dog-friendly table free for ",_," at ",U,". Try another time."]})]}):null,je?(0,B.jsxs)(b.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsxs)(T.T,{weight:"semibold",colour:j.colours.amber,children:["Bookings are paused ",je.from,"\u2013",je.to,je.reason?` (${je.reason})`:'']}),we?(0,B.jsx)(T.Chip,{label:W?'Manager override on':'Override and book anyway',selected:W,onPress:()=>A(e=>!e)}):(0,B.jsx)(T.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,pe.length?null:(0,B.jsx)(b.default,{testID:"nb-closed",children:(0,B.jsxs)(T.T,{size:14,weight:"semibold",colour:j.colours.amber,children:["Closed on ",(0,x.niceDate)(ue)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,B.jsx)(D.MoreQuestions,{rid:u,r:c,value:te,onChange:se,party:_,date:M,time:U,today:(0,x.ymd)(h),bookings:L,audience:"staff",showTables:!1!==c.settings.tableRequests}),ve&&!(0,P.accessibleSetUp)(ie)?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,B.jsx)(T.Field,{label:"Notes (optional)",value:Q,onChangeText:V,placeholder:I.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(c.settings),_)?(0,B.jsxs)(T.Muted,{children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(c.settings),_))," (",(0,a.gbp)((0,i.depositOf)(c.settings).perPersonPence)," per person for ",(0,i.depositOf)(c.settings).fromParty,"+). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,B.jsxs)(T.Muted,{children:["The guest gets a confirmation text",X.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Te?(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["We already have the most dogs we can look after at ",U,". Try another time: dogs are very welcome then."]}):null,(0,B.jsx)(T.Button,{label:oe.length?oe[0]:'Save booking',testID:"nb-save",disabled:!Se,onPress:()=>{if(M<(0,x.ymd)(h))return;const e=(0,D.needsPatch)(te),s=te.tableReq.find(e=>!re||ge.some(t=>t.table===e));f.repo.bookings.create({restaurantId:u,customerId:null,name:E.trim(),partySize:_,date:M,time:U,notes:Q.trim(),security:(0,i.depositDue)((0,i.depositOf)(c.settings),_)?'deposit':'none',depositPaid:0,...(0,i.depositDue)((0,i.depositOf)(c.settings),_)?{depositDue:(0,i.depositDue)((0,i.depositOf)(c.settings),_),depositPolicy:(0,i.depositWords)((0,i.depositOf)(c.settings),_,c.name).join(' '),depositRefundable:(0,i.depositOf)(c.settings).refundable,depositCutoffHours:(0,i.depositOf)(c.settings).cutoffHours}:{},phone:me.pretty,email:X.trim()||void 0,source:Z,...e,...pe.find(e=>e.time===U)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...re?{table:le??s??ge[0]?.table}:{}}).then(e=>(0,$.postNewBookingToKitchen)(e,O)).catch(()=>{}),d?.({date:M,time:U,name:E.trim()}),t()}})]})}},1113,[827,1114,1115,860,867,14,1116,34,859,402,102,872,1079,874,1117,1095,858,821,864,794,1021,1018,1118,1119,1124,1097,1091,1125,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return O}}),_e.useTableNames=N,_e.resetTableLive=M,_e.seatBookingNow=L,_e.finishBookingNow=async function(e,t){await f.repo.bookings.setStatus(t.id,'finished'),(0,S.tablesOf)(t.table).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=F,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return R}}),_e.TablePicker=W,_e.WalkInSheet=E,_e.WalkInMatchPrompt=H,_e.AssignTableSheet=_,_e.undoNotice=Y,_e.NewBookingSheet=U,_e.useFrontDoor=function(e,t){const[s,o]=(0,r.useState)(!1),[l,a]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>d({b:e}),combineTables:e=>d({b:e,combine:!0}),elements:(0,B.jsxs)(B.Fragment,{children:[s?(0,B.jsx)(E,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,B.jsx)(U,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,n.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,x.niceDate)((0,x.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,B.jsx)(_,{booking:i.b,combine:i.combine,onClose:()=>d(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=e(r),u=_r(_d[8]),c=e(_r(_d[9])),b=e(_r(_d[10])),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),w=_r(_d[18]),T=_r(_d[19]),S=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),D=_r(_d[23]),I=_r(_d[24]),$=_r(_d[25]),P=_r(_d[26]),z=_r(_d[27]),B=_r(_d[28]);const O=Array.from({length:12},(e,t)=>String(t+1));function N(e){const t=(0,S.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function M(e,t){(0,S.tablesOf)(t).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}async function L(e,t){await f.repo.bookings.setStatus(t.id,'seated'),M(e,t.table)}function F(e,t){const s=(0,f.useBookings)(e),o=(0,f.useOrders)(e),l=N(e),a=(0,S.useFloor)(t=>t.live[e])??{},i=(0,S.usePlan)(e),n=(0,v.useBlocks)(e=>e.blocks),r=(0,x.ymd)(t),d=(0,v.closedAreasAt)(n,e,r,(0,x.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,S.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,x.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const R=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function W({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:d}){const u=Object.keys(e),[h,p]=(0,r.useState)(0),f=i?6:8,y=i?64:o?92:76,k=h?Math.max(3,Math.floor((h+f)/(y+f))):0,x=k?Math.floor((h-f*(k-1))/k):y,w=new Set(n??[]),v=a?(0,S.tablesOf)(a)[0]:null;return(0,B.jsx)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:f},testID:"table-picker",onLayout:e=>p(Math.floor(e.nativeEvent.layout.width)),children:u.map(o=>{const a=e[o],n=t===o||!!d?.includes(o),r=w.has(o),u=v===o&&!n,h=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,B.jsxs)(c.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${d?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${r?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:x,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?j.colours.gold:a.busy?j.colours.red:j.colours.ok,backgroundColor:n?j.colours.goldTint:a.busy?j.colours.redBg:j.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,B.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,B.jsx)(T.T,{weight:"bold",size:22,colour:n?j.colours.goldLight:j.colours.text,children:(0,l.tableNumbers)(o)}),r?(0,B.jsx)(b.default,{testID:"best-table",style:{backgroundColor:j.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,B.jsx)(T.T,{size:11,weight:"bold",colour:j.colours.onGold,children:"BEST"})}):null]}),(0,B.jsx)(T.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:h})]},o)})})}const A=[1,2,3,4,5,6,7,8];function E({onClose:e,onSeated:a,wide:i,initialTable:y}){const{rid:w,r:C,now:D}=(0,p.useCtx)(15e3),I=F(w,D),[$,P]=(0,r.useState)(2),[O,N]=(0,r.useState)(!1),[R,E]=(0,r.useState)(y??null),_=(0,S.usePlan)(w),Y=(0,f.useBookings)(w),U=(0,v.useBlocks)(e=>e.blocks),q=(0,v.closedAreasAt)(U,w,(0,x.ymd)(D),(0,x.hm)(D)),Q=d.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(_,Y.filter(e=>e.date===(0,x.ymd)(D)),e,$,D,(0,k.turnFor)($,C.settings.turnMins),90,void 0,{closed:q})?.table??null},[_,Y,I,$,q.size,D.getTime()]);(0,r.useEffect)(()=>{R&&(0,S.tablesOf)(R).some(e=>'Closed'===I[e]?.label)&&E(null)},[R,q.size]);const[V,G]=(0,r.useState)(!1),[K,X]=(0,r.useState)(''),J=(e,t=String(e),s=()=>{N(!1),P(e)})=>{const o='9+'===t?O:!O&&$===e;return(0,B.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?j.colours.gold:'transparent'},children:(0,B.jsx)(T.T,{weight:"bold",size:22,colour:o?j.colours.onGold:j.colours.gold,children:t})},t)},Z=(0,B.jsx)(s.PartySizeInput,{value:$,onChange:P,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),ee=(0,B.jsxs)(b.default,{style:{gap:8,width:i?256:void 0},children:[(0,B.jsx)(T.T,{weight:"semibold",children:"How many people?"}),(0,B.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[A.map(e=>J(e)),J(9,'9+',()=>{N(!0),P(e=>e>=9?e:9)})]}),O?Z:null]}),[te,se]=(0,r.useState)(!1),[oe,le]=(0,r.useState)(null),ae=async(t=R,s=!1)=>{if(!te){if(!s){const e=(0,z.bookingsNearWalkIn)(Y,D,$);if(e.length)return void le({at:t,list:e})}se(!0);try{const s=await f.repo.bookings.seatWalkIn(w,$,t??void 0,K);M(w,t??void 0),a(s),e()}finally{se(!1)}}},ie=async(t,s)=>{if(!te){se(!0);try{const o=s??t.table??null;o&&o!==t.table&&await f.repo.bookings.assignTable(t.id,o),await L(w,{...t,table:o??void 0}),(0,n.notify)({id:`seated:${t.id}`,testID:'walkin-match-toast',timeoutMs:5e3,icon:'\u2713',title:`${t.name} seated \xb7 ${t.partySize} \xb7 ${o?(0,l.tableNumbers)(o):'table to assign'} (booking ${t.ref})`}),le(null),e()}finally{se(!1)}}},ne=(0,B.jsxs)(b.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,B.jsxs)(T.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(T.T,{weight:"semibold",children:["Table ",(0,B.jsx)(T.T,{colour:j.colours.muted,size:14,children:"(optional)"})]}),R?(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>E(null)}):null]}),(0,B.jsx)(W,{use:I,value:R,onPick:e=>{I[e]&&!I[e].busy?ae(e):E(R===e?null:e)},big:i,dense:i,best:Q,bestSet:(0,u.bestTables)(_)}),(0,B.jsxs)(T.Muted,{children:["Tap a free table to seat them there",Q&&!R?` (suggested for ${$}: ${(0,l.tableNumbers)(Q)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,x.hm)(D)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,B.jsx)(T.Button,{label:`Seat walk-in \xb7 ${$} ${1===$?'person':'people'}${R?` \xb7 ${(0,l.tableNumbers)(R)}`:''}`,disabled:te,onPress:()=>{ae()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,B.jsxs)(T.Row,{gap:16,style:{alignItems:'flex-start'},children:[ee,ne]}):(0,B.jsxs)(B.Fragment,{children:[ee,ne]}),(0,B.jsxs)(T.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[V?(0,B.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:K,onChangeText:X,style:[T.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>G(!0)}),(0,B.jsx)(b.default,{style:{flex:1,minWidth:220},children:(0,B.jsxs)(T.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==h.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]}),oe?(0,B.jsx)(H,{list:oe.list,busy:te,onYes:e=>{ie(e,oe.at)},onNo:()=>{const e=oe.at;le(null),ae(e,!0)},onClose:()=>le(null)}):null]})}function H({list:e,busy:t,onYes:s,onNo:o,onClose:a}){return(0,B.jsx)(T.Sheet,{visible:!0,onClose:a,title:"Booked party?",maxWidth:720,testID:"walkin-match",children:(0,B.jsxs)(b.default,{style:{gap:14},children:[e.map((e,o)=>(0,B.jsxs)(b.default,{testID:`walkin-match-${o}`,style:{gap:12,padding:16,borderRadius:16,borderWidth:2,borderColor:j.colours.gold,backgroundColor:'#15130F'},children:[(0,B.jsx)(b.default,{accessibilityRole:"header",accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:26,weight:"bold",colour:j.colours.goldLight,testID:"walkin-match-question",children:(0,z.walkInMatchQuestion)(e)})}),e.table?(0,B.jsxs)(T.T,{size:17,colour:j.colours.text,children:["Booked table ",(0,l.tableNumbers)(e.table)," \xb7 ",e.ref]}):(0,B.jsx)(T.T,{size:17,colour:j.colours.text,children:e.ref}),(0,B.jsx)(T.Button,{label:"Yes, seat booking",testID:"walkin-match-yes",disabled:t,accessibilityLabel:`Yes, seat ${e.name}'s booking, ${e.partySize} people`,onPress:()=>s(e),style:{minHeight:64}})]},e.id)),(0,B.jsx)(T.Button,{kind:"secondary",label:"No, new walk-in",testID:"walkin-match-no",disabled:t,onPress:o,style:{minHeight:64}})]})})}function _({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,p.useCtx)(15e3),n=F(o,i),c=(0,S.usePlan)(o),h=(0,f.useBookings)(o),y=(0,S.tablesOf)(e.table),w=d.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,y.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),v=d.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(w).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(c,h.filter(e=>e.date===(0,x.ymd)(i)),t,e.partySize,i,(0,k.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[c,h,w,e.partySize,i.getTime()]),[C,D]=(0,r.useState)(!!s||y.length>1),[I,$]=(0,r.useState)(y),P=e=>c.tables.find(t=>t.name===e)?.maxSeats??0,z=I.reduce((e,t)=>e+P(t),0),O=I.length>0&&z{const l=(0,S.joinTables)(s);await f.repo.bookings.assignTable(e.id,l);y.filter(e=>!s.includes(e)).forEach(t=>S.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&M(o,l),t()},L=C?(0,B.jsxs)(b.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,B.jsx)(b.default,{accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:17,weight:"semibold",colour:j.colours.text,children:I.length?`${(0,S.tablesLabel)((0,S.joinTables)(I))} \xb7 ${z} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,B.jsx)(b.default,{testID:"combine-short",children:(0,B.jsxs)(T.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-z," more needed. Add another table."]})}):null,(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,B.jsxs)(T.Row,{gap:8,wrap:!0,children:[(0,B.jsx)(T.Button,{label:"Done",testID:"combine-done",disabled:!I.length,accessibilityLabel:I.length?`Done, save ${(0,S.tableCardLabel)((0,S.joinTables)(I))}`:'Done',onPress:()=>N(I)}),(0,B.jsx)(T.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,B.jsx)(b.default,{style:{gap:8},testID:"assign-table-tip",children:(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`${C?'Combine tables':'Assign table'} \xb7 ${R(e)}`,testID:"assign-table-sheet",footer:L,children:[v&&!C?(0,B.jsx)(b.default,{testID:"assign-suggested",children:(0,B.jsxs)(T.T,{size:16,weight:"semibold",colour:j.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,S.tableCardLabel)(v)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(v)]})}):null,C?null:(0,B.jsx)(T.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>D(!0)}),(0,B.jsx)(W,{use:w,best:C?null:v,bestSet:(0,u.bestTables)(c),picked:C?I:void 0,onPick:C?e=>$(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await N([e])}})]})}function Y(e){(0,n.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${R(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>f.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function U({date:e,onClose:t,wide:n,onSaved:d}){const{rid:u,r:c,now:h,role:z,meId:O}=(0,p.useCtx)(6e4),N=(0,x.ymd)(h),[M,L]=(0,r.useState)(ee.blocks),[W,A]=(0,r.useState)(!1),[E,H]=(0,r.useState)(''),[_,Y]=(0,r.useState)(2),[U,q]=(0,r.useState)(null),[Q,V]=(0,r.useState)(''),[G,K]=(0,r.useState)(''),[X,J]=(0,r.useState)(''),[Z,ee]=(0,r.useState)('phone'),[te,se]=(0,r.useState)((0,D.emptyNeeds)()),oe=(0,D.needsMissing)(te),[le,ae]=(0,r.useState)(null),ie=(0,S.usePlan)(u),ne=(0,P.dogSetUp)(ie),re=!0===te.dog&&ne,de=te.dog?te.dogs:0,ue=(0,x.parseYmd)(M),ce=(0,k.turnFor)(_,c.settings.turnMins),be=F.filter(e=>e.date===M),he=e=>(0,k.freeTablesAt)(ie,be,_,new Date(`${M}${(0,l.tableNumbers)(e)}:00`),ce,c.settings.turnMins,{dog:!0,closed:(0,v.closedAreasAt)(R,u,M,e)}),ge=re&&U?he(U):[];(0,r.useEffect)(()=>{ae(null)},[re,U,_]);const pe=(0,y.bookingSlots)(c,ue,e=>F.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),_,M===(0,x.ymd)(h)?h:(0,x.addMins)(ue,0),e=>F.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),me=(0,w.ukPhone)(G),[fe,ye]=(0,r.useState)(!1),ke=U?pe.find(e=>e.time===U):void 0,xe=ke&&ke.left<_?{left:Math.max(0,ke.left),time:ke.time}:null,je=ke&&null!=ke.partiesLeft&&ke.partiesLeft<1?{time:ke.time,cap:ke.partiesCap??0}:null,we=xe||je,Te=U?(0,v.blockAt)(R,u,M,U):void 0,Se='staff'!==z,ve=!!U&&!(0,D.dogTimeOk)(c,F,M,U,de),Ce=!oe.length&&E.trim().length>=2&&!!U&&(!we||fe)&&(0,o.validParty)(_)&&me.ok&&(0,w.emailOk)(X)&&(!Te||Se&&W)&&(!re||ge.length>0)&&!ve,De=te.wheelchair>0||te.stepFree;return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,x.niceDate)(ue)}`,maxWidth:n?760:void 0,testID:"booking-sheet",children:[(0,B.jsx)(D.FirstQuestions,{rid:u,value:te,onChange:se,party:_,audience:"staff"}),te.dog&&!ne?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,B.jsx)(C.BookingDatePicker,{r:c,today:h,value:M,onChange:e=>{e!==M&&(L(e),q(null),A(!1))}}),(0,B.jsxs)(T.Row,{gap:6,children:[(0,B.jsx)(T.Chip,{label:"Phone",selected:'phone'===Z,onPress:()=>ee('phone')}),(0,B.jsx)(T.Chip,{label:"In person",selected:'in-person'===Z,onPress:()=>ee('in-person')})]}),(0,B.jsx)(T.Field,{label:"Name",value:E,onChangeText:H,placeholder:"e.g. Reid",testID:"nb-name"}),(0,B.jsx)(T.Field,{label:"Mobile or phone number (needed)",value:G,onChangeText:K,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!me.ok&&G?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:me.error}):null,(0,B.jsx)(T.Field,{label:"Email (optional)",value:X,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,w.emailOk)(X)?null:(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,B.jsxs)(b.default,{style:{gap:6,alignItems:'center'},children:[(0,B.jsx)(T.T,{center:!0,children:"Covers"}),(0,B.jsx)(s.PartySizeInput,{value:_,onChange:e=>{Y(e),ye(!1)},label:"Covers",testID:"nb-party"})]}),(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:pe.map(e=>{const t=re&&e.available&&!he(e.time).length||!(0,D.dogTimeOk)(c,F,M,e.time,de);return(0,B.jsx)(T.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,v.blockAt)(R,u,M,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:U===e.time,onPress:()=>{q(e.time),A(!1),ye(!1)}},e.time)})}),we?(0,B.jsxs)(b.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[xe?(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overCapacityNote)(_,xe.left,xe.time)}):null,je?(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overPartiesNote)(je.time,je.cap)}):null,(0,B.jsx)(T.Chip,{label:fe?'Booking over the limit: on':'Book anyway (over the limit)',selected:fe,onPress:()=>ye(e=>!e),testID:"nb-over-ok"})]}):null,re&&U?(0,B.jsxs)(b.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,B.jsxs)(T.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,B.jsxs)(T.T,{size:13,colour:j.colours.muted,children:["(",ie.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),ge.length?(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:ge.slice(0,10).map((e,t)=>(0,B.jsx)(T.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${De&&(0,P.accessibleSetUp)(ie)&&!(0,P.isAccessible)(ie,e.table)?' \xb7 not step-free':''}`,selected:(le??ge[0].table)===e.table,onPress:()=>ae(e.table)},e.table))}):(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["No dog-friendly table free for ",_," at ",U,". Try another time."]})]}):null,Te?(0,B.jsxs)(b.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsxs)(T.T,{weight:"semibold",colour:j.colours.amber,children:["Bookings are paused ",Te.from,"\u2013",Te.to,Te.reason?` (${Te.reason})`:'']}),Se?(0,B.jsx)(T.Chip,{label:W?'Manager override on':'Override and book anyway',selected:W,onPress:()=>A(e=>!e)}):(0,B.jsx)(T.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,pe.length?null:(0,B.jsx)(b.default,{testID:"nb-closed",children:(0,B.jsxs)(T.T,{size:14,weight:"semibold",colour:j.colours.amber,children:["Closed on ",(0,x.niceDate)(ue)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,B.jsx)(D.MoreQuestions,{rid:u,r:c,value:te,onChange:se,party:_,date:M,time:U,today:(0,x.ymd)(h),bookings:F,audience:"staff",showTables:!1!==c.settings.tableRequests}),De&&!(0,P.accessibleSetUp)(ie)?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,B.jsx)(T.Field,{label:"Notes (optional)",value:Q,onChangeText:V,placeholder:I.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(c.settings),_)?(0,B.jsxs)(T.Muted,{children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(c.settings),_))," (",(0,a.gbp)((0,i.depositOf)(c.settings).perPersonPence)," per person for ",(0,i.depositOf)(c.settings).fromParty,"+). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,B.jsxs)(T.Muted,{children:["The guest gets a confirmation text",X.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),ve?(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["We already have the most dogs we can look after at ",U,". Try another time: dogs are very welcome then."]}):null,(0,B.jsx)(T.Button,{label:oe.length?oe[0]:'Save booking',testID:"nb-save",disabled:!Ce,onPress:()=>{if(M<(0,x.ymd)(h))return;const e=(0,D.needsPatch)(te),s=te.tableReq.find(e=>!re||ge.some(t=>t.table===e));f.repo.bookings.create({restaurantId:u,customerId:null,name:E.trim(),partySize:_,date:M,time:U,notes:Q.trim(),security:(0,i.depositDue)((0,i.depositOf)(c.settings),_)?'deposit':'none',depositPaid:0,...(0,i.depositDue)((0,i.depositOf)(c.settings),_)?{depositDue:(0,i.depositDue)((0,i.depositOf)(c.settings),_),depositPolicy:(0,i.depositWords)((0,i.depositOf)(c.settings),_,c.name).join(' '),depositRefundable:(0,i.depositOf)(c.settings).refundable,depositCutoffHours:(0,i.depositOf)(c.settings).cutoffHours}:{},phone:me.pretty,email:X.trim()||void 0,source:Z,...e,...pe.find(e=>e.time===U)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...re?{table:le??s??ge[0]?.table}:{}}).then(e=>(0,$.postNewBookingToKitchen)(e,O)).catch(()=>{}),d?.({date:M,time:U,name:E.trim()}),t()}})]})}},1113,[827,1114,1115,860,867,14,1116,34,859,402,102,872,1079,874,1117,1095,858,821,864,794,1021,1018,1118,1119,1124,1097,1091,1125,25]); __d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PartySizeInput=function({value:e,onChange:p,min:b=s.MIN_PARTY,max:y=s.MAX_PARTY,label:f="Party size",testID:h="party-size"}){const[x,$]=(0,t.useState)(String(e));(0,t.useEffect)(()=>{$(String(e))},[e]);const w=e=>p((0,s.clampParty)(e,b,y)),I=(t,n,l)=>{const s=t<0?e<=b:e>=y;return(0,d.jsx)(o.default,{testID:`${h}-${t>0?'up':'down'}${10===Math.abs(t)?'10':''}`,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:s},disabled:s,onPress:()=>w(e+t),hitSlop:4,style:{minWidth:44,height:44,paddingHorizontal:8,borderRadius:22,borderWidth:1.5,borderColor:c.colours.gold,alignItems:'center',justifyContent:'center',opacity:s?.4:1},children:(0,d.jsx)(u.T,{size:10===Math.abs(t)?14:20,weight:"semibold",colour:c.colours.gold,center:!0,children:n})},t)};return(0,d.jsxs)(l.default,{testID:h,style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap',justifyContent:'center'},children:[y-b>=20?I(-10,'\u221210',"10 fewer people"):null,I(-1,'\u2212','One fewer person'),(0,d.jsx)(n.default,{testID:`${h}-input`,value:x,keyboardType:"number-pad",inputMode:"numeric",maxLength:3,selectTextOnFocus:!0,accessibilityLabel:`${f}, ${b} to ${y} people`,accessibilityValue:{min:b,max:y,now:e,text:`${e} ${1===e?'person':'people'}`},onChangeText:e=>{$(e.replace(/\D/g,'')),e.replace(/\D/g,'')&&w((0,s.partyFromText)(e,b,y))},onBlur:()=>{const e=(0,s.partyFromText)(x,b,y);$(String(e)),w(e)},style:{width:64,height:44,borderRadius:10,borderWidth:1,borderColor:c.colours.border,color:c.colours.text,backgroundColor:c.colours.surface,textAlign:'center',fontSize:20,fontFamily:c.fonts.semibold}}),I(1,'+','One more person'),y-b>=20?I(10,'+10',"10 more people"):null]})};var t=r(_d[0]),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),s=r(_d[4]),c=r(_d[5]),u=r(_d[6]),d=r(_d[7])},1114,[34,402,412,102,1115,821,794,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const f=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(f)?f:u))},f=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),b=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`},1115,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overPartiesNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const s=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(s)?s:u))},s=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),f=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`,b=(t,n)=>`${t} already has the most bookings we take at one start time (${n}). Booking another goes over the venue\u2019s limit: check tables and staffing.`},1115,[]); __d(function(g,r,i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"dismissNotice",{enumerable:!0,get:function(){return u.dismissNotice}}),Object.defineProperty(_e,"notify",{enumerable:!0,get:function(){return u.notify}}),Object.defineProperty(_e,"useSliders",{enumerable:!0,get:function(){return u.useSliders}}),Object.defineProperty(_e,"SLIDER",{enumerable:!0,get:function(){return j}}),_e.SliderButton=k,_e.SliderCard=C,_e.SliderHost=function(){y();const e=(0,u.useSliders)(e=>e.queue),n=e[0],o=(0,t.useRef)(null);(0,t.useEffect)(()=>{if(p)return window.ccSlider=e=>(0,u.notify)(e),()=>{delete window.ccSlider}},[]),(0,t.useEffect)(()=>{if(o.current&&clearTimeout(o.current),!n)return;const e=void 0!==n.timeoutMs?n.timeoutMs:n.actions?.length||n.content?null:6e3;return e&&(o.current=setTimeout(()=>u.useSliders.getState().dismiss(n.id),e)),()=>{o.current&&clearTimeout(o.current)}},[n?.id,n?.timeoutMs]);const[l,c]=(0,t.useState)(0);if((0,t.useEffect)(()=>{if(!p||!n)return;const e=()=>{const e=document.querySelector('[data-testid="app-bottom-tabs"]');c(e?Math.max(0,Math.round(window.innerHeight-e.getBoundingClientRect().top)):0)};e();const t=setTimeout(e,300);return window.addEventListener('resize',e),()=>{clearTimeout(t),window.removeEventListener('resize',e)}},[n?.id]),!n)return null;const a=p?'fixed':'absolute';return(0,f.jsxs)(f.Fragment,{children:[n.modal?(0,f.jsx)(s.default,{...x('dim'),style:{position:a,left:0,right:0,top:0,bottom:0,zIndex:2147482990,backgroundColor:'rgba(0,0,0,0.72)'}}):null,(0,f.jsx)(s.default,{testID:"cc-slider-host",pointerEvents:"box-none",style:{position:a,left:12,right:12,bottom:12,zIndex:2147483e3,alignItems:'center',...p?{bottom:l?`${12+l}px`:'calc(12px + env(safe-area-inset-bottom))'}:{}},children:(0,f.jsx)(C,{n:n,waiting:e.length-1,onClose:()=>u.useSliders.getState().dismiss(n.id)},n.id+':'+(n.seq??0))})]})};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),s=e(r(d[4])),l=e(r(d[5])),c=r(d[6]),a=r(d[7]),u=r(d[8]),b=r(d[9]),f=r(d[10]);const p='undefined'!=typeof document,h="\n[data-ccsl=\"in\"]{animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both}\n@keyframes ccsl-in{from{opacity:0;transform:translate3d(0,110%,0)}to{opacity:1;transform:none}}\n[data-ccsl=\"urgent\"]{animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both,ccsl-red 1.6s ease-in-out .45s infinite}\n@keyframes ccsl-red{0%,100%{box-shadow:0 10px 30px rgba(0,0,0,.6),0 0 0 1px rgba(255,107,94,.55)}50%{box-shadow:0 10px 40px rgba(0,0,0,.6),0 0 0 2px #FF6B5E,0 0 34px rgba(255,107,94,.45)}}\n[data-ccsl=\"dim\"]{animation:ccsl-dim .3s ease both}\n@keyframes ccsl-dim{from{opacity:0}to{opacity:1}}\n@media (prefers-reduced-motion: reduce){[data-ccsl]{animation:none !important}}\n",x=e=>p?{dataSet:{ccsl:e}}:{};function y(){(0,t.useEffect)(()=>{if(!p||document.getElementById('cc-slider-css'))return;const e=document.createElement('style');e.id='cc-slider-css',e.textContent=h,document.head.appendChild(e)},[])}const j={bg:'#17140F',border:'rgba(207,164,95,.55)',text:'#F5F1E8',quiet:'#A89A80',gold:c.colours.gold,ink:'#17130D'},w=(e="normal")=>'urgent'===e?c.colours.red:'warn'===e?c.colours.amber:c.colours.gold,S=(e="normal")=>'urgent'===e?'rgba(255,107,94,.75)':'warn'===e?'rgba(255,181,71,.65)':j.border;function k({a:e,onDone:t,big:o}){const s=e.kind??'primary';return(0,f.jsx)(n.default,{testID:e.testID,accessibilityRole:"button",accessibilityLabel:e.label,onPress:()=>{try{e.onPress?.()}finally{e.keepOpen||t()}},style:({pressed:e})=>({minHeight:o?56:44,minWidth:44,paddingHorizontal:'ghost'===s?10:o?24:18,borderRadius:12,alignItems:'center',justifyContent:'center',backgroundColor:'primary'===s?j.gold:'transparent',borderWidth:'danger'===s?1:0,borderColor:c.colours.red,opacity:e?.8:1}),children:(0,f.jsx)(a.T,{size:o?18:'ghost'===s?14:15,weight:'primary'===s?'bold':'medium',colour:'primary'===s?j.ink:'danger'===s?c.colours.red:j.quiet,children:e.label})})}function C({n:e,onClose:t,waiting:n=0,maxWidth:c=520}){y();const u=e.tone??'normal',h=w(u),C=e.content,z=!!e.big,{height:I}=(0,l.default)(),D=e.actions??[];return(0,f.jsxs)(s.default,{testID:e.testID??'cc-slider',accessibilityRole:"summary",accessibilityLabel:`${e.kicker?e.kicker+': ':''}${e.title}`,...x('urgent'===u?'urgent':'in'),style:{width:'100%',maxWidth:z?Math.max(c,900):c,alignSelf:'center',borderRadius:14,backgroundColor:j.bg,borderWidth:1,borderColor:S(u),overflow:'hidden',...p?{boxShadow:'0 10px 30px rgba(0,0,0,.6)'}:{elevation:12}},children:['normal'!==u?(0,f.jsx)(s.default,{style:{position:'absolute',left:0,top:0,bottom:0,width:5,backgroundColor:h}}):null,(0,f.jsxs)(o.default,{style:{maxHeight:Math.max(220,I-40)},contentContainerStyle:{paddingVertical:z?18:12,paddingLeft:'normal'!==u?z?24:18:z?20:14,paddingRight:z?20:14,gap:z?10:6},children:[(0,f.jsxs)(s.default,{style:{flexDirection:'row',alignItems:'center',gap:12},children:[e.icon?(0,f.jsx)(a.T,{size:z?34:22,children:e.icon}):null,(0,f.jsxs)(s.default,{style:{flex:1,gap:2},children:[e.kicker?(0,f.jsx)(a.T,{size:z?15:11,weight:"bold",colour:h,style:{letterSpacing:1.4},children:e.kicker}):null,(0,f.jsx)(a.T,{size:z?24:15,weight:"medium",colour:j.text,children:e.title}),e.body?(0,f.jsx)(a.T,{size:z?18:13,colour:j.quiet,children:e.body}):null]}),D.length||C?null:(0,f.jsx)(b.ToastClose,{testID:"cc-slider-ok",label:`Close: ${e.title}`,onPress:t,size:z?'lg':'md',colour:j.quiet})]}),C?(0,f.jsx)(C,{close:t}):null,D.length?(0,f.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',alignItems:'center',gap:8,justifyContent:'flex-end'},children:D.map(e=>(0,f.jsx)(k,{a:e,onDone:t,big:z},e.label))}):null,n>0?(0,f.jsxs)(a.T,{size:z?14:11,colour:j.quiet,center:!0,style:{alignSelf:'stretch'},children:[n," more waiting"]}):null]})]})}},1116,[34,236,402,295,102,426,821,794,998,796,25]); -__d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.bookingSlotMinutesOf=s,Object.defineProperty(e,"COVERS_WINDOW_MINS",{enumerable:!0,get:function(){return r}}),e.coversInHalfHour=l,e.takeawaySlots=function(o,s,r){const l=(0,t.hoursFor)(o,r);if(!l)return[];const u=o.settings.slotMinutes,c=(0,n.addMins)(r,o.settings.leadMins),f=[];for(let t=new Date(l.open);t<=l.close;t=(0,n.addMins)(t,u)){if(tn.restaurantId===o.id&&'takeaway'===n.type&&'cancelled'!==n.status&&n.slotTime&&new Date(n.slotTime).getTime()===t.getTime()).length;f.push({time:new Date(t),label:(0,n.hm)(t),taken:r,cap:o.settings.slotCap,full:r>=o.settings.slotCap})}return f},e.bookingSlots=function(r,c,f,d,m){const p=(0,t.hoursFor)(r,c);if(!p)return[];const M=[],S=p.close,b=(0,o.lastFoodOn)(r,u(c)),h=b?(0,n.atTime)(c,b.time):S,k='drinks'===(0,o.afterLastFood)(r),O=s(r);for(let t=new Date(p.open);t<=S;t=(0,n.addMins)(t,O)){const o=(0,n.hm)(t),s=t>h;if(s&&!k)continue;const u=r.settings.bookingCoversPerSlot-l(f,o),c=t.getTime()=d,past:c,...s?{drinksOnly:!0}:{}})}return M};var t=_r(_d[0]),n=_r(_d[1]),o=_r(_d[2]);function s(t){const n=t.settings.bookingSlotMinutes;return 5===n||10===n||15===n||20===n||30===n?n:15}const r=30;function l(t,o){const s=Math.floor((0,n.toMins)(o)/r)*r;let l=0;for(let o=0;o`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},1117,[878,858,877]); +__d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.bookingSlotMinutesOf=s,e.bookingNoticeMinsOf=r,e.bookingCoversPerStartOf=u,e.bookingPartiesPerStartOf=l,e.onlinePartyBounds=c,Object.defineProperty(e,"COVERS_WINDOW_MINS",{enumerable:!0,get:function(){return f}}),e.coversInHalfHour=m,e.countInStartSlot=p,e.bookingLimitsHint=function(t){const n=s(t),o=u(t),f=l(t),m=r(t),p=c(t);if(null!=o||null!=f){const t=[];return null!=o&&null!=f?t.push(`up to ${o} people and ${f} bookings at each start time`):null!=o?t.push(`up to ${o} people at each start time`):t.push(`up to ${f} bookings at each start time`),(p.max<100||p.min>1)&&t.push(`parties of ${p.min} to ${p.max}`),t.push(`from ${m} minutes ahead`),t.push('table rules still apply'),`Times are every ${n} minutes: ${t.join(', ')}.`}return`Times are every ${n} minutes. Covers per slot (${t.settings.bookingCoversPerSlot} per half hour) and table rules still apply.`},e.takeawaySlots=function(o,s,r){const u=(0,t.hoursFor)(o,r);if(!u)return[];const l=o.settings.slotMinutes,c=(0,n.addMins)(r,o.settings.leadMins),f=[];for(let t=new Date(u.open);t<=u.close;t=(0,n.addMins)(t,l)){if(tn.restaurantId===o.id&&'takeaway'===n.type&&'cancelled'!==n.status&&n.slotTime&&new Date(n.slotTime).getTime()===t.getTime()).length;f.push({time:new Date(t),label:(0,n.hm)(t),taken:r,cap:o.settings.slotCap,full:r>=o.settings.slotCap})}return f},e.bookingSlots=function(c,f,d,h,k,M=()=>0){const y=(0,t.hoursFor)(c,f);if(!y)return[];const S=[],$=y.close,P=(0,o.lastFoodOn)(c,b(f)),v=P?(0,n.atTime)(f,P.time):$,I='drinks'===(0,o.afterLastFood)(c),O=s(c),C=r(c),N=u(c),T=l(c);for(let t=new Date(y.open);t<=$;t=(0,n.addMins)(t,O)){const o=(0,n.hm)(t),s=t>v;if(s&&!I)continue;const r=null!=N?p(d,o,O):m(d,o),u=(N??c.settings.bookingCoversPerSlot)-r,l=null!=T?p(M,o,O):0,f=null!=T?T-l:void 0,b=t.getTime()=1;S.push({time:o,left:u,available:!b&&u>=h&&y,past:b,...s?{drinksOnly:!0}:{},...null!=f?{partiesLeft:f,partiesCap:T}:{}})}return S};var t=_r(_d[0]),n=_r(_d[1]),o=_r(_d[2]);function s(t){const n=t.settings.bookingSlotMinutes;return 5===n||10===n||15===n||20===n||30===n?n:15}function r(t){const n=t.settings.bookingNoticeMins;return'number'==typeof n&&Number.isInteger(n)&&n>=0&&n<=1440?n:30}function u(t){const n=t.settings.bookingCoversPerStart;return'number'==typeof n&&Number.isInteger(n)&&n>0&&n<=200?n:null}function l(t){const n=t.settings.bookingPartiesPerStart;return'number'==typeof n&&Number.isInteger(n)&&n>0&&n<=50?n:null}function c(t){const n=t.settings.onlinePartyMin,o=t.settings.onlinePartyMax,s='number'==typeof n&&Number.isInteger(n)&&n>=1&&n<=100?n:1;return{min:s,max:'number'==typeof o&&Number.isInteger(o)&&o>=s&&o<=100?o:100}}const f=30;function m(t,o){const s=Math.floor((0,n.toMins)(o)/f)*f;let r=0;for(let o=0;o`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},1117,[878,858,877]); __d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.nextDays=c,Object.defineProperty(_e,"openOn",{enumerable:!0,get:function(){return u}}),_e.BookingDatePicker=function({r:e,today:l,value:b,onChange:m}){const[f,x]=(0,t.useState)(!1),p=(0,r.ymd)(l),j=c(l,9),D=(e,t)=>0===t?'Today':1===t?'Tomorrow':`${(0,r.dayShort)(e)} ${e.getDate()}`,w=j.some(e=>(0,r.ymd)(e)===b),C=(0,r.parseYmd)(b),[P,T]=(0,t.useState)(()=>({y:C.getFullYear(),m:C.getMonth()})),v=(new Date(P.y,P.m,1,12).getDay()+6)%7,M=new Date(P.y,P.m+1,0).getDate(),R=[...Array.from({length:v},()=>null),...Array.from({length:M},(e,t)=>new Date(P.y,P.m,t+1,12))];for(;R.length%7;)R.push(null);const k=12*(P.y-l.getFullYear())+P.m-l.getMonth(),F=e=>T(({y:t,m:o})=>{const s=new Date(t,o+e,1);return{y:s.getFullYear(),m:s.getMonth()}});return(0,i.jsxs)(s.default,{testID:"nb-date",style:{gap:6},children:[(0,i.jsxs)(d.Row,{wrap:!0,gap:6,children:[j.map((t,o)=>(0,i.jsx)(d.Chip,{label:D(t,o),sub:u(e,t)?void 0:'Closed',selected:b===(0,r.ymd)(t),onPress:()=>{m((0,r.ymd)(t)),x(!1)}},(0,r.ymd)(t))),w?null:(0,i.jsx)(d.Chip,{label:(0,r.niceDate)(C),sub:u(e,C)?void 0:'Closed',selected:!0,onPress:()=>x(!0)}),(0,i.jsx)(d.Chip,{label:f?'Close calendar':'\ud83d\udcc5 Pick date',selected:f,onPress:()=>{f||T({y:C.getFullYear(),m:C.getMonth()}),x(!f)}})]}),f?(0,i.jsxs)(s.default,{testID:"nb-calendar",style:{borderWidth:1,borderColor:n.colours.border,borderRadius:14,padding:10,gap:6,backgroundColor:n.colours.surface2,maxWidth:420},children:[(0,i.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,i.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Previous month",disabled:k<=0,onPress:()=>F(-1),style:{padding:8,opacity:k<=0?.3:1},children:(0,i.jsx)(d.T,{size:20,colour:n.colours.gold,children:"\u2039"})}),(0,i.jsxs)(d.T,{weight:"semibold",children:[(0,r.monthLong)(P.m)," ",P.y]}),(0,i.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Next month",disabled:k>=h,onPress:()=>F(1),style:{padding:8,opacity:k>=h?.3:1},children:(0,i.jsx)(d.T,{size:20,colour:n.colours.gold,children:"\u203a"})})]}),(0,i.jsx)(s.default,{style:{flexDirection:'row'},children:y.map(e=>(0,i.jsx)(d.T,{size:12,colour:n.colours.muted,center:!0,style:{flex:1},children:e},e))}),Array.from({length:R.length/7},(t,l)=>(0,i.jsx)(s.default,{style:{flexDirection:'row',gap:4},children:R.slice(7*l,7*l+7).map((t,l)=>{if(!t)return(0,i.jsx)(s.default,{style:{flex:1,height:40}},l);const c=(0,r.ymd)(t),y=c{m(c),x(!1)},style:{flex:1,height:40,borderRadius:10,alignItems:'center',justifyContent:'center',borderWidth:c===p?1.5:0,borderColor:n.colours.gold,backgroundColor:h?n.colours.gold:'transparent',opacity:y?.3:1},children:(0,i.jsx)(d.T,{size:15,weight:h?'bold':'regular',colour:h?n.colours.onGold:f?n.colours.muted:n.colours.text,style:f&&!y?{textDecorationLine:'line-through'}:void 0,children:t.getDate()})},l)})},l)),(0,i.jsx)(d.Muted,{children:"Past dates can\u2019t be booked. Crossed-out days: closed (per the venue\u2019s hours)."})]}):null]})};var t=_r(_d[0]),o=e(_r(_d[1])),s=e(_r(_d[2])),l=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),d=_r(_d[6]),i=_r(_d[7]);function c(e,t){const o=new Date(e);return o.setHours(12,0,0,0),Array.from({length:t},(e,t)=>{const s=new Date(o);return s.setDate(o.getDate()+t),s})}const u=(e,t)=>!!(0,l.hoursFor)(e,t),y=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],h=12},1118,[34,402,102,878,858,821,794,25]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"emptyNeeds",{enumerable:!0,get:function(){return w}}),_e.needsMissing=function(e,l=[]){const s=[];null===e.allergy?s.push('Answer the allergy question first'):'yes'!==e.allergy||e.allergens.length||l.length||e.allergyNote.trim()||s.push('Pick the allergens or describe them');null===e.dog&&s.push('Say whether a dog is coming');return s},_e.needsPatch=function(e,l=[]){const s='yes'===e.allergy?e.allergens.filter(e=>!l.some(l=>l.allergen===e)).map(l=>({allergen:l,severity:e.severity})):[],t=Object.entries(e.holds).filter(([,e])=>e>0).map(([e,l])=>({kind:e.startsWith('item:')?'item':'stock',id:e.slice(5),qty:l})),a=e.dog?Math.max(1,e.dogs):0,n={...e.wheelchair?{wheelchair:e.wheelchair}:{},...e.stepFree?{stepFree:!0}:{},...e.toilet?{toilet:!0}:{},...e.assistDog?{assistDog:!0}:{},...e.accessNote.trim()?{note:e.accessNote.trim()}:{}},r={...e.vegan?{vegan:e.vegan}:{},...e.vegetarian?{vegetarian:e.vegetarian}:{}};return{allergies:[...l,...s],allergyNone:'none'===e.allergy&&!l.length||void 0,allergyPeople:'yes'===e.allergy?e.allergyPeople:void 0,allergyNote:'yes'===e.allergy&&e.allergyNote.trim()?e.allergyNote.trim():void 0,dog:a>0,dogs:a||void 0,access:Object.keys(n).length?n:void 0,diet:Object.keys(r).length?r:void 0,holds:t.length?t:void 0,tableReq:e.tableReq.length?e.tableReq:void 0}},_e.FirstQuestions=function({rid:e,value:l,onChange:a,party:r,audience:i,profile:o=[]}){const y=e=>a({...l,...e}),b=(0,p.usePlan)(e),[x,j]=(0,t.useState)(!1),k=(0,s.dogQuestionOn)((0,u.useRestaurant)(e));(0,t.useEffect)(()=>{k||null!==l.dog||a({...l,dog:!1})},[k,l.dog]);const w=x?m.ALLERGENS:m.ALLERGENS.filter(e=>['gluten','milk','peanuts','treenuts','crustaceans','molluscs','fish','eggs','sesame'].includes(e.id)||l.allergens.includes(e.id)),q=[...o.map(e=>e.allergen),...l.allergens],M=(0,f.dogSetUp)(b);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(R,{tone:"red",testID:"q-allergens",children:[(0,v.jsx)(C,{sub:'guest'===i?'We ask everyone first, so the kitchen can keep you safe.':'Ask every guest first. It goes to the kitchen in red.',children:"\u26a0\ufe0f Does anyone in the party have a food allergy?"}),o.length?(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:o.map(e=>(0,v.jsx)(h.Badge,{kind:"red",label:`${m.ALLERGENS.find(l=>l.id===e.allergen)?.short} (from your profile)`},e.allergen))}):null,(0,v.jsxs)(h.Row,{gap:8,children:[(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"No allergies",selected:'none'===l.allergy,onPress:()=>y({allergy:'none',allergens:[]})})}),(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"Yes, allergies",selected:'yes'===l.allergy,onPress:()=>y({allergy:'yes'})})})]}),'none'===l.allergy&&o.length?(0,v.jsx)(h.Muted,{children:"Your profile allergies above are still shared with the kitchen."}):null,'yes'===l.allergy?(0,v.jsxs)(n.default,{style:{gap:10},testID:"allergen-picker",children:[(0,v.jsx)(h.T,{size:14,weight:"semibold",children:"Which allergens? (the 14 UK allergens)"}),(0,v.jsxs)(h.Row,{wrap:!0,gap:6,children:[w.map(e=>(0,v.jsx)(h.Chip,{label:e.short,selected:l.allergens.includes(e.id)||o.some(l=>l.allergen===e.id),disabled:o.some(l=>l.allergen===e.id),onPress:()=>y({allergens:l.allergens.includes(e.id)?l.allergens.filter(l=>l!==e.id):[...l.allergens,e.id]})},e.id)),x?null:(0,v.jsx)(h.Chip,{label:"All 14\u2026",onPress:()=>j(!0)})]}),(0,v.jsx)(h.T,{size:14,weight:"semibold",children:"How serious?"}),(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:m.SEVERITIES.map(e=>(0,v.jsx)(h.Chip,{label:e.label,selected:l.severity===e.id,onPress:()=>y({severity:e.id})},e.id))}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"How many people with allergies?"}),(0,v.jsx)(h.Stepper,{value:Math.min(l.allergyPeople,r),onChange:e=>y({allergyPeople:e}),min:1,max:Math.max(1,r),label:"people with allergies"})]}),(0,v.jsx)(h.Field,{label:"Anything else the kitchen should know? (optional)",value:l.allergyNote,onChangeText:e=>y({allergyNote:e}),placeholder:"e.g. traces of sesame, one child with coeliac disease",testID:"allergy-note"}),q.length?(0,v.jsx)(c.MenuAllergyCheck,{rid:e,allergens:q,audience:i}):null]}):null]}),k?(0,v.jsxs)(R,{tone:"gold",testID:"q-dogs",children:[(0,v.jsx)(C,{sub:M?'Well-behaved dogs are welcome at our dog-friendly tables.':'staff'===i?'Dog-friendly tables aren\u2019t marked yet (Managers \u203a Booking options), so any table is offered for now.':void 0,children:"\ud83d\udc15 Are you bringing a dog?"}),(0,v.jsxs)(h.Row,{gap:8,children:[(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"No",selected:!1===l.dog,onPress:()=>y({dog:!1})})}),(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"Yes",selected:!0===l.dog,onPress:()=>y({dog:!0,dogs:Math.max(1,l.dogs)})})})]}),l.dog?(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"How many dogs?"}),(0,v.jsx)(h.Stepper,{value:l.dogs,onChange:e=>y({dogs:e}),min:1,max:4,label:"dogs"})]}):null]}):null]})},_e.useReserveAvailability=q,_e.MoreQuestions=function({rid:e,r:l,value:a,onChange:r,party:i,date:o,time:c,today:y,bookings:m,audience:b,showTables:x}){const j=e=>r({...a,...e}),w=l.settings,S=(0,u.useMenu)(e),P=(0,t.useMemo)(()=>S.filter(e=>/\((V|VG|Ve)\)|vegan|vegetarian/i.test(`${e.name} ${e.tags?.join(' ')??''}`)).slice(0,4),[S.length]),N=q(e,l,o,y,m,b),T=e=>a.holds[e]??0,D=(0,f.stockNeed)({holds:Object.entries(a.holds).map(([e,l])=>({kind:e.startsWith('item:')?'item':'stock',id:e.slice(5),qty:l}))},N.items),$=(e,l)=>Math.min(10,...e.map(e=>{const s=(D[e.key]??0)-T(l)*e.qty;return Math.floor(((N.free[e.key]??0)-s)/e.qty)})),I=(e,l,s,t)=>{const r=T(e),i=t<=0&&0===r;return(0,v.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:10,opacity:i?.55:1},testID:`reserve-${e.replace(':','-')}`,children:[(0,v.jsxs)(n.default,{style:{flex:1,minWidth:0},children:[(0,v.jsx)(h.T,{weight:"semibold",children:l}),(0,v.jsx)(h.Muted,{children:i?'Unavailable \u2014 none left for this day':s})]}),i?(0,v.jsx)(h.Badge,{kind:"neutral",label:"Unavailable"}):(0,v.jsx)(h.Stepper,{value:r,onChange:l=>j({holds:{...a.holds,[e]:Math.max(0,Math.min(l,Math.max(r,t)))}}),min:0,max:Math.max(r,Math.min(10,t)),label:l})]},e)},A=N.items.length>0||!1!==w.reserveStock&&N.stock.length>0,O=(0,p.usePlan)(e);return(0,v.jsxs)(v.Fragment,{children:[(0,s.accessQuestionOn)(l)?(0,v.jsxs)(R,{tone:"plain",testID:"q-access",children:[(0,v.jsx)(C,{sub:"Optional. Tell us and we\u2019ll have the right table ready.",children:"\u267f Access needs"}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Wheelchair users"}),(0,v.jsx)(h.Stepper,{value:a.wheelchair,onChange:e=>j({wheelchair:e}),min:0,max:Math.max(1,i),label:"wheelchair users"})]}),(0,v.jsxs)(h.Row,{wrap:!0,gap:6,children:[(0,v.jsx)(h.Chip,{label:"Step-free access",selected:a.stepFree,onPress:()=>j({stepFree:!a.stepFree})}),(0,v.jsx)(h.Chip,{label:"Accessible toilet",selected:a.toilet,onPress:()=>j({toilet:!a.toilet})}),(0,v.jsx)(h.Chip,{label:"Assistance dog",selected:a.assistDog,onPress:()=>j({assistDog:!a.assistDog})})]}),(0,v.jsx)(h.Field,{label:"Anything else? (optional)",value:a.accessNote,onChangeText:e=>j({accessNote:e}),placeholder:"e.g. needs a chair with arms"}),w.accessStatement?.trim()?(0,v.jsx)(h.Muted,{children:w.accessStatement.trim()}):null]}):null,(0,s.dietQuestionOn)(l)?(0,v.jsxs)(R,{tone:"plain",testID:"q-veg",children:[(0,v.jsx)(C,{sub:"We\u2019d love to look after you. Optional.",children:"\u24cb Any vegans or vegetarians?"}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Vegan"}),(0,v.jsx)(h.Stepper,{value:a.vegan,onChange:e=>j({vegan:e}),min:0,max:Math.max(1,i),label:"vegans"})]}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Vegetarian"}),(0,v.jsx)(h.Stepper,{value:a.vegetarian,onChange:e=>j({vegetarian:e}),min:0,max:Math.max(1,i),label:"vegetarians"})]}),!1!==w.vegTeaser&&P.length&&(a.vegan||a.vegetarian)?(0,v.jsxs)(h.Muted,{children:["On the menu: ",P.map(e=>e.name).join(' \xb7 ')]}):null]}):null,A?(0,v.jsxs)(R,{tone:"gold",testID:"q-reserve",children:[(0,v.jsx)(C,{sub:N.known?'Held for you from today\u2019s count.':o>y||'guest'===b?'Held for you; the kitchen confirms and orders in.':void 0,children:"\ud83e\udd9e Reserve with your table"}),N.items.map(e=>I(`item:${e.id}`,`${e.name}${k(e.price)}`,e.description||e.uses.map(e=>`${e.qty} ${N.stock.find(l=>l.key===e.key)?.name.toLowerCase()??e.key}`).join(' + '),$(e.uses,`item:${e.id}`))),!1!==w.reserveStock?N.stock.map(e=>I(`stock:${e.key}`,`Reserve ${e.name.toLowerCase()}`,N.known?`${N.free[e.key]} available today`:'Held for the kitchen to order',$([{key:e.key,qty:1}],`stock:${e.key}`))):null,'staff'===b&&N.known?(0,v.jsxs)(h.Muted,{children:["Today: ",N.stock.map(e=>`${N.free[e.key]} ${e.plural.toLowerCase()} free (${N.reserved[e.key]??0} reserved)`).join(' \xb7 ')]}):null]}):null,x&&!1!==w.tableRequests&&O.tables.length?(0,v.jsx)(M,{rid:e,value:a,onChange:r,party:i,hide:w.tableRequestHide??[]}):null]})},_e.dogTimeOk=function(e,l,s,t,a){if(!a)return!0;const n=e.settings.maxDogsPerSlot;return!n||(0,f.dogsAt)(l,s,t)+a<=n},Object.defineProperty(_e,"accessibleSetUp",{enumerable:!0,get:function(){return f.accessibleSetUp}});var e,l=_r(d[0]),s=_r(d[1]),t=_r(d[2]),a=_r(d[3]),n=(e=a)&&e.__esModule?e:{default:e},r=_r(d[4]),i=_r(d[5]),o=_r(d[6]),c=_r(d[7]),h=_r(d[8]),u=_r(d[9]),p=_r(d[10]),y=_r(d[11]),m=_r(d[12]),b=_r(d[13]),x=_r(d[14]),f=_r(d[15]),j=_r(d[16]),v=_r(d[17]);const k=e=>'display'===x.APP_VARIANT?'':` \xb7 ${(0,b.gbp)(e)}`,w=()=>({allergy:null,allergens:[],severity:'allergy',allergyPeople:1,allergyNote:'',dog:null,dogs:1,wheelchair:0,stepFree:!1,toilet:!1,assistDog:!1,accessNote:'',vegan:0,vegetarian:0,holds:{},tableReq:[]});const R=({children:e,tone:l,testID:s})=>(0,v.jsx)(n.default,{testID:s,style:{gap:10,padding:16,borderRadius:16,borderWidth:'plain'===l?1:1.5,borderColor:'red'===l?j.colours.red:'gold'===l?j.colours.accentBorder:j.colours.hairline,backgroundColor:'red'===l?'#1E1110':j.colours.surface},children:e}),C=({children:e,sub:l})=>(0,v.jsxs)(n.default,{style:{gap:2},children:[(0,v.jsx)(h.T,{weight:"semibold",size:17,children:e}),l?(0,v.jsx)(h.Muted,{children:l}):null]});function q(e,l,s,t,a,n,i){const o=(0,f.reservablesOf)(l),c=(0,y.useStockItems)(e),h=(0,y.useShellStore)((0,r.useShallow)(l=>(0,y.venueCounts)(l,e))),u=(0,y.useShellStore)(l=>!!l.server[e]),p=(0,f.reservedOn)(a,s,o,i),m=s===t&&('staff'===n||u),b={};for(const e of c)b[e.key]=m?Math.max(0,Math.floor((h[e.key]??0)-(p[e.key]??0))):1/0;return{items:o,stock:c,free:b,reserved:p,known:m}}function M({rid:e,value:s,onChange:a,party:r,hide:c}){const u=(0,p.usePlan)(e),y=u.areas.filter(e=>u.tables.some(l=>l.areaId===e.id&&!c.includes(l.name))),[m,b]=(0,t.useState)(y[0]?.id??''),x=s.dog?s.dogs:0,k=e=>c.includes(e)?'Not bookable':(0,f.tableBlockReason)(u,e,r,x,s.wheelchair>0||s.stepFree),w=Object.fromEntries(u.tables.map(e=>[e.name,{table:e,status:k(e.name)?'blocked':'free',covers:0,allergy:!1}])),q=e=>{if(k(e))return;const l=s.tableReq.includes(e)?s.tableReq.filter(l=>l!==e):[...s.tableReq,e].slice(-2);a({...s,tableReq:l})},M=u.tables.filter(e=>e.areaId===m&&!c.includes(e.name));return(0,v.jsxs)(R,{tone:"plain",testID:"q-table",children:[(0,v.jsx)(C,{sub:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best.",children:"\ud83e\ude91 Request a table (optional)"}),y.length>1?(0,v.jsx)(i.AreaTabs,{plan:u,area:m,onPick:b}):null,(0,v.jsx)(n.default,{testID:"q-table-plan",style:{height:240,borderRadius:12,overflow:'hidden',borderWidth:1,borderColor:j.colours.hairline},children:(0,v.jsx)(o.FloorCanvas,{plan:u,areaId:m,mode:"live",view:w,privacy:!0,fit:"contain",crop:!0,maxH:260,highlight:s.tableReq,onTap:e=>q(e.name)})}),(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:M.map(e=>{const t=k(e.name),a=s.tableReq.indexOf(e.name);return(0,v.jsx)(h.Chip,{label:`${(0,l.tableNumbers)(e.name)}`,sub:t||(0===a?'1st choice':1===a?'2nd choice':`${e.maxSeats} seats`),selected:a>=0,disabled:!!t,onPress:()=>q(e.name)},e.name)})}),s.tableReq.length?(0,v.jsxs)(h.T,{size:14,colour:j.colours.goldLight,children:["Requested: ",s.tableReq.map((e,s)=>`${(0,l.tableNumbers)(e)}${s?' (2nd choice)':''}`).join(', ')]}):(0,v.jsx)(h.Muted,{children:"Tap a table; tap another for a second choice."})]})}},1119,[860,877,34,102,879,1120,1121,1123,794,874,1021,984,861,867,872,1091,821,25]); __d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"areaMarks",{enumerable:!0,get:function(){return n}}),_e.AreaTabs=function({plan:o,area:e,onPick:u,counts:a,closed:b}){return(0,c.jsx)(t.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:o.areas.map(o=>{const h=o.id===e,f=b?.has(o.id);return(0,c.jsx)(l.default,{testID:`area-${o.id}`,accessibilityRole:"tab",accessibilityLabel:`Area ${o.name}${o.dogs?', dogs allowed':''}${o.outdoor?', outdoor':''}${f?', closed for weather':''}`,accessibilityState:{selected:h},onPress:()=>u(o.id),style:{maxWidth:'100%',minWidth:0,flexShrink:1,minHeight:48,paddingHorizontal:16,borderRadius:24,borderWidth:1.5,borderColor:h?s.colours.gold:f?s.colours.blue:s.colours.border,backgroundColor:h?s.colours.gold:s.colours.surface,justifyContent:'center'},children:(0,c.jsxs)(t.T,{weight:"semibold",size:15,colour:h?s.colours.onGold:s.colours.text,children:[o.name,n(o),f?(0,c.jsx)(t.T,{size:12,colour:h?s.colours.onGold:s.colours.blue,children:" closed"}):null,a?.[o.id]?(0,c.jsxs)(t.T,{size:12,colour:h?s.colours.onGold:s.colours.muted,children:[" ",a[o.id]]}):null]})},o.id)})})},r(d[0]);var o,e=r(d[1]),l=(o=e)&&o.__esModule?o:{default:o},s=r(d[2]),t=r(d[3]),c=r(d[4]);const n=o=>`${o.dogs?' \ud83d\udc3e':''}${o.outdoor?' \ud83c\udf26':''}`},1120,[34,402,821,794,25]); @@ -1295,7 +1295,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useChefAssistant",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"CHEF_PROMPTS",{enumerable:!0,get:function(){return P}}),_e.ChefAssistantButton=function({compact:e}){return e?(0,S.jsx)(u.default,{testID:"chef-assistant-open",accessibilityRole:"button",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0),style:{borderRadius:12,backgroundColor:w.colours.accentBg,borderWidth:1,borderColor:w.colours.accentBorder,paddingVertical:6,paddingHorizontal:12,minHeight:36,justifyContent:'center'},children:(0,S.jsx)(m.T,{weight:"semibold",colour:w.colours.goldLight,size:13,children:"\u2726 Assistant"})}):(0,S.jsx)(d.ActionTile,{primary:!0,testID:"chef-assistant-open",icon:"sparkle",label:"Assistant",sub:"Recipe card, order, allergens, GP, temps",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0)})},_e.ChefAssistantSheet=function({go:e}){const l=I(e=>e.open),d=()=>I.getState().setOpen(!1),{rid:f,me:W,menu:L,k:B,c:F}=(0,$.useChef)(3e4),G=(0,T.useSuggestions)(),E=(0,r.useSafetyView)('chef').points,[M,H]=(0,o.useState)([]),[N,_]=(0,o.useState)(''),[V,K]=(0,o.useState)(!1),[Y,q]=(0,o.useState)(!1),Q=(0,o.useRef)(null),U=(0,o.useRef)(null);if((0,o.useEffect)(()=>{setTimeout(()=>Q.current?.scrollToEnd?.({animated:!0}),50)},[M.length]),!l)return null;const J=(e,t=!1)=>H(n=>[...n,{id:R(),from:'bot',text:e,demo:t}]),X=e=>H(t=>[...t,{id:R(),from:'bot',plan:e,state:'open'}]),Z=L.filter(e=>!e.name.includes('(example)')||!0),ee=(t,n)=>{const r=A(t);if(!(0,s.chefCanSee)(f,t))return void J('That check is managed in the Managers app.');if(/\b(send|email|text|pay|delete|remove|order now|place the order)\b/.test(r)&&!/\b(build|draft|make|prepare)\b/.test(r))return void J('I can\u2019t send, pay for or delete anything. I can prepare it for you to check and do yourself, for example \u201cbuild the fish order\u201d.');const o=(0,y.parseQuick)(t,E).filter(e=>e.point&&(0,y.isTempKind)(e.point.kind));if(o.length&&(/\b(fridge|freezer|walk ?in|core|probe|cool|hot|deliver|degree|temp)/.test(r)||o.some(e=>null!=e.value))){const t=o.filter(e=>null!=e.value),r=o.filter(e=>null==e.value);if(r.length&&J(`I didn\u2019t hear a temperature for ${r.map(e=>e.point.name).join(', ')}. Say or type the reading, for example \u201c${r[0].point.name} 4 degrees\u201d. I never fill one in.`),!t.length)return;const s=t.filter(e=>!(0,y.inRange)(e.point,e.value));return void X({title:`Log ${1===t.length?'a reading':`${t.length} readings`} in the food safety log`,detail:t.map(e=>`${e.point.name}: ${e.value}\xb0C (${(0,y.limitText)(e.point)})${(0,y.inRange)(e.point,e.value)?'':' \xb7 OUT OF RANGE'}`).join('\n')+`\nSigned ${(0,y.initialsOf)(W)} \xb7 ${n?'voice':'typed'}`,warn:s.length?`${s.map(e=>e.point.name).join(', ')} out of range: you\u2019ll need to add the corrective action in the food safety log.`:void 0,confirm:'Log it',run:()=>{const r=(new Date).toISOString();return v.useSafety.getState().addEntries(t.map(e=>({pointId:e.point.id,name:e.point.name,kind:e.point.kind,at:r,by:W.replace(' (example)',''),byId:$.CHEF_ID,app:'chef',value:e.value,ok:(0,y.inRange)(e.point,e.value),source:n?'voice':'typed',initials:(0,y.initialsOf)(W)}))),s.length&&setTimeout(()=>e('haccp'),600),`Logged ${t.map(e=>`${e.point.name} ${e.value}\xb0C`).join(', ')}.${s.length?' Opening the food safety log for the corrective action.':''}`}})}if(/\b(fridge|freezer|temp|temperature|degrees)\b/.test(r))return void J('Which unit, and what does it read? For example \u201cprep fridge 4 degrees\u201d or \u201cfreezer minus 19\u201d. I only log the number you give me.');if(/allergen|allerg|contain|gluten|nut|dairy|milk|shellfish|crustacean|coeliac/.test(r)){const e=D(t,Z,e=>e.name);if(!e)return void J('Which dish? For example \u201callergens in the fish and chips\u201d.');const n=(0,j.recipeCards)().byMenuItem(e.id),r=e=>b.ALLERGENS.find(t=>t.id===e)?.label??e,s=Object.entries(e.allergens??{}).filter(([,e])=>'contains'===e).map(([e])=>r(e)),a=Object.entries(e.allergens??{}).filter(([,e])=>'may'===e).map(([e])=>r(e));return void J(`${e.name}: ${s.length?`contains ${s.join(', ')}`:'no allergens recorded as \u201ccontains\u201d'}${a.length?`; may contain ${a.join(', ')}`:''}. ${n?n.signOff?`From the signed-off recipe card (${n.signOff.by}).`:'The recipe card is awaiting your sign-off, so check it before telling a guest.':'There\u2019s no recipe card for it yet.'} Always check the card and the ingredients with the guest.`)}if(/\bgp\b|gross profit|margin|price for|what price|cost of|costing/.test(r)){const e=D(t,F,e=>e.item.name),n=Number((t.toLowerCase().match(/(\d{2})\s*(?:%|percent|per cent)/)??[])[1])||B.targetGp;if(!e)return void J(`Which dish? I can cost the dishes that have a recipe in GP & costing (${F.length} do). For example \u201cGP on the haddock\u201d.`);const r=(0,C.priceForTarget)(e.cost,n);return void J(`${e.item.name}: food cost ${(0,x.gbp)(e.cost)}, sells at ${(0,x.gbp)(e.priceInc)} (inc VAT) = ${e.gp.toFixed(1)}% GP. For ${n}% GP it would need ${(0,x.gbp)(r)} inc VAT. Prices are changed by a manager; I haven\u2019t changed anything.`)}if(/\border|supplier|delivery|par\b|restock/.test(r)){const n=D(t,G,e=>`${e.s.name} ${e.s.category??''}`)??(1===G.length?G[0]:void 0);return n?void X({title:`Build an order for ${n.s.name}`,detail:(n.lines.length?n.lines.map(e=>`${e.i.name}: ${(0,a.fishQtyText)(f,e.i,e.qty)}`).join('\n')+`\nAbout ${(0,x.gbp)(n.total)} at the latest prices.`:'Nothing is below par for this supplier yet.')+'\nI\u2019ll open it in Ordering for you to check, change and place yourself. Nothing is sent.',confirm:'Open the order',run:()=>(setTimeout(()=>{d(),e('orders',n.s.id)},400),`Opening the ${n.s.name} order. You check it and place it yourself.`)}):void J(G.length?`Which supplier? ${G.map(e=>e.s.name).join(', ')}.`:'Nothing is below par and no supplier orders today.')}if(/recipe|card|new dish|write up|spec/.test(r)){const n=t.replace(/^.*?(?:recipe card|card|recipe|dish|spec)\s*(?:for|of)?\s*/i,'').replace(/[.?!]+$/,'').trim();if(!n||n.length<3)return void J('What\u2019s the dish called? For example \u201cdraft a recipe card for crab linguine\u201d.');const r=n.replace(/^the\s+/i,'').replace(/^./,e=>e.toUpperCase()).slice(0,60),s=(0,j.recipeCards)().list(f).find(e=>A(e.dish)===A(r));return s?(J(`There\u2019s already a card for ${s.dish}. Opening Recipe cards.`),void setTimeout(()=>{d(),e('recipes')},600)):void X({title:`Draft a recipe card: ${r}`,detail:'A new card, awaiting your sign-off, with the dish name and section filled in. You add the ingredients, method, allergens, photo and price, then sign it off. It isn\u2019t shown to guests until you do.',confirm:'Make the draft',run:async()=>(await(0,j.recipeCards)().create(f,{dish:r,section:'Specials',price:null,ingredients:[],steps:[]},{name:W,role:'head-chef'}),setTimeout(()=>{d(),e('recipes')},500),`Draft card for ${r} saved, awaiting sign-off. Opening Recipe cards.`)})}const l='I can help with: drafting a recipe card, building a supplier order, a dish\u2019s allergens, GP pricing, and logging a temperature you read out. Try one of the suggestions.';(0,k.askServer)('chef',t,[]).then(e=>J('text'===e.kind?e.text:l)).catch(()=>J(l))},te=(e,t=!1)=>{const n=e.trim();if(n){_(''),H(e=>[...e,{id:R(),from:'you',text:n}]);try{ee(n,t)}catch(e){J(`Sorry, that didn\u2019t work: ${e.message}`)}}},ne=async e=>{if(e.plan){H(t=>t.map(t=>t.id===e.id?{...t,state:'done'}:t));try{J(String(await e.plan.run()))}catch(e){J(`Couldn\u2019t do that: ${e.message}`)}}},ie=e=>{H(t=>t.map(t=>t.id===e.id?{...t,state:'cancelled'}:t)),J('Cancelled. Nothing was changed.')},re=()=>{te(N,Y),q(!1)};return(0,S.jsx)(c.default,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:d,children:(0,S.jsx)(p.default,{style:[m.styles.overlay,{justifyContent:'flex-end',padding:0}],children:(0,S.jsxs)(p.default,{testID:"chef-assistant",style:{backgroundColor:w.colours.surface,borderTopLeftRadius:18,borderTopRightRadius:18,borderWidth:1,borderColor:w.colours.border,width:'100%',maxWidth:640,alignSelf:'center',maxHeight:'92%',minHeight:'70%',padding:14,gap:10},children:[(0,S.jsxs)(m.Row,{style:{justifyContent:'space-between'},children:[(0,S.jsx)(m.T,{size:20,weight:"semibold",children:"\u2726 Kitchen Assistant"}),(0,S.jsx)(n.GoldClose,{testID:"chef-assistant-close",onPress:d,style:{marginRight:-6}})]}),(0,S.jsx)(p.default,{testID:"chef-assistant-demo",children:(0,S.jsx)(m.Badge,{kind:"amber",label:O})}),(0,S.jsxs)(h.default,{ref:Q,style:{flex:1},contentContainerStyle:{gap:10,paddingBottom:6},keyboardShouldPersistTaps:"handled",children:[0===M.length?(0,S.jsxs)(p.default,{style:{gap:8},children:[(0,S.jsxs)(m.T,{children:["Hi ",W.split(' ')[0],". Type or tap \ud83c\udfa4 and say what you need. I\u2019ll show you what I\u2019m about to do and wait for you to confirm. I never send, pay or delete."]}),P.map(e=>(0,S.jsx)(u.default,{accessibilityRole:"button",onPress:()=>te(e),style:{borderWidth:1,borderColor:w.colours.border,borderRadius:12,paddingVertical:9,paddingHorizontal:12,backgroundColor:w.colours.surface2},children:(0,S.jsx)(m.T,{size:14,children:e})},e))]}):null,M.map(e=>'you'===e.from?(0,S.jsx)(p.default,{style:{alignSelf:'flex-end',maxWidth:'85%',backgroundColor:'#3A2F12',borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id):e.plan?(0,S.jsxs)(p.default,{testID:"chef-confirm-card",style:{borderWidth:1.5,borderColor:'open'===e.state?w.colours.gold:w.colours.border,borderRadius:14,padding:12,gap:8,backgroundColor:w.colours.surface2},children:[(0,S.jsx)(m.T,{weight:"semibold",children:e.plan.title}),(0,S.jsx)(m.T,{size:14,colour:w.colours.muted,children:e.plan.detail}),e.plan.warn?(0,S.jsxs)(m.T,{size:13,colour:w.colours.amber,children:["\u26a0 ",e.plan.warn]}):null,'open'===e.state?(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(m.Button,{small:!0,testID:"chef-confirm",label:e.plan.confirm,onPress:()=>ne(e)}),(0,S.jsx)(m.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ie(e)})]}):(0,S.jsx)(m.Badge,{kind:'done'===e.state?'ok':'neutral',label:'done'===e.state?'Confirmed':'Cancelled: nothing done'}),'open'===e.state?(0,S.jsxs)(m.Muted,{children:["Nothing happens until you tap ",e.plan.confirm,"."]}):null]},e.id):(0,S.jsx)(p.default,{testID:"chef-assistant-reply",style:{alignSelf:'flex-start',maxWidth:'92%',backgroundColor:w.colours.surface2,borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id))]}),(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(t.TextInput,{testID:"chef-assistant-input",accessibilityLabel:"Ask the Assistant",placeholder:"Type a kitchen task\u2026",placeholderTextColor:"#7D776C",value:N,onChangeText:e=>{_(e),e||q(!1)},onSubmitEditing:re,returnKeyType:"send",style:[m.styles.input,{flex:1,minWidth:0,width:40}]}),(0,S.jsx)(u.default,{testID:"chef-assistant-mic",accessibilityRole:"button",accessibilityLabel:V?'Stop listening':'Speak',onPress:()=>{const e=z();if(e)if(V)U.current?.stop?.();else try{const t=new e;U.current=t,t.lang='en-GB',t.interimResults=!1,t.maxAlternatives=1,t.onresult=e=>{const t=e.results?.[0]?.[0]?.transcript;t&&(_(t),q(!0))},t.onend=()=>K(!1),t.onerror=()=>{K(!1),J('Sorry, I didn\u2019t catch that. You can type instead.')},K(!0),t.start()}catch{K(!1),J('Voice input isn\u2019t available here. Please type instead.')}else J('Voice input isn\u2019t available in this browser. Please type instead.')},style:{width:48,height:48,borderRadius:24,borderWidth:1.5,borderColor:w.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:V?w.colours.gold:'transparent'},children:(0,S.jsx)(m.T,{size:20,children:"\ud83c\udfa4"})}),(0,S.jsx)(m.Button,{label:"Send",disabled:!N.trim(),onPress:re})]}),(0,S.jsx)(m.Muted,{center:!0,children:"Every action waits for your Confirm \xb7 nothing is sent, paid or deleted"})]})})})};var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),s=_r(_d[3]),a=_r(_d[4]),o=_r(_d[5]),l=_r(_d[6]),d=_r(_d[7]),c=e(_r(_d[8]));_r(_d[9]);var u=e(_r(_d[10])),h=e(_r(_d[11])),p=e(_r(_d[12])),f=_r(_d[13]),m=_r(_d[14]),b=_r(_d[15]),y=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),v=_r(_d[19]),w=_r(_d[20]),$=_r(_d[21]),C=_r(_d[22]),T=_r(_d[23]),k=_r(_d[24]),S=_r(_d[25]);const I=(0,f.create)(e=>({open:!1,setOpen:t=>e({open:t})})),R=()=>Math.random().toString(36).slice(2,9),P=['Draft a recipe card for crab linguine','Build the fish order','What allergens are in the fish and chips?','What price gives 70% GP on the lobster?','Walk-in fridge 3.5 degrees'],O='The secure AI server: not set up yet',A=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').replace(/\s+/g,' ').trim(),W=new Set(['the','and','with','for','our','house','served','side','of','in','on','from']);function D(e,t,n){const r=` ${A(e)} `;let s,a=0;for(const e of t){const t=A(n(e).replace(/\(example\)/i,'')).split(' ').filter(e=>e.length>2&&!W.has(e)),o=t.filter(e=>r.includes(` ${e} `)||r.includes(` ${e}s `)).length,l=t.length?o/t.length+.01*o:0;o&&l>a&&(s=e,a=l)}return s}function z(){return'undefined'==typeof window?null:(0,l.speechRecognizer)()}},1212,[827,796,1184,835,985,34,932,1170,395,236,402,295,102,846,794,861,1027,867,882,1026,821,1138,1132,1157,933,25]); __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTTOM_TABS_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.BottomTabs=function({tabs:e,active:b,onPress:y,background:x,tablist:p}){const{width:j}=(0,s.default)(),v=j/Math.max(1,e.length),w=v>=60?11:10,I=v<56?20:22,[F,S]=(0,t.useState)({}),[H,_]=(0,t.useState)(0),M=H>0&&e.some(e=>(F[e.id]??0)>H-6),z={flexDirection:'row',flexWrap:'nowrap',alignItems:'stretch',borderTopWidth:1,borderColor:c.colours.border,backgroundColor:x};return(0,f.jsx)(l.default,{testID:"app-bottom-tabs",accessibilityRole:p?'tablist':void 0,style:z,children:e.map(t=>{const s=b===t.id,x=s?c.colours.gold:c.colours.muted;return(0,f.jsxs)(n.default,{onLayout:t===e[0]?e=>_(e.nativeEvent.layout.width):void 0,testID:`tab-${t.id}`,accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:t.a11y??t.label,onPress:()=>y(t.id),style:{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:44,minHeight:h,alignItems:'center',justifyContent:'center',paddingVertical:4,paddingHorizontal:1,gap:2},children:[(0,f.jsxs)(l.default,{style:{width:I,height:I,alignItems:'center',justifyContent:'center'},children:[(0,f.jsx)(u.Icon,{name:t.icon,size:I,colour:x}),t.badge?(0,f.jsx)(l.default,{testID:t.badge.testID,style:{position:'absolute',right:-10,top:-5,backgroundColor:t.badge.bg,borderRadius:8,minWidth:16,height:16,paddingHorizontal:3,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(o.default,{style:{fontFamily:c.fonts.bold,fontSize:10,lineHeight:12,color:t.badge.fg??'#FFFFFF'},children:t.badge.text})}):null]}),(0,f.jsx)(l.default,{pointerEvents:"none","aria-hidden":!0,importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,style:{position:'absolute',left:0,top:0,width:0,height:0,overflow:'hidden',opacity:0},children:(0,f.jsx)(l.default,{style:{width:400,flexDirection:'row',alignItems:'flex-start'},children:(0,f.jsx)(o.default,{onLayout:e=>{const n=Math.ceil(e.nativeEvent.layout.width);S(e=>e[t.id]===n?e:{...e,[t.id]:n})},style:{fontFamily:c.fonts.semibold,fontSize:w,lineHeight:Math.round(1.3*w),flexShrink:0},children:t.short??t.label})})}),M?null:(0,f.jsx)(o.default,{numberOfLines:1,style:{fontFamily:s?c.fonts.semibold:c.fonts.regular,fontSize:w,lineHeight:Math.round(1.3*w),color:x,textAlign:'center',alignSelf:'center',maxWidth:'100%'},children:t.short??t.label})]},t.id)})})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=r(d[5]),u=r(d[6]),f=r(d[7]);const h=56},1213,[34,402,346,102,426,821,1171,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return(0,u.canShow)('chef')?(0,c.jsx)(n.ChefApp,{}):(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]})}},1214,[30,34,792,872,25]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return B}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=(e=r)&&e.__esModule?e:{default:e},u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),S=_r(_d[19]),w=_r(_d[20]),D=_r(_d[21]),T=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]),P=_r(_d[25]),M=_r(_d[26]);function B(){const{rid:e,date:r}=(0,n.useLocalSearchParams)(),B=(0,x.useRestaurant)(e),O=(0,x.useCustomer)(),A=(0,x.useBookings)(e),N=(0,x.useEvents)(e),z=(0,x.useNow)(6e4),[R]=(0,l.useState)(()=>(0,a.startForm)()),[F,I]=(0,l.useState)(''),[q,E]=(0,l.useState)(2),[H,W]=(0,l.useState)(r??(0,k.ymd)(z)),[L,_]=(0,l.useState)(null),[Y,U]=(0,l.useState)(O.name),[G,Q]=(0,l.useState)(O.phone??''),[V,J]=(0,l.useState)(O.email??''),[K,X]=(0,l.useState)(!1),[Z,ee]=(0,l.useState)(''),[te,oe]=(0,l.useState)(!1),[se,ne]=(0,l.useState)([]),[le,ie]=(0,l.useState)(!1),ae=[...O.allergies,...se.filter(e=>!O.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[re,de]=(0,l.useState)(null),ue=(0,D.useBlocks)(e=>e.blocks);(0,j.usePublicDayStore)(e=>e.n);const ce=e?(0,j.publicDay)(e,H):null,he=ce?[...ce.bookings,...A.filter(e=>e.date!==H)]:A,me=ce?[...ue.filter(t=>t.rid!==e||t.date!==H),...ce.blocks]:ue,ge=(0,T.usePlan)(e),[pe,be]=(0,l.useState)((0,$.emptyNeeds)()),fe=!0===pe.dog,ye=fe?pe.dogs:0,ke=(0,l.useMemo)(()=>{const e=[],t=new Date(z);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return r&&!e.some(e=>(0,k.ymd)(e)===r)&&e.push((0,k.parseYmd)(r)),e},[z.toDateString(),r]);if(!B)return(0,M.jsx)(h.Screen,{title:"Not found",children:(0,M.jsx)(h.T,{children:"Restaurant not found."})});const xe=B.settings,je=(0,k.parseYmd)(H),ve=(0,D.blocksOn)(me,B.id,H),Se=he.filter(e=>e.date===H),we=ge.areas.filter(e=>e.dogs),De=(0,P.dogSetUp)(ge),Te=e=>(0,C.freeTablesAt)(ge,Se,q,new Date(`${H}${(0,t.tableNumbers)(e)}:00`),(0,C.turnFor)(q,xe.turnMins),xe.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(me,B.id,H,e)}),Ce=(0,y.bookingSlots)(B,je,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),q,z).map(e=>{const t=(0,D.blockAt)(me,B.id,H,e.time),o=fe&&De&&e.available&&!t&&(!Te(e.time).length||!(0,$.dogTimeOk)(B,he,H,e.time,ye));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),$e=Ce.some(e=>e.available),Pe=(0,u.depositOf)(xe),Me=(0,u.depositDue)(Pe,q),Be=Me>0?'deposit':'none',Oe=(0,u.depositWords)(Pe,q,B.name),Ae=N.filter(e=>e.date===H),Ne=(0,w.ukPhone)(G),ze=(0,w.emailOk)(V),Re=(0,$.needsMissing)(pe,O.allergies),Fe=!!L&&te&&!Re.length&&Y.trim().length>1&&Ne.ok&&ze,Ie=async()=>{const e=(0,$.needsPatch)(pe,O.allergies),t=fe&&De?Te(L).map(e=>e.table):[],o=fe?pe.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await x.repo.bookings.create({restaurantId:B.id,customerId:O.id,name:Y,partySize:q,date:H,time:L,notes:Z.trim(),security:Be,depositPaid:0,...Me?{depositDue:Me,depositPolicy:Oe.join(' '),depositRefundable:Pe.refundable,depositCutoffHours:Pe.cutoffHours}:{},phone:Ne.pretty,email:V.trim()||void 0,source:'online',...e,...Ce.find(e=>e.time===L)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??ae,...o?{table:o}:{}});(0,a.rememberGuard)(s.id,(0,a.guardFor)({...R,hp:F})),de(s)},qe=(0,x.useStore)(e=>re?e.bookings.find(e=>e.id===re.id)?.ref:void 0),Ee=e=>(0,S.waMeLink)(B.settings.whatsapp,(0,S.guestWhatsAppText)({name:e.name,ref:qe??e.ref,date:e.date,time:e.time,partySize:e.partySize},B.name));if(re){const e='pending'===re.status;return(0,M.jsxs)(h.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:B.name,children:[(0,M.jsx)(h.Banner,{kind:e?'info':'success',title:`Reference ${qe??re.ref}`,children:`${re.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(re.date))} at ${re.time}`}),e?(0,M.jsx)(h.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(h.T,{children:["Name: ",re.name]}),(0,M.jsxs)(h.T,{children:["Mobile: ",re.phone]}),re.email?(0,M.jsxs)(h.T,{children:["Email: ",re.email]}):null,(0,M.jsxs)(h.T,{children:["Allergies shared with the restaurant: ",re.allergies.length?re.allergies.map(e=>`${(0,p.allergenLabel)(e.allergen)} (${(0,p.severityLabel)(e.severity)})`).join(', '):'none']}),re.notes?(0,M.jsxs)(h.T,{children:["Notes: ",re.notes]}):null,re.dog?(0,M.jsxs)(h.T,{children:["\ud83d\udc15 Dog coming too",re.table?` \xb7 dog-friendly table ${re.table}`:'']}):null,re.holds?.length?(0,M.jsxs)(h.T,{children:["Reserved: ",re.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(B.settings.reservables??P.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,re.tableReq?.length?(0,M.jsxs)(h.T,{children:["Table requested: ",re.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===re.security&&re.depositDue?(0,M.jsxs)(h.T,{weight:"semibold",children:["Deposit due: ",(0,f.gbp)(re.depositDue),". ",B.name," will tell you how to pay it."]}):null,'deposit'===re.security&&re.depositPolicy?(0,M.jsx)(h.Muted,{children:re.depositPolicy}):null,(0,M.jsx)(h.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,M.jsxs)(h.Muted,{children:["Need to change or cancel? Call ",B.phone," and quote ",qe??re.ref,"."]})]}),Ee(re)?(0,M.jsxs)(d.default,{style:{gap:4},children:[(0,M.jsx)(h.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ee(re);e&&(0,S.openWhatsApp)(e)}}),(0,M.jsx)(h.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,M.jsx)(h.Button,{label:"Back to restaurant",onPress:()=>n.router.replace(`/customer/${B.id}`)})]})}return(0,M.jsxs)(h.Screen,{title:"Book a table",subtitle:B.name,footer:(0,M.jsx)(h.Button,{label:Re.length?Re[0]:q>(xe.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Fe,onPress:()=>Ie(),testID:"confirm-booking"}),children:[(0,M.jsx)($.FirstQuestions,{rid:B.id,value:pe,onChange:e=>{e.dog===pe.dog&&e.dogs===pe.dogs||_(null),be(e)},party:q,audience:"guest",profile:O.allergies}),(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(d.default,{style:{gap:6,alignItems:'center'},children:[(0,M.jsx)(h.H2,{children:"Party size"}),(0,M.jsx)(o.PartySizeInput,{value:q,onChange:e=>{E(e),_(null)},label:"Party size",testID:"party-size"})]}),Me?(0,M.jsx)(h.Banner,{kind:"info",title:`Deposit: ${(0,f.gbp)(Me)} for ${q} guests`,children:(0,M.jsx)(d.default,{style:{gap:4},children:Oe.map(e=>(0,M.jsx)(h.T,{size:13,children:e},e))})}):Pe.on&&Pe.perPersonPence>0?(0,M.jsxs)(h.Muted,{children:["No deposit for fewer than ",Pe.fromParty," guests."]}):null,q>(xe.autoAcceptUpTo??7)?(0,M.jsxs)(h.Muted,{children:["For ",q," people the team checks the booking first, then texts you to confirm."]}):null,fe&&De?(0,M.jsxs)(h.Muted,{children:["Dogs are welcome in the ",we.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",B.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Date"}),(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:ke.map(e=>{const t=!!(0,b.hoursFor)(B,e),o=N.some(t=>t.date===(0,k.ymd)(e));return(0,M.jsx)(h.Chip,{label:(0,k.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:H===(0,k.ymd)(e),onPress:()=>{W((0,k.ymd)(e)),_(null)}},(0,k.ymd)(e))})}),Ae.map(e=>(0,M.jsx)(h.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Time"}),0===Ce.length?(0,M.jsx)(h.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:Ce.map(e=>(0,M.jsx)(h.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left_(e.time)},e.time))}),ve.length>0&&Ce.some(e=>e.blocked)?(0,M.jsx)(h.Banner,{kind:"info",title:$e?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${ve.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(je)}. Please give us a ring on ${B.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,s.lastFoodOn)(B,H);return e&&Ce.some(e=>e.drinksOnly)?(0,M.jsx)(h.Banner,{kind:"info",title:`Last food orders ${(0,s.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),fe&&Ce.some(e=>e.noDog)?(0,M.jsx)(h.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${we.map(e=>e.name).join(' and ')}${B.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,D.closedAreasAt)(me,B.id,H,L??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,M.jsxs)(h.Muted,{children:["Times are every ",(0,y.bookingSlotMinutesOf)(B)," minutes. Covers per slot (",xe.bookingCoversPerSlot," per half hour) and table rules still apply."]})]}),(0,M.jsx)($.MoreQuestions,{rid:B.id,r:B,value:pe,onChange:be,party:q,date:H,time:L,today:(0,k.ymd)(z),bookings:he,audience:"guest",showTables:!0}),(0,M.jsxs)(h.Card,{highlight:te?void 0:v.colours.amber,children:[(0,M.jsx)(h.Field,{label:"Notes (optional)",value:Z,onChangeText:ee,placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,M.jsx)(h.Toggle,{label:"I confirm the allergy information for this booking",value:te,onChange:oe}),(0,M.jsx)(h.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Your details"}),(0,M.jsx)(h.Field,{label:"Name for the booking",value:Y,onChangeText:U}),(0,M.jsx)(h.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:G,onChangeText:Q,onBlur:()=>X(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Ne.ok||!K&&!G?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:Ne.error}),(0,M.jsx)(h.Field,{testID:"book-email",label:"Email (optional)",value:V,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),ze?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,M.jsxs)(h.Muted,{children:["We\u2019ll text you a confirmation",V.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,M.jsx)(i.Honeypot,{value:F,onChange:I})]})}},1215,[860,1114,877,30,34,1216,999,102,14,1124,794,861,878,867,1117,858,874,988,821,1168,864,1018,1021,1095,1119,1091,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return B}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=(e=r)&&e.__esModule?e:{default:e},u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),x=_r(_d[15]),k=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),D=_r(_d[21]),T=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]),P=_r(_d[25]),M=_r(_d[26]);function B(){const{rid:e,date:r}=(0,n.useLocalSearchParams)(),B=(0,k.useRestaurant)(e),A=(0,k.useCustomer)(),O=(0,k.useBookings)(e),N=(0,k.useEvents)(e),z=(0,k.useNow)(6e4),[R]=(0,l.useState)(()=>(0,a.startForm)()),[F,I]=(0,l.useState)(''),[q,L]=(0,l.useState)(2),[H,E]=(0,l.useState)(r??(0,x.ymd)(z)),[W,_]=(0,l.useState)(null),[Y,U]=(0,l.useState)(A.name),[G,Q]=(0,l.useState)(A.phone??''),[V,J]=(0,l.useState)(A.email??''),[K,X]=(0,l.useState)(!1),[Z,ee]=(0,l.useState)(''),[te,oe]=(0,l.useState)(!1),[se,ne]=(0,l.useState)([]),[le,ie]=(0,l.useState)(!1),ae=[...A.allergies,...se.filter(e=>!A.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[re,de]=(0,l.useState)(null),ue=(0,D.useBlocks)(e=>e.blocks);(0,j.usePublicDayStore)(e=>e.n);const ce=e?(0,j.publicDay)(e,H):null,he=ce?[...ce.bookings,...O.filter(e=>e.date!==H)]:O,me=ce?[...ue.filter(t=>t.rid!==e||t.date!==H),...ce.blocks]:ue,ge=(0,T.usePlan)(e),[pe,be]=(0,l.useState)((0,$.emptyNeeds)()),fe=!0===pe.dog,ye=fe?pe.dogs:0,xe=(0,l.useMemo)(()=>{const e=[],t=new Date(z);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return r&&!e.some(e=>(0,x.ymd)(e)===r)&&e.push((0,x.parseYmd)(r)),e},[z.toDateString(),r]);if(!B)return(0,M.jsx)(h.Screen,{title:"Not found",children:(0,M.jsx)(h.T,{children:"Restaurant not found."})});const ke=B.settings,je=(0,x.parseYmd)(H),ve=(0,y.onlinePartyBounds)(B),we=(0,D.blocksOn)(me,B.id,H),Se=he.filter(e=>e.date===H),De=ge.areas.filter(e=>e.dogs),Te=(0,P.dogSetUp)(ge),Ce=e=>(0,C.freeTablesAt)(ge,Se,q,new Date(`${H}${(0,t.tableNumbers)(e)}:00`),(0,C.turnFor)(q,ke.turnMins),ke.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(me,B.id,H,e)}),$e=(0,y.bookingSlots)(B,je,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),q,z,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,D.blockAt)(me,B.id,H,e.time),o=fe&&Te&&e.available&&!t&&(!Ce(e.time).length||!(0,$.dogTimeOk)(B,he,H,e.time,ye));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Pe=$e.some(e=>e.available),Me=(0,u.depositOf)(ke),Be=(0,u.depositDue)(Me,q),Ae=Be>0?'deposit':'none',Oe=(0,u.depositWords)(Me,q,B.name),Ne=N.filter(e=>e.date===H),ze=(0,S.ukPhone)(G),Re=(0,S.emailOk)(V),Fe=(0,$.needsMissing)(pe,A.allergies),Ie=!!W&&te&&!Fe.length&&Y.trim().length>1&&ze.ok&&Re,qe=async()=>{const e=(0,$.needsPatch)(pe,A.allergies),t=fe&&Te?Ce(W).map(e=>e.table):[],o=fe?pe.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await k.repo.bookings.create({restaurantId:B.id,customerId:A.id,name:Y,partySize:q,date:H,time:W,notes:Z.trim(),security:Ae,depositPaid:0,...Be?{depositDue:Be,depositPolicy:Oe.join(' '),depositRefundable:Me.refundable,depositCutoffHours:Me.cutoffHours}:{},phone:ze.pretty,email:V.trim()||void 0,source:'online',...e,...$e.find(e=>e.time===W)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??ae,...o?{table:o}:{}});(0,a.rememberGuard)(s.id,(0,a.guardFor)({...R,hp:F})),de(s)},Le=(0,k.useStore)(e=>re?e.bookings.find(e=>e.id===re.id)?.ref:void 0),He=e=>(0,w.waMeLink)(B.settings.whatsapp,(0,w.guestWhatsAppText)({name:e.name,ref:Le??e.ref,date:e.date,time:e.time,partySize:e.partySize},B.name));if(re){const e='pending'===re.status;return(0,M.jsxs)(h.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:B.name,children:[(0,M.jsx)(h.Banner,{kind:e?'info':'success',title:`Reference ${Le??re.ref}`,children:`${re.partySize} people \xb7 ${(0,x.niceDateYear)((0,x.parseYmd)(re.date))} at ${re.time}`}),e?(0,M.jsx)(h.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(h.T,{children:["Name: ",re.name]}),(0,M.jsxs)(h.T,{children:["Mobile: ",re.phone]}),re.email?(0,M.jsxs)(h.T,{children:["Email: ",re.email]}):null,(0,M.jsxs)(h.T,{children:["Allergies shared with the restaurant: ",re.allergies.length?re.allergies.map(e=>`${(0,p.allergenLabel)(e.allergen)} (${(0,p.severityLabel)(e.severity)})`).join(', '):'none']}),re.notes?(0,M.jsxs)(h.T,{children:["Notes: ",re.notes]}):null,re.dog?(0,M.jsxs)(h.T,{children:["\ud83d\udc15 Dog coming too",re.table?` \xb7 dog-friendly table ${re.table}`:'']}):null,re.holds?.length?(0,M.jsxs)(h.T,{children:["Reserved: ",re.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(B.settings.reservables??P.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,re.tableReq?.length?(0,M.jsxs)(h.T,{children:["Table requested: ",re.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===re.security&&re.depositDue?(0,M.jsxs)(h.T,{weight:"semibold",children:["Deposit due: ",(0,f.gbp)(re.depositDue),". ",B.name," will tell you how to pay it."]}):null,'deposit'===re.security&&re.depositPolicy?(0,M.jsx)(h.Muted,{children:re.depositPolicy}):null,(0,M.jsx)(h.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,M.jsxs)(h.Muted,{children:["Need to change or cancel? Call ",B.phone," and quote ",Le??re.ref,"."]})]}),He(re)?(0,M.jsxs)(d.default,{style:{gap:4},children:[(0,M.jsx)(h.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=He(re);e&&(0,w.openWhatsApp)(e)}}),(0,M.jsx)(h.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,M.jsx)(h.Button,{label:"Back to restaurant",onPress:()=>n.router.replace(`/customer/${B.id}`)})]})}return(0,M.jsxs)(h.Screen,{title:"Book a table",subtitle:B.name,footer:(0,M.jsx)(h.Button,{label:Fe.length?Fe[0]:q>(ke.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Ie,onPress:()=>qe(),testID:"confirm-booking"}),children:[(0,M.jsx)($.FirstQuestions,{rid:B.id,value:pe,onChange:e=>{e.dog===pe.dog&&e.dogs===pe.dogs||_(null),be(e)},party:q,audience:"guest",profile:A.allergies}),(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(d.default,{style:{gap:6,alignItems:'center'},children:[(0,M.jsx)(h.H2,{children:"Party size"}),(0,M.jsx)(o.PartySizeInput,{value:q,onChange:e=>{L(e),_(null)},min:ve.min,max:ve.max,label:"Party size",testID:"party-size"})]}),Be?(0,M.jsx)(h.Banner,{kind:"info",title:`Deposit: ${(0,f.gbp)(Be)} for ${q} guests`,children:(0,M.jsx)(d.default,{style:{gap:4},children:Oe.map(e=>(0,M.jsx)(h.T,{size:13,children:e},e))})}):Me.on&&Me.perPersonPence>0?(0,M.jsxs)(h.Muted,{children:["No deposit for fewer than ",Me.fromParty," guests."]}):null,q>(ke.autoAcceptUpTo??7)?(0,M.jsxs)(h.Muted,{children:["For ",q," people the team checks the booking first, then texts you to confirm."]}):null,fe&&Te?(0,M.jsxs)(h.Muted,{children:["Dogs are welcome in the ",De.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",B.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Date"}),(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:xe.map(e=>{const t=!!(0,b.hoursFor)(B,e),o=N.some(t=>t.date===(0,x.ymd)(e));return(0,M.jsx)(h.Chip,{label:(0,x.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:H===(0,x.ymd)(e),onPress:()=>{E((0,x.ymd)(e)),_(null)}},(0,x.ymd)(e))})}),Ne.map(e=>(0,M.jsx)(h.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Time"}),0===$e.length?(0,M.jsx)(h.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:$e.map(e=>(0,M.jsx)(h.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left_(e.time)},e.time))}),we.length>0&&$e.some(e=>e.blocked)?(0,M.jsx)(h.Banner,{kind:"info",title:Pe?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${we.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,x.niceDate)(je)}. Please give us a ring on ${B.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,s.lastFoodOn)(B,H);return e&&$e.some(e=>e.drinksOnly)?(0,M.jsx)(h.Banner,{kind:"info",title:`Last food orders ${(0,s.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),fe&&$e.some(e=>e.noDog)?(0,M.jsx)(h.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${De.map(e=>e.name).join(' and ')}${B.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,D.closedAreasAt)(me,B.id,H,W??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,M.jsx)(h.Muted,{children:(0,y.bookingLimitsHint)(B)})]}),(0,M.jsx)($.MoreQuestions,{rid:B.id,r:B,value:pe,onChange:be,party:q,date:H,time:W,today:(0,x.ymd)(z),bookings:he,audience:"guest",showTables:!0}),(0,M.jsxs)(h.Card,{highlight:te?void 0:v.colours.amber,children:[(0,M.jsx)(h.Field,{label:"Notes (optional)",value:Z,onChangeText:ee,placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,M.jsx)(h.Toggle,{label:"I confirm the allergy information for this booking",value:te,onChange:oe}),(0,M.jsx)(h.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Your details"}),(0,M.jsx)(h.Field,{label:"Name for the booking",value:Y,onChangeText:U}),(0,M.jsx)(h.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:G,onChangeText:Q,onBlur:()=>X(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),ze.ok||!K&&!G?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:ze.error}),(0,M.jsx)(h.Field,{testID:"book-email",label:"Email (optional)",value:V,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Re?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,M.jsxs)(h.Muted,{children:["We\u2019ll text you a confirmation",V.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,M.jsx)(i.Honeypot,{value:F,onChange:I})]})}},1215,[860,1114,877,30,34,1216,999,102,14,1124,794,861,878,867,1117,858,874,988,821,1168,864,1018,1021,1095,1119,1091,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Honeypot=function({value:t,onChange:n}){return(0,l.jsx)(o.default,{"aria-hidden":!0,pointerEvents:"none",style:{position:'absolute',left:-1e4,top:0,width:1,height:1,overflow:'hidden',opacity:0},children:(0,l.jsx)(e.TextInput,{testID:"hp-field",accessibilityLabel:"Leave this empty",value:t,onChangeText:n,tabIndex:-1,autoComplete:'off',name:'cc_extra_info','aria-hidden':!0})})};var e=r(d[0]);r(d[1]),r(d[2]);var t,n=r(d[3]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[4])},1216,[827,34,236,102,25]); __d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var t=_r(_d[0]),n=_r(_d[1]),l=e(_r(_d[2])),s=e(_r(_d[3])),r=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]);function f(){const{rid:e,did:f}=(0,t.useLocalSearchParams)(),b=(0,u.useRestaurant)(e),j=(0,u.useMenu)(e).find(e=>e.id===f),x=(0,u.useCustomer)(),m=(0,u.useRecipeCards)(e).find(e=>e.id===j?.recipeCardId),y=m?.signOff&&m.photo?(0,h.recipeCards)().photoSource(m.photo):null,k=(0,u.useStore)(e=>e.addLine),[v,w]=(0,n.useState)(()=>(j?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[S,C]=(0,n.useState)(1),[B,$]=(0,n.useState)(''),[I,P]=(0,n.useState)(!1),[L,T]=(0,n.useState)(!1),[D,O]=(0,n.useState)(!1),[A,M]=(0,n.useState)(!1),R=(0,n.useMemo)(()=>j?(0,d.effectiveAllergens)(j,v):{},[j,v]);if(!b||!j)return(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Dish not found."})});const q=(0,d.conflictsFor)(R,x.allergies),_=(j.price??0)+(j.optionGroups??[]).flatMap(e=>e.choices).filter(e=>v.includes(e.id)).reduce((e,t)=>e+t.priceDelta,0),N=j.soldOut||!j.signOff||null===j.price,G=(e,t)=>{const n=j.optionGroups.find(t=>t.id===e);w(e=>{const l=n.choices.map(e=>e.id);return n.multi?e.includes(t)?e.filter(e=>e!==t):[...e,t]:e.includes(t)&&!n.required?e.filter(e=>e!==t):[...e.filter(e=>!l.includes(e)),t]})},z=e=>{u.useStore.getState().basket.restaurantId!==b.id&&u.useStore.getState().startBasket(b.id,'takeaway'),k({itemId:j.id,qty:S,choiceIds:v,notes:B,override:e?{allergens:q.contains,at:(new Date).toISOString()}:void 0}),P(!1),M(!0)};return(0,p.jsxs)(o.Screen,{title:j.name,subtitle:b.name,right:(0,p.jsx)(a.BasketButton,{}),children:[y?(0,p.jsx)(l.default,{testID:"dish-photo",source:y,accessibilityLabel:`${j.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.T,{weight:"bold",size:20,colour:g.colours.gold,children:null===j.price?j.priceNote:(0,c.gbp)(_)}),j.dietary.map(e=>(0,p.jsx)(o.Badge,{kind:"ok",label:e},e))]}),(0,p.jsx)(o.T,{children:j.description}),q.contains.length?(0,p.jsx)(o.Banner,{kind:"danger",title:`Blocked: contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,q.may.length?(0,p.jsx)(o.Banner,{kind:"warn",title:`Warning: may contain ${q.may.map(d.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(j.optionGroups??[]).map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:e.choices.map(t=>(0,p.jsx)(o.Chip,{label:t.label,sub:t.priceDelta?`+${(0,c.gbp)(t.priceDelta)}`:void 0,selected:v.includes(t.id),onPress:()=>G(e.id,t.id)},t.id))})]},e.id)),(0,p.jsx)(o.Card,{children:(0,p.jsx)(r.AllergenPanel,{item:j,map:R,declared:x.allergies})}),b.fictional?null:(0,p.jsx)(o.ExampleAllergenNotice,{}),(0,p.jsx)(o.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:B,onChangeText:$}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Quantity"}),(0,p.jsx)(o.Stepper,{value:S,onChange:C,label:"quantity"})]}),A?(0,p.jsx)(o.Banner,{kind:"success",title:"Added to basket",children:q.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,N?(0,p.jsx)(o.Banner,{kind:"warn",children:j.soldOut?'Sold out today.':j.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):q.contains.length?(0,p.jsxs)(s.default,{style:{gap:8},children:[(0,p.jsx)(o.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,p.jsx)(o.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{T(!1),O(!1),P(!0)},testID:"override-open"})]}):(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{style:{flex:1},label:`Add ${S} to basket \xb7 ${(0,c.gbp)(_*S)}`,onPress:()=>z(!1),testID:"add-to-basket"}),A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,p.jsxs)(o.Sheet,{visible:I,onClose:()=>P(!1),title:"Allergy override",children:[(0,p.jsx)(o.Banner,{kind:"danger",title:`${j.name} contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`Your profile says: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}.`}),(0,p.jsx)(o.Toggle,{label:"I understand this dish contains an allergen I have declared",value:L,onChange:T}),(0,p.jsx)(o.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:D,onChange:O}),(0,p.jsx)(o.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,p.jsx)(o.Button,{kind:"danger",disabled:!L||!D,label:"Confirm override and add",onPress:()=>z(!0),testID:"override-confirm"})]})]})}},1217,[30,34,336,102,1192,1218,794,861,867,874,882,821,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BasketButton=function(){const s=(0,l.useBasket)().lines.reduce((e,s)=>e+s.qty,0);return s?(0,c.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:`Basket, ${s} items`,onPress:()=>e.router.push('/customer/basket'),style:{backgroundColor:u.colours.gold,borderRadius:999,paddingHorizontal:12,paddingVertical:6},children:(0,c.jsxs)(n.T,{weight:"semibold",colour:u.colours.onGold,size:14,children:["Basket \xb7 ",s]})}):null};var e=r(d[0]);r(d[1]);var s,t=r(d[2]),o=(s=t)&&s.__esModule?s:{default:s},l=r(d[3]),u=r(d[4]),n=r(d[5]),c=r(d[6])},1218,[30,34,402,874,821,794,25]); @@ -1530,7 +1530,7 @@ __d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{ __d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.TrendLine=y,_e.SpendPerHeadPage=function(){const{rid:e,today:s}=(0,c.useCtx)(6e4),a=(0,r.useBookings)(e),n=(0,o.useCashUp)(e=>e.cashUps),[b,j]=(0,t.useState)('day'),k=(0,d.hasAnyTakings)(n,e),w=(0,d.dayRows)(n,a,e,s,14),f=(0,d.weekRows)(n,a,e,s,8),v=(0,d.averageSph)(w),$=(e,t,s,a,n)=>(0,u.jsxs)(l.default,{testID:`sph-row-${e}`,style:{alignItems:'center',paddingVertical:8,borderTopWidth:1,borderTopColor:h.colours.hairline,gap:2},accessible:!0,accessibilityLabel:`${t}: ${'No takings entered'===a?'no takings entered':`spend per head ${a}`}, ${s}${n?`, ${n}`:''}`,children:[(0,u.jsx)(i.T,{center:!0,children:t}),(0,u.jsx)(i.T,{center:!0,colour:h.colours.muted,children:s}),(0,u.jsx)(i.T,{center:!0,weight:"semibold",colour:'No takings entered'===a?h.colours.muted:h.colours.goldLight,size:'No takings entered'===a?13:16,children:a}),n?(0,u.jsx)(i.Muted,{center:!0,children:n}):null]},e);return(0,u.jsxs)(l.default,{style:{gap:12},testID:"sph-screen",children:[(0,u.jsx)(i.Muted,{children:"Tip: spend per head is Gross takings \xf7 Covers. Enter the gross on the cash up (Take a picture of the taking sheet, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out."}),(0,u.jsxs)(i.Card,{highlight:h.colours.gold,children:[(0,u.jsx)(i.T,{size:12,weight:"semibold",colour:h.colours.gold,style:{letterSpacing:1.5},children:"LAST 14 DAYS"}),null==v?(0,u.jsx)(i.T,{size:22,weight:"semibold",colour:h.colours.muted,testID:"sph-none",children:"No takings entered"}):(0,u.jsxs)(i.T,{size:34,weight:"bold",colour:h.colours.goldLight,testID:"sph-avg",children:[p(v)," ",(0,u.jsx)(i.T,{size:16,colour:h.colours.muted,children:"per head"})]}),(0,u.jsx)(i.Muted,{children:k?'Only days with gross takings entered are counted.':'Nothing has been entered yet. Spend per head appears once a cash up has Gross takings.'})]}),(0,u.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,u.jsx)(i.Chip,{testID:"sph-day",label:"By day",selected:'day'===b,onPress:()=>j('day')}),(0,u.jsx)(i.Chip,{testID:"sph-week",label:"By week",selected:'week'===b,onPress:()=>j('week')})]}),'day'===b?(0,u.jsxs)(i.Card,{children:[(0,u.jsx)(i.T,{weight:"semibold",children:"Spend per head by day"}),(0,u.jsx)(y,{testID:"sph-trend-day",label:"Spend per head trend by day",points:w.map(e=>({label:x(e.date),value:e.sph}))}),[...w].reverse().map(e=>$(e.date,x(e.date),`${e.covers} Covers`,null==e.sph?'No takings entered':p(e.sph),null!=e.foodPh||null!=e.drinkPh?`food ${p(e.foodPh)}, drink ${p(e.drinkPh)} per head`:void 0))]}):null,'week'===b?(0,u.jsxs)(i.Card,{children:[(0,u.jsx)(i.T,{weight:"semibold",children:"Spend per head by week (Mon\u2013Sun)"}),(0,u.jsx)(y,{testID:"sph-trend-week",label:"Spend per head trend by week",points:f.map(e=>({label:`w/c ${x(e.weekStart).split(' ').slice(1).join(' ')}`,value:e.sph}))}),[...f].reverse().map(e=>$(e.weekStart,`w/c ${x(e.weekStart)}`,e.days?`${e.covers} Covers \xb7 ${e.days} day${1===e.days?'':'s'}`:'\u2014',null==e.sph?'No takings entered':p(e.sph)))]}):null,(0,u.jsx)(i.Muted,{children:"Order-at-table totals will be added here when order at table is switched on. Nothing on this page is estimated."})]})};var t=_r(_d[0]),s=e(t),l=e(_r(_d[1])),a=_r(_d[2]),n=e(a),i=_r(_d[3]),r=_r(_d[4]),o=_r(_d[5]),d=_r(_d[6]),h=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]);const p=e=>null==e?'\u2014':`\xa3${e.toLocaleString('en-GB',{minimumFractionDigits:2,maximumFractionDigits:2})}`,x=e=>new Date(`${e}T12:00:00Z`).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short',timeZone:'UTC'});function y({points:e,testID:r,label:o}){const[d,c]=(0,t.useState)(320),[x,y]=(0,t.useState)(e.length);(0,t.useEffect)(()=>y(e.length),[e.length,r]);const b=d<340?2:3,j=Math.min(e.length,Math.max(b,x)),k=Math.max(0,j-b),w=e.slice(k,j),f=Math.max(140,d-68),v=e.map(e=>e.value).filter(e=>null!=e),$=Math.max(5,5*Math.ceil(Math.max(0,...v)/5)),T=e=>38+e*(f-76)/Math.max(1,w.length-1),S=e=>140-e/$*106,L=[];let D=[];w.forEach((e,t)=>{null==e.value?(D.length&&L.push(D),D=[]):D.push({i:t,v:e.value})}),D.length&&L.push(D);const M=e.filter(e=>null!=e.value).map(e=>`${e.label} ${p(e.value)}`).join(', ');return(0,u.jsxs)(l.default,{testID:r,onLayout:e=>c(e.nativeEvent.layout.width),style:{gap:8},children:[(0,u.jsxs)(l.default,{accessible:!0,accessibilityLabel:`${o}. ${M||'No takings entered'}`,style:{flexDirection:'row',minWidth:0},children:[(0,u.jsx)(n.default,{width:64,height:170,children:[0,1,2,3,4].map(e=>(0,u.jsx)(a.Text,{x:60,y:S($*e/4)+4,textAnchor:"end",fontSize:11,fill:h.colours.muted,children:p($*e/4)},e))}),(0,u.jsxs)(n.default,{width:f,height:170,children:[[0,1,2,3,4].map(e=>(0,u.jsx)(a.Line,{x1:0,x2:f,y1:S($*e/4),y2:S($*e/4),stroke:h.colours.border,strokeWidth:1},e)),L.map((e,t)=>(0,u.jsx)(a.Polyline,{points:e.map(e=>`${T(e.i)},${S(e.v)}`).join(' '),fill:"none",stroke:h.colours.gold,strokeWidth:2.5},t)),w.map((e,t)=>(0,u.jsx)(s.default.Fragment,{children:null==e.value?(0,u.jsx)(a.Circle,{cx:T(t),cy:140,r:2,fill:"#444"}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(a.Circle,{cx:T(t),cy:S(e.value),r:4,fill:h.colours.goldLight}),(0,u.jsx)(a.Text,{x:T(t),y:S(e.value)-10,textAnchor:"middle",fontSize:12,fontWeight:"bold",fill:h.colours.goldLight,children:p(e.value)})]})},k+t))]})]}),(0,u.jsx)(l.default,{style:{flexDirection:'row',gap:12},children:w.map((e,t)=>(0,u.jsxs)(l.default,{style:{flex:1,minWidth:0},accessible:!0,accessibilityLabel:`${e.label}: ${null==e.value?'No takings entered':p(e.value)}`,children:[(0,u.jsx)(i.T,{center:!0,size:12,colour:h.colours.muted,children:e.label}),(0,u.jsx)(i.T,{center:!0,size:14,weight:"semibold",colour:null==e.value?h.colours.muted:h.colours.goldLight,children:null==e.value?'No takings entered':p(e.value)})]},k+t))}),(0,u.jsxs)(i.Row,{wrap:!0,gap:8,style:{justifyContent:'center'},children:[(0,u.jsx)(i.Button,{small:!0,kind:"secondary",label:"Earlier",accessibilityLabel:"Earlier spend per head chart points",disabled:0===k,onPress:()=>y(Math.max(b,j-b))}),(0,u.jsx)(i.Button,{small:!0,kind:"secondary",label:"Later",accessibilityLabel:"Later spend per head chart points",disabled:j>=e.length,onPress:()=>y(Math.min(e.length,j+b))})]})]})}},1447,[34,102,797,794,874,1031,1448,821,1079,25]); __d(function(g,_r,_i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"COUNTED",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"serviceOfBooking",{enumerable:!0,get:function(){return o}}),e.coversOn=d,e.dayRows=i,e.weekRows=function(n,t,s,o,d){const u=(0,r.weekStartOf)(o);return Array.from({length:d},(l,f)=>{const h=(0,r.addDaysYmd)(u,7*(f-d+1)),m=i(n,t,s,(0,r.addDaysYmd)(h,6),7).filter(r=>r.date<=o&&null!=r.gross),p=m.length?Math.round(100*m.reduce((r,n)=>r+n.gross,0))/100:null,v=m.reduce((r,n)=>r+n.covers,0);return{weekStart:h,gross:p,covers:v,days:m.length,sph:c(p,v)}})},e.serviceRows=function(n,t,s,o,i,l=1020){const f=new Map(n.filter(r=>r.rid===s&&r.confirmedAt).map(r=>[r.date,r])),h=[];for(let n=0;nnull!=r.gross&&r.covers>0);return n.length?c(n.reduce((r,n)=>r+n.gross,0),n.reduce((r,n)=>r+n.covers,0)):null},Object.defineProperty(e,"hasAnyTakings",{enumerable:!0,get:function(){return l}});var r=_r(_d[0]);const n=['seated','finished'],t=r=>n.includes(r.status),s=r=>{const[n,t]=r.split(':').map(Number);return 60*n+(t||0)},o=(r,n)=>s(r.time)r.restaurantId===n&&r.date===s&&t(r)&&(!d||o(r,u)===d)).reduce((r,n)=>r+(n.partySize||0),0)}const u=r=>'number'==typeof r&&Number.isFinite(r)?r:null,c=(r,n)=>null==r||n<=0?null:Math.round(r/n*100)/100;function i(n,t,s,o,i){const l=new Map(n.filter(r=>r.rid===s&&r.confirmedAt).map(r=>[r.date,r]));return Array.from({length:i},(n,f)=>{const h=(0,r.addDaysYmd)(o,f-i+1),m=l.get(h)?.vals??{},p=(0,r.grossOf)(m),v=d(t,s,h),y=u(m.food),b=u(m.drink);return{date:h,gross:p,covers:v,sph:c(p,v),food:y,drink:b,foodPh:c(y,v),drinkPh:c(b,v)}})}const l=(n,t)=>n.some(n=>n.rid===t&&n.confirmedAt&&null!=(0,r.grossOf)(n.vals))},1448,[13]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.MyAvatar=function(){const{meId:s,me:c}=(0,n.useCtx)(6e4);return(0,u.jsx)(t.AvatarMaker,{meId:s,me:c})},r(d[0]);var t=r(d[1]),n=r(d[2]),u=r(d[3])},1449,[34,793,1079,25]); -__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.GiftVouchers=function(){return n.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(Q,{}):(0,V.jsx)(W,{})},_e.Merch=function(){return n.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(Q,{}):(0,V.jsx)(X,{})},_e.TablesQr=function({go:e}={}){const{rid:s,r:t,now:r,me:a}=(0,A.useCtx)(1e4);return n.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(l.StaffTableOrders,{rid:s,me:a}),(0,V.jsx)(v.Muted,{children:"QR codes, tables and hours: Settings \u203a Advanced \u203a Order at the table."})]}):(0,M.orderAtTableOn)(t)?(0,V.jsx)(q,{rid:s,now:r,me:a}):(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Banner,{kind:"info",title:"Order at table is off",children:"In-house orders go through your till. Switch it on in Settings \u203a Order at table if this venue takes orders at the table."}),e?(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Open Order at table settings",onPress:()=>e('more','orderattable')}):null]})},_e.TakeawaySettings=function({go:e}){const{rid:s,r:t,now:r}=(0,A.useCtx)(3e4),n=(0,T.useOrders)(s),a=t.settings,l=(0,P.takeawaySlots)(t,n,r).slice(0,10),i=e=>G().updateSettings(s,e),o=n.filter(e=>'takeaway'===e.type&&(0,B.LIVE)(e));return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Card,{highlight:a.takeawayPaused?I.colours.red:I.colours.ok,children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",children:a.takeawayPaused?'Takeaway paused':'Taking takeaway orders'}),(0,V.jsx)(v.Toggle,{label:"Takeaway on",value:!a.takeawayPaused,onChange:e=>i({takeawayPaused:!e})})]}),(0,V.jsx)(v.Muted,{children:"Direct ordering, no delivery-app commission."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Collection slots & capacity"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Slot length (min)"}),(0,V.jsx)(v.Stepper,{value:a.slotMinutes,min:5,max:30,onChange:e=>i({slotMinutes:e}),label:"slot minutes"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Orders per slot"}),(0,V.jsx)(v.Stepper,{value:a.slotCap,min:1,max:20,onChange:e=>i({slotCap:e}),label:"orders per slot"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Earliest pickup (min ahead)"}),(0,V.jsx)(v.Stepper,{value:a.leadMins,min:5,max:60,onChange:e=>i({leadMins:e}),label:"lead minutes"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Readiness buffer (min)"}),(0,V.jsx)(v.Stepper,{value:a.bufferMins,min:0,max:20,onChange:e=>i({bufferMins:e}),label:"buffer minutes"})]}),(0,V.jsx)(v.Muted,{children:"Readiness alerts (start cooking \u2192 bag it \u2192 ready) are for takeaway only, timed from the pickup slot. Dine-in starts when the table is seated and has ordered."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Next slots"}),l.map(e=>(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{size:14,children:e.label}),(0,V.jsx)(w.default,{style:{flex:1,height:8,marginHorizontal:8,backgroundColor:I.colours.border,borderRadius:4},children:(0,V.jsx)(w.default,{style:{width:e.taken/e.cap*100+"%",height:8,backgroundColor:e.full?I.colours.red:I.colours.gold,borderRadius:4}})}),(0,V.jsxs)(v.Muted,{children:[e.taken,"/",e.cap]})]},e.label))]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",children:["Live queue: ",o.length]}),(0,V.jsx)(v.Button,{small:!0,label:"Open orders",onPress:()=>e('orders')})]}),o.map(e=>(0,V.jsxs)(v.Muted,{children:[e.slotTime?(0,O.hm)(new Date(e.slotTime)):'\u2013'," \xb7 ",e.ref," ",e.customerName," \xb7 ",(0,B.statusLabel)(e)]},e.id))]})]})},_e.BookingSettings=function({go:e}){const{rid:r,r:n}=(0,A.useCtx)(6e4),a=n.settings,l=(0,S.useOwner)(e=>e.reminders),i=e=>G().updateSettings(r,e),o=e=>S.useOwner.getState().setOwner({reminders:{...l,...e}});return(0,V.jsxs)(w.default,{style:{gap:10},children:[s.IS_GREENSIDE?(0,V.jsx)(t.GreensideCashOnly,{}):(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Deposits"}),(0,V.jsxs)(v.Muted,{children:[(()=>{const e=(0,c.depositOf)(a);return e.on&&e.perPersonPence>0?`On: ${(0,R.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more.`:'Off.'})()," Deposits are paid through website bookings: website bookings show Deposit paid on website bookings by themselves; staff tick phone and walk-in deposits paid."]}),(0,V.jsx)(v.Muted,{children:"Tip: change the amount, party size, refunds and the words guests see in Settings \u203a Advanced \u203a Deposits."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Reminders"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Reminder 24 hours before"}),(0,V.jsx)(v.Toggle,{label:"24h reminder",value:l.h24,onChange:e=>o({h24:e})})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Reminder 2 hours before"}),(0,V.jsx)(v.Toggle,{label:"2h reminder",value:l.h2,onChange:e=>o({h2:e})})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Ask guests to confirm or cancel"}),(0,V.jsx)(v.Toggle,{label:"confirm",value:l.confirmText,onChange:e=>o({confirmText:e})})]}),(0,V.jsx)(v.Muted,{children:"Guest reminders are not connected; nothing is sent."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Capacity & waitlist"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Booking start times (min)"}),(0,V.jsx)(v.Stepper,{value:(0,P.bookingSlotMinutesOf)(n),min:15,max:30,step:15,onChange:e=>i({bookingSlotMinutes:e}),label:"booking start times"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Covers per 30-min slot"}),(0,V.jsx)(v.Stepper,{value:a.bookingCoversPerSlot,min:2,max:60,onChange:e=>i({bookingCoversPerSlot:e}),label:"Covers per slot"})]}),(0,V.jsx)(v.Muted,{children:"Guests can pick a start every 15 or 30 minutes. The covers cap is still for each half hour, so 19:00 and 19:15 share the same limit."}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Typical table turn (min)"}),(0,V.jsx)(v.Stepper,{value:a.turnMins,min:30,max:180,onChange:e=>i({turnMins:e}),label:"turn minutes"})]}),(0,V.jsx)(v.Muted,{children:"The online waitlist estimate uses the table turn time."}),(0,V.jsx)(v.Button,{small:!0,label:"Open bookings & waitlist",onPress:()=>e('bookings')})]})]})},_e.AllergyHub=function({go:e}){const{rid:s,today:t,role:r,me:n}=(0,A.useCtx)(1e4),[a,l]=(0,m.useState)(null),i=(0,T.useOrders)(s),o=(0,T.useStore)((0,k.useShallow)(e=>e.bookings.filter(e=>e.restaurantId===s&&e.date===t))),d=(0,T.useAudit)(s).filter(e=>'allergy'===e.kind),c=(0,z.useUnsignedDishes)(s),h=(0,T.useStore)(e=>e.bookings),u=i.filter(e=>(0,B.LIVE)(e)&&(0,D.chainNeedsAction)(e,h)).length+o.filter(e=>'cancelled'!==e.status&&(0,D.bookingNeedsAction)(e,i.filter(B.LIVE))).length,g=(0,A.useSignedIn)(),p=(0,F.cardActorFor)(n,'owner'===r?'owner':'manager'===r?'manager':'staff',g);if('unsigned'===a)return(0,V.jsx)(z.UnsignedDishList,{rid:s,actor:p,onClose:()=>l(null),onOpenCards:()=>e('more','recipecards')});if('pending'===a)return(0,V.jsx)(K,{go:e,onClose:()=>l(null)});const b={flex:1,minHeight:48};return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Banner,{kind:"info",title:"Supports staff, doesn't replace them",children:"CoverCharge flags the 14 UK allergens and asks a named person to verify. Staff still check with the guest and the recipe every time."}),(0,V.jsxs)(v.Row,{gap:8,children:[(0,V.jsx)(y.default,{testID:"tile-awaiting-verification",accessibilityRole:"button",accessibilityLabel:`Awaiting verification, ${u}. Opens the list.`,onPress:()=>l('pending'),style:({pressed:e})=>[b,{opacity:e?.85:1}],children:(0,V.jsxs)(v.Card,{style:{flex:1,alignItems:'center'},highlight:u?I.colours.red:void 0,children:[(0,V.jsx)(v.Muted,{center:!0,children:"Awaiting verification"}),(0,V.jsx)(v.T,{center:!0,size:20,weight:"bold",children:u})]})}),(0,V.jsx)(y.default,{testID:"tile-not-signed-off",accessibilityRole:"button",accessibilityLabel:`Dishes not signed off, ${c.length}. Opens the list.`,onPress:()=>l('unsigned'),style:({pressed:e})=>[b,{opacity:e?.85:1}],children:(0,V.jsxs)(v.Card,{style:{flex:1,alignItems:'center'},highlight:c.length?I.colours.amber:void 0,children:[(0,V.jsx)(v.Muted,{center:!0,children:"Dishes not signed off"}),(0,V.jsx)(v.T,{center:!0,size:20,weight:"bold",children:c.length})]})})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"1. Allergens per dish (14 UK allergens)"}),(0,V.jsx)(v.Muted,{children:"Each dish\u2019s recipe card lists contains / may contain, suggested from its ingredients. The head chef signs each card off; the menu, takeaway and booking checks all read the cards."}),(0,V.jsx)(v.Button,{small:!0,label:"Recipe cards",onPress:()=>e('more','recipecards')})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"2. Kitchen alerts on orders & bookings"}),(0,V.jsx)(v.Muted,{children:"Red allergy cards; cooking is blocked until the Kitchen sign-off."}),(0,V.jsxs)(v.Row,{gap:6,children:[(0,V.jsx)(v.Button,{small:!0,label:"Orders",onPress:()=>e('orders')}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Bookings",onPress:()=>e('bookings')})]})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"3. Five-step sign-off chain"}),(0,V.jsx)(v.Muted,{children:"Booked, Ordered, Kitchen, Pass and Table: a named person taps Sign off at each step, in order."}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Allergen sign-off log",onPress:()=>e('more','allergen-signoffs')})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"4. Audit log"}),d.slice(0,6).map(e=>(0,V.jsxs)(v.Muted,{children:[(0,O.hm)(new Date(e.at))," \xb7 ",e.text]},e.id)),d.length?null:(0,V.jsx)(v.Muted,{children:"No allergy events yet."}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Full log & daily checks",onPress:()=>e('more','compliance')})]})]})},_e.TabletPreview=function(){return(0,V.jsx)(w.default,{style:{gap:10},children:(0,V.jsxs)(v.Card,{highlight:I.colours.gold,style:{alignItems:'center'},children:[(0,V.jsxs)(w.default,{style:{width:240,height:160,borderRadius:14,borderWidth:3,borderColor:I.colours.border,alignItems:'center',justifyContent:'center'},children:[(0,V.jsx)(v.T,{size:30,children:"\ud83d\udda5\ufe0f"}),(0,V.jsx)(v.T,{weight:"semibold",children:"Kitchen & front-of-house tablet"})]}),(0,V.jsx)(v.T,{size:20,weight:"bold",colour:I.colours.gold,children:"CoverCharge for Display"}),(0,V.jsx)(v.Muted,{center:!0,children:"The in-restaurant tablet and kitchen display is its own app, CoverCharge for Display (landscape). Everything it shows (orders, readiness alerts, allergies, bookings) is also live in this app."})]})})},_e.AllFeatures=function({go:e}){const{role:s,r:t}=(0,A.useCtx)(6e4),r=(0,d.useLiveVenue)(),n=s=>s.startsWith('tab:')?e(s.slice(4)):e('more',s),a=e=>e.startsWith('tab:')?'tab:forecast'!==e||S.CAN.forecasts(s):(()=>{const t=L.PAGES.find(s=>s.id===e);return!!t&&(!t.can||t.can(s))})();return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Card,{highlight:I.colours.gold,children:[(0,V.jsx)(v.T,{weight:"semibold",children:"CoverCharge is five apps that share one set of venue data"}),[['CoverCharge for Managers','This app. Run the venue: orders, bookings, forecasts, team, menu, marketing, social posting, billing.','This app'],['CoverCharge for Staff','Clock in/out with break prompt, rota, swaps & leave, chat, my hours & pay, my tips.','Separate app'],['CoverCharge',`For customers: menu, takeaway ordering, table bookings, loyalty, gift cards${(0,M.orderAtTableOn)(t)?', QR table ordering':''}.`,'Separate app'],['CoverCharge for Display','Restaurant tablet / kitchen display: live orders, readiness, allergy alerts.','Separate app'],['CoverCharge for Head Chef','Stock and deliveries, recipe costing and GP, menu engineering, waste, ordering, prep lists, allergens, kitchen compliance, kitchen rota and chat, plus My pay & tips (their own hours, tips, tip goal and paydays only). No other staff pay, customer data or billing.','Separate app']].map(([e,s,t])=>(0,V.jsxs)(v.Row,{style:{alignItems:'flex-start'},children:[(0,V.jsxs)(w.default,{style:{flex:1},children:[(0,V.jsx)(v.T,{weight:"medium",children:e}),(0,V.jsx)(v.Muted,{children:s})]}),(0,V.jsx)(v.Badge,{kind:'This app'===t?'ok':'gold',label:t})]},e)),'owner'===s?(0,V.jsx)(v.Chip,{label:"Open the Staff app preview \u203a",onPress:()=>{S.useOwner.getState().setPreviewRole('staff'),e('home')}}):null,(0,V.jsx)(v.Muted,{children:r?'All five share your venue\u2019s live data. Each is installed separately, and your venue\u2019s own logo leads (Settings \u203a Branding).':'This copy isn\u2019t connected to a venue yet, so it only shows what is saved on this device. Each app is installed separately, and the venue\u2019s own logo leads (Settings \u203a Branding).'})]}),(0,V.jsx)(v.Muted,{children:"Every CoverCharge feature and where to manage it."}),[...Y].filter(e=>4!==e.n||(0,M.orderAtTableOn)(t)).sort((e,s)=>e.n-s.n).map(e=>(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{alignItems:'flex-start'},children:[(0,V.jsxs)(v.T,{weight:"bold",colour:I.colours.gold,style:{width:26},children:[e.n,"."]}),(0,V.jsxs)(w.default,{style:{flex:1},children:[(0,V.jsx)(v.T,{weight:"semibold",children:e.title}),(0,V.jsx)(v.Muted,{children:e.note})]})]}),(0,V.jsx)(v.Row,{wrap:!0,gap:6,children:e.links.filter(([,e])=>a(e)).map(([e,s])=>(0,V.jsx)(v.Chip,{label:`${e} \u203a`,onPress:()=>n(s)},s))})]},e.n))]})},Object.defineProperty(_e,"Divider",{enumerable:!0,get:function(){return v.Divider}}),_e.Loyalty=function(){return n.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(ee,{kind:"card"}):(0,V.jsx)(_,{})},_e.Referrals=function(){return n.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(ee,{kind:"referrals"}):(0,V.jsx)(H,{})};var s=_r(_d[0]),t=_r(_d[1]),r=_r(_d[2]),n=_r(_d[3]),a=_r(_d[4]),l=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),u=_r(_d[11]),g=_r(_d[12]),p=_r(_d[13]),b=_r(_d[14]),m=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),y=e(_r(_d[19])),w=e(_r(_d[20])),k=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),T=_r(_d[24]),S=_r(_d[25]),R=_r(_d[26]),M=_r(_d[27]),P=_r(_d[28]),O=_r(_d[29]),I=_r(_d[30]),B=_r(_d[31]),A=_r(_d[32]),N=_r(_d[33]),$=_r(_d[34]),L=_r(_d[35]),D=_r(_d[36]),E=_r(_d[37]),z=_r(_d[38]),F=_r(_d[39]),U=_r(_d[40]),V=_r(_d[41]);const G=()=>T.useStore.getState();function _(){const{rid:e,r:t,me:n}=(0,A.useCtx)(3e4),a=t.settings,l=(0,T.useStore)((0,k.useShallow)(s=>s.stampCards.filter(s=>s.restaurantId===e))),i=(0,T.useStore)(e=>e.customer.name),o=(0,T.useAudit)(e).filter(e=>'stamp'===e.kind),d=(0,m.useMemo)(()=>(0,N.crmCustomers)(),[]),[c,h]=(0,m.useState)(a.stampReward),[u,g]=(0,m.useState)('');(0,m.useEffect)(()=>{(0,$.examplesAllowed)()&&e===s.VENUE_RID&&!l.some(e=>e.customerId.startsWith('cr-'))&&T.useStore.setState(s=>({stampCards:[...s.stampCards,...d.filter(e=>'cust-demo'!==e.id).map((s,t)=>({restaurantId:e,customerId:s.id,stamps:s.stamps%a.stampTarget,rewardsAvailable:t%5==0?1:0,history:[{at:'2026-10-20',source:t%2?'Takeaway':'Dine-in'}]}))]}))},[e]);const p=e=>d.find(s=>s.id===e)?.name??(e===T.useStore.getState().customer.id?i||'Guest':e),b=l.filter(e=>!u||p(e.customerId).toLowerCase().includes(u.toLowerCase())).sort((e,s)=>s.stamps-e.stamps),x=(0,$.examplesAllowed)(),f=o.filter(e=>/redeemed/.test(e.text)).length+(x?31:0);return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Row,{gap:8,children:[(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Active cards"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:l.length})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Rewards ready"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:l.reduce((e,s)=>e+s.rewardsAvailable,0)})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Redeemed"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:f}),(0,V.jsx)(v.Muted,{children:x?'all time (example)':'all time'})]})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Card settings"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Stamps for a reward"}),(0,V.jsx)(v.Stepper,{value:a.stampTarget,min:3,max:15,onChange:s=>G().updateSettings(e,{stampTarget:s}),label:"stamps"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Min spend \xa3"}),(0,V.jsx)(v.Stepper,{value:a.stampMinSpend/100,min:0,max:50,onChange:s=>G().updateSettings(e,{stampMinSpend:100*s}),label:"minimum spend"})]}),(0,V.jsx)(v.Field,{label:"Reward",value:c,onChangeText:h}),(0,V.jsx)(v.Button,{small:!0,label:"Save reward",onPress:()=>G().updateSettings(e,{stampReward:c.trim()||a.stampReward})}),(0,V.jsx)(v.Muted,{children:"One card per customer account, shared across dine-in, table QR and takeaway."})]}),(0,V.jsx)(B.SectionHead,{title:"Members"}),(0,V.jsx)(r.TextInput,{accessibilityLabel:"Search members",placeholder:"Search members",placeholderTextColor:"#7D776C",value:u,onChangeText:g,style:v.styles.input}),b.map(s=>(0,V.jsxs)(w.default,{style:v.styles.card,children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",style:{flex:1},children:p(s.customerId)}),s.rewardsAvailable?(0,V.jsx)(v.Badge,{kind:"ok",label:`${s.rewardsAvailable} reward ready`}):null]}),(0,V.jsx)(v.Row,{gap:4,children:Array.from({length:a.stampTarget},(e,t)=>(0,V.jsx)(w.default,{style:{flex:1,height:8,borderRadius:4,backgroundColor:te.source))).join(', ')||'\u2013']}),(0,V.jsxs)(v.Row,{gap:6,children:[(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Add stamp",onPress:()=>G().addStamp(e,s.customerId,`Manual (${n})`)}),(0,V.jsx)(v.Button,{small:!0,label:"Redeem reward",disabled:!s.rewardsAvailable,onPress:()=>G().redeemReward(e,s.customerId)})]})]},s.customerId))]})}function H(){const e=(0,S.useOwner)(e=>e.referral),s=(0,S.useOwner)(e=>e.referrals),[t,r]=(0,m.useState)(e.giverReward),[n,a]=(0,m.useState)(e.friendReward),l=e=>s.filter(s=>s.status===e).length,i=(0,$.examplesAllowed)();return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Row,{gap:8,children:[i?(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Invites sent"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:"64"}),(0,V.jsx)(v.Muted,{children:"example"})]}):null,(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Sign-ups"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:s.length+(i?23:0)})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Ordered"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:l('first order')+l('rewarded')+(i?9:0)})]})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Bring a friend"}),(0,V.jsx)(v.Toggle,{label:"Referrals on",value:e.active,onChange:s=>S.useOwner.getState().setOwner({referral:{...e,active:s}})})]}),(0,V.jsx)(v.Field,{label:"Reward for the customer who invites",value:t,onChangeText:r}),(0,V.jsx)(v.Field,{label:"Reward for the friend (first order)",value:n,onChangeText:a}),(0,V.jsx)(v.Button,{small:!0,label:"Save rewards",onPress:()=>S.useOwner.getState().setOwner({referral:{...e,giverReward:t.trim(),friendReward:n.trim()}})}),(0,V.jsx)(v.Muted,{children:"The inviter\u2019s reward is added to their account after the friend\u2019s first order."})]}),(0,V.jsx)(B.SectionHead,{title:"Referrals"}),s.map(e=>(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",style:{flex:1},children:[e.referrer," \u2192 ",e.friend]}),(0,V.jsx)(v.Badge,{kind:'rewarded'===e.status?'ok':'first order'===e.status?'gold':'neutral',label:e.status})]}),(0,V.jsx)(v.Muted,{children:e.at})]},e.id))]})}function Q(){const{me:e}=(0,A.useCtx)(6e4),s=(0,A.useSignedIn)();return(0,V.jsx)(p.GiftCardsPage,{me:(s?.name??e).replace(' (example)','')})}function W(){const{rid:e,me:s}=(0,A.useCtx)(6e4),t=(0,T.useStore)((0,k.useShallow)(s=>s.giftCards.filter(s=>s.restaurantId===e))),[n,a]=(0,m.useState)(25),[l,i]=(0,m.useState)(''),[o,d]=(0,m.useState)(''),[c,h]=(0,m.useState)(''),[u,g]=(0,m.useState)(''),[p,b]=(0,m.useState)(''),[x,f]=(0,m.useState)(null),j=t.find(e=>e.code.toUpperCase()===o.trim().toUpperCase()),y=t.find(e=>e.legacy&&e.code.toUpperCase()===u.trim().toUpperCase());return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Row,{gap:8,children:[(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Sold"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:(0,R.gbp)(t.reduce((e,s)=>e+s.initial,0))})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Outstanding"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:(0,R.gbp)(t.reduce((e,s)=>e+s.balance,0))})]})]}),x?(0,V.jsx)(v.Banner,{kind:"success",title:x}):null,(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Check balance & redeem"}),(0,V.jsx)(r.TextInput,{accessibilityLabel:"Gift card code",placeholder:"Code, e.g. ANC-G7QX-4M2P-9TRE",placeholderTextColor:"#7D776C",autoCapitalize:"characters",value:o,onChangeText:d,style:v.styles.input}),o.trim().length>5?j?(0,V.jsxs)(v.Muted,{children:[j.recipientName," \xb7 balance ",(0,R.gbp)(j.balance)," of ",(0,R.gbp)(j.initial),j.legacy?' \xb7 legacy website bookings':'']}):(0,V.jsx)(v.T,{size:13,colour:I.colours.red,children:"No card with that code."}):null,(0,V.jsx)(v.Field,{label:"Amount to redeem \xa3",value:c,onChangeText:h,keyboardType:"decimal-pad"}),(0,V.jsx)(v.Button,{small:!0,label:"Redeem",disabled:!j||!(Number(c)>0)||100*Number(c)>(j?.balance??0),onPress:()=>{G().redeemGiftCard(o,Math.round(100*Number(c)),s)&&(f(`Redeemed \xa3${Number(c).toFixed(2)} from ${j.code}`),h(''))}})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Honour an old website bookings gift card"}),(0,V.jsx)(r.TextInput,{accessibilityLabel:"Website bookings gift card code",placeholder:"Old gift card code, e.g. WEB-OLD-10-EXAMPLE",placeholderTextColor:"#7D776C",autoCapitalize:"characters",value:u,onChangeText:g,style:v.styles.input}),u.trim().length>4?y?(0,V.jsxs)(v.Muted,{children:["Found in imported website bookings cards: balance ",(0,R.gbp)(y.balance),". Redeem it above."]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(v.Muted,{children:"Not in the imported list. Check it in your website bookings dashboard, then honour it here:"}),(0,V.jsx)(v.Field,{label:"Balance confirmed in website bookings \xa3",value:p,onChangeText:b,keyboardType:"decimal-pad"}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Honour & add to CoverCharge",disabled:!(Number(p)>0),onPress:()=>{const t=G().honourLegacyCard(e,u,Math.round(100*Number(p)),s);f(`Website bookings card ${t.code} honoured`),d(t.code),g(''),b('')}})]}):null]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Create / sell a gift card"}),(0,V.jsx)(v.Row,{wrap:!0,gap:6,children:[10,25,50,100].map(e=>(0,V.jsx)(v.Chip,{label:`\xa3${e}`,selected:n===e,onPress:()=>a(e)},e))}),(0,V.jsx)(v.Field,{label:"Recipient",value:l,onChangeText:i}),(0,V.jsx)(v.Button,{label:`Record a \xa3${n} card paid at the till`,disabled:l.trim().length<2,onPress:()=>{const s=G().buyGiftCard(e,100*n,l.trim(),'Sold at the till');f(`Created ${s.code}`),i('')}}),(0,V.jsx)(v.Muted,{children:"Gift cards are sold through your website. Record one here only when it was paid at the till."})]}),(0,V.jsx)(B.SectionHead,{title:"All cards"}),t.map(e=>(0,V.jsxs)(v.Card,{onPress:()=>d(e.code),children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",style:{flex:1},children:e.recipientName}),e.legacy?(0,V.jsx)(v.Badge,{kind:"neutral",label:"Legacy website bookings"}):null]}),(0,V.jsxs)(v.Muted,{children:[e.code," \xb7 ",(0,R.gbp)(e.balance)," of ",(0,R.gbp)(e.initial)]})]},e.id))]})}function q({rid:e,now:s,me:t}){const r=(0,T.useOrders)(e).filter(e=>'table'===e.type),[n,l]=(0,m.useState)(null),i=(0,x.useTableUse)(e,s),o=(0,x.useTableNames)(e);return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Muted,{children:"Each table has its own QR code. Guests scan, order and pay (or split) from their phone. Dine-in cooking starts once the table is seated and has ordered."}),(0,V.jsx)(v.Button,{kind:"secondary",label:"Preview customer table ordering (5)",onPress:()=>j.router.push('/table/5'),testID:"preview-table-ordering"}),(0,V.jsx)(v.Row,{wrap:!0,gap:8,children:o.map(e=>{const s=r.filter(s=>s.tableNo===e&&(0,B.LIVE)(s)),t=s.reduce((e,s)=>e+s.total-s.paid,0);return(0,V.jsxs)(y.default,{accessibilityRole:"button",accessibilityLabel:`Table ${(0,a.tableNumbers)(e)}`,onPress:()=>l(e),style:{width:'31%',padding:10,borderRadius:12,borderWidth:1,borderColor:s.length?I.colours.gold:I.colours.border,backgroundColor:I.colours.surface,gap:2},children:[(0,V.jsx)(v.T,{weight:"bold",children:(0,a.tableNumbers)(e)}),(0,V.jsx)(v.T,{size:12,colour:i[e]?.busy?'#FFD9D4':'#E2C489',children:i[e]?.busy?i[e].label:'Free'}),(0,V.jsx)(v.Muted,{children:s.length?`${s.length} order${s.length>1?'s':''}`:'No orders'}),t?(0,V.jsxs)(v.T,{size:12,colour:I.colours.amber,children:[(0,R.gbp)(t)," to pay"]}):(0,V.jsx)(v.T,{size:12,colour:I.colours.muted,children:"View QR"})]},e)})}),(0,V.jsx)(B.SectionHead,{title:"Live table orders"}),r.filter(B.LIVE).map(e=>(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",children:[(0,a.tableNumbers)(e.tableNo)," \xb7 ",e.ref]}),(0,V.jsx)(v.Badge,{kind:(0,B.statusKind)(e.status),label:(0,B.statusLabel)(e)})]}),(0,V.jsxs)(v.Muted,{children:[e.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",(0,O.minsBetween)(new Date(e.createdAt),s)," min ago \xb7 ",(0,R.gbp)(e.paid)," of ",(0,R.gbp)(e.total)," paid",e.split?` \xb7 split ${e.split.paidShares}/${e.split.ways}`:'']})]},e.id)),r.filter(B.LIVE).length?null:(0,V.jsx)(v.Muted,{children:"No live table orders."}),n?(0,V.jsxs)(v.Sheet,{visible:!0,onClose:()=>l(null),title:`${(0,a.tableNumbers)(n)} QR code`,children:[(0,V.jsx)(w.default,{style:{alignItems:'center',backgroundColor:'#fff',padding:16,borderRadius:12},children:(0,V.jsx)(C.QR,{value:`https://covercharge.example/t/${e}/${n}`,size:200})}),(0,V.jsxs)(v.Muted,{center:!0,children:["Example link (table ordering links aren\u2019t live yet): covercharge.example/t/",e,"/",n]}),(0,V.jsx)(v.Banner,{kind:"demo",title:"Print later",children:"Printing table cards from here isn\u2019t set up yet. Nothing is printed or sent."}),(0,V.jsx)(v.Button,{label:`Preview customer table ordering (${(0,a.tableNumbers)(n)})`,onPress:()=>{const e=n;l(null),j.router.push(`/table/${e}`)}}),(0,V.jsx)(v.Button,{kind:"secondary",label:"Show the code again",onPress:()=>l(n)})]}):null]})}function K({go:e,onClose:s}){const{rid:t,today:r,role:n}=(0,A.useCtx)(1e4),a=(0,T.useOrders)(t),l=(0,T.useStore)(e=>e.bookings);(0,E.useBackLayer)(!0,s);const i=a.filter(B.LIVE),o=[...i.filter(e=>(0,D.chainNeedsAction)(e,l)).map(e=>{const s=(0,D.nextStep)(e,(0,D.linkedBooking)(e,l)),t=D.CHAIN_STEPS.find(e=>e.id===s);return{id:`o-${e.id}`,at:e.createdAt,title:`${e.ref} \xb7 ${'table'===e.type?`Table ${e.tableNo??''}`.trim():'Takeaway'}${e.customerName?` \xb7 ${e.customerName}`:''}`,when:`Ordered ${(0,O.hm)(new Date(e.createdAt))}`,allergies:e.allergies.map(e=>(0,U.allergenLabel)(e.allergen)).join(', '),next:t?`Next: ${t.n}. ${t.label} sign-off`:'Sign-off waiting',tab:'orders',open:'Open Orders to sign off'}}),...l.filter(e=>e.restaurantId===t&&e.date===r&&'cancelled'!==e.status&&(0,D.bookingNeedsAction)(e,i)).map(e=>({id:`b-${e.id}`,at:`${e.date}T${e.time}`,title:`${e.name} \xb7 ${e.partySize} at ${e.time}`,when:`Booking ${e.ref??''}`.trim(),allergies:e.allergies.map(e=>(0,U.allergenLabel)(e.allergen)).join(', '),next:'Next: 1. Booked sign-off',tab:'bookings',open:'Open Bookings to sign off'}))].sort((e,s)=>e.at.localeCompare(s.at));return(0,V.jsxs)(w.default,{testID:"pending-list",style:{gap:12,alignItems:'stretch'},children:[(0,V.jsx)(E.BackButton,{onPress:s,testID:"pending-back"}),(0,V.jsx)(v.T,{center:!0,size:22,weight:"bold",colour:I.colours.gold,accessibilityRole:"header",style:{alignSelf:'stretch'},children:"Awaiting verification"}),(0,V.jsx)(v.Muted,{center:!0,testID:"pending-status",children:o.length?`${o.length} allergy ${1===o.length?'sign-off':'sign-offs'} waiting, oldest first.`:'Nothing is waiting for an allergy sign-off.'}),o.map(s=>(0,V.jsxs)(v.Card,{highlight:I.colours.red,style:{alignItems:'center',gap:8},children:[(0,V.jsxs)(w.default,{testID:`pending-row-${s.id}`,accessible:!0,accessibilityLabel:`${s.title}, ${s.when}, allergies: ${s.allergies}. ${s.next}.`,style:{alignItems:'center',gap:4,width:'100%'},children:[(0,V.jsx)(v.T,{center:!0,weight:"bold",size:18,children:s.title}),(0,V.jsx)(v.T,{center:!0,children:s.when}),(0,V.jsxs)(v.Muted,{center:!0,children:["Allergies: ",s.allergies]}),(0,V.jsx)(v.T,{center:!0,colour:I.colours.gold,children:s.next})]}),(0,V.jsx)(v.Button,{small:!0,label:s.open,onPress:()=>e(s.tab),style:{alignSelf:'stretch'}})]},s.id)),'owner'===n||'manager'===n?(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Allergen sign-off log",onPress:()=>e('more','allergen-signoffs')}):null]})}function X(){const e=(0,S.useOwner)(e=>e.merch),s=(0,S.useOwner)(e=>e.merchOrders),[t,r]=(0,m.useState)(''),[n,a]=(0,m.useState)(''),l=(s,t)=>S.useOwner.getState().setOwner({merch:e.map(e=>e.id===s?{...e,...t}:e)});return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Banner,{kind:"demo",title:"Optional add-on",children:"Sell branded items in the customer app for collection. Example only on this device; nothing is charged."}),(0,V.jsx)(B.SectionHead,{title:"Products & stock"}),e.map(e=>(0,V.jsxs)(w.default,{style:v.styles.card,children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",style:{flex:1},children:e.name}),(0,V.jsx)(v.T,{children:(0,R.gbp)(e.price)})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(w.default,{style:{flex:1,minWidth:0},children:(0,V.jsx)(v.Toggle,{label:e.live?'In shop':'Hidden',a11y:`${e.name} live`,value:e.live,onChange:s=>l(e.id,{live:s})})}),(0,V.jsx)(v.Stepper,{value:e.stock,min:0,max:500,onChange:s=>l(e.id,{stock:s}),label:`${e.name} stock`})]}),0===e.stock?(0,V.jsx)(v.T,{size:13,colour:I.colours.red,children:"Out of stock"}):e.stock<8?(0,V.jsx)(v.T,{size:13,colour:I.colours.amber,children:"Low stock"}):null]},e.id)),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Add a product"}),(0,V.jsx)(v.Field,{label:"Name",value:t,onChangeText:r}),(0,V.jsx)(v.Field,{label:"Price \xa3",value:n,onChangeText:a,keyboardType:"decimal-pad"}),(0,V.jsx)(v.Button,{small:!0,label:"Add product",disabled:t.trim().length<2||!(Number(n)>0),onPress:()=>{S.useOwner.getState().setOwner({merch:[...e,{id:`mc-${Date.now()}`,name:t.trim(),price:Math.round(100*Number(n)),stock:10,live:!0}]}),r(''),a('')}})]}),(0,V.jsx)(B.SectionHead,{title:"Shop orders"}),s.map(t=>{const r=e.find(e=>e.id===t.productId);return(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",style:{flex:1},children:[t.qty,"\xd7 ",r?.name," \xb7 ",t.customer]}),(0,V.jsx)(v.Badge,{kind:'new'===t.status?'amber':'ready'===t.status?'blue':'ok',label:t.status})]}),(0,V.jsxs)(v.Muted,{children:[t.at," \xb7 ",(0,R.gbp)((r?.price??0)*t.qty)]}),'collected'!==t.status?(0,V.jsx)(v.Button,{small:!0,label:'new'===t.status?'Mark ready':'Mark collected',onPress:()=>S.useOwner.getState().setOwner({merchOrders:s.map(e=>e.id===t.id?{...e,status:'new'===t.status?'ready':'collected'}:e)})}):null]},t.id)})]})}const Y=[{n:1,title:'Loyalty stamp card',links:[['Stamp card','loyalty']],note:'Settings, members, add/redeem, stats. One card across dine-in & takeaway.'},{n:2,title:'Bring-a-friend referrals',links:[['Referrals','referrals']],note:'Rewards, referral list and stats.'},{n:3,title:'Gift cards & vouchers',links:[['Gift cards','giftcards']],note:'Sold through your website. Check a balance, take it off the bill, honour website bookings cards.'},{n:4,title:'QR order & pay at table',links:[['Tables & QR codes','tables']],note:'Table list, QR per table, live table orders.'},{n:5,title:'Direct takeaway ordering',links:[['Takeaway settings','takeaway'],['Orders','tab:orders']],note:'Slots, capacity, live queue, readiness alerts (takeaway only).'},{n:6,title:'Table bookings, no-shows & waitlist',links:[['Bookings','tab:bookings'],['Booking settings','bookingsettings']],note:'Deposits (Deposit due / paid, set in Settings \u203a Advanced), no-show marking, reminders, online waitlist.'},{n:7,title:'Allergy verification',links:[['Allergy hub','allergy'],['Menu & allergens','menu']],note:'14 UK allergens per dish, kitchen alerts, named verification, audit log.'},{n:8,title:'Push offers & specials (opt-in)',links:[['Marketing','marketing'],['Specials & offers','offers']],note:'Saved campaign drafts. Delivery is not connected.'},{n:9,title:'Calendar & marketing hooks',links:[['Forecast calendar','tab:forecast'],['Events','events']],note:'Scottish bank holidays, school holidays, local & own events, promo hooks.'},{n:10,title:'Private feedback',links:[['Feedback inbox','feedback'],['Reviews','reviews']],note:'Low-rating alerts. No review gating.'},{n:11,title:'Lost property & coat check',links:[['Lost property','lost']],note:'Found items and coat-check tickets.'},{n:12,title:'Merch shop (optional)',links:[['Merch shop','merch']],note:'Products, stock and orders.'},{n:14,title:'Staff group chat',links:[['Chat','tab:chat']],note:'Channels, DMs, photos, reactions, read receipts, pins, auto-posts, cover requests. Local only.'},{n:16,title:'Suppliers',links:[['Suppliers','suppliers'],['Prep & stock list','prep']],note:'Contacts, categories, favourites, cut-offs and delivery days, tap to call/email/website, orders due today, order log, staff permission.'},{n:17,title:'Hours & pay',links:[['My hours & pay','mypay'],['Payroll & pay rates','payroll'],['Timesheets','timesheets']],note:'Staff see their own hours and gross pay (before tax, estimate) plus tips; owner sets hourly rates and sees the team payroll summary.'},{n:15,title:'Tip splitter',links:[['Tips','tips'],['My tips','mytips']],note:'Pay periods, card + cash pot, 4 split methods, approve & lock, compliance checklist.'},{n:18,title:'Post to social',links:[['Post to social','social'],['Connected accounts','socialaccounts'],['Marketing','marketing']],note:'Social publishing is not connected. No accounts are linked and nothing is posted.'},{n:20,title:'Head Chef app',links:[['Menu & allergens','menu'],['Suppliers','suppliers']],note:'CoverCharge for Head Chef: stock with par levels and alerts, stock take, deliveries checked against the order, recipe cards with dish cost, GP % and cash GP against a target, price-change impact, theoretical vs actual GP, menu engineering, waste log, ordering from par and forecast, prep lists, 14-allergen matrix with sign-off, temperatures, cleaning and daily checks, kitchen rota, chat, live tickets and a Sold out list (a reminder for staff, shown on the Display). Uses this menu and these suppliers.'},{n:21,title:'Branding',links:[['Branding','branding']],note:'Your logo and accent colour lead all five apps, with a small "powered by CoverCharge". Pick any colour with the colour picker or a hex code; text on it stays readable.'},{n:19,title:'Quick links',links:[['Quick links','quicklinks'],['Dashboard','tab:home']],note:'One-tap Work email (Gmail) and Website bookings view/edit for owners and managers, plus up to 6 of your own links. Staff never see the website bookings links; per-link staff visibility for the rest (off by default). Head Chef: no quick links or email at all. Opens the app or site only.'},{n:13,title:'Forecasting, dashboard & running the business',links:[['Forecast','tab:forecast'],['Dashboard','tab:home'],['Tablet preview','tablet'],['Rota','rota'],['Clock in/out','clock'],['Timesheets','timesheets'],['Analytics','analytics'],['CRM','crm'],['Plan & billing','plan']],note:'Headline forecast, rotas, geofenced clock in/out with break prompt, analytics, CRM'+f.PLAN_FEATURE_NOTE+'.'}];const J=async e=>{try{return'undefined'!=typeof localStorage&&'1'===localStorage.getItem(e)}catch{return!1}},Z=async e=>{try{'undefined'!=typeof localStorage&&localStorage.setItem(e,'1')}catch{}};function ee({kind:e}){const{r:s}=(0,A.useCtx)(6e4),t=(0,S.useOwner)(e=>e.offers);(0,m.useEffect)(()=>{(0,h.migrateLocalOnce)({offers:t},J,Z).catch(()=>{})},[]);const r=(0,u.can)('venue.settings');return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(b.LoyaltySummaryCard,{kind:e}),(0,V.jsx)(g.StaffLoyalty,{venue:s.name,canRemove:r,onOpenSettings:r?()=>{i.advancedPrefill.q='loyalty',o.useVoiceNav.getState().go?.('more','advanced')}:void 0}),r?(0,V.jsx)(v.Card,{children:(0,V.jsxs)(w.default,{style:{gap:8},children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Card, offers and bring-a-friend settings"}),(0,V.jsx)(b.LoyaltySettingsPanel,{})]})}):null]})}},1450,[5,1366,827,837,860,1451,1388,1422,1193,14,1227,988,1452,1454,1389,34,1113,1430,30,402,102,879,1247,794,874,892,867,881,1117,858,821,1165,1079,1133,884,1403,869,1048,1149,863,861,25]); +__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.GiftVouchers=function(){return r.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(Q,{}):(0,V.jsx)(W,{})},_e.Merch=function(){return r.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(Q,{}):(0,V.jsx)(X,{})},_e.TablesQr=function({go:e}={}){const{rid:t,r:s,now:n,me:a}=(0,N.useCtx)(1e4);return r.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(i.StaffTableOrders,{rid:t,me:a}),(0,V.jsx)(v.Muted,{children:"QR codes, tables and hours: Settings \u203a Advanced \u203a Order at the table."})]}):(0,M.orderAtTableOn)(s)?(0,V.jsx)(q,{rid:t,now:n,me:a}):(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Banner,{kind:"info",title:"Order at table is off",children:"In-house orders go through your till. Switch it on in Settings \u203a Order at table if this venue takes orders at the table."}),e?(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Open Order at table settings",onPress:()=>e('more','orderattable')}):null]})},_e.TakeawaySettings=function({go:e}){const{rid:t,r:s,now:n}=(0,N.useCtx)(3e4),r=(0,S.useOrders)(t),a=s.settings,i=(0,P.takeawaySlots)(s,r,n).slice(0,10),l=e=>G().updateSettings(t,e),o=r.filter(e=>'takeaway'===e.type&&(0,I.LIVE)(e));return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Card,{highlight:a.takeawayPaused?B.colours.red:B.colours.ok,children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",children:a.takeawayPaused?'Takeaway paused':'Taking takeaway orders'}),(0,V.jsx)(v.Toggle,{label:"Takeaway on",value:!a.takeawayPaused,onChange:e=>l({takeawayPaused:!e})})]}),(0,V.jsx)(v.Muted,{children:"Direct ordering, no delivery-app commission."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Collection slots & capacity"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Slot length (min)"}),(0,V.jsx)(v.Stepper,{value:a.slotMinutes,min:5,max:30,onChange:e=>l({slotMinutes:e}),label:"slot minutes"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Orders per slot"}),(0,V.jsx)(v.Stepper,{value:a.slotCap,min:1,max:20,onChange:e=>l({slotCap:e}),label:"orders per slot"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Earliest pickup (min ahead)"}),(0,V.jsx)(v.Stepper,{value:a.leadMins,min:5,max:60,onChange:e=>l({leadMins:e}),label:"lead minutes"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Readiness buffer (min)"}),(0,V.jsx)(v.Stepper,{value:a.bufferMins,min:0,max:20,onChange:e=>l({bufferMins:e}),label:"buffer minutes"})]}),(0,V.jsx)(v.Muted,{children:"Readiness alerts (start cooking \u2192 bag it \u2192 ready) are for takeaway only, timed from the pickup slot. Dine-in starts when the table is seated and has ordered."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Next slots"}),i.map(e=>(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{size:14,children:e.label}),(0,V.jsx)(w.default,{style:{flex:1,height:8,marginHorizontal:8,backgroundColor:B.colours.border,borderRadius:4},children:(0,V.jsx)(w.default,{style:{width:e.taken/e.cap*100+"%",height:8,backgroundColor:e.full?B.colours.red:B.colours.gold,borderRadius:4}})}),(0,V.jsxs)(v.Muted,{children:[e.taken,"/",e.cap]})]},e.label))]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",children:["Live queue: ",o.length]}),(0,V.jsx)(v.Button,{small:!0,label:"Open orders",onPress:()=>e('orders')})]}),o.map(e=>(0,V.jsxs)(v.Muted,{children:[e.slotTime?(0,O.hm)(new Date(e.slotTime)):'\u2013'," \xb7 ",e.ref," ",e.customerName," \xb7 ",(0,I.statusLabel)(e)]},e.id))]})]})},_e.BookingSettings=function({go:e}){const{rid:n,r:r}=(0,N.useCtx)(6e4),a=r.settings,i=(0,T.useOwner)(e=>e.reminders),l=e=>G().updateSettings(n,e),o=e=>T.useOwner.getState().setOwner({reminders:{...i,...e}});return(0,V.jsxs)(w.default,{style:{gap:10},children:[t.IS_GREENSIDE?(0,V.jsx)(s.GreensideCashOnly,{}):(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Deposits"}),(0,V.jsxs)(v.Muted,{children:[(()=>{const e=(0,c.depositOf)(a);return e.on&&e.perPersonPence>0?`On: ${(0,R.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more.`:'Off.'})()," Deposits are paid through website bookings: website bookings show Deposit paid on website bookings by themselves; staff tick phone and walk-in deposits paid."]}),(0,V.jsx)(v.Muted,{children:"Tip: change the amount, party size, refunds and the words guests see in Settings \u203a Advanced \u203a Deposits."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Reminders"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Reminder 24 hours before"}),(0,V.jsx)(v.Toggle,{label:"24h reminder",value:i.h24,onChange:e=>o({h24:e})})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Reminder 2 hours before"}),(0,V.jsx)(v.Toggle,{label:"2h reminder",value:i.h2,onChange:e=>o({h2:e})})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Ask guests to confirm or cancel"}),(0,V.jsx)(v.Toggle,{label:"confirm",value:i.confirmText,onChange:e=>o({confirmText:e})})]}),(0,V.jsx)(v.Muted,{children:"Guest reminders are not connected; nothing is sent."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Capacity & waitlist"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Booking start times (min)"}),(0,V.jsx)(v.Stepper,{value:(0,P.bookingSlotMinutesOf)(r),min:15,max:30,step:15,onChange:e=>l({bookingSlotMinutes:e}),label:"booking start times"})]}),null!=(0,P.bookingCoversPerStartOf)(r)||null!=(0,P.bookingPartiesPerStartOf)(r)?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Covers at each start time"}),(0,V.jsx)(v.Stepper,{value:a.bookingCoversPerStart??15,min:1,max:60,onChange:e=>l({bookingCoversPerStart:e}),label:"covers at each start time"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Bookings at each start time"}),(0,V.jsx)(v.Stepper,{value:a.bookingPartiesPerStart??4,min:1,max:20,onChange:e=>l({bookingPartiesPerStart:e}),label:"bookings at each start time"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Online party size, from"}),(0,V.jsx)(v.Stepper,{value:(0,P.onlinePartyBounds)(r).min,min:1,max:(0,P.onlinePartyBounds)(r).max,onChange:e=>l({onlinePartyMin:e}),label:"online party from"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Online party size, up to"}),(0,V.jsx)(v.Stepper,{value:(0,P.onlinePartyBounds)(r).max,min:(0,P.onlinePartyBounds)(r).min,max:100,onChange:e=>l({onlinePartyMax:e}),label:"online party up to"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Minimum notice (min)"}),(0,V.jsx)(v.Stepper,{value:(0,P.bookingNoticeMinsOf)(r),min:0,max:180,step:5,onChange:e=>l({bookingNoticeMins:e}),label:"minimum notice"})]}),(0,V.jsx)(v.Muted,{children:"Each start time has its own covers and bookings cap, so 19:00 and 19:15 do not share a limit. Last booking is still the closing time. Staff can still book over the limit from New booking."})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Covers per 30-min slot"}),(0,V.jsx)(v.Stepper,{value:a.bookingCoversPerSlot,min:2,max:60,onChange:e=>l({bookingCoversPerSlot:e}),label:"Covers per slot"})]}),(0,V.jsx)(v.Muted,{children:"Guests can pick a start every 15 or 30 minutes. The covers cap is still for each half hour, so 19:00 and 19:15 share the same limit."})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Typical table turn (min)"}),(0,V.jsx)(v.Stepper,{value:a.turnMins,min:30,max:180,onChange:e=>l({turnMins:e}),label:"turn minutes"})]}),(0,V.jsx)(v.Muted,{children:"The online waitlist estimate uses the table turn time."}),(0,V.jsx)(v.Button,{small:!0,label:"Open bookings & waitlist",onPress:()=>e('bookings')})]})]})},_e.AllergyHub=function({go:e}){const{rid:t,today:s,role:n,me:r}=(0,N.useCtx)(1e4),[a,i]=(0,x.useState)(null),l=(0,S.useOrders)(t),o=(0,S.useStore)((0,k.useShallow)(e=>e.bookings.filter(e=>e.restaurantId===t&&e.date===s))),d=(0,S.useAudit)(t).filter(e=>'allergy'===e.kind),c=(0,z.useUnsignedDishes)(t),h=(0,S.useStore)(e=>e.bookings),u=l.filter(e=>(0,I.LIVE)(e)&&(0,D.chainNeedsAction)(e,h)).length+o.filter(e=>'cancelled'!==e.status&&(0,D.bookingNeedsAction)(e,l.filter(I.LIVE))).length,g=(0,N.useSignedIn)(),p=(0,F.cardActorFor)(r,'owner'===n?'owner':'manager'===n?'manager':'staff',g);if('unsigned'===a)return(0,V.jsx)(z.UnsignedDishList,{rid:t,actor:p,onClose:()=>i(null),onOpenCards:()=>e('more','recipecards')});if('pending'===a)return(0,V.jsx)(K,{go:e,onClose:()=>i(null)});const m={flex:1,minHeight:48};return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Banner,{kind:"info",title:"Supports staff, doesn't replace them",children:"CoverCharge flags the 14 UK allergens and asks a named person to verify. Staff still check with the guest and the recipe every time."}),(0,V.jsxs)(v.Row,{gap:8,children:[(0,V.jsx)(y.default,{testID:"tile-awaiting-verification",accessibilityRole:"button",accessibilityLabel:`Awaiting verification, ${u}. Opens the list.`,onPress:()=>i('pending'),style:({pressed:e})=>[m,{opacity:e?.85:1}],children:(0,V.jsxs)(v.Card,{style:{flex:1,alignItems:'center'},highlight:u?B.colours.red:void 0,children:[(0,V.jsx)(v.Muted,{center:!0,children:"Awaiting verification"}),(0,V.jsx)(v.T,{center:!0,size:20,weight:"bold",children:u})]})}),(0,V.jsx)(y.default,{testID:"tile-not-signed-off",accessibilityRole:"button",accessibilityLabel:`Dishes not signed off, ${c.length}. Opens the list.`,onPress:()=>i('unsigned'),style:({pressed:e})=>[m,{opacity:e?.85:1}],children:(0,V.jsxs)(v.Card,{style:{flex:1,alignItems:'center'},highlight:c.length?B.colours.amber:void 0,children:[(0,V.jsx)(v.Muted,{center:!0,children:"Dishes not signed off"}),(0,V.jsx)(v.T,{center:!0,size:20,weight:"bold",children:c.length})]})})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"1. Allergens per dish (14 UK allergens)"}),(0,V.jsx)(v.Muted,{children:"Each dish\u2019s recipe card lists contains / may contain, suggested from its ingredients. The head chef signs each card off; the menu, takeaway and booking checks all read the cards."}),(0,V.jsx)(v.Button,{small:!0,label:"Recipe cards",onPress:()=>e('more','recipecards')})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"2. Kitchen alerts on orders & bookings"}),(0,V.jsx)(v.Muted,{children:"Red allergy cards; cooking is blocked until the Kitchen sign-off."}),(0,V.jsxs)(v.Row,{gap:6,children:[(0,V.jsx)(v.Button,{small:!0,label:"Orders",onPress:()=>e('orders')}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Bookings",onPress:()=>e('bookings')})]})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"3. Five-step sign-off chain"}),(0,V.jsx)(v.Muted,{children:"Booked, Ordered, Kitchen, Pass and Table: a named person taps Sign off at each step, in order."}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Allergen sign-off log",onPress:()=>e('more','allergen-signoffs')})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"4. Audit log"}),d.slice(0,6).map(e=>(0,V.jsxs)(v.Muted,{children:[(0,O.hm)(new Date(e.at))," \xb7 ",e.text]},e.id)),d.length?null:(0,V.jsx)(v.Muted,{children:"No allergy events yet."}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Full log & daily checks",onPress:()=>e('more','compliance')})]})]})},_e.TabletPreview=function(){return(0,V.jsx)(w.default,{style:{gap:10},children:(0,V.jsxs)(v.Card,{highlight:B.colours.gold,style:{alignItems:'center'},children:[(0,V.jsxs)(w.default,{style:{width:240,height:160,borderRadius:14,borderWidth:3,borderColor:B.colours.border,alignItems:'center',justifyContent:'center'},children:[(0,V.jsx)(v.T,{size:30,children:"\ud83d\udda5\ufe0f"}),(0,V.jsx)(v.T,{weight:"semibold",children:"Kitchen & front-of-house tablet"})]}),(0,V.jsx)(v.T,{size:20,weight:"bold",colour:B.colours.gold,children:"CoverCharge for Display"}),(0,V.jsx)(v.Muted,{center:!0,children:"The in-restaurant tablet and kitchen display is its own app, CoverCharge for Display (landscape). Everything it shows (orders, readiness alerts, allergies, bookings) is also live in this app."})]})})},_e.AllFeatures=function({go:e}){const{role:t,r:s}=(0,N.useCtx)(6e4),n=(0,d.useLiveVenue)(),r=t=>t.startsWith('tab:')?e(t.slice(4)):e('more',t),a=e=>e.startsWith('tab:')?'tab:forecast'!==e||T.CAN.forecasts(t):(()=>{const s=$.PAGES.find(t=>t.id===e);return!!s&&(!s.can||s.can(t))})();return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Card,{highlight:B.colours.gold,children:[(0,V.jsx)(v.T,{weight:"semibold",children:"CoverCharge is five apps that share one set of venue data"}),[['CoverCharge for Managers','This app. Run the venue: orders, bookings, forecasts, team, menu, marketing, social posting, billing.','This app'],['CoverCharge for Staff','Clock in/out with break prompt, rota, swaps & leave, chat, my hours & pay, my tips.','Separate app'],['CoverCharge',`For customers: menu, takeaway ordering, table bookings, loyalty, gift cards${(0,M.orderAtTableOn)(s)?', QR table ordering':''}.`,'Separate app'],['CoverCharge for Display','Restaurant tablet / kitchen display: live orders, readiness, allergy alerts.','Separate app'],['CoverCharge for Head Chef','Stock and deliveries, recipe costing and GP, menu engineering, waste, ordering, prep lists, allergens, kitchen compliance, kitchen rota and chat, plus My pay & tips (their own hours, tips, tip goal and paydays only). No other staff pay, customer data or billing.','Separate app']].map(([e,t,s])=>(0,V.jsxs)(v.Row,{style:{alignItems:'flex-start'},children:[(0,V.jsxs)(w.default,{style:{flex:1},children:[(0,V.jsx)(v.T,{weight:"medium",children:e}),(0,V.jsx)(v.Muted,{children:t})]}),(0,V.jsx)(v.Badge,{kind:'This app'===s?'ok':'gold',label:s})]},e)),'owner'===t?(0,V.jsx)(v.Chip,{label:"Open the Staff app preview \u203a",onPress:()=>{T.useOwner.getState().setPreviewRole('staff'),e('home')}}):null,(0,V.jsx)(v.Muted,{children:n?'All five share your venue\u2019s live data. Each is installed separately, and your venue\u2019s own logo leads (Settings \u203a Branding).':'This copy isn\u2019t connected to a venue yet, so it only shows what is saved on this device. Each app is installed separately, and the venue\u2019s own logo leads (Settings \u203a Branding).'})]}),(0,V.jsx)(v.Muted,{children:"Every CoverCharge feature and where to manage it."}),[...Y].filter(e=>4!==e.n||(0,M.orderAtTableOn)(s)).sort((e,t)=>e.n-t.n).map(e=>(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{alignItems:'flex-start'},children:[(0,V.jsxs)(v.T,{weight:"bold",colour:B.colours.gold,style:{width:26},children:[e.n,"."]}),(0,V.jsxs)(w.default,{style:{flex:1},children:[(0,V.jsx)(v.T,{weight:"semibold",children:e.title}),(0,V.jsx)(v.Muted,{children:e.note})]})]}),(0,V.jsx)(v.Row,{wrap:!0,gap:6,children:e.links.filter(([,e])=>a(e)).map(([e,t])=>(0,V.jsx)(v.Chip,{label:`${e} \u203a`,onPress:()=>r(t)},t))})]},e.n))]})},Object.defineProperty(_e,"Divider",{enumerable:!0,get:function(){return v.Divider}}),_e.Loyalty=function(){return r.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(ee,{kind:"card"}):(0,V.jsx)(_,{})},_e.Referrals=function(){return r.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(ee,{kind:"referrals"}):(0,V.jsx)(H,{})};var t=_r(_d[0]),s=_r(_d[1]),n=_r(_d[2]),r=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),l=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),u=_r(_d[11]),g=_r(_d[12]),p=_r(_d[13]),m=_r(_d[14]),x=_r(_d[15]),b=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),y=e(_r(_d[19])),w=e(_r(_d[20])),k=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),S=_r(_d[24]),T=_r(_d[25]),R=_r(_d[26]),M=_r(_d[27]),P=_r(_d[28]),O=_r(_d[29]),B=_r(_d[30]),I=_r(_d[31]),N=_r(_d[32]),A=_r(_d[33]),L=_r(_d[34]),$=_r(_d[35]),D=_r(_d[36]),E=_r(_d[37]),z=_r(_d[38]),F=_r(_d[39]),U=_r(_d[40]),V=_r(_d[41]);const G=()=>S.useStore.getState();function _(){const{rid:e,r:s,me:r}=(0,N.useCtx)(3e4),a=s.settings,i=(0,S.useStore)((0,k.useShallow)(t=>t.stampCards.filter(t=>t.restaurantId===e))),l=(0,S.useStore)(e=>e.customer.name),o=(0,S.useAudit)(e).filter(e=>'stamp'===e.kind),d=(0,x.useMemo)(()=>(0,A.crmCustomers)(),[]),[c,h]=(0,x.useState)(a.stampReward),[u,g]=(0,x.useState)('');(0,x.useEffect)(()=>{(0,L.examplesAllowed)()&&e===t.VENUE_RID&&!i.some(e=>e.customerId.startsWith('cr-'))&&S.useStore.setState(t=>({stampCards:[...t.stampCards,...d.filter(e=>'cust-demo'!==e.id).map((t,s)=>({restaurantId:e,customerId:t.id,stamps:t.stamps%a.stampTarget,rewardsAvailable:s%5==0?1:0,history:[{at:'2026-10-20',source:s%2?'Takeaway':'Dine-in'}]}))]}))},[e]);const p=e=>d.find(t=>t.id===e)?.name??(e===S.useStore.getState().customer.id?l||'Guest':e),m=i.filter(e=>!u||p(e.customerId).toLowerCase().includes(u.toLowerCase())).sort((e,t)=>t.stamps-e.stamps),b=(0,L.examplesAllowed)(),f=o.filter(e=>/redeemed/.test(e.text)).length+(b?31:0);return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Row,{gap:8,children:[(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Active cards"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:i.length})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Rewards ready"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:i.reduce((e,t)=>e+t.rewardsAvailable,0)})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Redeemed"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:f}),(0,V.jsx)(v.Muted,{children:b?'all time (example)':'all time'})]})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Card settings"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Stamps for a reward"}),(0,V.jsx)(v.Stepper,{value:a.stampTarget,min:3,max:15,onChange:t=>G().updateSettings(e,{stampTarget:t}),label:"stamps"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Min spend \xa3"}),(0,V.jsx)(v.Stepper,{value:a.stampMinSpend/100,min:0,max:50,onChange:t=>G().updateSettings(e,{stampMinSpend:100*t}),label:"minimum spend"})]}),(0,V.jsx)(v.Field,{label:"Reward",value:c,onChangeText:h}),(0,V.jsx)(v.Button,{small:!0,label:"Save reward",onPress:()=>G().updateSettings(e,{stampReward:c.trim()||a.stampReward})}),(0,V.jsx)(v.Muted,{children:"One card per customer account, shared across dine-in, table QR and takeaway."})]}),(0,V.jsx)(I.SectionHead,{title:"Members"}),(0,V.jsx)(n.TextInput,{accessibilityLabel:"Search members",placeholder:"Search members",placeholderTextColor:"#7D776C",value:u,onChangeText:g,style:v.styles.input}),m.map(t=>(0,V.jsxs)(w.default,{style:v.styles.card,children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",style:{flex:1},children:p(t.customerId)}),t.rewardsAvailable?(0,V.jsx)(v.Badge,{kind:"ok",label:`${t.rewardsAvailable} reward ready`}):null]}),(0,V.jsx)(v.Row,{gap:4,children:Array.from({length:a.stampTarget},(e,s)=>(0,V.jsx)(w.default,{style:{flex:1,height:8,borderRadius:4,backgroundColor:se.source))).join(', ')||'\u2013']}),(0,V.jsxs)(v.Row,{gap:6,children:[(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Add stamp",onPress:()=>G().addStamp(e,t.customerId,`Manual (${r})`)}),(0,V.jsx)(v.Button,{small:!0,label:"Redeem reward",disabled:!t.rewardsAvailable,onPress:()=>G().redeemReward(e,t.customerId)})]})]},t.customerId))]})}function H(){const e=(0,T.useOwner)(e=>e.referral),t=(0,T.useOwner)(e=>e.referrals),[s,n]=(0,x.useState)(e.giverReward),[r,a]=(0,x.useState)(e.friendReward),i=e=>t.filter(t=>t.status===e).length,l=(0,L.examplesAllowed)();return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Row,{gap:8,children:[l?(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Invites sent"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:"64"}),(0,V.jsx)(v.Muted,{children:"example"})]}):null,(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Sign-ups"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:t.length+(l?23:0)})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Ordered"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:i('first order')+i('rewarded')+(l?9:0)})]})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Bring a friend"}),(0,V.jsx)(v.Toggle,{label:"Referrals on",value:e.active,onChange:t=>T.useOwner.getState().setOwner({referral:{...e,active:t}})})]}),(0,V.jsx)(v.Field,{label:"Reward for the customer who invites",value:s,onChangeText:n}),(0,V.jsx)(v.Field,{label:"Reward for the friend (first order)",value:r,onChangeText:a}),(0,V.jsx)(v.Button,{small:!0,label:"Save rewards",onPress:()=>T.useOwner.getState().setOwner({referral:{...e,giverReward:s.trim(),friendReward:r.trim()}})}),(0,V.jsx)(v.Muted,{children:"The inviter\u2019s reward is added to their account after the friend\u2019s first order."})]}),(0,V.jsx)(I.SectionHead,{title:"Referrals"}),t.map(e=>(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",style:{flex:1},children:[e.referrer," \u2192 ",e.friend]}),(0,V.jsx)(v.Badge,{kind:'rewarded'===e.status?'ok':'first order'===e.status?'gold':'neutral',label:e.status})]}),(0,V.jsx)(v.Muted,{children:e.at})]},e.id))]})}function Q(){const{me:e}=(0,N.useCtx)(6e4),t=(0,N.useSignedIn)();return(0,V.jsx)(p.GiftCardsPage,{me:(t?.name??e).replace(' (example)','')})}function W(){const{rid:e,me:t}=(0,N.useCtx)(6e4),s=(0,S.useStore)((0,k.useShallow)(t=>t.giftCards.filter(t=>t.restaurantId===e))),[r,a]=(0,x.useState)(25),[i,l]=(0,x.useState)(''),[o,d]=(0,x.useState)(''),[c,h]=(0,x.useState)(''),[u,g]=(0,x.useState)(''),[p,m]=(0,x.useState)(''),[b,f]=(0,x.useState)(null),j=s.find(e=>e.code.toUpperCase()===o.trim().toUpperCase()),y=s.find(e=>e.legacy&&e.code.toUpperCase()===u.trim().toUpperCase());return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Row,{gap:8,children:[(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Sold"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:(0,R.gbp)(s.reduce((e,t)=>e+t.initial,0))})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Outstanding"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:(0,R.gbp)(s.reduce((e,t)=>e+t.balance,0))})]})]}),b?(0,V.jsx)(v.Banner,{kind:"success",title:b}):null,(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Check balance & redeem"}),(0,V.jsx)(n.TextInput,{accessibilityLabel:"Gift card code",placeholder:"Code, e.g. ANC-G7QX-4M2P-9TRE",placeholderTextColor:"#7D776C",autoCapitalize:"characters",value:o,onChangeText:d,style:v.styles.input}),o.trim().length>5?j?(0,V.jsxs)(v.Muted,{children:[j.recipientName," \xb7 balance ",(0,R.gbp)(j.balance)," of ",(0,R.gbp)(j.initial),j.legacy?' \xb7 legacy website bookings':'']}):(0,V.jsx)(v.T,{size:13,colour:B.colours.red,children:"No card with that code."}):null,(0,V.jsx)(v.Field,{label:"Amount to redeem \xa3",value:c,onChangeText:h,keyboardType:"decimal-pad"}),(0,V.jsx)(v.Button,{small:!0,label:"Redeem",disabled:!j||!(Number(c)>0)||100*Number(c)>(j?.balance??0),onPress:()=>{G().redeemGiftCard(o,Math.round(100*Number(c)),t)&&(f(`Redeemed \xa3${Number(c).toFixed(2)} from ${j.code}`),h(''))}})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Honour an old website bookings gift card"}),(0,V.jsx)(n.TextInput,{accessibilityLabel:"Website bookings gift card code",placeholder:"Old gift card code, e.g. WEB-OLD-10-EXAMPLE",placeholderTextColor:"#7D776C",autoCapitalize:"characters",value:u,onChangeText:g,style:v.styles.input}),u.trim().length>4?y?(0,V.jsxs)(v.Muted,{children:["Found in imported website bookings cards: balance ",(0,R.gbp)(y.balance),". Redeem it above."]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(v.Muted,{children:"Not in the imported list. Check it in your website bookings dashboard, then honour it here:"}),(0,V.jsx)(v.Field,{label:"Balance confirmed in website bookings \xa3",value:p,onChangeText:m,keyboardType:"decimal-pad"}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Honour & add to CoverCharge",disabled:!(Number(p)>0),onPress:()=>{const s=G().honourLegacyCard(e,u,Math.round(100*Number(p)),t);f(`Website bookings card ${s.code} honoured`),d(s.code),g(''),m('')}})]}):null]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Create / sell a gift card"}),(0,V.jsx)(v.Row,{wrap:!0,gap:6,children:[10,25,50,100].map(e=>(0,V.jsx)(v.Chip,{label:`\xa3${e}`,selected:r===e,onPress:()=>a(e)},e))}),(0,V.jsx)(v.Field,{label:"Recipient",value:i,onChangeText:l}),(0,V.jsx)(v.Button,{label:`Record a \xa3${r} card paid at the till`,disabled:i.trim().length<2,onPress:()=>{const t=G().buyGiftCard(e,100*r,i.trim(),'Sold at the till');f(`Created ${t.code}`),l('')}}),(0,V.jsx)(v.Muted,{children:"Gift cards are sold through your website. Record one here only when it was paid at the till."})]}),(0,V.jsx)(I.SectionHead,{title:"All cards"}),s.map(e=>(0,V.jsxs)(v.Card,{onPress:()=>d(e.code),children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",style:{flex:1},children:e.recipientName}),e.legacy?(0,V.jsx)(v.Badge,{kind:"neutral",label:"Legacy website bookings"}):null]}),(0,V.jsxs)(v.Muted,{children:[e.code," \xb7 ",(0,R.gbp)(e.balance)," of ",(0,R.gbp)(e.initial)]})]},e.id))]})}function q({rid:e,now:t,me:s}){const n=(0,S.useOrders)(e).filter(e=>'table'===e.type),[r,i]=(0,x.useState)(null),l=(0,b.useTableUse)(e,t),o=(0,b.useTableNames)(e);return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Muted,{children:"Each table has its own QR code. Guests scan, order and pay (or split) from their phone. Dine-in cooking starts once the table is seated and has ordered."}),(0,V.jsx)(v.Button,{kind:"secondary",label:"Preview customer table ordering (5)",onPress:()=>j.router.push('/table/5'),testID:"preview-table-ordering"}),(0,V.jsx)(v.Row,{wrap:!0,gap:8,children:o.map(e=>{const t=n.filter(t=>t.tableNo===e&&(0,I.LIVE)(t)),s=t.reduce((e,t)=>e+t.total-t.paid,0);return(0,V.jsxs)(y.default,{accessibilityRole:"button",accessibilityLabel:`Table ${(0,a.tableNumbers)(e)}`,onPress:()=>i(e),style:{width:'31%',padding:10,borderRadius:12,borderWidth:1,borderColor:t.length?B.colours.gold:B.colours.border,backgroundColor:B.colours.surface,gap:2},children:[(0,V.jsx)(v.T,{weight:"bold",children:(0,a.tableNumbers)(e)}),(0,V.jsx)(v.T,{size:12,colour:l[e]?.busy?'#FFD9D4':'#E2C489',children:l[e]?.busy?l[e].label:'Free'}),(0,V.jsx)(v.Muted,{children:t.length?`${t.length} order${t.length>1?'s':''}`:'No orders'}),s?(0,V.jsxs)(v.T,{size:12,colour:B.colours.amber,children:[(0,R.gbp)(s)," to pay"]}):(0,V.jsx)(v.T,{size:12,colour:B.colours.muted,children:"View QR"})]},e)})}),(0,V.jsx)(I.SectionHead,{title:"Live table orders"}),n.filter(I.LIVE).map(e=>(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",children:[(0,a.tableNumbers)(e.tableNo)," \xb7 ",e.ref]}),(0,V.jsx)(v.Badge,{kind:(0,I.statusKind)(e.status),label:(0,I.statusLabel)(e)})]}),(0,V.jsxs)(v.Muted,{children:[e.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",(0,O.minsBetween)(new Date(e.createdAt),t)," min ago \xb7 ",(0,R.gbp)(e.paid)," of ",(0,R.gbp)(e.total)," paid",e.split?` \xb7 split ${e.split.paidShares}/${e.split.ways}`:'']})]},e.id)),n.filter(I.LIVE).length?null:(0,V.jsx)(v.Muted,{children:"No live table orders."}),r?(0,V.jsxs)(v.Sheet,{visible:!0,onClose:()=>i(null),title:`${(0,a.tableNumbers)(r)} QR code`,children:[(0,V.jsx)(w.default,{style:{alignItems:'center',backgroundColor:'#fff',padding:16,borderRadius:12},children:(0,V.jsx)(C.QR,{value:`https://covercharge.example/t/${e}/${r}`,size:200})}),(0,V.jsxs)(v.Muted,{center:!0,children:["Example link (table ordering links aren\u2019t live yet): covercharge.example/t/",e,"/",r]}),(0,V.jsx)(v.Banner,{kind:"demo",title:"Print later",children:"Printing table cards from here isn\u2019t set up yet. Nothing is printed or sent."}),(0,V.jsx)(v.Button,{label:`Preview customer table ordering (${(0,a.tableNumbers)(r)})`,onPress:()=>{const e=r;i(null),j.router.push(`/table/${e}`)}}),(0,V.jsx)(v.Button,{kind:"secondary",label:"Show the code again",onPress:()=>i(r)})]}):null]})}function K({go:e,onClose:t}){const{rid:s,today:n,role:r}=(0,N.useCtx)(1e4),a=(0,S.useOrders)(s),i=(0,S.useStore)(e=>e.bookings);(0,E.useBackLayer)(!0,t);const l=a.filter(I.LIVE),o=[...l.filter(e=>(0,D.chainNeedsAction)(e,i)).map(e=>{const t=(0,D.nextStep)(e,(0,D.linkedBooking)(e,i)),s=D.CHAIN_STEPS.find(e=>e.id===t);return{id:`o-${e.id}`,at:e.createdAt,title:`${e.ref} \xb7 ${'table'===e.type?`Table ${e.tableNo??''}`.trim():'Takeaway'}${e.customerName?` \xb7 ${e.customerName}`:''}`,when:`Ordered ${(0,O.hm)(new Date(e.createdAt))}`,allergies:e.allergies.map(e=>(0,U.allergenLabel)(e.allergen)).join(', '),next:s?`Next: ${s.n}. ${s.label} sign-off`:'Sign-off waiting',tab:'orders',open:'Open Orders to sign off'}}),...i.filter(e=>e.restaurantId===s&&e.date===n&&'cancelled'!==e.status&&(0,D.bookingNeedsAction)(e,l)).map(e=>({id:`b-${e.id}`,at:`${e.date}T${e.time}`,title:`${e.name} \xb7 ${e.partySize} at ${e.time}`,when:`Booking ${e.ref??''}`.trim(),allergies:e.allergies.map(e=>(0,U.allergenLabel)(e.allergen)).join(', '),next:'Next: 1. Booked sign-off',tab:'bookings',open:'Open Bookings to sign off'}))].sort((e,t)=>e.at.localeCompare(t.at));return(0,V.jsxs)(w.default,{testID:"pending-list",style:{gap:12,alignItems:'stretch'},children:[(0,V.jsx)(E.BackButton,{onPress:t,testID:"pending-back"}),(0,V.jsx)(v.T,{center:!0,size:22,weight:"bold",colour:B.colours.gold,accessibilityRole:"header",style:{alignSelf:'stretch'},children:"Awaiting verification"}),(0,V.jsx)(v.Muted,{center:!0,testID:"pending-status",children:o.length?`${o.length} allergy ${1===o.length?'sign-off':'sign-offs'} waiting, oldest first.`:'Nothing is waiting for an allergy sign-off.'}),o.map(t=>(0,V.jsxs)(v.Card,{highlight:B.colours.red,style:{alignItems:'center',gap:8},children:[(0,V.jsxs)(w.default,{testID:`pending-row-${t.id}`,accessible:!0,accessibilityLabel:`${t.title}, ${t.when}, allergies: ${t.allergies}. ${t.next}.`,style:{alignItems:'center',gap:4,width:'100%'},children:[(0,V.jsx)(v.T,{center:!0,weight:"bold",size:18,children:t.title}),(0,V.jsx)(v.T,{center:!0,children:t.when}),(0,V.jsxs)(v.Muted,{center:!0,children:["Allergies: ",t.allergies]}),(0,V.jsx)(v.T,{center:!0,colour:B.colours.gold,children:t.next})]}),(0,V.jsx)(v.Button,{small:!0,label:t.open,onPress:()=>e(t.tab),style:{alignSelf:'stretch'}})]},t.id)),'owner'===r||'manager'===r?(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Allergen sign-off log",onPress:()=>e('more','allergen-signoffs')}):null]})}function X(){const e=(0,T.useOwner)(e=>e.merch),t=(0,T.useOwner)(e=>e.merchOrders),[s,n]=(0,x.useState)(''),[r,a]=(0,x.useState)(''),i=(t,s)=>T.useOwner.getState().setOwner({merch:e.map(e=>e.id===t?{...e,...s}:e)});return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Banner,{kind:"demo",title:"Optional add-on",children:"Sell branded items in the customer app for collection. Example only on this device; nothing is charged."}),(0,V.jsx)(I.SectionHead,{title:"Products & stock"}),e.map(e=>(0,V.jsxs)(w.default,{style:v.styles.card,children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",style:{flex:1},children:e.name}),(0,V.jsx)(v.T,{children:(0,R.gbp)(e.price)})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(w.default,{style:{flex:1,minWidth:0},children:(0,V.jsx)(v.Toggle,{label:e.live?'In shop':'Hidden',a11y:`${e.name} live`,value:e.live,onChange:t=>i(e.id,{live:t})})}),(0,V.jsx)(v.Stepper,{value:e.stock,min:0,max:500,onChange:t=>i(e.id,{stock:t}),label:`${e.name} stock`})]}),0===e.stock?(0,V.jsx)(v.T,{size:13,colour:B.colours.red,children:"Out of stock"}):e.stock<8?(0,V.jsx)(v.T,{size:13,colour:B.colours.amber,children:"Low stock"}):null]},e.id)),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Add a product"}),(0,V.jsx)(v.Field,{label:"Name",value:s,onChangeText:n}),(0,V.jsx)(v.Field,{label:"Price \xa3",value:r,onChangeText:a,keyboardType:"decimal-pad"}),(0,V.jsx)(v.Button,{small:!0,label:"Add product",disabled:s.trim().length<2||!(Number(r)>0),onPress:()=>{T.useOwner.getState().setOwner({merch:[...e,{id:`mc-${Date.now()}`,name:s.trim(),price:Math.round(100*Number(r)),stock:10,live:!0}]}),n(''),a('')}})]}),(0,V.jsx)(I.SectionHead,{title:"Shop orders"}),t.map(s=>{const n=e.find(e=>e.id===s.productId);return(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",style:{flex:1},children:[s.qty,"\xd7 ",n?.name," \xb7 ",s.customer]}),(0,V.jsx)(v.Badge,{kind:'new'===s.status?'amber':'ready'===s.status?'blue':'ok',label:s.status})]}),(0,V.jsxs)(v.Muted,{children:[s.at," \xb7 ",(0,R.gbp)((n?.price??0)*s.qty)]}),'collected'!==s.status?(0,V.jsx)(v.Button,{small:!0,label:'new'===s.status?'Mark ready':'Mark collected',onPress:()=>T.useOwner.getState().setOwner({merchOrders:t.map(e=>e.id===s.id?{...e,status:'new'===s.status?'ready':'collected'}:e)})}):null]},s.id)})]})}const Y=[{n:1,title:'Loyalty stamp card',links:[['Stamp card','loyalty']],note:'Settings, members, add/redeem, stats. One card across dine-in & takeaway.'},{n:2,title:'Bring-a-friend referrals',links:[['Referrals','referrals']],note:'Rewards, referral list and stats.'},{n:3,title:'Gift cards & vouchers',links:[['Gift cards','giftcards']],note:'Sold through your website. Check a balance, take it off the bill, honour website bookings cards.'},{n:4,title:'QR order & pay at table',links:[['Tables & QR codes','tables']],note:'Table list, QR per table, live table orders.'},{n:5,title:'Direct takeaway ordering',links:[['Takeaway settings','takeaway'],['Orders','tab:orders']],note:'Slots, capacity, live queue, readiness alerts (takeaway only).'},{n:6,title:'Table bookings, no-shows & waitlist',links:[['Bookings','tab:bookings'],['Booking settings','bookingsettings']],note:'Deposits (Deposit due / paid, set in Settings \u203a Advanced), no-show marking, reminders, online waitlist.'},{n:7,title:'Allergy verification',links:[['Allergy hub','allergy'],['Menu & allergens','menu']],note:'14 UK allergens per dish, kitchen alerts, named verification, audit log.'},{n:8,title:'Push offers & specials (opt-in)',links:[['Marketing','marketing'],['Specials & offers','offers']],note:'Saved campaign drafts. Delivery is not connected.'},{n:9,title:'Calendar & marketing hooks',links:[['Forecast calendar','tab:forecast'],['Events','events']],note:'Scottish bank holidays, school holidays, local & own events, promo hooks.'},{n:10,title:'Private feedback',links:[['Feedback inbox','feedback'],['Reviews','reviews']],note:'Low-rating alerts. No review gating.'},{n:11,title:'Lost property & coat check',links:[['Lost property','lost']],note:'Found items and coat-check tickets.'},{n:12,title:'Merch shop (optional)',links:[['Merch shop','merch']],note:'Products, stock and orders.'},{n:14,title:'Staff group chat',links:[['Chat','tab:chat']],note:'Channels, DMs, photos, reactions, read receipts, pins, auto-posts, cover requests. Local only.'},{n:16,title:'Suppliers',links:[['Suppliers','suppliers'],['Prep & stock list','prep']],note:'Contacts, categories, favourites, cut-offs and delivery days, tap to call/email/website, orders due today, order log, staff permission.'},{n:17,title:'Hours & pay',links:[['My hours & pay','mypay'],['Payroll & pay rates','payroll'],['Timesheets','timesheets']],note:'Staff see their own hours and gross pay (before tax, estimate) plus tips; owner sets hourly rates and sees the team payroll summary.'},{n:15,title:'Tip splitter',links:[['Tips','tips'],['My tips','mytips']],note:'Pay periods, card + cash pot, 4 split methods, approve & lock, compliance checklist.'},{n:18,title:'Post to social',links:[['Post to social','social'],['Connected accounts','socialaccounts'],['Marketing','marketing']],note:'Social publishing is not connected. No accounts are linked and nothing is posted.'},{n:20,title:'Head Chef app',links:[['Menu & allergens','menu'],['Suppliers','suppliers']],note:'CoverCharge for Head Chef: stock with par levels and alerts, stock take, deliveries checked against the order, recipe cards with dish cost, GP % and cash GP against a target, price-change impact, theoretical vs actual GP, menu engineering, waste log, ordering from par and forecast, prep lists, 14-allergen matrix with sign-off, temperatures, cleaning and daily checks, kitchen rota, chat, live tickets and a Sold out list (a reminder for staff, shown on the Display). Uses this menu and these suppliers.'},{n:21,title:'Branding',links:[['Branding','branding']],note:'Your logo and accent colour lead all five apps, with a small "powered by CoverCharge". Pick any colour with the colour picker or a hex code; text on it stays readable.'},{n:19,title:'Quick links',links:[['Quick links','quicklinks'],['Dashboard','tab:home']],note:'One-tap Work email (Gmail) and Website bookings view/edit for owners and managers, plus up to 6 of your own links. Staff never see the website bookings links; per-link staff visibility for the rest (off by default). Head Chef: no quick links or email at all. Opens the app or site only.'},{n:13,title:'Forecasting, dashboard & running the business',links:[['Forecast','tab:forecast'],['Dashboard','tab:home'],['Tablet preview','tablet'],['Rota','rota'],['Clock in/out','clock'],['Timesheets','timesheets'],['Analytics','analytics'],['CRM','crm'],['Plan & billing','plan']],note:'Headline forecast, rotas, geofenced clock in/out with break prompt, analytics, CRM'+f.PLAN_FEATURE_NOTE+'.'}];const J=async e=>{try{return'undefined'!=typeof localStorage&&'1'===localStorage.getItem(e)}catch{return!1}},Z=async e=>{try{'undefined'!=typeof localStorage&&localStorage.setItem(e,'1')}catch{}};function ee({kind:e}){const{r:t}=(0,N.useCtx)(6e4),s=(0,T.useOwner)(e=>e.offers);(0,x.useEffect)(()=>{(0,h.migrateLocalOnce)({offers:s},J,Z).catch(()=>{})},[]);const n=(0,u.can)('venue.settings');return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(m.LoyaltySummaryCard,{kind:e}),(0,V.jsx)(g.StaffLoyalty,{venue:t.name,canRemove:n,onOpenSettings:n?()=>{l.advancedPrefill.q='loyalty',o.useVoiceNav.getState().go?.('more','advanced')}:void 0}),n?(0,V.jsx)(v.Card,{children:(0,V.jsxs)(w.default,{style:{gap:8},children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Card, offers and bring-a-friend settings"}),(0,V.jsx)(m.LoyaltySettingsPanel,{})]})}):null]})}},1450,[5,1366,827,837,860,1451,1388,1422,1193,14,1227,988,1452,1454,1389,34,1113,1430,30,402,102,879,1247,794,874,892,867,881,1117,858,821,1165,1079,1133,884,1403,869,1048,1149,863,861,25]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffTableOrders=function({rid:e,me:l}){const p=(0,c.useOrderAtTable)(e),x=(0,c.useNow)(15e3),f=(0,c.useStore)(e=>e.bookings),w=(0,c.useOrders)(e).filter(i.isTableQr).sort((e,t)=>t.createdAt.localeCompare(e.createdAt)),S=w.filter(i.waitingForStaff),y=w.filter(e=>m(e)&&!(0,i.waitingForStaff)(e)),v=w.filter(e=>!m(e)).slice(0,8),[k,T]=(0,s.useState)(null),[$,B]=(0,s.useState)(null),M=e=>{c.repo.orders.accept(e.id,l),B(`${e.ref} accepted for table ${(0,t.tableNumbers)(e.tableNo)}: it's gone to the kitchen.`)},N=e=>{const t=(0,h.statusBlock)(e,'served',(0,h.linkedBooking)(e,f));if(t)return void B(`${e.ref}: ${t}`);const s=(new Date).toISOString();c.useStore.setState(t=>({orders:t.orders.map(t=>t.id===e.id?{...t,servedBy:{by:l,at:s}}:t)})),c.useStore.getState().setOrderStatus(e.id,'served',l),B(`${e.ref} marked served.`)},O=(e,t)=>{const s=(new Date).toISOString();c.useStore.setState(r=>({orders:r.orders.map(r=>r.id===e.id?{...r,cancelReason:t,cancelledBy:{by:l,at:s}}:r)})),c.useStore.getState().setOrderStatus(e.id,'cancelled',l),T(null),B(`${e.ref} cancelled (${t}). The guest's phone shows the reason.`)},A=({o:e,held:s})=>(0,b.jsxs)(a.Card,{highlight:s?u.colours.amber:e.allergies.length?u.colours.red:u.colours.gold,children:[(0,b.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,b.jsxs)(a.T,{weight:"semibold",children:["Table ",(0,t.tableNumbers)(e.tableNo)," \xb7 ",e.ref]}),(0,b.jsx)(a.Badge,{kind:s?'amber':'cancelled'===e.status?'neutral':'gold',label:s?'Waiting for you':'served'===e.status?'Served':'cancelled'===e.status?'Cancelled':'In the kitchen'})]}),(0,b.jsxs)(a.Muted,{children:[e.customerName," \xb7 ",j(e.createdAt,x),e.accepted?` \xb7 accepted by ${e.accepted.by}`:'']}),e.lines.map((e,t)=>(0,b.jsxs)(a.T,{children:[e.qty,"\xd7 ",e.name,e.notes?` (note: ${e.notes})`:'']},t)),e.allergies.length?(0,b.jsx)(a.Row,{wrap:!0,gap:6,children:e.allergies.map(e=>(0,b.jsx)(a.Badge,{kind:"red",label:`${(0,n.allergenLabel)(e.allergen)}: ${(0,n.severityLabel)(e.severity)}`},e.allergen))}):(0,b.jsx)(a.Muted,{children:"No allergies declared."}),e.notes?(0,b.jsxs)(a.T,{size:13,children:["Note: ",e.notes]}):null,(0,b.jsxs)(a.T,{size:13,colour:u.colours.muted,children:[(0,o.gbp)(e.total)," to pay at the bar or with the server"]}),'cancelled'===e.status&&e.cancelReason?(0,b.jsxs)(a.Muted,{children:["Reason: ",e.cancelReason]}):null,m(e)?k===e.id?(0,b.jsxs)(r.default,{style:{gap:6},children:[(0,b.jsx)(a.T,{size:13,children:"Why are you cancelling? The guest sees this."}),(0,b.jsx)(a.Row,{wrap:!0,gap:6,children:i.CANCEL_REASONS.map(t=>(0,b.jsx)(a.Chip,{label:t,onPress:()=>O(e,t)},t))}),(0,b.jsx)(a.Button,{small:!0,kind:"ghost",label:"Don't cancel",onPress:()=>T(null)})]}):(0,b.jsxs)(a.Row,{gap:8,wrap:!0,children:[s?(0,b.jsx)(a.Button,{small:!0,label:"Accept",testID:`accept-${e.ref}`,onPress:()=>M(e)}):(0,b.jsx)(a.Button,{small:!0,label:"Mark served",testID:`served-${e.ref}`,onPress:()=>N(e)}),(0,b.jsx)(a.Button,{small:!0,kind:"secondary",label:"Cancel with a reason",onPress:()=>T(e.id)})]}):null]});return(0,b.jsxs)(r.default,{style:{gap:10},children:[(0,b.jsx)(a.Muted,{children:"Tip: orders from guests' phones land here within seconds. Accept the first one from a new phone, check allergies, then mark it served. Guests pay at the bar or with their server."}),p?null:(0,b.jsx)(a.Banner,{kind:"demo",title:"Order at the table is off",children:"Managers can switch it on in Settings \u203a Advanced \u203a Order at the table."}),$?(0,b.jsx)(a.Banner,{kind:"success",children:$}):null,(0,b.jsxs)(a.T,{weight:"semibold",children:["Waiting for you to accept (",S.length,")"]}),S.length?S.map(e=>(0,b.jsx)(A,{o:e,held:!0},e.id)):(0,b.jsx)(a.Muted,{children:"Nothing waiting."}),(0,b.jsxs)(a.T,{weight:"semibold",children:["In the kitchen (",y.length,")"]}),y.length?y.map(e=>(0,b.jsx)(A,{o:e,held:!1},e.id)):(0,b.jsx)(a.Muted,{children:"No table orders being made."}),v.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a.T,{weight:"semibold",children:"Served or cancelled"}),v.map(e=>(0,b.jsx)(A,{o:e,held:!1},e.id))]}):null]})};var e,t=_r(d[0]),s=_r(d[1]),l=_r(d[2]),r=(e=l)&&e.__esModule?e:{default:e},a=_r(d[3]),n=_r(d[4]),o=_r(d[5]),i=_r(d[6]),c=_r(d[7]),h=_r(d[8]),u=_r(d[9]),b=_r(d[10]);const j=(e,t)=>{const s=Math.max(0,Math.round((t.getTime()-new Date(e).getTime())/6e4));return s<1?'just now':`${s} min ago`},m=e=>!['served','collected','closed','cancelled'].includes(e.status)},1451,[860,34,102,794,861,867,1148,874,869,821,25]); __d(function(g,_r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.customerCodeLink=y,_e.StaffLoyalty=function({venue:e,canRemove:r=!1,onOpenSettings:u}){const[p,x]=(0,t.useState)(null),[y,b]=(0,t.useState)(''),[S,k]=(0,t.useState)(null),[v,C]=(0,t.useState)(null),[M,T]=(0,t.useState)(!1),[B,R]=(0,t.useState)(''),[P,O]=(0,t.useState)(null),$=(0,c.staffServer)(),L=(0,n.can)('venue.settings'),[N,E]=(0,t.useState)(!1),[D,A]=(0,t.useState)(''),F=async e=>{if(p){E(!0),A('');try{await(0,c.saveSettings)({...p,cardOn:e}),x({...p,cardOn:e,saved:!0});const n=e?'Stamp card switched on':'Stamp card switched off';A(n),s.default.announceForAccessibility?.(n)}catch(e){R((0,o.plainError)(e))}E(!1)}},I=(0,t.useCallback)(()=>{$&&(0,c.readSettings)().then(x).catch(()=>{})},[$]);(0,t.useEffect)(()=>(I(),(0,c.watchLoyalty)(()=>{I(),C(e=>(e&&(0,c.staffCard)(e.id).then(C).catch(()=>{}),e))})),[I]);const _=async(e=y)=>{R('');try{const n=await(0,c.staffFind)(e);k(n),1===n.length&&C(n[0])}catch(e){R((0,o.plainError)(e))}},z=(0,t.useCallback)(e=>{T(!1),b((0,o.prettyCardNo)(e)),_(e)},[]);return $?(0,m.jsxs)(l.default,{style:{gap:10},children:[!p||p.cardOn||L?null:(0,m.jsx)(i.Banner,{kind:"info",title:"The stamp card is off",children:"Ask a manager to switch it on."}),p&&L?(0,m.jsx)(i.Card,{children:(0,m.jsxs)(l.default,{style:{gap:8},testID:"loy-quick",children:[p.cardOn?null:(0,m.jsx)(i.T,{weight:"semibold",children:"The stamp card is off"}),(0,m.jsx)(i.Toggle,{testID:"loy-quick-on",label:"Stamp card on",a11y:"Stamp card on. "+(p.cardOn?'On':'Off'),value:p.cardOn,disabled:N,onChange:e=>{F(e)}}),D?(0,m.jsx)(l.default,{accessibilityLiveRegion:"polite",children:(0,m.jsx)(i.Muted,{children:D})}):null,u?(0,m.jsx)(i.Button,{kind:"ghost",label:"Change the stamp card",testID:"loy-open-settings",onPress:u}):null]})}):null,p&&p.saved?(0,m.jsxs)(i.Muted,{children:[p.stampsNeeded," stamps = ",p.reward||'reward not set',". At most ",p.maxPerDay," a day",p.gapMinutes?`, ${p.gapMinutes} minutes apart`:'',"."]}):null,p&&!p.saved&&L?(0,m.jsxs)(i.Muted,{children:["Suggested settings, not saved yet: ",p.stampsNeeded," stamps = ",p.reward||'reward not set',". At most ",p.maxPerDay," a day",p.gapMinutes?`, ${p.gapMinutes} minutes apart`:'',"."]}):null,(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Find a guest"}),(0,m.jsx)(i.Field,{label:"Name, phone, email or card number",value:y,onChangeText:b,onSubmitEditing:()=>_(),autoCapitalize:"none",testID:"loyalty-search"}),(0,m.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(i.Button,{small:!0,label:"Find",disabled:y.trim().length<2,onPress:()=>_(),testID:"loyalty-find"}),(0,h.canScan)()?(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:M?'Scanning\u2026':'Scan their card',onPress:()=>T(!0)}):null]}),M?(0,m.jsx)(h.CardScanner,{onCard:z,onClose:()=>T(!1)}):null,B?(0,m.jsx)(i.Banner,{kind:"warn",children:B}):null,S&&!S.length?(0,m.jsx)(i.Muted,{children:"No one found. Check the spelling, or sign them up below."}):null,S&&S.length>1?S.map(e=>(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{children:e.name}),(0,m.jsxs)(i.Muted,{children:[(0,o.prettyCardNo)(e.cardNo)," \xb7 ",e.stamps," of ",e.needed,e.phone?` \xb7 ${e.phone}`:'']})]}),e.rewards.length?(0,m.jsx)(i.Badge,{kind:"gold",label:`${e.rewards.length} ready`}):null,(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Open",onPress:()=>C(e)})]},e.id)):null]}),v?(0,m.jsx)(f,{card:v,settings:p,canRemove:r,onChange:e=>{C(e),k(null)},onClose:()=>C(null)}):null,(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Stamp code"}),(0,m.jsx)(i.Muted,{children:"Busy? Make a one-time code and show it to the guest; they type it (or scan it) on their own phone for one stamp."}),P?(0,m.jsx)(j,{c:P,what:"One stamp."}):null,(0,m.jsx)(i.Button,{kind:"secondary",label:P?'Make another code':'Make a stamp code',disabled:!1===p?.cardOn,onPress:()=>{R(''),(0,c.staffCode)('stamp').then(O).catch(e=>R((0,o.plainError)(e)))}})]}),(0,m.jsx)(w,{venue:e,onJoined:e=>{C(e),k(null)}}),(0,m.jsx)(i.Muted,{children:"Tip: search by the last 4 digits of a phone number. Each reward can only be used once, and the card shows who used it and when."})]}):(0,m.jsxs)(l.default,{style:{gap:10},children:[(0,m.jsx)(i.Banner,{kind:"info",title:"Connect to your venue first",children:"The stamp card is saved on your venue's account. Open your invite link on this phone to connect, then you can find guests and add stamps here."}),(0,m.jsx)(i.Muted,{children:"Tip: stamps can only be added by staff of the venue, so a guest can't stamp their own card."})]})};var n=_r(d[0]),t=_r(d[1]),s=e(_r(d[2]));_r(d[3]);var l=e(_r(d[4])),r=_r(d[5]),i=_r(d[6]),o=_r(d[7]),c=_r(d[8]),u=_r(d[9]),h=_r(d[10]),m=_r(d[11]);const p=e=>{try{return new Date(e).toLocaleString('en-GB',{day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})}catch{return e}},x=e=>{try{return new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})}catch{return''}};function y(e){if('undefined'==typeof window||!window.location)return e;const n=window.location.pathname.match(/^(.*?)\/(owner|staff|customer|display|chef)-app(\/|$)/);return new URL(`${n?n[1]:''}/customer-app/index.html?loyalty=${e}`,window.location.origin).toString()}function j({c:e,what:n}){return(0,m.jsxs)(l.default,{style:{gap:4,alignItems:'center'},children:[(0,m.jsx)(i.T,{size:34,weight:"bold",colour:u.colours.gold,center:!0,children:e.code}),(0,m.jsx)(r.QR,{value:y(e.code),size:150}),(0,m.jsxs)(i.Muted,{center:!0,children:[n," Works once, until ",x(e.expiresAt),". The guest types it in Stamp card, or scans this with their phone camera."]})]})}function f({card:e,settings:n,canRemove:s,onChange:r,onClose:h}){const[x,y]=(0,t.useState)(null),[f,w]=(0,t.useState)(!1),[b,S]=(0,t.useState)(null),[k,v]=(0,t.useState)(null),C=async e=>{w(!0),y(null);try{await e()}catch(e){y({kind:'warn',text:(0,o.plainError)(e)})}finally{w(!1),S(null)}};return(0,m.jsxs)(i.Card,{highlight:u.colours.gold,children:[(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.H2,{children:e.name}),(0,m.jsxs)(i.Muted,{children:["Card ",(0,o.prettyCardNo)(e.cardNo),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']})]}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Close",onPress:h})]}),(0,m.jsxs)(i.T,{size:20,weight:"semibold",children:[e.stamps," of ",e.needed," stamps"]}),(0,m.jsxs)(i.Muted,{children:["Next reward: ",e.reward]}),x?(0,m.jsx)(i.Banner,{kind:x.kind,children:x.text}):null,(0,m.jsx)(i.Button,{label:f?'Saving\u2026':'Add a stamp',disabled:f||!1===n?.cardOn,testID:"loyalty-add-stamp",onPress:()=>C(async()=>{const n=await(0,c.staffStamp)(e.id);r(n),y({kind:'success',text:n.newReward?`Stamp added. ${e.name} has earned: ${n.rewards[n.rewards.length-1]?.title??'a reward'}.`:`Stamp added: ${n.stamps} of ${n.needed}.`})})}),!1===n?.cardOn?(0,m.jsx)(i.Muted,{children:"The stamp card is switched off in Settings \u203a Advanced \u203a Loyalty, so no stamps can be added."}):null,e.rewards.length?(0,m.jsx)(i.T,{weight:"semibold",children:"Rewards ready"}):(0,m.jsx)(i.Muted,{children:"No rewards ready yet."}),e.rewards.map(e=>(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{children:e.title}),e.expiresAt?(0,m.jsxs)(i.Muted,{children:["Use by ",p(e.expiresAt)]}):null]}),b===e.id?(0,m.jsxs)(i.Row,{gap:6,children:[(0,m.jsx)(i.Button,{small:!0,label:"Yes, used now",disabled:f,onPress:()=>C(async()=>{const n=await(0,c.staffRedeem)(e.id);r(n),y({kind:'success',text:`${n.redeemed} marked used.`})})}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Not yet",onPress:()=>S(null)})]}):(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Use reward",onPress:()=>S(e.id)})]},e.id)),(0,m.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Sign-in code for their phone",onPress:()=>C(async()=>v(await(0,c.staffCode)('link',e.id)))}),s?'remove'===b?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(i.Button,{small:!0,kind:"danger",label:"Yes, remove their details",onPress:()=>C(async()=>{await(0,c.staffRemove)(e.id),r(null),h()})}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Keep",onPress:()=>S(null)})]}):(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Remove guest",onPress:()=>S('remove')}):null]}),k?(0,m.jsx)(j,{c:k,what:`Opens ${e.name}'s card on their phone.`}):null,'remove'===b?(0,m.jsx)(i.Muted,{children:"Removing wipes their name, phone and email and closes the card (for example if they ask you to delete their data). Counts in the summary stay."}):null,(0,m.jsx)(i.T,{weight:"semibold",children:"Recent"}),e.history.length?e.history.slice(0,8).map((e,n)=>(0,m.jsxs)(i.Muted,{children:[p(e.at)," \xb7 ",e.what]},n)):(0,m.jsx)(i.Muted,{children:"Nothing yet."})]})}function w({venue:e,onJoined:n}){const[s,l]=(0,t.useState)(''),[r,u]=(0,t.useState)(''),[h,p]=(0,t.useState)(''),[x,y]=(0,t.useState)(!1),[j,f]=(0,t.useState)(!1),[w,b]=(0,t.useState)('');return(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Sign a guest up"}),(0,m.jsx)(i.Muted,{children:"Only a name is needed. Read the agreement to the guest and tick it only if they say yes."}),(0,m.jsx)(i.Field,{label:"Guest's name",value:s,onChangeText:l,maxLength:60}),(0,m.jsx)(i.Field,{label:"Phone (optional)",value:r,onChangeText:u,keyboardType:"phone-pad",maxLength:20}),(0,m.jsx)(i.Field,{label:"Email (optional)",value:h,onChangeText:p,keyboardType:"email-address",autoCapitalize:"none",maxLength:120}),(0,m.jsx)(i.Toggle,{label:`The guest agrees: \u201c${(0,o.consentText)(e)}\u201d`,value:x,onChange:y}),w?(0,m.jsx)(i.Banner,{kind:"warn",children:w}):null,(0,m.jsx)(i.Button,{label:j?'Saving\u2026':'Sign up',disabled:j||!x||!s.trim(),onPress:async()=>{f(!0),b('');try{n(await(0,c.staffJoin)({name:s,phone:r,email:h,consent:x,consentText:(0,o.consentText)(e)})),l(''),u(''),p(''),y(!1)}catch(e){b((0,o.plainError)(e))}finally{f(!1)}}})]})}},1452,[988,34,281,236,102,1247,794,1224,1227,821,1453,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"canScan",{enumerable:!0,get:function(){return l}}),_e.CardScanner=function({onCard:t,onClose:n}){const f=(0,e.useRef)(null),[h,w]=(0,e.useState)('');return(0,e.useEffect)(()=>{if(!l())return void w('This browser can\u2019t scan. Type the card number or search by name instead.');let e=!1,n=null,c=null;const o=document.createElement('video');return o.setAttribute('playsinline','true'),o.muted=!0,Object.assign(o.style,{width:'100%',maxWidth:'360px',borderRadius:'12px',border:'2px solid #CFA45F'}),(async()=>{try{if(n=await navigator.mediaDevices.getUserMedia({video:{facingMode:'environment'}}),e)return void n.getTracks().forEach(e=>e.stop());o.srcObject=n,await o.play();const u=f.current;u?.appendChild(o);const l=new(0,window.BarcodeDetector)({formats:['qr_code']}),h=async()=>{if(!e){try{const e=await l.detect(o);for(const n of e){const e=(0,s.readCardQr)(String(n.rawValue??''));if(e)return void t(e)}}catch{}c=setTimeout(h,300)}};h()}catch{w('The camera didn\u2019t start. Allow the camera, or type the card number instead.')}})(),()=>{e=!0,c&&clearTimeout(c),n?.getTracks().forEach(e=>e.stop()),o.remove()}},[t]),(0,u.jsxs)(c.default,{style:{gap:8,alignItems:'center'},children:[(0,u.jsx)(c.default,{ref:f,style:{width:'100%',alignItems:'center'}}),h?(0,u.jsx)(o.Banner,{kind:"warn",children:h}):(0,u.jsx)(o.Muted,{center:!0,children:"Point the camera at the QR on the guest\u2019s card screen."}),(0,u.jsx)(o.Button,{kind:"ghost",label:"Close camera",onPress:n})]})};var e=r(d[0]);r(d[1]);var t,n=r(d[2]),c=(t=n)&&t.__esModule?t:{default:t},o=r(d[3]),s=r(d[4]),u=r(d[5]);const l=()=>'undefined'!=typeof window&&'BarcodeDetector'in window&&!!navigator?.mediaDevices?.getUserMedia},1453,[34,236,102,794,1224,25]); @@ -1583,7 +1583,7 @@ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule', __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useCarViewport=function(){(0,t.useEffect)(()=>{if(!o)return;const t=document.documentElement,n=document.body,s=[t.style.cssText,n.style.cssText];for(const o of[t.style,n.style])o.height='100%',o.margin='0',o.overflow='hidden',o.overscrollBehavior='none',o.touchAction='manipulation';return()=>{t.style.cssText=s[0],n.style.cssText=s[1]}},[])};var t=r(d[0]);r(d[1]);const o='undefined'!=typeof document},1500,[34,236]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),f=r(d[3]),u=r(d[4]);function c(){return(0,n.canShow)('staff')?(0,u.jsx)(f.StaffApp,{}):(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1501,[30,34,872,1502,25]); __d(function(g,_r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffApp=function(){return(0,ye.jsx)(q.StaffAppCtx.Provider,{value:!0,children:(0,ye.jsx)(Se,{})})};var s=_r(d[0]),t=_r(d[1]),o=_r(d[2]),r=_r(d[3]),i=_r(d[4]),l=_r(d[5]),n=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),f=_r(d[10]),p=_r(d[11]),b=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),w=_r(d[17]),v=_r(d[18]),S=_r(d[19]),C=_r(d[20]),T=_r(d[21]),M=_r(d[22]),R=_r(d[23]),B=_r(d[24]),A=_r(d[25]),I=_r(d[26]),P=e(_r(d[27])),O=e(_r(d[28])),L=e(_r(d[29])),W=e(_r(d[30])),z=e(_r(d[31])),E=_r(d[32]),H=_r(d[33]),_=_r(d[34]),D=_r(d[35]),N=_r(d[36]),F=_r(d[37]),U=_r(d[38]),V=_r(d[39]),$=_r(d[40]),G=_r(d[41]),Y=_r(d[42]),Q=_r(d[43]),J=_r(d[44]),K=_r(d[45]),q=_r(d[46]),X=_r(d[47]),Z=_r(d[48]),ee=_r(d[49]),se=_r(d[50]),te=_r(d[51]),ae=_r(d[52]);_r(d[53]);var oe=_r(d[54]),re=_r(d[55]),ie=_r(d[56]),le=_r(d[57]),ne=_r(d[58]),de=_r(d[59]),ce=_r(d[60]),ue=_r(d[61]),he=_r(d[62]),fe=_r(d[63]),pe=_r(d[64]),ge=_r(d[65]),me=_r(d[66]),be=_r(d[67]),ye=_r(d[68]);const xe=he.ROSTER.find(e=>'chef'===e.app)?.id,ke=[{id:'home',label:'Home',icon:'home'},{id:'clock',label:'Clock',icon:'clock'},{id:'rota',label:'Rota',icon:'bookings'},{id:'chat',label:'Chat',icon:'chat'},{id:'me',label:'Me',icon:'user'}],je={home:'Today',clock:'Clock in / out',rota:'Rota, swaps & leave',chat:'Staff chat',me:'Me'},we=[{id:'mytips',title:'Tips',sub:'The venue tip pot and today\u2019s tips'},{id:'reviews',title:'Reviews',sub:'Published reviews, newest first'},{id:'bookings',title:'Bookings',sub:'Any day, back or forward: tables, Covers, Unseat and Undo'},{id:'loyalty',title:'Stamp card',sub:'Find a guest, add a stamp or use a reward'},{id:'guests',title:'Guest profiles',sub:'Look a guest up: visits, Covers, allergies they told us, preferences'},{id:'giftcards',title:'Gift cards',sub:'Check a balance, take it off the bill, mark paid at the till'},{id:'tableorders',title:'Table orders',sub:'Orders from guests\u2019 phones at the table: accept, mark served or cancel'},{id:'soldout',title:'Sold out',sub:'What\u2019s run out today. Mark sold out or Back on; shows on the Display'},{id:'board',title:'Question board',sub:'Ask the team anything anonymously, and vote'},{id:'recipecards',title:'Recipe cards',sub:'Signed-off dishes: photo, ingredients, method and allergens (read-only)'},{id:'avatar',title:'My avatar',sub:'Your space-age avatar, or create one from a photo'},{id:'cashup',title:'Cash up',sub:'End-of-night takings: take a picture of the taking sheet or upload a spreadsheet (if a manager has switched it on for you)'},{id:'haccp',title:'Food safety checks',sub:'Record fridge, freezer, cooking and other checks (say or type)'},{id:'accidents',title:'Accident book',sub:'Report an accident or near miss; see your own entries'},{id:'mypay',title:'My hours & pay',sub:'Shifts, paid hours and estimated pay'},{id:'timesheets',title:'My timesheets',sub:'Your clock-ins, breaks and any changes'},{id:'orderlists',title:'Order lists',sub:'Add what\u2019s running low (Alsons drinks, Cash and carry)'},{id:'phone',title:'Turn on alerts',sub:'Get your reminders on this phone, even with the app closed'},{id:'suppliers',title:'Suppliers',sub:'Contacts and order days (if your manager allows)'},{id:'privacy',title:'Privacy & location',sub:'What CoverCharge for Staff stores about you'}],ve=[{id:'mgr-plan',title:'Tables & areas',sub:'Edit the table plan, areas, seats and joined tables'},{id:'mgr-times',title:'Booking times',sub:'Kitchen hours, table times and Covers per booking slot'},{id:'mgr-bookings',title:'Bookings (manager)',sub:'New, edit and cancel bookings, walk-ins, seat, move and finish tables, deposit status'},{id:'mgr-clear',title:'Tables to clear',sub:'Tables waiting to be cleared; mark them cleared'},{id:'mgr-blocks',title:'Block bookings',sub:'Block now, add a block, close the garden'},{id:'mgr-allergy',title:'Allergy checks',sub:'Every allergy order\u2019s sign-offs and the allergen log'},{id:'mgr-stock',title:'Tracked stock',sub:'What\u2019s counted live through service; add or change items'},{id:'mgr-clock',title:'Who\u2019s clocked in',sub:'Today\u2019s clock-ins for the team (read only)'},{id:'mgr-swaps',title:'Shift swaps',sub:'Approve swaps and cover, or give a shift to someone else'}];function Se(){const{r:e,rid:i,me:n,meId:S,today:C,now:T}=(0,q.useCtx)(3e4);(0,A.useReviewAlerts)(i),(0,de.useStaffTipsNotice)(i,C);const ce=(0,q.useSignedIn)(),ue=ce?.ownerAccess&&'owner'!==ce.role?'owner privileges':ce?.managerAccess&&'staff'===ce.role?'manager privileges':'',he=(0,q.useShiftManager)(),Se=(0,be.useSync)(e=>e.perms),Me=ve.filter(e=>'mgr-swaps'===e.id?Se.includes('rota.swap'):'mgr-times'!==e.id||(Se.includes('bookings.settings')||Se.includes('*')));(0,y.useSoldOutLink)(!0,n);(0,N.useOwner)(e=>e.staff);const Re=(0,N.useOwner)(e=>e.staffCanViewSuppliers),[Be,Ae]=(0,M.useState)('home'),[Ie,Pe]=(0,M.useState)(null),[Oe,Le]=(0,M.useState)(!1),We=(0,M.useRef)(null);(0,M.useEffect)(()=>{(0,q.ensureAttendance)(C,T),(0,U.ensureChat)(T)},[C]),globalThis.__ccNow=T.getTime();const ze=(0,U.useChatUnread)().total,Ee=(0,M.useRef)({t:'home',s:null});Ee.current={t:Be,s:Ie};const He=(0,M.useRef)([]),De=(0,M.useCallback)((e,s=null)=>{const t=Ee.current;t.t===e&&t.s===s||(He.current=[...He.current,{...t,y:Ue.leave()}].slice(-30),Ue.restore(0)),Ae(e),Pe(s)},[]),Ne=(0,M.useCallback)(()=>{if((0,u.runBackLayer)())return!0;const e=Ee.current;let s=He.current.pop();for(;s&&s.t===e.t&&s.s===e.s;)s=He.current.pop();if(!s&&'home'===e.t&&!e.s)return!1;const t=s??{t:'home',s:null};return Ue.leave(),Ae(t.t),Pe(t.s),Ue.restore(t.y??0),!0},[]);(0,u.useWebBack)(Ne);const Fe=(0,u.useInnerBackShown)();(0,M.useEffect)(()=>{w.PITCH&&(globalThis.__pitchGo=De,globalThis.__pitchClock={setClockServer:j.setClockServer,markClockSent:j.markClockSent,markClockUnsent:j.markClockUnsent})},[De]),(0,M.useEffect)(()=>(0,k.startForegroundRefresh)(),[]),(0,$.useShiftReminders)({rid:i,staffId:S,name:n,onStartBreak:()=>De('clock')}),(0,G.useScheduledNotices)({rid:i,staffId:ce?.id??'',name:n,onOpen:e=>{'orderlists'===e&&De('me','orderlists')}}),(0,Y.useOffRotaPrompt)({rid:i,staffId:ce?.id??''});const Ue=(0,c.useScrollMemory)(We),Ve=(0,M.useCallback)((e,s=null)=>'chat'===e?De('chat'):'clock'===s?De('clock'):'rota'===s?De('rota'):s&&we.some(e=>e.id===s)?De('me',s):'blocks'===s&&he?De('me','mgr-blocks'):void De('home'===e?'home':'me'),[De,he]);(0,M.useEffect)(()=>{const e=P.default.addEventListener('hardwareBackPress',Ne);return()=>e.remove()},[Ne]);const $e='me'===Be&&Ie?we.find(e=>e.id===Ie)??(he?Me.find(e=>e.id===Ie):void 0):void 0,Ge=(0,K.useOrderLists)(e=>e.settings[i]?.allowStaff??!0),Ye=we.filter(e=>('suppliers'!==e.id||Re)&&('orderlists'!==e.id||Ge||ce&&'staff'!==ce.role));(0,M.useEffect)(()=>{N.useOwner.getState().staffAs&&N.useOwner.setState({staffAs:void 0})},[]);(0,z.default)().width;return(0,ye.jsxs)(E.SafeAreaView,{style:{flex:1,backgroundColor:F.colours.bg},edges:['top','left','right','bottom'],children:[(0,ye.jsxs)(W.default,{style:{position:'relative',paddingHorizontal:14,paddingTop:6,paddingBottom:8,borderBottomWidth:1,borderColor:F.colours.border,gap:6},children:[(0,ye.jsx)(W.default,{style:{position:'absolute',top:4,right:6,zIndex:5,flexDirection:'row',alignItems:'center'},children:(0,ye.jsx)(D.VoiceSlot,{size:44})}),(0,ye.jsx)(W.default,{testID:"header-me-wrap",style:{alignItems:'flex-start',minHeight:44,justifyContent:'center',maxWidth:'70%'},children:(0,ye.jsx)(O.default,{testID:"header-me",accessibilityRole:"button",accessibilityLabel:`${(0,r.privateClockVenue)(i)?`Signed in as ${n}`:'Signed in as'}${ue?`, ${ue}`:''}`,onPress:()=>Le(!0),hitSlop:6,style:{borderWidth:1,borderColor:F.colours.gold,borderRadius:22,paddingHorizontal:10,paddingVertical:4,maxWidth:'100%',minHeight:44,justifyContent:'center'},children:(0,ye.jsxs)(H.Row,{gap:6,style:{justifyContent:'flex-start'},children:[(0,ye.jsx)(ge.StaffAvatar,{id:S,size:24,ring:!1}),(0,ye.jsxs)(W.default,{style:{flexShrink:1},children:[(0,ye.jsxs)(H.T,{size:13,weight:"semibold",colour:F.colours.gold,numberOfLines:1,style:{flexShrink:1},children:[n.replace(' (example)',''),ce?'':' (preview)'," \u25be"]}),ue?(0,ye.jsx)(H.Muted,{center:!1,size:10,numberOfLines:1,children:ue}):null]})]})})}),(0,ye.jsx)(_.VenueHeaderBlock,{rid:e.id,name:e.name,badge:"STAFF",place:"Front of House"+(e.location?` \xb7 ${e.location.split(',').slice(0,2).join(',')}`:'')})]}),(0,ye.jsxs)(L.default,{ref:We,...Ue.props,contentContainerStyle:{padding:14,paddingBottom:16,gap:12,width:'100%',maxWidth:760,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:[(0,ye.jsx)(u.BackTitleRow,{back:!('home'===Be&&!Ie||Fe),onBack:Ne,title:$e?$e.title:je[Be]}),'home'===Be&&he?(0,ye.jsx)(se.ManagerFeaturesNote,{}):null,'home'===Be&&ce&&'staff'!==ce.role&&!he&&'undefined'!=typeof window?(0,ye.jsxs)(W.default,{testID:"manager-access-banner",style:{borderWidth:1,borderColor:F.colours.gold,borderRadius:12,padding:10,gap:6},children:[(0,ye.jsx)(H.T,{weight:"semibold",colour:F.colours.gold,children:"You have manager access"}),(0,ye.jsx)(H.Muted,{children:"The Manager app has everything here plus bookings, the rota, staff and settings."}),(0,ye.jsx)(O.default,{accessibilityRole:"button",onPress:()=>{const e=(0,ae.appUrl)('owner');e&&window.location.assign(e)},style:{alignSelf:'flex-start',borderWidth:1,borderColor:F.colours.gold,borderRadius:14,paddingHorizontal:12,paddingVertical:5,minHeight:44,justifyContent:'center'},children:(0,ye.jsx)(H.T,{size:14,colour:F.colours.gold,children:"Open the Managers app \u203a"})})]}):null,'home'===Be&&ce?(0,ye.jsx)(v.MyTasksToday,{rid:i,staffId:ce.id,name:ce.name,onShift:(0,$.shiftNow)(ce.id,T.getTime()).on}):null,'home'===Be?(0,ye.jsx)(Ce,{go:Ve}):null,'clock'===Be?(0,ye.jsx)(ne.ClockInOut,{}):null,'rota'===Be?(0,ye.jsx)(ne.Rota,{}):null,'chat'===Be?(0,ye.jsx)(U.Chat,{go:Ve}):null,'me'!==Be||$e?null:(0,ye.jsxs)(W.default,{style:{gap:10},children:[(0,ye.jsx)(W.default,{style:{borderRadius:14,borderWidth:1,borderColor:F.colours.border,backgroundColor:F.colours.surface,overflow:'hidden'},children:Ye.map((e,s)=>(0,ye.jsx)(O.default,{testID:`audit-page-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.title,onPress:()=>De('me',e.id),style:({pressed:e})=>({padding:12,borderTopWidth:s?1:0,borderColor:F.colours.border,backgroundColor:e?'#1d1a14':'transparent'}),children:(0,ye.jsxs)(H.Row,{style:{justifyContent:'space-between'},children:[(0,ye.jsxs)(W.default,{style:{flex:1},children:[(0,ye.jsx)(H.T,{weight:"medium",children:e.title}),(0,ye.jsx)(H.Muted,{children:e.sub})]}),(0,ye.jsx)(H.T,{colour:F.colours.muted,children:"\u203a"})]})},e.id))}),he?(0,ye.jsxs)(W.default,{testID:"manager-features",style:{gap:6},children:[(0,ye.jsx)(H.T,{weight:"semibold",colour:F.colours.gold,children:"Manager features"}),(0,ye.jsx)(W.default,{style:{borderRadius:14,borderWidth:1,borderColor:F.colours.gold,backgroundColor:F.colours.surface,overflow:'hidden'},children:Me.map((e,s)=>(0,ye.jsx)(O.default,{testID:`audit-page-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.title,onPress:()=>De('me',e.id),style:({pressed:e})=>({padding:12,borderTopWidth:s?1:0,borderColor:F.colours.border,backgroundColor:e?'#1d1a14':'transparent'}),children:(0,ye.jsxs)(H.Row,{style:{justifyContent:'space-between'},children:[(0,ye.jsxs)(W.default,{style:{flex:1},children:[(0,ye.jsx)(H.T,{weight:"medium",children:e.title}),(0,ye.jsx)(H.Muted,{children:e.sub})]}),(0,ye.jsx)(H.T,{colour:F.colours.muted,children:"\u203a"})]})},e.id))}),(0,ye.jsx)(se.ManagerFeaturesAbout,{})]}):null,Re?null:(0,ye.jsx)(H.Muted,{children:"Suppliers are hidden: your manager hasn\u2019t shared them with staff."}),(0,ye.jsxs)(H.Muted,{center:!0,children:["Staff app \xb7 ",x.APP_VERSION," \xb7 ",'live'===be.useSync.getState().mode?'shared with your team':'saved on this device until it connects']})]}),he&&$e?.id.startsWith('mgr-')?(0,ye.jsxs)(q.ShiftMgrScope.Provider,{value:!0,children:['mgr-plan'===$e.id?(0,ye.jsx)(s.TablePlan,{}):null,'mgr-times'===$e.id?(0,ye.jsx)(t.StaffBookingTimes,{}):null,'mgr-bookings'===$e.id?(0,ye.jsx)(V.Bookings,{}):null,'mgr-clear'===$e.id?(0,ye.jsx)(se.TablesToClear,{rid:i}):null,'mgr-blocks'===$e.id?(0,ye.jsx)(X.BlocksPage,{}):null,'mgr-allergy'===$e.id?(0,ye.jsx)(Z.AllergenSignOffLog,{}):null,'mgr-stock'===$e.id?(0,ye.jsxs)(W.default,{style:{gap:10},children:[(0,ye.jsx)(ee.TrackedStockPage,{}),(0,ye.jsx)(b.SoldOutList,{rid:i,by:n.replace(' (example)','')})]}):null,'mgr-clock'===$e.id?(0,ye.jsx)(se.ClockOverview,{today:C,now:T}):null,'mgr-swaps'===$e.id?(0,ye.jsx)(se.SwapApprovals,{today:C,me:n}):null]}):null,'loyalty'===$e?.id?(0,ye.jsx)(h.StaffLoyalty,{venue:e.name}):null,'guests'===$e?.id?(0,ye.jsx)(f.GuestProfiles,{me:n.replace(' (example)',''),manager:!1}):null,'bookings'===$e?.id?(0,ye.jsx)(V.Bookings,{}):null,'giftcards'===$e?.id?(0,ye.jsx)(p.GiftCardsPage,{me:n.replace(' (example)','')}):null,'tableorders'===$e?.id?(0,ye.jsx)(l.StaffTableOrders,{rid:i,me:n.replace(' (example)','')}):null,'soldout'===$e?.id?(0,ye.jsx)(b.SoldOutList,{rid:i,by:n.replace(' (example)','')}):null,'board'===$e?.id?(0,ye.jsx)(I.QuestionBoard,{rid:i,today:C,manager:!1,by:""}):null,'recipecards'===$e?.id?(0,ye.jsx)(R.RecipeCards,{rid:e.id,actor:{name:n,role:'staff'},mode:"read"}):null,'avatar'===$e?.id?(0,ye.jsx)(me.AvatarMaker,{meId:S,me:n}):null,'cashup'===$e?.id?(0,ye.jsx)(Te,{rid:i,today:C,meId:S,me:n}):null,'haccp'===$e?.id?(0,ye.jsx)(pe.HaccpLog,{mode:"staff",me:n,meId:S,now:T}):null,'accidents'===$e?.id?(0,ye.jsx)(fe.AccidentBook,{app:"staff",me:n,meId:S,now:T,seeAll:!1}):null,'mypay'===$e?.id?(0,ye.jsxs)(W.default,{style:{gap:10},children:[(0,ye.jsx)(ie.MyPeriods,{staffId:S}),(0,ye.jsx)(re.MyHoursPay,{staffId:S})]}):null,'mytips'===$e?.id?(0,ye.jsx)(de.MyTips,{}):null,'reviews'===$e?.id?(0,ye.jsx)(B.ReviewsSection,{rid:i,mode:"read",venueName:e.name}):null,'timesheets'===$e?.id?(0,ye.jsxs)(W.default,{style:{gap:10},children:[(0,ye.jsx)(ie.MyPeriods,{staffId:S}),(0,ye.jsx)(ne.Timesheets,{})]}):null,'orderlists'===$e?.id?(0,ye.jsx)(Q.OrderListsScreen,{rid:i,today:C,editor:!!ce&&'staff'!==ce.role&&!he,who:{id:S,name:n.replace(' (example)','')}}):null,'phone'===$e?.id?(0,ye.jsx)(J.PhoneAlerts,{}):null,'suppliers'===$e?.id?Re?(0,ye.jsx)(le.Suppliers,{}):(0,ye.jsx)(H.Muted,{children:"Your manager hasn\u2019t shared suppliers with staff."}):null,'privacy'===$e?.id?(0,ye.jsxs)(W.default,{style:{gap:8},children:[(0,r.privateClockVenue)(i)?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(H.T,{size:14,children:"Location is checked only when you choose Clock in at the pub. Only a pass or fail is saved with the clock-in time, or an audited manager override."}),(0,ye.jsx)(H.T,{size:14,children:"Your position, accuracy and distance are never saved. There are no location trails, background/arrival checks, clock-out checks or break checks."})]}):(0,ye.jsxs)(ye.Fragment,{children:[" ",(0,ye.jsx)(H.T,{size:14,children:"\u2022 Location is checked when you tap Clock in, Clock out, Start break or End break, and (if you allowed location) while the app is open to ask if you want to clock in when you\u2019re at the venue but not on the rota. Never in the background."}),(0,ye.jsx)(H.T,{size:14,children:"\u2022 Each clock record keeps the location reading, how accurate it was, whether it was inside the venue area, and the time. Managers can see these."})]}),(0,ye.jsx)(H.T,{size:14,children:"\u2022 You see only your own hours, pay estimates and tips. Managers see the team\u2019s."}),(0,ye.jsxs)(H.T,{size:14,children:["\u2022 Chat messages stay within ",e.name,"\u2019s team."]}),(0,ye.jsx)(H.T,{size:14,children:"\u2022 Pay figures are estimates before tax and deductions; your payslip is the official record."})]}):null]}),(0,ye.jsx)(oe.BottomTabs,{background:(0,o.soutersSurface)('#0d0d0d'),active:Be,onPress:e=>De(e),tabs:ke.map(e=>({id:e.id,label:e.label,icon:e.icon,badge:'chat'===e.id&&ze?{text:String(ze),bg:F.colours.red}:null}))}),(0,ye.jsx)(H.Sheet,{visible:Oe,onClose:()=>Le(!1),title:"Signed in as",children:ce?(0,ye.jsxs)(W.default,{style:{gap:8},children:[(0,ye.jsxs)(H.Row,{gap:10,children:[(0,ye.jsx)(ge.StaffAvatar,{id:ce.id,size:48}),(0,ye.jsxs)(W.default,{style:{flex:1},children:[(0,ye.jsx)(H.T,{weight:"semibold",children:ce.name}),(0,ye.jsx)(H.Muted,{children:(0,ae.levelJob)(ce.level??'Staff',ce.job)})]})]}),(0,ye.jsx)(H.Muted,{children:"Signed in with your personal link. This phone remembers you."}),he?(0,ye.jsx)(H.Muted,{children:"Manager features are on for you in this app."}):null,'staff'===ce.role||he?null:(0,ye.jsx)(H.Button,{kind:"secondary",label:"Back to CoverCharge for Managers",onPress:()=>{const e=(0,ae.appUrl)('owner');e&&window.location.assign(e)}}),ce.id===xe?(0,ye.jsx)(H.Button,{kind:"secondary",label:"Back to CoverCharge for Head Chef",onPress:()=>{const e=(0,ae.appUrl)('chef');e&&window.location.assign(e)}}):null]}):(0,ye.jsxs)(W.default,{style:{gap:8},children:[(0,ye.jsx)(H.Muted,{children:"Not signed in: this is a preview. Open your personal link, or paste it here, to sign in as yourself."}),(0,ye.jsx)(te.SignInWithLink,{})]})})]})}function Ce({go:e}){const{rid:s,today:t}=(0,q.useCtx)(3e4),o=(0,ue.useTravelDay)('staff',t);return(0,ye.jsxs)(W.default,{style:{gap:10},children:[(0,ye.jsx)(n.WhoBar,{}),(0,ye.jsx)(ue.DayBar,{app:"staff",today:t}),o?null:(0,ye.jsx)(i.CoversToday,{rid:s}),o?(0,ye.jsx)(ue.DayView,{rid:s,day:o,today:t,app:"staff"}):(0,ye.jsx)(ce.StaffHome,{go:e})]})}function Te({rid:e,today:s,meId:t,me:o}){return!0!==(0,T.useCashAccess)(e=>e.mine)?(0,ye.jsx)(C.NoCashUpAccess,{}):(0,ye.jsx)(S.CashUpScreen,{rid:e,today:s,canEdit:!0,who:{id:t??'me',name:o.replace(' (example)','')}})}},1502,[1404,1503,828,995,1089,1451,1181,1047,1048,1452,1476,1454,1147,980,1012,1504,1009,2,1052,1053,1428,997,34,1149,1207,1211,1177,373,402,295,102,426,36,794,873,1130,892,821,1152,1365,1085,1102,1103,1098,1049,1032,1079,1446,1441,1460,1505,1374,1001,236,1213,1163,1169,1402,1176,1175,1416,1166,15,1182,1183,926,793,988,25]); -__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:n}=(0,l.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[b,h]=(0,t.useState)(String(e.settings.turnMins??'')),[y,v]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[f,k]=(0,t.useState)(!1),M=(e,t,n)=>c(s=>({...s,[e]:0===t?[n,s[e]?.[1]??'']:[s[e]?.[0]??'',n]})),S=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(b)<=360&&Number(y)>=1&&Number(y)<=1e3;return(0,r.jsxs)(s.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(n=>({...n,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>M(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>M(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:b,onChangeText:h,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:y,onChangeText:v,keyboardType:"number-pad"})]}),(0,r.jsx)(i.Button,{label:f?'Saving\u2026':'Save booking times',disabled:!S||f,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{k(!0);try{await(0,o.saveStaffBookingTimes)(n,u,Number(b),Number(y)),j('Booking times saved.')}catch(e){j(e.message)}finally{k(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),n=_r(_d[1]),s=(e=n)&&e.__esModule?e:{default:e},i=_r(_d[2]),l=_r(_d[3]),o=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1503,[34,102,794,1079,988,25]); +__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:s}=(0,o.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[h,b]=(0,t.useState)(String(e.settings.turnMins??'')),[v,y]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[k,S]=(0,t.useState)(!1),f=(e,t,s)=>c(n=>({...n,[e]:0===t?[s,n[e]?.[1]??'']:[n[e]?.[0]??'',s]})),p=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(h)<=360&&Number(v)>=1&&Number(v)<=1e3;return(0,r.jsxs)(n.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(s=>({...s,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>f(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>f(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:h,onChangeText:b,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:v,onChangeText:y,keyboardType:"number-pad"}),e.settings.bookingCoversPerStart||e.settings.bookingPartiesPerStart?(0,r.jsx)(i.Muted,{center:!0,children:"Online booking uses the covers and bookings caps at each start time (Settings \u203a Capacity & waitlist), not this half-hour figure."}):null]}),(0,r.jsx)(i.Button,{label:k?'Saving\u2026':'Save booking times',disabled:!p||k,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{S(!0);try{await(0,l.saveStaffBookingTimes)(s,u,Number(h),Number(v)),j('Booking times saved.')}catch(e){j(e.message)}finally{S(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),s=_r(_d[1]),n=(e=s)&&e.__esModule?e:{default:e},i=_r(_d[2]),o=_r(_d[3]),l=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1503,[34,102,794,1079,988,25]); __d(function(g,_r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.newerRelease=r,_e.startForegroundRefresh=function(n={}){if('undefined'==typeof document)return()=>{};let o='hidden'===document.visibilityState?Date.now():0,c=!1;const s=n.reload??(()=>location.reload()),u=async()=>{if(!c){c=!0;try{await Promise.race([e.mutationQueue.retryNow(),new Promise(e=>setTimeout(e,4e3))]),n.onWake?.();const t=await(navigator.serviceWorker?.getRegistration?.().catch(()=>{}));if(await(t?.update?.().catch(()=>{})),t?.waiting){try{t.waiting.postMessage({type:'SKIP_WAITING'})}catch{}return void setTimeout(s,3e3)}await r().catch(()=>!1)&&s()}finally{c=!1}}},l=()=>{if('hidden'===document.visibilityState)return void(o=Date.now());const n=o?Date.now()-o:0;o=0,e.mutationQueue.retryNow(),n>=t&&u()},f=()=>{e.mutationQueue.retryNow()};document.addEventListener('visibilitychange',l);for(const e of['focus','online','pageshow'])window.addEventListener(e,f);return()=>{document.removeEventListener('visibilitychange',l);for(const e of['focus','online','pageshow'])window.removeEventListener(e,f)}},_r(d[0]);var e=_r(d[1]);const t=3e4,n=e=>(e.match(/_expo\/static\/js\/web\/[A-Za-z0-9_.-]+\.js(\?v=[0-9a-f]+)?/)??[])[0]??null;function o(){try{const e=[...document.querySelectorAll('script[src]')].map(e=>e.src).find(e=>/_expo\/static\/js\/web\//.test(e));return e?n(e):null}catch{return null}}async function r(e=fetch){const t=o();if(!t)return!1;const r=location.pathname.replace(/[^/]*$/,''),c=await e(`${r}index.html?fresh=${Date.now()}`,{cache:'no-store'});if(!c.ok)return!1;const s=n(await c.text());return!!s&&s!==t}},1504,[236,1010]); __d(function(g,_r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ManagerFeaturesNote=function(){return(0,j.jsxs)(a.default,{testID:"manager-features-banner",style:{borderWidth:1,borderColor:b.colours.gold,borderRadius:12,padding:10,gap:4},children:[(0,j.jsx)(d.T,{weight:"semibold",colour:b.colours.gold,children:"Manager features are on"}),(0,j.jsx)(d.Muted,{children:"Open Me \u203a Manager features for bookings, tables, blocks, allergy checks, stock, who\u2019s clocked in and shift swaps."})]})},_e.ManagerFeaturesAbout=function(){return(0,j.jsxs)(d.Card,{children:[(0,j.jsx)(d.T,{weight:"semibold",children:"What manager features include"}),c.SHIFT_MANAGER_FEATURES.map(e=>(0,j.jsxs)(d.T,{size:14,children:["\u2022 ",e]},e)),(0,j.jsxs)(d.Muted,{children:["Not included: ",c.SHIFT_MANAGER_EXCLUDED_WORDS,". Those stay in the Managers app."]})]})},_e.ClockOverview=function({today:e,now:t}){const s=(0,o.useOwner)(e=>e.staff),n=(0,o.useOwner)(e=>e.attendance).filter(t=>t.date===e&&t.in),r=e=>x(s.find(t=>t.id===e)?.name)||'Team member',h=n.filter(e=>!e.out).sort((e,t)=>(e.in??'').localeCompare(t.in??'')),c=n.filter(e=>e.out).sort((e,t)=>(e.out??'').localeCompare(t.out??'')),u=e=>(e.breaks??[]).some(e=>!e.end);return(0,j.jsxs)(a.default,{style:{gap:10},testID:"clock-overview",children:[(0,j.jsxs)(d.T,{weight:"semibold",children:["Clocked in now (",h.length,")"]}),h.length?h.map(e=>(0,j.jsxs)(d.Card,{children:[(0,j.jsx)(d.T,{weight:"medium",children:r(e.staffId)}),(0,j.jsxs)(d.Muted,{children:["In at ",(0,l.hm)(new Date(e.in)),u(e)?' \xb7 on a break':'',!1===e.inSite?' \xb7 clocked in away from the venue':'']})]},e.id)):(0,j.jsx)(d.Muted,{children:"Nobody is clocked in right now."}),(0,j.jsxs)(d.T,{weight:"semibold",children:["Finished today (",c.length,")"]}),c.length?c.map(e=>(0,j.jsxs)(d.Card,{children:[(0,j.jsx)(d.T,{weight:"medium",children:r(e.staffId)}),(0,j.jsxs)(d.Muted,{children:[(0,l.hm)(new Date(e.in))," to ",(0,l.hm)(new Date(e.out))]})]},e.id)):(0,j.jsx)(d.Muted,{children:"Nobody has clocked out yet today."}),(0,j.jsxs)(d.Muted,{children:["Read only. To change someone\u2019s clock record, ask a manager in the Managers app. Checked at ",(0,l.hm)(t),"."]})]})},_e.TablesToClear=function({rid:e}){const s=(0,r.useFloor)(t=>t.live[e])??{},n=Object.entries(s).filter(([,e])=>e?.dirty).map(([e])=>e).sort((e,t)=>e.localeCompare(t,'en',{numeric:!0}));return(0,j.jsx)(a.default,{style:{gap:8},testID:"tables-to-clear",children:n.length?n.map(s=>(0,j.jsx)(d.Card,{children:(0,j.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(d.T,{weight:"semibold",children:(0,t.tableNumbers)(s)}),(0,j.jsx)(d.Button,{small:!0,kind:"success",label:"Mark cleared",accessibilityLabel:`Mark table ${s} cleared, table free`,testID:`clear-${s}`,onPress:()=>{r.useFloor.getState().setLive(e,s,{dirty:!1,stage:void 0}),(0,w.notify)({id:`clear-${s}`,title:`${(0,t.tableNumbers)(s)} is free`,timeoutMs:4e3})}})]})},s)):(0,j.jsx)(d.Muted,{children:"No tables need clearing."})})},_e.SwapApprovals=function({today:e,me:t}){const n=(0,o.useOwner)(e=>e.staff),r=(0,o.useOwner)(e=>e.shifts),y=(0,o.useOwner)(e=>e.swaps),[M,k]=(0,s.useState)(null),[I,v]=(0,s.useState)(null),[T,S]=(0,s.useState)(!1),C=e=>x(n.find(t=>t.id===e)?.name)||'Team member',D=(()=>{const t=(0,l.parseYmd)(e);return t.setDate(t.getDate()+13),t})(),N=r.filter(t=>{return!1!==t.published&&t.date>=e&&(0,l.parseYmd)(t.date)<=D&&(s=t.staffId,!('owner'===n.find(e=>e.id===s)?.role));var s}).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start),O=e=>`${(0,l.niceDate)((0,l.parseYmd)(e.date))}, ${(0,h.fmtH)(e.start)} to ${(0,h.fmtH)(e.end)}`,R=async(e,s,n,a)=>{S(!0);const d=await(0,u.approveShiftSwap)(e.id,s,n);S(!1),d.ok?(o.useOwner.setState(t=>({shifts:t.shifts.map(t=>t.id===e.id?{...t,staffId:s}:t)})),a&&o.useOwner.getState().setSwap(a,'approved'),(0,w.notify)({id:'swap-ok',title:'Shift changed',body:`${C(e.staffId)}\u2019s shift on ${O(e)} is now ${C(s)}\u2019s. Approved by ${x(t)}.`,timeoutMs:6e3}),k(null),v(null)):(0,w.notify)({id:'swap-fail',title:'Not changed',body:d.message,timeoutMs:6e3})},$=y.filter(e=>'open'===e.status);return(0,j.jsxs)(a.default,{style:{gap:10},testID:"swap-approvals",children:[(0,j.jsxs)(d.T,{weight:"semibold",children:["Requests (",$.length,")"]}),$.length?$.map(e=>{const t=r.find(t=>t.id===e.shiftId);return(0,j.jsxs)(d.Card,{children:[(0,j.jsxs)(d.T,{weight:"medium",children:[C(e.fromId)," \xb7 ",'cover'===e.kind?'needs cover':'swap']}),(0,j.jsxs)(d.Muted,{children:[t?O(t):'Shift not found',e.toId?` \xb7 to ${C(e.toId)}`:'',e.note?` \xb7 ${e.note}`:'']}),(0,j.jsxs)(d.Row,{gap:6,children:[(0,j.jsx)(d.Button,{small:!0,label:"Approve",disabled:!t||!e.toId||T||!(0,p.canSwapWith)(n.find(t=>t.id===e.fromId),n.find(t=>t.id===e.toId),f.VENUE_RID),onPress:()=>t&&e.toId&&R(t,e.toId,e.kind,e.id)}),(0,j.jsx)(d.Button,{small:!0,kind:"ghost",label:"Decline",onPress:()=>o.useOwner.getState().setSwap(e.id,'declined')})]})]},e.id)}):(0,j.jsx)(d.Muted,{children:"No open requests on this phone. Swap requests made on other phones aren\u2019t shared yet, so if someone asks you in person, use Give a shift to someone else below."}),(0,j.jsx)(d.T,{weight:"semibold",children:"Give a shift to someone else"}),M?(0,j.jsxs)(d.Card,{highlight:b.colours.gold,children:[(0,j.jsxs)(d.T,{weight:"semibold",children:[C(M.staffId)," \xb7 ",O(M)]}),(0,j.jsx)(d.Muted,{children:"Who takes it? Only someone they are allowed to swap with."}),(0,j.jsx)(d.Row,{wrap:!0,gap:6,children:(0,c.swapTargets)(n,M.staffId,f.VENUE_RID).map(e=>(0,j.jsx)(d.Chip,{label:x(e.name),selected:I===e.id,onPress:()=>v(e.id)},e.id))}),(0,j.jsxs)(d.Row,{gap:6,children:[(0,j.jsx)(d.Button,{label:"Approve",disabled:!I||T,onPress:()=>I&&R(M,I,'swap'),testID:"swap-give"}),(0,j.jsx)(d.Button,{kind:"secondary",label:"Cancel",onPress:()=>{k(null),v(null)}})]})]}):N.length?N.map(e=>(0,j.jsxs)(d.Card,{onPress:()=>{k(e),v(null)},children:[(0,j.jsx)(d.T,{weight:"medium",children:C(e.staffId)}),(0,j.jsx)(d.Muted,{children:O(e)})]},e.id)):(0,j.jsx)(d.Muted,{children:"No published shifts in the next two weeks."}),(0,j.jsx)(d.Banner,{kind:"info",children:"Approving moves the shift on the rota for everyone and records who approved it. Writing or publishing the rota stays in the Managers app."})]})};var e,t=_r(_d[0]),s=_r(_d[1]),n=_r(_d[2]),a=(e=n)&&e.__esModule?e:{default:e},d=_r(_d[3]),o=_r(_d[4]),r=_r(_d[5]),l=_r(_d[6]),h=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),p=_r(_d[10]),f=_r(_d[11]),w=_r(_d[12]),b=_r(_d[13]),j=_r(_d[14]);const x=e=>(e??'').replace(' (example)','')},1505,[860,34,102,794,892,1021,858,1082,1080,988,1081,5,998,821,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1506,[30,34,872,25]); diff --git a/car-app/index.html b/car-app/index.html index 83c2106100cb4fa6d2ce4becca7b14c5fbc9a5e4..82c1fa735a2b7f1d39277aaf7bcea30ad0278557 100644 --- a/car-app/index.html +++ b/car-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/car-app/owner.html b/car-app/owner.html index 81205078d9594158d4da4c553420346bde2018db..c3f4b994a49f1181086f085b529d205524ddd0f2 100644 --- a/car-app/owner.html +++ b/car-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/car-app/sw.js b/car-app/sw.js index dc14850dd740faf7e741ee3dcb449305e4a3be4f..dd113fdfc5ea124e90b7933b20f8ca40342f294a 100644 --- a/car-app/sw.js +++ b/car-app/sw.js @@ -1,7 +1,7 @@ // Anchorage car screen service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-car-568d11694e"; +const V = "cc-car-9ecf7d6b01"; const BASE = "/car-app/"; -const PRECACHE = ["/car-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/car-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/car-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/car-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/car-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/car-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/car-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/car-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/car-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/car-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/car-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/car-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/car-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/car-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/car-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/car-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/car-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/car-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/car-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/car-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/car-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/car-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/car-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/car-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/car-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/car-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/car-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/car-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/car-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/car-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/car-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/car-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/car-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/car-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/car-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/car-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/car-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/car-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/car-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/car-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/car-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/car-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/car-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/car-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/car-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/car-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/car-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/car-app/favicon.ico", "/car-app/index.html", "/car-app/_expo/static/js/web/bundle.js?v=568d11694e93b494228a08bafe10e4a18032d1abfb21129e3dd6dd639f72d3aa"]; +const PRECACHE = ["/car-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/car-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/car-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/car-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/car-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/car-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/car-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/car-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/car-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/car-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/car-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/car-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/car-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/car-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/car-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/car-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/car-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/car-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/car-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/car-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/car-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/car-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/car-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/car-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/car-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/car-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/car-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/car-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/car-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/car-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/car-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/car-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/car-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/car-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/car-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/car-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/car-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/car-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/car-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/car-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/car-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/car-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/car-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/car-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/car-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/car-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/car-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/car-app/favicon.ico", "/car-app/index.html", "/car-app/_expo/static/js/web/bundle.js?v=9ecf7d6b017cf9f684ac321dd8822d3b23cc3e61f3f13d13aa88327e3358f594"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/chef-app/_expo/static/js/web/bundle.js b/chef-app/_expo/static/js/web/bundle.js index 9130731a9a61bbe1822b3b2d8681392f194a321d..292dd759c9661297cf4f0fe6a538dccac731c7ea 100644 --- a/chef-app/_expo/static/js/web/bundle.js +++ b/chef-app/_expo/static/js/web/bundle.js @@ -6,7 +6,7 @@ var __BUNDLE_START_TIME__=globalThis.nativePerformanceNow?nativePerformanceNow() __d(function(g,r,i,a,m,e,d){"use strict";r(d[0]),r(d[1])},0,[1,19]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";var e,t=_r(d[0]),o=_r(d[1]),a=_r(d[2]),n=_r(d[3]),i=_r(d[4]),c=(e=i)&&e.__esModule?e:{default:e};if(t.PITCH){const e=o.restaurants.find(e=>'anchorage'===e.id);e&&Object.assign(e,{name:n.PITCH_VENUE.name,tagline:n.PITCH_VENUE.tagline,location:n.PITCH_VENUE.location,phone:n.PITCH_VENUE.phone,website:n.PITCH_VENUE.website,hoursNote:'Kitchen (food) hours. The closing time is last food orders.',fictional:!1}),e&&(e.settings={...e.settings,whatsapp:'07700 900123'});for(const e of c.default.areas)delete e.best;for(let e=a.ROSTER.length-1;e>=0;e--){const t=n.PITCH_TEAM[a.ROSTER[e].id];t?(Object.assign(a.ROSTER[e],{name:t.name,job:t.job,hourlyPence:t.hourlyPence,...t.dept?{dept:t.dept}:{},...null!=t.salaried?{salaried:t.salaried}:{}}),delete a.ROSTER[e].nickname):a.ROSTER.splice(e,1)}if('undefined'!=typeof document){const e=t=>{if(3===t.nodeType){const e=t.nodeValue??'',o=(0,n.pitchText)(e);return void(o!==e&&(t.nodeValue=o))}if(1!==t.nodeType)return;const o=t;if('INPUT'===o.tagName||'TEXTAREA'===o.tagName){const e=o,t=(0,n.pitchText)(e.value);t!==e.value&&(e.value=t);const a=e.getAttribute('placeholder');if(a){const t=(0,n.pitchText)(a);t!==a&&e.setAttribute('placeholder',t)}}for(const e of['aria-label','title']){const t=o.getAttribute(e);if(t){const a=(0,n.pitchText)(t);a!==t&&o.setAttribute(e,a)}}o.childNodes.forEach(e)},t=()=>{e(document.body),document.title=(0,n.pitchText)(document.title),new MutationObserver(t=>{for(const o of t)'characterData'===o.type?e(o.target):o.addedNodes.forEach(e),'attributes'===o.type&&e(o.target);document.title=(0,n.pitchText)(document.title)}).observe(document.body,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:['value','placeholder','aria-label']}),document.addEventListener('input',e=>{e.target},!0)};document.body?t():document.addEventListener('DOMContentLoaded',t)}}},1,[2,3,15,17,18]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PITCH",{enumerable:!0,get:function(){return n}});const n=(['anchorage','souters','kirkmichael','wildings','kirkton','abbotsford','greenside',"3idiots","cecchinis","mrbasrais","yasmins","williewastles","rupeeroom","smokinggoat","pizzaioli","drunkencoo"].includes("anchorage"),!1)},2,[]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return t.GREENSIDE_RESTAURANT}}),Object.defineProperty(e,"ABBOTSFORD_RESTAURANT",{enumerable:!0,get:function(){return n.ABBOTSFORD_RESTAURANT}}),Object.defineProperty(e,"KIRKTON_RESTAURANT",{enumerable:!0,get:function(){return o.KIRKTON_RESTAURANT}}),Object.defineProperty(e,"WILDINGS_RESTAURANT",{enumerable:!0,get:function(){return s.WILDINGS_RESTAURANT}}),Object.defineProperty(e,"KIRKMICHAEL_RESTAURANT",{enumerable:!0,get:function(){return c.KIRKMICHAEL_RESTAURANT}}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return R}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);const u={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:16,bookingSlotMinutes:15,deposit:{...r(d[6]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},h={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},f={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},b={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},p=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:f,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...u,orderAtTable:!1,pay:h,cashUpRecord:[...l.ANCHORAGE_CASH_UP]},sections:[]},{id:'saltmarsh',name:'The Venue',tagline:'FICTIONAL demo restaurant \u2014 shows multi-tenancy',location:'Port Ailsa (fictional town)',fictional:!0,kitchenHours:{0:['12:00','20:00'],1:['12:00','20:00'],2:['12:00','20:00'],3:['12:00','20:00'],4:['12:00','21:00'],5:['12:00','21:00'],6:['12:00','21:00']},settings:{...u,slotCap:4,stampTarget:6,stampReward:'Free side',capacityPerHour:30},sections:['Small plates','Mains','Puddings']},{id:'brae',name:'Brae Bakehouse',tagline:'FICTIONAL demo caf\xe9 \u2014 shows multi-tenancy',location:'Kilbrae (fictional village)',fictional:!0,kitchenHours:{0:['09:00','16:00'],1:['09:00','16:00'],2:['09:00','16:00'],3:['09:00','16:00'],4:['09:00','16:00'],5:['09:00','20:00'],6:['09:00','20:00']},settings:{...u,slotCap:5,slotMinutes:15,stampTarget:10,stampReward:'Free coffee & cake',capacityPerHour:24,bookingCoversPerSlot:10},sections:['Bakes','Lunch','Hot drinks']}],A={by:'Fictional demo',at:'2026-10-26'},T=(t,n,o,s,c,l,u,h,f=[])=>({id:n,restaurantId:t,section:o,name:s,description:c,price:l,allergens:u,prepMins:h,dietary:f,soldOut:!1,signOff:A}),R=[T('saltmarsh','s-beets','Small plates','Roast beetroot & whipped feta','Fictional dish for the demo.',750,{milk:'contains',treenuts:'may'},6,['V']),T('saltmarsh','s-squid','Small plates','Salt & pepper squid','Fictional dish for the demo.',850,{molluscs:'contains',gluten:'contains'},7),T('saltmarsh','s-hake','Mains','Pan-roast hake, mussel broth','Fictional dish for the demo.',1950,{fish:'contains',molluscs:'contains',milk:'contains',celery:'contains'},15),T('saltmarsh','s-risotto','Mains','Wild mushroom risotto','Fictional dish for the demo.',1600,{milk:'contains',celery:'contains',sulphites:'contains'},16,['V']),T('saltmarsh','s-cranachan','Puddings','Cranachan','Fictional dish for the demo.',700,{milk:'contains',gluten:'contains'},3,['V']),T('brae','b-scone','Bakes','Cheese scone','Fictional dish for the demo.',350,{gluten:'contains',milk:'contains',eggs:'contains'},2,['V']),T('brae','b-caramel','Bakes','Millionaire\u2019s shortbread','Fictional dish for the demo.',300,{gluten:'contains',milk:'contains',soya:'may'},1,['V']),T('brae','b-toastie','Lunch','Ham & mustard toastie','Fictional dish for the demo.',750,{gluten:'contains',milk:'contains',mustard:'contains'},6),T('brae','b-soup','Lunch','Lentil soup & bread','Fictional dish for the demo.',600,{gluten:'contains',celery:'contains'},4,['VG']),T('brae','b-flat','Hot drinks','Flat white','Fictional dish for the demo.',330,{milk:'contains'},2,['V'])]},3,[4,8,9,10,12,13,14]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return t.GREENSIDE_RESTAURANT}}),Object.defineProperty(e,"ABBOTSFORD_RESTAURANT",{enumerable:!0,get:function(){return n.ABBOTSFORD_RESTAURANT}}),Object.defineProperty(e,"KIRKTON_RESTAURANT",{enumerable:!0,get:function(){return o.KIRKTON_RESTAURANT}}),Object.defineProperty(e,"WILDINGS_RESTAURANT",{enumerable:!0,get:function(){return s.WILDINGS_RESTAURANT}}),Object.defineProperty(e,"KIRKMICHAEL_RESTAURANT",{enumerable:!0,get:function(){return c.KIRKMICHAEL_RESTAURANT}}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return R}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);const u={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:20,bookingSlotMinutes:15,deposit:{...r(d[6]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},h={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},f={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},b={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},p=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:f,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...u,orderAtTable:!1,pay:h,cashUpRecord:[...l.ANCHORAGE_CASH_UP],bookingCoversPerStart:15,bookingPartiesPerStart:4,onlinePartyMin:1,onlinePartyMax:8,bookingNoticeMins:15,autoAcceptUpTo:8},sections:[]},{id:'saltmarsh',name:'The Venue',tagline:'FICTIONAL demo restaurant \u2014 shows multi-tenancy',location:'Port Ailsa (fictional town)',fictional:!0,kitchenHours:{0:['12:00','20:00'],1:['12:00','20:00'],2:['12:00','20:00'],3:['12:00','20:00'],4:['12:00','21:00'],5:['12:00','21:00'],6:['12:00','21:00']},settings:{...u,slotCap:4,stampTarget:6,stampReward:'Free side',capacityPerHour:30},sections:['Small plates','Mains','Puddings']},{id:'brae',name:'Brae Bakehouse',tagline:'FICTIONAL demo caf\xe9 \u2014 shows multi-tenancy',location:'Kilbrae (fictional village)',fictional:!0,kitchenHours:{0:['09:00','16:00'],1:['09:00','16:00'],2:['09:00','16:00'],3:['09:00','16:00'],4:['09:00','16:00'],5:['09:00','20:00'],6:['09:00','20:00']},settings:{...u,slotCap:5,slotMinutes:15,stampTarget:10,stampReward:'Free coffee & cake',capacityPerHour:24,bookingCoversPerSlot:10},sections:['Bakes','Lunch','Hot drinks']}],A={by:'Fictional demo',at:'2026-10-26'},T=(t,n,o,s,c,l,u,h,f=[])=>({id:n,restaurantId:t,section:o,name:s,description:c,price:l,allergens:u,prepMins:h,dietary:f,soldOut:!1,signOff:A}),R=[T('saltmarsh','s-beets','Small plates','Roast beetroot & whipped feta','Fictional dish for the demo.',750,{milk:'contains',treenuts:'may'},6,['V']),T('saltmarsh','s-squid','Small plates','Salt & pepper squid','Fictional dish for the demo.',850,{molluscs:'contains',gluten:'contains'},7),T('saltmarsh','s-hake','Mains','Pan-roast hake, mussel broth','Fictional dish for the demo.',1950,{fish:'contains',molluscs:'contains',milk:'contains',celery:'contains'},15),T('saltmarsh','s-risotto','Mains','Wild mushroom risotto','Fictional dish for the demo.',1600,{milk:'contains',celery:'contains',sulphites:'contains'},16,['V']),T('saltmarsh','s-cranachan','Puddings','Cranachan','Fictional dish for the demo.',700,{milk:'contains',gluten:'contains'},3,['V']),T('brae','b-scone','Bakes','Cheese scone','Fictional dish for the demo.',350,{gluten:'contains',milk:'contains',eggs:'contains'},2,['V']),T('brae','b-caramel','Bakes','Millionaire\u2019s shortbread','Fictional dish for the demo.',300,{gluten:'contains',milk:'contains',soya:'may'},1,['V']),T('brae','b-toastie','Lunch','Ham & mustard toastie','Fictional dish for the demo.',750,{gluten:'contains',milk:'contains',mustard:'contains'},6),T('brae','b-soup','Lunch','Lentil soup & bread','Fictional dish for the demo.',600,{gluten:'contains',celery:'contains'},4,['VG']),T('brae','b-flat','Hot drinks','Flat white','Fictional dish for the demo.',330,{milk:'contains'},2,['V'])]},3,[4,8,9,10,12,13,14]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_UUID",{enumerable:!0,get:function(){return n.GREENSIDE_UUID}}),Object.defineProperty(e,"GREENSIDE_BOOKING_PHONE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"GREENSIDE_VENUE_HOURS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"GREENSIDE_KITCHEN_HOURS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return u}});var n=r(d[0]);const t='tel:01655889685',o={0:['10:00','00:00'],1:null,2:null,3:['10:00','23:00'],4:['10:00','23:00'],5:['10:00','00:00'],6:['10:00','00:00']},s={0:['10:00','20:00'],1:null,2:null,3:['10:00','20:00'],4:['10:00','20:00'],5:['10:00','21:00'],6:['10:00','21:00']},u={id:'greenside',name:'The Greenside Restaurant',tagline:'Restaurant \xb7 Wood Fired Pizza \xb7 Maybole',location:'5 Greenside, Maybole, South Ayrshire KA19 7DG',address:'5 Greenside, Maybole, South Ayrshire KA19 7DG',phone:'01655 889685',email:'info@thegreensiderestaurant.co.uk',emailNeedsConfirmation:!0,website:'thegreensiderestaurant.co.uk',fictional:!1,cashOnly:!0,kitchenHours:s,venueHours:o,hoursNote:'Closed Monday and Tuesday. Venue Wednesday and Thursday 10:00\u201323:00, Friday to Sunday 10:00\u201300:00. Kitchen Wednesday, Thursday and Sunday 10:00\u201320:00; Friday and Saturday 10:00\u201321:00. Cash only.',sections:[],settings:{slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!0,bookingCoversPerSlot:0,stampTarget:8,stampReward:'',stampMinSpend:0,capacityPerHour:0,walkInShare:0,turnMins:75,orderAtTable:!1,showTakeaway:!1,shortName:'The Greenside',reserveStock:!1,tableRequests:!0,deposit:{on:!1,perPersonPence:null,fromParty:null,refundable:null,cutoffHours:null,needsConfirmation:!0,wixLinksOn:!1,policy:'Deposit policy needs confirmation. Deposits and payments are off. Requests need a manager to confirm.'}}}},4,[5]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VENUE_RID",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ISOLATED_VENUE_IDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"IS_GREENSIDE",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"GREENSIDE_UUID",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"IS_ABBOTSFORD",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ABBOTSFORD_UUID",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"IS_KIRKTON",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"KIRKTON_UUID",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"IS_QUEUED_VENUE",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"IS_SOUTERS",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"IS_WILDINGS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"IS_KIRKMICHAEL",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"IS_ISOLATED_VENUE",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"SOUTERS_UUID",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"KIRKMICHAEL_UUID",{enumerable:!0,get:function(){return U}}),Object.defineProperty(e,"WILDINGS_UUID",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"VENUE_UUID",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"venueKey",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"venueIdentityAllowed",{enumerable:!0,get:function(){return D}});var n=r(d[0]);const t="anchorage".toLowerCase().replace(/[^a-z0-9-]/g,'')||'anchorage',c={"3idiots":"59766322-119e-4036-a18a-f6909f60a8d2",cecchinis:"596c6f7e-9797-4e16-84fe-db4a99fa1bdc",mrbasrais:"5d500571-e205-4ead-bb58-60e986b6f40e",yasmins:"f43f20ad-55d0-4008-88c8-7738dc1698df",williewastles:"6abc2793-93ab-4e23-a705-b4011a5cc011",rupeeroom:"78bff97d-5f07-440a-bb99-f6a6118da7a3",smokinggoat:"cd985ff5-2443-458d-ac8b-342d553628cf",pizzaioli:"35f870fc-772c-4aad-bb9e-09a9a16bc925",drunkencoo:"f500ef12-b405-438b-9671-e54289bec5dd",abbotsford:'24624ea5-d1e3-4182-b0d1-73402b8a1532',kirkton:'e0afad1d-cbc1-414a-add6-92e47d302139',greenside:'1bc2a056-2ef6-4585-abfd-b7d21c84f215',souters:'41ce63ca-ae46-432d-a5ba-25e1b801e64d',kirkmichael:'43c8da91-b8b8-4ce9-9ab7-f00c84c5f4f6',wildings:'47f86b36-4c99-466a-be9c-30eb3d79f1e1'},b='greenside'===t,u=c.greenside,f='abbotsford'===t,o=c.abbotsford,l='kirkton'===t,s=c.kirkton,I=(0,n.isQueuedVenue)(t),O='souters'===t,p='wildings'===t,y='kirkmichael'===t,E=Object.prototype.hasOwnProperty.call(c,t),_=c.souters,U=c.kirkmichael,S=c.wildings,j=c[t],P=n=>E?`cc-venue:${t}:${n}`:n,D=(c,b)=>!E||c===j&&b===(0,n.queuedDatabaseSlug)(t)},5,[6]); __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"queuedVenues",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"isQueuedVenue",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"queuedDatabaseSlug",{enumerable:!0,get:function(){return o}}),_e.queuedRestaurant=function(e){const t=n[e];if(!t)throw Error('Unknown venue');const s=t.kitchenSessionsByDay??t.hours.sessionsByDay,o=Object.fromEntries(Array.from({length:7},(e,t)=>[t,s?.[t]?.length?[s[t][0][0],s[t][s[t].length-1][1]]:null]));return{id:e,name:t.name,location:t.address,address:t.address,phone:t.phone||'',email:t.email||'',website:t.website||'',fictional:!1,tagline:'Restaurant',kitchenHours:o,...s?{kitchenSessionsByDay:s}:{},hoursNeedsConfirmation:!0,hoursNote:t.hours.note,sections:[],settings:{slotMinutes:15,slotCap:0,bufferMins:0,leadMins:0,takeawayPaused:!0,bookingCoversPerSlot:0,stampTarget:0,stampReward:'',stampMinSpend:0,capacityPerHour:0,walkInShare:0,turnMins:0,orderAtTable:!1,showTakeaway:!1,shortName:t.name,reserveStock:!1,tableRequests:!0,deposit:{on:!1,perPersonPence:null,fromParty:null,refundable:null,cutoffHours:null,needsConfirmation:!0,wixLinksOn:!1,policy:'Deposit terms to confirm. No payment is taken for requests.'}}}};var e,t=r(d[0]);const n=((e=t)&&e.__esModule?e:{default:e}).default,s=e=>Object.prototype.hasOwnProperty.call(n,e),o=e=>s(e)?n[e].databaseSlug:e},6,[7]); @@ -1092,7 +1092,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},1009,[34,1010]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},1010,[1007,978,1011]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},1011,[1007]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.142'},1012,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.144'},1012,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:h}=await r.select();c&&s(c,h);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},h='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,h.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),h}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),h={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:h})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},1013,[1014,1015,934,978,1010]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},1015,[978]); @@ -1193,11 +1193,11 @@ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{ __d(function(_g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.saveBookingTables=$,_e.TablePicker=function({rid:e,booking:u,name:p,turnBase:k=90,onClose:v,onSaved:w,onPickOnPlan:T}){const C=(0,b.usePlan)(e),L=(0,c.useBookings)(e),[S,W]=(0,t.useState)(()=>(0,b.tablesOf)((0,h.tableKey)((0,b.tablesOf)(u.table)))),P=(0,t.useMemo)(()=>(0,h.pickGroups)(C),[C]),z=L.filter(e=>e.date===u.date),O=(0,h.seatsOf)(C,S),D=(0,h.seatLine)(O.total,u.partySize),I=(0,h.pickClashes)(u,S,z,k),B=e=>(0,h.pickClashes)(u,[e],z,k)[0]?.with,M=(0,h.tableKey)(S)!==(0,h.tableKey)((0,b.tablesOf)(u.table)),N=(0,f.useBlocks)(e=>e.blocks),R=(0,f.blockAt)(N,e,u.date,u.time),_=e=>W(s=>(0,h.toggleTable)(s,e)),Y=async s=>{try{await $(e,u,s),w?.((0,h.savedWords)(p,u.partySize,s,(0,h.seatsOf)(C,s).total)),v()}catch(e){w?.(`Couldn\u2019t save tables for ${p}: ${String(e?.message??e).slice(0,120)}`)}},G=(0,x.jsxs)(n.default,{style:{gap:8},children:[(0,x.jsxs)(n.default,{testID:"table-pick-total",accessible:!0,accessibilityLabel:`${(0,h.tablesWords)(S)} picked. ${D.text}.`,children:[(0,x.jsx)(y.T,{size:18,weight:"semibold",colour:g.colours.goldLight,children:(0,h.tablesWords)(S)}),(0,x.jsx)(y.T,{size:17,colour:g.colours.text,children:D.text})]}),R?(0,x.jsx)(n.default,{testID:"table-pick-pause",accessible:!0,accessibilityLabel:`Note. New bookings are paused ${R.from} to ${R.to}${R.reason?` (${R.reason})`:''}. You can still assign tables to this booking.`,style:{padding:10,borderRadius:10,borderWidth:1,borderColor:g.colours.goldMuted},children:(0,x.jsxs)(y.T,{size:16,colour:g.colours.goldLight,children:["New bookings paused ",R.from,"\u2013",R.to,R.reason?` \xb7 ${R.reason}`:'',". You can still save tables for this booking."]})}):null,I.length?(0,x.jsx)(n.default,{testID:"table-pick-clash",accessible:!0,accessibilityLabel:`Warning. ${(0,h.clashWords)(I)} You can still save.`,style:{padding:10,borderRadius:10,borderWidth:1,borderColor:g.colours.gold},children:(0,x.jsxs)(y.T,{size:16,weight:"semibold",colour:g.colours.goldLight,children:[(0,h.clashWords)(I)," You can still save."]})}):null,(0,x.jsxs)(y.Row,{gap:8,wrap:!0,children:[(0,x.jsx)(y.Button,{testID:"table-pick-save",label:I.length?'Save anyway':'Save tables',disabled:!M||!S.length,accessibilityLabel:`${I.length?'Save anyway, ':'Save, '}${(0,h.tablesWords)(S)} for ${p}. ${D.text}.${I.length?` ${(0,h.clashWords)(I)}`:''}`,onPress:()=>Y(S),style:[j,{flexGrow:1}]}),(0,b.tablesOf)(u.table).length?(0,x.jsx)(y.Button,{testID:"table-pick-clear",kind:"secondary",label:"Clear table",accessibilityLabel:`Clear table, take ${(0,h.tablesWords)((0,b.tablesOf)(u.table)).toLowerCase()} off ${p}`,onPress:()=>Y([]),style:j}):null,(0,x.jsx)(y.Button,{testID:"table-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",onPress:v,style:j})]})]});return(0,x.jsxs)(y.Sheet,{visible:!0,onClose:v,title:`Tables \xb7 ${u.time} ${p} \xb7 ${u.partySize} Covers`,maxWidth:760,testID:"table-picker",footer:G,children:[(0,x.jsx)(s.TableNumberWarning,{plan:C}),(0,x.jsx)(y.T,{size:16,colour:g.colours.text,children:"Tap one table, or several to join them. Tap again to take one off."}),T?(0,x.jsx)(y.Button,{kind:"secondary",testID:"table-pick-on-plan",label:"Pick on the table plan",accessibilityLabel:`Pick on the table plan instead, for ${p}`,onPress:()=>T(S),style:j}):null,P.map(e=>(0,x.jsxs)(n.default,{style:{gap:6},accessibilityLabel:e.area,children:[(0,x.jsx)(y.T,{size:15,weight:"semibold",colour:g.colours.gold,children:e.area}),(0,x.jsx)(y.Row,{gap:8,wrap:!0,children:e.tables.map(e=>{const s=S.includes(e.name),t=B(e.name);return(0,x.jsxs)(o.default,{testID:`table-pick-${e.name}`,accessibilityRole:"checkbox",accessibilityState:{checked:s},'aria-checked':s,accessibilityLabel:(0,h.pickA11y)(e.name,e.seats,s,t),onPress:()=>_(e.name),style:({pressed:e})=>({minWidth:92,minHeight:64,paddingHorizontal:10,paddingVertical:6,borderRadius:12,alignItems:'center',justifyContent:'center',borderWidth:s?2:1,borderColor:s?g.colours.gold:t?g.colours.goldMuted:g.colours.hairline,borderStyle:t&&!s?'dashed':'solid',backgroundColor:s?g.colours.gold:e?g.colours.tilePressed:g.colours.tile}),children:[(0,x.jsx)(y.T,{size:18,weight:"semibold",colour:s?g.colours.onGold:g.colours.text,children:(0,l.tableNumbers)(e.name)}),(0,x.jsxs)(y.T,{size:14,colour:s?g.colours.onGold:g.colours.muted,children:[e.seats," seats",t?' \xb7 booked':'']})]},e.name)})})]},e.area)),P.length?null:(0,x.jsx)(y.Muted,{children:"No tables on the plan yet. Add them in Setup \u203a Table plan."})]})};var s=r(d[0]),l=r(d[1]),t=r(d[2]),o=e(r(d[3])),n=e(r(d[4])),c=r(d[5]),b=r(d[6]),u=r(d[7]),h=r(d[8]),g=r(d[9]),p=r(d[10]),y=r(d[11]),k=r(d[12]),f=r(d[13]),x=r(d[14]);const j={minHeight:56};async function $(e,s,l){const t=(0,h.tableKey)(l),o=(0,b.tablesOf)(s.table);await c.repo.bookings.update(s.id,(0,u.tablePatch)(t||null)),'seated'===s.status&&s.date===(0,p.venueYmd)(new Date)&&(o.filter(e=>!(0,b.tablesOf)(t).includes(e)).forEach(s=>b.useFloor.getState().setLive(e,s,{stage:void 0,dirty:!0})),t&&(0,k.resetTableLive)(e,t))}},1110,[1111,860,34,402,102,874,1021,1109,1112,821,858,794,1113,1018,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.TableNumberWarning=function({plan:u}){const c=(0,n.numberClashes)(u.tables),o=[...new Set([...c.acrossAreas,...u.tables.filter(n=>c.sameArea.has(n.name)).map(n.tableNumber)])];return o.length?(0,l.jsxs)(t.T,{testID:"duplicate-table-numbers",size:16,colour:s.colours.goldLight,children:["Duplicate table numbers: ",o.join(', '),". Kept unchanged. Ask a manager to check the areas before assigning."]}):null},r(d[0]);var n=r(d[1]),s=r(d[2]),t=r(d[3]),l=r(d[4])},1111,[34,859,821,794,25]); __d(function(_g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"byNum",{enumerable:!0,get:function(){return s}}),e.tableKey=o,e.toggleTable=function(t,n){return t.includes(n)?t.filter(t=>t!==n):a(o([...t,n]))},e.seatsOf=function(t,n){const a={};for(const s of n)a[s]=t.tables.find(t=>t.name===s)?.maxSeats??0;return{per:a,total:Object.values(a).reduce((t,n)=>t+n,0)}},e.seatLine=function(t,n){const a=Math.max(0,n-t);return{text:`${t} ${1===t?'seat':'seats'} for ${l(n)}${a?`: ${a} short`:''}`,short:a,fits:0===a&&t>0}},e.pickClashes=function(t,l,u,c=90){if(!l.length)return[];const f={...t,table:o(l)},b=[];for(const s of u)if(s.id!==t.id&&s.date===t.date&&!['cancelled','noshow','finished'].includes(s.status)&&(0,n.startOf)(f)<(0,n.endOf)(s,c)&&(0,n.startOf)(s)<(0,n.endOf)(f,c))for(const t of a(s.table))l.includes(t)&&b.push({table:t,with:s});return b.sort((t,n)=>s(t.table,n.table))},e.clashWords=function(n){return n.map(n=>`${(0,t.tableNumbers)(n.table)} has ${n.with.walkIn?'a walk-in':(n.with.name||'a booking').replace(' (example)','')} at ${n.with.time}`).join('. ')+(n.length?'.':'')},e.tablesWords=u,e.pickA11y=function(n,a,s,l){return`Table ${(0,t.tableNumbers)(n)}, ${a} ${1===a?'seat':'seats'}${s?', selected':''}${l?`, has ${l.walkIn?'a walk-in':l.name} at ${l.time}`:''}`},e.pickGroups=function(t){return t.areas.map(n=>({area:n.name,tables:t.tables.filter(t=>t.areaId===n.id).map(t=>({name:t.name,seats:t.maxSeats})).sort((t,n)=>s(t.name,n.name))})).filter(t=>t.tables.length)},e.savedWords=function(t,n,a,s){return a.length?`${t}, ${l(n)}: ${u(a)} (${s} seats).`:`${t}: table taken off.`},e.tableActions=function(t,n){const s=a(t.table);if(['cancelled','noshow'].includes(t.status))return[];const o=[s.length?{id:'assign',label:'Change table',a11y:`Change table for ${n}, ${l(t.partySize)}, now ${u(s).toLowerCase()}. You can pick several tables to join.`}:{id:'assign',label:'Assign table',a11y:`Assign table for ${n}, ${l(t.partySize)}. You can pick several tables to join.`}];s.length&&o.push({id:'clear',label:'Clear table',a11y:`Clear table for ${n}, take ${u(s).toLowerCase()} off this booking`});return o},e.dragTables=function(t,n,s){if(!s||'__none'===s||s===n)return null;const l=a(t);if(l.includes(s))return null;return o('__none'!==n&&l.includes(n)?l.map(t=>t===n?s:t):[s])};var t=r(d[0]),n=r(d[1]);const a=t=>t?t.split('+').map(t=>t.trim()).filter(Boolean):[],s=(t,n)=>t.localeCompare(n,'en-GB',{numeric:!0}),l=t=>`${t} ${1===t?'person':'people'}`;function o(t){return[...new Set(t.map(t=>String(t).trim()).filter(Boolean))].sort(s).join('+')}function u(n){const s=a(o(n));return s.length?(0,t.tableListNumbers)(s):'No table'}},1112,[860,1095]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return O}}),_e.useTableNames=N,_e.resetTableLive=M,_e.seatBookingNow=F,_e.finishBookingNow=async function(e,t){await f.repo.bookings.setStatus(t.id,'finished'),(0,S.tablesOf)(t.table).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=L,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return R}}),_e.TablePicker=W,_e.WalkInSheet=E,_e.WalkInMatchPrompt=H,_e.AssignTableSheet=_,_e.undoNotice=Y,_e.NewBookingSheet=U,_e.useFrontDoor=function(e,t){const[s,o]=(0,r.useState)(!1),[l,a]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>d({b:e}),combineTables:e=>d({b:e,combine:!0}),elements:(0,B.jsxs)(B.Fragment,{children:[s?(0,B.jsx)(E,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,B.jsx)(U,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,n.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,x.niceDate)((0,x.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,B.jsx)(_,{booking:i.b,combine:i.combine,onClose:()=>d(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=e(r),u=_r(_d[8]),c=e(_r(_d[9])),b=e(_r(_d[10])),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),w=_r(_d[18]),T=_r(_d[19]),S=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),D=_r(_d[23]),I=_r(_d[24]),$=_r(_d[25]),P=_r(_d[26]),z=_r(_d[27]),B=_r(_d[28]);const O=Array.from({length:12},(e,t)=>String(t+1));function N(e){const t=(0,S.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function M(e,t){(0,S.tablesOf)(t).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}async function F(e,t){await f.repo.bookings.setStatus(t.id,'seated'),M(e,t.table)}function L(e,t){const s=(0,f.useBookings)(e),o=(0,f.useOrders)(e),l=N(e),a=(0,S.useFloor)(t=>t.live[e])??{},i=(0,S.usePlan)(e),n=(0,v.useBlocks)(e=>e.blocks),r=(0,x.ymd)(t),d=(0,v.closedAreasAt)(n,e,r,(0,x.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,S.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,x.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const R=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function W({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:d}){const u=Object.keys(e),[h,p]=(0,r.useState)(0),f=i?6:8,y=i?64:o?92:76,k=h?Math.max(3,Math.floor((h+f)/(y+f))):0,x=k?Math.floor((h-f*(k-1))/k):y,w=new Set(n??[]),v=a?(0,S.tablesOf)(a)[0]:null;return(0,B.jsx)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:f},testID:"table-picker",onLayout:e=>p(Math.floor(e.nativeEvent.layout.width)),children:u.map(o=>{const a=e[o],n=t===o||!!d?.includes(o),r=w.has(o),u=v===o&&!n,h=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,B.jsxs)(c.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${d?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${r?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:x,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?j.colours.gold:a.busy?j.colours.red:j.colours.ok,backgroundColor:n?j.colours.goldTint:a.busy?j.colours.redBg:j.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,B.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,B.jsx)(T.T,{weight:"bold",size:22,colour:n?j.colours.goldLight:j.colours.text,children:(0,l.tableNumbers)(o)}),r?(0,B.jsx)(b.default,{testID:"best-table",style:{backgroundColor:j.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,B.jsx)(T.T,{size:11,weight:"bold",colour:j.colours.onGold,children:"BEST"})}):null]}),(0,B.jsx)(T.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:h})]},o)})})}const A=[1,2,3,4,5,6,7,8];function E({onClose:e,onSeated:a,wide:i,initialTable:y}){const{rid:w,r:C,now:D}=(0,p.useCtx)(15e3),I=L(w,D),[$,P]=(0,r.useState)(2),[O,N]=(0,r.useState)(!1),[R,E]=(0,r.useState)(y??null),_=(0,S.usePlan)(w),Y=(0,f.useBookings)(w),U=(0,v.useBlocks)(e=>e.blocks),q=(0,v.closedAreasAt)(U,w,(0,x.ymd)(D),(0,x.hm)(D)),Q=d.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(_,Y.filter(e=>e.date===(0,x.ymd)(D)),e,$,D,(0,k.turnFor)($,C.settings.turnMins),90,void 0,{closed:q})?.table??null},[_,Y,I,$,q.size,D.getTime()]);(0,r.useEffect)(()=>{R&&(0,S.tablesOf)(R).some(e=>'Closed'===I[e]?.label)&&E(null)},[R,q.size]);const[V,G]=(0,r.useState)(!1),[K,X]=(0,r.useState)(''),J=(e,t=String(e),s=()=>{N(!1),P(e)})=>{const o='9+'===t?O:!O&&$===e;return(0,B.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?j.colours.gold:'transparent'},children:(0,B.jsx)(T.T,{weight:"bold",size:22,colour:o?j.colours.onGold:j.colours.gold,children:t})},t)},Z=(0,B.jsx)(s.PartySizeInput,{value:$,onChange:P,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),ee=(0,B.jsxs)(b.default,{style:{gap:8,width:i?256:void 0},children:[(0,B.jsx)(T.T,{weight:"semibold",children:"How many people?"}),(0,B.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[A.map(e=>J(e)),J(9,'9+',()=>{N(!0),P(e=>e>=9?e:9)})]}),O?Z:null]}),[te,se]=(0,r.useState)(!1),[oe,le]=(0,r.useState)(null),ae=async(t=R,s=!1)=>{if(!te){if(!s){const e=(0,z.bookingsNearWalkIn)(Y,D,$);if(e.length)return void le({at:t,list:e})}se(!0);try{const s=await f.repo.bookings.seatWalkIn(w,$,t??void 0,K);M(w,t??void 0),a(s),e()}finally{se(!1)}}},ie=async(t,s)=>{if(!te){se(!0);try{const o=s??t.table??null;o&&o!==t.table&&await f.repo.bookings.assignTable(t.id,o),await F(w,{...t,table:o??void 0}),(0,n.notify)({id:`seated:${t.id}`,testID:'walkin-match-toast',timeoutMs:5e3,icon:'\u2713',title:`${t.name} seated \xb7 ${t.partySize} \xb7 ${o?(0,l.tableNumbers)(o):'table to assign'} (booking ${t.ref})`}),le(null),e()}finally{se(!1)}}},ne=(0,B.jsxs)(b.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,B.jsxs)(T.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(T.T,{weight:"semibold",children:["Table ",(0,B.jsx)(T.T,{colour:j.colours.muted,size:14,children:"(optional)"})]}),R?(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>E(null)}):null]}),(0,B.jsx)(W,{use:I,value:R,onPick:e=>{I[e]&&!I[e].busy?ae(e):E(R===e?null:e)},big:i,dense:i,best:Q,bestSet:(0,u.bestTables)(_)}),(0,B.jsxs)(T.Muted,{children:["Tap a free table to seat them there",Q&&!R?` (suggested for ${$}: ${(0,l.tableNumbers)(Q)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,x.hm)(D)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,B.jsx)(T.Button,{label:`Seat walk-in \xb7 ${$} ${1===$?'person':'people'}${R?` \xb7 ${(0,l.tableNumbers)(R)}`:''}`,disabled:te,onPress:()=>{ae()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,B.jsxs)(T.Row,{gap:16,style:{alignItems:'flex-start'},children:[ee,ne]}):(0,B.jsxs)(B.Fragment,{children:[ee,ne]}),(0,B.jsxs)(T.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[V?(0,B.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:K,onChangeText:X,style:[T.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>G(!0)}),(0,B.jsx)(b.default,{style:{flex:1,minWidth:220},children:(0,B.jsxs)(T.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==h.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]}),oe?(0,B.jsx)(H,{list:oe.list,busy:te,onYes:e=>{ie(e,oe.at)},onNo:()=>{const e=oe.at;le(null),ae(e,!0)},onClose:()=>le(null)}):null]})}function H({list:e,busy:t,onYes:s,onNo:o,onClose:a}){return(0,B.jsx)(T.Sheet,{visible:!0,onClose:a,title:"Booked party?",maxWidth:720,testID:"walkin-match",children:(0,B.jsxs)(b.default,{style:{gap:14},children:[e.map((e,o)=>(0,B.jsxs)(b.default,{testID:`walkin-match-${o}`,style:{gap:12,padding:16,borderRadius:16,borderWidth:2,borderColor:j.colours.gold,backgroundColor:'#15130F'},children:[(0,B.jsx)(b.default,{accessibilityRole:"header",accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:26,weight:"bold",colour:j.colours.goldLight,testID:"walkin-match-question",children:(0,z.walkInMatchQuestion)(e)})}),e.table?(0,B.jsxs)(T.T,{size:17,colour:j.colours.text,children:["Booked table ",(0,l.tableNumbers)(e.table)," \xb7 ",e.ref]}):(0,B.jsx)(T.T,{size:17,colour:j.colours.text,children:e.ref}),(0,B.jsx)(T.Button,{label:"Yes, seat booking",testID:"walkin-match-yes",disabled:t,accessibilityLabel:`Yes, seat ${e.name}'s booking, ${e.partySize} people`,onPress:()=>s(e),style:{minHeight:64}})]},e.id)),(0,B.jsx)(T.Button,{kind:"secondary",label:"No, new walk-in",testID:"walkin-match-no",disabled:t,onPress:o,style:{minHeight:64}})]})})}function _({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,p.useCtx)(15e3),n=L(o,i),c=(0,S.usePlan)(o),h=(0,f.useBookings)(o),y=(0,S.tablesOf)(e.table),w=d.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,y.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),v=d.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(w).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(c,h.filter(e=>e.date===(0,x.ymd)(i)),t,e.partySize,i,(0,k.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[c,h,w,e.partySize,i.getTime()]),[C,D]=(0,r.useState)(!!s||y.length>1),[I,$]=(0,r.useState)(y),P=e=>c.tables.find(t=>t.name===e)?.maxSeats??0,z=I.reduce((e,t)=>e+P(t),0),O=I.length>0&&z{const l=(0,S.joinTables)(s);await f.repo.bookings.assignTable(e.id,l);y.filter(e=>!s.includes(e)).forEach(t=>S.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&M(o,l),t()},F=C?(0,B.jsxs)(b.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,B.jsx)(b.default,{accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:17,weight:"semibold",colour:j.colours.text,children:I.length?`${(0,S.tablesLabel)((0,S.joinTables)(I))} \xb7 ${z} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,B.jsx)(b.default,{testID:"combine-short",children:(0,B.jsxs)(T.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-z," more needed. Add another table."]})}):null,(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,B.jsxs)(T.Row,{gap:8,wrap:!0,children:[(0,B.jsx)(T.Button,{label:"Done",testID:"combine-done",disabled:!I.length,accessibilityLabel:I.length?`Done, save ${(0,S.tableCardLabel)((0,S.joinTables)(I))}`:'Done',onPress:()=>N(I)}),(0,B.jsx)(T.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,B.jsx)(b.default,{style:{gap:8},testID:"assign-table-tip",children:(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`${C?'Combine tables':'Assign table'} \xb7 ${R(e)}`,testID:"assign-table-sheet",footer:F,children:[v&&!C?(0,B.jsx)(b.default,{testID:"assign-suggested",children:(0,B.jsxs)(T.T,{size:16,weight:"semibold",colour:j.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,S.tableCardLabel)(v)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(v)]})}):null,C?null:(0,B.jsx)(T.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>D(!0)}),(0,B.jsx)(W,{use:w,best:C?null:v,bestSet:(0,u.bestTables)(c),picked:C?I:void 0,onPick:C?e=>$(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await N([e])}})]})}function Y(e){(0,n.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${R(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>f.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function U({date:e,onClose:t,wide:n,onSaved:d}){const{rid:u,r:c,now:h,role:z,meId:O}=(0,p.useCtx)(6e4),N=(0,x.ymd)(h),[M,F]=(0,r.useState)(ee.blocks),[W,A]=(0,r.useState)(!1),[E,H]=(0,r.useState)(''),[_,Y]=(0,r.useState)(2),[U,q]=(0,r.useState)(null),[Q,V]=(0,r.useState)(''),[G,K]=(0,r.useState)(''),[X,J]=(0,r.useState)(''),[Z,ee]=(0,r.useState)('phone'),[te,se]=(0,r.useState)((0,D.emptyNeeds)()),oe=(0,D.needsMissing)(te),[le,ae]=(0,r.useState)(null),ie=(0,S.usePlan)(u),ne=(0,P.dogSetUp)(ie),re=!0===te.dog&&ne,de=te.dog?te.dogs:0,ue=(0,x.parseYmd)(M),ce=(0,k.turnFor)(_,c.settings.turnMins),be=L.filter(e=>e.date===M),he=e=>(0,k.freeTablesAt)(ie,be,_,new Date(`${M}${(0,l.tableNumbers)(e)}:00`),ce,c.settings.turnMins,{dog:!0,closed:(0,v.closedAreasAt)(R,u,M,e)}),ge=re&&U?he(U):[];(0,r.useEffect)(()=>{ae(null)},[re,U,_]);const pe=(0,y.bookingSlots)(c,ue,e=>L.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),_,M===(0,x.ymd)(h)?h:(0,x.addMins)(ue,0)),me=(0,w.ukPhone)(G),[fe,ye]=(0,r.useState)(!1),ke=U?pe.find(e=>e.time===U):void 0,xe=ke&&ke.left<_?{left:Math.max(0,ke.left),time:ke.time}:null,je=U?(0,v.blockAt)(R,u,M,U):void 0,we='staff'!==z,Te=!!U&&!(0,D.dogTimeOk)(c,L,M,U,de),Se=!oe.length&&E.trim().length>=2&&!!U&&(!xe||fe)&&(0,o.validParty)(_)&&me.ok&&(0,w.emailOk)(X)&&(!je||we&&W)&&(!re||ge.length>0)&&!Te,ve=te.wheelchair>0||te.stepFree;return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,x.niceDate)(ue)}`,maxWidth:n?760:void 0,testID:"booking-sheet",children:[(0,B.jsx)(D.FirstQuestions,{rid:u,value:te,onChange:se,party:_,audience:"staff"}),te.dog&&!ne?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,B.jsx)(C.BookingDatePicker,{r:c,today:h,value:M,onChange:e=>{e!==M&&(F(e),q(null),A(!1))}}),(0,B.jsxs)(T.Row,{gap:6,children:[(0,B.jsx)(T.Chip,{label:"Phone",selected:'phone'===Z,onPress:()=>ee('phone')}),(0,B.jsx)(T.Chip,{label:"In person",selected:'in-person'===Z,onPress:()=>ee('in-person')})]}),(0,B.jsx)(T.Field,{label:"Name",value:E,onChangeText:H,placeholder:"e.g. Reid",testID:"nb-name"}),(0,B.jsx)(T.Field,{label:"Mobile or phone number (needed)",value:G,onChangeText:K,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!me.ok&&G?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:me.error}):null,(0,B.jsx)(T.Field,{label:"Email (optional)",value:X,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,w.emailOk)(X)?null:(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,B.jsxs)(b.default,{style:{gap:6,alignItems:'center'},children:[(0,B.jsx)(T.T,{center:!0,children:"Covers"}),(0,B.jsx)(s.PartySizeInput,{value:_,onChange:e=>{Y(e),ye(!1)},label:"Covers",testID:"nb-party"})]}),(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:pe.map(e=>{const t=re&&e.available&&!he(e.time).length||!(0,D.dogTimeOk)(c,L,M,e.time,de);return(0,B.jsx)(T.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,v.blockAt)(R,u,M,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':e.left>0?`${e.left} left`:'Full',disabled:(e.past??!e.available)||t,selected:U===e.time,onPress:()=>{q(e.time),A(!1),ye(!1)}},e.time)})}),xe?(0,B.jsxs)(b.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overCapacityNote)(_,xe.left,xe.time)}),(0,B.jsx)(T.Chip,{label:fe?'Booking over the limit: on':'Book anyway (over the limit)',selected:fe,onPress:()=>ye(e=>!e),testID:"nb-over-ok"})]}):null,re&&U?(0,B.jsxs)(b.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,B.jsxs)(T.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,B.jsxs)(T.T,{size:13,colour:j.colours.muted,children:["(",ie.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),ge.length?(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:ge.slice(0,10).map((e,t)=>(0,B.jsx)(T.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${ve&&(0,P.accessibleSetUp)(ie)&&!(0,P.isAccessible)(ie,e.table)?' \xb7 not step-free':''}`,selected:(le??ge[0].table)===e.table,onPress:()=>ae(e.table)},e.table))}):(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["No dog-friendly table free for ",_," at ",U,". Try another time."]})]}):null,je?(0,B.jsxs)(b.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsxs)(T.T,{weight:"semibold",colour:j.colours.amber,children:["Bookings are paused ",je.from,"\u2013",je.to,je.reason?` (${je.reason})`:'']}),we?(0,B.jsx)(T.Chip,{label:W?'Manager override on':'Override and book anyway',selected:W,onPress:()=>A(e=>!e)}):(0,B.jsx)(T.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,pe.length?null:(0,B.jsx)(b.default,{testID:"nb-closed",children:(0,B.jsxs)(T.T,{size:14,weight:"semibold",colour:j.colours.amber,children:["Closed on ",(0,x.niceDate)(ue)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,B.jsx)(D.MoreQuestions,{rid:u,r:c,value:te,onChange:se,party:_,date:M,time:U,today:(0,x.ymd)(h),bookings:L,audience:"staff",showTables:!1!==c.settings.tableRequests}),ve&&!(0,P.accessibleSetUp)(ie)?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,B.jsx)(T.Field,{label:"Notes (optional)",value:Q,onChangeText:V,placeholder:I.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(c.settings),_)?(0,B.jsxs)(T.Muted,{children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(c.settings),_))," (",(0,a.gbp)((0,i.depositOf)(c.settings).perPersonPence)," per person for ",(0,i.depositOf)(c.settings).fromParty,"+). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,B.jsxs)(T.Muted,{children:["The guest gets a confirmation text",X.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Te?(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["We already have the most dogs we can look after at ",U,". Try another time: dogs are very welcome then."]}):null,(0,B.jsx)(T.Button,{label:oe.length?oe[0]:'Save booking',testID:"nb-save",disabled:!Se,onPress:()=>{if(M<(0,x.ymd)(h))return;const e=(0,D.needsPatch)(te),s=te.tableReq.find(e=>!re||ge.some(t=>t.table===e));f.repo.bookings.create({restaurantId:u,customerId:null,name:E.trim(),partySize:_,date:M,time:U,notes:Q.trim(),security:(0,i.depositDue)((0,i.depositOf)(c.settings),_)?'deposit':'none',depositPaid:0,...(0,i.depositDue)((0,i.depositOf)(c.settings),_)?{depositDue:(0,i.depositDue)((0,i.depositOf)(c.settings),_),depositPolicy:(0,i.depositWords)((0,i.depositOf)(c.settings),_,c.name).join(' '),depositRefundable:(0,i.depositOf)(c.settings).refundable,depositCutoffHours:(0,i.depositOf)(c.settings).cutoffHours}:{},phone:me.pretty,email:X.trim()||void 0,source:Z,...e,...pe.find(e=>e.time===U)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...re?{table:le??s??ge[0]?.table}:{}}).then(e=>(0,$.postNewBookingToKitchen)(e,O)).catch(()=>{}),d?.({date:M,time:U,name:E.trim()}),t()}})]})}},1113,[827,1114,1115,860,867,14,1116,34,859,402,102,872,1079,874,1117,1095,858,821,864,794,1021,1018,1118,1119,1124,1097,1091,1125,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return O}}),_e.useTableNames=N,_e.resetTableLive=M,_e.seatBookingNow=L,_e.finishBookingNow=async function(e,t){await f.repo.bookings.setStatus(t.id,'finished'),(0,S.tablesOf)(t.table).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=F,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return R}}),_e.TablePicker=W,_e.WalkInSheet=E,_e.WalkInMatchPrompt=H,_e.AssignTableSheet=_,_e.undoNotice=Y,_e.NewBookingSheet=U,_e.useFrontDoor=function(e,t){const[s,o]=(0,r.useState)(!1),[l,a]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>d({b:e}),combineTables:e=>d({b:e,combine:!0}),elements:(0,B.jsxs)(B.Fragment,{children:[s?(0,B.jsx)(E,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,B.jsx)(U,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,n.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,x.niceDate)((0,x.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,B.jsx)(_,{booking:i.b,combine:i.combine,onClose:()=>d(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=e(r),u=_r(_d[8]),c=e(_r(_d[9])),b=e(_r(_d[10])),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),w=_r(_d[18]),T=_r(_d[19]),S=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),D=_r(_d[23]),I=_r(_d[24]),$=_r(_d[25]),P=_r(_d[26]),z=_r(_d[27]),B=_r(_d[28]);const O=Array.from({length:12},(e,t)=>String(t+1));function N(e){const t=(0,S.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function M(e,t){(0,S.tablesOf)(t).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}async function L(e,t){await f.repo.bookings.setStatus(t.id,'seated'),M(e,t.table)}function F(e,t){const s=(0,f.useBookings)(e),o=(0,f.useOrders)(e),l=N(e),a=(0,S.useFloor)(t=>t.live[e])??{},i=(0,S.usePlan)(e),n=(0,v.useBlocks)(e=>e.blocks),r=(0,x.ymd)(t),d=(0,v.closedAreasAt)(n,e,r,(0,x.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,S.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,x.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const R=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function W({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:d}){const u=Object.keys(e),[h,p]=(0,r.useState)(0),f=i?6:8,y=i?64:o?92:76,k=h?Math.max(3,Math.floor((h+f)/(y+f))):0,x=k?Math.floor((h-f*(k-1))/k):y,w=new Set(n??[]),v=a?(0,S.tablesOf)(a)[0]:null;return(0,B.jsx)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:f},testID:"table-picker",onLayout:e=>p(Math.floor(e.nativeEvent.layout.width)),children:u.map(o=>{const a=e[o],n=t===o||!!d?.includes(o),r=w.has(o),u=v===o&&!n,h=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,B.jsxs)(c.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${d?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${r?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:x,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?j.colours.gold:a.busy?j.colours.red:j.colours.ok,backgroundColor:n?j.colours.goldTint:a.busy?j.colours.redBg:j.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,B.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,B.jsx)(T.T,{weight:"bold",size:22,colour:n?j.colours.goldLight:j.colours.text,children:(0,l.tableNumbers)(o)}),r?(0,B.jsx)(b.default,{testID:"best-table",style:{backgroundColor:j.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,B.jsx)(T.T,{size:11,weight:"bold",colour:j.colours.onGold,children:"BEST"})}):null]}),(0,B.jsx)(T.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:h})]},o)})})}const A=[1,2,3,4,5,6,7,8];function E({onClose:e,onSeated:a,wide:i,initialTable:y}){const{rid:w,r:C,now:D}=(0,p.useCtx)(15e3),I=F(w,D),[$,P]=(0,r.useState)(2),[O,N]=(0,r.useState)(!1),[R,E]=(0,r.useState)(y??null),_=(0,S.usePlan)(w),Y=(0,f.useBookings)(w),U=(0,v.useBlocks)(e=>e.blocks),q=(0,v.closedAreasAt)(U,w,(0,x.ymd)(D),(0,x.hm)(D)),Q=d.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(_,Y.filter(e=>e.date===(0,x.ymd)(D)),e,$,D,(0,k.turnFor)($,C.settings.turnMins),90,void 0,{closed:q})?.table??null},[_,Y,I,$,q.size,D.getTime()]);(0,r.useEffect)(()=>{R&&(0,S.tablesOf)(R).some(e=>'Closed'===I[e]?.label)&&E(null)},[R,q.size]);const[V,G]=(0,r.useState)(!1),[K,X]=(0,r.useState)(''),J=(e,t=String(e),s=()=>{N(!1),P(e)})=>{const o='9+'===t?O:!O&&$===e;return(0,B.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?j.colours.gold:'transparent'},children:(0,B.jsx)(T.T,{weight:"bold",size:22,colour:o?j.colours.onGold:j.colours.gold,children:t})},t)},Z=(0,B.jsx)(s.PartySizeInput,{value:$,onChange:P,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),ee=(0,B.jsxs)(b.default,{style:{gap:8,width:i?256:void 0},children:[(0,B.jsx)(T.T,{weight:"semibold",children:"How many people?"}),(0,B.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[A.map(e=>J(e)),J(9,'9+',()=>{N(!0),P(e=>e>=9?e:9)})]}),O?Z:null]}),[te,se]=(0,r.useState)(!1),[oe,le]=(0,r.useState)(null),ae=async(t=R,s=!1)=>{if(!te){if(!s){const e=(0,z.bookingsNearWalkIn)(Y,D,$);if(e.length)return void le({at:t,list:e})}se(!0);try{const s=await f.repo.bookings.seatWalkIn(w,$,t??void 0,K);M(w,t??void 0),a(s),e()}finally{se(!1)}}},ie=async(t,s)=>{if(!te){se(!0);try{const o=s??t.table??null;o&&o!==t.table&&await f.repo.bookings.assignTable(t.id,o),await L(w,{...t,table:o??void 0}),(0,n.notify)({id:`seated:${t.id}`,testID:'walkin-match-toast',timeoutMs:5e3,icon:'\u2713',title:`${t.name} seated \xb7 ${t.partySize} \xb7 ${o?(0,l.tableNumbers)(o):'table to assign'} (booking ${t.ref})`}),le(null),e()}finally{se(!1)}}},ne=(0,B.jsxs)(b.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,B.jsxs)(T.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(T.T,{weight:"semibold",children:["Table ",(0,B.jsx)(T.T,{colour:j.colours.muted,size:14,children:"(optional)"})]}),R?(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>E(null)}):null]}),(0,B.jsx)(W,{use:I,value:R,onPick:e=>{I[e]&&!I[e].busy?ae(e):E(R===e?null:e)},big:i,dense:i,best:Q,bestSet:(0,u.bestTables)(_)}),(0,B.jsxs)(T.Muted,{children:["Tap a free table to seat them there",Q&&!R?` (suggested for ${$}: ${(0,l.tableNumbers)(Q)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,x.hm)(D)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,B.jsx)(T.Button,{label:`Seat walk-in \xb7 ${$} ${1===$?'person':'people'}${R?` \xb7 ${(0,l.tableNumbers)(R)}`:''}`,disabled:te,onPress:()=>{ae()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,B.jsxs)(T.Row,{gap:16,style:{alignItems:'flex-start'},children:[ee,ne]}):(0,B.jsxs)(B.Fragment,{children:[ee,ne]}),(0,B.jsxs)(T.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[V?(0,B.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:K,onChangeText:X,style:[T.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>G(!0)}),(0,B.jsx)(b.default,{style:{flex:1,minWidth:220},children:(0,B.jsxs)(T.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==h.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]}),oe?(0,B.jsx)(H,{list:oe.list,busy:te,onYes:e=>{ie(e,oe.at)},onNo:()=>{const e=oe.at;le(null),ae(e,!0)},onClose:()=>le(null)}):null]})}function H({list:e,busy:t,onYes:s,onNo:o,onClose:a}){return(0,B.jsx)(T.Sheet,{visible:!0,onClose:a,title:"Booked party?",maxWidth:720,testID:"walkin-match",children:(0,B.jsxs)(b.default,{style:{gap:14},children:[e.map((e,o)=>(0,B.jsxs)(b.default,{testID:`walkin-match-${o}`,style:{gap:12,padding:16,borderRadius:16,borderWidth:2,borderColor:j.colours.gold,backgroundColor:'#15130F'},children:[(0,B.jsx)(b.default,{accessibilityRole:"header",accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:26,weight:"bold",colour:j.colours.goldLight,testID:"walkin-match-question",children:(0,z.walkInMatchQuestion)(e)})}),e.table?(0,B.jsxs)(T.T,{size:17,colour:j.colours.text,children:["Booked table ",(0,l.tableNumbers)(e.table)," \xb7 ",e.ref]}):(0,B.jsx)(T.T,{size:17,colour:j.colours.text,children:e.ref}),(0,B.jsx)(T.Button,{label:"Yes, seat booking",testID:"walkin-match-yes",disabled:t,accessibilityLabel:`Yes, seat ${e.name}'s booking, ${e.partySize} people`,onPress:()=>s(e),style:{minHeight:64}})]},e.id)),(0,B.jsx)(T.Button,{kind:"secondary",label:"No, new walk-in",testID:"walkin-match-no",disabled:t,onPress:o,style:{minHeight:64}})]})})}function _({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,p.useCtx)(15e3),n=F(o,i),c=(0,S.usePlan)(o),h=(0,f.useBookings)(o),y=(0,S.tablesOf)(e.table),w=d.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,y.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),v=d.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(w).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(c,h.filter(e=>e.date===(0,x.ymd)(i)),t,e.partySize,i,(0,k.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[c,h,w,e.partySize,i.getTime()]),[C,D]=(0,r.useState)(!!s||y.length>1),[I,$]=(0,r.useState)(y),P=e=>c.tables.find(t=>t.name===e)?.maxSeats??0,z=I.reduce((e,t)=>e+P(t),0),O=I.length>0&&z{const l=(0,S.joinTables)(s);await f.repo.bookings.assignTable(e.id,l);y.filter(e=>!s.includes(e)).forEach(t=>S.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&M(o,l),t()},L=C?(0,B.jsxs)(b.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,B.jsx)(b.default,{accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:17,weight:"semibold",colour:j.colours.text,children:I.length?`${(0,S.tablesLabel)((0,S.joinTables)(I))} \xb7 ${z} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,B.jsx)(b.default,{testID:"combine-short",children:(0,B.jsxs)(T.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-z," more needed. Add another table."]})}):null,(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,B.jsxs)(T.Row,{gap:8,wrap:!0,children:[(0,B.jsx)(T.Button,{label:"Done",testID:"combine-done",disabled:!I.length,accessibilityLabel:I.length?`Done, save ${(0,S.tableCardLabel)((0,S.joinTables)(I))}`:'Done',onPress:()=>N(I)}),(0,B.jsx)(T.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,B.jsx)(b.default,{style:{gap:8},testID:"assign-table-tip",children:(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`${C?'Combine tables':'Assign table'} \xb7 ${R(e)}`,testID:"assign-table-sheet",footer:L,children:[v&&!C?(0,B.jsx)(b.default,{testID:"assign-suggested",children:(0,B.jsxs)(T.T,{size:16,weight:"semibold",colour:j.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,S.tableCardLabel)(v)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(v)]})}):null,C?null:(0,B.jsx)(T.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>D(!0)}),(0,B.jsx)(W,{use:w,best:C?null:v,bestSet:(0,u.bestTables)(c),picked:C?I:void 0,onPick:C?e=>$(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await N([e])}})]})}function Y(e){(0,n.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${R(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>f.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function U({date:e,onClose:t,wide:n,onSaved:d}){const{rid:u,r:c,now:h,role:z,meId:O}=(0,p.useCtx)(6e4),N=(0,x.ymd)(h),[M,L]=(0,r.useState)(ee.blocks),[W,A]=(0,r.useState)(!1),[E,H]=(0,r.useState)(''),[_,Y]=(0,r.useState)(2),[U,q]=(0,r.useState)(null),[Q,V]=(0,r.useState)(''),[G,K]=(0,r.useState)(''),[X,J]=(0,r.useState)(''),[Z,ee]=(0,r.useState)('phone'),[te,se]=(0,r.useState)((0,D.emptyNeeds)()),oe=(0,D.needsMissing)(te),[le,ae]=(0,r.useState)(null),ie=(0,S.usePlan)(u),ne=(0,P.dogSetUp)(ie),re=!0===te.dog&&ne,de=te.dog?te.dogs:0,ue=(0,x.parseYmd)(M),ce=(0,k.turnFor)(_,c.settings.turnMins),be=F.filter(e=>e.date===M),he=e=>(0,k.freeTablesAt)(ie,be,_,new Date(`${M}${(0,l.tableNumbers)(e)}:00`),ce,c.settings.turnMins,{dog:!0,closed:(0,v.closedAreasAt)(R,u,M,e)}),ge=re&&U?he(U):[];(0,r.useEffect)(()=>{ae(null)},[re,U,_]);const pe=(0,y.bookingSlots)(c,ue,e=>F.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),_,M===(0,x.ymd)(h)?h:(0,x.addMins)(ue,0),e=>F.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),me=(0,w.ukPhone)(G),[fe,ye]=(0,r.useState)(!1),ke=U?pe.find(e=>e.time===U):void 0,xe=ke&&ke.left<_?{left:Math.max(0,ke.left),time:ke.time}:null,je=ke&&null!=ke.partiesLeft&&ke.partiesLeft<1?{time:ke.time,cap:ke.partiesCap??0}:null,we=xe||je,Te=U?(0,v.blockAt)(R,u,M,U):void 0,Se='staff'!==z,ve=!!U&&!(0,D.dogTimeOk)(c,F,M,U,de),Ce=!oe.length&&E.trim().length>=2&&!!U&&(!we||fe)&&(0,o.validParty)(_)&&me.ok&&(0,w.emailOk)(X)&&(!Te||Se&&W)&&(!re||ge.length>0)&&!ve,De=te.wheelchair>0||te.stepFree;return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,x.niceDate)(ue)}`,maxWidth:n?760:void 0,testID:"booking-sheet",children:[(0,B.jsx)(D.FirstQuestions,{rid:u,value:te,onChange:se,party:_,audience:"staff"}),te.dog&&!ne?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,B.jsx)(C.BookingDatePicker,{r:c,today:h,value:M,onChange:e=>{e!==M&&(L(e),q(null),A(!1))}}),(0,B.jsxs)(T.Row,{gap:6,children:[(0,B.jsx)(T.Chip,{label:"Phone",selected:'phone'===Z,onPress:()=>ee('phone')}),(0,B.jsx)(T.Chip,{label:"In person",selected:'in-person'===Z,onPress:()=>ee('in-person')})]}),(0,B.jsx)(T.Field,{label:"Name",value:E,onChangeText:H,placeholder:"e.g. Reid",testID:"nb-name"}),(0,B.jsx)(T.Field,{label:"Mobile or phone number (needed)",value:G,onChangeText:K,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!me.ok&&G?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:me.error}):null,(0,B.jsx)(T.Field,{label:"Email (optional)",value:X,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,w.emailOk)(X)?null:(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,B.jsxs)(b.default,{style:{gap:6,alignItems:'center'},children:[(0,B.jsx)(T.T,{center:!0,children:"Covers"}),(0,B.jsx)(s.PartySizeInput,{value:_,onChange:e=>{Y(e),ye(!1)},label:"Covers",testID:"nb-party"})]}),(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:pe.map(e=>{const t=re&&e.available&&!he(e.time).length||!(0,D.dogTimeOk)(c,F,M,e.time,de);return(0,B.jsx)(T.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,v.blockAt)(R,u,M,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:U===e.time,onPress:()=>{q(e.time),A(!1),ye(!1)}},e.time)})}),we?(0,B.jsxs)(b.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[xe?(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overCapacityNote)(_,xe.left,xe.time)}):null,je?(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overPartiesNote)(je.time,je.cap)}):null,(0,B.jsx)(T.Chip,{label:fe?'Booking over the limit: on':'Book anyway (over the limit)',selected:fe,onPress:()=>ye(e=>!e),testID:"nb-over-ok"})]}):null,re&&U?(0,B.jsxs)(b.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,B.jsxs)(T.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,B.jsxs)(T.T,{size:13,colour:j.colours.muted,children:["(",ie.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),ge.length?(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:ge.slice(0,10).map((e,t)=>(0,B.jsx)(T.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${De&&(0,P.accessibleSetUp)(ie)&&!(0,P.isAccessible)(ie,e.table)?' \xb7 not step-free':''}`,selected:(le??ge[0].table)===e.table,onPress:()=>ae(e.table)},e.table))}):(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["No dog-friendly table free for ",_," at ",U,". Try another time."]})]}):null,Te?(0,B.jsxs)(b.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsxs)(T.T,{weight:"semibold",colour:j.colours.amber,children:["Bookings are paused ",Te.from,"\u2013",Te.to,Te.reason?` (${Te.reason})`:'']}),Se?(0,B.jsx)(T.Chip,{label:W?'Manager override on':'Override and book anyway',selected:W,onPress:()=>A(e=>!e)}):(0,B.jsx)(T.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,pe.length?null:(0,B.jsx)(b.default,{testID:"nb-closed",children:(0,B.jsxs)(T.T,{size:14,weight:"semibold",colour:j.colours.amber,children:["Closed on ",(0,x.niceDate)(ue)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,B.jsx)(D.MoreQuestions,{rid:u,r:c,value:te,onChange:se,party:_,date:M,time:U,today:(0,x.ymd)(h),bookings:F,audience:"staff",showTables:!1!==c.settings.tableRequests}),De&&!(0,P.accessibleSetUp)(ie)?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,B.jsx)(T.Field,{label:"Notes (optional)",value:Q,onChangeText:V,placeholder:I.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(c.settings),_)?(0,B.jsxs)(T.Muted,{children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(c.settings),_))," (",(0,a.gbp)((0,i.depositOf)(c.settings).perPersonPence)," per person for ",(0,i.depositOf)(c.settings).fromParty,"+). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,B.jsxs)(T.Muted,{children:["The guest gets a confirmation text",X.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),ve?(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["We already have the most dogs we can look after at ",U,". Try another time: dogs are very welcome then."]}):null,(0,B.jsx)(T.Button,{label:oe.length?oe[0]:'Save booking',testID:"nb-save",disabled:!Ce,onPress:()=>{if(M<(0,x.ymd)(h))return;const e=(0,D.needsPatch)(te),s=te.tableReq.find(e=>!re||ge.some(t=>t.table===e));f.repo.bookings.create({restaurantId:u,customerId:null,name:E.trim(),partySize:_,date:M,time:U,notes:Q.trim(),security:(0,i.depositDue)((0,i.depositOf)(c.settings),_)?'deposit':'none',depositPaid:0,...(0,i.depositDue)((0,i.depositOf)(c.settings),_)?{depositDue:(0,i.depositDue)((0,i.depositOf)(c.settings),_),depositPolicy:(0,i.depositWords)((0,i.depositOf)(c.settings),_,c.name).join(' '),depositRefundable:(0,i.depositOf)(c.settings).refundable,depositCutoffHours:(0,i.depositOf)(c.settings).cutoffHours}:{},phone:me.pretty,email:X.trim()||void 0,source:Z,...e,...pe.find(e=>e.time===U)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...re?{table:le??s??ge[0]?.table}:{}}).then(e=>(0,$.postNewBookingToKitchen)(e,O)).catch(()=>{}),d?.({date:M,time:U,name:E.trim()}),t()}})]})}},1113,[827,1114,1115,860,867,14,1116,34,859,402,102,872,1079,874,1117,1095,858,821,864,794,1021,1018,1118,1119,1124,1097,1091,1125,25]); __d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PartySizeInput=function({value:e,onChange:p,min:b=s.MIN_PARTY,max:y=s.MAX_PARTY,label:f="Party size",testID:h="party-size"}){const[x,$]=(0,t.useState)(String(e));(0,t.useEffect)(()=>{$(String(e))},[e]);const w=e=>p((0,s.clampParty)(e,b,y)),I=(t,n,l)=>{const s=t<0?e<=b:e>=y;return(0,d.jsx)(o.default,{testID:`${h}-${t>0?'up':'down'}${10===Math.abs(t)?'10':''}`,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:s},disabled:s,onPress:()=>w(e+t),hitSlop:4,style:{minWidth:44,height:44,paddingHorizontal:8,borderRadius:22,borderWidth:1.5,borderColor:c.colours.gold,alignItems:'center',justifyContent:'center',opacity:s?.4:1},children:(0,d.jsx)(u.T,{size:10===Math.abs(t)?14:20,weight:"semibold",colour:c.colours.gold,center:!0,children:n})},t)};return(0,d.jsxs)(l.default,{testID:h,style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap',justifyContent:'center'},children:[y-b>=20?I(-10,'\u221210',"10 fewer people"):null,I(-1,'\u2212','One fewer person'),(0,d.jsx)(n.default,{testID:`${h}-input`,value:x,keyboardType:"number-pad",inputMode:"numeric",maxLength:3,selectTextOnFocus:!0,accessibilityLabel:`${f}, ${b} to ${y} people`,accessibilityValue:{min:b,max:y,now:e,text:`${e} ${1===e?'person':'people'}`},onChangeText:e=>{$(e.replace(/\D/g,'')),e.replace(/\D/g,'')&&w((0,s.partyFromText)(e,b,y))},onBlur:()=>{const e=(0,s.partyFromText)(x,b,y);$(String(e)),w(e)},style:{width:64,height:44,borderRadius:10,borderWidth:1,borderColor:c.colours.border,color:c.colours.text,backgroundColor:c.colours.surface,textAlign:'center',fontSize:20,fontFamily:c.fonts.semibold}}),I(1,'+','One more person'),y-b>=20?I(10,'+10',"10 more people"):null]})};var t=r(_d[0]),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),s=r(_d[4]),c=r(_d[5]),u=r(_d[6]),d=r(_d[7])},1114,[34,402,412,102,1115,821,794,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const f=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(f)?f:u))},f=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),b=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`},1115,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overPartiesNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const s=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(s)?s:u))},s=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),f=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`,b=(t,n)=>`${t} already has the most bookings we take at one start time (${n}). Booking another goes over the venue\u2019s limit: check tables and staffing.`},1115,[]); __d(function(g,r,i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"dismissNotice",{enumerable:!0,get:function(){return u.dismissNotice}}),Object.defineProperty(_e,"notify",{enumerable:!0,get:function(){return u.notify}}),Object.defineProperty(_e,"useSliders",{enumerable:!0,get:function(){return u.useSliders}}),Object.defineProperty(_e,"SLIDER",{enumerable:!0,get:function(){return j}}),_e.SliderButton=k,_e.SliderCard=C,_e.SliderHost=function(){y();const e=(0,u.useSliders)(e=>e.queue),n=e[0],o=(0,t.useRef)(null);(0,t.useEffect)(()=>{if(p)return window.ccSlider=e=>(0,u.notify)(e),()=>{delete window.ccSlider}},[]),(0,t.useEffect)(()=>{if(o.current&&clearTimeout(o.current),!n)return;const e=void 0!==n.timeoutMs?n.timeoutMs:n.actions?.length||n.content?null:6e3;return e&&(o.current=setTimeout(()=>u.useSliders.getState().dismiss(n.id),e)),()=>{o.current&&clearTimeout(o.current)}},[n?.id,n?.timeoutMs]);const[l,c]=(0,t.useState)(0);if((0,t.useEffect)(()=>{if(!p||!n)return;const e=()=>{const e=document.querySelector('[data-testid="app-bottom-tabs"]');c(e?Math.max(0,Math.round(window.innerHeight-e.getBoundingClientRect().top)):0)};e();const t=setTimeout(e,300);return window.addEventListener('resize',e),()=>{clearTimeout(t),window.removeEventListener('resize',e)}},[n?.id]),!n)return null;const a=p?'fixed':'absolute';return(0,f.jsxs)(f.Fragment,{children:[n.modal?(0,f.jsx)(s.default,{...x('dim'),style:{position:a,left:0,right:0,top:0,bottom:0,zIndex:2147482990,backgroundColor:'rgba(0,0,0,0.72)'}}):null,(0,f.jsx)(s.default,{testID:"cc-slider-host",pointerEvents:"box-none",style:{position:a,left:12,right:12,bottom:12,zIndex:2147483e3,alignItems:'center',...p?{bottom:l?`${12+l}px`:'calc(12px + env(safe-area-inset-bottom))'}:{}},children:(0,f.jsx)(C,{n:n,waiting:e.length-1,onClose:()=>u.useSliders.getState().dismiss(n.id)},n.id+':'+(n.seq??0))})]})};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),s=e(r(d[4])),l=e(r(d[5])),c=r(d[6]),a=r(d[7]),u=r(d[8]),b=r(d[9]),f=r(d[10]);const p='undefined'!=typeof document,h="\n[data-ccsl=\"in\"]{animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both}\n@keyframes ccsl-in{from{opacity:0;transform:translate3d(0,110%,0)}to{opacity:1;transform:none}}\n[data-ccsl=\"urgent\"]{animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both,ccsl-red 1.6s ease-in-out .45s infinite}\n@keyframes ccsl-red{0%,100%{box-shadow:0 10px 30px rgba(0,0,0,.6),0 0 0 1px rgba(255,107,94,.55)}50%{box-shadow:0 10px 40px rgba(0,0,0,.6),0 0 0 2px #FF6B5E,0 0 34px rgba(255,107,94,.45)}}\n[data-ccsl=\"dim\"]{animation:ccsl-dim .3s ease both}\n@keyframes ccsl-dim{from{opacity:0}to{opacity:1}}\n@media (prefers-reduced-motion: reduce){[data-ccsl]{animation:none !important}}\n",x=e=>p?{dataSet:{ccsl:e}}:{};function y(){(0,t.useEffect)(()=>{if(!p||document.getElementById('cc-slider-css'))return;const e=document.createElement('style');e.id='cc-slider-css',e.textContent=h,document.head.appendChild(e)},[])}const j={bg:'#17140F',border:'rgba(207,164,95,.55)',text:'#F5F1E8',quiet:'#A89A80',gold:c.colours.gold,ink:'#17130D'},w=(e="normal")=>'urgent'===e?c.colours.red:'warn'===e?c.colours.amber:c.colours.gold,S=(e="normal")=>'urgent'===e?'rgba(255,107,94,.75)':'warn'===e?'rgba(255,181,71,.65)':j.border;function k({a:e,onDone:t,big:o}){const s=e.kind??'primary';return(0,f.jsx)(n.default,{testID:e.testID,accessibilityRole:"button",accessibilityLabel:e.label,onPress:()=>{try{e.onPress?.()}finally{e.keepOpen||t()}},style:({pressed:e})=>({minHeight:o?56:44,minWidth:44,paddingHorizontal:'ghost'===s?10:o?24:18,borderRadius:12,alignItems:'center',justifyContent:'center',backgroundColor:'primary'===s?j.gold:'transparent',borderWidth:'danger'===s?1:0,borderColor:c.colours.red,opacity:e?.8:1}),children:(0,f.jsx)(a.T,{size:o?18:'ghost'===s?14:15,weight:'primary'===s?'bold':'medium',colour:'primary'===s?j.ink:'danger'===s?c.colours.red:j.quiet,children:e.label})})}function C({n:e,onClose:t,waiting:n=0,maxWidth:c=520}){y();const u=e.tone??'normal',h=w(u),C=e.content,z=!!e.big,{height:I}=(0,l.default)(),D=e.actions??[];return(0,f.jsxs)(s.default,{testID:e.testID??'cc-slider',accessibilityRole:"summary",accessibilityLabel:`${e.kicker?e.kicker+': ':''}${e.title}`,...x('urgent'===u?'urgent':'in'),style:{width:'100%',maxWidth:z?Math.max(c,900):c,alignSelf:'center',borderRadius:14,backgroundColor:j.bg,borderWidth:1,borderColor:S(u),overflow:'hidden',...p?{boxShadow:'0 10px 30px rgba(0,0,0,.6)'}:{elevation:12}},children:['normal'!==u?(0,f.jsx)(s.default,{style:{position:'absolute',left:0,top:0,bottom:0,width:5,backgroundColor:h}}):null,(0,f.jsxs)(o.default,{style:{maxHeight:Math.max(220,I-40)},contentContainerStyle:{paddingVertical:z?18:12,paddingLeft:'normal'!==u?z?24:18:z?20:14,paddingRight:z?20:14,gap:z?10:6},children:[(0,f.jsxs)(s.default,{style:{flexDirection:'row',alignItems:'center',gap:12},children:[e.icon?(0,f.jsx)(a.T,{size:z?34:22,children:e.icon}):null,(0,f.jsxs)(s.default,{style:{flex:1,gap:2},children:[e.kicker?(0,f.jsx)(a.T,{size:z?15:11,weight:"bold",colour:h,style:{letterSpacing:1.4},children:e.kicker}):null,(0,f.jsx)(a.T,{size:z?24:15,weight:"medium",colour:j.text,children:e.title}),e.body?(0,f.jsx)(a.T,{size:z?18:13,colour:j.quiet,children:e.body}):null]}),D.length||C?null:(0,f.jsx)(b.ToastClose,{testID:"cc-slider-ok",label:`Close: ${e.title}`,onPress:t,size:z?'lg':'md',colour:j.quiet})]}),C?(0,f.jsx)(C,{close:t}):null,D.length?(0,f.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',alignItems:'center',gap:8,justifyContent:'flex-end'},children:D.map(e=>(0,f.jsx)(k,{a:e,onDone:t,big:z},e.label))}):null,n>0?(0,f.jsxs)(a.T,{size:z?14:11,colour:j.quiet,center:!0,style:{alignSelf:'stretch'},children:[n," more waiting"]}):null]})]})}},1116,[34,236,402,295,102,426,821,794,998,796,25]); -__d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.bookingSlotMinutesOf=s,Object.defineProperty(e,"COVERS_WINDOW_MINS",{enumerable:!0,get:function(){return r}}),e.coversInHalfHour=l,e.takeawaySlots=function(o,s,r){const l=(0,t.hoursFor)(o,r);if(!l)return[];const u=o.settings.slotMinutes,c=(0,n.addMins)(r,o.settings.leadMins),f=[];for(let t=new Date(l.open);t<=l.close;t=(0,n.addMins)(t,u)){if(tn.restaurantId===o.id&&'takeaway'===n.type&&'cancelled'!==n.status&&n.slotTime&&new Date(n.slotTime).getTime()===t.getTime()).length;f.push({time:new Date(t),label:(0,n.hm)(t),taken:r,cap:o.settings.slotCap,full:r>=o.settings.slotCap})}return f},e.bookingSlots=function(r,c,f,d,m){const p=(0,t.hoursFor)(r,c);if(!p)return[];const M=[],S=p.close,b=(0,o.lastFoodOn)(r,u(c)),h=b?(0,n.atTime)(c,b.time):S,k='drinks'===(0,o.afterLastFood)(r),O=s(r);for(let t=new Date(p.open);t<=S;t=(0,n.addMins)(t,O)){const o=(0,n.hm)(t),s=t>h;if(s&&!k)continue;const u=r.settings.bookingCoversPerSlot-l(f,o),c=t.getTime()=d,past:c,...s?{drinksOnly:!0}:{}})}return M};var t=_r(_d[0]),n=_r(_d[1]),o=_r(_d[2]);function s(t){const n=t.settings.bookingSlotMinutes;return 5===n||10===n||15===n||20===n||30===n?n:15}const r=30;function l(t,o){const s=Math.floor((0,n.toMins)(o)/r)*r;let l=0;for(let o=0;o`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},1117,[878,858,877]); +__d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.bookingSlotMinutesOf=s,e.bookingNoticeMinsOf=r,e.bookingCoversPerStartOf=u,e.bookingPartiesPerStartOf=l,e.onlinePartyBounds=c,Object.defineProperty(e,"COVERS_WINDOW_MINS",{enumerable:!0,get:function(){return f}}),e.coversInHalfHour=m,e.countInStartSlot=p,e.bookingLimitsHint=function(t){const n=s(t),o=u(t),f=l(t),m=r(t),p=c(t);if(null!=o||null!=f){const t=[];return null!=o&&null!=f?t.push(`up to ${o} people and ${f} bookings at each start time`):null!=o?t.push(`up to ${o} people at each start time`):t.push(`up to ${f} bookings at each start time`),(p.max<100||p.min>1)&&t.push(`parties of ${p.min} to ${p.max}`),t.push(`from ${m} minutes ahead`),t.push('table rules still apply'),`Times are every ${n} minutes: ${t.join(', ')}.`}return`Times are every ${n} minutes. Covers per slot (${t.settings.bookingCoversPerSlot} per half hour) and table rules still apply.`},e.takeawaySlots=function(o,s,r){const u=(0,t.hoursFor)(o,r);if(!u)return[];const l=o.settings.slotMinutes,c=(0,n.addMins)(r,o.settings.leadMins),f=[];for(let t=new Date(u.open);t<=u.close;t=(0,n.addMins)(t,l)){if(tn.restaurantId===o.id&&'takeaway'===n.type&&'cancelled'!==n.status&&n.slotTime&&new Date(n.slotTime).getTime()===t.getTime()).length;f.push({time:new Date(t),label:(0,n.hm)(t),taken:r,cap:o.settings.slotCap,full:r>=o.settings.slotCap})}return f},e.bookingSlots=function(c,f,d,h,k,M=()=>0){const y=(0,t.hoursFor)(c,f);if(!y)return[];const S=[],$=y.close,P=(0,o.lastFoodOn)(c,b(f)),v=P?(0,n.atTime)(f,P.time):$,I='drinks'===(0,o.afterLastFood)(c),O=s(c),C=r(c),N=u(c),T=l(c);for(let t=new Date(y.open);t<=$;t=(0,n.addMins)(t,O)){const o=(0,n.hm)(t),s=t>v;if(s&&!I)continue;const r=null!=N?p(d,o,O):m(d,o),u=(N??c.settings.bookingCoversPerSlot)-r,l=null!=T?p(M,o,O):0,f=null!=T?T-l:void 0,b=t.getTime()=1;S.push({time:o,left:u,available:!b&&u>=h&&y,past:b,...s?{drinksOnly:!0}:{},...null!=f?{partiesLeft:f,partiesCap:T}:{}})}return S};var t=_r(_d[0]),n=_r(_d[1]),o=_r(_d[2]);function s(t){const n=t.settings.bookingSlotMinutes;return 5===n||10===n||15===n||20===n||30===n?n:15}function r(t){const n=t.settings.bookingNoticeMins;return'number'==typeof n&&Number.isInteger(n)&&n>=0&&n<=1440?n:30}function u(t){const n=t.settings.bookingCoversPerStart;return'number'==typeof n&&Number.isInteger(n)&&n>0&&n<=200?n:null}function l(t){const n=t.settings.bookingPartiesPerStart;return'number'==typeof n&&Number.isInteger(n)&&n>0&&n<=50?n:null}function c(t){const n=t.settings.onlinePartyMin,o=t.settings.onlinePartyMax,s='number'==typeof n&&Number.isInteger(n)&&n>=1&&n<=100?n:1;return{min:s,max:'number'==typeof o&&Number.isInteger(o)&&o>=s&&o<=100?o:100}}const f=30;function m(t,o){const s=Math.floor((0,n.toMins)(o)/f)*f;let r=0;for(let o=0;o`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},1117,[878,858,877]); __d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.nextDays=c,Object.defineProperty(_e,"openOn",{enumerable:!0,get:function(){return u}}),_e.BookingDatePicker=function({r:e,today:l,value:b,onChange:m}){const[f,x]=(0,t.useState)(!1),p=(0,r.ymd)(l),j=c(l,9),D=(e,t)=>0===t?'Today':1===t?'Tomorrow':`${(0,r.dayShort)(e)} ${e.getDate()}`,w=j.some(e=>(0,r.ymd)(e)===b),C=(0,r.parseYmd)(b),[P,T]=(0,t.useState)(()=>({y:C.getFullYear(),m:C.getMonth()})),v=(new Date(P.y,P.m,1,12).getDay()+6)%7,M=new Date(P.y,P.m+1,0).getDate(),R=[...Array.from({length:v},()=>null),...Array.from({length:M},(e,t)=>new Date(P.y,P.m,t+1,12))];for(;R.length%7;)R.push(null);const k=12*(P.y-l.getFullYear())+P.m-l.getMonth(),F=e=>T(({y:t,m:o})=>{const s=new Date(t,o+e,1);return{y:s.getFullYear(),m:s.getMonth()}});return(0,i.jsxs)(s.default,{testID:"nb-date",style:{gap:6},children:[(0,i.jsxs)(d.Row,{wrap:!0,gap:6,children:[j.map((t,o)=>(0,i.jsx)(d.Chip,{label:D(t,o),sub:u(e,t)?void 0:'Closed',selected:b===(0,r.ymd)(t),onPress:()=>{m((0,r.ymd)(t)),x(!1)}},(0,r.ymd)(t))),w?null:(0,i.jsx)(d.Chip,{label:(0,r.niceDate)(C),sub:u(e,C)?void 0:'Closed',selected:!0,onPress:()=>x(!0)}),(0,i.jsx)(d.Chip,{label:f?'Close calendar':'\ud83d\udcc5 Pick date',selected:f,onPress:()=>{f||T({y:C.getFullYear(),m:C.getMonth()}),x(!f)}})]}),f?(0,i.jsxs)(s.default,{testID:"nb-calendar",style:{borderWidth:1,borderColor:n.colours.border,borderRadius:14,padding:10,gap:6,backgroundColor:n.colours.surface2,maxWidth:420},children:[(0,i.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,i.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Previous month",disabled:k<=0,onPress:()=>F(-1),style:{padding:8,opacity:k<=0?.3:1},children:(0,i.jsx)(d.T,{size:20,colour:n.colours.gold,children:"\u2039"})}),(0,i.jsxs)(d.T,{weight:"semibold",children:[(0,r.monthLong)(P.m)," ",P.y]}),(0,i.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Next month",disabled:k>=h,onPress:()=>F(1),style:{padding:8,opacity:k>=h?.3:1},children:(0,i.jsx)(d.T,{size:20,colour:n.colours.gold,children:"\u203a"})})]}),(0,i.jsx)(s.default,{style:{flexDirection:'row'},children:y.map(e=>(0,i.jsx)(d.T,{size:12,colour:n.colours.muted,center:!0,style:{flex:1},children:e},e))}),Array.from({length:R.length/7},(t,l)=>(0,i.jsx)(s.default,{style:{flexDirection:'row',gap:4},children:R.slice(7*l,7*l+7).map((t,l)=>{if(!t)return(0,i.jsx)(s.default,{style:{flex:1,height:40}},l);const c=(0,r.ymd)(t),y=c{m(c),x(!1)},style:{flex:1,height:40,borderRadius:10,alignItems:'center',justifyContent:'center',borderWidth:c===p?1.5:0,borderColor:n.colours.gold,backgroundColor:h?n.colours.gold:'transparent',opacity:y?.3:1},children:(0,i.jsx)(d.T,{size:15,weight:h?'bold':'regular',colour:h?n.colours.onGold:f?n.colours.muted:n.colours.text,style:f&&!y?{textDecorationLine:'line-through'}:void 0,children:t.getDate()})},l)})},l)),(0,i.jsx)(d.Muted,{children:"Past dates can\u2019t be booked. Crossed-out days: closed (per the venue\u2019s hours)."})]}):null]})};var t=_r(_d[0]),o=e(_r(_d[1])),s=e(_r(_d[2])),l=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),d=_r(_d[6]),i=_r(_d[7]);function c(e,t){const o=new Date(e);return o.setHours(12,0,0,0),Array.from({length:t},(e,t)=>{const s=new Date(o);return s.setDate(o.getDate()+t),s})}const u=(e,t)=>!!(0,l.hoursFor)(e,t),y=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],h=12},1118,[34,402,102,878,858,821,794,25]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"emptyNeeds",{enumerable:!0,get:function(){return w}}),_e.needsMissing=function(e,l=[]){const s=[];null===e.allergy?s.push('Answer the allergy question first'):'yes'!==e.allergy||e.allergens.length||l.length||e.allergyNote.trim()||s.push('Pick the allergens or describe them');null===e.dog&&s.push('Say whether a dog is coming');return s},_e.needsPatch=function(e,l=[]){const s='yes'===e.allergy?e.allergens.filter(e=>!l.some(l=>l.allergen===e)).map(l=>({allergen:l,severity:e.severity})):[],t=Object.entries(e.holds).filter(([,e])=>e>0).map(([e,l])=>({kind:e.startsWith('item:')?'item':'stock',id:e.slice(5),qty:l})),a=e.dog?Math.max(1,e.dogs):0,n={...e.wheelchair?{wheelchair:e.wheelchair}:{},...e.stepFree?{stepFree:!0}:{},...e.toilet?{toilet:!0}:{},...e.assistDog?{assistDog:!0}:{},...e.accessNote.trim()?{note:e.accessNote.trim()}:{}},r={...e.vegan?{vegan:e.vegan}:{},...e.vegetarian?{vegetarian:e.vegetarian}:{}};return{allergies:[...l,...s],allergyNone:'none'===e.allergy&&!l.length||void 0,allergyPeople:'yes'===e.allergy?e.allergyPeople:void 0,allergyNote:'yes'===e.allergy&&e.allergyNote.trim()?e.allergyNote.trim():void 0,dog:a>0,dogs:a||void 0,access:Object.keys(n).length?n:void 0,diet:Object.keys(r).length?r:void 0,holds:t.length?t:void 0,tableReq:e.tableReq.length?e.tableReq:void 0}},_e.FirstQuestions=function({rid:e,value:l,onChange:a,party:r,audience:i,profile:o=[]}){const y=e=>a({...l,...e}),b=(0,p.usePlan)(e),[x,j]=(0,t.useState)(!1),k=(0,s.dogQuestionOn)((0,u.useRestaurant)(e));(0,t.useEffect)(()=>{k||null!==l.dog||a({...l,dog:!1})},[k,l.dog]);const w=x?m.ALLERGENS:m.ALLERGENS.filter(e=>['gluten','milk','peanuts','treenuts','crustaceans','molluscs','fish','eggs','sesame'].includes(e.id)||l.allergens.includes(e.id)),q=[...o.map(e=>e.allergen),...l.allergens],M=(0,f.dogSetUp)(b);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(R,{tone:"red",testID:"q-allergens",children:[(0,v.jsx)(C,{sub:'guest'===i?'We ask everyone first, so the kitchen can keep you safe.':'Ask every guest first. It goes to the kitchen in red.',children:"\u26a0\ufe0f Does anyone in the party have a food allergy?"}),o.length?(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:o.map(e=>(0,v.jsx)(h.Badge,{kind:"red",label:`${m.ALLERGENS.find(l=>l.id===e.allergen)?.short} (from your profile)`},e.allergen))}):null,(0,v.jsxs)(h.Row,{gap:8,children:[(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"No allergies",selected:'none'===l.allergy,onPress:()=>y({allergy:'none',allergens:[]})})}),(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"Yes, allergies",selected:'yes'===l.allergy,onPress:()=>y({allergy:'yes'})})})]}),'none'===l.allergy&&o.length?(0,v.jsx)(h.Muted,{children:"Your profile allergies above are still shared with the kitchen."}):null,'yes'===l.allergy?(0,v.jsxs)(n.default,{style:{gap:10},testID:"allergen-picker",children:[(0,v.jsx)(h.T,{size:14,weight:"semibold",children:"Which allergens? (the 14 UK allergens)"}),(0,v.jsxs)(h.Row,{wrap:!0,gap:6,children:[w.map(e=>(0,v.jsx)(h.Chip,{label:e.short,selected:l.allergens.includes(e.id)||o.some(l=>l.allergen===e.id),disabled:o.some(l=>l.allergen===e.id),onPress:()=>y({allergens:l.allergens.includes(e.id)?l.allergens.filter(l=>l!==e.id):[...l.allergens,e.id]})},e.id)),x?null:(0,v.jsx)(h.Chip,{label:"All 14\u2026",onPress:()=>j(!0)})]}),(0,v.jsx)(h.T,{size:14,weight:"semibold",children:"How serious?"}),(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:m.SEVERITIES.map(e=>(0,v.jsx)(h.Chip,{label:e.label,selected:l.severity===e.id,onPress:()=>y({severity:e.id})},e.id))}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"How many people with allergies?"}),(0,v.jsx)(h.Stepper,{value:Math.min(l.allergyPeople,r),onChange:e=>y({allergyPeople:e}),min:1,max:Math.max(1,r),label:"people with allergies"})]}),(0,v.jsx)(h.Field,{label:"Anything else the kitchen should know? (optional)",value:l.allergyNote,onChangeText:e=>y({allergyNote:e}),placeholder:"e.g. traces of sesame, one child with coeliac disease",testID:"allergy-note"}),q.length?(0,v.jsx)(c.MenuAllergyCheck,{rid:e,allergens:q,audience:i}):null]}):null]}),k?(0,v.jsxs)(R,{tone:"gold",testID:"q-dogs",children:[(0,v.jsx)(C,{sub:M?'Well-behaved dogs are welcome at our dog-friendly tables.':'staff'===i?'Dog-friendly tables aren\u2019t marked yet (Managers \u203a Booking options), so any table is offered for now.':void 0,children:"\ud83d\udc15 Are you bringing a dog?"}),(0,v.jsxs)(h.Row,{gap:8,children:[(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"No",selected:!1===l.dog,onPress:()=>y({dog:!1})})}),(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"Yes",selected:!0===l.dog,onPress:()=>y({dog:!0,dogs:Math.max(1,l.dogs)})})})]}),l.dog?(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"How many dogs?"}),(0,v.jsx)(h.Stepper,{value:l.dogs,onChange:e=>y({dogs:e}),min:1,max:4,label:"dogs"})]}):null]}):null]})},_e.useReserveAvailability=q,_e.MoreQuestions=function({rid:e,r:l,value:a,onChange:r,party:i,date:o,time:c,today:y,bookings:m,audience:b,showTables:x}){const j=e=>r({...a,...e}),w=l.settings,S=(0,u.useMenu)(e),P=(0,t.useMemo)(()=>S.filter(e=>/\((V|VG|Ve)\)|vegan|vegetarian/i.test(`${e.name} ${e.tags?.join(' ')??''}`)).slice(0,4),[S.length]),N=q(e,l,o,y,m,b),T=e=>a.holds[e]??0,D=(0,f.stockNeed)({holds:Object.entries(a.holds).map(([e,l])=>({kind:e.startsWith('item:')?'item':'stock',id:e.slice(5),qty:l}))},N.items),$=(e,l)=>Math.min(10,...e.map(e=>{const s=(D[e.key]??0)-T(l)*e.qty;return Math.floor(((N.free[e.key]??0)-s)/e.qty)})),I=(e,l,s,t)=>{const r=T(e),i=t<=0&&0===r;return(0,v.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:10,opacity:i?.55:1},testID:`reserve-${e.replace(':','-')}`,children:[(0,v.jsxs)(n.default,{style:{flex:1,minWidth:0},children:[(0,v.jsx)(h.T,{weight:"semibold",children:l}),(0,v.jsx)(h.Muted,{children:i?'Unavailable \u2014 none left for this day':s})]}),i?(0,v.jsx)(h.Badge,{kind:"neutral",label:"Unavailable"}):(0,v.jsx)(h.Stepper,{value:r,onChange:l=>j({holds:{...a.holds,[e]:Math.max(0,Math.min(l,Math.max(r,t)))}}),min:0,max:Math.max(r,Math.min(10,t)),label:l})]},e)},A=N.items.length>0||!1!==w.reserveStock&&N.stock.length>0,O=(0,p.usePlan)(e);return(0,v.jsxs)(v.Fragment,{children:[(0,s.accessQuestionOn)(l)?(0,v.jsxs)(R,{tone:"plain",testID:"q-access",children:[(0,v.jsx)(C,{sub:"Optional. Tell us and we\u2019ll have the right table ready.",children:"\u267f Access needs"}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Wheelchair users"}),(0,v.jsx)(h.Stepper,{value:a.wheelchair,onChange:e=>j({wheelchair:e}),min:0,max:Math.max(1,i),label:"wheelchair users"})]}),(0,v.jsxs)(h.Row,{wrap:!0,gap:6,children:[(0,v.jsx)(h.Chip,{label:"Step-free access",selected:a.stepFree,onPress:()=>j({stepFree:!a.stepFree})}),(0,v.jsx)(h.Chip,{label:"Accessible toilet",selected:a.toilet,onPress:()=>j({toilet:!a.toilet})}),(0,v.jsx)(h.Chip,{label:"Assistance dog",selected:a.assistDog,onPress:()=>j({assistDog:!a.assistDog})})]}),(0,v.jsx)(h.Field,{label:"Anything else? (optional)",value:a.accessNote,onChangeText:e=>j({accessNote:e}),placeholder:"e.g. needs a chair with arms"}),w.accessStatement?.trim()?(0,v.jsx)(h.Muted,{children:w.accessStatement.trim()}):null]}):null,(0,s.dietQuestionOn)(l)?(0,v.jsxs)(R,{tone:"plain",testID:"q-veg",children:[(0,v.jsx)(C,{sub:"We\u2019d love to look after you. Optional.",children:"\u24cb Any vegans or vegetarians?"}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Vegan"}),(0,v.jsx)(h.Stepper,{value:a.vegan,onChange:e=>j({vegan:e}),min:0,max:Math.max(1,i),label:"vegans"})]}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Vegetarian"}),(0,v.jsx)(h.Stepper,{value:a.vegetarian,onChange:e=>j({vegetarian:e}),min:0,max:Math.max(1,i),label:"vegetarians"})]}),!1!==w.vegTeaser&&P.length&&(a.vegan||a.vegetarian)?(0,v.jsxs)(h.Muted,{children:["On the menu: ",P.map(e=>e.name).join(' \xb7 ')]}):null]}):null,A?(0,v.jsxs)(R,{tone:"gold",testID:"q-reserve",children:[(0,v.jsx)(C,{sub:N.known?'Held for you from today\u2019s count.':o>y||'guest'===b?'Held for you; the kitchen confirms and orders in.':void 0,children:"\ud83e\udd9e Reserve with your table"}),N.items.map(e=>I(`item:${e.id}`,`${e.name}${k(e.price)}`,e.description||e.uses.map(e=>`${e.qty} ${N.stock.find(l=>l.key===e.key)?.name.toLowerCase()??e.key}`).join(' + '),$(e.uses,`item:${e.id}`))),!1!==w.reserveStock?N.stock.map(e=>I(`stock:${e.key}`,`Reserve ${e.name.toLowerCase()}`,N.known?`${N.free[e.key]} available today`:'Held for the kitchen to order',$([{key:e.key,qty:1}],`stock:${e.key}`))):null,'staff'===b&&N.known?(0,v.jsxs)(h.Muted,{children:["Today: ",N.stock.map(e=>`${N.free[e.key]} ${e.plural.toLowerCase()} free (${N.reserved[e.key]??0} reserved)`).join(' \xb7 ')]}):null]}):null,x&&!1!==w.tableRequests&&O.tables.length?(0,v.jsx)(M,{rid:e,value:a,onChange:r,party:i,hide:w.tableRequestHide??[]}):null]})},_e.dogTimeOk=function(e,l,s,t,a){if(!a)return!0;const n=e.settings.maxDogsPerSlot;return!n||(0,f.dogsAt)(l,s,t)+a<=n},Object.defineProperty(_e,"accessibleSetUp",{enumerable:!0,get:function(){return f.accessibleSetUp}});var e,l=_r(d[0]),s=_r(d[1]),t=_r(d[2]),a=_r(d[3]),n=(e=a)&&e.__esModule?e:{default:e},r=_r(d[4]),i=_r(d[5]),o=_r(d[6]),c=_r(d[7]),h=_r(d[8]),u=_r(d[9]),p=_r(d[10]),y=_r(d[11]),m=_r(d[12]),b=_r(d[13]),x=_r(d[14]),f=_r(d[15]),j=_r(d[16]),v=_r(d[17]);const k=e=>'display'===x.APP_VARIANT?'':` \xb7 ${(0,b.gbp)(e)}`,w=()=>({allergy:null,allergens:[],severity:'allergy',allergyPeople:1,allergyNote:'',dog:null,dogs:1,wheelchair:0,stepFree:!1,toilet:!1,assistDog:!1,accessNote:'',vegan:0,vegetarian:0,holds:{},tableReq:[]});const R=({children:e,tone:l,testID:s})=>(0,v.jsx)(n.default,{testID:s,style:{gap:10,padding:16,borderRadius:16,borderWidth:'plain'===l?1:1.5,borderColor:'red'===l?j.colours.red:'gold'===l?j.colours.accentBorder:j.colours.hairline,backgroundColor:'red'===l?'#1E1110':j.colours.surface},children:e}),C=({children:e,sub:l})=>(0,v.jsxs)(n.default,{style:{gap:2},children:[(0,v.jsx)(h.T,{weight:"semibold",size:17,children:e}),l?(0,v.jsx)(h.Muted,{children:l}):null]});function q(e,l,s,t,a,n,i){const o=(0,f.reservablesOf)(l),c=(0,y.useStockItems)(e),h=(0,y.useShellStore)((0,r.useShallow)(l=>(0,y.venueCounts)(l,e))),u=(0,y.useShellStore)(l=>!!l.server[e]),p=(0,f.reservedOn)(a,s,o,i),m=s===t&&('staff'===n||u),b={};for(const e of c)b[e.key]=m?Math.max(0,Math.floor((h[e.key]??0)-(p[e.key]??0))):1/0;return{items:o,stock:c,free:b,reserved:p,known:m}}function M({rid:e,value:s,onChange:a,party:r,hide:c}){const u=(0,p.usePlan)(e),y=u.areas.filter(e=>u.tables.some(l=>l.areaId===e.id&&!c.includes(l.name))),[m,b]=(0,t.useState)(y[0]?.id??''),x=s.dog?s.dogs:0,k=e=>c.includes(e)?'Not bookable':(0,f.tableBlockReason)(u,e,r,x,s.wheelchair>0||s.stepFree),w=Object.fromEntries(u.tables.map(e=>[e.name,{table:e,status:k(e.name)?'blocked':'free',covers:0,allergy:!1}])),q=e=>{if(k(e))return;const l=s.tableReq.includes(e)?s.tableReq.filter(l=>l!==e):[...s.tableReq,e].slice(-2);a({...s,tableReq:l})},M=u.tables.filter(e=>e.areaId===m&&!c.includes(e.name));return(0,v.jsxs)(R,{tone:"plain",testID:"q-table",children:[(0,v.jsx)(C,{sub:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best.",children:"\ud83e\ude91 Request a table (optional)"}),y.length>1?(0,v.jsx)(i.AreaTabs,{plan:u,area:m,onPick:b}):null,(0,v.jsx)(n.default,{testID:"q-table-plan",style:{height:240,borderRadius:12,overflow:'hidden',borderWidth:1,borderColor:j.colours.hairline},children:(0,v.jsx)(o.FloorCanvas,{plan:u,areaId:m,mode:"live",view:w,privacy:!0,fit:"contain",crop:!0,maxH:260,highlight:s.tableReq,onTap:e=>q(e.name)})}),(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:M.map(e=>{const t=k(e.name),a=s.tableReq.indexOf(e.name);return(0,v.jsx)(h.Chip,{label:`${(0,l.tableNumbers)(e.name)}`,sub:t||(0===a?'1st choice':1===a?'2nd choice':`${e.maxSeats} seats`),selected:a>=0,disabled:!!t,onPress:()=>q(e.name)},e.name)})}),s.tableReq.length?(0,v.jsxs)(h.T,{size:14,colour:j.colours.goldLight,children:["Requested: ",s.tableReq.map((e,s)=>`${(0,l.tableNumbers)(e)}${s?' (2nd choice)':''}`).join(', ')]}):(0,v.jsx)(h.Muted,{children:"Tap a table; tap another for a second choice."})]})}},1119,[860,877,34,102,879,1120,1121,1123,794,874,1021,984,861,867,872,1091,821,25]); __d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"areaMarks",{enumerable:!0,get:function(){return n}}),_e.AreaTabs=function({plan:o,area:e,onPick:u,counts:a,closed:b}){return(0,c.jsx)(t.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:o.areas.map(o=>{const h=o.id===e,f=b?.has(o.id);return(0,c.jsx)(l.default,{testID:`area-${o.id}`,accessibilityRole:"tab",accessibilityLabel:`Area ${o.name}${o.dogs?', dogs allowed':''}${o.outdoor?', outdoor':''}${f?', closed for weather':''}`,accessibilityState:{selected:h},onPress:()=>u(o.id),style:{maxWidth:'100%',minWidth:0,flexShrink:1,minHeight:48,paddingHorizontal:16,borderRadius:24,borderWidth:1.5,borderColor:h?s.colours.gold:f?s.colours.blue:s.colours.border,backgroundColor:h?s.colours.gold:s.colours.surface,justifyContent:'center'},children:(0,c.jsxs)(t.T,{weight:"semibold",size:15,colour:h?s.colours.onGold:s.colours.text,children:[o.name,n(o),f?(0,c.jsx)(t.T,{size:12,colour:h?s.colours.onGold:s.colours.blue,children:" closed"}):null,a?.[o.id]?(0,c.jsxs)(t.T,{size:12,colour:h?s.colours.onGold:s.colours.muted,children:[" ",a[o.id]]}):null]})},o.id)})})},r(d[0]);var o,e=r(d[1]),l=(o=e)&&o.__esModule?o:{default:o},s=r(d[2]),t=r(d[3]),c=r(d[4]);const n=o=>`${o.dogs?' \ud83d\udc3e':''}${o.outdoor?' \ud83c\udf26':''}`},1120,[34,402,821,794,25]); @@ -1295,7 +1295,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useChefAssistant",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"CHEF_PROMPTS",{enumerable:!0,get:function(){return P}}),_e.ChefAssistantButton=function({compact:e}){return e?(0,S.jsx)(u.default,{testID:"chef-assistant-open",accessibilityRole:"button",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0),style:{borderRadius:12,backgroundColor:w.colours.accentBg,borderWidth:1,borderColor:w.colours.accentBorder,paddingVertical:6,paddingHorizontal:12,minHeight:36,justifyContent:'center'},children:(0,S.jsx)(m.T,{weight:"semibold",colour:w.colours.goldLight,size:13,children:"\u2726 Assistant"})}):(0,S.jsx)(d.ActionTile,{primary:!0,testID:"chef-assistant-open",icon:"sparkle",label:"Assistant",sub:"Recipe card, order, allergens, GP, temps",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0)})},_e.ChefAssistantSheet=function({go:e}){const l=I(e=>e.open),d=()=>I.getState().setOpen(!1),{rid:f,me:W,menu:L,k:B,c:F}=(0,$.useChef)(3e4),G=(0,T.useSuggestions)(),E=(0,r.useSafetyView)('chef').points,[M,H]=(0,o.useState)([]),[N,_]=(0,o.useState)(''),[V,K]=(0,o.useState)(!1),[Y,q]=(0,o.useState)(!1),Q=(0,o.useRef)(null),U=(0,o.useRef)(null);if((0,o.useEffect)(()=>{setTimeout(()=>Q.current?.scrollToEnd?.({animated:!0}),50)},[M.length]),!l)return null;const J=(e,t=!1)=>H(n=>[...n,{id:R(),from:'bot',text:e,demo:t}]),X=e=>H(t=>[...t,{id:R(),from:'bot',plan:e,state:'open'}]),Z=L.filter(e=>!e.name.includes('(example)')||!0),ee=(t,n)=>{const r=A(t);if(!(0,s.chefCanSee)(f,t))return void J('That check is managed in the Managers app.');if(/\b(send|email|text|pay|delete|remove|order now|place the order)\b/.test(r)&&!/\b(build|draft|make|prepare)\b/.test(r))return void J('I can\u2019t send, pay for or delete anything. I can prepare it for you to check and do yourself, for example \u201cbuild the fish order\u201d.');const o=(0,y.parseQuick)(t,E).filter(e=>e.point&&(0,y.isTempKind)(e.point.kind));if(o.length&&(/\b(fridge|freezer|walk ?in|core|probe|cool|hot|deliver|degree|temp)/.test(r)||o.some(e=>null!=e.value))){const t=o.filter(e=>null!=e.value),r=o.filter(e=>null==e.value);if(r.length&&J(`I didn\u2019t hear a temperature for ${r.map(e=>e.point.name).join(', ')}. Say or type the reading, for example \u201c${r[0].point.name} 4 degrees\u201d. I never fill one in.`),!t.length)return;const s=t.filter(e=>!(0,y.inRange)(e.point,e.value));return void X({title:`Log ${1===t.length?'a reading':`${t.length} readings`} in the food safety log`,detail:t.map(e=>`${e.point.name}: ${e.value}\xb0C (${(0,y.limitText)(e.point)})${(0,y.inRange)(e.point,e.value)?'':' \xb7 OUT OF RANGE'}`).join('\n')+`\nSigned ${(0,y.initialsOf)(W)} \xb7 ${n?'voice':'typed'}`,warn:s.length?`${s.map(e=>e.point.name).join(', ')} out of range: you\u2019ll need to add the corrective action in the food safety log.`:void 0,confirm:'Log it',run:()=>{const r=(new Date).toISOString();return v.useSafety.getState().addEntries(t.map(e=>({pointId:e.point.id,name:e.point.name,kind:e.point.kind,at:r,by:W.replace(' (example)',''),byId:$.CHEF_ID,app:'chef',value:e.value,ok:(0,y.inRange)(e.point,e.value),source:n?'voice':'typed',initials:(0,y.initialsOf)(W)}))),s.length&&setTimeout(()=>e('haccp'),600),`Logged ${t.map(e=>`${e.point.name} ${e.value}\xb0C`).join(', ')}.${s.length?' Opening the food safety log for the corrective action.':''}`}})}if(/\b(fridge|freezer|temp|temperature|degrees)\b/.test(r))return void J('Which unit, and what does it read? For example \u201cprep fridge 4 degrees\u201d or \u201cfreezer minus 19\u201d. I only log the number you give me.');if(/allergen|allerg|contain|gluten|nut|dairy|milk|shellfish|crustacean|coeliac/.test(r)){const e=D(t,Z,e=>e.name);if(!e)return void J('Which dish? For example \u201callergens in the fish and chips\u201d.');const n=(0,j.recipeCards)().byMenuItem(e.id),r=e=>b.ALLERGENS.find(t=>t.id===e)?.label??e,s=Object.entries(e.allergens??{}).filter(([,e])=>'contains'===e).map(([e])=>r(e)),a=Object.entries(e.allergens??{}).filter(([,e])=>'may'===e).map(([e])=>r(e));return void J(`${e.name}: ${s.length?`contains ${s.join(', ')}`:'no allergens recorded as \u201ccontains\u201d'}${a.length?`; may contain ${a.join(', ')}`:''}. ${n?n.signOff?`From the signed-off recipe card (${n.signOff.by}).`:'The recipe card is awaiting your sign-off, so check it before telling a guest.':'There\u2019s no recipe card for it yet.'} Always check the card and the ingredients with the guest.`)}if(/\bgp\b|gross profit|margin|price for|what price|cost of|costing/.test(r)){const e=D(t,F,e=>e.item.name),n=Number((t.toLowerCase().match(/(\d{2})\s*(?:%|percent|per cent)/)??[])[1])||B.targetGp;if(!e)return void J(`Which dish? I can cost the dishes that have a recipe in GP & costing (${F.length} do). For example \u201cGP on the haddock\u201d.`);const r=(0,C.priceForTarget)(e.cost,n);return void J(`${e.item.name}: food cost ${(0,x.gbp)(e.cost)}, sells at ${(0,x.gbp)(e.priceInc)} (inc VAT) = ${e.gp.toFixed(1)}% GP. For ${n}% GP it would need ${(0,x.gbp)(r)} inc VAT. Prices are changed by a manager; I haven\u2019t changed anything.`)}if(/\border|supplier|delivery|par\b|restock/.test(r)){const n=D(t,G,e=>`${e.s.name} ${e.s.category??''}`)??(1===G.length?G[0]:void 0);return n?void X({title:`Build an order for ${n.s.name}`,detail:(n.lines.length?n.lines.map(e=>`${e.i.name}: ${(0,a.fishQtyText)(f,e.i,e.qty)}`).join('\n')+`\nAbout ${(0,x.gbp)(n.total)} at the latest prices.`:'Nothing is below par for this supplier yet.')+'\nI\u2019ll open it in Ordering for you to check, change and place yourself. Nothing is sent.',confirm:'Open the order',run:()=>(setTimeout(()=>{d(),e('orders',n.s.id)},400),`Opening the ${n.s.name} order. You check it and place it yourself.`)}):void J(G.length?`Which supplier? ${G.map(e=>e.s.name).join(', ')}.`:'Nothing is below par and no supplier orders today.')}if(/recipe|card|new dish|write up|spec/.test(r)){const n=t.replace(/^.*?(?:recipe card|card|recipe|dish|spec)\s*(?:for|of)?\s*/i,'').replace(/[.?!]+$/,'').trim();if(!n||n.length<3)return void J('What\u2019s the dish called? For example \u201cdraft a recipe card for crab linguine\u201d.');const r=n.replace(/^the\s+/i,'').replace(/^./,e=>e.toUpperCase()).slice(0,60),s=(0,j.recipeCards)().list(f).find(e=>A(e.dish)===A(r));return s?(J(`There\u2019s already a card for ${s.dish}. Opening Recipe cards.`),void setTimeout(()=>{d(),e('recipes')},600)):void X({title:`Draft a recipe card: ${r}`,detail:'A new card, awaiting your sign-off, with the dish name and section filled in. You add the ingredients, method, allergens, photo and price, then sign it off. It isn\u2019t shown to guests until you do.',confirm:'Make the draft',run:async()=>(await(0,j.recipeCards)().create(f,{dish:r,section:'Specials',price:null,ingredients:[],steps:[]},{name:W,role:'head-chef'}),setTimeout(()=>{d(),e('recipes')},500),`Draft card for ${r} saved, awaiting sign-off. Opening Recipe cards.`)})}const l='I can help with: drafting a recipe card, building a supplier order, a dish\u2019s allergens, GP pricing, and logging a temperature you read out. Try one of the suggestions.';(0,k.askServer)('chef',t,[]).then(e=>J('text'===e.kind?e.text:l)).catch(()=>J(l))},te=(e,t=!1)=>{const n=e.trim();if(n){_(''),H(e=>[...e,{id:R(),from:'you',text:n}]);try{ee(n,t)}catch(e){J(`Sorry, that didn\u2019t work: ${e.message}`)}}},ne=async e=>{if(e.plan){H(t=>t.map(t=>t.id===e.id?{...t,state:'done'}:t));try{J(String(await e.plan.run()))}catch(e){J(`Couldn\u2019t do that: ${e.message}`)}}},ie=e=>{H(t=>t.map(t=>t.id===e.id?{...t,state:'cancelled'}:t)),J('Cancelled. Nothing was changed.')},re=()=>{te(N,Y),q(!1)};return(0,S.jsx)(c.default,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:d,children:(0,S.jsx)(p.default,{style:[m.styles.overlay,{justifyContent:'flex-end',padding:0}],children:(0,S.jsxs)(p.default,{testID:"chef-assistant",style:{backgroundColor:w.colours.surface,borderTopLeftRadius:18,borderTopRightRadius:18,borderWidth:1,borderColor:w.colours.border,width:'100%',maxWidth:640,alignSelf:'center',maxHeight:'92%',minHeight:'70%',padding:14,gap:10},children:[(0,S.jsxs)(m.Row,{style:{justifyContent:'space-between'},children:[(0,S.jsx)(m.T,{size:20,weight:"semibold",children:"\u2726 Kitchen Assistant"}),(0,S.jsx)(n.GoldClose,{testID:"chef-assistant-close",onPress:d,style:{marginRight:-6}})]}),(0,S.jsx)(p.default,{testID:"chef-assistant-demo",children:(0,S.jsx)(m.Badge,{kind:"amber",label:O})}),(0,S.jsxs)(h.default,{ref:Q,style:{flex:1},contentContainerStyle:{gap:10,paddingBottom:6},keyboardShouldPersistTaps:"handled",children:[0===M.length?(0,S.jsxs)(p.default,{style:{gap:8},children:[(0,S.jsxs)(m.T,{children:["Hi ",W.split(' ')[0],". Type or tap \ud83c\udfa4 and say what you need. I\u2019ll show you what I\u2019m about to do and wait for you to confirm. I never send, pay or delete."]}),P.map(e=>(0,S.jsx)(u.default,{accessibilityRole:"button",onPress:()=>te(e),style:{borderWidth:1,borderColor:w.colours.border,borderRadius:12,paddingVertical:9,paddingHorizontal:12,backgroundColor:w.colours.surface2},children:(0,S.jsx)(m.T,{size:14,children:e})},e))]}):null,M.map(e=>'you'===e.from?(0,S.jsx)(p.default,{style:{alignSelf:'flex-end',maxWidth:'85%',backgroundColor:'#3A2F12',borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id):e.plan?(0,S.jsxs)(p.default,{testID:"chef-confirm-card",style:{borderWidth:1.5,borderColor:'open'===e.state?w.colours.gold:w.colours.border,borderRadius:14,padding:12,gap:8,backgroundColor:w.colours.surface2},children:[(0,S.jsx)(m.T,{weight:"semibold",children:e.plan.title}),(0,S.jsx)(m.T,{size:14,colour:w.colours.muted,children:e.plan.detail}),e.plan.warn?(0,S.jsxs)(m.T,{size:13,colour:w.colours.amber,children:["\u26a0 ",e.plan.warn]}):null,'open'===e.state?(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(m.Button,{small:!0,testID:"chef-confirm",label:e.plan.confirm,onPress:()=>ne(e)}),(0,S.jsx)(m.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ie(e)})]}):(0,S.jsx)(m.Badge,{kind:'done'===e.state?'ok':'neutral',label:'done'===e.state?'Confirmed':'Cancelled: nothing done'}),'open'===e.state?(0,S.jsxs)(m.Muted,{children:["Nothing happens until you tap ",e.plan.confirm,"."]}):null]},e.id):(0,S.jsx)(p.default,{testID:"chef-assistant-reply",style:{alignSelf:'flex-start',maxWidth:'92%',backgroundColor:w.colours.surface2,borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id))]}),(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(t.TextInput,{testID:"chef-assistant-input",accessibilityLabel:"Ask the Assistant",placeholder:"Type a kitchen task\u2026",placeholderTextColor:"#7D776C",value:N,onChangeText:e=>{_(e),e||q(!1)},onSubmitEditing:re,returnKeyType:"send",style:[m.styles.input,{flex:1,minWidth:0,width:40}]}),(0,S.jsx)(u.default,{testID:"chef-assistant-mic",accessibilityRole:"button",accessibilityLabel:V?'Stop listening':'Speak',onPress:()=>{const e=z();if(e)if(V)U.current?.stop?.();else try{const t=new e;U.current=t,t.lang='en-GB',t.interimResults=!1,t.maxAlternatives=1,t.onresult=e=>{const t=e.results?.[0]?.[0]?.transcript;t&&(_(t),q(!0))},t.onend=()=>K(!1),t.onerror=()=>{K(!1),J('Sorry, I didn\u2019t catch that. You can type instead.')},K(!0),t.start()}catch{K(!1),J('Voice input isn\u2019t available here. Please type instead.')}else J('Voice input isn\u2019t available in this browser. Please type instead.')},style:{width:48,height:48,borderRadius:24,borderWidth:1.5,borderColor:w.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:V?w.colours.gold:'transparent'},children:(0,S.jsx)(m.T,{size:20,children:"\ud83c\udfa4"})}),(0,S.jsx)(m.Button,{label:"Send",disabled:!N.trim(),onPress:re})]}),(0,S.jsx)(m.Muted,{center:!0,children:"Every action waits for your Confirm \xb7 nothing is sent, paid or deleted"})]})})})};var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),s=_r(_d[3]),a=_r(_d[4]),o=_r(_d[5]),l=_r(_d[6]),d=_r(_d[7]),c=e(_r(_d[8]));_r(_d[9]);var u=e(_r(_d[10])),h=e(_r(_d[11])),p=e(_r(_d[12])),f=_r(_d[13]),m=_r(_d[14]),b=_r(_d[15]),y=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),v=_r(_d[19]),w=_r(_d[20]),$=_r(_d[21]),C=_r(_d[22]),T=_r(_d[23]),k=_r(_d[24]),S=_r(_d[25]);const I=(0,f.create)(e=>({open:!1,setOpen:t=>e({open:t})})),R=()=>Math.random().toString(36).slice(2,9),P=['Draft a recipe card for crab linguine','Build the fish order','What allergens are in the fish and chips?','What price gives 70% GP on the lobster?','Walk-in fridge 3.5 degrees'],O='The secure AI server: not set up yet',A=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').replace(/\s+/g,' ').trim(),W=new Set(['the','and','with','for','our','house','served','side','of','in','on','from']);function D(e,t,n){const r=` ${A(e)} `;let s,a=0;for(const e of t){const t=A(n(e).replace(/\(example\)/i,'')).split(' ').filter(e=>e.length>2&&!W.has(e)),o=t.filter(e=>r.includes(` ${e} `)||r.includes(` ${e}s `)).length,l=t.length?o/t.length+.01*o:0;o&&l>a&&(s=e,a=l)}return s}function z(){return'undefined'==typeof window?null:(0,l.speechRecognizer)()}},1212,[827,796,1184,835,985,34,932,1170,395,236,402,295,102,846,794,861,1027,867,882,1026,821,1138,1132,1157,933,25]); __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTTOM_TABS_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.BottomTabs=function({tabs:e,active:b,onPress:y,background:x,tablist:p}){const{width:j}=(0,s.default)(),v=j/Math.max(1,e.length),w=v>=60?11:10,I=v<56?20:22,[F,S]=(0,t.useState)({}),[H,_]=(0,t.useState)(0),M=H>0&&e.some(e=>(F[e.id]??0)>H-6),z={flexDirection:'row',flexWrap:'nowrap',alignItems:'stretch',borderTopWidth:1,borderColor:c.colours.border,backgroundColor:x};return(0,f.jsx)(l.default,{testID:"app-bottom-tabs",accessibilityRole:p?'tablist':void 0,style:z,children:e.map(t=>{const s=b===t.id,x=s?c.colours.gold:c.colours.muted;return(0,f.jsxs)(n.default,{onLayout:t===e[0]?e=>_(e.nativeEvent.layout.width):void 0,testID:`tab-${t.id}`,accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:t.a11y??t.label,onPress:()=>y(t.id),style:{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:44,minHeight:h,alignItems:'center',justifyContent:'center',paddingVertical:4,paddingHorizontal:1,gap:2},children:[(0,f.jsxs)(l.default,{style:{width:I,height:I,alignItems:'center',justifyContent:'center'},children:[(0,f.jsx)(u.Icon,{name:t.icon,size:I,colour:x}),t.badge?(0,f.jsx)(l.default,{testID:t.badge.testID,style:{position:'absolute',right:-10,top:-5,backgroundColor:t.badge.bg,borderRadius:8,minWidth:16,height:16,paddingHorizontal:3,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(o.default,{style:{fontFamily:c.fonts.bold,fontSize:10,lineHeight:12,color:t.badge.fg??'#FFFFFF'},children:t.badge.text})}):null]}),(0,f.jsx)(l.default,{pointerEvents:"none","aria-hidden":!0,importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,style:{position:'absolute',left:0,top:0,width:0,height:0,overflow:'hidden',opacity:0},children:(0,f.jsx)(l.default,{style:{width:400,flexDirection:'row',alignItems:'flex-start'},children:(0,f.jsx)(o.default,{onLayout:e=>{const n=Math.ceil(e.nativeEvent.layout.width);S(e=>e[t.id]===n?e:{...e,[t.id]:n})},style:{fontFamily:c.fonts.semibold,fontSize:w,lineHeight:Math.round(1.3*w),flexShrink:0},children:t.short??t.label})})}),M?null:(0,f.jsx)(o.default,{numberOfLines:1,style:{fontFamily:s?c.fonts.semibold:c.fonts.regular,fontSize:w,lineHeight:Math.round(1.3*w),color:x,textAlign:'center',alignSelf:'center',maxWidth:'100%'},children:t.short??t.label})]},t.id)})})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=r(d[5]),u=r(d[6]),f=r(d[7]);const h=56},1213,[34,402,346,102,426,821,1171,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return(0,u.canShow)('chef')?(0,c.jsx)(n.ChefApp,{}):(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]})}},1214,[30,34,792,872,25]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return B}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=(e=r)&&e.__esModule?e:{default:e},u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),S=_r(_d[19]),w=_r(_d[20]),D=_r(_d[21]),T=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]),P=_r(_d[25]),M=_r(_d[26]);function B(){const{rid:e,date:r}=(0,n.useLocalSearchParams)(),B=(0,x.useRestaurant)(e),O=(0,x.useCustomer)(),A=(0,x.useBookings)(e),N=(0,x.useEvents)(e),z=(0,x.useNow)(6e4),[R]=(0,l.useState)(()=>(0,a.startForm)()),[F,I]=(0,l.useState)(''),[q,E]=(0,l.useState)(2),[H,W]=(0,l.useState)(r??(0,k.ymd)(z)),[L,_]=(0,l.useState)(null),[Y,U]=(0,l.useState)(O.name),[G,Q]=(0,l.useState)(O.phone??''),[V,J]=(0,l.useState)(O.email??''),[K,X]=(0,l.useState)(!1),[Z,ee]=(0,l.useState)(''),[te,oe]=(0,l.useState)(!1),[se,ne]=(0,l.useState)([]),[le,ie]=(0,l.useState)(!1),ae=[...O.allergies,...se.filter(e=>!O.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[re,de]=(0,l.useState)(null),ue=(0,D.useBlocks)(e=>e.blocks);(0,j.usePublicDayStore)(e=>e.n);const ce=e?(0,j.publicDay)(e,H):null,he=ce?[...ce.bookings,...A.filter(e=>e.date!==H)]:A,me=ce?[...ue.filter(t=>t.rid!==e||t.date!==H),...ce.blocks]:ue,ge=(0,T.usePlan)(e),[pe,be]=(0,l.useState)((0,$.emptyNeeds)()),fe=!0===pe.dog,ye=fe?pe.dogs:0,ke=(0,l.useMemo)(()=>{const e=[],t=new Date(z);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return r&&!e.some(e=>(0,k.ymd)(e)===r)&&e.push((0,k.parseYmd)(r)),e},[z.toDateString(),r]);if(!B)return(0,M.jsx)(h.Screen,{title:"Not found",children:(0,M.jsx)(h.T,{children:"Restaurant not found."})});const xe=B.settings,je=(0,k.parseYmd)(H),ve=(0,D.blocksOn)(me,B.id,H),Se=he.filter(e=>e.date===H),we=ge.areas.filter(e=>e.dogs),De=(0,P.dogSetUp)(ge),Te=e=>(0,C.freeTablesAt)(ge,Se,q,new Date(`${H}${(0,t.tableNumbers)(e)}:00`),(0,C.turnFor)(q,xe.turnMins),xe.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(me,B.id,H,e)}),Ce=(0,y.bookingSlots)(B,je,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),q,z).map(e=>{const t=(0,D.blockAt)(me,B.id,H,e.time),o=fe&&De&&e.available&&!t&&(!Te(e.time).length||!(0,$.dogTimeOk)(B,he,H,e.time,ye));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),$e=Ce.some(e=>e.available),Pe=(0,u.depositOf)(xe),Me=(0,u.depositDue)(Pe,q),Be=Me>0?'deposit':'none',Oe=(0,u.depositWords)(Pe,q,B.name),Ae=N.filter(e=>e.date===H),Ne=(0,w.ukPhone)(G),ze=(0,w.emailOk)(V),Re=(0,$.needsMissing)(pe,O.allergies),Fe=!!L&&te&&!Re.length&&Y.trim().length>1&&Ne.ok&&ze,Ie=async()=>{const e=(0,$.needsPatch)(pe,O.allergies),t=fe&&De?Te(L).map(e=>e.table):[],o=fe?pe.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await x.repo.bookings.create({restaurantId:B.id,customerId:O.id,name:Y,partySize:q,date:H,time:L,notes:Z.trim(),security:Be,depositPaid:0,...Me?{depositDue:Me,depositPolicy:Oe.join(' '),depositRefundable:Pe.refundable,depositCutoffHours:Pe.cutoffHours}:{},phone:Ne.pretty,email:V.trim()||void 0,source:'online',...e,...Ce.find(e=>e.time===L)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??ae,...o?{table:o}:{}});(0,a.rememberGuard)(s.id,(0,a.guardFor)({...R,hp:F})),de(s)},qe=(0,x.useStore)(e=>re?e.bookings.find(e=>e.id===re.id)?.ref:void 0),Ee=e=>(0,S.waMeLink)(B.settings.whatsapp,(0,S.guestWhatsAppText)({name:e.name,ref:qe??e.ref,date:e.date,time:e.time,partySize:e.partySize},B.name));if(re){const e='pending'===re.status;return(0,M.jsxs)(h.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:B.name,children:[(0,M.jsx)(h.Banner,{kind:e?'info':'success',title:`Reference ${qe??re.ref}`,children:`${re.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(re.date))} at ${re.time}`}),e?(0,M.jsx)(h.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(h.T,{children:["Name: ",re.name]}),(0,M.jsxs)(h.T,{children:["Mobile: ",re.phone]}),re.email?(0,M.jsxs)(h.T,{children:["Email: ",re.email]}):null,(0,M.jsxs)(h.T,{children:["Allergies shared with the restaurant: ",re.allergies.length?re.allergies.map(e=>`${(0,p.allergenLabel)(e.allergen)} (${(0,p.severityLabel)(e.severity)})`).join(', '):'none']}),re.notes?(0,M.jsxs)(h.T,{children:["Notes: ",re.notes]}):null,re.dog?(0,M.jsxs)(h.T,{children:["\ud83d\udc15 Dog coming too",re.table?` \xb7 dog-friendly table ${re.table}`:'']}):null,re.holds?.length?(0,M.jsxs)(h.T,{children:["Reserved: ",re.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(B.settings.reservables??P.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,re.tableReq?.length?(0,M.jsxs)(h.T,{children:["Table requested: ",re.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===re.security&&re.depositDue?(0,M.jsxs)(h.T,{weight:"semibold",children:["Deposit due: ",(0,f.gbp)(re.depositDue),". ",B.name," will tell you how to pay it."]}):null,'deposit'===re.security&&re.depositPolicy?(0,M.jsx)(h.Muted,{children:re.depositPolicy}):null,(0,M.jsx)(h.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,M.jsxs)(h.Muted,{children:["Need to change or cancel? Call ",B.phone," and quote ",qe??re.ref,"."]})]}),Ee(re)?(0,M.jsxs)(d.default,{style:{gap:4},children:[(0,M.jsx)(h.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ee(re);e&&(0,S.openWhatsApp)(e)}}),(0,M.jsx)(h.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,M.jsx)(h.Button,{label:"Back to restaurant",onPress:()=>n.router.replace(`/customer/${B.id}`)})]})}return(0,M.jsxs)(h.Screen,{title:"Book a table",subtitle:B.name,footer:(0,M.jsx)(h.Button,{label:Re.length?Re[0]:q>(xe.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Fe,onPress:()=>Ie(),testID:"confirm-booking"}),children:[(0,M.jsx)($.FirstQuestions,{rid:B.id,value:pe,onChange:e=>{e.dog===pe.dog&&e.dogs===pe.dogs||_(null),be(e)},party:q,audience:"guest",profile:O.allergies}),(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(d.default,{style:{gap:6,alignItems:'center'},children:[(0,M.jsx)(h.H2,{children:"Party size"}),(0,M.jsx)(o.PartySizeInput,{value:q,onChange:e=>{E(e),_(null)},label:"Party size",testID:"party-size"})]}),Me?(0,M.jsx)(h.Banner,{kind:"info",title:`Deposit: ${(0,f.gbp)(Me)} for ${q} guests`,children:(0,M.jsx)(d.default,{style:{gap:4},children:Oe.map(e=>(0,M.jsx)(h.T,{size:13,children:e},e))})}):Pe.on&&Pe.perPersonPence>0?(0,M.jsxs)(h.Muted,{children:["No deposit for fewer than ",Pe.fromParty," guests."]}):null,q>(xe.autoAcceptUpTo??7)?(0,M.jsxs)(h.Muted,{children:["For ",q," people the team checks the booking first, then texts you to confirm."]}):null,fe&&De?(0,M.jsxs)(h.Muted,{children:["Dogs are welcome in the ",we.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",B.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Date"}),(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:ke.map(e=>{const t=!!(0,b.hoursFor)(B,e),o=N.some(t=>t.date===(0,k.ymd)(e));return(0,M.jsx)(h.Chip,{label:(0,k.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:H===(0,k.ymd)(e),onPress:()=>{W((0,k.ymd)(e)),_(null)}},(0,k.ymd)(e))})}),Ae.map(e=>(0,M.jsx)(h.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Time"}),0===Ce.length?(0,M.jsx)(h.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:Ce.map(e=>(0,M.jsx)(h.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left_(e.time)},e.time))}),ve.length>0&&Ce.some(e=>e.blocked)?(0,M.jsx)(h.Banner,{kind:"info",title:$e?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${ve.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(je)}. Please give us a ring on ${B.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,s.lastFoodOn)(B,H);return e&&Ce.some(e=>e.drinksOnly)?(0,M.jsx)(h.Banner,{kind:"info",title:`Last food orders ${(0,s.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),fe&&Ce.some(e=>e.noDog)?(0,M.jsx)(h.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${we.map(e=>e.name).join(' and ')}${B.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,D.closedAreasAt)(me,B.id,H,L??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,M.jsxs)(h.Muted,{children:["Times are every ",(0,y.bookingSlotMinutesOf)(B)," minutes. Covers per slot (",xe.bookingCoversPerSlot," per half hour) and table rules still apply."]})]}),(0,M.jsx)($.MoreQuestions,{rid:B.id,r:B,value:pe,onChange:be,party:q,date:H,time:L,today:(0,k.ymd)(z),bookings:he,audience:"guest",showTables:!0}),(0,M.jsxs)(h.Card,{highlight:te?void 0:v.colours.amber,children:[(0,M.jsx)(h.Field,{label:"Notes (optional)",value:Z,onChangeText:ee,placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,M.jsx)(h.Toggle,{label:"I confirm the allergy information for this booking",value:te,onChange:oe}),(0,M.jsx)(h.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Your details"}),(0,M.jsx)(h.Field,{label:"Name for the booking",value:Y,onChangeText:U}),(0,M.jsx)(h.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:G,onChangeText:Q,onBlur:()=>X(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Ne.ok||!K&&!G?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:Ne.error}),(0,M.jsx)(h.Field,{testID:"book-email",label:"Email (optional)",value:V,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),ze?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,M.jsxs)(h.Muted,{children:["We\u2019ll text you a confirmation",V.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,M.jsx)(i.Honeypot,{value:F,onChange:I})]})}},1215,[860,1114,877,30,34,1216,999,102,14,1124,794,861,878,867,1117,858,874,988,821,1168,864,1018,1021,1095,1119,1091,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return B}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=(e=r)&&e.__esModule?e:{default:e},u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),x=_r(_d[15]),k=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),D=_r(_d[21]),T=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]),P=_r(_d[25]),M=_r(_d[26]);function B(){const{rid:e,date:r}=(0,n.useLocalSearchParams)(),B=(0,k.useRestaurant)(e),A=(0,k.useCustomer)(),O=(0,k.useBookings)(e),N=(0,k.useEvents)(e),z=(0,k.useNow)(6e4),[R]=(0,l.useState)(()=>(0,a.startForm)()),[F,I]=(0,l.useState)(''),[q,L]=(0,l.useState)(2),[H,E]=(0,l.useState)(r??(0,x.ymd)(z)),[W,_]=(0,l.useState)(null),[Y,U]=(0,l.useState)(A.name),[G,Q]=(0,l.useState)(A.phone??''),[V,J]=(0,l.useState)(A.email??''),[K,X]=(0,l.useState)(!1),[Z,ee]=(0,l.useState)(''),[te,oe]=(0,l.useState)(!1),[se,ne]=(0,l.useState)([]),[le,ie]=(0,l.useState)(!1),ae=[...A.allergies,...se.filter(e=>!A.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[re,de]=(0,l.useState)(null),ue=(0,D.useBlocks)(e=>e.blocks);(0,j.usePublicDayStore)(e=>e.n);const ce=e?(0,j.publicDay)(e,H):null,he=ce?[...ce.bookings,...O.filter(e=>e.date!==H)]:O,me=ce?[...ue.filter(t=>t.rid!==e||t.date!==H),...ce.blocks]:ue,ge=(0,T.usePlan)(e),[pe,be]=(0,l.useState)((0,$.emptyNeeds)()),fe=!0===pe.dog,ye=fe?pe.dogs:0,xe=(0,l.useMemo)(()=>{const e=[],t=new Date(z);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return r&&!e.some(e=>(0,x.ymd)(e)===r)&&e.push((0,x.parseYmd)(r)),e},[z.toDateString(),r]);if(!B)return(0,M.jsx)(h.Screen,{title:"Not found",children:(0,M.jsx)(h.T,{children:"Restaurant not found."})});const ke=B.settings,je=(0,x.parseYmd)(H),ve=(0,y.onlinePartyBounds)(B),we=(0,D.blocksOn)(me,B.id,H),Se=he.filter(e=>e.date===H),De=ge.areas.filter(e=>e.dogs),Te=(0,P.dogSetUp)(ge),Ce=e=>(0,C.freeTablesAt)(ge,Se,q,new Date(`${H}${(0,t.tableNumbers)(e)}:00`),(0,C.turnFor)(q,ke.turnMins),ke.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(me,B.id,H,e)}),$e=(0,y.bookingSlots)(B,je,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),q,z,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,D.blockAt)(me,B.id,H,e.time),o=fe&&Te&&e.available&&!t&&(!Ce(e.time).length||!(0,$.dogTimeOk)(B,he,H,e.time,ye));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Pe=$e.some(e=>e.available),Me=(0,u.depositOf)(ke),Be=(0,u.depositDue)(Me,q),Ae=Be>0?'deposit':'none',Oe=(0,u.depositWords)(Me,q,B.name),Ne=N.filter(e=>e.date===H),ze=(0,S.ukPhone)(G),Re=(0,S.emailOk)(V),Fe=(0,$.needsMissing)(pe,A.allergies),Ie=!!W&&te&&!Fe.length&&Y.trim().length>1&&ze.ok&&Re,qe=async()=>{const e=(0,$.needsPatch)(pe,A.allergies),t=fe&&Te?Ce(W).map(e=>e.table):[],o=fe?pe.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await k.repo.bookings.create({restaurantId:B.id,customerId:A.id,name:Y,partySize:q,date:H,time:W,notes:Z.trim(),security:Ae,depositPaid:0,...Be?{depositDue:Be,depositPolicy:Oe.join(' '),depositRefundable:Me.refundable,depositCutoffHours:Me.cutoffHours}:{},phone:ze.pretty,email:V.trim()||void 0,source:'online',...e,...$e.find(e=>e.time===W)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??ae,...o?{table:o}:{}});(0,a.rememberGuard)(s.id,(0,a.guardFor)({...R,hp:F})),de(s)},Le=(0,k.useStore)(e=>re?e.bookings.find(e=>e.id===re.id)?.ref:void 0),He=e=>(0,w.waMeLink)(B.settings.whatsapp,(0,w.guestWhatsAppText)({name:e.name,ref:Le??e.ref,date:e.date,time:e.time,partySize:e.partySize},B.name));if(re){const e='pending'===re.status;return(0,M.jsxs)(h.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:B.name,children:[(0,M.jsx)(h.Banner,{kind:e?'info':'success',title:`Reference ${Le??re.ref}`,children:`${re.partySize} people \xb7 ${(0,x.niceDateYear)((0,x.parseYmd)(re.date))} at ${re.time}`}),e?(0,M.jsx)(h.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(h.T,{children:["Name: ",re.name]}),(0,M.jsxs)(h.T,{children:["Mobile: ",re.phone]}),re.email?(0,M.jsxs)(h.T,{children:["Email: ",re.email]}):null,(0,M.jsxs)(h.T,{children:["Allergies shared with the restaurant: ",re.allergies.length?re.allergies.map(e=>`${(0,p.allergenLabel)(e.allergen)} (${(0,p.severityLabel)(e.severity)})`).join(', '):'none']}),re.notes?(0,M.jsxs)(h.T,{children:["Notes: ",re.notes]}):null,re.dog?(0,M.jsxs)(h.T,{children:["\ud83d\udc15 Dog coming too",re.table?` \xb7 dog-friendly table ${re.table}`:'']}):null,re.holds?.length?(0,M.jsxs)(h.T,{children:["Reserved: ",re.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(B.settings.reservables??P.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,re.tableReq?.length?(0,M.jsxs)(h.T,{children:["Table requested: ",re.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===re.security&&re.depositDue?(0,M.jsxs)(h.T,{weight:"semibold",children:["Deposit due: ",(0,f.gbp)(re.depositDue),". ",B.name," will tell you how to pay it."]}):null,'deposit'===re.security&&re.depositPolicy?(0,M.jsx)(h.Muted,{children:re.depositPolicy}):null,(0,M.jsx)(h.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,M.jsxs)(h.Muted,{children:["Need to change or cancel? Call ",B.phone," and quote ",Le??re.ref,"."]})]}),He(re)?(0,M.jsxs)(d.default,{style:{gap:4},children:[(0,M.jsx)(h.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=He(re);e&&(0,w.openWhatsApp)(e)}}),(0,M.jsx)(h.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,M.jsx)(h.Button,{label:"Back to restaurant",onPress:()=>n.router.replace(`/customer/${B.id}`)})]})}return(0,M.jsxs)(h.Screen,{title:"Book a table",subtitle:B.name,footer:(0,M.jsx)(h.Button,{label:Fe.length?Fe[0]:q>(ke.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Ie,onPress:()=>qe(),testID:"confirm-booking"}),children:[(0,M.jsx)($.FirstQuestions,{rid:B.id,value:pe,onChange:e=>{e.dog===pe.dog&&e.dogs===pe.dogs||_(null),be(e)},party:q,audience:"guest",profile:A.allergies}),(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(d.default,{style:{gap:6,alignItems:'center'},children:[(0,M.jsx)(h.H2,{children:"Party size"}),(0,M.jsx)(o.PartySizeInput,{value:q,onChange:e=>{L(e),_(null)},min:ve.min,max:ve.max,label:"Party size",testID:"party-size"})]}),Be?(0,M.jsx)(h.Banner,{kind:"info",title:`Deposit: ${(0,f.gbp)(Be)} for ${q} guests`,children:(0,M.jsx)(d.default,{style:{gap:4},children:Oe.map(e=>(0,M.jsx)(h.T,{size:13,children:e},e))})}):Me.on&&Me.perPersonPence>0?(0,M.jsxs)(h.Muted,{children:["No deposit for fewer than ",Me.fromParty," guests."]}):null,q>(ke.autoAcceptUpTo??7)?(0,M.jsxs)(h.Muted,{children:["For ",q," people the team checks the booking first, then texts you to confirm."]}):null,fe&&Te?(0,M.jsxs)(h.Muted,{children:["Dogs are welcome in the ",De.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",B.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Date"}),(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:xe.map(e=>{const t=!!(0,b.hoursFor)(B,e),o=N.some(t=>t.date===(0,x.ymd)(e));return(0,M.jsx)(h.Chip,{label:(0,x.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:H===(0,x.ymd)(e),onPress:()=>{E((0,x.ymd)(e)),_(null)}},(0,x.ymd)(e))})}),Ne.map(e=>(0,M.jsx)(h.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Time"}),0===$e.length?(0,M.jsx)(h.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:$e.map(e=>(0,M.jsx)(h.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left_(e.time)},e.time))}),we.length>0&&$e.some(e=>e.blocked)?(0,M.jsx)(h.Banner,{kind:"info",title:Pe?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${we.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,x.niceDate)(je)}. Please give us a ring on ${B.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,s.lastFoodOn)(B,H);return e&&$e.some(e=>e.drinksOnly)?(0,M.jsx)(h.Banner,{kind:"info",title:`Last food orders ${(0,s.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),fe&&$e.some(e=>e.noDog)?(0,M.jsx)(h.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${De.map(e=>e.name).join(' and ')}${B.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,D.closedAreasAt)(me,B.id,H,W??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,M.jsx)(h.Muted,{children:(0,y.bookingLimitsHint)(B)})]}),(0,M.jsx)($.MoreQuestions,{rid:B.id,r:B,value:pe,onChange:be,party:q,date:H,time:W,today:(0,x.ymd)(z),bookings:he,audience:"guest",showTables:!0}),(0,M.jsxs)(h.Card,{highlight:te?void 0:v.colours.amber,children:[(0,M.jsx)(h.Field,{label:"Notes (optional)",value:Z,onChangeText:ee,placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,M.jsx)(h.Toggle,{label:"I confirm the allergy information for this booking",value:te,onChange:oe}),(0,M.jsx)(h.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Your details"}),(0,M.jsx)(h.Field,{label:"Name for the booking",value:Y,onChangeText:U}),(0,M.jsx)(h.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:G,onChangeText:Q,onBlur:()=>X(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),ze.ok||!K&&!G?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:ze.error}),(0,M.jsx)(h.Field,{testID:"book-email",label:"Email (optional)",value:V,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Re?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,M.jsxs)(h.Muted,{children:["We\u2019ll text you a confirmation",V.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,M.jsx)(i.Honeypot,{value:F,onChange:I})]})}},1215,[860,1114,877,30,34,1216,999,102,14,1124,794,861,878,867,1117,858,874,988,821,1168,864,1018,1021,1095,1119,1091,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Honeypot=function({value:t,onChange:n}){return(0,l.jsx)(o.default,{"aria-hidden":!0,pointerEvents:"none",style:{position:'absolute',left:-1e4,top:0,width:1,height:1,overflow:'hidden',opacity:0},children:(0,l.jsx)(e.TextInput,{testID:"hp-field",accessibilityLabel:"Leave this empty",value:t,onChangeText:n,tabIndex:-1,autoComplete:'off',name:'cc_extra_info','aria-hidden':!0})})};var e=r(d[0]);r(d[1]),r(d[2]);var t,n=r(d[3]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[4])},1216,[827,34,236,102,25]); __d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var t=_r(_d[0]),n=_r(_d[1]),l=e(_r(_d[2])),s=e(_r(_d[3])),r=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]);function f(){const{rid:e,did:f}=(0,t.useLocalSearchParams)(),b=(0,u.useRestaurant)(e),j=(0,u.useMenu)(e).find(e=>e.id===f),x=(0,u.useCustomer)(),m=(0,u.useRecipeCards)(e).find(e=>e.id===j?.recipeCardId),y=m?.signOff&&m.photo?(0,h.recipeCards)().photoSource(m.photo):null,k=(0,u.useStore)(e=>e.addLine),[v,w]=(0,n.useState)(()=>(j?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[S,C]=(0,n.useState)(1),[B,$]=(0,n.useState)(''),[I,P]=(0,n.useState)(!1),[L,T]=(0,n.useState)(!1),[D,O]=(0,n.useState)(!1),[A,M]=(0,n.useState)(!1),R=(0,n.useMemo)(()=>j?(0,d.effectiveAllergens)(j,v):{},[j,v]);if(!b||!j)return(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Dish not found."})});const q=(0,d.conflictsFor)(R,x.allergies),_=(j.price??0)+(j.optionGroups??[]).flatMap(e=>e.choices).filter(e=>v.includes(e.id)).reduce((e,t)=>e+t.priceDelta,0),N=j.soldOut||!j.signOff||null===j.price,G=(e,t)=>{const n=j.optionGroups.find(t=>t.id===e);w(e=>{const l=n.choices.map(e=>e.id);return n.multi?e.includes(t)?e.filter(e=>e!==t):[...e,t]:e.includes(t)&&!n.required?e.filter(e=>e!==t):[...e.filter(e=>!l.includes(e)),t]})},z=e=>{u.useStore.getState().basket.restaurantId!==b.id&&u.useStore.getState().startBasket(b.id,'takeaway'),k({itemId:j.id,qty:S,choiceIds:v,notes:B,override:e?{allergens:q.contains,at:(new Date).toISOString()}:void 0}),P(!1),M(!0)};return(0,p.jsxs)(o.Screen,{title:j.name,subtitle:b.name,right:(0,p.jsx)(a.BasketButton,{}),children:[y?(0,p.jsx)(l.default,{testID:"dish-photo",source:y,accessibilityLabel:`${j.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.T,{weight:"bold",size:20,colour:g.colours.gold,children:null===j.price?j.priceNote:(0,c.gbp)(_)}),j.dietary.map(e=>(0,p.jsx)(o.Badge,{kind:"ok",label:e},e))]}),(0,p.jsx)(o.T,{children:j.description}),q.contains.length?(0,p.jsx)(o.Banner,{kind:"danger",title:`Blocked: contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,q.may.length?(0,p.jsx)(o.Banner,{kind:"warn",title:`Warning: may contain ${q.may.map(d.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(j.optionGroups??[]).map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:e.choices.map(t=>(0,p.jsx)(o.Chip,{label:t.label,sub:t.priceDelta?`+${(0,c.gbp)(t.priceDelta)}`:void 0,selected:v.includes(t.id),onPress:()=>G(e.id,t.id)},t.id))})]},e.id)),(0,p.jsx)(o.Card,{children:(0,p.jsx)(r.AllergenPanel,{item:j,map:R,declared:x.allergies})}),b.fictional?null:(0,p.jsx)(o.ExampleAllergenNotice,{}),(0,p.jsx)(o.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:B,onChangeText:$}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Quantity"}),(0,p.jsx)(o.Stepper,{value:S,onChange:C,label:"quantity"})]}),A?(0,p.jsx)(o.Banner,{kind:"success",title:"Added to basket",children:q.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,N?(0,p.jsx)(o.Banner,{kind:"warn",children:j.soldOut?'Sold out today.':j.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):q.contains.length?(0,p.jsxs)(s.default,{style:{gap:8},children:[(0,p.jsx)(o.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,p.jsx)(o.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{T(!1),O(!1),P(!0)},testID:"override-open"})]}):(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{style:{flex:1},label:`Add ${S} to basket \xb7 ${(0,c.gbp)(_*S)}`,onPress:()=>z(!1),testID:"add-to-basket"}),A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,p.jsxs)(o.Sheet,{visible:I,onClose:()=>P(!1),title:"Allergy override",children:[(0,p.jsx)(o.Banner,{kind:"danger",title:`${j.name} contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`Your profile says: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}.`}),(0,p.jsx)(o.Toggle,{label:"I understand this dish contains an allergen I have declared",value:L,onChange:T}),(0,p.jsx)(o.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:D,onChange:O}),(0,p.jsx)(o.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,p.jsx)(o.Button,{kind:"danger",disabled:!L||!D,label:"Confirm override and add",onPress:()=>z(!0),testID:"override-confirm"})]})]})}},1217,[30,34,336,102,1192,1218,794,861,867,874,882,821,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BasketButton=function(){const s=(0,l.useBasket)().lines.reduce((e,s)=>e+s.qty,0);return s?(0,c.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:`Basket, ${s} items`,onPress:()=>e.router.push('/customer/basket'),style:{backgroundColor:u.colours.gold,borderRadius:999,paddingHorizontal:12,paddingVertical:6},children:(0,c.jsxs)(n.T,{weight:"semibold",colour:u.colours.onGold,size:14,children:["Basket \xb7 ",s]})}):null};var e=r(d[0]);r(d[1]);var s,t=r(d[2]),o=(s=t)&&s.__esModule?s:{default:s},l=r(d[3]),u=r(d[4]),n=r(d[5]),c=r(d[6])},1218,[30,34,402,874,821,794,25]); @@ -1450,7 +1450,7 @@ __d(function(g,_r,i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModul __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.WipeDevice=function({compact:e}){const f=(0,u.useDisplaySettings)(p.VENUE_RID),[v,T]=(0,s.useState)(!1),[w,j]=(0,s.useState)(''),[D,C]=(0,s.useState)(!1),I='display'===h.APP_VARIANT&&f.pinOn,P=!I||(0,b.wakePinMatches)(f,w);return v?(0,x.jsxs)(o.default,{testID:"wipe-confirm-box",style:{gap:6,marginTop:6},children:[(0,x.jsx)(l.T,{size:e?12:14,children:"Sign out and remove everything CoverCharge keeps on this device: sign-ins, pairing, saved screens and any changes not sent yet. The venue\u2019s shared data is not touched. To use it again, open a personal link or pair the Display again."}),I?(0,x.jsx)(t.TextInput,{testID:"wipe-pin",value:w,onChangeText:j,placeholder:"Display wake PIN",placeholderTextColor:c.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display wake PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:c.colours.text}}):null,(0,x.jsxs)(o.default,{style:{flexDirection:'row',gap:8},children:[(0,x.jsx)(n.default,{testID:"wipe-confirm",accessibilityRole:"button",accessibilityLabel:"Yes, wipe this device",disabled:!P||D,onPress:()=>{C(!0),(0,y.wipeThisDevice)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:P?c.colours.red:'rgba(255,255,255,0.08)'},children:(0,x.jsx)(l.T,{size:12,weight:"semibold",children:D?'Wiping\u2026':'Yes, wipe this device'})}),(0,x.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:()=>{T(!1),j('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,x.jsx)(l.T,{size:12,children:"Cancel"})})]})]}):(0,x.jsx)(n.default,{testID:"wipe-device",accessibilityRole:"button",accessibilityLabel:"Sign out and wipe this device",onPress:()=>T(!0),style:{alignSelf:'flex-start',marginTop:e?4:0,minHeight:44,justifyContent:'center'},children:(0,x.jsx)(l.T,{size:e?12:14,colour:c.colours.gold,children:"Sign out and wipe this device\u2026"})})};var t=r(d[0]),s=r(d[1]),n=e(r(d[2])),o=e(r(d[3])),l=r(d[4]),c=r(d[5]),u=r(d[6]),p=r(d[7]),b=r(d[8]),h=r(d[9]),y=r(d[10]),x=r(d[11])},1367,[827,34,402,102,794,821,1021,5,1022,872,988,25]); __d(function(g,r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.PlanPhoto=function({rid:e}){const t=(0,n.usePlan)(e),b=(0,n.useFloor)(e=>e.setPlan),[y,f]=(0,a.useState)(null),[x,w]=(0,a.useState)(null),[v,j]=(0,a.useState)(null),[k,S]=(0,a.useState)(''),[P,T]=(0,a.useState)(!1),I=async e=>{let a;T(!0);try{const{data:t,error:l}=await(0,u.getSupabase)().functions.invoke('plan-photo-read',{body:{image:e}});a=l?{ok:!1,message:'The plan could not be read. The photo is still here.'}:{ok:!0,tables:(0,o.cleanFindings)(t)}}catch{a={ok:!1,message:'The plan could not be read. The photo is still here.'}}finally{T(!1)}const t=(0,o.planReadAfter)(e,a);w(t.photo),f(t.rows&&t.rows.length?t.rows:null),S(t.note)},L=async()=>{S('');const e=(await(0,c.pickPhotos)({source:'camera'}))[0];e?(w(e),await I(e)):S('No photo taken.')};return(0,p.jsxs)(l.default,{testID:"plan-photo",style:{width:'100%',alignItems:'center',gap:10},children:[(0,p.jsx)(s.Button,{testID:"plan-photo-camera",label:P?'Reading the plan\u2026':'Take a picture of the table plan',accessibilityLabel:"Take a picture of a hand-drawn table plan",disabled:P,onPress:()=>{L()}}),k?(0,p.jsx)(s.Muted,{center:!0,testID:"plan-photo-note",children:k}):null,x&&!P?(0,p.jsx)(s.Button,{kind:"ghost",testID:"plan-photo-retry",label:"Read this photo again",accessibilityLabel:"Read this photo again",onPress:()=>{I(x)}}):null,y?(0,p.jsx)(l.default,{testID:"plan-photo-review",style:{width:'100%'},children:(0,p.jsxs)(s.Card,{style:{alignItems:'center',width:'100%'},children:[(0,p.jsx)(s.T,{center:!0,weight:"bold",colour:h.colours.gold,children:"Check what was read"}),(0,p.jsx)(s.Muted,{center:!0,children:"Nothing is saved until you tap Save the plan."}),y.map((e,a)=>(0,p.jsxs)(l.default,{style:{width:'100%',gap:6},children:[(0,p.jsx)(s.Field,{label:"Area",accessibilityLabel:`Area ${a+1}`,value:e.area,onChangeText:e=>f(y.map((t,l)=>l===a?{...t,area:e}:t))}),(0,p.jsx)(s.Field,{label:"Table",accessibilityLabel:`Table ${a+1}`,value:e.name,onChangeText:e=>f(y.map((t,l)=>l===a?{...t,name:e}:t))}),(0,p.jsx)(s.Field,{label:"Seats",accessibilityLabel:`Seats at table ${a+1}`,value:String(e.seats),keyboardType:"number-pad",onChangeText:e=>f(y.map((t,l)=>l===a?{...t,seats:Math.max(1,Math.min(30,Number(e.replace(/\D/g,''))||1))}:t))}),(0,p.jsx)(s.Button,{kind:"ghost",label:`Remove ${e.name||'table'}`,accessibilityLabel:`Remove ${e.name||'table'}`,onPress:()=>f(y.filter((e,t)=>t!==a))})]},`${e.area}-${e.name}-${a}`)),(0,p.jsx)(s.Button,{testID:"plan-photo-save",label:"Save the plan",accessibilityLabel:"Save the checked table plan",disabled:!y.length,onPress:()=>{if(!y?.length)return;j(t);const a=[...t.areas],l=[...t.tables];for(const e of y){let t=a.find(a=>a.name.toLowerCase()===e.area.toLowerCase());t||(t={id:(0,i.fid)('area'),name:e.area},a.push(t));const s=(0,i.sizeFor)(e.seats),n=l.filter(e=>e.areaId===t.id).length;l.push({id:(0,i.fid)('t'),name:e.name,areaId:t.id,shape:s.shape,minSeats:1,maxSeats:e.seats,x:40+n%6*140,y:40+120*Math.floor(n/6),w:s.w,h:s.h,rot:0,online:!0})}b(e,{...t,areas:a,tables:l}),f(null),S('Plan saved. Undo puts the previous plan back.')}})]})}):null,v?(0,p.jsx)(s.Button,{kind:"ghost",testID:"plan-photo-undo",label:"Undo table plan",accessibilityLabel:"Undo the table plan and restore the previous one",onPress:()=>{b(e,v),j(null),S('Previous plan restored.')}}):null]})};var e,a=r(d[0]),t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},s=r(d[2]),n=r(d[3]),o=r(d[4]),i=r(d[5]),h=r(d[6]),c=r(d[7]),u=r(d[8]),p=r(d[9])},1368,[34,102,794,1021,1369,859,821,1066,934,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.planReadAfter=function(t,o){return o.ok?o.tables.length?{photo:t,rows:o.tables,note:''}:{photo:t,rows:[],note:'Nothing readable on that photo. The photo is still here.'}:{photo:t,rows:null,note:o.message}},e.cleanFindings=function(o){if(!o||'object'!=typeof o)return[];const n=o.tables;if(!Array.isArray(n))return[];const s=[];for(const o of n.slice(0,80)){if(!o||'object'!=typeof o)continue;const n=t(o.area,40),c=t(o.name,12),l=o.seats;!n||!c||'number'!=typeof l||!Number.isInteger(l)||l<1||l>30||s.push({area:n,name:c,seats:l})}return s};const t=(t,o)=>'string'==typeof t?t.trim().slice(0,o):''},1369,[]); -__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:n}=(0,l.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[b,h]=(0,t.useState)(String(e.settings.turnMins??'')),[y,v]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[f,k]=(0,t.useState)(!1),M=(e,t,n)=>c(s=>({...s,[e]:0===t?[n,s[e]?.[1]??'']:[s[e]?.[0]??'',n]})),S=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(b)<=360&&Number(y)>=1&&Number(y)<=1e3;return(0,r.jsxs)(s.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(n=>({...n,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>M(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>M(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:b,onChangeText:h,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:y,onChangeText:v,keyboardType:"number-pad"})]}),(0,r.jsx)(i.Button,{label:f?'Saving\u2026':'Save booking times',disabled:!S||f,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{k(!0);try{await(0,o.saveStaffBookingTimes)(n,u,Number(b),Number(y)),j('Booking times saved.')}catch(e){j(e.message)}finally{k(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),n=_r(_d[1]),s=(e=n)&&e.__esModule?e:{default:e},i=_r(_d[2]),l=_r(_d[3]),o=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1370,[34,102,794,1079,988,25]); +__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:s}=(0,o.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[h,b]=(0,t.useState)(String(e.settings.turnMins??'')),[v,y]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[k,S]=(0,t.useState)(!1),f=(e,t,s)=>c(n=>({...n,[e]:0===t?[s,n[e]?.[1]??'']:[n[e]?.[0]??'',s]})),p=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(h)<=360&&Number(v)>=1&&Number(v)<=1e3;return(0,r.jsxs)(n.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(s=>({...s,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>f(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>f(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:h,onChangeText:b,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:v,onChangeText:y,keyboardType:"number-pad"}),e.settings.bookingCoversPerStart||e.settings.bookingPartiesPerStart?(0,r.jsx)(i.Muted,{center:!0,children:"Online booking uses the covers and bookings caps at each start time (Settings \u203a Capacity & waitlist), not this half-hour figure."}):null]}),(0,r.jsx)(i.Button,{label:k?'Saving\u2026':'Save booking times',disabled:!p||k,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{S(!0);try{await(0,l.saveStaffBookingTimes)(s,u,Number(h),Number(v)),j('Booking times saved.')}catch(e){j(e.message)}finally{S(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),s=_r(_d[1]),n=(e=s)&&e.__esModule?e:{default:e},i=_r(_d[2]),o=_r(_d[3]),l=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1370,[34,102,794,1079,988,25]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffTableOrders=function({rid:e,me:l}){const p=(0,c.useOrderAtTable)(e),x=(0,c.useNow)(15e3),f=(0,c.useStore)(e=>e.bookings),w=(0,c.useOrders)(e).filter(i.isTableQr).sort((e,t)=>t.createdAt.localeCompare(e.createdAt)),S=w.filter(i.waitingForStaff),y=w.filter(e=>m(e)&&!(0,i.waitingForStaff)(e)),v=w.filter(e=>!m(e)).slice(0,8),[k,T]=(0,s.useState)(null),[$,B]=(0,s.useState)(null),M=e=>{c.repo.orders.accept(e.id,l),B(`${e.ref} accepted for table ${(0,t.tableNumbers)(e.tableNo)}: it's gone to the kitchen.`)},N=e=>{const t=(0,h.statusBlock)(e,'served',(0,h.linkedBooking)(e,f));if(t)return void B(`${e.ref}: ${t}`);const s=(new Date).toISOString();c.useStore.setState(t=>({orders:t.orders.map(t=>t.id===e.id?{...t,servedBy:{by:l,at:s}}:t)})),c.useStore.getState().setOrderStatus(e.id,'served',l),B(`${e.ref} marked served.`)},O=(e,t)=>{const s=(new Date).toISOString();c.useStore.setState(r=>({orders:r.orders.map(r=>r.id===e.id?{...r,cancelReason:t,cancelledBy:{by:l,at:s}}:r)})),c.useStore.getState().setOrderStatus(e.id,'cancelled',l),T(null),B(`${e.ref} cancelled (${t}). The guest's phone shows the reason.`)},A=({o:e,held:s})=>(0,b.jsxs)(a.Card,{highlight:s?u.colours.amber:e.allergies.length?u.colours.red:u.colours.gold,children:[(0,b.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,b.jsxs)(a.T,{weight:"semibold",children:["Table ",(0,t.tableNumbers)(e.tableNo)," \xb7 ",e.ref]}),(0,b.jsx)(a.Badge,{kind:s?'amber':'cancelled'===e.status?'neutral':'gold',label:s?'Waiting for you':'served'===e.status?'Served':'cancelled'===e.status?'Cancelled':'In the kitchen'})]}),(0,b.jsxs)(a.Muted,{children:[e.customerName," \xb7 ",j(e.createdAt,x),e.accepted?` \xb7 accepted by ${e.accepted.by}`:'']}),e.lines.map((e,t)=>(0,b.jsxs)(a.T,{children:[e.qty,"\xd7 ",e.name,e.notes?` (note: ${e.notes})`:'']},t)),e.allergies.length?(0,b.jsx)(a.Row,{wrap:!0,gap:6,children:e.allergies.map(e=>(0,b.jsx)(a.Badge,{kind:"red",label:`${(0,n.allergenLabel)(e.allergen)}: ${(0,n.severityLabel)(e.severity)}`},e.allergen))}):(0,b.jsx)(a.Muted,{children:"No allergies declared."}),e.notes?(0,b.jsxs)(a.T,{size:13,children:["Note: ",e.notes]}):null,(0,b.jsxs)(a.T,{size:13,colour:u.colours.muted,children:[(0,o.gbp)(e.total)," to pay at the bar or with the server"]}),'cancelled'===e.status&&e.cancelReason?(0,b.jsxs)(a.Muted,{children:["Reason: ",e.cancelReason]}):null,m(e)?k===e.id?(0,b.jsxs)(r.default,{style:{gap:6},children:[(0,b.jsx)(a.T,{size:13,children:"Why are you cancelling? The guest sees this."}),(0,b.jsx)(a.Row,{wrap:!0,gap:6,children:i.CANCEL_REASONS.map(t=>(0,b.jsx)(a.Chip,{label:t,onPress:()=>O(e,t)},t))}),(0,b.jsx)(a.Button,{small:!0,kind:"ghost",label:"Don't cancel",onPress:()=>T(null)})]}):(0,b.jsxs)(a.Row,{gap:8,wrap:!0,children:[s?(0,b.jsx)(a.Button,{small:!0,label:"Accept",testID:`accept-${e.ref}`,onPress:()=>M(e)}):(0,b.jsx)(a.Button,{small:!0,label:"Mark served",testID:`served-${e.ref}`,onPress:()=>N(e)}),(0,b.jsx)(a.Button,{small:!0,kind:"secondary",label:"Cancel with a reason",onPress:()=>T(e.id)})]}):null]});return(0,b.jsxs)(r.default,{style:{gap:10},children:[(0,b.jsx)(a.Muted,{children:"Tip: orders from guests' phones land here within seconds. Accept the first one from a new phone, check allergies, then mark it served. Guests pay at the bar or with their server."}),p?null:(0,b.jsx)(a.Banner,{kind:"demo",title:"Order at the table is off",children:"Managers can switch it on in Settings \u203a Advanced \u203a Order at the table."}),$?(0,b.jsx)(a.Banner,{kind:"success",children:$}):null,(0,b.jsxs)(a.T,{weight:"semibold",children:["Waiting for you to accept (",S.length,")"]}),S.length?S.map(e=>(0,b.jsx)(A,{o:e,held:!0},e.id)):(0,b.jsx)(a.Muted,{children:"Nothing waiting."}),(0,b.jsxs)(a.T,{weight:"semibold",children:["In the kitchen (",y.length,")"]}),y.length?y.map(e=>(0,b.jsx)(A,{o:e,held:!1},e.id)):(0,b.jsx)(a.Muted,{children:"No table orders being made."}),v.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a.T,{weight:"semibold",children:"Served or cancelled"}),v.map(e=>(0,b.jsx)(A,{o:e,held:!1},e.id))]}):null]})};var e,t=_r(d[0]),s=_r(d[1]),l=_r(d[2]),r=(e=l)&&e.__esModule?e:{default:e},a=_r(d[3]),n=_r(d[4]),o=_r(d[5]),i=_r(d[6]),c=_r(d[7]),h=_r(d[8]),u=_r(d[9]),b=_r(d[10]);const j=(e,t)=>{const s=Math.max(0,Math.round((t.getTime()-new Date(e).getTime())/6e4));return s<1?'just now':`${s} min ago`},m=e=>!['served','collected','closed','cancelled'].includes(e.status)},1371,[860,34,102,794,861,867,1148,874,869,821,25]); __d(function(g,_r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.customerCodeLink=y,_e.StaffLoyalty=function({venue:e,canRemove:r=!1,onOpenSettings:u}){const[p,x]=(0,t.useState)(null),[y,b]=(0,t.useState)(''),[S,k]=(0,t.useState)(null),[v,C]=(0,t.useState)(null),[M,T]=(0,t.useState)(!1),[B,R]=(0,t.useState)(''),[P,O]=(0,t.useState)(null),$=(0,c.staffServer)(),L=(0,n.can)('venue.settings'),[N,E]=(0,t.useState)(!1),[D,A]=(0,t.useState)(''),F=async e=>{if(p){E(!0),A('');try{await(0,c.saveSettings)({...p,cardOn:e}),x({...p,cardOn:e,saved:!0});const n=e?'Stamp card switched on':'Stamp card switched off';A(n),s.default.announceForAccessibility?.(n)}catch(e){R((0,o.plainError)(e))}E(!1)}},I=(0,t.useCallback)(()=>{$&&(0,c.readSettings)().then(x).catch(()=>{})},[$]);(0,t.useEffect)(()=>(I(),(0,c.watchLoyalty)(()=>{I(),C(e=>(e&&(0,c.staffCard)(e.id).then(C).catch(()=>{}),e))})),[I]);const _=async(e=y)=>{R('');try{const n=await(0,c.staffFind)(e);k(n),1===n.length&&C(n[0])}catch(e){R((0,o.plainError)(e))}},z=(0,t.useCallback)(e=>{T(!1),b((0,o.prettyCardNo)(e)),_(e)},[]);return $?(0,m.jsxs)(l.default,{style:{gap:10},children:[!p||p.cardOn||L?null:(0,m.jsx)(i.Banner,{kind:"info",title:"The stamp card is off",children:"Ask a manager to switch it on."}),p&&L?(0,m.jsx)(i.Card,{children:(0,m.jsxs)(l.default,{style:{gap:8},testID:"loy-quick",children:[p.cardOn?null:(0,m.jsx)(i.T,{weight:"semibold",children:"The stamp card is off"}),(0,m.jsx)(i.Toggle,{testID:"loy-quick-on",label:"Stamp card on",a11y:"Stamp card on. "+(p.cardOn?'On':'Off'),value:p.cardOn,disabled:N,onChange:e=>{F(e)}}),D?(0,m.jsx)(l.default,{accessibilityLiveRegion:"polite",children:(0,m.jsx)(i.Muted,{children:D})}):null,u?(0,m.jsx)(i.Button,{kind:"ghost",label:"Change the stamp card",testID:"loy-open-settings",onPress:u}):null]})}):null,p&&p.saved?(0,m.jsxs)(i.Muted,{children:[p.stampsNeeded," stamps = ",p.reward||'reward not set',". At most ",p.maxPerDay," a day",p.gapMinutes?`, ${p.gapMinutes} minutes apart`:'',"."]}):null,p&&!p.saved&&L?(0,m.jsxs)(i.Muted,{children:["Suggested settings, not saved yet: ",p.stampsNeeded," stamps = ",p.reward||'reward not set',". At most ",p.maxPerDay," a day",p.gapMinutes?`, ${p.gapMinutes} minutes apart`:'',"."]}):null,(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Find a guest"}),(0,m.jsx)(i.Field,{label:"Name, phone, email or card number",value:y,onChangeText:b,onSubmitEditing:()=>_(),autoCapitalize:"none",testID:"loyalty-search"}),(0,m.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(i.Button,{small:!0,label:"Find",disabled:y.trim().length<2,onPress:()=>_(),testID:"loyalty-find"}),(0,h.canScan)()?(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:M?'Scanning\u2026':'Scan their card',onPress:()=>T(!0)}):null]}),M?(0,m.jsx)(h.CardScanner,{onCard:z,onClose:()=>T(!1)}):null,B?(0,m.jsx)(i.Banner,{kind:"warn",children:B}):null,S&&!S.length?(0,m.jsx)(i.Muted,{children:"No one found. Check the spelling, or sign them up below."}):null,S&&S.length>1?S.map(e=>(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{children:e.name}),(0,m.jsxs)(i.Muted,{children:[(0,o.prettyCardNo)(e.cardNo)," \xb7 ",e.stamps," of ",e.needed,e.phone?` \xb7 ${e.phone}`:'']})]}),e.rewards.length?(0,m.jsx)(i.Badge,{kind:"gold",label:`${e.rewards.length} ready`}):null,(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Open",onPress:()=>C(e)})]},e.id)):null]}),v?(0,m.jsx)(f,{card:v,settings:p,canRemove:r,onChange:e=>{C(e),k(null)},onClose:()=>C(null)}):null,(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Stamp code"}),(0,m.jsx)(i.Muted,{children:"Busy? Make a one-time code and show it to the guest; they type it (or scan it) on their own phone for one stamp."}),P?(0,m.jsx)(j,{c:P,what:"One stamp."}):null,(0,m.jsx)(i.Button,{kind:"secondary",label:P?'Make another code':'Make a stamp code',disabled:!1===p?.cardOn,onPress:()=>{R(''),(0,c.staffCode)('stamp').then(O).catch(e=>R((0,o.plainError)(e)))}})]}),(0,m.jsx)(w,{venue:e,onJoined:e=>{C(e),k(null)}}),(0,m.jsx)(i.Muted,{children:"Tip: search by the last 4 digits of a phone number. Each reward can only be used once, and the card shows who used it and when."})]}):(0,m.jsxs)(l.default,{style:{gap:10},children:[(0,m.jsx)(i.Banner,{kind:"info",title:"Connect to your venue first",children:"The stamp card is saved on your venue's account. Open your invite link on this phone to connect, then you can find guests and add stamps here."}),(0,m.jsx)(i.Muted,{children:"Tip: stamps can only be added by staff of the venue, so a guest can't stamp their own card."})]})};var n=_r(d[0]),t=_r(d[1]),s=e(_r(d[2]));_r(d[3]);var l=e(_r(d[4])),r=_r(d[5]),i=_r(d[6]),o=_r(d[7]),c=_r(d[8]),u=_r(d[9]),h=_r(d[10]),m=_r(d[11]);const p=e=>{try{return new Date(e).toLocaleString('en-GB',{day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})}catch{return e}},x=e=>{try{return new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})}catch{return''}};function y(e){if('undefined'==typeof window||!window.location)return e;const n=window.location.pathname.match(/^(.*?)\/(owner|staff|customer|display|chef)-app(\/|$)/);return new URL(`${n?n[1]:''}/customer-app/index.html?loyalty=${e}`,window.location.origin).toString()}function j({c:e,what:n}){return(0,m.jsxs)(l.default,{style:{gap:4,alignItems:'center'},children:[(0,m.jsx)(i.T,{size:34,weight:"bold",colour:u.colours.gold,center:!0,children:e.code}),(0,m.jsx)(r.QR,{value:y(e.code),size:150}),(0,m.jsxs)(i.Muted,{center:!0,children:[n," Works once, until ",x(e.expiresAt),". The guest types it in Stamp card, or scans this with their phone camera."]})]})}function f({card:e,settings:n,canRemove:s,onChange:r,onClose:h}){const[x,y]=(0,t.useState)(null),[f,w]=(0,t.useState)(!1),[b,S]=(0,t.useState)(null),[k,v]=(0,t.useState)(null),C=async e=>{w(!0),y(null);try{await e()}catch(e){y({kind:'warn',text:(0,o.plainError)(e)})}finally{w(!1),S(null)}};return(0,m.jsxs)(i.Card,{highlight:u.colours.gold,children:[(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.H2,{children:e.name}),(0,m.jsxs)(i.Muted,{children:["Card ",(0,o.prettyCardNo)(e.cardNo),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']})]}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Close",onPress:h})]}),(0,m.jsxs)(i.T,{size:20,weight:"semibold",children:[e.stamps," of ",e.needed," stamps"]}),(0,m.jsxs)(i.Muted,{children:["Next reward: ",e.reward]}),x?(0,m.jsx)(i.Banner,{kind:x.kind,children:x.text}):null,(0,m.jsx)(i.Button,{label:f?'Saving\u2026':'Add a stamp',disabled:f||!1===n?.cardOn,testID:"loyalty-add-stamp",onPress:()=>C(async()=>{const n=await(0,c.staffStamp)(e.id);r(n),y({kind:'success',text:n.newReward?`Stamp added. ${e.name} has earned: ${n.rewards[n.rewards.length-1]?.title??'a reward'}.`:`Stamp added: ${n.stamps} of ${n.needed}.`})})}),!1===n?.cardOn?(0,m.jsx)(i.Muted,{children:"The stamp card is switched off in Settings \u203a Advanced \u203a Loyalty, so no stamps can be added."}):null,e.rewards.length?(0,m.jsx)(i.T,{weight:"semibold",children:"Rewards ready"}):(0,m.jsx)(i.Muted,{children:"No rewards ready yet."}),e.rewards.map(e=>(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{children:e.title}),e.expiresAt?(0,m.jsxs)(i.Muted,{children:["Use by ",p(e.expiresAt)]}):null]}),b===e.id?(0,m.jsxs)(i.Row,{gap:6,children:[(0,m.jsx)(i.Button,{small:!0,label:"Yes, used now",disabled:f,onPress:()=>C(async()=>{const n=await(0,c.staffRedeem)(e.id);r(n),y({kind:'success',text:`${n.redeemed} marked used.`})})}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Not yet",onPress:()=>S(null)})]}):(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Use reward",onPress:()=>S(e.id)})]},e.id)),(0,m.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Sign-in code for their phone",onPress:()=>C(async()=>v(await(0,c.staffCode)('link',e.id)))}),s?'remove'===b?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(i.Button,{small:!0,kind:"danger",label:"Yes, remove their details",onPress:()=>C(async()=>{await(0,c.staffRemove)(e.id),r(null),h()})}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Keep",onPress:()=>S(null)})]}):(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Remove guest",onPress:()=>S('remove')}):null]}),k?(0,m.jsx)(j,{c:k,what:`Opens ${e.name}'s card on their phone.`}):null,'remove'===b?(0,m.jsx)(i.Muted,{children:"Removing wipes their name, phone and email and closes the card (for example if they ask you to delete their data). Counts in the summary stay."}):null,(0,m.jsx)(i.T,{weight:"semibold",children:"Recent"}),e.history.length?e.history.slice(0,8).map((e,n)=>(0,m.jsxs)(i.Muted,{children:[p(e.at)," \xb7 ",e.what]},n)):(0,m.jsx)(i.Muted,{children:"Nothing yet."})]})}function w({venue:e,onJoined:n}){const[s,l]=(0,t.useState)(''),[r,u]=(0,t.useState)(''),[h,p]=(0,t.useState)(''),[x,y]=(0,t.useState)(!1),[j,f]=(0,t.useState)(!1),[w,b]=(0,t.useState)('');return(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Sign a guest up"}),(0,m.jsx)(i.Muted,{children:"Only a name is needed. Read the agreement to the guest and tick it only if they say yes."}),(0,m.jsx)(i.Field,{label:"Guest's name",value:s,onChangeText:l,maxLength:60}),(0,m.jsx)(i.Field,{label:"Phone (optional)",value:r,onChangeText:u,keyboardType:"phone-pad",maxLength:20}),(0,m.jsx)(i.Field,{label:"Email (optional)",value:h,onChangeText:p,keyboardType:"email-address",autoCapitalize:"none",maxLength:120}),(0,m.jsx)(i.Toggle,{label:`The guest agrees: \u201c${(0,o.consentText)(e)}\u201d`,value:x,onChange:y}),w?(0,m.jsx)(i.Banner,{kind:"warn",children:w}):null,(0,m.jsx)(i.Button,{label:j?'Saving\u2026':'Sign up',disabled:j||!x||!s.trim(),onPress:async()=>{f(!0),b('');try{n(await(0,c.staffJoin)({name:s,phone:r,email:h,consent:x,consentText:(0,o.consentText)(e)})),l(''),u(''),p(''),y(!1)}catch(e){b((0,o.plainError)(e))}finally{f(!1)}}})]})}},1372,[988,34,281,236,102,1247,794,1224,1227,821,1373,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"canScan",{enumerable:!0,get:function(){return l}}),_e.CardScanner=function({onCard:t,onClose:n}){const f=(0,e.useRef)(null),[h,w]=(0,e.useState)('');return(0,e.useEffect)(()=>{if(!l())return void w('This browser can\u2019t scan. Type the card number or search by name instead.');let e=!1,n=null,c=null;const o=document.createElement('video');return o.setAttribute('playsinline','true'),o.muted=!0,Object.assign(o.style,{width:'100%',maxWidth:'360px',borderRadius:'12px',border:'2px solid #CFA45F'}),(async()=>{try{if(n=await navigator.mediaDevices.getUserMedia({video:{facingMode:'environment'}}),e)return void n.getTracks().forEach(e=>e.stop());o.srcObject=n,await o.play();const u=f.current;u?.appendChild(o);const l=new(0,window.BarcodeDetector)({formats:['qr_code']}),h=async()=>{if(!e){try{const e=await l.detect(o);for(const n of e){const e=(0,s.readCardQr)(String(n.rawValue??''));if(e)return void t(e)}}catch{}c=setTimeout(h,300)}};h()}catch{w('The camera didn\u2019t start. Allow the camera, or type the card number instead.')}})(),()=>{e=!0,c&&clearTimeout(c),n?.getTracks().forEach(e=>e.stop()),o.remove()}},[t]),(0,u.jsxs)(c.default,{style:{gap:8,alignItems:'center'},children:[(0,u.jsx)(c.default,{ref:f,style:{width:'100%',alignItems:'center'}}),h?(0,u.jsx)(o.Banner,{kind:"warn",children:h}):(0,u.jsx)(o.Muted,{center:!0,children:"Point the camera at the QR on the guest\u2019s card screen."}),(0,u.jsx)(o.Button,{kind:"ghost",label:"Close camera",onPress:n})]})};var e=r(d[0]);r(d[1]);var t,n=r(d[2]),c=(t=n)&&t.__esModule?t:{default:t},o=r(d[3]),s=r(d[4]),u=r(d[5]);const l=()=>'undefined'!=typeof window&&'BarcodeDetector'in window&&!!navigator?.mediaDevices?.getUserMedia},1373,[34,236,102,794,1224,25]); diff --git a/chef-app/admin.html b/chef-app/admin.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/admin.html +++ b/chef-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer.html b/chef-app/customer.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer.html +++ b/chef-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage.html b/chef-app/customer/anchorage.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer/anchorage.html +++ b/chef-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/book.html b/chef-app/customer/anchorage/book.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer/anchorage/book.html +++ b/chef-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/feedback.html b/chef-app/customer/anchorage/feedback.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer/anchorage/feedback.html +++ b/chef-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/gift.html b/chef-app/customer/anchorage/gift.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer/anchorage/gift.html +++ b/chef-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/lost.html b/chef-app/customer/anchorage/lost.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer/anchorage/lost.html +++ b/chef-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/loyalty.html b/chef-app/customer/anchorage/loyalty.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer/anchorage/loyalty.html +++ b/chef-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/merch.html b/chef-app/customer/anchorage/merch.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer/anchorage/merch.html +++ b/chef-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/offers.html b/chef-app/customer/anchorage/offers.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer/anchorage/offers.html +++ b/chef-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/refer.html b/chef-app/customer/anchorage/refer.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer/anchorage/refer.html +++ b/chef-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/waitlist.html b/chef-app/customer/anchorage/waitlist.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer/anchorage/waitlist.html +++ b/chef-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/whatson.html b/chef-app/customer/anchorage/whatson.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer/anchorage/whatson.html +++ b/chef-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/basket.html b/chef-app/customer/basket.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer/basket.html +++ b/chef-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/profile.html b/chef-app/customer/profile.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/customer/profile.html +++ b/chef-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/demo.html b/chef-app/demo.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/demo.html +++ b/chef-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/display.html b/chef-app/display.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/display.html +++ b/chef-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/index.html b/chef-app/index.html index afa7f1a29e73f4619f01bde65a18612d2bd7f8d9..731448269541995b85b827e0d9fd5222c45cf8a2 100644 --- a/chef-app/index.html +++ b/chef-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/kitchen.html b/chef-app/kitchen.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/kitchen.html +++ b/chef-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/owner.html b/chef-app/owner.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/owner.html +++ b/chef-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/staff.html b/chef-app/staff.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/staff.html +++ b/chef-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/sw.js b/chef-app/sw.js index 0e711589c23d6d62a84059bf8d8cb021198386fd..1d79a21227ced2dbb066ee9f29cebdf539e5cd2a 100644 --- a/chef-app/sw.js +++ b/chef-app/sw.js @@ -1,7 +1,7 @@ // Anchorage Head Chef service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-chef-a22219713d"; +const V = "cc-chef-7e05680469"; const BASE = "/chef-app/"; -const PRECACHE = ["/chef-app/apple-touch-icon.png", "/chef-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/chef-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/chef-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/chef-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/chef-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/chef-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/chef-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/chef-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/chef-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/chef-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/chef-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/chef-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/chef-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/chef-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/chef-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/chef-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/chef-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/chef-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/chef-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/chef-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/chef-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/chef-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/chef-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/chef-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/chef-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/chef-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/chef-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/chef-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/chef-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/chef-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/chef-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/chef-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/chef-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/chef-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/chef-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/chef-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/chef-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/chef-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/chef-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/chef-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/chef-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/chef-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/chef-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/chef-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/chef-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/chef-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/chef-app/brand-logo.png", "/chef-app/favicon.ico", "/chef-app/icon-192.png", "/chef-app/icon-512.png", "/chef-app/icon-maskable-192.png", "/chef-app/icon-maskable-512.png", "/chef-app/manifest.webmanifest", "/chef-app/index.html", "/chef-app/_expo/static/js/web/bundle.js?v=a22219713de3ec349491dd6b43678523f53bc31a13c12a2948f597c0c7dfed4d"]; +const PRECACHE = ["/chef-app/apple-touch-icon.png", "/chef-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/chef-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/chef-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/chef-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/chef-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/chef-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/chef-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/chef-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/chef-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/chef-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/chef-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/chef-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/chef-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/chef-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/chef-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/chef-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/chef-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/chef-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/chef-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/chef-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/chef-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/chef-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/chef-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/chef-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/chef-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/chef-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/chef-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/chef-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/chef-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/chef-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/chef-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/chef-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/chef-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/chef-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/chef-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/chef-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/chef-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/chef-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/chef-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/chef-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/chef-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/chef-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/chef-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/chef-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/chef-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/chef-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/chef-app/brand-logo.png", "/chef-app/favicon.ico", "/chef-app/icon-192.png", "/chef-app/icon-512.png", "/chef-app/icon-maskable-192.png", "/chef-app/icon-maskable-512.png", "/chef-app/manifest.webmanifest", "/chef-app/index.html", "/chef-app/_expo/static/js/web/bundle.js?v=7e056804695ef24bd7365f9fbfd639bc4b35a72edb1058831ba936b81106d7bc"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/chef-app/team.html b/chef-app/team.html index 0bb95e70b6a0bed8f97b6171b064232ccc8740dc..3e7af6ce073c0d16d8691a6bd88726ee1d0c7552 100644 --- a/chef-app/team.html +++ b/chef-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/_expo/static/js/web/bundle.js b/customer-app/_expo/static/js/web/bundle.js index 1951a699504bf3963e6c0ffa61cef556ede08c31..946737695085002e8592ac26180c561ea400b7d9 100644 --- a/customer-app/_expo/static/js/web/bundle.js +++ b/customer-app/_expo/static/js/web/bundle.js @@ -6,7 +6,7 @@ var __BUNDLE_START_TIME__=globalThis.nativePerformanceNow?nativePerformanceNow() __d(function(g,r,i,a,m,e,d){"use strict";r(d[0]),r(d[1])},0,[1,19]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";var e,t=_r(d[0]),o=_r(d[1]),a=_r(d[2]),n=_r(d[3]),i=_r(d[4]),c=(e=i)&&e.__esModule?e:{default:e};if(t.PITCH){const e=o.restaurants.find(e=>'anchorage'===e.id);e&&Object.assign(e,{name:n.PITCH_VENUE.name,tagline:n.PITCH_VENUE.tagline,location:n.PITCH_VENUE.location,phone:n.PITCH_VENUE.phone,website:n.PITCH_VENUE.website,hoursNote:'Kitchen (food) hours. The closing time is last food orders.',fictional:!1}),e&&(e.settings={...e.settings,whatsapp:'07700 900123'});for(const e of c.default.areas)delete e.best;for(let e=a.ROSTER.length-1;e>=0;e--){const t=n.PITCH_TEAM[a.ROSTER[e].id];t?(Object.assign(a.ROSTER[e],{name:t.name,job:t.job,hourlyPence:t.hourlyPence,...t.dept?{dept:t.dept}:{},...null!=t.salaried?{salaried:t.salaried}:{}}),delete a.ROSTER[e].nickname):a.ROSTER.splice(e,1)}if('undefined'!=typeof document){const e=t=>{if(3===t.nodeType){const e=t.nodeValue??'',o=(0,n.pitchText)(e);return void(o!==e&&(t.nodeValue=o))}if(1!==t.nodeType)return;const o=t;if('INPUT'===o.tagName||'TEXTAREA'===o.tagName){const e=o,t=(0,n.pitchText)(e.value);t!==e.value&&(e.value=t);const a=e.getAttribute('placeholder');if(a){const t=(0,n.pitchText)(a);t!==a&&e.setAttribute('placeholder',t)}}for(const e of['aria-label','title']){const t=o.getAttribute(e);if(t){const a=(0,n.pitchText)(t);a!==t&&o.setAttribute(e,a)}}o.childNodes.forEach(e)},t=()=>{e(document.body),document.title=(0,n.pitchText)(document.title),new MutationObserver(t=>{for(const o of t)'characterData'===o.type?e(o.target):o.addedNodes.forEach(e),'attributes'===o.type&&e(o.target);document.title=(0,n.pitchText)(document.title)}).observe(document.body,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:['value','placeholder','aria-label']}),document.addEventListener('input',e=>{e.target},!0)};document.body?t():document.addEventListener('DOMContentLoaded',t)}}},1,[2,3,15,17,18]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PITCH",{enumerable:!0,get:function(){return n}});const n=(['anchorage','souters','kirkmichael','wildings','kirkton','abbotsford','greenside',"3idiots","cecchinis","mrbasrais","yasmins","williewastles","rupeeroom","smokinggoat","pizzaioli","drunkencoo"].includes("anchorage"),!1)},2,[]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return t.GREENSIDE_RESTAURANT}}),Object.defineProperty(e,"ABBOTSFORD_RESTAURANT",{enumerable:!0,get:function(){return n.ABBOTSFORD_RESTAURANT}}),Object.defineProperty(e,"KIRKTON_RESTAURANT",{enumerable:!0,get:function(){return o.KIRKTON_RESTAURANT}}),Object.defineProperty(e,"WILDINGS_RESTAURANT",{enumerable:!0,get:function(){return s.WILDINGS_RESTAURANT}}),Object.defineProperty(e,"KIRKMICHAEL_RESTAURANT",{enumerable:!0,get:function(){return c.KIRKMICHAEL_RESTAURANT}}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return R}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);const u={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:16,bookingSlotMinutes:15,deposit:{...r(d[6]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},h={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},f={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},b={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},p=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:f,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...u,orderAtTable:!1,pay:h,cashUpRecord:[...l.ANCHORAGE_CASH_UP]},sections:[]},{id:'saltmarsh',name:'The Venue',tagline:'FICTIONAL demo restaurant \u2014 shows multi-tenancy',location:'Port Ailsa (fictional town)',fictional:!0,kitchenHours:{0:['12:00','20:00'],1:['12:00','20:00'],2:['12:00','20:00'],3:['12:00','20:00'],4:['12:00','21:00'],5:['12:00','21:00'],6:['12:00','21:00']},settings:{...u,slotCap:4,stampTarget:6,stampReward:'Free side',capacityPerHour:30},sections:['Small plates','Mains','Puddings']},{id:'brae',name:'Brae Bakehouse',tagline:'FICTIONAL demo caf\xe9 \u2014 shows multi-tenancy',location:'Kilbrae (fictional village)',fictional:!0,kitchenHours:{0:['09:00','16:00'],1:['09:00','16:00'],2:['09:00','16:00'],3:['09:00','16:00'],4:['09:00','16:00'],5:['09:00','20:00'],6:['09:00','20:00']},settings:{...u,slotCap:5,slotMinutes:15,stampTarget:10,stampReward:'Free coffee & cake',capacityPerHour:24,bookingCoversPerSlot:10},sections:['Bakes','Lunch','Hot drinks']}],A={by:'Fictional demo',at:'2026-10-26'},T=(t,n,o,s,c,l,u,h,f=[])=>({id:n,restaurantId:t,section:o,name:s,description:c,price:l,allergens:u,prepMins:h,dietary:f,soldOut:!1,signOff:A}),R=[T('saltmarsh','s-beets','Small plates','Roast beetroot & whipped feta','Fictional dish for the demo.',750,{milk:'contains',treenuts:'may'},6,['V']),T('saltmarsh','s-squid','Small plates','Salt & pepper squid','Fictional dish for the demo.',850,{molluscs:'contains',gluten:'contains'},7),T('saltmarsh','s-hake','Mains','Pan-roast hake, mussel broth','Fictional dish for the demo.',1950,{fish:'contains',molluscs:'contains',milk:'contains',celery:'contains'},15),T('saltmarsh','s-risotto','Mains','Wild mushroom risotto','Fictional dish for the demo.',1600,{milk:'contains',celery:'contains',sulphites:'contains'},16,['V']),T('saltmarsh','s-cranachan','Puddings','Cranachan','Fictional dish for the demo.',700,{milk:'contains',gluten:'contains'},3,['V']),T('brae','b-scone','Bakes','Cheese scone','Fictional dish for the demo.',350,{gluten:'contains',milk:'contains',eggs:'contains'},2,['V']),T('brae','b-caramel','Bakes','Millionaire\u2019s shortbread','Fictional dish for the demo.',300,{gluten:'contains',milk:'contains',soya:'may'},1,['V']),T('brae','b-toastie','Lunch','Ham & mustard toastie','Fictional dish for the demo.',750,{gluten:'contains',milk:'contains',mustard:'contains'},6),T('brae','b-soup','Lunch','Lentil soup & bread','Fictional dish for the demo.',600,{gluten:'contains',celery:'contains'},4,['VG']),T('brae','b-flat','Hot drinks','Flat white','Fictional dish for the demo.',330,{milk:'contains'},2,['V'])]},3,[4,8,9,10,12,13,14]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return t.GREENSIDE_RESTAURANT}}),Object.defineProperty(e,"ABBOTSFORD_RESTAURANT",{enumerable:!0,get:function(){return n.ABBOTSFORD_RESTAURANT}}),Object.defineProperty(e,"KIRKTON_RESTAURANT",{enumerable:!0,get:function(){return o.KIRKTON_RESTAURANT}}),Object.defineProperty(e,"WILDINGS_RESTAURANT",{enumerable:!0,get:function(){return s.WILDINGS_RESTAURANT}}),Object.defineProperty(e,"KIRKMICHAEL_RESTAURANT",{enumerable:!0,get:function(){return c.KIRKMICHAEL_RESTAURANT}}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return R}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);const u={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:20,bookingSlotMinutes:15,deposit:{...r(d[6]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},h={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},f={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},b={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},p=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:f,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...u,orderAtTable:!1,pay:h,cashUpRecord:[...l.ANCHORAGE_CASH_UP],bookingCoversPerStart:15,bookingPartiesPerStart:4,onlinePartyMin:1,onlinePartyMax:8,bookingNoticeMins:15,autoAcceptUpTo:8},sections:[]},{id:'saltmarsh',name:'The Venue',tagline:'FICTIONAL demo restaurant \u2014 shows multi-tenancy',location:'Port Ailsa (fictional town)',fictional:!0,kitchenHours:{0:['12:00','20:00'],1:['12:00','20:00'],2:['12:00','20:00'],3:['12:00','20:00'],4:['12:00','21:00'],5:['12:00','21:00'],6:['12:00','21:00']},settings:{...u,slotCap:4,stampTarget:6,stampReward:'Free side',capacityPerHour:30},sections:['Small plates','Mains','Puddings']},{id:'brae',name:'Brae Bakehouse',tagline:'FICTIONAL demo caf\xe9 \u2014 shows multi-tenancy',location:'Kilbrae (fictional village)',fictional:!0,kitchenHours:{0:['09:00','16:00'],1:['09:00','16:00'],2:['09:00','16:00'],3:['09:00','16:00'],4:['09:00','16:00'],5:['09:00','20:00'],6:['09:00','20:00']},settings:{...u,slotCap:5,slotMinutes:15,stampTarget:10,stampReward:'Free coffee & cake',capacityPerHour:24,bookingCoversPerSlot:10},sections:['Bakes','Lunch','Hot drinks']}],A={by:'Fictional demo',at:'2026-10-26'},T=(t,n,o,s,c,l,u,h,f=[])=>({id:n,restaurantId:t,section:o,name:s,description:c,price:l,allergens:u,prepMins:h,dietary:f,soldOut:!1,signOff:A}),R=[T('saltmarsh','s-beets','Small plates','Roast beetroot & whipped feta','Fictional dish for the demo.',750,{milk:'contains',treenuts:'may'},6,['V']),T('saltmarsh','s-squid','Small plates','Salt & pepper squid','Fictional dish for the demo.',850,{molluscs:'contains',gluten:'contains'},7),T('saltmarsh','s-hake','Mains','Pan-roast hake, mussel broth','Fictional dish for the demo.',1950,{fish:'contains',molluscs:'contains',milk:'contains',celery:'contains'},15),T('saltmarsh','s-risotto','Mains','Wild mushroom risotto','Fictional dish for the demo.',1600,{milk:'contains',celery:'contains',sulphites:'contains'},16,['V']),T('saltmarsh','s-cranachan','Puddings','Cranachan','Fictional dish for the demo.',700,{milk:'contains',gluten:'contains'},3,['V']),T('brae','b-scone','Bakes','Cheese scone','Fictional dish for the demo.',350,{gluten:'contains',milk:'contains',eggs:'contains'},2,['V']),T('brae','b-caramel','Bakes','Millionaire\u2019s shortbread','Fictional dish for the demo.',300,{gluten:'contains',milk:'contains',soya:'may'},1,['V']),T('brae','b-toastie','Lunch','Ham & mustard toastie','Fictional dish for the demo.',750,{gluten:'contains',milk:'contains',mustard:'contains'},6),T('brae','b-soup','Lunch','Lentil soup & bread','Fictional dish for the demo.',600,{gluten:'contains',celery:'contains'},4,['VG']),T('brae','b-flat','Hot drinks','Flat white','Fictional dish for the demo.',330,{milk:'contains'},2,['V'])]},3,[4,8,9,10,12,13,14]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_UUID",{enumerable:!0,get:function(){return n.GREENSIDE_UUID}}),Object.defineProperty(e,"GREENSIDE_BOOKING_PHONE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"GREENSIDE_VENUE_HOURS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"GREENSIDE_KITCHEN_HOURS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return u}});var n=r(d[0]);const t='tel:01655889685',o={0:['10:00','00:00'],1:null,2:null,3:['10:00','23:00'],4:['10:00','23:00'],5:['10:00','00:00'],6:['10:00','00:00']},s={0:['10:00','20:00'],1:null,2:null,3:['10:00','20:00'],4:['10:00','20:00'],5:['10:00','21:00'],6:['10:00','21:00']},u={id:'greenside',name:'The Greenside Restaurant',tagline:'Restaurant \xb7 Wood Fired Pizza \xb7 Maybole',location:'5 Greenside, Maybole, South Ayrshire KA19 7DG',address:'5 Greenside, Maybole, South Ayrshire KA19 7DG',phone:'01655 889685',email:'info@thegreensiderestaurant.co.uk',emailNeedsConfirmation:!0,website:'thegreensiderestaurant.co.uk',fictional:!1,cashOnly:!0,kitchenHours:s,venueHours:o,hoursNote:'Closed Monday and Tuesday. Venue Wednesday and Thursday 10:00\u201323:00, Friday to Sunday 10:00\u201300:00. Kitchen Wednesday, Thursday and Sunday 10:00\u201320:00; Friday and Saturday 10:00\u201321:00. Cash only.',sections:[],settings:{slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!0,bookingCoversPerSlot:0,stampTarget:8,stampReward:'',stampMinSpend:0,capacityPerHour:0,walkInShare:0,turnMins:75,orderAtTable:!1,showTakeaway:!1,shortName:'The Greenside',reserveStock:!1,tableRequests:!0,deposit:{on:!1,perPersonPence:null,fromParty:null,refundable:null,cutoffHours:null,needsConfirmation:!0,wixLinksOn:!1,policy:'Deposit policy needs confirmation. Deposits and payments are off. Requests need a manager to confirm.'}}}},4,[5]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VENUE_RID",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ISOLATED_VENUE_IDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"IS_GREENSIDE",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"GREENSIDE_UUID",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"IS_ABBOTSFORD",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ABBOTSFORD_UUID",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"IS_KIRKTON",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"KIRKTON_UUID",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"IS_QUEUED_VENUE",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"IS_SOUTERS",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"IS_WILDINGS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"IS_KIRKMICHAEL",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"IS_ISOLATED_VENUE",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"SOUTERS_UUID",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"KIRKMICHAEL_UUID",{enumerable:!0,get:function(){return U}}),Object.defineProperty(e,"WILDINGS_UUID",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"VENUE_UUID",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"venueKey",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"venueIdentityAllowed",{enumerable:!0,get:function(){return D}});var n=r(d[0]);const t="anchorage".toLowerCase().replace(/[^a-z0-9-]/g,'')||'anchorage',c={"3idiots":"59766322-119e-4036-a18a-f6909f60a8d2",cecchinis:"596c6f7e-9797-4e16-84fe-db4a99fa1bdc",mrbasrais:"5d500571-e205-4ead-bb58-60e986b6f40e",yasmins:"f43f20ad-55d0-4008-88c8-7738dc1698df",williewastles:"6abc2793-93ab-4e23-a705-b4011a5cc011",rupeeroom:"78bff97d-5f07-440a-bb99-f6a6118da7a3",smokinggoat:"cd985ff5-2443-458d-ac8b-342d553628cf",pizzaioli:"35f870fc-772c-4aad-bb9e-09a9a16bc925",drunkencoo:"f500ef12-b405-438b-9671-e54289bec5dd",abbotsford:'24624ea5-d1e3-4182-b0d1-73402b8a1532',kirkton:'e0afad1d-cbc1-414a-add6-92e47d302139',greenside:'1bc2a056-2ef6-4585-abfd-b7d21c84f215',souters:'41ce63ca-ae46-432d-a5ba-25e1b801e64d',kirkmichael:'43c8da91-b8b8-4ce9-9ab7-f00c84c5f4f6',wildings:'47f86b36-4c99-466a-be9c-30eb3d79f1e1'},b='greenside'===t,u=c.greenside,f='abbotsford'===t,o=c.abbotsford,l='kirkton'===t,s=c.kirkton,I=(0,n.isQueuedVenue)(t),O='souters'===t,p='wildings'===t,y='kirkmichael'===t,E=Object.prototype.hasOwnProperty.call(c,t),_=c.souters,U=c.kirkmichael,S=c.wildings,j=c[t],P=n=>E?`cc-venue:${t}:${n}`:n,D=(c,b)=>!E||c===j&&b===(0,n.queuedDatabaseSlug)(t)},5,[6]); __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"queuedVenues",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"isQueuedVenue",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"queuedDatabaseSlug",{enumerable:!0,get:function(){return o}}),_e.queuedRestaurant=function(e){const t=n[e];if(!t)throw Error('Unknown venue');const s=t.kitchenSessionsByDay??t.hours.sessionsByDay,o=Object.fromEntries(Array.from({length:7},(e,t)=>[t,s?.[t]?.length?[s[t][0][0],s[t][s[t].length-1][1]]:null]));return{id:e,name:t.name,location:t.address,address:t.address,phone:t.phone||'',email:t.email||'',website:t.website||'',fictional:!1,tagline:'Restaurant',kitchenHours:o,...s?{kitchenSessionsByDay:s}:{},hoursNeedsConfirmation:!0,hoursNote:t.hours.note,sections:[],settings:{slotMinutes:15,slotCap:0,bufferMins:0,leadMins:0,takeawayPaused:!0,bookingCoversPerSlot:0,stampTarget:0,stampReward:'',stampMinSpend:0,capacityPerHour:0,walkInShare:0,turnMins:0,orderAtTable:!1,showTakeaway:!1,shortName:t.name,reserveStock:!1,tableRequests:!0,deposit:{on:!1,perPersonPence:null,fromParty:null,refundable:null,cutoffHours:null,needsConfirmation:!0,wixLinksOn:!1,policy:'Deposit terms to confirm. No payment is taken for requests.'}}}};var e,t=r(d[0]);const n=((e=t)&&e.__esModule?e:{default:e}).default,s=e=>Object.prototype.hasOwnProperty.call(n,e),o=e=>s(e)?n[e].databaseSlug:e},6,[7]); @@ -1092,7 +1092,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},1009,[34,1010]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},1010,[1007,978,1011]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},1011,[1007]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.142'},1012,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.144'},1012,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:h}=await r.select();c&&s(c,h);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},h='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,h.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),h}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),h={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:h})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},1013,[1014,1015,934,978,1010]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},1015,[978]); @@ -1193,11 +1193,11 @@ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{ __d(function(_g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.saveBookingTables=$,_e.TablePicker=function({rid:e,booking:u,name:p,turnBase:k=90,onClose:v,onSaved:w,onPickOnPlan:T}){const C=(0,b.usePlan)(e),L=(0,c.useBookings)(e),[S,W]=(0,t.useState)(()=>(0,b.tablesOf)((0,h.tableKey)((0,b.tablesOf)(u.table)))),P=(0,t.useMemo)(()=>(0,h.pickGroups)(C),[C]),z=L.filter(e=>e.date===u.date),O=(0,h.seatsOf)(C,S),D=(0,h.seatLine)(O.total,u.partySize),I=(0,h.pickClashes)(u,S,z,k),B=e=>(0,h.pickClashes)(u,[e],z,k)[0]?.with,M=(0,h.tableKey)(S)!==(0,h.tableKey)((0,b.tablesOf)(u.table)),N=(0,f.useBlocks)(e=>e.blocks),R=(0,f.blockAt)(N,e,u.date,u.time),_=e=>W(s=>(0,h.toggleTable)(s,e)),Y=async s=>{try{await $(e,u,s),w?.((0,h.savedWords)(p,u.partySize,s,(0,h.seatsOf)(C,s).total)),v()}catch(e){w?.(`Couldn\u2019t save tables for ${p}: ${String(e?.message??e).slice(0,120)}`)}},G=(0,x.jsxs)(n.default,{style:{gap:8},children:[(0,x.jsxs)(n.default,{testID:"table-pick-total",accessible:!0,accessibilityLabel:`${(0,h.tablesWords)(S)} picked. ${D.text}.`,children:[(0,x.jsx)(y.T,{size:18,weight:"semibold",colour:g.colours.goldLight,children:(0,h.tablesWords)(S)}),(0,x.jsx)(y.T,{size:17,colour:g.colours.text,children:D.text})]}),R?(0,x.jsx)(n.default,{testID:"table-pick-pause",accessible:!0,accessibilityLabel:`Note. New bookings are paused ${R.from} to ${R.to}${R.reason?` (${R.reason})`:''}. You can still assign tables to this booking.`,style:{padding:10,borderRadius:10,borderWidth:1,borderColor:g.colours.goldMuted},children:(0,x.jsxs)(y.T,{size:16,colour:g.colours.goldLight,children:["New bookings paused ",R.from,"\u2013",R.to,R.reason?` \xb7 ${R.reason}`:'',". You can still save tables for this booking."]})}):null,I.length?(0,x.jsx)(n.default,{testID:"table-pick-clash",accessible:!0,accessibilityLabel:`Warning. ${(0,h.clashWords)(I)} You can still save.`,style:{padding:10,borderRadius:10,borderWidth:1,borderColor:g.colours.gold},children:(0,x.jsxs)(y.T,{size:16,weight:"semibold",colour:g.colours.goldLight,children:[(0,h.clashWords)(I)," You can still save."]})}):null,(0,x.jsxs)(y.Row,{gap:8,wrap:!0,children:[(0,x.jsx)(y.Button,{testID:"table-pick-save",label:I.length?'Save anyway':'Save tables',disabled:!M||!S.length,accessibilityLabel:`${I.length?'Save anyway, ':'Save, '}${(0,h.tablesWords)(S)} for ${p}. ${D.text}.${I.length?` ${(0,h.clashWords)(I)}`:''}`,onPress:()=>Y(S),style:[j,{flexGrow:1}]}),(0,b.tablesOf)(u.table).length?(0,x.jsx)(y.Button,{testID:"table-pick-clear",kind:"secondary",label:"Clear table",accessibilityLabel:`Clear table, take ${(0,h.tablesWords)((0,b.tablesOf)(u.table)).toLowerCase()} off ${p}`,onPress:()=>Y([]),style:j}):null,(0,x.jsx)(y.Button,{testID:"table-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",onPress:v,style:j})]})]});return(0,x.jsxs)(y.Sheet,{visible:!0,onClose:v,title:`Tables \xb7 ${u.time} ${p} \xb7 ${u.partySize} Covers`,maxWidth:760,testID:"table-picker",footer:G,children:[(0,x.jsx)(s.TableNumberWarning,{plan:C}),(0,x.jsx)(y.T,{size:16,colour:g.colours.text,children:"Tap one table, or several to join them. Tap again to take one off."}),T?(0,x.jsx)(y.Button,{kind:"secondary",testID:"table-pick-on-plan",label:"Pick on the table plan",accessibilityLabel:`Pick on the table plan instead, for ${p}`,onPress:()=>T(S),style:j}):null,P.map(e=>(0,x.jsxs)(n.default,{style:{gap:6},accessibilityLabel:e.area,children:[(0,x.jsx)(y.T,{size:15,weight:"semibold",colour:g.colours.gold,children:e.area}),(0,x.jsx)(y.Row,{gap:8,wrap:!0,children:e.tables.map(e=>{const s=S.includes(e.name),t=B(e.name);return(0,x.jsxs)(o.default,{testID:`table-pick-${e.name}`,accessibilityRole:"checkbox",accessibilityState:{checked:s},'aria-checked':s,accessibilityLabel:(0,h.pickA11y)(e.name,e.seats,s,t),onPress:()=>_(e.name),style:({pressed:e})=>({minWidth:92,minHeight:64,paddingHorizontal:10,paddingVertical:6,borderRadius:12,alignItems:'center',justifyContent:'center',borderWidth:s?2:1,borderColor:s?g.colours.gold:t?g.colours.goldMuted:g.colours.hairline,borderStyle:t&&!s?'dashed':'solid',backgroundColor:s?g.colours.gold:e?g.colours.tilePressed:g.colours.tile}),children:[(0,x.jsx)(y.T,{size:18,weight:"semibold",colour:s?g.colours.onGold:g.colours.text,children:(0,l.tableNumbers)(e.name)}),(0,x.jsxs)(y.T,{size:14,colour:s?g.colours.onGold:g.colours.muted,children:[e.seats," seats",t?' \xb7 booked':'']})]},e.name)})})]},e.area)),P.length?null:(0,x.jsx)(y.Muted,{children:"No tables on the plan yet. Add them in Setup \u203a Table plan."})]})};var s=r(d[0]),l=r(d[1]),t=r(d[2]),o=e(r(d[3])),n=e(r(d[4])),c=r(d[5]),b=r(d[6]),u=r(d[7]),h=r(d[8]),g=r(d[9]),p=r(d[10]),y=r(d[11]),k=r(d[12]),f=r(d[13]),x=r(d[14]);const j={minHeight:56};async function $(e,s,l){const t=(0,h.tableKey)(l),o=(0,b.tablesOf)(s.table);await c.repo.bookings.update(s.id,(0,u.tablePatch)(t||null)),'seated'===s.status&&s.date===(0,p.venueYmd)(new Date)&&(o.filter(e=>!(0,b.tablesOf)(t).includes(e)).forEach(s=>b.useFloor.getState().setLive(e,s,{stage:void 0,dirty:!0})),t&&(0,k.resetTableLive)(e,t))}},1110,[1111,860,34,402,102,874,1021,1109,1112,821,858,794,1113,1018,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.TableNumberWarning=function({plan:u}){const c=(0,n.numberClashes)(u.tables),o=[...new Set([...c.acrossAreas,...u.tables.filter(n=>c.sameArea.has(n.name)).map(n.tableNumber)])];return o.length?(0,l.jsxs)(t.T,{testID:"duplicate-table-numbers",size:16,colour:s.colours.goldLight,children:["Duplicate table numbers: ",o.join(', '),". Kept unchanged. Ask a manager to check the areas before assigning."]}):null},r(d[0]);var n=r(d[1]),s=r(d[2]),t=r(d[3]),l=r(d[4])},1111,[34,859,821,794,25]); __d(function(_g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"byNum",{enumerable:!0,get:function(){return s}}),e.tableKey=o,e.toggleTable=function(t,n){return t.includes(n)?t.filter(t=>t!==n):a(o([...t,n]))},e.seatsOf=function(t,n){const a={};for(const s of n)a[s]=t.tables.find(t=>t.name===s)?.maxSeats??0;return{per:a,total:Object.values(a).reduce((t,n)=>t+n,0)}},e.seatLine=function(t,n){const a=Math.max(0,n-t);return{text:`${t} ${1===t?'seat':'seats'} for ${l(n)}${a?`: ${a} short`:''}`,short:a,fits:0===a&&t>0}},e.pickClashes=function(t,l,u,c=90){if(!l.length)return[];const f={...t,table:o(l)},b=[];for(const s of u)if(s.id!==t.id&&s.date===t.date&&!['cancelled','noshow','finished'].includes(s.status)&&(0,n.startOf)(f)<(0,n.endOf)(s,c)&&(0,n.startOf)(s)<(0,n.endOf)(f,c))for(const t of a(s.table))l.includes(t)&&b.push({table:t,with:s});return b.sort((t,n)=>s(t.table,n.table))},e.clashWords=function(n){return n.map(n=>`${(0,t.tableNumbers)(n.table)} has ${n.with.walkIn?'a walk-in':(n.with.name||'a booking').replace(' (example)','')} at ${n.with.time}`).join('. ')+(n.length?'.':'')},e.tablesWords=u,e.pickA11y=function(n,a,s,l){return`Table ${(0,t.tableNumbers)(n)}, ${a} ${1===a?'seat':'seats'}${s?', selected':''}${l?`, has ${l.walkIn?'a walk-in':l.name} at ${l.time}`:''}`},e.pickGroups=function(t){return t.areas.map(n=>({area:n.name,tables:t.tables.filter(t=>t.areaId===n.id).map(t=>({name:t.name,seats:t.maxSeats})).sort((t,n)=>s(t.name,n.name))})).filter(t=>t.tables.length)},e.savedWords=function(t,n,a,s){return a.length?`${t}, ${l(n)}: ${u(a)} (${s} seats).`:`${t}: table taken off.`},e.tableActions=function(t,n){const s=a(t.table);if(['cancelled','noshow'].includes(t.status))return[];const o=[s.length?{id:'assign',label:'Change table',a11y:`Change table for ${n}, ${l(t.partySize)}, now ${u(s).toLowerCase()}. You can pick several tables to join.`}:{id:'assign',label:'Assign table',a11y:`Assign table for ${n}, ${l(t.partySize)}. You can pick several tables to join.`}];s.length&&o.push({id:'clear',label:'Clear table',a11y:`Clear table for ${n}, take ${u(s).toLowerCase()} off this booking`});return o},e.dragTables=function(t,n,s){if(!s||'__none'===s||s===n)return null;const l=a(t);if(l.includes(s))return null;return o('__none'!==n&&l.includes(n)?l.map(t=>t===n?s:t):[s])};var t=r(d[0]),n=r(d[1]);const a=t=>t?t.split('+').map(t=>t.trim()).filter(Boolean):[],s=(t,n)=>t.localeCompare(n,'en-GB',{numeric:!0}),l=t=>`${t} ${1===t?'person':'people'}`;function o(t){return[...new Set(t.map(t=>String(t).trim()).filter(Boolean))].sort(s).join('+')}function u(n){const s=a(o(n));return s.length?(0,t.tableListNumbers)(s):'No table'}},1112,[860,1095]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return O}}),_e.useTableNames=N,_e.resetTableLive=M,_e.seatBookingNow=F,_e.finishBookingNow=async function(e,t){await f.repo.bookings.setStatus(t.id,'finished'),(0,S.tablesOf)(t.table).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=L,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return R}}),_e.TablePicker=W,_e.WalkInSheet=E,_e.WalkInMatchPrompt=H,_e.AssignTableSheet=_,_e.undoNotice=Y,_e.NewBookingSheet=U,_e.useFrontDoor=function(e,t){const[s,o]=(0,r.useState)(!1),[l,a]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>d({b:e}),combineTables:e=>d({b:e,combine:!0}),elements:(0,B.jsxs)(B.Fragment,{children:[s?(0,B.jsx)(E,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,B.jsx)(U,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,n.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,x.niceDate)((0,x.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,B.jsx)(_,{booking:i.b,combine:i.combine,onClose:()=>d(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=e(r),u=_r(_d[8]),c=e(_r(_d[9])),b=e(_r(_d[10])),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),w=_r(_d[18]),T=_r(_d[19]),S=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),D=_r(_d[23]),I=_r(_d[24]),$=_r(_d[25]),P=_r(_d[26]),z=_r(_d[27]),B=_r(_d[28]);const O=Array.from({length:12},(e,t)=>String(t+1));function N(e){const t=(0,S.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function M(e,t){(0,S.tablesOf)(t).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}async function F(e,t){await f.repo.bookings.setStatus(t.id,'seated'),M(e,t.table)}function L(e,t){const s=(0,f.useBookings)(e),o=(0,f.useOrders)(e),l=N(e),a=(0,S.useFloor)(t=>t.live[e])??{},i=(0,S.usePlan)(e),n=(0,v.useBlocks)(e=>e.blocks),r=(0,x.ymd)(t),d=(0,v.closedAreasAt)(n,e,r,(0,x.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,S.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,x.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const R=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function W({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:d}){const u=Object.keys(e),[h,p]=(0,r.useState)(0),f=i?6:8,y=i?64:o?92:76,k=h?Math.max(3,Math.floor((h+f)/(y+f))):0,x=k?Math.floor((h-f*(k-1))/k):y,w=new Set(n??[]),v=a?(0,S.tablesOf)(a)[0]:null;return(0,B.jsx)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:f},testID:"table-picker",onLayout:e=>p(Math.floor(e.nativeEvent.layout.width)),children:u.map(o=>{const a=e[o],n=t===o||!!d?.includes(o),r=w.has(o),u=v===o&&!n,h=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,B.jsxs)(c.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${d?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${r?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:x,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?j.colours.gold:a.busy?j.colours.red:j.colours.ok,backgroundColor:n?j.colours.goldTint:a.busy?j.colours.redBg:j.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,B.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,B.jsx)(T.T,{weight:"bold",size:22,colour:n?j.colours.goldLight:j.colours.text,children:(0,l.tableNumbers)(o)}),r?(0,B.jsx)(b.default,{testID:"best-table",style:{backgroundColor:j.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,B.jsx)(T.T,{size:11,weight:"bold",colour:j.colours.onGold,children:"BEST"})}):null]}),(0,B.jsx)(T.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:h})]},o)})})}const A=[1,2,3,4,5,6,7,8];function E({onClose:e,onSeated:a,wide:i,initialTable:y}){const{rid:w,r:C,now:D}=(0,p.useCtx)(15e3),I=L(w,D),[$,P]=(0,r.useState)(2),[O,N]=(0,r.useState)(!1),[R,E]=(0,r.useState)(y??null),_=(0,S.usePlan)(w),Y=(0,f.useBookings)(w),U=(0,v.useBlocks)(e=>e.blocks),q=(0,v.closedAreasAt)(U,w,(0,x.ymd)(D),(0,x.hm)(D)),Q=d.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(_,Y.filter(e=>e.date===(0,x.ymd)(D)),e,$,D,(0,k.turnFor)($,C.settings.turnMins),90,void 0,{closed:q})?.table??null},[_,Y,I,$,q.size,D.getTime()]);(0,r.useEffect)(()=>{R&&(0,S.tablesOf)(R).some(e=>'Closed'===I[e]?.label)&&E(null)},[R,q.size]);const[V,G]=(0,r.useState)(!1),[K,X]=(0,r.useState)(''),J=(e,t=String(e),s=()=>{N(!1),P(e)})=>{const o='9+'===t?O:!O&&$===e;return(0,B.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?j.colours.gold:'transparent'},children:(0,B.jsx)(T.T,{weight:"bold",size:22,colour:o?j.colours.onGold:j.colours.gold,children:t})},t)},Z=(0,B.jsx)(s.PartySizeInput,{value:$,onChange:P,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),ee=(0,B.jsxs)(b.default,{style:{gap:8,width:i?256:void 0},children:[(0,B.jsx)(T.T,{weight:"semibold",children:"How many people?"}),(0,B.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[A.map(e=>J(e)),J(9,'9+',()=>{N(!0),P(e=>e>=9?e:9)})]}),O?Z:null]}),[te,se]=(0,r.useState)(!1),[oe,le]=(0,r.useState)(null),ae=async(t=R,s=!1)=>{if(!te){if(!s){const e=(0,z.bookingsNearWalkIn)(Y,D,$);if(e.length)return void le({at:t,list:e})}se(!0);try{const s=await f.repo.bookings.seatWalkIn(w,$,t??void 0,K);M(w,t??void 0),a(s),e()}finally{se(!1)}}},ie=async(t,s)=>{if(!te){se(!0);try{const o=s??t.table??null;o&&o!==t.table&&await f.repo.bookings.assignTable(t.id,o),await F(w,{...t,table:o??void 0}),(0,n.notify)({id:`seated:${t.id}`,testID:'walkin-match-toast',timeoutMs:5e3,icon:'\u2713',title:`${t.name} seated \xb7 ${t.partySize} \xb7 ${o?(0,l.tableNumbers)(o):'table to assign'} (booking ${t.ref})`}),le(null),e()}finally{se(!1)}}},ne=(0,B.jsxs)(b.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,B.jsxs)(T.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(T.T,{weight:"semibold",children:["Table ",(0,B.jsx)(T.T,{colour:j.colours.muted,size:14,children:"(optional)"})]}),R?(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>E(null)}):null]}),(0,B.jsx)(W,{use:I,value:R,onPick:e=>{I[e]&&!I[e].busy?ae(e):E(R===e?null:e)},big:i,dense:i,best:Q,bestSet:(0,u.bestTables)(_)}),(0,B.jsxs)(T.Muted,{children:["Tap a free table to seat them there",Q&&!R?` (suggested for ${$}: ${(0,l.tableNumbers)(Q)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,x.hm)(D)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,B.jsx)(T.Button,{label:`Seat walk-in \xb7 ${$} ${1===$?'person':'people'}${R?` \xb7 ${(0,l.tableNumbers)(R)}`:''}`,disabled:te,onPress:()=>{ae()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,B.jsxs)(T.Row,{gap:16,style:{alignItems:'flex-start'},children:[ee,ne]}):(0,B.jsxs)(B.Fragment,{children:[ee,ne]}),(0,B.jsxs)(T.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[V?(0,B.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:K,onChangeText:X,style:[T.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>G(!0)}),(0,B.jsx)(b.default,{style:{flex:1,minWidth:220},children:(0,B.jsxs)(T.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==h.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]}),oe?(0,B.jsx)(H,{list:oe.list,busy:te,onYes:e=>{ie(e,oe.at)},onNo:()=>{const e=oe.at;le(null),ae(e,!0)},onClose:()=>le(null)}):null]})}function H({list:e,busy:t,onYes:s,onNo:o,onClose:a}){return(0,B.jsx)(T.Sheet,{visible:!0,onClose:a,title:"Booked party?",maxWidth:720,testID:"walkin-match",children:(0,B.jsxs)(b.default,{style:{gap:14},children:[e.map((e,o)=>(0,B.jsxs)(b.default,{testID:`walkin-match-${o}`,style:{gap:12,padding:16,borderRadius:16,borderWidth:2,borderColor:j.colours.gold,backgroundColor:'#15130F'},children:[(0,B.jsx)(b.default,{accessibilityRole:"header",accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:26,weight:"bold",colour:j.colours.goldLight,testID:"walkin-match-question",children:(0,z.walkInMatchQuestion)(e)})}),e.table?(0,B.jsxs)(T.T,{size:17,colour:j.colours.text,children:["Booked table ",(0,l.tableNumbers)(e.table)," \xb7 ",e.ref]}):(0,B.jsx)(T.T,{size:17,colour:j.colours.text,children:e.ref}),(0,B.jsx)(T.Button,{label:"Yes, seat booking",testID:"walkin-match-yes",disabled:t,accessibilityLabel:`Yes, seat ${e.name}'s booking, ${e.partySize} people`,onPress:()=>s(e),style:{minHeight:64}})]},e.id)),(0,B.jsx)(T.Button,{kind:"secondary",label:"No, new walk-in",testID:"walkin-match-no",disabled:t,onPress:o,style:{minHeight:64}})]})})}function _({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,p.useCtx)(15e3),n=L(o,i),c=(0,S.usePlan)(o),h=(0,f.useBookings)(o),y=(0,S.tablesOf)(e.table),w=d.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,y.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),v=d.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(w).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(c,h.filter(e=>e.date===(0,x.ymd)(i)),t,e.partySize,i,(0,k.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[c,h,w,e.partySize,i.getTime()]),[C,D]=(0,r.useState)(!!s||y.length>1),[I,$]=(0,r.useState)(y),P=e=>c.tables.find(t=>t.name===e)?.maxSeats??0,z=I.reduce((e,t)=>e+P(t),0),O=I.length>0&&z{const l=(0,S.joinTables)(s);await f.repo.bookings.assignTable(e.id,l);y.filter(e=>!s.includes(e)).forEach(t=>S.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&M(o,l),t()},F=C?(0,B.jsxs)(b.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,B.jsx)(b.default,{accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:17,weight:"semibold",colour:j.colours.text,children:I.length?`${(0,S.tablesLabel)((0,S.joinTables)(I))} \xb7 ${z} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,B.jsx)(b.default,{testID:"combine-short",children:(0,B.jsxs)(T.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-z," more needed. Add another table."]})}):null,(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,B.jsxs)(T.Row,{gap:8,wrap:!0,children:[(0,B.jsx)(T.Button,{label:"Done",testID:"combine-done",disabled:!I.length,accessibilityLabel:I.length?`Done, save ${(0,S.tableCardLabel)((0,S.joinTables)(I))}`:'Done',onPress:()=>N(I)}),(0,B.jsx)(T.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,B.jsx)(b.default,{style:{gap:8},testID:"assign-table-tip",children:(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`${C?'Combine tables':'Assign table'} \xb7 ${R(e)}`,testID:"assign-table-sheet",footer:F,children:[v&&!C?(0,B.jsx)(b.default,{testID:"assign-suggested",children:(0,B.jsxs)(T.T,{size:16,weight:"semibold",colour:j.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,S.tableCardLabel)(v)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(v)]})}):null,C?null:(0,B.jsx)(T.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>D(!0)}),(0,B.jsx)(W,{use:w,best:C?null:v,bestSet:(0,u.bestTables)(c),picked:C?I:void 0,onPick:C?e=>$(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await N([e])}})]})}function Y(e){(0,n.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${R(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>f.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function U({date:e,onClose:t,wide:n,onSaved:d}){const{rid:u,r:c,now:h,role:z,meId:O}=(0,p.useCtx)(6e4),N=(0,x.ymd)(h),[M,F]=(0,r.useState)(ee.blocks),[W,A]=(0,r.useState)(!1),[E,H]=(0,r.useState)(''),[_,Y]=(0,r.useState)(2),[U,q]=(0,r.useState)(null),[Q,V]=(0,r.useState)(''),[G,K]=(0,r.useState)(''),[X,J]=(0,r.useState)(''),[Z,ee]=(0,r.useState)('phone'),[te,se]=(0,r.useState)((0,D.emptyNeeds)()),oe=(0,D.needsMissing)(te),[le,ae]=(0,r.useState)(null),ie=(0,S.usePlan)(u),ne=(0,P.dogSetUp)(ie),re=!0===te.dog&&ne,de=te.dog?te.dogs:0,ue=(0,x.parseYmd)(M),ce=(0,k.turnFor)(_,c.settings.turnMins),be=L.filter(e=>e.date===M),he=e=>(0,k.freeTablesAt)(ie,be,_,new Date(`${M}${(0,l.tableNumbers)(e)}:00`),ce,c.settings.turnMins,{dog:!0,closed:(0,v.closedAreasAt)(R,u,M,e)}),ge=re&&U?he(U):[];(0,r.useEffect)(()=>{ae(null)},[re,U,_]);const pe=(0,y.bookingSlots)(c,ue,e=>L.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),_,M===(0,x.ymd)(h)?h:(0,x.addMins)(ue,0)),me=(0,w.ukPhone)(G),[fe,ye]=(0,r.useState)(!1),ke=U?pe.find(e=>e.time===U):void 0,xe=ke&&ke.left<_?{left:Math.max(0,ke.left),time:ke.time}:null,je=U?(0,v.blockAt)(R,u,M,U):void 0,we='staff'!==z,Te=!!U&&!(0,D.dogTimeOk)(c,L,M,U,de),Se=!oe.length&&E.trim().length>=2&&!!U&&(!xe||fe)&&(0,o.validParty)(_)&&me.ok&&(0,w.emailOk)(X)&&(!je||we&&W)&&(!re||ge.length>0)&&!Te,ve=te.wheelchair>0||te.stepFree;return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,x.niceDate)(ue)}`,maxWidth:n?760:void 0,testID:"booking-sheet",children:[(0,B.jsx)(D.FirstQuestions,{rid:u,value:te,onChange:se,party:_,audience:"staff"}),te.dog&&!ne?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,B.jsx)(C.BookingDatePicker,{r:c,today:h,value:M,onChange:e=>{e!==M&&(F(e),q(null),A(!1))}}),(0,B.jsxs)(T.Row,{gap:6,children:[(0,B.jsx)(T.Chip,{label:"Phone",selected:'phone'===Z,onPress:()=>ee('phone')}),(0,B.jsx)(T.Chip,{label:"In person",selected:'in-person'===Z,onPress:()=>ee('in-person')})]}),(0,B.jsx)(T.Field,{label:"Name",value:E,onChangeText:H,placeholder:"e.g. Reid",testID:"nb-name"}),(0,B.jsx)(T.Field,{label:"Mobile or phone number (needed)",value:G,onChangeText:K,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!me.ok&&G?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:me.error}):null,(0,B.jsx)(T.Field,{label:"Email (optional)",value:X,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,w.emailOk)(X)?null:(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,B.jsxs)(b.default,{style:{gap:6,alignItems:'center'},children:[(0,B.jsx)(T.T,{center:!0,children:"Covers"}),(0,B.jsx)(s.PartySizeInput,{value:_,onChange:e=>{Y(e),ye(!1)},label:"Covers",testID:"nb-party"})]}),(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:pe.map(e=>{const t=re&&e.available&&!he(e.time).length||!(0,D.dogTimeOk)(c,L,M,e.time,de);return(0,B.jsx)(T.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,v.blockAt)(R,u,M,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':e.left>0?`${e.left} left`:'Full',disabled:(e.past??!e.available)||t,selected:U===e.time,onPress:()=>{q(e.time),A(!1),ye(!1)}},e.time)})}),xe?(0,B.jsxs)(b.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overCapacityNote)(_,xe.left,xe.time)}),(0,B.jsx)(T.Chip,{label:fe?'Booking over the limit: on':'Book anyway (over the limit)',selected:fe,onPress:()=>ye(e=>!e),testID:"nb-over-ok"})]}):null,re&&U?(0,B.jsxs)(b.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,B.jsxs)(T.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,B.jsxs)(T.T,{size:13,colour:j.colours.muted,children:["(",ie.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),ge.length?(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:ge.slice(0,10).map((e,t)=>(0,B.jsx)(T.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${ve&&(0,P.accessibleSetUp)(ie)&&!(0,P.isAccessible)(ie,e.table)?' \xb7 not step-free':''}`,selected:(le??ge[0].table)===e.table,onPress:()=>ae(e.table)},e.table))}):(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["No dog-friendly table free for ",_," at ",U,". Try another time."]})]}):null,je?(0,B.jsxs)(b.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsxs)(T.T,{weight:"semibold",colour:j.colours.amber,children:["Bookings are paused ",je.from,"\u2013",je.to,je.reason?` (${je.reason})`:'']}),we?(0,B.jsx)(T.Chip,{label:W?'Manager override on':'Override and book anyway',selected:W,onPress:()=>A(e=>!e)}):(0,B.jsx)(T.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,pe.length?null:(0,B.jsx)(b.default,{testID:"nb-closed",children:(0,B.jsxs)(T.T,{size:14,weight:"semibold",colour:j.colours.amber,children:["Closed on ",(0,x.niceDate)(ue)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,B.jsx)(D.MoreQuestions,{rid:u,r:c,value:te,onChange:se,party:_,date:M,time:U,today:(0,x.ymd)(h),bookings:L,audience:"staff",showTables:!1!==c.settings.tableRequests}),ve&&!(0,P.accessibleSetUp)(ie)?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,B.jsx)(T.Field,{label:"Notes (optional)",value:Q,onChangeText:V,placeholder:I.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(c.settings),_)?(0,B.jsxs)(T.Muted,{children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(c.settings),_))," (",(0,a.gbp)((0,i.depositOf)(c.settings).perPersonPence)," per person for ",(0,i.depositOf)(c.settings).fromParty,"+). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,B.jsxs)(T.Muted,{children:["The guest gets a confirmation text",X.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Te?(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["We already have the most dogs we can look after at ",U,". Try another time: dogs are very welcome then."]}):null,(0,B.jsx)(T.Button,{label:oe.length?oe[0]:'Save booking',testID:"nb-save",disabled:!Se,onPress:()=>{if(M<(0,x.ymd)(h))return;const e=(0,D.needsPatch)(te),s=te.tableReq.find(e=>!re||ge.some(t=>t.table===e));f.repo.bookings.create({restaurantId:u,customerId:null,name:E.trim(),partySize:_,date:M,time:U,notes:Q.trim(),security:(0,i.depositDue)((0,i.depositOf)(c.settings),_)?'deposit':'none',depositPaid:0,...(0,i.depositDue)((0,i.depositOf)(c.settings),_)?{depositDue:(0,i.depositDue)((0,i.depositOf)(c.settings),_),depositPolicy:(0,i.depositWords)((0,i.depositOf)(c.settings),_,c.name).join(' '),depositRefundable:(0,i.depositOf)(c.settings).refundable,depositCutoffHours:(0,i.depositOf)(c.settings).cutoffHours}:{},phone:me.pretty,email:X.trim()||void 0,source:Z,...e,...pe.find(e=>e.time===U)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...re?{table:le??s??ge[0]?.table}:{}}).then(e=>(0,$.postNewBookingToKitchen)(e,O)).catch(()=>{}),d?.({date:M,time:U,name:E.trim()}),t()}})]})}},1113,[827,1114,1115,860,867,14,1116,34,859,402,102,872,1079,874,1117,1095,858,821,864,794,1021,1018,1118,1119,1124,1097,1091,1125,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return O}}),_e.useTableNames=N,_e.resetTableLive=M,_e.seatBookingNow=L,_e.finishBookingNow=async function(e,t){await f.repo.bookings.setStatus(t.id,'finished'),(0,S.tablesOf)(t.table).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=F,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return R}}),_e.TablePicker=W,_e.WalkInSheet=E,_e.WalkInMatchPrompt=H,_e.AssignTableSheet=_,_e.undoNotice=Y,_e.NewBookingSheet=U,_e.useFrontDoor=function(e,t){const[s,o]=(0,r.useState)(!1),[l,a]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>d({b:e}),combineTables:e=>d({b:e,combine:!0}),elements:(0,B.jsxs)(B.Fragment,{children:[s?(0,B.jsx)(E,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,B.jsx)(U,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,n.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,x.niceDate)((0,x.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,B.jsx)(_,{booking:i.b,combine:i.combine,onClose:()=>d(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=e(r),u=_r(_d[8]),c=e(_r(_d[9])),b=e(_r(_d[10])),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),w=_r(_d[18]),T=_r(_d[19]),S=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),D=_r(_d[23]),I=_r(_d[24]),$=_r(_d[25]),P=_r(_d[26]),z=_r(_d[27]),B=_r(_d[28]);const O=Array.from({length:12},(e,t)=>String(t+1));function N(e){const t=(0,S.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function M(e,t){(0,S.tablesOf)(t).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}async function L(e,t){await f.repo.bookings.setStatus(t.id,'seated'),M(e,t.table)}function F(e,t){const s=(0,f.useBookings)(e),o=(0,f.useOrders)(e),l=N(e),a=(0,S.useFloor)(t=>t.live[e])??{},i=(0,S.usePlan)(e),n=(0,v.useBlocks)(e=>e.blocks),r=(0,x.ymd)(t),d=(0,v.closedAreasAt)(n,e,r,(0,x.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,S.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,x.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const R=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function W({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:d}){const u=Object.keys(e),[h,p]=(0,r.useState)(0),f=i?6:8,y=i?64:o?92:76,k=h?Math.max(3,Math.floor((h+f)/(y+f))):0,x=k?Math.floor((h-f*(k-1))/k):y,w=new Set(n??[]),v=a?(0,S.tablesOf)(a)[0]:null;return(0,B.jsx)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:f},testID:"table-picker",onLayout:e=>p(Math.floor(e.nativeEvent.layout.width)),children:u.map(o=>{const a=e[o],n=t===o||!!d?.includes(o),r=w.has(o),u=v===o&&!n,h=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,B.jsxs)(c.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${d?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${r?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:x,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?j.colours.gold:a.busy?j.colours.red:j.colours.ok,backgroundColor:n?j.colours.goldTint:a.busy?j.colours.redBg:j.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,B.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,B.jsx)(T.T,{weight:"bold",size:22,colour:n?j.colours.goldLight:j.colours.text,children:(0,l.tableNumbers)(o)}),r?(0,B.jsx)(b.default,{testID:"best-table",style:{backgroundColor:j.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,B.jsx)(T.T,{size:11,weight:"bold",colour:j.colours.onGold,children:"BEST"})}):null]}),(0,B.jsx)(T.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:h})]},o)})})}const A=[1,2,3,4,5,6,7,8];function E({onClose:e,onSeated:a,wide:i,initialTable:y}){const{rid:w,r:C,now:D}=(0,p.useCtx)(15e3),I=F(w,D),[$,P]=(0,r.useState)(2),[O,N]=(0,r.useState)(!1),[R,E]=(0,r.useState)(y??null),_=(0,S.usePlan)(w),Y=(0,f.useBookings)(w),U=(0,v.useBlocks)(e=>e.blocks),q=(0,v.closedAreasAt)(U,w,(0,x.ymd)(D),(0,x.hm)(D)),Q=d.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(_,Y.filter(e=>e.date===(0,x.ymd)(D)),e,$,D,(0,k.turnFor)($,C.settings.turnMins),90,void 0,{closed:q})?.table??null},[_,Y,I,$,q.size,D.getTime()]);(0,r.useEffect)(()=>{R&&(0,S.tablesOf)(R).some(e=>'Closed'===I[e]?.label)&&E(null)},[R,q.size]);const[V,G]=(0,r.useState)(!1),[K,X]=(0,r.useState)(''),J=(e,t=String(e),s=()=>{N(!1),P(e)})=>{const o='9+'===t?O:!O&&$===e;return(0,B.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?j.colours.gold:'transparent'},children:(0,B.jsx)(T.T,{weight:"bold",size:22,colour:o?j.colours.onGold:j.colours.gold,children:t})},t)},Z=(0,B.jsx)(s.PartySizeInput,{value:$,onChange:P,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),ee=(0,B.jsxs)(b.default,{style:{gap:8,width:i?256:void 0},children:[(0,B.jsx)(T.T,{weight:"semibold",children:"How many people?"}),(0,B.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[A.map(e=>J(e)),J(9,'9+',()=>{N(!0),P(e=>e>=9?e:9)})]}),O?Z:null]}),[te,se]=(0,r.useState)(!1),[oe,le]=(0,r.useState)(null),ae=async(t=R,s=!1)=>{if(!te){if(!s){const e=(0,z.bookingsNearWalkIn)(Y,D,$);if(e.length)return void le({at:t,list:e})}se(!0);try{const s=await f.repo.bookings.seatWalkIn(w,$,t??void 0,K);M(w,t??void 0),a(s),e()}finally{se(!1)}}},ie=async(t,s)=>{if(!te){se(!0);try{const o=s??t.table??null;o&&o!==t.table&&await f.repo.bookings.assignTable(t.id,o),await L(w,{...t,table:o??void 0}),(0,n.notify)({id:`seated:${t.id}`,testID:'walkin-match-toast',timeoutMs:5e3,icon:'\u2713',title:`${t.name} seated \xb7 ${t.partySize} \xb7 ${o?(0,l.tableNumbers)(o):'table to assign'} (booking ${t.ref})`}),le(null),e()}finally{se(!1)}}},ne=(0,B.jsxs)(b.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,B.jsxs)(T.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(T.T,{weight:"semibold",children:["Table ",(0,B.jsx)(T.T,{colour:j.colours.muted,size:14,children:"(optional)"})]}),R?(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>E(null)}):null]}),(0,B.jsx)(W,{use:I,value:R,onPick:e=>{I[e]&&!I[e].busy?ae(e):E(R===e?null:e)},big:i,dense:i,best:Q,bestSet:(0,u.bestTables)(_)}),(0,B.jsxs)(T.Muted,{children:["Tap a free table to seat them there",Q&&!R?` (suggested for ${$}: ${(0,l.tableNumbers)(Q)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,x.hm)(D)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,B.jsx)(T.Button,{label:`Seat walk-in \xb7 ${$} ${1===$?'person':'people'}${R?` \xb7 ${(0,l.tableNumbers)(R)}`:''}`,disabled:te,onPress:()=>{ae()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,B.jsxs)(T.Row,{gap:16,style:{alignItems:'flex-start'},children:[ee,ne]}):(0,B.jsxs)(B.Fragment,{children:[ee,ne]}),(0,B.jsxs)(T.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[V?(0,B.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:K,onChangeText:X,style:[T.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>G(!0)}),(0,B.jsx)(b.default,{style:{flex:1,minWidth:220},children:(0,B.jsxs)(T.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==h.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]}),oe?(0,B.jsx)(H,{list:oe.list,busy:te,onYes:e=>{ie(e,oe.at)},onNo:()=>{const e=oe.at;le(null),ae(e,!0)},onClose:()=>le(null)}):null]})}function H({list:e,busy:t,onYes:s,onNo:o,onClose:a}){return(0,B.jsx)(T.Sheet,{visible:!0,onClose:a,title:"Booked party?",maxWidth:720,testID:"walkin-match",children:(0,B.jsxs)(b.default,{style:{gap:14},children:[e.map((e,o)=>(0,B.jsxs)(b.default,{testID:`walkin-match-${o}`,style:{gap:12,padding:16,borderRadius:16,borderWidth:2,borderColor:j.colours.gold,backgroundColor:'#15130F'},children:[(0,B.jsx)(b.default,{accessibilityRole:"header",accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:26,weight:"bold",colour:j.colours.goldLight,testID:"walkin-match-question",children:(0,z.walkInMatchQuestion)(e)})}),e.table?(0,B.jsxs)(T.T,{size:17,colour:j.colours.text,children:["Booked table ",(0,l.tableNumbers)(e.table)," \xb7 ",e.ref]}):(0,B.jsx)(T.T,{size:17,colour:j.colours.text,children:e.ref}),(0,B.jsx)(T.Button,{label:"Yes, seat booking",testID:"walkin-match-yes",disabled:t,accessibilityLabel:`Yes, seat ${e.name}'s booking, ${e.partySize} people`,onPress:()=>s(e),style:{minHeight:64}})]},e.id)),(0,B.jsx)(T.Button,{kind:"secondary",label:"No, new walk-in",testID:"walkin-match-no",disabled:t,onPress:o,style:{minHeight:64}})]})})}function _({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,p.useCtx)(15e3),n=F(o,i),c=(0,S.usePlan)(o),h=(0,f.useBookings)(o),y=(0,S.tablesOf)(e.table),w=d.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,y.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),v=d.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(w).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(c,h.filter(e=>e.date===(0,x.ymd)(i)),t,e.partySize,i,(0,k.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[c,h,w,e.partySize,i.getTime()]),[C,D]=(0,r.useState)(!!s||y.length>1),[I,$]=(0,r.useState)(y),P=e=>c.tables.find(t=>t.name===e)?.maxSeats??0,z=I.reduce((e,t)=>e+P(t),0),O=I.length>0&&z{const l=(0,S.joinTables)(s);await f.repo.bookings.assignTable(e.id,l);y.filter(e=>!s.includes(e)).forEach(t=>S.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&M(o,l),t()},L=C?(0,B.jsxs)(b.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,B.jsx)(b.default,{accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:17,weight:"semibold",colour:j.colours.text,children:I.length?`${(0,S.tablesLabel)((0,S.joinTables)(I))} \xb7 ${z} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,B.jsx)(b.default,{testID:"combine-short",children:(0,B.jsxs)(T.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-z," more needed. Add another table."]})}):null,(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,B.jsxs)(T.Row,{gap:8,wrap:!0,children:[(0,B.jsx)(T.Button,{label:"Done",testID:"combine-done",disabled:!I.length,accessibilityLabel:I.length?`Done, save ${(0,S.tableCardLabel)((0,S.joinTables)(I))}`:'Done',onPress:()=>N(I)}),(0,B.jsx)(T.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,B.jsx)(b.default,{style:{gap:8},testID:"assign-table-tip",children:(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`${C?'Combine tables':'Assign table'} \xb7 ${R(e)}`,testID:"assign-table-sheet",footer:L,children:[v&&!C?(0,B.jsx)(b.default,{testID:"assign-suggested",children:(0,B.jsxs)(T.T,{size:16,weight:"semibold",colour:j.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,S.tableCardLabel)(v)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(v)]})}):null,C?null:(0,B.jsx)(T.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>D(!0)}),(0,B.jsx)(W,{use:w,best:C?null:v,bestSet:(0,u.bestTables)(c),picked:C?I:void 0,onPick:C?e=>$(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await N([e])}})]})}function Y(e){(0,n.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${R(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>f.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function U({date:e,onClose:t,wide:n,onSaved:d}){const{rid:u,r:c,now:h,role:z,meId:O}=(0,p.useCtx)(6e4),N=(0,x.ymd)(h),[M,L]=(0,r.useState)(ee.blocks),[W,A]=(0,r.useState)(!1),[E,H]=(0,r.useState)(''),[_,Y]=(0,r.useState)(2),[U,q]=(0,r.useState)(null),[Q,V]=(0,r.useState)(''),[G,K]=(0,r.useState)(''),[X,J]=(0,r.useState)(''),[Z,ee]=(0,r.useState)('phone'),[te,se]=(0,r.useState)((0,D.emptyNeeds)()),oe=(0,D.needsMissing)(te),[le,ae]=(0,r.useState)(null),ie=(0,S.usePlan)(u),ne=(0,P.dogSetUp)(ie),re=!0===te.dog&&ne,de=te.dog?te.dogs:0,ue=(0,x.parseYmd)(M),ce=(0,k.turnFor)(_,c.settings.turnMins),be=F.filter(e=>e.date===M),he=e=>(0,k.freeTablesAt)(ie,be,_,new Date(`${M}${(0,l.tableNumbers)(e)}:00`),ce,c.settings.turnMins,{dog:!0,closed:(0,v.closedAreasAt)(R,u,M,e)}),ge=re&&U?he(U):[];(0,r.useEffect)(()=>{ae(null)},[re,U,_]);const pe=(0,y.bookingSlots)(c,ue,e=>F.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),_,M===(0,x.ymd)(h)?h:(0,x.addMins)(ue,0),e=>F.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),me=(0,w.ukPhone)(G),[fe,ye]=(0,r.useState)(!1),ke=U?pe.find(e=>e.time===U):void 0,xe=ke&&ke.left<_?{left:Math.max(0,ke.left),time:ke.time}:null,je=ke&&null!=ke.partiesLeft&&ke.partiesLeft<1?{time:ke.time,cap:ke.partiesCap??0}:null,we=xe||je,Te=U?(0,v.blockAt)(R,u,M,U):void 0,Se='staff'!==z,ve=!!U&&!(0,D.dogTimeOk)(c,F,M,U,de),Ce=!oe.length&&E.trim().length>=2&&!!U&&(!we||fe)&&(0,o.validParty)(_)&&me.ok&&(0,w.emailOk)(X)&&(!Te||Se&&W)&&(!re||ge.length>0)&&!ve,De=te.wheelchair>0||te.stepFree;return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,x.niceDate)(ue)}`,maxWidth:n?760:void 0,testID:"booking-sheet",children:[(0,B.jsx)(D.FirstQuestions,{rid:u,value:te,onChange:se,party:_,audience:"staff"}),te.dog&&!ne?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,B.jsx)(C.BookingDatePicker,{r:c,today:h,value:M,onChange:e=>{e!==M&&(L(e),q(null),A(!1))}}),(0,B.jsxs)(T.Row,{gap:6,children:[(0,B.jsx)(T.Chip,{label:"Phone",selected:'phone'===Z,onPress:()=>ee('phone')}),(0,B.jsx)(T.Chip,{label:"In person",selected:'in-person'===Z,onPress:()=>ee('in-person')})]}),(0,B.jsx)(T.Field,{label:"Name",value:E,onChangeText:H,placeholder:"e.g. Reid",testID:"nb-name"}),(0,B.jsx)(T.Field,{label:"Mobile or phone number (needed)",value:G,onChangeText:K,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!me.ok&&G?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:me.error}):null,(0,B.jsx)(T.Field,{label:"Email (optional)",value:X,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,w.emailOk)(X)?null:(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,B.jsxs)(b.default,{style:{gap:6,alignItems:'center'},children:[(0,B.jsx)(T.T,{center:!0,children:"Covers"}),(0,B.jsx)(s.PartySizeInput,{value:_,onChange:e=>{Y(e),ye(!1)},label:"Covers",testID:"nb-party"})]}),(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:pe.map(e=>{const t=re&&e.available&&!he(e.time).length||!(0,D.dogTimeOk)(c,F,M,e.time,de);return(0,B.jsx)(T.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,v.blockAt)(R,u,M,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:U===e.time,onPress:()=>{q(e.time),A(!1),ye(!1)}},e.time)})}),we?(0,B.jsxs)(b.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[xe?(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overCapacityNote)(_,xe.left,xe.time)}):null,je?(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overPartiesNote)(je.time,je.cap)}):null,(0,B.jsx)(T.Chip,{label:fe?'Booking over the limit: on':'Book anyway (over the limit)',selected:fe,onPress:()=>ye(e=>!e),testID:"nb-over-ok"})]}):null,re&&U?(0,B.jsxs)(b.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,B.jsxs)(T.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,B.jsxs)(T.T,{size:13,colour:j.colours.muted,children:["(",ie.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),ge.length?(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:ge.slice(0,10).map((e,t)=>(0,B.jsx)(T.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${De&&(0,P.accessibleSetUp)(ie)&&!(0,P.isAccessible)(ie,e.table)?' \xb7 not step-free':''}`,selected:(le??ge[0].table)===e.table,onPress:()=>ae(e.table)},e.table))}):(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["No dog-friendly table free for ",_," at ",U,". Try another time."]})]}):null,Te?(0,B.jsxs)(b.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsxs)(T.T,{weight:"semibold",colour:j.colours.amber,children:["Bookings are paused ",Te.from,"\u2013",Te.to,Te.reason?` (${Te.reason})`:'']}),Se?(0,B.jsx)(T.Chip,{label:W?'Manager override on':'Override and book anyway',selected:W,onPress:()=>A(e=>!e)}):(0,B.jsx)(T.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,pe.length?null:(0,B.jsx)(b.default,{testID:"nb-closed",children:(0,B.jsxs)(T.T,{size:14,weight:"semibold",colour:j.colours.amber,children:["Closed on ",(0,x.niceDate)(ue)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,B.jsx)(D.MoreQuestions,{rid:u,r:c,value:te,onChange:se,party:_,date:M,time:U,today:(0,x.ymd)(h),bookings:F,audience:"staff",showTables:!1!==c.settings.tableRequests}),De&&!(0,P.accessibleSetUp)(ie)?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,B.jsx)(T.Field,{label:"Notes (optional)",value:Q,onChangeText:V,placeholder:I.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(c.settings),_)?(0,B.jsxs)(T.Muted,{children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(c.settings),_))," (",(0,a.gbp)((0,i.depositOf)(c.settings).perPersonPence)," per person for ",(0,i.depositOf)(c.settings).fromParty,"+). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,B.jsxs)(T.Muted,{children:["The guest gets a confirmation text",X.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),ve?(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["We already have the most dogs we can look after at ",U,". Try another time: dogs are very welcome then."]}):null,(0,B.jsx)(T.Button,{label:oe.length?oe[0]:'Save booking',testID:"nb-save",disabled:!Ce,onPress:()=>{if(M<(0,x.ymd)(h))return;const e=(0,D.needsPatch)(te),s=te.tableReq.find(e=>!re||ge.some(t=>t.table===e));f.repo.bookings.create({restaurantId:u,customerId:null,name:E.trim(),partySize:_,date:M,time:U,notes:Q.trim(),security:(0,i.depositDue)((0,i.depositOf)(c.settings),_)?'deposit':'none',depositPaid:0,...(0,i.depositDue)((0,i.depositOf)(c.settings),_)?{depositDue:(0,i.depositDue)((0,i.depositOf)(c.settings),_),depositPolicy:(0,i.depositWords)((0,i.depositOf)(c.settings),_,c.name).join(' '),depositRefundable:(0,i.depositOf)(c.settings).refundable,depositCutoffHours:(0,i.depositOf)(c.settings).cutoffHours}:{},phone:me.pretty,email:X.trim()||void 0,source:Z,...e,...pe.find(e=>e.time===U)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...re?{table:le??s??ge[0]?.table}:{}}).then(e=>(0,$.postNewBookingToKitchen)(e,O)).catch(()=>{}),d?.({date:M,time:U,name:E.trim()}),t()}})]})}},1113,[827,1114,1115,860,867,14,1116,34,859,402,102,872,1079,874,1117,1095,858,821,864,794,1021,1018,1118,1119,1124,1097,1091,1125,25]); __d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PartySizeInput=function({value:e,onChange:p,min:b=s.MIN_PARTY,max:y=s.MAX_PARTY,label:f="Party size",testID:h="party-size"}){const[x,$]=(0,t.useState)(String(e));(0,t.useEffect)(()=>{$(String(e))},[e]);const w=e=>p((0,s.clampParty)(e,b,y)),I=(t,n,l)=>{const s=t<0?e<=b:e>=y;return(0,d.jsx)(o.default,{testID:`${h}-${t>0?'up':'down'}${10===Math.abs(t)?'10':''}`,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:s},disabled:s,onPress:()=>w(e+t),hitSlop:4,style:{minWidth:44,height:44,paddingHorizontal:8,borderRadius:22,borderWidth:1.5,borderColor:c.colours.gold,alignItems:'center',justifyContent:'center',opacity:s?.4:1},children:(0,d.jsx)(u.T,{size:10===Math.abs(t)?14:20,weight:"semibold",colour:c.colours.gold,center:!0,children:n})},t)};return(0,d.jsxs)(l.default,{testID:h,style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap',justifyContent:'center'},children:[y-b>=20?I(-10,'\u221210',"10 fewer people"):null,I(-1,'\u2212','One fewer person'),(0,d.jsx)(n.default,{testID:`${h}-input`,value:x,keyboardType:"number-pad",inputMode:"numeric",maxLength:3,selectTextOnFocus:!0,accessibilityLabel:`${f}, ${b} to ${y} people`,accessibilityValue:{min:b,max:y,now:e,text:`${e} ${1===e?'person':'people'}`},onChangeText:e=>{$(e.replace(/\D/g,'')),e.replace(/\D/g,'')&&w((0,s.partyFromText)(e,b,y))},onBlur:()=>{const e=(0,s.partyFromText)(x,b,y);$(String(e)),w(e)},style:{width:64,height:44,borderRadius:10,borderWidth:1,borderColor:c.colours.border,color:c.colours.text,backgroundColor:c.colours.surface,textAlign:'center',fontSize:20,fontFamily:c.fonts.semibold}}),I(1,'+','One more person'),y-b>=20?I(10,'+10',"10 more people"):null]})};var t=r(_d[0]),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),s=r(_d[4]),c=r(_d[5]),u=r(_d[6]),d=r(_d[7])},1114,[34,402,412,102,1115,821,794,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const f=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(f)?f:u))},f=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),b=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`},1115,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overPartiesNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const s=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(s)?s:u))},s=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),f=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`,b=(t,n)=>`${t} already has the most bookings we take at one start time (${n}). Booking another goes over the venue\u2019s limit: check tables and staffing.`},1115,[]); __d(function(g,r,i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"dismissNotice",{enumerable:!0,get:function(){return u.dismissNotice}}),Object.defineProperty(_e,"notify",{enumerable:!0,get:function(){return u.notify}}),Object.defineProperty(_e,"useSliders",{enumerable:!0,get:function(){return u.useSliders}}),Object.defineProperty(_e,"SLIDER",{enumerable:!0,get:function(){return j}}),_e.SliderButton=k,_e.SliderCard=C,_e.SliderHost=function(){y();const e=(0,u.useSliders)(e=>e.queue),n=e[0],o=(0,t.useRef)(null);(0,t.useEffect)(()=>{if(p)return window.ccSlider=e=>(0,u.notify)(e),()=>{delete window.ccSlider}},[]),(0,t.useEffect)(()=>{if(o.current&&clearTimeout(o.current),!n)return;const e=void 0!==n.timeoutMs?n.timeoutMs:n.actions?.length||n.content?null:6e3;return e&&(o.current=setTimeout(()=>u.useSliders.getState().dismiss(n.id),e)),()=>{o.current&&clearTimeout(o.current)}},[n?.id,n?.timeoutMs]);const[l,c]=(0,t.useState)(0);if((0,t.useEffect)(()=>{if(!p||!n)return;const e=()=>{const e=document.querySelector('[data-testid="app-bottom-tabs"]');c(e?Math.max(0,Math.round(window.innerHeight-e.getBoundingClientRect().top)):0)};e();const t=setTimeout(e,300);return window.addEventListener('resize',e),()=>{clearTimeout(t),window.removeEventListener('resize',e)}},[n?.id]),!n)return null;const a=p?'fixed':'absolute';return(0,f.jsxs)(f.Fragment,{children:[n.modal?(0,f.jsx)(s.default,{...x('dim'),style:{position:a,left:0,right:0,top:0,bottom:0,zIndex:2147482990,backgroundColor:'rgba(0,0,0,0.72)'}}):null,(0,f.jsx)(s.default,{testID:"cc-slider-host",pointerEvents:"box-none",style:{position:a,left:12,right:12,bottom:12,zIndex:2147483e3,alignItems:'center',...p?{bottom:l?`${12+l}px`:'calc(12px + env(safe-area-inset-bottom))'}:{}},children:(0,f.jsx)(C,{n:n,waiting:e.length-1,onClose:()=>u.useSliders.getState().dismiss(n.id)},n.id+':'+(n.seq??0))})]})};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),s=e(r(d[4])),l=e(r(d[5])),c=r(d[6]),a=r(d[7]),u=r(d[8]),b=r(d[9]),f=r(d[10]);const p='undefined'!=typeof document,h="\n[data-ccsl=\"in\"]{animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both}\n@keyframes ccsl-in{from{opacity:0;transform:translate3d(0,110%,0)}to{opacity:1;transform:none}}\n[data-ccsl=\"urgent\"]{animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both,ccsl-red 1.6s ease-in-out .45s infinite}\n@keyframes ccsl-red{0%,100%{box-shadow:0 10px 30px rgba(0,0,0,.6),0 0 0 1px rgba(255,107,94,.55)}50%{box-shadow:0 10px 40px rgba(0,0,0,.6),0 0 0 2px #FF6B5E,0 0 34px rgba(255,107,94,.45)}}\n[data-ccsl=\"dim\"]{animation:ccsl-dim .3s ease both}\n@keyframes ccsl-dim{from{opacity:0}to{opacity:1}}\n@media (prefers-reduced-motion: reduce){[data-ccsl]{animation:none !important}}\n",x=e=>p?{dataSet:{ccsl:e}}:{};function y(){(0,t.useEffect)(()=>{if(!p||document.getElementById('cc-slider-css'))return;const e=document.createElement('style');e.id='cc-slider-css',e.textContent=h,document.head.appendChild(e)},[])}const j={bg:'#17140F',border:'rgba(207,164,95,.55)',text:'#F5F1E8',quiet:'#A89A80',gold:c.colours.gold,ink:'#17130D'},w=(e="normal")=>'urgent'===e?c.colours.red:'warn'===e?c.colours.amber:c.colours.gold,S=(e="normal")=>'urgent'===e?'rgba(255,107,94,.75)':'warn'===e?'rgba(255,181,71,.65)':j.border;function k({a:e,onDone:t,big:o}){const s=e.kind??'primary';return(0,f.jsx)(n.default,{testID:e.testID,accessibilityRole:"button",accessibilityLabel:e.label,onPress:()=>{try{e.onPress?.()}finally{e.keepOpen||t()}},style:({pressed:e})=>({minHeight:o?56:44,minWidth:44,paddingHorizontal:'ghost'===s?10:o?24:18,borderRadius:12,alignItems:'center',justifyContent:'center',backgroundColor:'primary'===s?j.gold:'transparent',borderWidth:'danger'===s?1:0,borderColor:c.colours.red,opacity:e?.8:1}),children:(0,f.jsx)(a.T,{size:o?18:'ghost'===s?14:15,weight:'primary'===s?'bold':'medium',colour:'primary'===s?j.ink:'danger'===s?c.colours.red:j.quiet,children:e.label})})}function C({n:e,onClose:t,waiting:n=0,maxWidth:c=520}){y();const u=e.tone??'normal',h=w(u),C=e.content,z=!!e.big,{height:I}=(0,l.default)(),D=e.actions??[];return(0,f.jsxs)(s.default,{testID:e.testID??'cc-slider',accessibilityRole:"summary",accessibilityLabel:`${e.kicker?e.kicker+': ':''}${e.title}`,...x('urgent'===u?'urgent':'in'),style:{width:'100%',maxWidth:z?Math.max(c,900):c,alignSelf:'center',borderRadius:14,backgroundColor:j.bg,borderWidth:1,borderColor:S(u),overflow:'hidden',...p?{boxShadow:'0 10px 30px rgba(0,0,0,.6)'}:{elevation:12}},children:['normal'!==u?(0,f.jsx)(s.default,{style:{position:'absolute',left:0,top:0,bottom:0,width:5,backgroundColor:h}}):null,(0,f.jsxs)(o.default,{style:{maxHeight:Math.max(220,I-40)},contentContainerStyle:{paddingVertical:z?18:12,paddingLeft:'normal'!==u?z?24:18:z?20:14,paddingRight:z?20:14,gap:z?10:6},children:[(0,f.jsxs)(s.default,{style:{flexDirection:'row',alignItems:'center',gap:12},children:[e.icon?(0,f.jsx)(a.T,{size:z?34:22,children:e.icon}):null,(0,f.jsxs)(s.default,{style:{flex:1,gap:2},children:[e.kicker?(0,f.jsx)(a.T,{size:z?15:11,weight:"bold",colour:h,style:{letterSpacing:1.4},children:e.kicker}):null,(0,f.jsx)(a.T,{size:z?24:15,weight:"medium",colour:j.text,children:e.title}),e.body?(0,f.jsx)(a.T,{size:z?18:13,colour:j.quiet,children:e.body}):null]}),D.length||C?null:(0,f.jsx)(b.ToastClose,{testID:"cc-slider-ok",label:`Close: ${e.title}`,onPress:t,size:z?'lg':'md',colour:j.quiet})]}),C?(0,f.jsx)(C,{close:t}):null,D.length?(0,f.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',alignItems:'center',gap:8,justifyContent:'flex-end'},children:D.map(e=>(0,f.jsx)(k,{a:e,onDone:t,big:z},e.label))}):null,n>0?(0,f.jsxs)(a.T,{size:z?14:11,colour:j.quiet,center:!0,style:{alignSelf:'stretch'},children:[n," more waiting"]}):null]})]})}},1116,[34,236,402,295,102,426,821,794,998,796,25]); -__d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.bookingSlotMinutesOf=s,Object.defineProperty(e,"COVERS_WINDOW_MINS",{enumerable:!0,get:function(){return r}}),e.coversInHalfHour=l,e.takeawaySlots=function(o,s,r){const l=(0,t.hoursFor)(o,r);if(!l)return[];const u=o.settings.slotMinutes,c=(0,n.addMins)(r,o.settings.leadMins),f=[];for(let t=new Date(l.open);t<=l.close;t=(0,n.addMins)(t,u)){if(tn.restaurantId===o.id&&'takeaway'===n.type&&'cancelled'!==n.status&&n.slotTime&&new Date(n.slotTime).getTime()===t.getTime()).length;f.push({time:new Date(t),label:(0,n.hm)(t),taken:r,cap:o.settings.slotCap,full:r>=o.settings.slotCap})}return f},e.bookingSlots=function(r,c,f,d,m){const p=(0,t.hoursFor)(r,c);if(!p)return[];const M=[],S=p.close,b=(0,o.lastFoodOn)(r,u(c)),h=b?(0,n.atTime)(c,b.time):S,k='drinks'===(0,o.afterLastFood)(r),O=s(r);for(let t=new Date(p.open);t<=S;t=(0,n.addMins)(t,O)){const o=(0,n.hm)(t),s=t>h;if(s&&!k)continue;const u=r.settings.bookingCoversPerSlot-l(f,o),c=t.getTime()=d,past:c,...s?{drinksOnly:!0}:{}})}return M};var t=_r(_d[0]),n=_r(_d[1]),o=_r(_d[2]);function s(t){const n=t.settings.bookingSlotMinutes;return 5===n||10===n||15===n||20===n||30===n?n:15}const r=30;function l(t,o){const s=Math.floor((0,n.toMins)(o)/r)*r;let l=0;for(let o=0;o`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},1117,[878,858,877]); +__d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.bookingSlotMinutesOf=s,e.bookingNoticeMinsOf=r,e.bookingCoversPerStartOf=u,e.bookingPartiesPerStartOf=l,e.onlinePartyBounds=c,Object.defineProperty(e,"COVERS_WINDOW_MINS",{enumerable:!0,get:function(){return f}}),e.coversInHalfHour=m,e.countInStartSlot=p,e.bookingLimitsHint=function(t){const n=s(t),o=u(t),f=l(t),m=r(t),p=c(t);if(null!=o||null!=f){const t=[];return null!=o&&null!=f?t.push(`up to ${o} people and ${f} bookings at each start time`):null!=o?t.push(`up to ${o} people at each start time`):t.push(`up to ${f} bookings at each start time`),(p.max<100||p.min>1)&&t.push(`parties of ${p.min} to ${p.max}`),t.push(`from ${m} minutes ahead`),t.push('table rules still apply'),`Times are every ${n} minutes: ${t.join(', ')}.`}return`Times are every ${n} minutes. Covers per slot (${t.settings.bookingCoversPerSlot} per half hour) and table rules still apply.`},e.takeawaySlots=function(o,s,r){const u=(0,t.hoursFor)(o,r);if(!u)return[];const l=o.settings.slotMinutes,c=(0,n.addMins)(r,o.settings.leadMins),f=[];for(let t=new Date(u.open);t<=u.close;t=(0,n.addMins)(t,l)){if(tn.restaurantId===o.id&&'takeaway'===n.type&&'cancelled'!==n.status&&n.slotTime&&new Date(n.slotTime).getTime()===t.getTime()).length;f.push({time:new Date(t),label:(0,n.hm)(t),taken:r,cap:o.settings.slotCap,full:r>=o.settings.slotCap})}return f},e.bookingSlots=function(c,f,d,h,k,M=()=>0){const y=(0,t.hoursFor)(c,f);if(!y)return[];const S=[],$=y.close,P=(0,o.lastFoodOn)(c,b(f)),v=P?(0,n.atTime)(f,P.time):$,I='drinks'===(0,o.afterLastFood)(c),O=s(c),C=r(c),N=u(c),T=l(c);for(let t=new Date(y.open);t<=$;t=(0,n.addMins)(t,O)){const o=(0,n.hm)(t),s=t>v;if(s&&!I)continue;const r=null!=N?p(d,o,O):m(d,o),u=(N??c.settings.bookingCoversPerSlot)-r,l=null!=T?p(M,o,O):0,f=null!=T?T-l:void 0,b=t.getTime()=1;S.push({time:o,left:u,available:!b&&u>=h&&y,past:b,...s?{drinksOnly:!0}:{},...null!=f?{partiesLeft:f,partiesCap:T}:{}})}return S};var t=_r(_d[0]),n=_r(_d[1]),o=_r(_d[2]);function s(t){const n=t.settings.bookingSlotMinutes;return 5===n||10===n||15===n||20===n||30===n?n:15}function r(t){const n=t.settings.bookingNoticeMins;return'number'==typeof n&&Number.isInteger(n)&&n>=0&&n<=1440?n:30}function u(t){const n=t.settings.bookingCoversPerStart;return'number'==typeof n&&Number.isInteger(n)&&n>0&&n<=200?n:null}function l(t){const n=t.settings.bookingPartiesPerStart;return'number'==typeof n&&Number.isInteger(n)&&n>0&&n<=50?n:null}function c(t){const n=t.settings.onlinePartyMin,o=t.settings.onlinePartyMax,s='number'==typeof n&&Number.isInteger(n)&&n>=1&&n<=100?n:1;return{min:s,max:'number'==typeof o&&Number.isInteger(o)&&o>=s&&o<=100?o:100}}const f=30;function m(t,o){const s=Math.floor((0,n.toMins)(o)/f)*f;let r=0;for(let o=0;o`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},1117,[878,858,877]); __d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.nextDays=c,Object.defineProperty(_e,"openOn",{enumerable:!0,get:function(){return u}}),_e.BookingDatePicker=function({r:e,today:l,value:b,onChange:m}){const[f,x]=(0,t.useState)(!1),p=(0,r.ymd)(l),j=c(l,9),D=(e,t)=>0===t?'Today':1===t?'Tomorrow':`${(0,r.dayShort)(e)} ${e.getDate()}`,w=j.some(e=>(0,r.ymd)(e)===b),C=(0,r.parseYmd)(b),[P,T]=(0,t.useState)(()=>({y:C.getFullYear(),m:C.getMonth()})),v=(new Date(P.y,P.m,1,12).getDay()+6)%7,M=new Date(P.y,P.m+1,0).getDate(),R=[...Array.from({length:v},()=>null),...Array.from({length:M},(e,t)=>new Date(P.y,P.m,t+1,12))];for(;R.length%7;)R.push(null);const k=12*(P.y-l.getFullYear())+P.m-l.getMonth(),F=e=>T(({y:t,m:o})=>{const s=new Date(t,o+e,1);return{y:s.getFullYear(),m:s.getMonth()}});return(0,i.jsxs)(s.default,{testID:"nb-date",style:{gap:6},children:[(0,i.jsxs)(d.Row,{wrap:!0,gap:6,children:[j.map((t,o)=>(0,i.jsx)(d.Chip,{label:D(t,o),sub:u(e,t)?void 0:'Closed',selected:b===(0,r.ymd)(t),onPress:()=>{m((0,r.ymd)(t)),x(!1)}},(0,r.ymd)(t))),w?null:(0,i.jsx)(d.Chip,{label:(0,r.niceDate)(C),sub:u(e,C)?void 0:'Closed',selected:!0,onPress:()=>x(!0)}),(0,i.jsx)(d.Chip,{label:f?'Close calendar':'\ud83d\udcc5 Pick date',selected:f,onPress:()=>{f||T({y:C.getFullYear(),m:C.getMonth()}),x(!f)}})]}),f?(0,i.jsxs)(s.default,{testID:"nb-calendar",style:{borderWidth:1,borderColor:n.colours.border,borderRadius:14,padding:10,gap:6,backgroundColor:n.colours.surface2,maxWidth:420},children:[(0,i.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,i.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Previous month",disabled:k<=0,onPress:()=>F(-1),style:{padding:8,opacity:k<=0?.3:1},children:(0,i.jsx)(d.T,{size:20,colour:n.colours.gold,children:"\u2039"})}),(0,i.jsxs)(d.T,{weight:"semibold",children:[(0,r.monthLong)(P.m)," ",P.y]}),(0,i.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Next month",disabled:k>=h,onPress:()=>F(1),style:{padding:8,opacity:k>=h?.3:1},children:(0,i.jsx)(d.T,{size:20,colour:n.colours.gold,children:"\u203a"})})]}),(0,i.jsx)(s.default,{style:{flexDirection:'row'},children:y.map(e=>(0,i.jsx)(d.T,{size:12,colour:n.colours.muted,center:!0,style:{flex:1},children:e},e))}),Array.from({length:R.length/7},(t,l)=>(0,i.jsx)(s.default,{style:{flexDirection:'row',gap:4},children:R.slice(7*l,7*l+7).map((t,l)=>{if(!t)return(0,i.jsx)(s.default,{style:{flex:1,height:40}},l);const c=(0,r.ymd)(t),y=c{m(c),x(!1)},style:{flex:1,height:40,borderRadius:10,alignItems:'center',justifyContent:'center',borderWidth:c===p?1.5:0,borderColor:n.colours.gold,backgroundColor:h?n.colours.gold:'transparent',opacity:y?.3:1},children:(0,i.jsx)(d.T,{size:15,weight:h?'bold':'regular',colour:h?n.colours.onGold:f?n.colours.muted:n.colours.text,style:f&&!y?{textDecorationLine:'line-through'}:void 0,children:t.getDate()})},l)})},l)),(0,i.jsx)(d.Muted,{children:"Past dates can\u2019t be booked. Crossed-out days: closed (per the venue\u2019s hours)."})]}):null]})};var t=_r(_d[0]),o=e(_r(_d[1])),s=e(_r(_d[2])),l=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),d=_r(_d[6]),i=_r(_d[7]);function c(e,t){const o=new Date(e);return o.setHours(12,0,0,0),Array.from({length:t},(e,t)=>{const s=new Date(o);return s.setDate(o.getDate()+t),s})}const u=(e,t)=>!!(0,l.hoursFor)(e,t),y=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],h=12},1118,[34,402,102,878,858,821,794,25]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"emptyNeeds",{enumerable:!0,get:function(){return w}}),_e.needsMissing=function(e,l=[]){const s=[];null===e.allergy?s.push('Answer the allergy question first'):'yes'!==e.allergy||e.allergens.length||l.length||e.allergyNote.trim()||s.push('Pick the allergens or describe them');null===e.dog&&s.push('Say whether a dog is coming');return s},_e.needsPatch=function(e,l=[]){const s='yes'===e.allergy?e.allergens.filter(e=>!l.some(l=>l.allergen===e)).map(l=>({allergen:l,severity:e.severity})):[],t=Object.entries(e.holds).filter(([,e])=>e>0).map(([e,l])=>({kind:e.startsWith('item:')?'item':'stock',id:e.slice(5),qty:l})),a=e.dog?Math.max(1,e.dogs):0,n={...e.wheelchair?{wheelchair:e.wheelchair}:{},...e.stepFree?{stepFree:!0}:{},...e.toilet?{toilet:!0}:{},...e.assistDog?{assistDog:!0}:{},...e.accessNote.trim()?{note:e.accessNote.trim()}:{}},r={...e.vegan?{vegan:e.vegan}:{},...e.vegetarian?{vegetarian:e.vegetarian}:{}};return{allergies:[...l,...s],allergyNone:'none'===e.allergy&&!l.length||void 0,allergyPeople:'yes'===e.allergy?e.allergyPeople:void 0,allergyNote:'yes'===e.allergy&&e.allergyNote.trim()?e.allergyNote.trim():void 0,dog:a>0,dogs:a||void 0,access:Object.keys(n).length?n:void 0,diet:Object.keys(r).length?r:void 0,holds:t.length?t:void 0,tableReq:e.tableReq.length?e.tableReq:void 0}},_e.FirstQuestions=function({rid:e,value:l,onChange:a,party:r,audience:i,profile:o=[]}){const y=e=>a({...l,...e}),b=(0,p.usePlan)(e),[x,j]=(0,t.useState)(!1),k=(0,s.dogQuestionOn)((0,u.useRestaurant)(e));(0,t.useEffect)(()=>{k||null!==l.dog||a({...l,dog:!1})},[k,l.dog]);const w=x?m.ALLERGENS:m.ALLERGENS.filter(e=>['gluten','milk','peanuts','treenuts','crustaceans','molluscs','fish','eggs','sesame'].includes(e.id)||l.allergens.includes(e.id)),q=[...o.map(e=>e.allergen),...l.allergens],M=(0,f.dogSetUp)(b);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(R,{tone:"red",testID:"q-allergens",children:[(0,v.jsx)(C,{sub:'guest'===i?'We ask everyone first, so the kitchen can keep you safe.':'Ask every guest first. It goes to the kitchen in red.',children:"\u26a0\ufe0f Does anyone in the party have a food allergy?"}),o.length?(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:o.map(e=>(0,v.jsx)(h.Badge,{kind:"red",label:`${m.ALLERGENS.find(l=>l.id===e.allergen)?.short} (from your profile)`},e.allergen))}):null,(0,v.jsxs)(h.Row,{gap:8,children:[(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"No allergies",selected:'none'===l.allergy,onPress:()=>y({allergy:'none',allergens:[]})})}),(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"Yes, allergies",selected:'yes'===l.allergy,onPress:()=>y({allergy:'yes'})})})]}),'none'===l.allergy&&o.length?(0,v.jsx)(h.Muted,{children:"Your profile allergies above are still shared with the kitchen."}):null,'yes'===l.allergy?(0,v.jsxs)(n.default,{style:{gap:10},testID:"allergen-picker",children:[(0,v.jsx)(h.T,{size:14,weight:"semibold",children:"Which allergens? (the 14 UK allergens)"}),(0,v.jsxs)(h.Row,{wrap:!0,gap:6,children:[w.map(e=>(0,v.jsx)(h.Chip,{label:e.short,selected:l.allergens.includes(e.id)||o.some(l=>l.allergen===e.id),disabled:o.some(l=>l.allergen===e.id),onPress:()=>y({allergens:l.allergens.includes(e.id)?l.allergens.filter(l=>l!==e.id):[...l.allergens,e.id]})},e.id)),x?null:(0,v.jsx)(h.Chip,{label:"All 14\u2026",onPress:()=>j(!0)})]}),(0,v.jsx)(h.T,{size:14,weight:"semibold",children:"How serious?"}),(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:m.SEVERITIES.map(e=>(0,v.jsx)(h.Chip,{label:e.label,selected:l.severity===e.id,onPress:()=>y({severity:e.id})},e.id))}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"How many people with allergies?"}),(0,v.jsx)(h.Stepper,{value:Math.min(l.allergyPeople,r),onChange:e=>y({allergyPeople:e}),min:1,max:Math.max(1,r),label:"people with allergies"})]}),(0,v.jsx)(h.Field,{label:"Anything else the kitchen should know? (optional)",value:l.allergyNote,onChangeText:e=>y({allergyNote:e}),placeholder:"e.g. traces of sesame, one child with coeliac disease",testID:"allergy-note"}),q.length?(0,v.jsx)(c.MenuAllergyCheck,{rid:e,allergens:q,audience:i}):null]}):null]}),k?(0,v.jsxs)(R,{tone:"gold",testID:"q-dogs",children:[(0,v.jsx)(C,{sub:M?'Well-behaved dogs are welcome at our dog-friendly tables.':'staff'===i?'Dog-friendly tables aren\u2019t marked yet (Managers \u203a Booking options), so any table is offered for now.':void 0,children:"\ud83d\udc15 Are you bringing a dog?"}),(0,v.jsxs)(h.Row,{gap:8,children:[(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"No",selected:!1===l.dog,onPress:()=>y({dog:!1})})}),(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"Yes",selected:!0===l.dog,onPress:()=>y({dog:!0,dogs:Math.max(1,l.dogs)})})})]}),l.dog?(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"How many dogs?"}),(0,v.jsx)(h.Stepper,{value:l.dogs,onChange:e=>y({dogs:e}),min:1,max:4,label:"dogs"})]}):null]}):null]})},_e.useReserveAvailability=q,_e.MoreQuestions=function({rid:e,r:l,value:a,onChange:r,party:i,date:o,time:c,today:y,bookings:m,audience:b,showTables:x}){const j=e=>r({...a,...e}),w=l.settings,S=(0,u.useMenu)(e),P=(0,t.useMemo)(()=>S.filter(e=>/\((V|VG|Ve)\)|vegan|vegetarian/i.test(`${e.name} ${e.tags?.join(' ')??''}`)).slice(0,4),[S.length]),N=q(e,l,o,y,m,b),T=e=>a.holds[e]??0,D=(0,f.stockNeed)({holds:Object.entries(a.holds).map(([e,l])=>({kind:e.startsWith('item:')?'item':'stock',id:e.slice(5),qty:l}))},N.items),$=(e,l)=>Math.min(10,...e.map(e=>{const s=(D[e.key]??0)-T(l)*e.qty;return Math.floor(((N.free[e.key]??0)-s)/e.qty)})),I=(e,l,s,t)=>{const r=T(e),i=t<=0&&0===r;return(0,v.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:10,opacity:i?.55:1},testID:`reserve-${e.replace(':','-')}`,children:[(0,v.jsxs)(n.default,{style:{flex:1,minWidth:0},children:[(0,v.jsx)(h.T,{weight:"semibold",children:l}),(0,v.jsx)(h.Muted,{children:i?'Unavailable \u2014 none left for this day':s})]}),i?(0,v.jsx)(h.Badge,{kind:"neutral",label:"Unavailable"}):(0,v.jsx)(h.Stepper,{value:r,onChange:l=>j({holds:{...a.holds,[e]:Math.max(0,Math.min(l,Math.max(r,t)))}}),min:0,max:Math.max(r,Math.min(10,t)),label:l})]},e)},A=N.items.length>0||!1!==w.reserveStock&&N.stock.length>0,O=(0,p.usePlan)(e);return(0,v.jsxs)(v.Fragment,{children:[(0,s.accessQuestionOn)(l)?(0,v.jsxs)(R,{tone:"plain",testID:"q-access",children:[(0,v.jsx)(C,{sub:"Optional. Tell us and we\u2019ll have the right table ready.",children:"\u267f Access needs"}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Wheelchair users"}),(0,v.jsx)(h.Stepper,{value:a.wheelchair,onChange:e=>j({wheelchair:e}),min:0,max:Math.max(1,i),label:"wheelchair users"})]}),(0,v.jsxs)(h.Row,{wrap:!0,gap:6,children:[(0,v.jsx)(h.Chip,{label:"Step-free access",selected:a.stepFree,onPress:()=>j({stepFree:!a.stepFree})}),(0,v.jsx)(h.Chip,{label:"Accessible toilet",selected:a.toilet,onPress:()=>j({toilet:!a.toilet})}),(0,v.jsx)(h.Chip,{label:"Assistance dog",selected:a.assistDog,onPress:()=>j({assistDog:!a.assistDog})})]}),(0,v.jsx)(h.Field,{label:"Anything else? (optional)",value:a.accessNote,onChangeText:e=>j({accessNote:e}),placeholder:"e.g. needs a chair with arms"}),w.accessStatement?.trim()?(0,v.jsx)(h.Muted,{children:w.accessStatement.trim()}):null]}):null,(0,s.dietQuestionOn)(l)?(0,v.jsxs)(R,{tone:"plain",testID:"q-veg",children:[(0,v.jsx)(C,{sub:"We\u2019d love to look after you. Optional.",children:"\u24cb Any vegans or vegetarians?"}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Vegan"}),(0,v.jsx)(h.Stepper,{value:a.vegan,onChange:e=>j({vegan:e}),min:0,max:Math.max(1,i),label:"vegans"})]}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Vegetarian"}),(0,v.jsx)(h.Stepper,{value:a.vegetarian,onChange:e=>j({vegetarian:e}),min:0,max:Math.max(1,i),label:"vegetarians"})]}),!1!==w.vegTeaser&&P.length&&(a.vegan||a.vegetarian)?(0,v.jsxs)(h.Muted,{children:["On the menu: ",P.map(e=>e.name).join(' \xb7 ')]}):null]}):null,A?(0,v.jsxs)(R,{tone:"gold",testID:"q-reserve",children:[(0,v.jsx)(C,{sub:N.known?'Held for you from today\u2019s count.':o>y||'guest'===b?'Held for you; the kitchen confirms and orders in.':void 0,children:"\ud83e\udd9e Reserve with your table"}),N.items.map(e=>I(`item:${e.id}`,`${e.name}${k(e.price)}`,e.description||e.uses.map(e=>`${e.qty} ${N.stock.find(l=>l.key===e.key)?.name.toLowerCase()??e.key}`).join(' + '),$(e.uses,`item:${e.id}`))),!1!==w.reserveStock?N.stock.map(e=>I(`stock:${e.key}`,`Reserve ${e.name.toLowerCase()}`,N.known?`${N.free[e.key]} available today`:'Held for the kitchen to order',$([{key:e.key,qty:1}],`stock:${e.key}`))):null,'staff'===b&&N.known?(0,v.jsxs)(h.Muted,{children:["Today: ",N.stock.map(e=>`${N.free[e.key]} ${e.plural.toLowerCase()} free (${N.reserved[e.key]??0} reserved)`).join(' \xb7 ')]}):null]}):null,x&&!1!==w.tableRequests&&O.tables.length?(0,v.jsx)(M,{rid:e,value:a,onChange:r,party:i,hide:w.tableRequestHide??[]}):null]})},_e.dogTimeOk=function(e,l,s,t,a){if(!a)return!0;const n=e.settings.maxDogsPerSlot;return!n||(0,f.dogsAt)(l,s,t)+a<=n},Object.defineProperty(_e,"accessibleSetUp",{enumerable:!0,get:function(){return f.accessibleSetUp}});var e,l=_r(d[0]),s=_r(d[1]),t=_r(d[2]),a=_r(d[3]),n=(e=a)&&e.__esModule?e:{default:e},r=_r(d[4]),i=_r(d[5]),o=_r(d[6]),c=_r(d[7]),h=_r(d[8]),u=_r(d[9]),p=_r(d[10]),y=_r(d[11]),m=_r(d[12]),b=_r(d[13]),x=_r(d[14]),f=_r(d[15]),j=_r(d[16]),v=_r(d[17]);const k=e=>'display'===x.APP_VARIANT?'':` \xb7 ${(0,b.gbp)(e)}`,w=()=>({allergy:null,allergens:[],severity:'allergy',allergyPeople:1,allergyNote:'',dog:null,dogs:1,wheelchair:0,stepFree:!1,toilet:!1,assistDog:!1,accessNote:'',vegan:0,vegetarian:0,holds:{},tableReq:[]});const R=({children:e,tone:l,testID:s})=>(0,v.jsx)(n.default,{testID:s,style:{gap:10,padding:16,borderRadius:16,borderWidth:'plain'===l?1:1.5,borderColor:'red'===l?j.colours.red:'gold'===l?j.colours.accentBorder:j.colours.hairline,backgroundColor:'red'===l?'#1E1110':j.colours.surface},children:e}),C=({children:e,sub:l})=>(0,v.jsxs)(n.default,{style:{gap:2},children:[(0,v.jsx)(h.T,{weight:"semibold",size:17,children:e}),l?(0,v.jsx)(h.Muted,{children:l}):null]});function q(e,l,s,t,a,n,i){const o=(0,f.reservablesOf)(l),c=(0,y.useStockItems)(e),h=(0,y.useShellStore)((0,r.useShallow)(l=>(0,y.venueCounts)(l,e))),u=(0,y.useShellStore)(l=>!!l.server[e]),p=(0,f.reservedOn)(a,s,o,i),m=s===t&&('staff'===n||u),b={};for(const e of c)b[e.key]=m?Math.max(0,Math.floor((h[e.key]??0)-(p[e.key]??0))):1/0;return{items:o,stock:c,free:b,reserved:p,known:m}}function M({rid:e,value:s,onChange:a,party:r,hide:c}){const u=(0,p.usePlan)(e),y=u.areas.filter(e=>u.tables.some(l=>l.areaId===e.id&&!c.includes(l.name))),[m,b]=(0,t.useState)(y[0]?.id??''),x=s.dog?s.dogs:0,k=e=>c.includes(e)?'Not bookable':(0,f.tableBlockReason)(u,e,r,x,s.wheelchair>0||s.stepFree),w=Object.fromEntries(u.tables.map(e=>[e.name,{table:e,status:k(e.name)?'blocked':'free',covers:0,allergy:!1}])),q=e=>{if(k(e))return;const l=s.tableReq.includes(e)?s.tableReq.filter(l=>l!==e):[...s.tableReq,e].slice(-2);a({...s,tableReq:l})},M=u.tables.filter(e=>e.areaId===m&&!c.includes(e.name));return(0,v.jsxs)(R,{tone:"plain",testID:"q-table",children:[(0,v.jsx)(C,{sub:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best.",children:"\ud83e\ude91 Request a table (optional)"}),y.length>1?(0,v.jsx)(i.AreaTabs,{plan:u,area:m,onPick:b}):null,(0,v.jsx)(n.default,{testID:"q-table-plan",style:{height:240,borderRadius:12,overflow:'hidden',borderWidth:1,borderColor:j.colours.hairline},children:(0,v.jsx)(o.FloorCanvas,{plan:u,areaId:m,mode:"live",view:w,privacy:!0,fit:"contain",crop:!0,maxH:260,highlight:s.tableReq,onTap:e=>q(e.name)})}),(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:M.map(e=>{const t=k(e.name),a=s.tableReq.indexOf(e.name);return(0,v.jsx)(h.Chip,{label:`${(0,l.tableNumbers)(e.name)}`,sub:t||(0===a?'1st choice':1===a?'2nd choice':`${e.maxSeats} seats`),selected:a>=0,disabled:!!t,onPress:()=>q(e.name)},e.name)})}),s.tableReq.length?(0,v.jsxs)(h.T,{size:14,colour:j.colours.goldLight,children:["Requested: ",s.tableReq.map((e,s)=>`${(0,l.tableNumbers)(e)}${s?' (2nd choice)':''}`).join(', ')]}):(0,v.jsx)(h.Muted,{children:"Tap a table; tap another for a second choice."})]})}},1119,[860,877,34,102,879,1120,1121,1123,794,874,1021,984,861,867,872,1091,821,25]); __d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"areaMarks",{enumerable:!0,get:function(){return n}}),_e.AreaTabs=function({plan:o,area:e,onPick:u,counts:a,closed:b}){return(0,c.jsx)(t.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:o.areas.map(o=>{const h=o.id===e,f=b?.has(o.id);return(0,c.jsx)(l.default,{testID:`area-${o.id}`,accessibilityRole:"tab",accessibilityLabel:`Area ${o.name}${o.dogs?', dogs allowed':''}${o.outdoor?', outdoor':''}${f?', closed for weather':''}`,accessibilityState:{selected:h},onPress:()=>u(o.id),style:{maxWidth:'100%',minWidth:0,flexShrink:1,minHeight:48,paddingHorizontal:16,borderRadius:24,borderWidth:1.5,borderColor:h?s.colours.gold:f?s.colours.blue:s.colours.border,backgroundColor:h?s.colours.gold:s.colours.surface,justifyContent:'center'},children:(0,c.jsxs)(t.T,{weight:"semibold",size:15,colour:h?s.colours.onGold:s.colours.text,children:[o.name,n(o),f?(0,c.jsx)(t.T,{size:12,colour:h?s.colours.onGold:s.colours.blue,children:" closed"}):null,a?.[o.id]?(0,c.jsxs)(t.T,{size:12,colour:h?s.colours.onGold:s.colours.muted,children:[" ",a[o.id]]}):null]})},o.id)})})},r(d[0]);var o,e=r(d[1]),l=(o=e)&&o.__esModule?o:{default:o},s=r(d[2]),t=r(d[3]),c=r(d[4]);const n=o=>`${o.dogs?' \ud83d\udc3e':''}${o.outdoor?' \ud83c\udf26':''}`},1120,[34,402,821,794,25]); @@ -1286,7 +1286,7 @@ __d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModu __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useSafetyView=function(o){const c=(0,n.useSafety)(),u=(0,f.useOwner)(t=>t.site);return(0,t.useMemo)(()=>{if('chef'!==o)return c;const t=c.points.filter(t=>(0,s.chefCanSee)(u,t)),n=new Set(c.points.filter(t=>!(0,s.chefCanSee)(u,t)).map(t=>t.id)),f=t=>(0,s.chefCanSee)(u,t)&&!n.has(t.pointId||'');return{...c,points:t,entries:c.entries.filter(f),probes:c.probes.filter(f),diary:c.diary.filter(t=>f(t)&&(0,s.chefCanSee)(u,t.text)),weekly:c.weekly.filter(t=>(0,s.chefCanSee)(u,t.note))}},[c,u,o])};var t=r(d[0]),n=r(d[1]),f=r(d[2]),s=r(d[3])},1203,[34,1026,892,835]); __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTTOM_TABS_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.BottomTabs=function({tabs:e,active:b,onPress:y,background:x,tablist:p}){const{width:j}=(0,s.default)(),v=j/Math.max(1,e.length),w=v>=60?11:10,I=v<56?20:22,[F,S]=(0,t.useState)({}),[H,_]=(0,t.useState)(0),M=H>0&&e.some(e=>(F[e.id]??0)>H-6),z={flexDirection:'row',flexWrap:'nowrap',alignItems:'stretch',borderTopWidth:1,borderColor:c.colours.border,backgroundColor:x};return(0,f.jsx)(l.default,{testID:"app-bottom-tabs",accessibilityRole:p?'tablist':void 0,style:z,children:e.map(t=>{const s=b===t.id,x=s?c.colours.gold:c.colours.muted;return(0,f.jsxs)(n.default,{onLayout:t===e[0]?e=>_(e.nativeEvent.layout.width):void 0,testID:`tab-${t.id}`,accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:t.a11y??t.label,onPress:()=>y(t.id),style:{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:44,minHeight:h,alignItems:'center',justifyContent:'center',paddingVertical:4,paddingHorizontal:1,gap:2},children:[(0,f.jsxs)(l.default,{style:{width:I,height:I,alignItems:'center',justifyContent:'center'},children:[(0,f.jsx)(u.Icon,{name:t.icon,size:I,colour:x}),t.badge?(0,f.jsx)(l.default,{testID:t.badge.testID,style:{position:'absolute',right:-10,top:-5,backgroundColor:t.badge.bg,borderRadius:8,minWidth:16,height:16,paddingHorizontal:3,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(o.default,{style:{fontFamily:c.fonts.bold,fontSize:10,lineHeight:12,color:t.badge.fg??'#FFFFFF'},children:t.badge.text})}):null]}),(0,f.jsx)(l.default,{pointerEvents:"none","aria-hidden":!0,importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,style:{position:'absolute',left:0,top:0,width:0,height:0,overflow:'hidden',opacity:0},children:(0,f.jsx)(l.default,{style:{width:400,flexDirection:'row',alignItems:'flex-start'},children:(0,f.jsx)(o.default,{onLayout:e=>{const n=Math.ceil(e.nativeEvent.layout.width);S(e=>e[t.id]===n?e:{...e,[t.id]:n})},style:{fontFamily:c.fonts.semibold,fontSize:w,lineHeight:Math.round(1.3*w),flexShrink:0},children:t.short??t.label})})}),M?null:(0,f.jsx)(o.default,{numberOfLines:1,style:{fontFamily:s?c.fonts.semibold:c.fonts.regular,fontSize:w,lineHeight:Math.round(1.3*w),color:x,textAlign:'center',alignSelf:'center',maxWidth:'100%'},children:t.short??t.label})]},t.id)})})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=r(d[5]),u=r(d[6]),f=r(d[7]);const h=56},1204,[34,402,346,102,426,821,1171,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return(0,u.canShow)('chef')?(0,c.jsx)(n.ChefApp,{}):(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]})}},1205,[30,34,792,872,25]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return B}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=(e=r)&&e.__esModule?e:{default:e},u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),S=_r(_d[19]),w=_r(_d[20]),D=_r(_d[21]),T=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]),P=_r(_d[25]),M=_r(_d[26]);function B(){const{rid:e,date:r}=(0,n.useLocalSearchParams)(),B=(0,x.useRestaurant)(e),O=(0,x.useCustomer)(),A=(0,x.useBookings)(e),N=(0,x.useEvents)(e),z=(0,x.useNow)(6e4),[R]=(0,l.useState)(()=>(0,a.startForm)()),[F,I]=(0,l.useState)(''),[q,E]=(0,l.useState)(2),[H,W]=(0,l.useState)(r??(0,k.ymd)(z)),[L,_]=(0,l.useState)(null),[Y,U]=(0,l.useState)(O.name),[G,Q]=(0,l.useState)(O.phone??''),[V,J]=(0,l.useState)(O.email??''),[K,X]=(0,l.useState)(!1),[Z,ee]=(0,l.useState)(''),[te,oe]=(0,l.useState)(!1),[se,ne]=(0,l.useState)([]),[le,ie]=(0,l.useState)(!1),ae=[...O.allergies,...se.filter(e=>!O.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[re,de]=(0,l.useState)(null),ue=(0,D.useBlocks)(e=>e.blocks);(0,j.usePublicDayStore)(e=>e.n);const ce=e?(0,j.publicDay)(e,H):null,he=ce?[...ce.bookings,...A.filter(e=>e.date!==H)]:A,me=ce?[...ue.filter(t=>t.rid!==e||t.date!==H),...ce.blocks]:ue,ge=(0,T.usePlan)(e),[pe,be]=(0,l.useState)((0,$.emptyNeeds)()),fe=!0===pe.dog,ye=fe?pe.dogs:0,ke=(0,l.useMemo)(()=>{const e=[],t=new Date(z);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return r&&!e.some(e=>(0,k.ymd)(e)===r)&&e.push((0,k.parseYmd)(r)),e},[z.toDateString(),r]);if(!B)return(0,M.jsx)(h.Screen,{title:"Not found",children:(0,M.jsx)(h.T,{children:"Restaurant not found."})});const xe=B.settings,je=(0,k.parseYmd)(H),ve=(0,D.blocksOn)(me,B.id,H),Se=he.filter(e=>e.date===H),we=ge.areas.filter(e=>e.dogs),De=(0,P.dogSetUp)(ge),Te=e=>(0,C.freeTablesAt)(ge,Se,q,new Date(`${H}${(0,t.tableNumbers)(e)}:00`),(0,C.turnFor)(q,xe.turnMins),xe.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(me,B.id,H,e)}),Ce=(0,y.bookingSlots)(B,je,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),q,z).map(e=>{const t=(0,D.blockAt)(me,B.id,H,e.time),o=fe&&De&&e.available&&!t&&(!Te(e.time).length||!(0,$.dogTimeOk)(B,he,H,e.time,ye));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),$e=Ce.some(e=>e.available),Pe=(0,u.depositOf)(xe),Me=(0,u.depositDue)(Pe,q),Be=Me>0?'deposit':'none',Oe=(0,u.depositWords)(Pe,q,B.name),Ae=N.filter(e=>e.date===H),Ne=(0,w.ukPhone)(G),ze=(0,w.emailOk)(V),Re=(0,$.needsMissing)(pe,O.allergies),Fe=!!L&&te&&!Re.length&&Y.trim().length>1&&Ne.ok&&ze,Ie=async()=>{const e=(0,$.needsPatch)(pe,O.allergies),t=fe&&De?Te(L).map(e=>e.table):[],o=fe?pe.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await x.repo.bookings.create({restaurantId:B.id,customerId:O.id,name:Y,partySize:q,date:H,time:L,notes:Z.trim(),security:Be,depositPaid:0,...Me?{depositDue:Me,depositPolicy:Oe.join(' '),depositRefundable:Pe.refundable,depositCutoffHours:Pe.cutoffHours}:{},phone:Ne.pretty,email:V.trim()||void 0,source:'online',...e,...Ce.find(e=>e.time===L)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??ae,...o?{table:o}:{}});(0,a.rememberGuard)(s.id,(0,a.guardFor)({...R,hp:F})),de(s)},qe=(0,x.useStore)(e=>re?e.bookings.find(e=>e.id===re.id)?.ref:void 0),Ee=e=>(0,S.waMeLink)(B.settings.whatsapp,(0,S.guestWhatsAppText)({name:e.name,ref:qe??e.ref,date:e.date,time:e.time,partySize:e.partySize},B.name));if(re){const e='pending'===re.status;return(0,M.jsxs)(h.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:B.name,children:[(0,M.jsx)(h.Banner,{kind:e?'info':'success',title:`Reference ${qe??re.ref}`,children:`${re.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(re.date))} at ${re.time}`}),e?(0,M.jsx)(h.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(h.T,{children:["Name: ",re.name]}),(0,M.jsxs)(h.T,{children:["Mobile: ",re.phone]}),re.email?(0,M.jsxs)(h.T,{children:["Email: ",re.email]}):null,(0,M.jsxs)(h.T,{children:["Allergies shared with the restaurant: ",re.allergies.length?re.allergies.map(e=>`${(0,p.allergenLabel)(e.allergen)} (${(0,p.severityLabel)(e.severity)})`).join(', '):'none']}),re.notes?(0,M.jsxs)(h.T,{children:["Notes: ",re.notes]}):null,re.dog?(0,M.jsxs)(h.T,{children:["\ud83d\udc15 Dog coming too",re.table?` \xb7 dog-friendly table ${re.table}`:'']}):null,re.holds?.length?(0,M.jsxs)(h.T,{children:["Reserved: ",re.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(B.settings.reservables??P.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,re.tableReq?.length?(0,M.jsxs)(h.T,{children:["Table requested: ",re.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===re.security&&re.depositDue?(0,M.jsxs)(h.T,{weight:"semibold",children:["Deposit due: ",(0,f.gbp)(re.depositDue),". ",B.name," will tell you how to pay it."]}):null,'deposit'===re.security&&re.depositPolicy?(0,M.jsx)(h.Muted,{children:re.depositPolicy}):null,(0,M.jsx)(h.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,M.jsxs)(h.Muted,{children:["Need to change or cancel? Call ",B.phone," and quote ",qe??re.ref,"."]})]}),Ee(re)?(0,M.jsxs)(d.default,{style:{gap:4},children:[(0,M.jsx)(h.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ee(re);e&&(0,S.openWhatsApp)(e)}}),(0,M.jsx)(h.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,M.jsx)(h.Button,{label:"Back to restaurant",onPress:()=>n.router.replace(`/customer/${B.id}`)})]})}return(0,M.jsxs)(h.Screen,{title:"Book a table",subtitle:B.name,footer:(0,M.jsx)(h.Button,{label:Re.length?Re[0]:q>(xe.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Fe,onPress:()=>Ie(),testID:"confirm-booking"}),children:[(0,M.jsx)($.FirstQuestions,{rid:B.id,value:pe,onChange:e=>{e.dog===pe.dog&&e.dogs===pe.dogs||_(null),be(e)},party:q,audience:"guest",profile:O.allergies}),(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(d.default,{style:{gap:6,alignItems:'center'},children:[(0,M.jsx)(h.H2,{children:"Party size"}),(0,M.jsx)(o.PartySizeInput,{value:q,onChange:e=>{E(e),_(null)},label:"Party size",testID:"party-size"})]}),Me?(0,M.jsx)(h.Banner,{kind:"info",title:`Deposit: ${(0,f.gbp)(Me)} for ${q} guests`,children:(0,M.jsx)(d.default,{style:{gap:4},children:Oe.map(e=>(0,M.jsx)(h.T,{size:13,children:e},e))})}):Pe.on&&Pe.perPersonPence>0?(0,M.jsxs)(h.Muted,{children:["No deposit for fewer than ",Pe.fromParty," guests."]}):null,q>(xe.autoAcceptUpTo??7)?(0,M.jsxs)(h.Muted,{children:["For ",q," people the team checks the booking first, then texts you to confirm."]}):null,fe&&De?(0,M.jsxs)(h.Muted,{children:["Dogs are welcome in the ",we.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",B.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Date"}),(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:ke.map(e=>{const t=!!(0,b.hoursFor)(B,e),o=N.some(t=>t.date===(0,k.ymd)(e));return(0,M.jsx)(h.Chip,{label:(0,k.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:H===(0,k.ymd)(e),onPress:()=>{W((0,k.ymd)(e)),_(null)}},(0,k.ymd)(e))})}),Ae.map(e=>(0,M.jsx)(h.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Time"}),0===Ce.length?(0,M.jsx)(h.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:Ce.map(e=>(0,M.jsx)(h.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left_(e.time)},e.time))}),ve.length>0&&Ce.some(e=>e.blocked)?(0,M.jsx)(h.Banner,{kind:"info",title:$e?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${ve.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(je)}. Please give us a ring on ${B.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,s.lastFoodOn)(B,H);return e&&Ce.some(e=>e.drinksOnly)?(0,M.jsx)(h.Banner,{kind:"info",title:`Last food orders ${(0,s.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),fe&&Ce.some(e=>e.noDog)?(0,M.jsx)(h.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${we.map(e=>e.name).join(' and ')}${B.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,D.closedAreasAt)(me,B.id,H,L??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,M.jsxs)(h.Muted,{children:["Times are every ",(0,y.bookingSlotMinutesOf)(B)," minutes. Covers per slot (",xe.bookingCoversPerSlot," per half hour) and table rules still apply."]})]}),(0,M.jsx)($.MoreQuestions,{rid:B.id,r:B,value:pe,onChange:be,party:q,date:H,time:L,today:(0,k.ymd)(z),bookings:he,audience:"guest",showTables:!0}),(0,M.jsxs)(h.Card,{highlight:te?void 0:v.colours.amber,children:[(0,M.jsx)(h.Field,{label:"Notes (optional)",value:Z,onChangeText:ee,placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,M.jsx)(h.Toggle,{label:"I confirm the allergy information for this booking",value:te,onChange:oe}),(0,M.jsx)(h.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Your details"}),(0,M.jsx)(h.Field,{label:"Name for the booking",value:Y,onChangeText:U}),(0,M.jsx)(h.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:G,onChangeText:Q,onBlur:()=>X(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Ne.ok||!K&&!G?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:Ne.error}),(0,M.jsx)(h.Field,{testID:"book-email",label:"Email (optional)",value:V,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),ze?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,M.jsxs)(h.Muted,{children:["We\u2019ll text you a confirmation",V.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,M.jsx)(i.Honeypot,{value:F,onChange:I})]})}},1206,[860,1114,877,30,34,1207,999,102,14,1124,794,861,878,867,1117,858,874,988,821,1168,864,1018,1021,1095,1119,1091,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return B}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=(e=r)&&e.__esModule?e:{default:e},u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),x=_r(_d[15]),k=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),D=_r(_d[21]),T=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]),P=_r(_d[25]),M=_r(_d[26]);function B(){const{rid:e,date:r}=(0,n.useLocalSearchParams)(),B=(0,k.useRestaurant)(e),A=(0,k.useCustomer)(),O=(0,k.useBookings)(e),N=(0,k.useEvents)(e),z=(0,k.useNow)(6e4),[R]=(0,l.useState)(()=>(0,a.startForm)()),[F,I]=(0,l.useState)(''),[q,L]=(0,l.useState)(2),[H,E]=(0,l.useState)(r??(0,x.ymd)(z)),[W,_]=(0,l.useState)(null),[Y,U]=(0,l.useState)(A.name),[G,Q]=(0,l.useState)(A.phone??''),[V,J]=(0,l.useState)(A.email??''),[K,X]=(0,l.useState)(!1),[Z,ee]=(0,l.useState)(''),[te,oe]=(0,l.useState)(!1),[se,ne]=(0,l.useState)([]),[le,ie]=(0,l.useState)(!1),ae=[...A.allergies,...se.filter(e=>!A.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[re,de]=(0,l.useState)(null),ue=(0,D.useBlocks)(e=>e.blocks);(0,j.usePublicDayStore)(e=>e.n);const ce=e?(0,j.publicDay)(e,H):null,he=ce?[...ce.bookings,...O.filter(e=>e.date!==H)]:O,me=ce?[...ue.filter(t=>t.rid!==e||t.date!==H),...ce.blocks]:ue,ge=(0,T.usePlan)(e),[pe,be]=(0,l.useState)((0,$.emptyNeeds)()),fe=!0===pe.dog,ye=fe?pe.dogs:0,xe=(0,l.useMemo)(()=>{const e=[],t=new Date(z);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return r&&!e.some(e=>(0,x.ymd)(e)===r)&&e.push((0,x.parseYmd)(r)),e},[z.toDateString(),r]);if(!B)return(0,M.jsx)(h.Screen,{title:"Not found",children:(0,M.jsx)(h.T,{children:"Restaurant not found."})});const ke=B.settings,je=(0,x.parseYmd)(H),ve=(0,y.onlinePartyBounds)(B),we=(0,D.blocksOn)(me,B.id,H),Se=he.filter(e=>e.date===H),De=ge.areas.filter(e=>e.dogs),Te=(0,P.dogSetUp)(ge),Ce=e=>(0,C.freeTablesAt)(ge,Se,q,new Date(`${H}${(0,t.tableNumbers)(e)}:00`),(0,C.turnFor)(q,ke.turnMins),ke.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(me,B.id,H,e)}),$e=(0,y.bookingSlots)(B,je,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),q,z,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,D.blockAt)(me,B.id,H,e.time),o=fe&&Te&&e.available&&!t&&(!Ce(e.time).length||!(0,$.dogTimeOk)(B,he,H,e.time,ye));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Pe=$e.some(e=>e.available),Me=(0,u.depositOf)(ke),Be=(0,u.depositDue)(Me,q),Ae=Be>0?'deposit':'none',Oe=(0,u.depositWords)(Me,q,B.name),Ne=N.filter(e=>e.date===H),ze=(0,S.ukPhone)(G),Re=(0,S.emailOk)(V),Fe=(0,$.needsMissing)(pe,A.allergies),Ie=!!W&&te&&!Fe.length&&Y.trim().length>1&&ze.ok&&Re,qe=async()=>{const e=(0,$.needsPatch)(pe,A.allergies),t=fe&&Te?Ce(W).map(e=>e.table):[],o=fe?pe.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await k.repo.bookings.create({restaurantId:B.id,customerId:A.id,name:Y,partySize:q,date:H,time:W,notes:Z.trim(),security:Ae,depositPaid:0,...Be?{depositDue:Be,depositPolicy:Oe.join(' '),depositRefundable:Me.refundable,depositCutoffHours:Me.cutoffHours}:{},phone:ze.pretty,email:V.trim()||void 0,source:'online',...e,...$e.find(e=>e.time===W)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??ae,...o?{table:o}:{}});(0,a.rememberGuard)(s.id,(0,a.guardFor)({...R,hp:F})),de(s)},Le=(0,k.useStore)(e=>re?e.bookings.find(e=>e.id===re.id)?.ref:void 0),He=e=>(0,w.waMeLink)(B.settings.whatsapp,(0,w.guestWhatsAppText)({name:e.name,ref:Le??e.ref,date:e.date,time:e.time,partySize:e.partySize},B.name));if(re){const e='pending'===re.status;return(0,M.jsxs)(h.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:B.name,children:[(0,M.jsx)(h.Banner,{kind:e?'info':'success',title:`Reference ${Le??re.ref}`,children:`${re.partySize} people \xb7 ${(0,x.niceDateYear)((0,x.parseYmd)(re.date))} at ${re.time}`}),e?(0,M.jsx)(h.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(h.T,{children:["Name: ",re.name]}),(0,M.jsxs)(h.T,{children:["Mobile: ",re.phone]}),re.email?(0,M.jsxs)(h.T,{children:["Email: ",re.email]}):null,(0,M.jsxs)(h.T,{children:["Allergies shared with the restaurant: ",re.allergies.length?re.allergies.map(e=>`${(0,p.allergenLabel)(e.allergen)} (${(0,p.severityLabel)(e.severity)})`).join(', '):'none']}),re.notes?(0,M.jsxs)(h.T,{children:["Notes: ",re.notes]}):null,re.dog?(0,M.jsxs)(h.T,{children:["\ud83d\udc15 Dog coming too",re.table?` \xb7 dog-friendly table ${re.table}`:'']}):null,re.holds?.length?(0,M.jsxs)(h.T,{children:["Reserved: ",re.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(B.settings.reservables??P.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,re.tableReq?.length?(0,M.jsxs)(h.T,{children:["Table requested: ",re.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===re.security&&re.depositDue?(0,M.jsxs)(h.T,{weight:"semibold",children:["Deposit due: ",(0,f.gbp)(re.depositDue),". ",B.name," will tell you how to pay it."]}):null,'deposit'===re.security&&re.depositPolicy?(0,M.jsx)(h.Muted,{children:re.depositPolicy}):null,(0,M.jsx)(h.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,M.jsxs)(h.Muted,{children:["Need to change or cancel? Call ",B.phone," and quote ",Le??re.ref,"."]})]}),He(re)?(0,M.jsxs)(d.default,{style:{gap:4},children:[(0,M.jsx)(h.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=He(re);e&&(0,w.openWhatsApp)(e)}}),(0,M.jsx)(h.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,M.jsx)(h.Button,{label:"Back to restaurant",onPress:()=>n.router.replace(`/customer/${B.id}`)})]})}return(0,M.jsxs)(h.Screen,{title:"Book a table",subtitle:B.name,footer:(0,M.jsx)(h.Button,{label:Fe.length?Fe[0]:q>(ke.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Ie,onPress:()=>qe(),testID:"confirm-booking"}),children:[(0,M.jsx)($.FirstQuestions,{rid:B.id,value:pe,onChange:e=>{e.dog===pe.dog&&e.dogs===pe.dogs||_(null),be(e)},party:q,audience:"guest",profile:A.allergies}),(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(d.default,{style:{gap:6,alignItems:'center'},children:[(0,M.jsx)(h.H2,{children:"Party size"}),(0,M.jsx)(o.PartySizeInput,{value:q,onChange:e=>{L(e),_(null)},min:ve.min,max:ve.max,label:"Party size",testID:"party-size"})]}),Be?(0,M.jsx)(h.Banner,{kind:"info",title:`Deposit: ${(0,f.gbp)(Be)} for ${q} guests`,children:(0,M.jsx)(d.default,{style:{gap:4},children:Oe.map(e=>(0,M.jsx)(h.T,{size:13,children:e},e))})}):Me.on&&Me.perPersonPence>0?(0,M.jsxs)(h.Muted,{children:["No deposit for fewer than ",Me.fromParty," guests."]}):null,q>(ke.autoAcceptUpTo??7)?(0,M.jsxs)(h.Muted,{children:["For ",q," people the team checks the booking first, then texts you to confirm."]}):null,fe&&Te?(0,M.jsxs)(h.Muted,{children:["Dogs are welcome in the ",De.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",B.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Date"}),(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:xe.map(e=>{const t=!!(0,b.hoursFor)(B,e),o=N.some(t=>t.date===(0,x.ymd)(e));return(0,M.jsx)(h.Chip,{label:(0,x.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:H===(0,x.ymd)(e),onPress:()=>{E((0,x.ymd)(e)),_(null)}},(0,x.ymd)(e))})}),Ne.map(e=>(0,M.jsx)(h.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Time"}),0===$e.length?(0,M.jsx)(h.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:$e.map(e=>(0,M.jsx)(h.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left_(e.time)},e.time))}),we.length>0&&$e.some(e=>e.blocked)?(0,M.jsx)(h.Banner,{kind:"info",title:Pe?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${we.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,x.niceDate)(je)}. Please give us a ring on ${B.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,s.lastFoodOn)(B,H);return e&&$e.some(e=>e.drinksOnly)?(0,M.jsx)(h.Banner,{kind:"info",title:`Last food orders ${(0,s.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),fe&&$e.some(e=>e.noDog)?(0,M.jsx)(h.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${De.map(e=>e.name).join(' and ')}${B.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,D.closedAreasAt)(me,B.id,H,W??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,M.jsx)(h.Muted,{children:(0,y.bookingLimitsHint)(B)})]}),(0,M.jsx)($.MoreQuestions,{rid:B.id,r:B,value:pe,onChange:be,party:q,date:H,time:W,today:(0,x.ymd)(z),bookings:he,audience:"guest",showTables:!0}),(0,M.jsxs)(h.Card,{highlight:te?void 0:v.colours.amber,children:[(0,M.jsx)(h.Field,{label:"Notes (optional)",value:Z,onChangeText:ee,placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,M.jsx)(h.Toggle,{label:"I confirm the allergy information for this booking",value:te,onChange:oe}),(0,M.jsx)(h.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Your details"}),(0,M.jsx)(h.Field,{label:"Name for the booking",value:Y,onChangeText:U}),(0,M.jsx)(h.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:G,onChangeText:Q,onBlur:()=>X(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),ze.ok||!K&&!G?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:ze.error}),(0,M.jsx)(h.Field,{testID:"book-email",label:"Email (optional)",value:V,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Re?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,M.jsxs)(h.Muted,{children:["We\u2019ll text you a confirmation",V.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,M.jsx)(i.Honeypot,{value:F,onChange:I})]})}},1206,[860,1114,877,30,34,1207,999,102,14,1124,794,861,878,867,1117,858,874,988,821,1168,864,1018,1021,1095,1119,1091,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Honeypot=function({value:t,onChange:n}){return(0,l.jsx)(o.default,{"aria-hidden":!0,pointerEvents:"none",style:{position:'absolute',left:-1e4,top:0,width:1,height:1,overflow:'hidden',opacity:0},children:(0,l.jsx)(e.TextInput,{testID:"hp-field",accessibilityLabel:"Leave this empty",value:t,onChangeText:n,tabIndex:-1,autoComplete:'off',name:'cc_extra_info','aria-hidden':!0})})};var e=r(d[0]);r(d[1]),r(d[2]);var t,n=r(d[3]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[4])},1207,[827,34,236,102,25]); __d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var t=_r(_d[0]),n=_r(_d[1]),l=e(_r(_d[2])),s=e(_r(_d[3])),r=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]);function f(){const{rid:e,did:f}=(0,t.useLocalSearchParams)(),b=(0,u.useRestaurant)(e),j=(0,u.useMenu)(e).find(e=>e.id===f),x=(0,u.useCustomer)(),m=(0,u.useRecipeCards)(e).find(e=>e.id===j?.recipeCardId),y=m?.signOff&&m.photo?(0,h.recipeCards)().photoSource(m.photo):null,k=(0,u.useStore)(e=>e.addLine),[v,w]=(0,n.useState)(()=>(j?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[S,C]=(0,n.useState)(1),[B,$]=(0,n.useState)(''),[I,P]=(0,n.useState)(!1),[L,T]=(0,n.useState)(!1),[D,O]=(0,n.useState)(!1),[A,M]=(0,n.useState)(!1),R=(0,n.useMemo)(()=>j?(0,d.effectiveAllergens)(j,v):{},[j,v]);if(!b||!j)return(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Dish not found."})});const q=(0,d.conflictsFor)(R,x.allergies),_=(j.price??0)+(j.optionGroups??[]).flatMap(e=>e.choices).filter(e=>v.includes(e.id)).reduce((e,t)=>e+t.priceDelta,0),N=j.soldOut||!j.signOff||null===j.price,G=(e,t)=>{const n=j.optionGroups.find(t=>t.id===e);w(e=>{const l=n.choices.map(e=>e.id);return n.multi?e.includes(t)?e.filter(e=>e!==t):[...e,t]:e.includes(t)&&!n.required?e.filter(e=>e!==t):[...e.filter(e=>!l.includes(e)),t]})},z=e=>{u.useStore.getState().basket.restaurantId!==b.id&&u.useStore.getState().startBasket(b.id,'takeaway'),k({itemId:j.id,qty:S,choiceIds:v,notes:B,override:e?{allergens:q.contains,at:(new Date).toISOString()}:void 0}),P(!1),M(!0)};return(0,p.jsxs)(o.Screen,{title:j.name,subtitle:b.name,right:(0,p.jsx)(a.BasketButton,{}),children:[y?(0,p.jsx)(l.default,{testID:"dish-photo",source:y,accessibilityLabel:`${j.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.T,{weight:"bold",size:20,colour:g.colours.gold,children:null===j.price?j.priceNote:(0,c.gbp)(_)}),j.dietary.map(e=>(0,p.jsx)(o.Badge,{kind:"ok",label:e},e))]}),(0,p.jsx)(o.T,{children:j.description}),q.contains.length?(0,p.jsx)(o.Banner,{kind:"danger",title:`Blocked: contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,q.may.length?(0,p.jsx)(o.Banner,{kind:"warn",title:`Warning: may contain ${q.may.map(d.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(j.optionGroups??[]).map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:e.choices.map(t=>(0,p.jsx)(o.Chip,{label:t.label,sub:t.priceDelta?`+${(0,c.gbp)(t.priceDelta)}`:void 0,selected:v.includes(t.id),onPress:()=>G(e.id,t.id)},t.id))})]},e.id)),(0,p.jsx)(o.Card,{children:(0,p.jsx)(r.AllergenPanel,{item:j,map:R,declared:x.allergies})}),b.fictional?null:(0,p.jsx)(o.ExampleAllergenNotice,{}),(0,p.jsx)(o.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:B,onChangeText:$}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Quantity"}),(0,p.jsx)(o.Stepper,{value:S,onChange:C,label:"quantity"})]}),A?(0,p.jsx)(o.Banner,{kind:"success",title:"Added to basket",children:q.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,N?(0,p.jsx)(o.Banner,{kind:"warn",children:j.soldOut?'Sold out today.':j.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):q.contains.length?(0,p.jsxs)(s.default,{style:{gap:8},children:[(0,p.jsx)(o.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,p.jsx)(o.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{T(!1),O(!1),P(!0)},testID:"override-open"})]}):(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{style:{flex:1},label:`Add ${S} to basket \xb7 ${(0,c.gbp)(_*S)}`,onPress:()=>z(!1),testID:"add-to-basket"}),A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,p.jsxs)(o.Sheet,{visible:I,onClose:()=>P(!1),title:"Allergy override",children:[(0,p.jsx)(o.Banner,{kind:"danger",title:`${j.name} contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`Your profile says: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}.`}),(0,p.jsx)(o.Toggle,{label:"I understand this dish contains an allergen I have declared",value:L,onChange:T}),(0,p.jsx)(o.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:D,onChange:O}),(0,p.jsx)(o.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,p.jsx)(o.Button,{kind:"danger",disabled:!L||!D,label:"Confirm override and add",onPress:()=>z(!0),testID:"override-confirm"})]})]})}},1208,[30,34,336,102,1209,1211,794,861,867,874,882,821,25]); __d(function(g,r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AllergenPanel=function({item:e,map:n,declared:u}){return(0,d.jsxs)(s.default,{style:{gap:6},accessibilityLabel:"Allergen panel",children:[(0,d.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,d.jsx)(o.T,{weight:"semibold",children:"Allergen panel (14 UK allergens)"}),(0,l.isLiveVenue)()?null:(0,d.jsx)(o.Badge,{label:"NOT CONNECTED",kind:"amber"})]}),(0,d.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:6},children:a.ALLERGENS.map(e=>{const l=n[e.id],c=u.find(l=>l.allergen===e.id),f='contains'===l?t.colours.redBg:'may'===l?t.colours.amberBg:t.colours.surface2,h='contains'===l?'#FFD9D4':'may'===l?'#FFE2A8':t.colours.muted;return(0,d.jsxs)(s.default,{style:{width:'48%',flexGrow:1,backgroundColor:f,borderRadius:8,padding:8,borderWidth:c?2:1,borderColor:c?t.colours.red:t.colours.border},children:[(0,d.jsx)(o.T,{size:14,weight:"medium",colour:l?h:t.colours.text,children:e.label}),(0,d.jsxs)(o.T,{size:13,colour:h,children:['contains'===l?'Contains':'may'===l?'May contain':'Not listed',c?` \xb7 YOUR ALLERGY (${(0,a.severityLabel)(c.severity)})`:'']})]},e.id)})}),e.allergenNotes?(0,d.jsxs)(o.Muted,{children:["Notes: ",e.allergenNotes]}):null,(0,d.jsx)(s.default,{testID:"allergen-signoff",children:(0,d.jsx)(o.Muted,{children:e.signOff?`From the dish's recipe card. Signed off by ${e.signOff.by} on ${c(e.signOff.at)}.`:"Awaiting the head chef's allergen sign-off: not available to order online."})}),(0,d.jsx)(o.Muted,{children:"Always tell staff about allergies when you order or arrive."})]})},_e.AllergenChips=function({map:e,declared:l}){const n=Object.entries(e);return n.length?(0,d.jsx)(o.Row,{wrap:!0,gap:5,children:n.sort((e,l)=>e[1]===l[1]?0:'contains'===e[1]?-1:1).map(([e,n])=>{const s=l.some(l=>l.allergen===e);return(0,d.jsx)(o.Badge,{label:`${s?'\u26a0 ':''}${(0,a.allergenLabel)(e)}${'may'===n?' (may)':''}`,kind:s?'contains'===n?'red':'amber':'neutral'},e)})}):(0,d.jsx)(o.Muted,{children:"No listed allergens"})},r(_d[0]);var e,l=r(_d[1]),n=r(_d[2]),s=(e=n)&&e.__esModule?e:{default:e},a=r(_d[3]),t=r(_d[4]),o=r(_d[5]),d=r(_d[6]);const c=e=>{const l=new Date(`${e.slice(0,10)}T12:00:00`);return isNaN(+l)?e:l.toLocaleDateString('en-GB',{day:'numeric',month:'long',year:'numeric'})}},1209,[34,1210,102,861,821,794,25]); @@ -1445,7 +1445,7 @@ __d(function(g,_r,i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModul __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.WipeDevice=function({compact:e}){const f=(0,u.useDisplaySettings)(p.VENUE_RID),[v,T]=(0,s.useState)(!1),[w,j]=(0,s.useState)(''),[D,C]=(0,s.useState)(!1),I='display'===h.APP_VARIANT&&f.pinOn,P=!I||(0,b.wakePinMatches)(f,w);return v?(0,x.jsxs)(o.default,{testID:"wipe-confirm-box",style:{gap:6,marginTop:6},children:[(0,x.jsx)(l.T,{size:e?12:14,children:"Sign out and remove everything CoverCharge keeps on this device: sign-ins, pairing, saved screens and any changes not sent yet. The venue\u2019s shared data is not touched. To use it again, open a personal link or pair the Display again."}),I?(0,x.jsx)(t.TextInput,{testID:"wipe-pin",value:w,onChangeText:j,placeholder:"Display wake PIN",placeholderTextColor:c.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display wake PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:c.colours.text}}):null,(0,x.jsxs)(o.default,{style:{flexDirection:'row',gap:8},children:[(0,x.jsx)(n.default,{testID:"wipe-confirm",accessibilityRole:"button",accessibilityLabel:"Yes, wipe this device",disabled:!P||D,onPress:()=>{C(!0),(0,y.wipeThisDevice)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:P?c.colours.red:'rgba(255,255,255,0.08)'},children:(0,x.jsx)(l.T,{size:12,weight:"semibold",children:D?'Wiping\u2026':'Yes, wipe this device'})}),(0,x.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:()=>{T(!1),j('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,x.jsx)(l.T,{size:12,children:"Cancel"})})]})]}):(0,x.jsx)(n.default,{testID:"wipe-device",accessibilityRole:"button",accessibilityLabel:"Sign out and wipe this device",onPress:()=>T(!0),style:{alignSelf:'flex-start',marginTop:e?4:0,minHeight:44,justifyContent:'center'},children:(0,x.jsx)(l.T,{size:e?12:14,colour:c.colours.gold,children:"Sign out and wipe this device\u2026"})})};var t=r(d[0]),s=r(d[1]),n=e(r(d[2])),o=e(r(d[3])),l=r(d[4]),c=r(d[5]),u=r(d[6]),p=r(d[7]),b=r(d[8]),h=r(d[9]),y=r(d[10]),x=r(d[11])},1362,[827,34,402,102,794,821,1021,5,1022,872,988,25]); __d(function(g,r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.PlanPhoto=function({rid:e}){const t=(0,n.usePlan)(e),b=(0,n.useFloor)(e=>e.setPlan),[y,f]=(0,a.useState)(null),[x,w]=(0,a.useState)(null),[v,j]=(0,a.useState)(null),[k,S]=(0,a.useState)(''),[P,T]=(0,a.useState)(!1),I=async e=>{let a;T(!0);try{const{data:t,error:l}=await(0,u.getSupabase)().functions.invoke('plan-photo-read',{body:{image:e}});a=l?{ok:!1,message:'The plan could not be read. The photo is still here.'}:{ok:!0,tables:(0,o.cleanFindings)(t)}}catch{a={ok:!1,message:'The plan could not be read. The photo is still here.'}}finally{T(!1)}const t=(0,o.planReadAfter)(e,a);w(t.photo),f(t.rows&&t.rows.length?t.rows:null),S(t.note)},L=async()=>{S('');const e=(await(0,c.pickPhotos)({source:'camera'}))[0];e?(w(e),await I(e)):S('No photo taken.')};return(0,p.jsxs)(l.default,{testID:"plan-photo",style:{width:'100%',alignItems:'center',gap:10},children:[(0,p.jsx)(s.Button,{testID:"plan-photo-camera",label:P?'Reading the plan\u2026':'Take a picture of the table plan',accessibilityLabel:"Take a picture of a hand-drawn table plan",disabled:P,onPress:()=>{L()}}),k?(0,p.jsx)(s.Muted,{center:!0,testID:"plan-photo-note",children:k}):null,x&&!P?(0,p.jsx)(s.Button,{kind:"ghost",testID:"plan-photo-retry",label:"Read this photo again",accessibilityLabel:"Read this photo again",onPress:()=>{I(x)}}):null,y?(0,p.jsx)(l.default,{testID:"plan-photo-review",style:{width:'100%'},children:(0,p.jsxs)(s.Card,{style:{alignItems:'center',width:'100%'},children:[(0,p.jsx)(s.T,{center:!0,weight:"bold",colour:h.colours.gold,children:"Check what was read"}),(0,p.jsx)(s.Muted,{center:!0,children:"Nothing is saved until you tap Save the plan."}),y.map((e,a)=>(0,p.jsxs)(l.default,{style:{width:'100%',gap:6},children:[(0,p.jsx)(s.Field,{label:"Area",accessibilityLabel:`Area ${a+1}`,value:e.area,onChangeText:e=>f(y.map((t,l)=>l===a?{...t,area:e}:t))}),(0,p.jsx)(s.Field,{label:"Table",accessibilityLabel:`Table ${a+1}`,value:e.name,onChangeText:e=>f(y.map((t,l)=>l===a?{...t,name:e}:t))}),(0,p.jsx)(s.Field,{label:"Seats",accessibilityLabel:`Seats at table ${a+1}`,value:String(e.seats),keyboardType:"number-pad",onChangeText:e=>f(y.map((t,l)=>l===a?{...t,seats:Math.max(1,Math.min(30,Number(e.replace(/\D/g,''))||1))}:t))}),(0,p.jsx)(s.Button,{kind:"ghost",label:`Remove ${e.name||'table'}`,accessibilityLabel:`Remove ${e.name||'table'}`,onPress:()=>f(y.filter((e,t)=>t!==a))})]},`${e.area}-${e.name}-${a}`)),(0,p.jsx)(s.Button,{testID:"plan-photo-save",label:"Save the plan",accessibilityLabel:"Save the checked table plan",disabled:!y.length,onPress:()=>{if(!y?.length)return;j(t);const a=[...t.areas],l=[...t.tables];for(const e of y){let t=a.find(a=>a.name.toLowerCase()===e.area.toLowerCase());t||(t={id:(0,i.fid)('area'),name:e.area},a.push(t));const s=(0,i.sizeFor)(e.seats),n=l.filter(e=>e.areaId===t.id).length;l.push({id:(0,i.fid)('t'),name:e.name,areaId:t.id,shape:s.shape,minSeats:1,maxSeats:e.seats,x:40+n%6*140,y:40+120*Math.floor(n/6),w:s.w,h:s.h,rot:0,online:!0})}b(e,{...t,areas:a,tables:l}),f(null),S('Plan saved. Undo puts the previous plan back.')}})]})}):null,v?(0,p.jsx)(s.Button,{kind:"ghost",testID:"plan-photo-undo",label:"Undo table plan",accessibilityLabel:"Undo the table plan and restore the previous one",onPress:()=>{b(e,v),j(null),S('Previous plan restored.')}}):null]})};var e,a=r(d[0]),t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},s=r(d[2]),n=r(d[3]),o=r(d[4]),i=r(d[5]),h=r(d[6]),c=r(d[7]),u=r(d[8]),p=r(d[9])},1363,[34,102,794,1021,1364,859,821,1066,934,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.planReadAfter=function(t,o){return o.ok?o.tables.length?{photo:t,rows:o.tables,note:''}:{photo:t,rows:[],note:'Nothing readable on that photo. The photo is still here.'}:{photo:t,rows:null,note:o.message}},e.cleanFindings=function(o){if(!o||'object'!=typeof o)return[];const n=o.tables;if(!Array.isArray(n))return[];const s=[];for(const o of n.slice(0,80)){if(!o||'object'!=typeof o)continue;const n=t(o.area,40),c=t(o.name,12),l=o.seats;!n||!c||'number'!=typeof l||!Number.isInteger(l)||l<1||l>30||s.push({area:n,name:c,seats:l})}return s};const t=(t,o)=>'string'==typeof t?t.trim().slice(0,o):''},1364,[]); -__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:n}=(0,l.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[b,h]=(0,t.useState)(String(e.settings.turnMins??'')),[y,v]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[f,k]=(0,t.useState)(!1),M=(e,t,n)=>c(s=>({...s,[e]:0===t?[n,s[e]?.[1]??'']:[s[e]?.[0]??'',n]})),S=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(b)<=360&&Number(y)>=1&&Number(y)<=1e3;return(0,r.jsxs)(s.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(n=>({...n,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>M(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>M(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:b,onChangeText:h,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:y,onChangeText:v,keyboardType:"number-pad"})]}),(0,r.jsx)(i.Button,{label:f?'Saving\u2026':'Save booking times',disabled:!S||f,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{k(!0);try{await(0,o.saveStaffBookingTimes)(n,u,Number(b),Number(y)),j('Booking times saved.')}catch(e){j(e.message)}finally{k(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),n=_r(_d[1]),s=(e=n)&&e.__esModule?e:{default:e},i=_r(_d[2]),l=_r(_d[3]),o=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1365,[34,102,794,1079,988,25]); +__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:s}=(0,o.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[h,b]=(0,t.useState)(String(e.settings.turnMins??'')),[v,y]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[k,S]=(0,t.useState)(!1),f=(e,t,s)=>c(n=>({...n,[e]:0===t?[s,n[e]?.[1]??'']:[n[e]?.[0]??'',s]})),p=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(h)<=360&&Number(v)>=1&&Number(v)<=1e3;return(0,r.jsxs)(n.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(s=>({...s,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>f(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>f(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:h,onChangeText:b,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:v,onChangeText:y,keyboardType:"number-pad"}),e.settings.bookingCoversPerStart||e.settings.bookingPartiesPerStart?(0,r.jsx)(i.Muted,{center:!0,children:"Online booking uses the covers and bookings caps at each start time (Settings \u203a Capacity & waitlist), not this half-hour figure."}):null]}),(0,r.jsx)(i.Button,{label:k?'Saving\u2026':'Save booking times',disabled:!p||k,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{S(!0);try{await(0,l.saveStaffBookingTimes)(s,u,Number(h),Number(v)),j('Booking times saved.')}catch(e){j(e.message)}finally{S(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),s=_r(_d[1]),n=(e=s)&&e.__esModule?e:{default:e},i=_r(_d[2]),o=_r(_d[3]),l=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1365,[34,102,794,1079,988,25]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffTableOrders=function({rid:e,me:l}){const p=(0,c.useOrderAtTable)(e),x=(0,c.useNow)(15e3),f=(0,c.useStore)(e=>e.bookings),w=(0,c.useOrders)(e).filter(i.isTableQr).sort((e,t)=>t.createdAt.localeCompare(e.createdAt)),S=w.filter(i.waitingForStaff),y=w.filter(e=>m(e)&&!(0,i.waitingForStaff)(e)),v=w.filter(e=>!m(e)).slice(0,8),[k,T]=(0,s.useState)(null),[$,B]=(0,s.useState)(null),M=e=>{c.repo.orders.accept(e.id,l),B(`${e.ref} accepted for table ${(0,t.tableNumbers)(e.tableNo)}: it's gone to the kitchen.`)},N=e=>{const t=(0,h.statusBlock)(e,'served',(0,h.linkedBooking)(e,f));if(t)return void B(`${e.ref}: ${t}`);const s=(new Date).toISOString();c.useStore.setState(t=>({orders:t.orders.map(t=>t.id===e.id?{...t,servedBy:{by:l,at:s}}:t)})),c.useStore.getState().setOrderStatus(e.id,'served',l),B(`${e.ref} marked served.`)},O=(e,t)=>{const s=(new Date).toISOString();c.useStore.setState(r=>({orders:r.orders.map(r=>r.id===e.id?{...r,cancelReason:t,cancelledBy:{by:l,at:s}}:r)})),c.useStore.getState().setOrderStatus(e.id,'cancelled',l),T(null),B(`${e.ref} cancelled (${t}). The guest's phone shows the reason.`)},A=({o:e,held:s})=>(0,b.jsxs)(a.Card,{highlight:s?u.colours.amber:e.allergies.length?u.colours.red:u.colours.gold,children:[(0,b.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,b.jsxs)(a.T,{weight:"semibold",children:["Table ",(0,t.tableNumbers)(e.tableNo)," \xb7 ",e.ref]}),(0,b.jsx)(a.Badge,{kind:s?'amber':'cancelled'===e.status?'neutral':'gold',label:s?'Waiting for you':'served'===e.status?'Served':'cancelled'===e.status?'Cancelled':'In the kitchen'})]}),(0,b.jsxs)(a.Muted,{children:[e.customerName," \xb7 ",j(e.createdAt,x),e.accepted?` \xb7 accepted by ${e.accepted.by}`:'']}),e.lines.map((e,t)=>(0,b.jsxs)(a.T,{children:[e.qty,"\xd7 ",e.name,e.notes?` (note: ${e.notes})`:'']},t)),e.allergies.length?(0,b.jsx)(a.Row,{wrap:!0,gap:6,children:e.allergies.map(e=>(0,b.jsx)(a.Badge,{kind:"red",label:`${(0,n.allergenLabel)(e.allergen)}: ${(0,n.severityLabel)(e.severity)}`},e.allergen))}):(0,b.jsx)(a.Muted,{children:"No allergies declared."}),e.notes?(0,b.jsxs)(a.T,{size:13,children:["Note: ",e.notes]}):null,(0,b.jsxs)(a.T,{size:13,colour:u.colours.muted,children:[(0,o.gbp)(e.total)," to pay at the bar or with the server"]}),'cancelled'===e.status&&e.cancelReason?(0,b.jsxs)(a.Muted,{children:["Reason: ",e.cancelReason]}):null,m(e)?k===e.id?(0,b.jsxs)(r.default,{style:{gap:6},children:[(0,b.jsx)(a.T,{size:13,children:"Why are you cancelling? The guest sees this."}),(0,b.jsx)(a.Row,{wrap:!0,gap:6,children:i.CANCEL_REASONS.map(t=>(0,b.jsx)(a.Chip,{label:t,onPress:()=>O(e,t)},t))}),(0,b.jsx)(a.Button,{small:!0,kind:"ghost",label:"Don't cancel",onPress:()=>T(null)})]}):(0,b.jsxs)(a.Row,{gap:8,wrap:!0,children:[s?(0,b.jsx)(a.Button,{small:!0,label:"Accept",testID:`accept-${e.ref}`,onPress:()=>M(e)}):(0,b.jsx)(a.Button,{small:!0,label:"Mark served",testID:`served-${e.ref}`,onPress:()=>N(e)}),(0,b.jsx)(a.Button,{small:!0,kind:"secondary",label:"Cancel with a reason",onPress:()=>T(e.id)})]}):null]});return(0,b.jsxs)(r.default,{style:{gap:10},children:[(0,b.jsx)(a.Muted,{children:"Tip: orders from guests' phones land here within seconds. Accept the first one from a new phone, check allergies, then mark it served. Guests pay at the bar or with their server."}),p?null:(0,b.jsx)(a.Banner,{kind:"demo",title:"Order at the table is off",children:"Managers can switch it on in Settings \u203a Advanced \u203a Order at the table."}),$?(0,b.jsx)(a.Banner,{kind:"success",children:$}):null,(0,b.jsxs)(a.T,{weight:"semibold",children:["Waiting for you to accept (",S.length,")"]}),S.length?S.map(e=>(0,b.jsx)(A,{o:e,held:!0},e.id)):(0,b.jsx)(a.Muted,{children:"Nothing waiting."}),(0,b.jsxs)(a.T,{weight:"semibold",children:["In the kitchen (",y.length,")"]}),y.length?y.map(e=>(0,b.jsx)(A,{o:e,held:!1},e.id)):(0,b.jsx)(a.Muted,{children:"No table orders being made."}),v.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a.T,{weight:"semibold",children:"Served or cancelled"}),v.map(e=>(0,b.jsx)(A,{o:e,held:!1},e.id))]}):null]})};var e,t=_r(d[0]),s=_r(d[1]),l=_r(d[2]),r=(e=l)&&e.__esModule?e:{default:e},a=_r(d[3]),n=_r(d[4]),o=_r(d[5]),i=_r(d[6]),c=_r(d[7]),h=_r(d[8]),u=_r(d[9]),b=_r(d[10]);const j=(e,t)=>{const s=Math.max(0,Math.round((t.getTime()-new Date(e).getTime())/6e4));return s<1?'just now':`${s} min ago`},m=e=>!['served','collected','closed','cancelled'].includes(e.status)},1366,[860,34,102,794,861,867,1148,874,869,821,25]); __d(function(g,_r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.customerCodeLink=y,_e.StaffLoyalty=function({venue:e,canRemove:r=!1,onOpenSettings:u}){const[p,x]=(0,t.useState)(null),[y,b]=(0,t.useState)(''),[S,k]=(0,t.useState)(null),[v,C]=(0,t.useState)(null),[M,T]=(0,t.useState)(!1),[B,R]=(0,t.useState)(''),[P,O]=(0,t.useState)(null),$=(0,c.staffServer)(),L=(0,n.can)('venue.settings'),[N,E]=(0,t.useState)(!1),[D,A]=(0,t.useState)(''),F=async e=>{if(p){E(!0),A('');try{await(0,c.saveSettings)({...p,cardOn:e}),x({...p,cardOn:e,saved:!0});const n=e?'Stamp card switched on':'Stamp card switched off';A(n),s.default.announceForAccessibility?.(n)}catch(e){R((0,o.plainError)(e))}E(!1)}},I=(0,t.useCallback)(()=>{$&&(0,c.readSettings)().then(x).catch(()=>{})},[$]);(0,t.useEffect)(()=>(I(),(0,c.watchLoyalty)(()=>{I(),C(e=>(e&&(0,c.staffCard)(e.id).then(C).catch(()=>{}),e))})),[I]);const _=async(e=y)=>{R('');try{const n=await(0,c.staffFind)(e);k(n),1===n.length&&C(n[0])}catch(e){R((0,o.plainError)(e))}},z=(0,t.useCallback)(e=>{T(!1),b((0,o.prettyCardNo)(e)),_(e)},[]);return $?(0,m.jsxs)(l.default,{style:{gap:10},children:[!p||p.cardOn||L?null:(0,m.jsx)(i.Banner,{kind:"info",title:"The stamp card is off",children:"Ask a manager to switch it on."}),p&&L?(0,m.jsx)(i.Card,{children:(0,m.jsxs)(l.default,{style:{gap:8},testID:"loy-quick",children:[p.cardOn?null:(0,m.jsx)(i.T,{weight:"semibold",children:"The stamp card is off"}),(0,m.jsx)(i.Toggle,{testID:"loy-quick-on",label:"Stamp card on",a11y:"Stamp card on. "+(p.cardOn?'On':'Off'),value:p.cardOn,disabled:N,onChange:e=>{F(e)}}),D?(0,m.jsx)(l.default,{accessibilityLiveRegion:"polite",children:(0,m.jsx)(i.Muted,{children:D})}):null,u?(0,m.jsx)(i.Button,{kind:"ghost",label:"Change the stamp card",testID:"loy-open-settings",onPress:u}):null]})}):null,p&&p.saved?(0,m.jsxs)(i.Muted,{children:[p.stampsNeeded," stamps = ",p.reward||'reward not set',". At most ",p.maxPerDay," a day",p.gapMinutes?`, ${p.gapMinutes} minutes apart`:'',"."]}):null,p&&!p.saved&&L?(0,m.jsxs)(i.Muted,{children:["Suggested settings, not saved yet: ",p.stampsNeeded," stamps = ",p.reward||'reward not set',". At most ",p.maxPerDay," a day",p.gapMinutes?`, ${p.gapMinutes} minutes apart`:'',"."]}):null,(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Find a guest"}),(0,m.jsx)(i.Field,{label:"Name, phone, email or card number",value:y,onChangeText:b,onSubmitEditing:()=>_(),autoCapitalize:"none",testID:"loyalty-search"}),(0,m.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(i.Button,{small:!0,label:"Find",disabled:y.trim().length<2,onPress:()=>_(),testID:"loyalty-find"}),(0,h.canScan)()?(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:M?'Scanning\u2026':'Scan their card',onPress:()=>T(!0)}):null]}),M?(0,m.jsx)(h.CardScanner,{onCard:z,onClose:()=>T(!1)}):null,B?(0,m.jsx)(i.Banner,{kind:"warn",children:B}):null,S&&!S.length?(0,m.jsx)(i.Muted,{children:"No one found. Check the spelling, or sign them up below."}):null,S&&S.length>1?S.map(e=>(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{children:e.name}),(0,m.jsxs)(i.Muted,{children:[(0,o.prettyCardNo)(e.cardNo)," \xb7 ",e.stamps," of ",e.needed,e.phone?` \xb7 ${e.phone}`:'']})]}),e.rewards.length?(0,m.jsx)(i.Badge,{kind:"gold",label:`${e.rewards.length} ready`}):null,(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Open",onPress:()=>C(e)})]},e.id)):null]}),v?(0,m.jsx)(f,{card:v,settings:p,canRemove:r,onChange:e=>{C(e),k(null)},onClose:()=>C(null)}):null,(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Stamp code"}),(0,m.jsx)(i.Muted,{children:"Busy? Make a one-time code and show it to the guest; they type it (or scan it) on their own phone for one stamp."}),P?(0,m.jsx)(j,{c:P,what:"One stamp."}):null,(0,m.jsx)(i.Button,{kind:"secondary",label:P?'Make another code':'Make a stamp code',disabled:!1===p?.cardOn,onPress:()=>{R(''),(0,c.staffCode)('stamp').then(O).catch(e=>R((0,o.plainError)(e)))}})]}),(0,m.jsx)(w,{venue:e,onJoined:e=>{C(e),k(null)}}),(0,m.jsx)(i.Muted,{children:"Tip: search by the last 4 digits of a phone number. Each reward can only be used once, and the card shows who used it and when."})]}):(0,m.jsxs)(l.default,{style:{gap:10},children:[(0,m.jsx)(i.Banner,{kind:"info",title:"Connect to your venue first",children:"The stamp card is saved on your venue's account. Open your invite link on this phone to connect, then you can find guests and add stamps here."}),(0,m.jsx)(i.Muted,{children:"Tip: stamps can only be added by staff of the venue, so a guest can't stamp their own card."})]})};var n=_r(d[0]),t=_r(d[1]),s=e(_r(d[2]));_r(d[3]);var l=e(_r(d[4])),r=_r(d[5]),i=_r(d[6]),o=_r(d[7]),c=_r(d[8]),u=_r(d[9]),h=_r(d[10]),m=_r(d[11]);const p=e=>{try{return new Date(e).toLocaleString('en-GB',{day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})}catch{return e}},x=e=>{try{return new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})}catch{return''}};function y(e){if('undefined'==typeof window||!window.location)return e;const n=window.location.pathname.match(/^(.*?)\/(owner|staff|customer|display|chef)-app(\/|$)/);return new URL(`${n?n[1]:''}/customer-app/index.html?loyalty=${e}`,window.location.origin).toString()}function j({c:e,what:n}){return(0,m.jsxs)(l.default,{style:{gap:4,alignItems:'center'},children:[(0,m.jsx)(i.T,{size:34,weight:"bold",colour:u.colours.gold,center:!0,children:e.code}),(0,m.jsx)(r.QR,{value:y(e.code),size:150}),(0,m.jsxs)(i.Muted,{center:!0,children:[n," Works once, until ",x(e.expiresAt),". The guest types it in Stamp card, or scans this with their phone camera."]})]})}function f({card:e,settings:n,canRemove:s,onChange:r,onClose:h}){const[x,y]=(0,t.useState)(null),[f,w]=(0,t.useState)(!1),[b,S]=(0,t.useState)(null),[k,v]=(0,t.useState)(null),C=async e=>{w(!0),y(null);try{await e()}catch(e){y({kind:'warn',text:(0,o.plainError)(e)})}finally{w(!1),S(null)}};return(0,m.jsxs)(i.Card,{highlight:u.colours.gold,children:[(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.H2,{children:e.name}),(0,m.jsxs)(i.Muted,{children:["Card ",(0,o.prettyCardNo)(e.cardNo),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']})]}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Close",onPress:h})]}),(0,m.jsxs)(i.T,{size:20,weight:"semibold",children:[e.stamps," of ",e.needed," stamps"]}),(0,m.jsxs)(i.Muted,{children:["Next reward: ",e.reward]}),x?(0,m.jsx)(i.Banner,{kind:x.kind,children:x.text}):null,(0,m.jsx)(i.Button,{label:f?'Saving\u2026':'Add a stamp',disabled:f||!1===n?.cardOn,testID:"loyalty-add-stamp",onPress:()=>C(async()=>{const n=await(0,c.staffStamp)(e.id);r(n),y({kind:'success',text:n.newReward?`Stamp added. ${e.name} has earned: ${n.rewards[n.rewards.length-1]?.title??'a reward'}.`:`Stamp added: ${n.stamps} of ${n.needed}.`})})}),!1===n?.cardOn?(0,m.jsx)(i.Muted,{children:"The stamp card is switched off in Settings \u203a Advanced \u203a Loyalty, so no stamps can be added."}):null,e.rewards.length?(0,m.jsx)(i.T,{weight:"semibold",children:"Rewards ready"}):(0,m.jsx)(i.Muted,{children:"No rewards ready yet."}),e.rewards.map(e=>(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{children:e.title}),e.expiresAt?(0,m.jsxs)(i.Muted,{children:["Use by ",p(e.expiresAt)]}):null]}),b===e.id?(0,m.jsxs)(i.Row,{gap:6,children:[(0,m.jsx)(i.Button,{small:!0,label:"Yes, used now",disabled:f,onPress:()=>C(async()=>{const n=await(0,c.staffRedeem)(e.id);r(n),y({kind:'success',text:`${n.redeemed} marked used.`})})}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Not yet",onPress:()=>S(null)})]}):(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Use reward",onPress:()=>S(e.id)})]},e.id)),(0,m.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Sign-in code for their phone",onPress:()=>C(async()=>v(await(0,c.staffCode)('link',e.id)))}),s?'remove'===b?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(i.Button,{small:!0,kind:"danger",label:"Yes, remove their details",onPress:()=>C(async()=>{await(0,c.staffRemove)(e.id),r(null),h()})}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Keep",onPress:()=>S(null)})]}):(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Remove guest",onPress:()=>S('remove')}):null]}),k?(0,m.jsx)(j,{c:k,what:`Opens ${e.name}'s card on their phone.`}):null,'remove'===b?(0,m.jsx)(i.Muted,{children:"Removing wipes their name, phone and email and closes the card (for example if they ask you to delete their data). Counts in the summary stay."}):null,(0,m.jsx)(i.T,{weight:"semibold",children:"Recent"}),e.history.length?e.history.slice(0,8).map((e,n)=>(0,m.jsxs)(i.Muted,{children:[p(e.at)," \xb7 ",e.what]},n)):(0,m.jsx)(i.Muted,{children:"Nothing yet."})]})}function w({venue:e,onJoined:n}){const[s,l]=(0,t.useState)(''),[r,u]=(0,t.useState)(''),[h,p]=(0,t.useState)(''),[x,y]=(0,t.useState)(!1),[j,f]=(0,t.useState)(!1),[w,b]=(0,t.useState)('');return(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Sign a guest up"}),(0,m.jsx)(i.Muted,{children:"Only a name is needed. Read the agreement to the guest and tick it only if they say yes."}),(0,m.jsx)(i.Field,{label:"Guest's name",value:s,onChangeText:l,maxLength:60}),(0,m.jsx)(i.Field,{label:"Phone (optional)",value:r,onChangeText:u,keyboardType:"phone-pad",maxLength:20}),(0,m.jsx)(i.Field,{label:"Email (optional)",value:h,onChangeText:p,keyboardType:"email-address",autoCapitalize:"none",maxLength:120}),(0,m.jsx)(i.Toggle,{label:`The guest agrees: \u201c${(0,o.consentText)(e)}\u201d`,value:x,onChange:y}),w?(0,m.jsx)(i.Banner,{kind:"warn",children:w}):null,(0,m.jsx)(i.Button,{label:j?'Saving\u2026':'Sign up',disabled:j||!x||!s.trim(),onPress:async()=>{f(!0),b('');try{n(await(0,c.staffJoin)({name:s,phone:r,email:h,consent:x,consentText:(0,o.consentText)(e)})),l(''),u(''),p(''),y(!1)}catch(e){b((0,o.plainError)(e))}finally{f(!1)}}})]})}},1367,[988,34,281,236,102,1242,794,1217,1220,821,1368,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"canScan",{enumerable:!0,get:function(){return l}}),_e.CardScanner=function({onCard:t,onClose:n}){const f=(0,e.useRef)(null),[h,w]=(0,e.useState)('');return(0,e.useEffect)(()=>{if(!l())return void w('This browser can\u2019t scan. Type the card number or search by name instead.');let e=!1,n=null,c=null;const o=document.createElement('video');return o.setAttribute('playsinline','true'),o.muted=!0,Object.assign(o.style,{width:'100%',maxWidth:'360px',borderRadius:'12px',border:'2px solid #CFA45F'}),(async()=>{try{if(n=await navigator.mediaDevices.getUserMedia({video:{facingMode:'environment'}}),e)return void n.getTracks().forEach(e=>e.stop());o.srcObject=n,await o.play();const u=f.current;u?.appendChild(o);const l=new(0,window.BarcodeDetector)({formats:['qr_code']}),h=async()=>{if(!e){try{const e=await l.detect(o);for(const n of e){const e=(0,s.readCardQr)(String(n.rawValue??''));if(e)return void t(e)}}catch{}c=setTimeout(h,300)}};h()}catch{w('The camera didn\u2019t start. Allow the camera, or type the card number instead.')}})(),()=>{e=!0,c&&clearTimeout(c),n?.getTracks().forEach(e=>e.stop()),o.remove()}},[t]),(0,u.jsxs)(c.default,{style:{gap:8,alignItems:'center'},children:[(0,u.jsx)(c.default,{ref:f,style:{width:'100%',alignItems:'center'}}),h?(0,u.jsx)(o.Banner,{kind:"warn",children:h}):(0,u.jsx)(o.Muted,{center:!0,children:"Point the camera at the QR on the guest\u2019s card screen."}),(0,u.jsx)(o.Button,{kind:"ghost",label:"Close camera",onPress:n})]})};var e=r(d[0]);r(d[1]);var t,n=r(d[2]),c=(t=n)&&t.__esModule?t:{default:t},o=r(d[3]),s=r(d[4]),u=r(d[5]);const l=()=>'undefined'!=typeof window&&'BarcodeDetector'in window&&!!navigator?.mediaDevices?.getUserMedia},1368,[34,236,102,794,1217,25]); diff --git a/customer-app/admin.html b/customer-app/admin.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/admin.html +++ b/customer-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer.html b/customer-app/customer.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer.html +++ b/customer-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage.html b/customer-app/customer/anchorage.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer/anchorage.html +++ b/customer-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/book.html b/customer-app/customer/anchorage/book.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer/anchorage/book.html +++ b/customer-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/feedback.html b/customer-app/customer/anchorage/feedback.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer/anchorage/feedback.html +++ b/customer-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/gift.html b/customer-app/customer/anchorage/gift.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer/anchorage/gift.html +++ b/customer-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/lost.html b/customer-app/customer/anchorage/lost.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer/anchorage/lost.html +++ b/customer-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/loyalty.html b/customer-app/customer/anchorage/loyalty.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer/anchorage/loyalty.html +++ b/customer-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/merch.html b/customer-app/customer/anchorage/merch.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer/anchorage/merch.html +++ b/customer-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/offers.html b/customer-app/customer/anchorage/offers.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer/anchorage/offers.html +++ b/customer-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/refer.html b/customer-app/customer/anchorage/refer.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer/anchorage/refer.html +++ b/customer-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/waitlist.html b/customer-app/customer/anchorage/waitlist.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer/anchorage/waitlist.html +++ b/customer-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/whatson.html b/customer-app/customer/anchorage/whatson.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer/anchorage/whatson.html +++ b/customer-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/basket.html b/customer-app/customer/basket.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer/basket.html +++ b/customer-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/profile.html b/customer-app/customer/profile.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/customer/profile.html +++ b/customer-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/demo.html b/customer-app/demo.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/demo.html +++ b/customer-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/display.html b/customer-app/display.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/display.html +++ b/customer-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/index.html b/customer-app/index.html index 6dfad7d4e01ad5577b790e9d4f340e63afb309e9..78eef4cddbb030b38a9805cff89bffa60337c591 100644 --- a/customer-app/index.html +++ b/customer-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/kitchen.html b/customer-app/kitchen.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/kitchen.html +++ b/customer-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/owner.html b/customer-app/owner.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/owner.html +++ b/customer-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/staff.html b/customer-app/staff.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/staff.html +++ b/customer-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/sw.js b/customer-app/sw.js index c0e218586ee0748eb57e67c085ab834b7c1b624d..c19a6f135919dc3b02632e8953dc2b7c97b3942d 100644 --- a/customer-app/sw.js +++ b/customer-app/sw.js @@ -1,7 +1,7 @@ // Anchorage service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-customer-df085634a0"; +const V = "cc-customer-71c4739bed"; const BASE = "/customer-app/"; -const PRECACHE = ["/customer-app/apple-touch-icon.png", "/customer-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/customer-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/customer-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/customer-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/customer-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/customer-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/customer-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/customer-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/customer-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/customer-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/customer-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/customer-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/customer-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/customer-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/customer-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/customer-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/customer-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/customer-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/customer-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/customer-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/customer-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/customer-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/customer-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/customer-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/customer-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/customer-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/customer-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/customer-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/customer-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/customer-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/customer-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/customer-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/customer-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/customer-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/customer-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/customer-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/customer-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/customer-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/customer-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/customer-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/customer-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/customer-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/customer-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/customer-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/customer-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/customer-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/customer-app/brand-logo.png", "/customer-app/favicon.ico", "/customer-app/icon-192.png", "/customer-app/icon-512.png", "/customer-app/icon-maskable-192.png", "/customer-app/icon-maskable-512.png", "/customer-app/manifest.webmanifest", "/customer-app/index.html", "/customer-app/_expo/static/js/web/bundle.js?v=df085634a03d2317f6edd654b5c2d1687e6ca6c327696b7ca11530e62ba59d18"]; +const PRECACHE = ["/customer-app/apple-touch-icon.png", "/customer-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/customer-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/customer-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/customer-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/customer-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/customer-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/customer-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/customer-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/customer-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/customer-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/customer-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/customer-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/customer-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/customer-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/customer-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/customer-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/customer-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/customer-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/customer-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/customer-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/customer-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/customer-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/customer-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/customer-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/customer-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/customer-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/customer-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/customer-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/customer-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/customer-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/customer-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/customer-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/customer-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/customer-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/customer-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/customer-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/customer-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/customer-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/customer-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/customer-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/customer-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/customer-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/customer-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/customer-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/customer-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/customer-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/customer-app/brand-logo.png", "/customer-app/favicon.ico", "/customer-app/icon-192.png", "/customer-app/icon-512.png", "/customer-app/icon-maskable-192.png", "/customer-app/icon-maskable-512.png", "/customer-app/manifest.webmanifest", "/customer-app/index.html", "/customer-app/_expo/static/js/web/bundle.js?v=71c4739bedec01a75f38a3f215558ae8991bcd137db56a33b04a39265fba77b3"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/customer-app/team.html b/customer-app/team.html index 5b72cd6d7537796ec5e23b54c31166bc4295d2ef..e4fa4d70277b2c113017dbdca7429fe5fd238929 100644 --- a/customer-app/team.html +++ b/customer-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/_expo/static/js/web/bundle.js b/display-app/_expo/static/js/web/bundle.js index 0697cc76bc835ee903ad82e204a7f4647cbace2f..c5abc4599feac71dc2e81b6b8fe0465e6edeb7fa 100644 --- a/display-app/_expo/static/js/web/bundle.js +++ b/display-app/_expo/static/js/web/bundle.js @@ -6,7 +6,7 @@ var __BUNDLE_START_TIME__=globalThis.nativePerformanceNow?nativePerformanceNow() __d(function(g,r,i,a,m,e,d){"use strict";r(d[0]),r(d[1])},0,[1,19]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";var e,t=_r(d[0]),o=_r(d[1]),a=_r(d[2]),n=_r(d[3]),i=_r(d[4]),c=(e=i)&&e.__esModule?e:{default:e};if(t.PITCH){const e=o.restaurants.find(e=>'anchorage'===e.id);e&&Object.assign(e,{name:n.PITCH_VENUE.name,tagline:n.PITCH_VENUE.tagline,location:n.PITCH_VENUE.location,phone:n.PITCH_VENUE.phone,website:n.PITCH_VENUE.website,hoursNote:'Kitchen (food) hours. The closing time is last food orders.',fictional:!1}),e&&(e.settings={...e.settings,whatsapp:'07700 900123'});for(const e of c.default.areas)delete e.best;for(let e=a.ROSTER.length-1;e>=0;e--){const t=n.PITCH_TEAM[a.ROSTER[e].id];t?(Object.assign(a.ROSTER[e],{name:t.name,job:t.job,hourlyPence:t.hourlyPence,...t.dept?{dept:t.dept}:{},...null!=t.salaried?{salaried:t.salaried}:{}}),delete a.ROSTER[e].nickname):a.ROSTER.splice(e,1)}if('undefined'!=typeof document){const e=t=>{if(3===t.nodeType){const e=t.nodeValue??'',o=(0,n.pitchText)(e);return void(o!==e&&(t.nodeValue=o))}if(1!==t.nodeType)return;const o=t;if('INPUT'===o.tagName||'TEXTAREA'===o.tagName){const e=o,t=(0,n.pitchText)(e.value);t!==e.value&&(e.value=t);const a=e.getAttribute('placeholder');if(a){const t=(0,n.pitchText)(a);t!==a&&e.setAttribute('placeholder',t)}}for(const e of['aria-label','title']){const t=o.getAttribute(e);if(t){const a=(0,n.pitchText)(t);a!==t&&o.setAttribute(e,a)}}o.childNodes.forEach(e)},t=()=>{e(document.body),document.title=(0,n.pitchText)(document.title),new MutationObserver(t=>{for(const o of t)'characterData'===o.type?e(o.target):o.addedNodes.forEach(e),'attributes'===o.type&&e(o.target);document.title=(0,n.pitchText)(document.title)}).observe(document.body,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:['value','placeholder','aria-label']}),document.addEventListener('input',e=>{e.target},!0)};document.body?t():document.addEventListener('DOMContentLoaded',t)}}},1,[2,3,15,17,18]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PITCH",{enumerable:!0,get:function(){return n}});const n=(['anchorage','souters','kirkmichael','wildings','kirkton','abbotsford','greenside',"3idiots","cecchinis","mrbasrais","yasmins","williewastles","rupeeroom","smokinggoat","pizzaioli","drunkencoo"].includes("anchorage"),!1)},2,[]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return t.GREENSIDE_RESTAURANT}}),Object.defineProperty(e,"ABBOTSFORD_RESTAURANT",{enumerable:!0,get:function(){return n.ABBOTSFORD_RESTAURANT}}),Object.defineProperty(e,"KIRKTON_RESTAURANT",{enumerable:!0,get:function(){return o.KIRKTON_RESTAURANT}}),Object.defineProperty(e,"WILDINGS_RESTAURANT",{enumerable:!0,get:function(){return s.WILDINGS_RESTAURANT}}),Object.defineProperty(e,"KIRKMICHAEL_RESTAURANT",{enumerable:!0,get:function(){return c.KIRKMICHAEL_RESTAURANT}}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return R}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);const u={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:16,bookingSlotMinutes:15,deposit:{...r(d[6]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},h={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},f={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},b={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},p=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:f,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...u,orderAtTable:!1,pay:h,cashUpRecord:[...l.ANCHORAGE_CASH_UP]},sections:[]},{id:'saltmarsh',name:'The Venue',tagline:'FICTIONAL demo restaurant \u2014 shows multi-tenancy',location:'Port Ailsa (fictional town)',fictional:!0,kitchenHours:{0:['12:00','20:00'],1:['12:00','20:00'],2:['12:00','20:00'],3:['12:00','20:00'],4:['12:00','21:00'],5:['12:00','21:00'],6:['12:00','21:00']},settings:{...u,slotCap:4,stampTarget:6,stampReward:'Free side',capacityPerHour:30},sections:['Small plates','Mains','Puddings']},{id:'brae',name:'Brae Bakehouse',tagline:'FICTIONAL demo caf\xe9 \u2014 shows multi-tenancy',location:'Kilbrae (fictional village)',fictional:!0,kitchenHours:{0:['09:00','16:00'],1:['09:00','16:00'],2:['09:00','16:00'],3:['09:00','16:00'],4:['09:00','16:00'],5:['09:00','20:00'],6:['09:00','20:00']},settings:{...u,slotCap:5,slotMinutes:15,stampTarget:10,stampReward:'Free coffee & cake',capacityPerHour:24,bookingCoversPerSlot:10},sections:['Bakes','Lunch','Hot drinks']}],A={by:'Fictional demo',at:'2026-10-26'},T=(t,n,o,s,c,l,u,h,f=[])=>({id:n,restaurantId:t,section:o,name:s,description:c,price:l,allergens:u,prepMins:h,dietary:f,soldOut:!1,signOff:A}),R=[T('saltmarsh','s-beets','Small plates','Roast beetroot & whipped feta','Fictional dish for the demo.',750,{milk:'contains',treenuts:'may'},6,['V']),T('saltmarsh','s-squid','Small plates','Salt & pepper squid','Fictional dish for the demo.',850,{molluscs:'contains',gluten:'contains'},7),T('saltmarsh','s-hake','Mains','Pan-roast hake, mussel broth','Fictional dish for the demo.',1950,{fish:'contains',molluscs:'contains',milk:'contains',celery:'contains'},15),T('saltmarsh','s-risotto','Mains','Wild mushroom risotto','Fictional dish for the demo.',1600,{milk:'contains',celery:'contains',sulphites:'contains'},16,['V']),T('saltmarsh','s-cranachan','Puddings','Cranachan','Fictional dish for the demo.',700,{milk:'contains',gluten:'contains'},3,['V']),T('brae','b-scone','Bakes','Cheese scone','Fictional dish for the demo.',350,{gluten:'contains',milk:'contains',eggs:'contains'},2,['V']),T('brae','b-caramel','Bakes','Millionaire\u2019s shortbread','Fictional dish for the demo.',300,{gluten:'contains',milk:'contains',soya:'may'},1,['V']),T('brae','b-toastie','Lunch','Ham & mustard toastie','Fictional dish for the demo.',750,{gluten:'contains',milk:'contains',mustard:'contains'},6),T('brae','b-soup','Lunch','Lentil soup & bread','Fictional dish for the demo.',600,{gluten:'contains',celery:'contains'},4,['VG']),T('brae','b-flat','Hot drinks','Flat white','Fictional dish for the demo.',330,{milk:'contains'},2,['V'])]},3,[4,8,9,10,12,13,14]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return t.GREENSIDE_RESTAURANT}}),Object.defineProperty(e,"ABBOTSFORD_RESTAURANT",{enumerable:!0,get:function(){return n.ABBOTSFORD_RESTAURANT}}),Object.defineProperty(e,"KIRKTON_RESTAURANT",{enumerable:!0,get:function(){return o.KIRKTON_RESTAURANT}}),Object.defineProperty(e,"WILDINGS_RESTAURANT",{enumerable:!0,get:function(){return s.WILDINGS_RESTAURANT}}),Object.defineProperty(e,"KIRKMICHAEL_RESTAURANT",{enumerable:!0,get:function(){return c.KIRKMICHAEL_RESTAURANT}}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return R}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);const u={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:20,bookingSlotMinutes:15,deposit:{...r(d[6]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},h={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},f={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},b={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},p=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:f,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...u,orderAtTable:!1,pay:h,cashUpRecord:[...l.ANCHORAGE_CASH_UP],bookingCoversPerStart:15,bookingPartiesPerStart:4,onlinePartyMin:1,onlinePartyMax:8,bookingNoticeMins:15,autoAcceptUpTo:8},sections:[]},{id:'saltmarsh',name:'The Venue',tagline:'FICTIONAL demo restaurant \u2014 shows multi-tenancy',location:'Port Ailsa (fictional town)',fictional:!0,kitchenHours:{0:['12:00','20:00'],1:['12:00','20:00'],2:['12:00','20:00'],3:['12:00','20:00'],4:['12:00','21:00'],5:['12:00','21:00'],6:['12:00','21:00']},settings:{...u,slotCap:4,stampTarget:6,stampReward:'Free side',capacityPerHour:30},sections:['Small plates','Mains','Puddings']},{id:'brae',name:'Brae Bakehouse',tagline:'FICTIONAL demo caf\xe9 \u2014 shows multi-tenancy',location:'Kilbrae (fictional village)',fictional:!0,kitchenHours:{0:['09:00','16:00'],1:['09:00','16:00'],2:['09:00','16:00'],3:['09:00','16:00'],4:['09:00','16:00'],5:['09:00','20:00'],6:['09:00','20:00']},settings:{...u,slotCap:5,slotMinutes:15,stampTarget:10,stampReward:'Free coffee & cake',capacityPerHour:24,bookingCoversPerSlot:10},sections:['Bakes','Lunch','Hot drinks']}],A={by:'Fictional demo',at:'2026-10-26'},T=(t,n,o,s,c,l,u,h,f=[])=>({id:n,restaurantId:t,section:o,name:s,description:c,price:l,allergens:u,prepMins:h,dietary:f,soldOut:!1,signOff:A}),R=[T('saltmarsh','s-beets','Small plates','Roast beetroot & whipped feta','Fictional dish for the demo.',750,{milk:'contains',treenuts:'may'},6,['V']),T('saltmarsh','s-squid','Small plates','Salt & pepper squid','Fictional dish for the demo.',850,{molluscs:'contains',gluten:'contains'},7),T('saltmarsh','s-hake','Mains','Pan-roast hake, mussel broth','Fictional dish for the demo.',1950,{fish:'contains',molluscs:'contains',milk:'contains',celery:'contains'},15),T('saltmarsh','s-risotto','Mains','Wild mushroom risotto','Fictional dish for the demo.',1600,{milk:'contains',celery:'contains',sulphites:'contains'},16,['V']),T('saltmarsh','s-cranachan','Puddings','Cranachan','Fictional dish for the demo.',700,{milk:'contains',gluten:'contains'},3,['V']),T('brae','b-scone','Bakes','Cheese scone','Fictional dish for the demo.',350,{gluten:'contains',milk:'contains',eggs:'contains'},2,['V']),T('brae','b-caramel','Bakes','Millionaire\u2019s shortbread','Fictional dish for the demo.',300,{gluten:'contains',milk:'contains',soya:'may'},1,['V']),T('brae','b-toastie','Lunch','Ham & mustard toastie','Fictional dish for the demo.',750,{gluten:'contains',milk:'contains',mustard:'contains'},6),T('brae','b-soup','Lunch','Lentil soup & bread','Fictional dish for the demo.',600,{gluten:'contains',celery:'contains'},4,['VG']),T('brae','b-flat','Hot drinks','Flat white','Fictional dish for the demo.',330,{milk:'contains'},2,['V'])]},3,[4,8,9,10,12,13,14]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_UUID",{enumerable:!0,get:function(){return n.GREENSIDE_UUID}}),Object.defineProperty(e,"GREENSIDE_BOOKING_PHONE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"GREENSIDE_VENUE_HOURS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"GREENSIDE_KITCHEN_HOURS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return u}});var n=r(d[0]);const t='tel:01655889685',o={0:['10:00','00:00'],1:null,2:null,3:['10:00','23:00'],4:['10:00','23:00'],5:['10:00','00:00'],6:['10:00','00:00']},s={0:['10:00','20:00'],1:null,2:null,3:['10:00','20:00'],4:['10:00','20:00'],5:['10:00','21:00'],6:['10:00','21:00']},u={id:'greenside',name:'The Greenside Restaurant',tagline:'Restaurant \xb7 Wood Fired Pizza \xb7 Maybole',location:'5 Greenside, Maybole, South Ayrshire KA19 7DG',address:'5 Greenside, Maybole, South Ayrshire KA19 7DG',phone:'01655 889685',email:'info@thegreensiderestaurant.co.uk',emailNeedsConfirmation:!0,website:'thegreensiderestaurant.co.uk',fictional:!1,cashOnly:!0,kitchenHours:s,venueHours:o,hoursNote:'Closed Monday and Tuesday. Venue Wednesday and Thursday 10:00\u201323:00, Friday to Sunday 10:00\u201300:00. Kitchen Wednesday, Thursday and Sunday 10:00\u201320:00; Friday and Saturday 10:00\u201321:00. Cash only.',sections:[],settings:{slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!0,bookingCoversPerSlot:0,stampTarget:8,stampReward:'',stampMinSpend:0,capacityPerHour:0,walkInShare:0,turnMins:75,orderAtTable:!1,showTakeaway:!1,shortName:'The Greenside',reserveStock:!1,tableRequests:!0,deposit:{on:!1,perPersonPence:null,fromParty:null,refundable:null,cutoffHours:null,needsConfirmation:!0,wixLinksOn:!1,policy:'Deposit policy needs confirmation. Deposits and payments are off. Requests need a manager to confirm.'}}}},4,[5]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VENUE_RID",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ISOLATED_VENUE_IDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"IS_GREENSIDE",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"GREENSIDE_UUID",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"IS_ABBOTSFORD",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ABBOTSFORD_UUID",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"IS_KIRKTON",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"KIRKTON_UUID",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"IS_QUEUED_VENUE",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"IS_SOUTERS",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"IS_WILDINGS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"IS_KIRKMICHAEL",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"IS_ISOLATED_VENUE",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"SOUTERS_UUID",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"KIRKMICHAEL_UUID",{enumerable:!0,get:function(){return U}}),Object.defineProperty(e,"WILDINGS_UUID",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"VENUE_UUID",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"venueKey",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"venueIdentityAllowed",{enumerable:!0,get:function(){return D}});var n=r(d[0]);const t="anchorage".toLowerCase().replace(/[^a-z0-9-]/g,'')||'anchorage',c={"3idiots":"59766322-119e-4036-a18a-f6909f60a8d2",cecchinis:"596c6f7e-9797-4e16-84fe-db4a99fa1bdc",mrbasrais:"5d500571-e205-4ead-bb58-60e986b6f40e",yasmins:"f43f20ad-55d0-4008-88c8-7738dc1698df",williewastles:"6abc2793-93ab-4e23-a705-b4011a5cc011",rupeeroom:"78bff97d-5f07-440a-bb99-f6a6118da7a3",smokinggoat:"cd985ff5-2443-458d-ac8b-342d553628cf",pizzaioli:"35f870fc-772c-4aad-bb9e-09a9a16bc925",drunkencoo:"f500ef12-b405-438b-9671-e54289bec5dd",abbotsford:'24624ea5-d1e3-4182-b0d1-73402b8a1532',kirkton:'e0afad1d-cbc1-414a-add6-92e47d302139',greenside:'1bc2a056-2ef6-4585-abfd-b7d21c84f215',souters:'41ce63ca-ae46-432d-a5ba-25e1b801e64d',kirkmichael:'43c8da91-b8b8-4ce9-9ab7-f00c84c5f4f6',wildings:'47f86b36-4c99-466a-be9c-30eb3d79f1e1'},b='greenside'===t,u=c.greenside,f='abbotsford'===t,o=c.abbotsford,l='kirkton'===t,s=c.kirkton,I=(0,n.isQueuedVenue)(t),O='souters'===t,p='wildings'===t,y='kirkmichael'===t,E=Object.prototype.hasOwnProperty.call(c,t),_=c.souters,U=c.kirkmichael,S=c.wildings,j=c[t],P=n=>E?`cc-venue:${t}:${n}`:n,D=(c,b)=>!E||c===j&&b===(0,n.queuedDatabaseSlug)(t)},5,[6]); __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"queuedVenues",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"isQueuedVenue",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"queuedDatabaseSlug",{enumerable:!0,get:function(){return o}}),_e.queuedRestaurant=function(e){const t=n[e];if(!t)throw Error('Unknown venue');const s=t.kitchenSessionsByDay??t.hours.sessionsByDay,o=Object.fromEntries(Array.from({length:7},(e,t)=>[t,s?.[t]?.length?[s[t][0][0],s[t][s[t].length-1][1]]:null]));return{id:e,name:t.name,location:t.address,address:t.address,phone:t.phone||'',email:t.email||'',website:t.website||'',fictional:!1,tagline:'Restaurant',kitchenHours:o,...s?{kitchenSessionsByDay:s}:{},hoursNeedsConfirmation:!0,hoursNote:t.hours.note,sections:[],settings:{slotMinutes:15,slotCap:0,bufferMins:0,leadMins:0,takeawayPaused:!0,bookingCoversPerSlot:0,stampTarget:0,stampReward:'',stampMinSpend:0,capacityPerHour:0,walkInShare:0,turnMins:0,orderAtTable:!1,showTakeaway:!1,shortName:t.name,reserveStock:!1,tableRequests:!0,deposit:{on:!1,perPersonPence:null,fromParty:null,refundable:null,cutoffHours:null,needsConfirmation:!0,wixLinksOn:!1,policy:'Deposit terms to confirm. No payment is taken for requests.'}}}};var e,t=r(d[0]);const n=((e=t)&&e.__esModule?e:{default:e}).default,s=e=>Object.prototype.hasOwnProperty.call(n,e),o=e=>s(e)?n[e].databaseSlug:e},6,[7]); @@ -1092,7 +1092,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},1009,[34,1010]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},1010,[1007,978,1011]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},1011,[1007]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.142'},1012,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.144'},1012,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:h}=await r.select();c&&s(c,h);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},h='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,h.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),h}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),h={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:h})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},1013,[1014,1015,934,978,1010]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},1015,[978]); @@ -1193,11 +1193,11 @@ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{ __d(function(_g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.saveBookingTables=$,_e.TablePicker=function({rid:e,booking:u,name:p,turnBase:k=90,onClose:v,onSaved:w,onPickOnPlan:T}){const C=(0,b.usePlan)(e),L=(0,c.useBookings)(e),[S,W]=(0,t.useState)(()=>(0,b.tablesOf)((0,h.tableKey)((0,b.tablesOf)(u.table)))),P=(0,t.useMemo)(()=>(0,h.pickGroups)(C),[C]),z=L.filter(e=>e.date===u.date),O=(0,h.seatsOf)(C,S),D=(0,h.seatLine)(O.total,u.partySize),I=(0,h.pickClashes)(u,S,z,k),B=e=>(0,h.pickClashes)(u,[e],z,k)[0]?.with,M=(0,h.tableKey)(S)!==(0,h.tableKey)((0,b.tablesOf)(u.table)),N=(0,f.useBlocks)(e=>e.blocks),R=(0,f.blockAt)(N,e,u.date,u.time),_=e=>W(s=>(0,h.toggleTable)(s,e)),Y=async s=>{try{await $(e,u,s),w?.((0,h.savedWords)(p,u.partySize,s,(0,h.seatsOf)(C,s).total)),v()}catch(e){w?.(`Couldn\u2019t save tables for ${p}: ${String(e?.message??e).slice(0,120)}`)}},G=(0,x.jsxs)(n.default,{style:{gap:8},children:[(0,x.jsxs)(n.default,{testID:"table-pick-total",accessible:!0,accessibilityLabel:`${(0,h.tablesWords)(S)} picked. ${D.text}.`,children:[(0,x.jsx)(y.T,{size:18,weight:"semibold",colour:g.colours.goldLight,children:(0,h.tablesWords)(S)}),(0,x.jsx)(y.T,{size:17,colour:g.colours.text,children:D.text})]}),R?(0,x.jsx)(n.default,{testID:"table-pick-pause",accessible:!0,accessibilityLabel:`Note. New bookings are paused ${R.from} to ${R.to}${R.reason?` (${R.reason})`:''}. You can still assign tables to this booking.`,style:{padding:10,borderRadius:10,borderWidth:1,borderColor:g.colours.goldMuted},children:(0,x.jsxs)(y.T,{size:16,colour:g.colours.goldLight,children:["New bookings paused ",R.from,"\u2013",R.to,R.reason?` \xb7 ${R.reason}`:'',". You can still save tables for this booking."]})}):null,I.length?(0,x.jsx)(n.default,{testID:"table-pick-clash",accessible:!0,accessibilityLabel:`Warning. ${(0,h.clashWords)(I)} You can still save.`,style:{padding:10,borderRadius:10,borderWidth:1,borderColor:g.colours.gold},children:(0,x.jsxs)(y.T,{size:16,weight:"semibold",colour:g.colours.goldLight,children:[(0,h.clashWords)(I)," You can still save."]})}):null,(0,x.jsxs)(y.Row,{gap:8,wrap:!0,children:[(0,x.jsx)(y.Button,{testID:"table-pick-save",label:I.length?'Save anyway':'Save tables',disabled:!M||!S.length,accessibilityLabel:`${I.length?'Save anyway, ':'Save, '}${(0,h.tablesWords)(S)} for ${p}. ${D.text}.${I.length?` ${(0,h.clashWords)(I)}`:''}`,onPress:()=>Y(S),style:[j,{flexGrow:1}]}),(0,b.tablesOf)(u.table).length?(0,x.jsx)(y.Button,{testID:"table-pick-clear",kind:"secondary",label:"Clear table",accessibilityLabel:`Clear table, take ${(0,h.tablesWords)((0,b.tablesOf)(u.table)).toLowerCase()} off ${p}`,onPress:()=>Y([]),style:j}):null,(0,x.jsx)(y.Button,{testID:"table-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",onPress:v,style:j})]})]});return(0,x.jsxs)(y.Sheet,{visible:!0,onClose:v,title:`Tables \xb7 ${u.time} ${p} \xb7 ${u.partySize} Covers`,maxWidth:760,testID:"table-picker",footer:G,children:[(0,x.jsx)(s.TableNumberWarning,{plan:C}),(0,x.jsx)(y.T,{size:16,colour:g.colours.text,children:"Tap one table, or several to join them. Tap again to take one off."}),T?(0,x.jsx)(y.Button,{kind:"secondary",testID:"table-pick-on-plan",label:"Pick on the table plan",accessibilityLabel:`Pick on the table plan instead, for ${p}`,onPress:()=>T(S),style:j}):null,P.map(e=>(0,x.jsxs)(n.default,{style:{gap:6},accessibilityLabel:e.area,children:[(0,x.jsx)(y.T,{size:15,weight:"semibold",colour:g.colours.gold,children:e.area}),(0,x.jsx)(y.Row,{gap:8,wrap:!0,children:e.tables.map(e=>{const s=S.includes(e.name),t=B(e.name);return(0,x.jsxs)(o.default,{testID:`table-pick-${e.name}`,accessibilityRole:"checkbox",accessibilityState:{checked:s},'aria-checked':s,accessibilityLabel:(0,h.pickA11y)(e.name,e.seats,s,t),onPress:()=>_(e.name),style:({pressed:e})=>({minWidth:92,minHeight:64,paddingHorizontal:10,paddingVertical:6,borderRadius:12,alignItems:'center',justifyContent:'center',borderWidth:s?2:1,borderColor:s?g.colours.gold:t?g.colours.goldMuted:g.colours.hairline,borderStyle:t&&!s?'dashed':'solid',backgroundColor:s?g.colours.gold:e?g.colours.tilePressed:g.colours.tile}),children:[(0,x.jsx)(y.T,{size:18,weight:"semibold",colour:s?g.colours.onGold:g.colours.text,children:(0,l.tableNumbers)(e.name)}),(0,x.jsxs)(y.T,{size:14,colour:s?g.colours.onGold:g.colours.muted,children:[e.seats," seats",t?' \xb7 booked':'']})]},e.name)})})]},e.area)),P.length?null:(0,x.jsx)(y.Muted,{children:"No tables on the plan yet. Add them in Setup \u203a Table plan."})]})};var s=r(d[0]),l=r(d[1]),t=r(d[2]),o=e(r(d[3])),n=e(r(d[4])),c=r(d[5]),b=r(d[6]),u=r(d[7]),h=r(d[8]),g=r(d[9]),p=r(d[10]),y=r(d[11]),k=r(d[12]),f=r(d[13]),x=r(d[14]);const j={minHeight:56};async function $(e,s,l){const t=(0,h.tableKey)(l),o=(0,b.tablesOf)(s.table);await c.repo.bookings.update(s.id,(0,u.tablePatch)(t||null)),'seated'===s.status&&s.date===(0,p.venueYmd)(new Date)&&(o.filter(e=>!(0,b.tablesOf)(t).includes(e)).forEach(s=>b.useFloor.getState().setLive(e,s,{stage:void 0,dirty:!0})),t&&(0,k.resetTableLive)(e,t))}},1110,[1111,860,34,402,102,874,1021,1109,1112,821,858,794,1113,1018,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.TableNumberWarning=function({plan:u}){const c=(0,n.numberClashes)(u.tables),o=[...new Set([...c.acrossAreas,...u.tables.filter(n=>c.sameArea.has(n.name)).map(n.tableNumber)])];return o.length?(0,l.jsxs)(t.T,{testID:"duplicate-table-numbers",size:16,colour:s.colours.goldLight,children:["Duplicate table numbers: ",o.join(', '),". Kept unchanged. Ask a manager to check the areas before assigning."]}):null},r(d[0]);var n=r(d[1]),s=r(d[2]),t=r(d[3]),l=r(d[4])},1111,[34,859,821,794,25]); __d(function(_g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"byNum",{enumerable:!0,get:function(){return s}}),e.tableKey=o,e.toggleTable=function(t,n){return t.includes(n)?t.filter(t=>t!==n):a(o([...t,n]))},e.seatsOf=function(t,n){const a={};for(const s of n)a[s]=t.tables.find(t=>t.name===s)?.maxSeats??0;return{per:a,total:Object.values(a).reduce((t,n)=>t+n,0)}},e.seatLine=function(t,n){const a=Math.max(0,n-t);return{text:`${t} ${1===t?'seat':'seats'} for ${l(n)}${a?`: ${a} short`:''}`,short:a,fits:0===a&&t>0}},e.pickClashes=function(t,l,u,c=90){if(!l.length)return[];const f={...t,table:o(l)},b=[];for(const s of u)if(s.id!==t.id&&s.date===t.date&&!['cancelled','noshow','finished'].includes(s.status)&&(0,n.startOf)(f)<(0,n.endOf)(s,c)&&(0,n.startOf)(s)<(0,n.endOf)(f,c))for(const t of a(s.table))l.includes(t)&&b.push({table:t,with:s});return b.sort((t,n)=>s(t.table,n.table))},e.clashWords=function(n){return n.map(n=>`${(0,t.tableNumbers)(n.table)} has ${n.with.walkIn?'a walk-in':(n.with.name||'a booking').replace(' (example)','')} at ${n.with.time}`).join('. ')+(n.length?'.':'')},e.tablesWords=u,e.pickA11y=function(n,a,s,l){return`Table ${(0,t.tableNumbers)(n)}, ${a} ${1===a?'seat':'seats'}${s?', selected':''}${l?`, has ${l.walkIn?'a walk-in':l.name} at ${l.time}`:''}`},e.pickGroups=function(t){return t.areas.map(n=>({area:n.name,tables:t.tables.filter(t=>t.areaId===n.id).map(t=>({name:t.name,seats:t.maxSeats})).sort((t,n)=>s(t.name,n.name))})).filter(t=>t.tables.length)},e.savedWords=function(t,n,a,s){return a.length?`${t}, ${l(n)}: ${u(a)} (${s} seats).`:`${t}: table taken off.`},e.tableActions=function(t,n){const s=a(t.table);if(['cancelled','noshow'].includes(t.status))return[];const o=[s.length?{id:'assign',label:'Change table',a11y:`Change table for ${n}, ${l(t.partySize)}, now ${u(s).toLowerCase()}. You can pick several tables to join.`}:{id:'assign',label:'Assign table',a11y:`Assign table for ${n}, ${l(t.partySize)}. You can pick several tables to join.`}];s.length&&o.push({id:'clear',label:'Clear table',a11y:`Clear table for ${n}, take ${u(s).toLowerCase()} off this booking`});return o},e.dragTables=function(t,n,s){if(!s||'__none'===s||s===n)return null;const l=a(t);if(l.includes(s))return null;return o('__none'!==n&&l.includes(n)?l.map(t=>t===n?s:t):[s])};var t=r(d[0]),n=r(d[1]);const a=t=>t?t.split('+').map(t=>t.trim()).filter(Boolean):[],s=(t,n)=>t.localeCompare(n,'en-GB',{numeric:!0}),l=t=>`${t} ${1===t?'person':'people'}`;function o(t){return[...new Set(t.map(t=>String(t).trim()).filter(Boolean))].sort(s).join('+')}function u(n){const s=a(o(n));return s.length?(0,t.tableListNumbers)(s):'No table'}},1112,[860,1095]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return O}}),_e.useTableNames=N,_e.resetTableLive=M,_e.seatBookingNow=F,_e.finishBookingNow=async function(e,t){await f.repo.bookings.setStatus(t.id,'finished'),(0,S.tablesOf)(t.table).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=L,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return R}}),_e.TablePicker=W,_e.WalkInSheet=E,_e.WalkInMatchPrompt=H,_e.AssignTableSheet=_,_e.undoNotice=Y,_e.NewBookingSheet=U,_e.useFrontDoor=function(e,t){const[s,o]=(0,r.useState)(!1),[l,a]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>d({b:e}),combineTables:e=>d({b:e,combine:!0}),elements:(0,B.jsxs)(B.Fragment,{children:[s?(0,B.jsx)(E,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,B.jsx)(U,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,n.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,x.niceDate)((0,x.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,B.jsx)(_,{booking:i.b,combine:i.combine,onClose:()=>d(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=e(r),u=_r(_d[8]),c=e(_r(_d[9])),b=e(_r(_d[10])),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),w=_r(_d[18]),T=_r(_d[19]),S=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),D=_r(_d[23]),I=_r(_d[24]),$=_r(_d[25]),P=_r(_d[26]),z=_r(_d[27]),B=_r(_d[28]);const O=Array.from({length:12},(e,t)=>String(t+1));function N(e){const t=(0,S.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function M(e,t){(0,S.tablesOf)(t).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}async function F(e,t){await f.repo.bookings.setStatus(t.id,'seated'),M(e,t.table)}function L(e,t){const s=(0,f.useBookings)(e),o=(0,f.useOrders)(e),l=N(e),a=(0,S.useFloor)(t=>t.live[e])??{},i=(0,S.usePlan)(e),n=(0,v.useBlocks)(e=>e.blocks),r=(0,x.ymd)(t),d=(0,v.closedAreasAt)(n,e,r,(0,x.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,S.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,x.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const R=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function W({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:d}){const u=Object.keys(e),[h,p]=(0,r.useState)(0),f=i?6:8,y=i?64:o?92:76,k=h?Math.max(3,Math.floor((h+f)/(y+f))):0,x=k?Math.floor((h-f*(k-1))/k):y,w=new Set(n??[]),v=a?(0,S.tablesOf)(a)[0]:null;return(0,B.jsx)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:f},testID:"table-picker",onLayout:e=>p(Math.floor(e.nativeEvent.layout.width)),children:u.map(o=>{const a=e[o],n=t===o||!!d?.includes(o),r=w.has(o),u=v===o&&!n,h=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,B.jsxs)(c.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${d?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${r?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:x,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?j.colours.gold:a.busy?j.colours.red:j.colours.ok,backgroundColor:n?j.colours.goldTint:a.busy?j.colours.redBg:j.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,B.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,B.jsx)(T.T,{weight:"bold",size:22,colour:n?j.colours.goldLight:j.colours.text,children:(0,l.tableNumbers)(o)}),r?(0,B.jsx)(b.default,{testID:"best-table",style:{backgroundColor:j.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,B.jsx)(T.T,{size:11,weight:"bold",colour:j.colours.onGold,children:"BEST"})}):null]}),(0,B.jsx)(T.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:h})]},o)})})}const A=[1,2,3,4,5,6,7,8];function E({onClose:e,onSeated:a,wide:i,initialTable:y}){const{rid:w,r:C,now:D}=(0,p.useCtx)(15e3),I=L(w,D),[$,P]=(0,r.useState)(2),[O,N]=(0,r.useState)(!1),[R,E]=(0,r.useState)(y??null),_=(0,S.usePlan)(w),Y=(0,f.useBookings)(w),U=(0,v.useBlocks)(e=>e.blocks),q=(0,v.closedAreasAt)(U,w,(0,x.ymd)(D),(0,x.hm)(D)),Q=d.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(_,Y.filter(e=>e.date===(0,x.ymd)(D)),e,$,D,(0,k.turnFor)($,C.settings.turnMins),90,void 0,{closed:q})?.table??null},[_,Y,I,$,q.size,D.getTime()]);(0,r.useEffect)(()=>{R&&(0,S.tablesOf)(R).some(e=>'Closed'===I[e]?.label)&&E(null)},[R,q.size]);const[V,G]=(0,r.useState)(!1),[K,X]=(0,r.useState)(''),J=(e,t=String(e),s=()=>{N(!1),P(e)})=>{const o='9+'===t?O:!O&&$===e;return(0,B.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?j.colours.gold:'transparent'},children:(0,B.jsx)(T.T,{weight:"bold",size:22,colour:o?j.colours.onGold:j.colours.gold,children:t})},t)},Z=(0,B.jsx)(s.PartySizeInput,{value:$,onChange:P,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),ee=(0,B.jsxs)(b.default,{style:{gap:8,width:i?256:void 0},children:[(0,B.jsx)(T.T,{weight:"semibold",children:"How many people?"}),(0,B.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[A.map(e=>J(e)),J(9,'9+',()=>{N(!0),P(e=>e>=9?e:9)})]}),O?Z:null]}),[te,se]=(0,r.useState)(!1),[oe,le]=(0,r.useState)(null),ae=async(t=R,s=!1)=>{if(!te){if(!s){const e=(0,z.bookingsNearWalkIn)(Y,D,$);if(e.length)return void le({at:t,list:e})}se(!0);try{const s=await f.repo.bookings.seatWalkIn(w,$,t??void 0,K);M(w,t??void 0),a(s),e()}finally{se(!1)}}},ie=async(t,s)=>{if(!te){se(!0);try{const o=s??t.table??null;o&&o!==t.table&&await f.repo.bookings.assignTable(t.id,o),await F(w,{...t,table:o??void 0}),(0,n.notify)({id:`seated:${t.id}`,testID:'walkin-match-toast',timeoutMs:5e3,icon:'\u2713',title:`${t.name} seated \xb7 ${t.partySize} \xb7 ${o?(0,l.tableNumbers)(o):'table to assign'} (booking ${t.ref})`}),le(null),e()}finally{se(!1)}}},ne=(0,B.jsxs)(b.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,B.jsxs)(T.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(T.T,{weight:"semibold",children:["Table ",(0,B.jsx)(T.T,{colour:j.colours.muted,size:14,children:"(optional)"})]}),R?(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>E(null)}):null]}),(0,B.jsx)(W,{use:I,value:R,onPick:e=>{I[e]&&!I[e].busy?ae(e):E(R===e?null:e)},big:i,dense:i,best:Q,bestSet:(0,u.bestTables)(_)}),(0,B.jsxs)(T.Muted,{children:["Tap a free table to seat them there",Q&&!R?` (suggested for ${$}: ${(0,l.tableNumbers)(Q)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,x.hm)(D)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,B.jsx)(T.Button,{label:`Seat walk-in \xb7 ${$} ${1===$?'person':'people'}${R?` \xb7 ${(0,l.tableNumbers)(R)}`:''}`,disabled:te,onPress:()=>{ae()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,B.jsxs)(T.Row,{gap:16,style:{alignItems:'flex-start'},children:[ee,ne]}):(0,B.jsxs)(B.Fragment,{children:[ee,ne]}),(0,B.jsxs)(T.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[V?(0,B.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:K,onChangeText:X,style:[T.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>G(!0)}),(0,B.jsx)(b.default,{style:{flex:1,minWidth:220},children:(0,B.jsxs)(T.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==h.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]}),oe?(0,B.jsx)(H,{list:oe.list,busy:te,onYes:e=>{ie(e,oe.at)},onNo:()=>{const e=oe.at;le(null),ae(e,!0)},onClose:()=>le(null)}):null]})}function H({list:e,busy:t,onYes:s,onNo:o,onClose:a}){return(0,B.jsx)(T.Sheet,{visible:!0,onClose:a,title:"Booked party?",maxWidth:720,testID:"walkin-match",children:(0,B.jsxs)(b.default,{style:{gap:14},children:[e.map((e,o)=>(0,B.jsxs)(b.default,{testID:`walkin-match-${o}`,style:{gap:12,padding:16,borderRadius:16,borderWidth:2,borderColor:j.colours.gold,backgroundColor:'#15130F'},children:[(0,B.jsx)(b.default,{accessibilityRole:"header",accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:26,weight:"bold",colour:j.colours.goldLight,testID:"walkin-match-question",children:(0,z.walkInMatchQuestion)(e)})}),e.table?(0,B.jsxs)(T.T,{size:17,colour:j.colours.text,children:["Booked table ",(0,l.tableNumbers)(e.table)," \xb7 ",e.ref]}):(0,B.jsx)(T.T,{size:17,colour:j.colours.text,children:e.ref}),(0,B.jsx)(T.Button,{label:"Yes, seat booking",testID:"walkin-match-yes",disabled:t,accessibilityLabel:`Yes, seat ${e.name}'s booking, ${e.partySize} people`,onPress:()=>s(e),style:{minHeight:64}})]},e.id)),(0,B.jsx)(T.Button,{kind:"secondary",label:"No, new walk-in",testID:"walkin-match-no",disabled:t,onPress:o,style:{minHeight:64}})]})})}function _({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,p.useCtx)(15e3),n=L(o,i),c=(0,S.usePlan)(o),h=(0,f.useBookings)(o),y=(0,S.tablesOf)(e.table),w=d.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,y.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),v=d.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(w).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(c,h.filter(e=>e.date===(0,x.ymd)(i)),t,e.partySize,i,(0,k.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[c,h,w,e.partySize,i.getTime()]),[C,D]=(0,r.useState)(!!s||y.length>1),[I,$]=(0,r.useState)(y),P=e=>c.tables.find(t=>t.name===e)?.maxSeats??0,z=I.reduce((e,t)=>e+P(t),0),O=I.length>0&&z{const l=(0,S.joinTables)(s);await f.repo.bookings.assignTable(e.id,l);y.filter(e=>!s.includes(e)).forEach(t=>S.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&M(o,l),t()},F=C?(0,B.jsxs)(b.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,B.jsx)(b.default,{accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:17,weight:"semibold",colour:j.colours.text,children:I.length?`${(0,S.tablesLabel)((0,S.joinTables)(I))} \xb7 ${z} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,B.jsx)(b.default,{testID:"combine-short",children:(0,B.jsxs)(T.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-z," more needed. Add another table."]})}):null,(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,B.jsxs)(T.Row,{gap:8,wrap:!0,children:[(0,B.jsx)(T.Button,{label:"Done",testID:"combine-done",disabled:!I.length,accessibilityLabel:I.length?`Done, save ${(0,S.tableCardLabel)((0,S.joinTables)(I))}`:'Done',onPress:()=>N(I)}),(0,B.jsx)(T.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,B.jsx)(b.default,{style:{gap:8},testID:"assign-table-tip",children:(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`${C?'Combine tables':'Assign table'} \xb7 ${R(e)}`,testID:"assign-table-sheet",footer:F,children:[v&&!C?(0,B.jsx)(b.default,{testID:"assign-suggested",children:(0,B.jsxs)(T.T,{size:16,weight:"semibold",colour:j.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,S.tableCardLabel)(v)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(v)]})}):null,C?null:(0,B.jsx)(T.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>D(!0)}),(0,B.jsx)(W,{use:w,best:C?null:v,bestSet:(0,u.bestTables)(c),picked:C?I:void 0,onPick:C?e=>$(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await N([e])}})]})}function Y(e){(0,n.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${R(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>f.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function U({date:e,onClose:t,wide:n,onSaved:d}){const{rid:u,r:c,now:h,role:z,meId:O}=(0,p.useCtx)(6e4),N=(0,x.ymd)(h),[M,F]=(0,r.useState)(ee.blocks),[W,A]=(0,r.useState)(!1),[E,H]=(0,r.useState)(''),[_,Y]=(0,r.useState)(2),[U,q]=(0,r.useState)(null),[Q,V]=(0,r.useState)(''),[G,K]=(0,r.useState)(''),[X,J]=(0,r.useState)(''),[Z,ee]=(0,r.useState)('phone'),[te,se]=(0,r.useState)((0,D.emptyNeeds)()),oe=(0,D.needsMissing)(te),[le,ae]=(0,r.useState)(null),ie=(0,S.usePlan)(u),ne=(0,P.dogSetUp)(ie),re=!0===te.dog&&ne,de=te.dog?te.dogs:0,ue=(0,x.parseYmd)(M),ce=(0,k.turnFor)(_,c.settings.turnMins),be=L.filter(e=>e.date===M),he=e=>(0,k.freeTablesAt)(ie,be,_,new Date(`${M}${(0,l.tableNumbers)(e)}:00`),ce,c.settings.turnMins,{dog:!0,closed:(0,v.closedAreasAt)(R,u,M,e)}),ge=re&&U?he(U):[];(0,r.useEffect)(()=>{ae(null)},[re,U,_]);const pe=(0,y.bookingSlots)(c,ue,e=>L.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),_,M===(0,x.ymd)(h)?h:(0,x.addMins)(ue,0)),me=(0,w.ukPhone)(G),[fe,ye]=(0,r.useState)(!1),ke=U?pe.find(e=>e.time===U):void 0,xe=ke&&ke.left<_?{left:Math.max(0,ke.left),time:ke.time}:null,je=U?(0,v.blockAt)(R,u,M,U):void 0,we='staff'!==z,Te=!!U&&!(0,D.dogTimeOk)(c,L,M,U,de),Se=!oe.length&&E.trim().length>=2&&!!U&&(!xe||fe)&&(0,o.validParty)(_)&&me.ok&&(0,w.emailOk)(X)&&(!je||we&&W)&&(!re||ge.length>0)&&!Te,ve=te.wheelchair>0||te.stepFree;return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,x.niceDate)(ue)}`,maxWidth:n?760:void 0,testID:"booking-sheet",children:[(0,B.jsx)(D.FirstQuestions,{rid:u,value:te,onChange:se,party:_,audience:"staff"}),te.dog&&!ne?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,B.jsx)(C.BookingDatePicker,{r:c,today:h,value:M,onChange:e=>{e!==M&&(F(e),q(null),A(!1))}}),(0,B.jsxs)(T.Row,{gap:6,children:[(0,B.jsx)(T.Chip,{label:"Phone",selected:'phone'===Z,onPress:()=>ee('phone')}),(0,B.jsx)(T.Chip,{label:"In person",selected:'in-person'===Z,onPress:()=>ee('in-person')})]}),(0,B.jsx)(T.Field,{label:"Name",value:E,onChangeText:H,placeholder:"e.g. Reid",testID:"nb-name"}),(0,B.jsx)(T.Field,{label:"Mobile or phone number (needed)",value:G,onChangeText:K,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!me.ok&&G?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:me.error}):null,(0,B.jsx)(T.Field,{label:"Email (optional)",value:X,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,w.emailOk)(X)?null:(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,B.jsxs)(b.default,{style:{gap:6,alignItems:'center'},children:[(0,B.jsx)(T.T,{center:!0,children:"Covers"}),(0,B.jsx)(s.PartySizeInput,{value:_,onChange:e=>{Y(e),ye(!1)},label:"Covers",testID:"nb-party"})]}),(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:pe.map(e=>{const t=re&&e.available&&!he(e.time).length||!(0,D.dogTimeOk)(c,L,M,e.time,de);return(0,B.jsx)(T.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,v.blockAt)(R,u,M,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':e.left>0?`${e.left} left`:'Full',disabled:(e.past??!e.available)||t,selected:U===e.time,onPress:()=>{q(e.time),A(!1),ye(!1)}},e.time)})}),xe?(0,B.jsxs)(b.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overCapacityNote)(_,xe.left,xe.time)}),(0,B.jsx)(T.Chip,{label:fe?'Booking over the limit: on':'Book anyway (over the limit)',selected:fe,onPress:()=>ye(e=>!e),testID:"nb-over-ok"})]}):null,re&&U?(0,B.jsxs)(b.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,B.jsxs)(T.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,B.jsxs)(T.T,{size:13,colour:j.colours.muted,children:["(",ie.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),ge.length?(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:ge.slice(0,10).map((e,t)=>(0,B.jsx)(T.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${ve&&(0,P.accessibleSetUp)(ie)&&!(0,P.isAccessible)(ie,e.table)?' \xb7 not step-free':''}`,selected:(le??ge[0].table)===e.table,onPress:()=>ae(e.table)},e.table))}):(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["No dog-friendly table free for ",_," at ",U,". Try another time."]})]}):null,je?(0,B.jsxs)(b.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsxs)(T.T,{weight:"semibold",colour:j.colours.amber,children:["Bookings are paused ",je.from,"\u2013",je.to,je.reason?` (${je.reason})`:'']}),we?(0,B.jsx)(T.Chip,{label:W?'Manager override on':'Override and book anyway',selected:W,onPress:()=>A(e=>!e)}):(0,B.jsx)(T.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,pe.length?null:(0,B.jsx)(b.default,{testID:"nb-closed",children:(0,B.jsxs)(T.T,{size:14,weight:"semibold",colour:j.colours.amber,children:["Closed on ",(0,x.niceDate)(ue)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,B.jsx)(D.MoreQuestions,{rid:u,r:c,value:te,onChange:se,party:_,date:M,time:U,today:(0,x.ymd)(h),bookings:L,audience:"staff",showTables:!1!==c.settings.tableRequests}),ve&&!(0,P.accessibleSetUp)(ie)?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,B.jsx)(T.Field,{label:"Notes (optional)",value:Q,onChangeText:V,placeholder:I.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(c.settings),_)?(0,B.jsxs)(T.Muted,{children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(c.settings),_))," (",(0,a.gbp)((0,i.depositOf)(c.settings).perPersonPence)," per person for ",(0,i.depositOf)(c.settings).fromParty,"+). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,B.jsxs)(T.Muted,{children:["The guest gets a confirmation text",X.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Te?(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["We already have the most dogs we can look after at ",U,". Try another time: dogs are very welcome then."]}):null,(0,B.jsx)(T.Button,{label:oe.length?oe[0]:'Save booking',testID:"nb-save",disabled:!Se,onPress:()=>{if(M<(0,x.ymd)(h))return;const e=(0,D.needsPatch)(te),s=te.tableReq.find(e=>!re||ge.some(t=>t.table===e));f.repo.bookings.create({restaurantId:u,customerId:null,name:E.trim(),partySize:_,date:M,time:U,notes:Q.trim(),security:(0,i.depositDue)((0,i.depositOf)(c.settings),_)?'deposit':'none',depositPaid:0,...(0,i.depositDue)((0,i.depositOf)(c.settings),_)?{depositDue:(0,i.depositDue)((0,i.depositOf)(c.settings),_),depositPolicy:(0,i.depositWords)((0,i.depositOf)(c.settings),_,c.name).join(' '),depositRefundable:(0,i.depositOf)(c.settings).refundable,depositCutoffHours:(0,i.depositOf)(c.settings).cutoffHours}:{},phone:me.pretty,email:X.trim()||void 0,source:Z,...e,...pe.find(e=>e.time===U)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...re?{table:le??s??ge[0]?.table}:{}}).then(e=>(0,$.postNewBookingToKitchen)(e,O)).catch(()=>{}),d?.({date:M,time:U,name:E.trim()}),t()}})]})}},1113,[827,1114,1115,860,867,14,1116,34,859,402,102,872,1079,874,1117,1095,858,821,864,794,1021,1018,1118,1119,1124,1097,1091,1125,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return O}}),_e.useTableNames=N,_e.resetTableLive=M,_e.seatBookingNow=L,_e.finishBookingNow=async function(e,t){await f.repo.bookings.setStatus(t.id,'finished'),(0,S.tablesOf)(t.table).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=F,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return R}}),_e.TablePicker=W,_e.WalkInSheet=E,_e.WalkInMatchPrompt=H,_e.AssignTableSheet=_,_e.undoNotice=Y,_e.NewBookingSheet=U,_e.useFrontDoor=function(e,t){const[s,o]=(0,r.useState)(!1),[l,a]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>d({b:e}),combineTables:e=>d({b:e,combine:!0}),elements:(0,B.jsxs)(B.Fragment,{children:[s?(0,B.jsx)(E,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,B.jsx)(U,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,n.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,x.niceDate)((0,x.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,B.jsx)(_,{booking:i.b,combine:i.combine,onClose:()=>d(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=e(r),u=_r(_d[8]),c=e(_r(_d[9])),b=e(_r(_d[10])),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),w=_r(_d[18]),T=_r(_d[19]),S=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),D=_r(_d[23]),I=_r(_d[24]),$=_r(_d[25]),P=_r(_d[26]),z=_r(_d[27]),B=_r(_d[28]);const O=Array.from({length:12},(e,t)=>String(t+1));function N(e){const t=(0,S.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function M(e,t){(0,S.tablesOf)(t).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}async function L(e,t){await f.repo.bookings.setStatus(t.id,'seated'),M(e,t.table)}function F(e,t){const s=(0,f.useBookings)(e),o=(0,f.useOrders)(e),l=N(e),a=(0,S.useFloor)(t=>t.live[e])??{},i=(0,S.usePlan)(e),n=(0,v.useBlocks)(e=>e.blocks),r=(0,x.ymd)(t),d=(0,v.closedAreasAt)(n,e,r,(0,x.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,S.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,x.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const R=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function W({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:d}){const u=Object.keys(e),[h,p]=(0,r.useState)(0),f=i?6:8,y=i?64:o?92:76,k=h?Math.max(3,Math.floor((h+f)/(y+f))):0,x=k?Math.floor((h-f*(k-1))/k):y,w=new Set(n??[]),v=a?(0,S.tablesOf)(a)[0]:null;return(0,B.jsx)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:f},testID:"table-picker",onLayout:e=>p(Math.floor(e.nativeEvent.layout.width)),children:u.map(o=>{const a=e[o],n=t===o||!!d?.includes(o),r=w.has(o),u=v===o&&!n,h=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,B.jsxs)(c.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${d?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${r?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:x,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?j.colours.gold:a.busy?j.colours.red:j.colours.ok,backgroundColor:n?j.colours.goldTint:a.busy?j.colours.redBg:j.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,B.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,B.jsx)(T.T,{weight:"bold",size:22,colour:n?j.colours.goldLight:j.colours.text,children:(0,l.tableNumbers)(o)}),r?(0,B.jsx)(b.default,{testID:"best-table",style:{backgroundColor:j.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,B.jsx)(T.T,{size:11,weight:"bold",colour:j.colours.onGold,children:"BEST"})}):null]}),(0,B.jsx)(T.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:h})]},o)})})}const A=[1,2,3,4,5,6,7,8];function E({onClose:e,onSeated:a,wide:i,initialTable:y}){const{rid:w,r:C,now:D}=(0,p.useCtx)(15e3),I=F(w,D),[$,P]=(0,r.useState)(2),[O,N]=(0,r.useState)(!1),[R,E]=(0,r.useState)(y??null),_=(0,S.usePlan)(w),Y=(0,f.useBookings)(w),U=(0,v.useBlocks)(e=>e.blocks),q=(0,v.closedAreasAt)(U,w,(0,x.ymd)(D),(0,x.hm)(D)),Q=d.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(_,Y.filter(e=>e.date===(0,x.ymd)(D)),e,$,D,(0,k.turnFor)($,C.settings.turnMins),90,void 0,{closed:q})?.table??null},[_,Y,I,$,q.size,D.getTime()]);(0,r.useEffect)(()=>{R&&(0,S.tablesOf)(R).some(e=>'Closed'===I[e]?.label)&&E(null)},[R,q.size]);const[V,G]=(0,r.useState)(!1),[K,X]=(0,r.useState)(''),J=(e,t=String(e),s=()=>{N(!1),P(e)})=>{const o='9+'===t?O:!O&&$===e;return(0,B.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?j.colours.gold:'transparent'},children:(0,B.jsx)(T.T,{weight:"bold",size:22,colour:o?j.colours.onGold:j.colours.gold,children:t})},t)},Z=(0,B.jsx)(s.PartySizeInput,{value:$,onChange:P,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),ee=(0,B.jsxs)(b.default,{style:{gap:8,width:i?256:void 0},children:[(0,B.jsx)(T.T,{weight:"semibold",children:"How many people?"}),(0,B.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[A.map(e=>J(e)),J(9,'9+',()=>{N(!0),P(e=>e>=9?e:9)})]}),O?Z:null]}),[te,se]=(0,r.useState)(!1),[oe,le]=(0,r.useState)(null),ae=async(t=R,s=!1)=>{if(!te){if(!s){const e=(0,z.bookingsNearWalkIn)(Y,D,$);if(e.length)return void le({at:t,list:e})}se(!0);try{const s=await f.repo.bookings.seatWalkIn(w,$,t??void 0,K);M(w,t??void 0),a(s),e()}finally{se(!1)}}},ie=async(t,s)=>{if(!te){se(!0);try{const o=s??t.table??null;o&&o!==t.table&&await f.repo.bookings.assignTable(t.id,o),await L(w,{...t,table:o??void 0}),(0,n.notify)({id:`seated:${t.id}`,testID:'walkin-match-toast',timeoutMs:5e3,icon:'\u2713',title:`${t.name} seated \xb7 ${t.partySize} \xb7 ${o?(0,l.tableNumbers)(o):'table to assign'} (booking ${t.ref})`}),le(null),e()}finally{se(!1)}}},ne=(0,B.jsxs)(b.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,B.jsxs)(T.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(T.T,{weight:"semibold",children:["Table ",(0,B.jsx)(T.T,{colour:j.colours.muted,size:14,children:"(optional)"})]}),R?(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>E(null)}):null]}),(0,B.jsx)(W,{use:I,value:R,onPick:e=>{I[e]&&!I[e].busy?ae(e):E(R===e?null:e)},big:i,dense:i,best:Q,bestSet:(0,u.bestTables)(_)}),(0,B.jsxs)(T.Muted,{children:["Tap a free table to seat them there",Q&&!R?` (suggested for ${$}: ${(0,l.tableNumbers)(Q)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,x.hm)(D)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,B.jsx)(T.Button,{label:`Seat walk-in \xb7 ${$} ${1===$?'person':'people'}${R?` \xb7 ${(0,l.tableNumbers)(R)}`:''}`,disabled:te,onPress:()=>{ae()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,B.jsxs)(T.Row,{gap:16,style:{alignItems:'flex-start'},children:[ee,ne]}):(0,B.jsxs)(B.Fragment,{children:[ee,ne]}),(0,B.jsxs)(T.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[V?(0,B.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:K,onChangeText:X,style:[T.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>G(!0)}),(0,B.jsx)(b.default,{style:{flex:1,minWidth:220},children:(0,B.jsxs)(T.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==h.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]}),oe?(0,B.jsx)(H,{list:oe.list,busy:te,onYes:e=>{ie(e,oe.at)},onNo:()=>{const e=oe.at;le(null),ae(e,!0)},onClose:()=>le(null)}):null]})}function H({list:e,busy:t,onYes:s,onNo:o,onClose:a}){return(0,B.jsx)(T.Sheet,{visible:!0,onClose:a,title:"Booked party?",maxWidth:720,testID:"walkin-match",children:(0,B.jsxs)(b.default,{style:{gap:14},children:[e.map((e,o)=>(0,B.jsxs)(b.default,{testID:`walkin-match-${o}`,style:{gap:12,padding:16,borderRadius:16,borderWidth:2,borderColor:j.colours.gold,backgroundColor:'#15130F'},children:[(0,B.jsx)(b.default,{accessibilityRole:"header",accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:26,weight:"bold",colour:j.colours.goldLight,testID:"walkin-match-question",children:(0,z.walkInMatchQuestion)(e)})}),e.table?(0,B.jsxs)(T.T,{size:17,colour:j.colours.text,children:["Booked table ",(0,l.tableNumbers)(e.table)," \xb7 ",e.ref]}):(0,B.jsx)(T.T,{size:17,colour:j.colours.text,children:e.ref}),(0,B.jsx)(T.Button,{label:"Yes, seat booking",testID:"walkin-match-yes",disabled:t,accessibilityLabel:`Yes, seat ${e.name}'s booking, ${e.partySize} people`,onPress:()=>s(e),style:{minHeight:64}})]},e.id)),(0,B.jsx)(T.Button,{kind:"secondary",label:"No, new walk-in",testID:"walkin-match-no",disabled:t,onPress:o,style:{minHeight:64}})]})})}function _({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,p.useCtx)(15e3),n=F(o,i),c=(0,S.usePlan)(o),h=(0,f.useBookings)(o),y=(0,S.tablesOf)(e.table),w=d.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,y.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),v=d.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(w).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(c,h.filter(e=>e.date===(0,x.ymd)(i)),t,e.partySize,i,(0,k.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[c,h,w,e.partySize,i.getTime()]),[C,D]=(0,r.useState)(!!s||y.length>1),[I,$]=(0,r.useState)(y),P=e=>c.tables.find(t=>t.name===e)?.maxSeats??0,z=I.reduce((e,t)=>e+P(t),0),O=I.length>0&&z{const l=(0,S.joinTables)(s);await f.repo.bookings.assignTable(e.id,l);y.filter(e=>!s.includes(e)).forEach(t=>S.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&M(o,l),t()},L=C?(0,B.jsxs)(b.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,B.jsx)(b.default,{accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:17,weight:"semibold",colour:j.colours.text,children:I.length?`${(0,S.tablesLabel)((0,S.joinTables)(I))} \xb7 ${z} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,B.jsx)(b.default,{testID:"combine-short",children:(0,B.jsxs)(T.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-z," more needed. Add another table."]})}):null,(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,B.jsxs)(T.Row,{gap:8,wrap:!0,children:[(0,B.jsx)(T.Button,{label:"Done",testID:"combine-done",disabled:!I.length,accessibilityLabel:I.length?`Done, save ${(0,S.tableCardLabel)((0,S.joinTables)(I))}`:'Done',onPress:()=>N(I)}),(0,B.jsx)(T.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,B.jsx)(b.default,{style:{gap:8},testID:"assign-table-tip",children:(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`${C?'Combine tables':'Assign table'} \xb7 ${R(e)}`,testID:"assign-table-sheet",footer:L,children:[v&&!C?(0,B.jsx)(b.default,{testID:"assign-suggested",children:(0,B.jsxs)(T.T,{size:16,weight:"semibold",colour:j.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,S.tableCardLabel)(v)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(v)]})}):null,C?null:(0,B.jsx)(T.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>D(!0)}),(0,B.jsx)(W,{use:w,best:C?null:v,bestSet:(0,u.bestTables)(c),picked:C?I:void 0,onPick:C?e=>$(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await N([e])}})]})}function Y(e){(0,n.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${R(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>f.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function U({date:e,onClose:t,wide:n,onSaved:d}){const{rid:u,r:c,now:h,role:z,meId:O}=(0,p.useCtx)(6e4),N=(0,x.ymd)(h),[M,L]=(0,r.useState)(ee.blocks),[W,A]=(0,r.useState)(!1),[E,H]=(0,r.useState)(''),[_,Y]=(0,r.useState)(2),[U,q]=(0,r.useState)(null),[Q,V]=(0,r.useState)(''),[G,K]=(0,r.useState)(''),[X,J]=(0,r.useState)(''),[Z,ee]=(0,r.useState)('phone'),[te,se]=(0,r.useState)((0,D.emptyNeeds)()),oe=(0,D.needsMissing)(te),[le,ae]=(0,r.useState)(null),ie=(0,S.usePlan)(u),ne=(0,P.dogSetUp)(ie),re=!0===te.dog&&ne,de=te.dog?te.dogs:0,ue=(0,x.parseYmd)(M),ce=(0,k.turnFor)(_,c.settings.turnMins),be=F.filter(e=>e.date===M),he=e=>(0,k.freeTablesAt)(ie,be,_,new Date(`${M}${(0,l.tableNumbers)(e)}:00`),ce,c.settings.turnMins,{dog:!0,closed:(0,v.closedAreasAt)(R,u,M,e)}),ge=re&&U?he(U):[];(0,r.useEffect)(()=>{ae(null)},[re,U,_]);const pe=(0,y.bookingSlots)(c,ue,e=>F.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),_,M===(0,x.ymd)(h)?h:(0,x.addMins)(ue,0),e=>F.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),me=(0,w.ukPhone)(G),[fe,ye]=(0,r.useState)(!1),ke=U?pe.find(e=>e.time===U):void 0,xe=ke&&ke.left<_?{left:Math.max(0,ke.left),time:ke.time}:null,je=ke&&null!=ke.partiesLeft&&ke.partiesLeft<1?{time:ke.time,cap:ke.partiesCap??0}:null,we=xe||je,Te=U?(0,v.blockAt)(R,u,M,U):void 0,Se='staff'!==z,ve=!!U&&!(0,D.dogTimeOk)(c,F,M,U,de),Ce=!oe.length&&E.trim().length>=2&&!!U&&(!we||fe)&&(0,o.validParty)(_)&&me.ok&&(0,w.emailOk)(X)&&(!Te||Se&&W)&&(!re||ge.length>0)&&!ve,De=te.wheelchair>0||te.stepFree;return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,x.niceDate)(ue)}`,maxWidth:n?760:void 0,testID:"booking-sheet",children:[(0,B.jsx)(D.FirstQuestions,{rid:u,value:te,onChange:se,party:_,audience:"staff"}),te.dog&&!ne?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,B.jsx)(C.BookingDatePicker,{r:c,today:h,value:M,onChange:e=>{e!==M&&(L(e),q(null),A(!1))}}),(0,B.jsxs)(T.Row,{gap:6,children:[(0,B.jsx)(T.Chip,{label:"Phone",selected:'phone'===Z,onPress:()=>ee('phone')}),(0,B.jsx)(T.Chip,{label:"In person",selected:'in-person'===Z,onPress:()=>ee('in-person')})]}),(0,B.jsx)(T.Field,{label:"Name",value:E,onChangeText:H,placeholder:"e.g. Reid",testID:"nb-name"}),(0,B.jsx)(T.Field,{label:"Mobile or phone number (needed)",value:G,onChangeText:K,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!me.ok&&G?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:me.error}):null,(0,B.jsx)(T.Field,{label:"Email (optional)",value:X,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,w.emailOk)(X)?null:(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,B.jsxs)(b.default,{style:{gap:6,alignItems:'center'},children:[(0,B.jsx)(T.T,{center:!0,children:"Covers"}),(0,B.jsx)(s.PartySizeInput,{value:_,onChange:e=>{Y(e),ye(!1)},label:"Covers",testID:"nb-party"})]}),(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:pe.map(e=>{const t=re&&e.available&&!he(e.time).length||!(0,D.dogTimeOk)(c,F,M,e.time,de);return(0,B.jsx)(T.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,v.blockAt)(R,u,M,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:U===e.time,onPress:()=>{q(e.time),A(!1),ye(!1)}},e.time)})}),we?(0,B.jsxs)(b.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[xe?(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overCapacityNote)(_,xe.left,xe.time)}):null,je?(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overPartiesNote)(je.time,je.cap)}):null,(0,B.jsx)(T.Chip,{label:fe?'Booking over the limit: on':'Book anyway (over the limit)',selected:fe,onPress:()=>ye(e=>!e),testID:"nb-over-ok"})]}):null,re&&U?(0,B.jsxs)(b.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,B.jsxs)(T.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,B.jsxs)(T.T,{size:13,colour:j.colours.muted,children:["(",ie.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),ge.length?(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:ge.slice(0,10).map((e,t)=>(0,B.jsx)(T.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${De&&(0,P.accessibleSetUp)(ie)&&!(0,P.isAccessible)(ie,e.table)?' \xb7 not step-free':''}`,selected:(le??ge[0].table)===e.table,onPress:()=>ae(e.table)},e.table))}):(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["No dog-friendly table free for ",_," at ",U,". Try another time."]})]}):null,Te?(0,B.jsxs)(b.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsxs)(T.T,{weight:"semibold",colour:j.colours.amber,children:["Bookings are paused ",Te.from,"\u2013",Te.to,Te.reason?` (${Te.reason})`:'']}),Se?(0,B.jsx)(T.Chip,{label:W?'Manager override on':'Override and book anyway',selected:W,onPress:()=>A(e=>!e)}):(0,B.jsx)(T.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,pe.length?null:(0,B.jsx)(b.default,{testID:"nb-closed",children:(0,B.jsxs)(T.T,{size:14,weight:"semibold",colour:j.colours.amber,children:["Closed on ",(0,x.niceDate)(ue)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,B.jsx)(D.MoreQuestions,{rid:u,r:c,value:te,onChange:se,party:_,date:M,time:U,today:(0,x.ymd)(h),bookings:F,audience:"staff",showTables:!1!==c.settings.tableRequests}),De&&!(0,P.accessibleSetUp)(ie)?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,B.jsx)(T.Field,{label:"Notes (optional)",value:Q,onChangeText:V,placeholder:I.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(c.settings),_)?(0,B.jsxs)(T.Muted,{children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(c.settings),_))," (",(0,a.gbp)((0,i.depositOf)(c.settings).perPersonPence)," per person for ",(0,i.depositOf)(c.settings).fromParty,"+). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,B.jsxs)(T.Muted,{children:["The guest gets a confirmation text",X.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),ve?(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["We already have the most dogs we can look after at ",U,". Try another time: dogs are very welcome then."]}):null,(0,B.jsx)(T.Button,{label:oe.length?oe[0]:'Save booking',testID:"nb-save",disabled:!Ce,onPress:()=>{if(M<(0,x.ymd)(h))return;const e=(0,D.needsPatch)(te),s=te.tableReq.find(e=>!re||ge.some(t=>t.table===e));f.repo.bookings.create({restaurantId:u,customerId:null,name:E.trim(),partySize:_,date:M,time:U,notes:Q.trim(),security:(0,i.depositDue)((0,i.depositOf)(c.settings),_)?'deposit':'none',depositPaid:0,...(0,i.depositDue)((0,i.depositOf)(c.settings),_)?{depositDue:(0,i.depositDue)((0,i.depositOf)(c.settings),_),depositPolicy:(0,i.depositWords)((0,i.depositOf)(c.settings),_,c.name).join(' '),depositRefundable:(0,i.depositOf)(c.settings).refundable,depositCutoffHours:(0,i.depositOf)(c.settings).cutoffHours}:{},phone:me.pretty,email:X.trim()||void 0,source:Z,...e,...pe.find(e=>e.time===U)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...re?{table:le??s??ge[0]?.table}:{}}).then(e=>(0,$.postNewBookingToKitchen)(e,O)).catch(()=>{}),d?.({date:M,time:U,name:E.trim()}),t()}})]})}},1113,[827,1114,1115,860,867,14,1116,34,859,402,102,872,1079,874,1117,1095,858,821,864,794,1021,1018,1118,1119,1124,1097,1091,1125,25]); __d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PartySizeInput=function({value:e,onChange:p,min:b=s.MIN_PARTY,max:y=s.MAX_PARTY,label:f="Party size",testID:h="party-size"}){const[x,$]=(0,t.useState)(String(e));(0,t.useEffect)(()=>{$(String(e))},[e]);const w=e=>p((0,s.clampParty)(e,b,y)),I=(t,n,l)=>{const s=t<0?e<=b:e>=y;return(0,d.jsx)(o.default,{testID:`${h}-${t>0?'up':'down'}${10===Math.abs(t)?'10':''}`,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:s},disabled:s,onPress:()=>w(e+t),hitSlop:4,style:{minWidth:44,height:44,paddingHorizontal:8,borderRadius:22,borderWidth:1.5,borderColor:c.colours.gold,alignItems:'center',justifyContent:'center',opacity:s?.4:1},children:(0,d.jsx)(u.T,{size:10===Math.abs(t)?14:20,weight:"semibold",colour:c.colours.gold,center:!0,children:n})},t)};return(0,d.jsxs)(l.default,{testID:h,style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap',justifyContent:'center'},children:[y-b>=20?I(-10,'\u221210',"10 fewer people"):null,I(-1,'\u2212','One fewer person'),(0,d.jsx)(n.default,{testID:`${h}-input`,value:x,keyboardType:"number-pad",inputMode:"numeric",maxLength:3,selectTextOnFocus:!0,accessibilityLabel:`${f}, ${b} to ${y} people`,accessibilityValue:{min:b,max:y,now:e,text:`${e} ${1===e?'person':'people'}`},onChangeText:e=>{$(e.replace(/\D/g,'')),e.replace(/\D/g,'')&&w((0,s.partyFromText)(e,b,y))},onBlur:()=>{const e=(0,s.partyFromText)(x,b,y);$(String(e)),w(e)},style:{width:64,height:44,borderRadius:10,borderWidth:1,borderColor:c.colours.border,color:c.colours.text,backgroundColor:c.colours.surface,textAlign:'center',fontSize:20,fontFamily:c.fonts.semibold}}),I(1,'+','One more person'),y-b>=20?I(10,'+10',"10 more people"):null]})};var t=r(_d[0]),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),s=r(_d[4]),c=r(_d[5]),u=r(_d[6]),d=r(_d[7])},1114,[34,402,412,102,1115,821,794,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const f=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(f)?f:u))},f=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),b=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`},1115,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overPartiesNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const s=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(s)?s:u))},s=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),f=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`,b=(t,n)=>`${t} already has the most bookings we take at one start time (${n}). Booking another goes over the venue\u2019s limit: check tables and staffing.`},1115,[]); __d(function(g,r,i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"dismissNotice",{enumerable:!0,get:function(){return u.dismissNotice}}),Object.defineProperty(_e,"notify",{enumerable:!0,get:function(){return u.notify}}),Object.defineProperty(_e,"useSliders",{enumerable:!0,get:function(){return u.useSliders}}),Object.defineProperty(_e,"SLIDER",{enumerable:!0,get:function(){return j}}),_e.SliderButton=k,_e.SliderCard=C,_e.SliderHost=function(){y();const e=(0,u.useSliders)(e=>e.queue),n=e[0],o=(0,t.useRef)(null);(0,t.useEffect)(()=>{if(p)return window.ccSlider=e=>(0,u.notify)(e),()=>{delete window.ccSlider}},[]),(0,t.useEffect)(()=>{if(o.current&&clearTimeout(o.current),!n)return;const e=void 0!==n.timeoutMs?n.timeoutMs:n.actions?.length||n.content?null:6e3;return e&&(o.current=setTimeout(()=>u.useSliders.getState().dismiss(n.id),e)),()=>{o.current&&clearTimeout(o.current)}},[n?.id,n?.timeoutMs]);const[l,c]=(0,t.useState)(0);if((0,t.useEffect)(()=>{if(!p||!n)return;const e=()=>{const e=document.querySelector('[data-testid="app-bottom-tabs"]');c(e?Math.max(0,Math.round(window.innerHeight-e.getBoundingClientRect().top)):0)};e();const t=setTimeout(e,300);return window.addEventListener('resize',e),()=>{clearTimeout(t),window.removeEventListener('resize',e)}},[n?.id]),!n)return null;const a=p?'fixed':'absolute';return(0,f.jsxs)(f.Fragment,{children:[n.modal?(0,f.jsx)(s.default,{...x('dim'),style:{position:a,left:0,right:0,top:0,bottom:0,zIndex:2147482990,backgroundColor:'rgba(0,0,0,0.72)'}}):null,(0,f.jsx)(s.default,{testID:"cc-slider-host",pointerEvents:"box-none",style:{position:a,left:12,right:12,bottom:12,zIndex:2147483e3,alignItems:'center',...p?{bottom:l?`${12+l}px`:'calc(12px + env(safe-area-inset-bottom))'}:{}},children:(0,f.jsx)(C,{n:n,waiting:e.length-1,onClose:()=>u.useSliders.getState().dismiss(n.id)},n.id+':'+(n.seq??0))})]})};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),s=e(r(d[4])),l=e(r(d[5])),c=r(d[6]),a=r(d[7]),u=r(d[8]),b=r(d[9]),f=r(d[10]);const p='undefined'!=typeof document,h="\n[data-ccsl=\"in\"]{animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both}\n@keyframes ccsl-in{from{opacity:0;transform:translate3d(0,110%,0)}to{opacity:1;transform:none}}\n[data-ccsl=\"urgent\"]{animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both,ccsl-red 1.6s ease-in-out .45s infinite}\n@keyframes ccsl-red{0%,100%{box-shadow:0 10px 30px rgba(0,0,0,.6),0 0 0 1px rgba(255,107,94,.55)}50%{box-shadow:0 10px 40px rgba(0,0,0,.6),0 0 0 2px #FF6B5E,0 0 34px rgba(255,107,94,.45)}}\n[data-ccsl=\"dim\"]{animation:ccsl-dim .3s ease both}\n@keyframes ccsl-dim{from{opacity:0}to{opacity:1}}\n@media (prefers-reduced-motion: reduce){[data-ccsl]{animation:none !important}}\n",x=e=>p?{dataSet:{ccsl:e}}:{};function y(){(0,t.useEffect)(()=>{if(!p||document.getElementById('cc-slider-css'))return;const e=document.createElement('style');e.id='cc-slider-css',e.textContent=h,document.head.appendChild(e)},[])}const j={bg:'#17140F',border:'rgba(207,164,95,.55)',text:'#F5F1E8',quiet:'#A89A80',gold:c.colours.gold,ink:'#17130D'},w=(e="normal")=>'urgent'===e?c.colours.red:'warn'===e?c.colours.amber:c.colours.gold,S=(e="normal")=>'urgent'===e?'rgba(255,107,94,.75)':'warn'===e?'rgba(255,181,71,.65)':j.border;function k({a:e,onDone:t,big:o}){const s=e.kind??'primary';return(0,f.jsx)(n.default,{testID:e.testID,accessibilityRole:"button",accessibilityLabel:e.label,onPress:()=>{try{e.onPress?.()}finally{e.keepOpen||t()}},style:({pressed:e})=>({minHeight:o?56:44,minWidth:44,paddingHorizontal:'ghost'===s?10:o?24:18,borderRadius:12,alignItems:'center',justifyContent:'center',backgroundColor:'primary'===s?j.gold:'transparent',borderWidth:'danger'===s?1:0,borderColor:c.colours.red,opacity:e?.8:1}),children:(0,f.jsx)(a.T,{size:o?18:'ghost'===s?14:15,weight:'primary'===s?'bold':'medium',colour:'primary'===s?j.ink:'danger'===s?c.colours.red:j.quiet,children:e.label})})}function C({n:e,onClose:t,waiting:n=0,maxWidth:c=520}){y();const u=e.tone??'normal',h=w(u),C=e.content,z=!!e.big,{height:I}=(0,l.default)(),D=e.actions??[];return(0,f.jsxs)(s.default,{testID:e.testID??'cc-slider',accessibilityRole:"summary",accessibilityLabel:`${e.kicker?e.kicker+': ':''}${e.title}`,...x('urgent'===u?'urgent':'in'),style:{width:'100%',maxWidth:z?Math.max(c,900):c,alignSelf:'center',borderRadius:14,backgroundColor:j.bg,borderWidth:1,borderColor:S(u),overflow:'hidden',...p?{boxShadow:'0 10px 30px rgba(0,0,0,.6)'}:{elevation:12}},children:['normal'!==u?(0,f.jsx)(s.default,{style:{position:'absolute',left:0,top:0,bottom:0,width:5,backgroundColor:h}}):null,(0,f.jsxs)(o.default,{style:{maxHeight:Math.max(220,I-40)},contentContainerStyle:{paddingVertical:z?18:12,paddingLeft:'normal'!==u?z?24:18:z?20:14,paddingRight:z?20:14,gap:z?10:6},children:[(0,f.jsxs)(s.default,{style:{flexDirection:'row',alignItems:'center',gap:12},children:[e.icon?(0,f.jsx)(a.T,{size:z?34:22,children:e.icon}):null,(0,f.jsxs)(s.default,{style:{flex:1,gap:2},children:[e.kicker?(0,f.jsx)(a.T,{size:z?15:11,weight:"bold",colour:h,style:{letterSpacing:1.4},children:e.kicker}):null,(0,f.jsx)(a.T,{size:z?24:15,weight:"medium",colour:j.text,children:e.title}),e.body?(0,f.jsx)(a.T,{size:z?18:13,colour:j.quiet,children:e.body}):null]}),D.length||C?null:(0,f.jsx)(b.ToastClose,{testID:"cc-slider-ok",label:`Close: ${e.title}`,onPress:t,size:z?'lg':'md',colour:j.quiet})]}),C?(0,f.jsx)(C,{close:t}):null,D.length?(0,f.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',alignItems:'center',gap:8,justifyContent:'flex-end'},children:D.map(e=>(0,f.jsx)(k,{a:e,onDone:t,big:z},e.label))}):null,n>0?(0,f.jsxs)(a.T,{size:z?14:11,colour:j.quiet,center:!0,style:{alignSelf:'stretch'},children:[n," more waiting"]}):null]})]})}},1116,[34,236,402,295,102,426,821,794,998,796,25]); -__d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.bookingSlotMinutesOf=s,Object.defineProperty(e,"COVERS_WINDOW_MINS",{enumerable:!0,get:function(){return r}}),e.coversInHalfHour=l,e.takeawaySlots=function(o,s,r){const l=(0,t.hoursFor)(o,r);if(!l)return[];const u=o.settings.slotMinutes,c=(0,n.addMins)(r,o.settings.leadMins),f=[];for(let t=new Date(l.open);t<=l.close;t=(0,n.addMins)(t,u)){if(tn.restaurantId===o.id&&'takeaway'===n.type&&'cancelled'!==n.status&&n.slotTime&&new Date(n.slotTime).getTime()===t.getTime()).length;f.push({time:new Date(t),label:(0,n.hm)(t),taken:r,cap:o.settings.slotCap,full:r>=o.settings.slotCap})}return f},e.bookingSlots=function(r,c,f,d,m){const p=(0,t.hoursFor)(r,c);if(!p)return[];const M=[],S=p.close,b=(0,o.lastFoodOn)(r,u(c)),h=b?(0,n.atTime)(c,b.time):S,k='drinks'===(0,o.afterLastFood)(r),O=s(r);for(let t=new Date(p.open);t<=S;t=(0,n.addMins)(t,O)){const o=(0,n.hm)(t),s=t>h;if(s&&!k)continue;const u=r.settings.bookingCoversPerSlot-l(f,o),c=t.getTime()=d,past:c,...s?{drinksOnly:!0}:{}})}return M};var t=_r(_d[0]),n=_r(_d[1]),o=_r(_d[2]);function s(t){const n=t.settings.bookingSlotMinutes;return 5===n||10===n||15===n||20===n||30===n?n:15}const r=30;function l(t,o){const s=Math.floor((0,n.toMins)(o)/r)*r;let l=0;for(let o=0;o`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},1117,[878,858,877]); +__d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.bookingSlotMinutesOf=s,e.bookingNoticeMinsOf=r,e.bookingCoversPerStartOf=u,e.bookingPartiesPerStartOf=l,e.onlinePartyBounds=c,Object.defineProperty(e,"COVERS_WINDOW_MINS",{enumerable:!0,get:function(){return f}}),e.coversInHalfHour=m,e.countInStartSlot=p,e.bookingLimitsHint=function(t){const n=s(t),o=u(t),f=l(t),m=r(t),p=c(t);if(null!=o||null!=f){const t=[];return null!=o&&null!=f?t.push(`up to ${o} people and ${f} bookings at each start time`):null!=o?t.push(`up to ${o} people at each start time`):t.push(`up to ${f} bookings at each start time`),(p.max<100||p.min>1)&&t.push(`parties of ${p.min} to ${p.max}`),t.push(`from ${m} minutes ahead`),t.push('table rules still apply'),`Times are every ${n} minutes: ${t.join(', ')}.`}return`Times are every ${n} minutes. Covers per slot (${t.settings.bookingCoversPerSlot} per half hour) and table rules still apply.`},e.takeawaySlots=function(o,s,r){const u=(0,t.hoursFor)(o,r);if(!u)return[];const l=o.settings.slotMinutes,c=(0,n.addMins)(r,o.settings.leadMins),f=[];for(let t=new Date(u.open);t<=u.close;t=(0,n.addMins)(t,l)){if(tn.restaurantId===o.id&&'takeaway'===n.type&&'cancelled'!==n.status&&n.slotTime&&new Date(n.slotTime).getTime()===t.getTime()).length;f.push({time:new Date(t),label:(0,n.hm)(t),taken:r,cap:o.settings.slotCap,full:r>=o.settings.slotCap})}return f},e.bookingSlots=function(c,f,d,h,k,M=()=>0){const y=(0,t.hoursFor)(c,f);if(!y)return[];const S=[],$=y.close,P=(0,o.lastFoodOn)(c,b(f)),v=P?(0,n.atTime)(f,P.time):$,I='drinks'===(0,o.afterLastFood)(c),O=s(c),C=r(c),N=u(c),T=l(c);for(let t=new Date(y.open);t<=$;t=(0,n.addMins)(t,O)){const o=(0,n.hm)(t),s=t>v;if(s&&!I)continue;const r=null!=N?p(d,o,O):m(d,o),u=(N??c.settings.bookingCoversPerSlot)-r,l=null!=T?p(M,o,O):0,f=null!=T?T-l:void 0,b=t.getTime()=1;S.push({time:o,left:u,available:!b&&u>=h&&y,past:b,...s?{drinksOnly:!0}:{},...null!=f?{partiesLeft:f,partiesCap:T}:{}})}return S};var t=_r(_d[0]),n=_r(_d[1]),o=_r(_d[2]);function s(t){const n=t.settings.bookingSlotMinutes;return 5===n||10===n||15===n||20===n||30===n?n:15}function r(t){const n=t.settings.bookingNoticeMins;return'number'==typeof n&&Number.isInteger(n)&&n>=0&&n<=1440?n:30}function u(t){const n=t.settings.bookingCoversPerStart;return'number'==typeof n&&Number.isInteger(n)&&n>0&&n<=200?n:null}function l(t){const n=t.settings.bookingPartiesPerStart;return'number'==typeof n&&Number.isInteger(n)&&n>0&&n<=50?n:null}function c(t){const n=t.settings.onlinePartyMin,o=t.settings.onlinePartyMax,s='number'==typeof n&&Number.isInteger(n)&&n>=1&&n<=100?n:1;return{min:s,max:'number'==typeof o&&Number.isInteger(o)&&o>=s&&o<=100?o:100}}const f=30;function m(t,o){const s=Math.floor((0,n.toMins)(o)/f)*f;let r=0;for(let o=0;o`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},1117,[878,858,877]); __d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.nextDays=c,Object.defineProperty(_e,"openOn",{enumerable:!0,get:function(){return u}}),_e.BookingDatePicker=function({r:e,today:l,value:b,onChange:m}){const[f,x]=(0,t.useState)(!1),p=(0,r.ymd)(l),j=c(l,9),D=(e,t)=>0===t?'Today':1===t?'Tomorrow':`${(0,r.dayShort)(e)} ${e.getDate()}`,w=j.some(e=>(0,r.ymd)(e)===b),C=(0,r.parseYmd)(b),[P,T]=(0,t.useState)(()=>({y:C.getFullYear(),m:C.getMonth()})),v=(new Date(P.y,P.m,1,12).getDay()+6)%7,M=new Date(P.y,P.m+1,0).getDate(),R=[...Array.from({length:v},()=>null),...Array.from({length:M},(e,t)=>new Date(P.y,P.m,t+1,12))];for(;R.length%7;)R.push(null);const k=12*(P.y-l.getFullYear())+P.m-l.getMonth(),F=e=>T(({y:t,m:o})=>{const s=new Date(t,o+e,1);return{y:s.getFullYear(),m:s.getMonth()}});return(0,i.jsxs)(s.default,{testID:"nb-date",style:{gap:6},children:[(0,i.jsxs)(d.Row,{wrap:!0,gap:6,children:[j.map((t,o)=>(0,i.jsx)(d.Chip,{label:D(t,o),sub:u(e,t)?void 0:'Closed',selected:b===(0,r.ymd)(t),onPress:()=>{m((0,r.ymd)(t)),x(!1)}},(0,r.ymd)(t))),w?null:(0,i.jsx)(d.Chip,{label:(0,r.niceDate)(C),sub:u(e,C)?void 0:'Closed',selected:!0,onPress:()=>x(!0)}),(0,i.jsx)(d.Chip,{label:f?'Close calendar':'\ud83d\udcc5 Pick date',selected:f,onPress:()=>{f||T({y:C.getFullYear(),m:C.getMonth()}),x(!f)}})]}),f?(0,i.jsxs)(s.default,{testID:"nb-calendar",style:{borderWidth:1,borderColor:n.colours.border,borderRadius:14,padding:10,gap:6,backgroundColor:n.colours.surface2,maxWidth:420},children:[(0,i.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,i.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Previous month",disabled:k<=0,onPress:()=>F(-1),style:{padding:8,opacity:k<=0?.3:1},children:(0,i.jsx)(d.T,{size:20,colour:n.colours.gold,children:"\u2039"})}),(0,i.jsxs)(d.T,{weight:"semibold",children:[(0,r.monthLong)(P.m)," ",P.y]}),(0,i.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Next month",disabled:k>=h,onPress:()=>F(1),style:{padding:8,opacity:k>=h?.3:1},children:(0,i.jsx)(d.T,{size:20,colour:n.colours.gold,children:"\u203a"})})]}),(0,i.jsx)(s.default,{style:{flexDirection:'row'},children:y.map(e=>(0,i.jsx)(d.T,{size:12,colour:n.colours.muted,center:!0,style:{flex:1},children:e},e))}),Array.from({length:R.length/7},(t,l)=>(0,i.jsx)(s.default,{style:{flexDirection:'row',gap:4},children:R.slice(7*l,7*l+7).map((t,l)=>{if(!t)return(0,i.jsx)(s.default,{style:{flex:1,height:40}},l);const c=(0,r.ymd)(t),y=c{m(c),x(!1)},style:{flex:1,height:40,borderRadius:10,alignItems:'center',justifyContent:'center',borderWidth:c===p?1.5:0,borderColor:n.colours.gold,backgroundColor:h?n.colours.gold:'transparent',opacity:y?.3:1},children:(0,i.jsx)(d.T,{size:15,weight:h?'bold':'regular',colour:h?n.colours.onGold:f?n.colours.muted:n.colours.text,style:f&&!y?{textDecorationLine:'line-through'}:void 0,children:t.getDate()})},l)})},l)),(0,i.jsx)(d.Muted,{children:"Past dates can\u2019t be booked. Crossed-out days: closed (per the venue\u2019s hours)."})]}):null]})};var t=_r(_d[0]),o=e(_r(_d[1])),s=e(_r(_d[2])),l=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),d=_r(_d[6]),i=_r(_d[7]);function c(e,t){const o=new Date(e);return o.setHours(12,0,0,0),Array.from({length:t},(e,t)=>{const s=new Date(o);return s.setDate(o.getDate()+t),s})}const u=(e,t)=>!!(0,l.hoursFor)(e,t),y=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],h=12},1118,[34,402,102,878,858,821,794,25]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"emptyNeeds",{enumerable:!0,get:function(){return w}}),_e.needsMissing=function(e,l=[]){const s=[];null===e.allergy?s.push('Answer the allergy question first'):'yes'!==e.allergy||e.allergens.length||l.length||e.allergyNote.trim()||s.push('Pick the allergens or describe them');null===e.dog&&s.push('Say whether a dog is coming');return s},_e.needsPatch=function(e,l=[]){const s='yes'===e.allergy?e.allergens.filter(e=>!l.some(l=>l.allergen===e)).map(l=>({allergen:l,severity:e.severity})):[],t=Object.entries(e.holds).filter(([,e])=>e>0).map(([e,l])=>({kind:e.startsWith('item:')?'item':'stock',id:e.slice(5),qty:l})),a=e.dog?Math.max(1,e.dogs):0,n={...e.wheelchair?{wheelchair:e.wheelchair}:{},...e.stepFree?{stepFree:!0}:{},...e.toilet?{toilet:!0}:{},...e.assistDog?{assistDog:!0}:{},...e.accessNote.trim()?{note:e.accessNote.trim()}:{}},r={...e.vegan?{vegan:e.vegan}:{},...e.vegetarian?{vegetarian:e.vegetarian}:{}};return{allergies:[...l,...s],allergyNone:'none'===e.allergy&&!l.length||void 0,allergyPeople:'yes'===e.allergy?e.allergyPeople:void 0,allergyNote:'yes'===e.allergy&&e.allergyNote.trim()?e.allergyNote.trim():void 0,dog:a>0,dogs:a||void 0,access:Object.keys(n).length?n:void 0,diet:Object.keys(r).length?r:void 0,holds:t.length?t:void 0,tableReq:e.tableReq.length?e.tableReq:void 0}},_e.FirstQuestions=function({rid:e,value:l,onChange:a,party:r,audience:i,profile:o=[]}){const y=e=>a({...l,...e}),b=(0,p.usePlan)(e),[x,j]=(0,t.useState)(!1),k=(0,s.dogQuestionOn)((0,u.useRestaurant)(e));(0,t.useEffect)(()=>{k||null!==l.dog||a({...l,dog:!1})},[k,l.dog]);const w=x?m.ALLERGENS:m.ALLERGENS.filter(e=>['gluten','milk','peanuts','treenuts','crustaceans','molluscs','fish','eggs','sesame'].includes(e.id)||l.allergens.includes(e.id)),q=[...o.map(e=>e.allergen),...l.allergens],M=(0,f.dogSetUp)(b);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(R,{tone:"red",testID:"q-allergens",children:[(0,v.jsx)(C,{sub:'guest'===i?'We ask everyone first, so the kitchen can keep you safe.':'Ask every guest first. It goes to the kitchen in red.',children:"\u26a0\ufe0f Does anyone in the party have a food allergy?"}),o.length?(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:o.map(e=>(0,v.jsx)(h.Badge,{kind:"red",label:`${m.ALLERGENS.find(l=>l.id===e.allergen)?.short} (from your profile)`},e.allergen))}):null,(0,v.jsxs)(h.Row,{gap:8,children:[(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"No allergies",selected:'none'===l.allergy,onPress:()=>y({allergy:'none',allergens:[]})})}),(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"Yes, allergies",selected:'yes'===l.allergy,onPress:()=>y({allergy:'yes'})})})]}),'none'===l.allergy&&o.length?(0,v.jsx)(h.Muted,{children:"Your profile allergies above are still shared with the kitchen."}):null,'yes'===l.allergy?(0,v.jsxs)(n.default,{style:{gap:10},testID:"allergen-picker",children:[(0,v.jsx)(h.T,{size:14,weight:"semibold",children:"Which allergens? (the 14 UK allergens)"}),(0,v.jsxs)(h.Row,{wrap:!0,gap:6,children:[w.map(e=>(0,v.jsx)(h.Chip,{label:e.short,selected:l.allergens.includes(e.id)||o.some(l=>l.allergen===e.id),disabled:o.some(l=>l.allergen===e.id),onPress:()=>y({allergens:l.allergens.includes(e.id)?l.allergens.filter(l=>l!==e.id):[...l.allergens,e.id]})},e.id)),x?null:(0,v.jsx)(h.Chip,{label:"All 14\u2026",onPress:()=>j(!0)})]}),(0,v.jsx)(h.T,{size:14,weight:"semibold",children:"How serious?"}),(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:m.SEVERITIES.map(e=>(0,v.jsx)(h.Chip,{label:e.label,selected:l.severity===e.id,onPress:()=>y({severity:e.id})},e.id))}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"How many people with allergies?"}),(0,v.jsx)(h.Stepper,{value:Math.min(l.allergyPeople,r),onChange:e=>y({allergyPeople:e}),min:1,max:Math.max(1,r),label:"people with allergies"})]}),(0,v.jsx)(h.Field,{label:"Anything else the kitchen should know? (optional)",value:l.allergyNote,onChangeText:e=>y({allergyNote:e}),placeholder:"e.g. traces of sesame, one child with coeliac disease",testID:"allergy-note"}),q.length?(0,v.jsx)(c.MenuAllergyCheck,{rid:e,allergens:q,audience:i}):null]}):null]}),k?(0,v.jsxs)(R,{tone:"gold",testID:"q-dogs",children:[(0,v.jsx)(C,{sub:M?'Well-behaved dogs are welcome at our dog-friendly tables.':'staff'===i?'Dog-friendly tables aren\u2019t marked yet (Managers \u203a Booking options), so any table is offered for now.':void 0,children:"\ud83d\udc15 Are you bringing a dog?"}),(0,v.jsxs)(h.Row,{gap:8,children:[(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"No",selected:!1===l.dog,onPress:()=>y({dog:!1})})}),(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"Yes",selected:!0===l.dog,onPress:()=>y({dog:!0,dogs:Math.max(1,l.dogs)})})})]}),l.dog?(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"How many dogs?"}),(0,v.jsx)(h.Stepper,{value:l.dogs,onChange:e=>y({dogs:e}),min:1,max:4,label:"dogs"})]}):null]}):null]})},_e.useReserveAvailability=q,_e.MoreQuestions=function({rid:e,r:l,value:a,onChange:r,party:i,date:o,time:c,today:y,bookings:m,audience:b,showTables:x}){const j=e=>r({...a,...e}),w=l.settings,S=(0,u.useMenu)(e),P=(0,t.useMemo)(()=>S.filter(e=>/\((V|VG|Ve)\)|vegan|vegetarian/i.test(`${e.name} ${e.tags?.join(' ')??''}`)).slice(0,4),[S.length]),N=q(e,l,o,y,m,b),T=e=>a.holds[e]??0,D=(0,f.stockNeed)({holds:Object.entries(a.holds).map(([e,l])=>({kind:e.startsWith('item:')?'item':'stock',id:e.slice(5),qty:l}))},N.items),$=(e,l)=>Math.min(10,...e.map(e=>{const s=(D[e.key]??0)-T(l)*e.qty;return Math.floor(((N.free[e.key]??0)-s)/e.qty)})),I=(e,l,s,t)=>{const r=T(e),i=t<=0&&0===r;return(0,v.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:10,opacity:i?.55:1},testID:`reserve-${e.replace(':','-')}`,children:[(0,v.jsxs)(n.default,{style:{flex:1,minWidth:0},children:[(0,v.jsx)(h.T,{weight:"semibold",children:l}),(0,v.jsx)(h.Muted,{children:i?'Unavailable \u2014 none left for this day':s})]}),i?(0,v.jsx)(h.Badge,{kind:"neutral",label:"Unavailable"}):(0,v.jsx)(h.Stepper,{value:r,onChange:l=>j({holds:{...a.holds,[e]:Math.max(0,Math.min(l,Math.max(r,t)))}}),min:0,max:Math.max(r,Math.min(10,t)),label:l})]},e)},A=N.items.length>0||!1!==w.reserveStock&&N.stock.length>0,O=(0,p.usePlan)(e);return(0,v.jsxs)(v.Fragment,{children:[(0,s.accessQuestionOn)(l)?(0,v.jsxs)(R,{tone:"plain",testID:"q-access",children:[(0,v.jsx)(C,{sub:"Optional. Tell us and we\u2019ll have the right table ready.",children:"\u267f Access needs"}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Wheelchair users"}),(0,v.jsx)(h.Stepper,{value:a.wheelchair,onChange:e=>j({wheelchair:e}),min:0,max:Math.max(1,i),label:"wheelchair users"})]}),(0,v.jsxs)(h.Row,{wrap:!0,gap:6,children:[(0,v.jsx)(h.Chip,{label:"Step-free access",selected:a.stepFree,onPress:()=>j({stepFree:!a.stepFree})}),(0,v.jsx)(h.Chip,{label:"Accessible toilet",selected:a.toilet,onPress:()=>j({toilet:!a.toilet})}),(0,v.jsx)(h.Chip,{label:"Assistance dog",selected:a.assistDog,onPress:()=>j({assistDog:!a.assistDog})})]}),(0,v.jsx)(h.Field,{label:"Anything else? (optional)",value:a.accessNote,onChangeText:e=>j({accessNote:e}),placeholder:"e.g. needs a chair with arms"}),w.accessStatement?.trim()?(0,v.jsx)(h.Muted,{children:w.accessStatement.trim()}):null]}):null,(0,s.dietQuestionOn)(l)?(0,v.jsxs)(R,{tone:"plain",testID:"q-veg",children:[(0,v.jsx)(C,{sub:"We\u2019d love to look after you. Optional.",children:"\u24cb Any vegans or vegetarians?"}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Vegan"}),(0,v.jsx)(h.Stepper,{value:a.vegan,onChange:e=>j({vegan:e}),min:0,max:Math.max(1,i),label:"vegans"})]}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Vegetarian"}),(0,v.jsx)(h.Stepper,{value:a.vegetarian,onChange:e=>j({vegetarian:e}),min:0,max:Math.max(1,i),label:"vegetarians"})]}),!1!==w.vegTeaser&&P.length&&(a.vegan||a.vegetarian)?(0,v.jsxs)(h.Muted,{children:["On the menu: ",P.map(e=>e.name).join(' \xb7 ')]}):null]}):null,A?(0,v.jsxs)(R,{tone:"gold",testID:"q-reserve",children:[(0,v.jsx)(C,{sub:N.known?'Held for you from today\u2019s count.':o>y||'guest'===b?'Held for you; the kitchen confirms and orders in.':void 0,children:"\ud83e\udd9e Reserve with your table"}),N.items.map(e=>I(`item:${e.id}`,`${e.name}${k(e.price)}`,e.description||e.uses.map(e=>`${e.qty} ${N.stock.find(l=>l.key===e.key)?.name.toLowerCase()??e.key}`).join(' + '),$(e.uses,`item:${e.id}`))),!1!==w.reserveStock?N.stock.map(e=>I(`stock:${e.key}`,`Reserve ${e.name.toLowerCase()}`,N.known?`${N.free[e.key]} available today`:'Held for the kitchen to order',$([{key:e.key,qty:1}],`stock:${e.key}`))):null,'staff'===b&&N.known?(0,v.jsxs)(h.Muted,{children:["Today: ",N.stock.map(e=>`${N.free[e.key]} ${e.plural.toLowerCase()} free (${N.reserved[e.key]??0} reserved)`).join(' \xb7 ')]}):null]}):null,x&&!1!==w.tableRequests&&O.tables.length?(0,v.jsx)(M,{rid:e,value:a,onChange:r,party:i,hide:w.tableRequestHide??[]}):null]})},_e.dogTimeOk=function(e,l,s,t,a){if(!a)return!0;const n=e.settings.maxDogsPerSlot;return!n||(0,f.dogsAt)(l,s,t)+a<=n},Object.defineProperty(_e,"accessibleSetUp",{enumerable:!0,get:function(){return f.accessibleSetUp}});var e,l=_r(d[0]),s=_r(d[1]),t=_r(d[2]),a=_r(d[3]),n=(e=a)&&e.__esModule?e:{default:e},r=_r(d[4]),i=_r(d[5]),o=_r(d[6]),c=_r(d[7]),h=_r(d[8]),u=_r(d[9]),p=_r(d[10]),y=_r(d[11]),m=_r(d[12]),b=_r(d[13]),x=_r(d[14]),f=_r(d[15]),j=_r(d[16]),v=_r(d[17]);const k=e=>'display'===x.APP_VARIANT?'':` \xb7 ${(0,b.gbp)(e)}`,w=()=>({allergy:null,allergens:[],severity:'allergy',allergyPeople:1,allergyNote:'',dog:null,dogs:1,wheelchair:0,stepFree:!1,toilet:!1,assistDog:!1,accessNote:'',vegan:0,vegetarian:0,holds:{},tableReq:[]});const R=({children:e,tone:l,testID:s})=>(0,v.jsx)(n.default,{testID:s,style:{gap:10,padding:16,borderRadius:16,borderWidth:'plain'===l?1:1.5,borderColor:'red'===l?j.colours.red:'gold'===l?j.colours.accentBorder:j.colours.hairline,backgroundColor:'red'===l?'#1E1110':j.colours.surface},children:e}),C=({children:e,sub:l})=>(0,v.jsxs)(n.default,{style:{gap:2},children:[(0,v.jsx)(h.T,{weight:"semibold",size:17,children:e}),l?(0,v.jsx)(h.Muted,{children:l}):null]});function q(e,l,s,t,a,n,i){const o=(0,f.reservablesOf)(l),c=(0,y.useStockItems)(e),h=(0,y.useShellStore)((0,r.useShallow)(l=>(0,y.venueCounts)(l,e))),u=(0,y.useShellStore)(l=>!!l.server[e]),p=(0,f.reservedOn)(a,s,o,i),m=s===t&&('staff'===n||u),b={};for(const e of c)b[e.key]=m?Math.max(0,Math.floor((h[e.key]??0)-(p[e.key]??0))):1/0;return{items:o,stock:c,free:b,reserved:p,known:m}}function M({rid:e,value:s,onChange:a,party:r,hide:c}){const u=(0,p.usePlan)(e),y=u.areas.filter(e=>u.tables.some(l=>l.areaId===e.id&&!c.includes(l.name))),[m,b]=(0,t.useState)(y[0]?.id??''),x=s.dog?s.dogs:0,k=e=>c.includes(e)?'Not bookable':(0,f.tableBlockReason)(u,e,r,x,s.wheelchair>0||s.stepFree),w=Object.fromEntries(u.tables.map(e=>[e.name,{table:e,status:k(e.name)?'blocked':'free',covers:0,allergy:!1}])),q=e=>{if(k(e))return;const l=s.tableReq.includes(e)?s.tableReq.filter(l=>l!==e):[...s.tableReq,e].slice(-2);a({...s,tableReq:l})},M=u.tables.filter(e=>e.areaId===m&&!c.includes(e.name));return(0,v.jsxs)(R,{tone:"plain",testID:"q-table",children:[(0,v.jsx)(C,{sub:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best.",children:"\ud83e\ude91 Request a table (optional)"}),y.length>1?(0,v.jsx)(i.AreaTabs,{plan:u,area:m,onPick:b}):null,(0,v.jsx)(n.default,{testID:"q-table-plan",style:{height:240,borderRadius:12,overflow:'hidden',borderWidth:1,borderColor:j.colours.hairline},children:(0,v.jsx)(o.FloorCanvas,{plan:u,areaId:m,mode:"live",view:w,privacy:!0,fit:"contain",crop:!0,maxH:260,highlight:s.tableReq,onTap:e=>q(e.name)})}),(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:M.map(e=>{const t=k(e.name),a=s.tableReq.indexOf(e.name);return(0,v.jsx)(h.Chip,{label:`${(0,l.tableNumbers)(e.name)}`,sub:t||(0===a?'1st choice':1===a?'2nd choice':`${e.maxSeats} seats`),selected:a>=0,disabled:!!t,onPress:()=>q(e.name)},e.name)})}),s.tableReq.length?(0,v.jsxs)(h.T,{size:14,colour:j.colours.goldLight,children:["Requested: ",s.tableReq.map((e,s)=>`${(0,l.tableNumbers)(e)}${s?' (2nd choice)':''}`).join(', ')]}):(0,v.jsx)(h.Muted,{children:"Tap a table; tap another for a second choice."})]})}},1119,[860,877,34,102,879,1120,1121,1123,794,874,1021,984,861,867,872,1091,821,25]); __d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"areaMarks",{enumerable:!0,get:function(){return n}}),_e.AreaTabs=function({plan:o,area:e,onPick:u,counts:a,closed:b}){return(0,c.jsx)(t.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:o.areas.map(o=>{const h=o.id===e,f=b?.has(o.id);return(0,c.jsx)(l.default,{testID:`area-${o.id}`,accessibilityRole:"tab",accessibilityLabel:`Area ${o.name}${o.dogs?', dogs allowed':''}${o.outdoor?', outdoor':''}${f?', closed for weather':''}`,accessibilityState:{selected:h},onPress:()=>u(o.id),style:{maxWidth:'100%',minWidth:0,flexShrink:1,minHeight:48,paddingHorizontal:16,borderRadius:24,borderWidth:1.5,borderColor:h?s.colours.gold:f?s.colours.blue:s.colours.border,backgroundColor:h?s.colours.gold:s.colours.surface,justifyContent:'center'},children:(0,c.jsxs)(t.T,{weight:"semibold",size:15,colour:h?s.colours.onGold:s.colours.text,children:[o.name,n(o),f?(0,c.jsx)(t.T,{size:12,colour:h?s.colours.onGold:s.colours.blue,children:" closed"}):null,a?.[o.id]?(0,c.jsxs)(t.T,{size:12,colour:h?s.colours.onGold:s.colours.muted,children:[" ",a[o.id]]}):null]})},o.id)})})},r(d[0]);var o,e=r(d[1]),l=(o=e)&&o.__esModule?o:{default:o},s=r(d[2]),t=r(d[3]),c=r(d[4]);const n=o=>`${o.dogs?' \ud83d\udc3e':''}${o.outdoor?' \ud83c\udf26':''}`},1120,[34,402,821,794,25]); @@ -1286,7 +1286,7 @@ __d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModu __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useSafetyView=function(o){const c=(0,n.useSafety)(),u=(0,f.useOwner)(t=>t.site);return(0,t.useMemo)(()=>{if('chef'!==o)return c;const t=c.points.filter(t=>(0,s.chefCanSee)(u,t)),n=new Set(c.points.filter(t=>!(0,s.chefCanSee)(u,t)).map(t=>t.id)),f=t=>(0,s.chefCanSee)(u,t)&&!n.has(t.pointId||'');return{...c,points:t,entries:c.entries.filter(f),probes:c.probes.filter(f),diary:c.diary.filter(t=>f(t)&&(0,s.chefCanSee)(u,t.text)),weekly:c.weekly.filter(t=>(0,s.chefCanSee)(u,t.note))}},[c,u,o])};var t=r(d[0]),n=r(d[1]),f=r(d[2]),s=r(d[3])},1203,[34,1026,892,835]); __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTTOM_TABS_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.BottomTabs=function({tabs:e,active:b,onPress:y,background:x,tablist:p}){const{width:j}=(0,s.default)(),v=j/Math.max(1,e.length),w=v>=60?11:10,I=v<56?20:22,[F,S]=(0,t.useState)({}),[H,_]=(0,t.useState)(0),M=H>0&&e.some(e=>(F[e.id]??0)>H-6),z={flexDirection:'row',flexWrap:'nowrap',alignItems:'stretch',borderTopWidth:1,borderColor:c.colours.border,backgroundColor:x};return(0,f.jsx)(l.default,{testID:"app-bottom-tabs",accessibilityRole:p?'tablist':void 0,style:z,children:e.map(t=>{const s=b===t.id,x=s?c.colours.gold:c.colours.muted;return(0,f.jsxs)(n.default,{onLayout:t===e[0]?e=>_(e.nativeEvent.layout.width):void 0,testID:`tab-${t.id}`,accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:t.a11y??t.label,onPress:()=>y(t.id),style:{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:44,minHeight:h,alignItems:'center',justifyContent:'center',paddingVertical:4,paddingHorizontal:1,gap:2},children:[(0,f.jsxs)(l.default,{style:{width:I,height:I,alignItems:'center',justifyContent:'center'},children:[(0,f.jsx)(u.Icon,{name:t.icon,size:I,colour:x}),t.badge?(0,f.jsx)(l.default,{testID:t.badge.testID,style:{position:'absolute',right:-10,top:-5,backgroundColor:t.badge.bg,borderRadius:8,minWidth:16,height:16,paddingHorizontal:3,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(o.default,{style:{fontFamily:c.fonts.bold,fontSize:10,lineHeight:12,color:t.badge.fg??'#FFFFFF'},children:t.badge.text})}):null]}),(0,f.jsx)(l.default,{pointerEvents:"none","aria-hidden":!0,importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,style:{position:'absolute',left:0,top:0,width:0,height:0,overflow:'hidden',opacity:0},children:(0,f.jsx)(l.default,{style:{width:400,flexDirection:'row',alignItems:'flex-start'},children:(0,f.jsx)(o.default,{onLayout:e=>{const n=Math.ceil(e.nativeEvent.layout.width);S(e=>e[t.id]===n?e:{...e,[t.id]:n})},style:{fontFamily:c.fonts.semibold,fontSize:w,lineHeight:Math.round(1.3*w),flexShrink:0},children:t.short??t.label})})}),M?null:(0,f.jsx)(o.default,{numberOfLines:1,style:{fontFamily:s?c.fonts.semibold:c.fonts.regular,fontSize:w,lineHeight:Math.round(1.3*w),color:x,textAlign:'center',alignSelf:'center',maxWidth:'100%'},children:t.short??t.label})]},t.id)})})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=r(d[5]),u=r(d[6]),f=r(d[7]);const h=56},1204,[34,402,346,102,426,821,1171,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return(0,u.canShow)('chef')?(0,c.jsx)(n.ChefApp,{}):(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]})}},1205,[30,34,792,872,25]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return B}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=(e=r)&&e.__esModule?e:{default:e},u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),S=_r(_d[19]),w=_r(_d[20]),D=_r(_d[21]),T=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]),P=_r(_d[25]),M=_r(_d[26]);function B(){const{rid:e,date:r}=(0,n.useLocalSearchParams)(),B=(0,x.useRestaurant)(e),O=(0,x.useCustomer)(),A=(0,x.useBookings)(e),N=(0,x.useEvents)(e),z=(0,x.useNow)(6e4),[R]=(0,l.useState)(()=>(0,a.startForm)()),[F,I]=(0,l.useState)(''),[q,E]=(0,l.useState)(2),[H,W]=(0,l.useState)(r??(0,k.ymd)(z)),[L,_]=(0,l.useState)(null),[Y,U]=(0,l.useState)(O.name),[G,Q]=(0,l.useState)(O.phone??''),[V,J]=(0,l.useState)(O.email??''),[K,X]=(0,l.useState)(!1),[Z,ee]=(0,l.useState)(''),[te,oe]=(0,l.useState)(!1),[se,ne]=(0,l.useState)([]),[le,ie]=(0,l.useState)(!1),ae=[...O.allergies,...se.filter(e=>!O.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[re,de]=(0,l.useState)(null),ue=(0,D.useBlocks)(e=>e.blocks);(0,j.usePublicDayStore)(e=>e.n);const ce=e?(0,j.publicDay)(e,H):null,he=ce?[...ce.bookings,...A.filter(e=>e.date!==H)]:A,me=ce?[...ue.filter(t=>t.rid!==e||t.date!==H),...ce.blocks]:ue,ge=(0,T.usePlan)(e),[pe,be]=(0,l.useState)((0,$.emptyNeeds)()),fe=!0===pe.dog,ye=fe?pe.dogs:0,ke=(0,l.useMemo)(()=>{const e=[],t=new Date(z);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return r&&!e.some(e=>(0,k.ymd)(e)===r)&&e.push((0,k.parseYmd)(r)),e},[z.toDateString(),r]);if(!B)return(0,M.jsx)(h.Screen,{title:"Not found",children:(0,M.jsx)(h.T,{children:"Restaurant not found."})});const xe=B.settings,je=(0,k.parseYmd)(H),ve=(0,D.blocksOn)(me,B.id,H),Se=he.filter(e=>e.date===H),we=ge.areas.filter(e=>e.dogs),De=(0,P.dogSetUp)(ge),Te=e=>(0,C.freeTablesAt)(ge,Se,q,new Date(`${H}${(0,t.tableNumbers)(e)}:00`),(0,C.turnFor)(q,xe.turnMins),xe.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(me,B.id,H,e)}),Ce=(0,y.bookingSlots)(B,je,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),q,z).map(e=>{const t=(0,D.blockAt)(me,B.id,H,e.time),o=fe&&De&&e.available&&!t&&(!Te(e.time).length||!(0,$.dogTimeOk)(B,he,H,e.time,ye));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),$e=Ce.some(e=>e.available),Pe=(0,u.depositOf)(xe),Me=(0,u.depositDue)(Pe,q),Be=Me>0?'deposit':'none',Oe=(0,u.depositWords)(Pe,q,B.name),Ae=N.filter(e=>e.date===H),Ne=(0,w.ukPhone)(G),ze=(0,w.emailOk)(V),Re=(0,$.needsMissing)(pe,O.allergies),Fe=!!L&&te&&!Re.length&&Y.trim().length>1&&Ne.ok&&ze,Ie=async()=>{const e=(0,$.needsPatch)(pe,O.allergies),t=fe&&De?Te(L).map(e=>e.table):[],o=fe?pe.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await x.repo.bookings.create({restaurantId:B.id,customerId:O.id,name:Y,partySize:q,date:H,time:L,notes:Z.trim(),security:Be,depositPaid:0,...Me?{depositDue:Me,depositPolicy:Oe.join(' '),depositRefundable:Pe.refundable,depositCutoffHours:Pe.cutoffHours}:{},phone:Ne.pretty,email:V.trim()||void 0,source:'online',...e,...Ce.find(e=>e.time===L)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??ae,...o?{table:o}:{}});(0,a.rememberGuard)(s.id,(0,a.guardFor)({...R,hp:F})),de(s)},qe=(0,x.useStore)(e=>re?e.bookings.find(e=>e.id===re.id)?.ref:void 0),Ee=e=>(0,S.waMeLink)(B.settings.whatsapp,(0,S.guestWhatsAppText)({name:e.name,ref:qe??e.ref,date:e.date,time:e.time,partySize:e.partySize},B.name));if(re){const e='pending'===re.status;return(0,M.jsxs)(h.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:B.name,children:[(0,M.jsx)(h.Banner,{kind:e?'info':'success',title:`Reference ${qe??re.ref}`,children:`${re.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(re.date))} at ${re.time}`}),e?(0,M.jsx)(h.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(h.T,{children:["Name: ",re.name]}),(0,M.jsxs)(h.T,{children:["Mobile: ",re.phone]}),re.email?(0,M.jsxs)(h.T,{children:["Email: ",re.email]}):null,(0,M.jsxs)(h.T,{children:["Allergies shared with the restaurant: ",re.allergies.length?re.allergies.map(e=>`${(0,p.allergenLabel)(e.allergen)} (${(0,p.severityLabel)(e.severity)})`).join(', '):'none']}),re.notes?(0,M.jsxs)(h.T,{children:["Notes: ",re.notes]}):null,re.dog?(0,M.jsxs)(h.T,{children:["\ud83d\udc15 Dog coming too",re.table?` \xb7 dog-friendly table ${re.table}`:'']}):null,re.holds?.length?(0,M.jsxs)(h.T,{children:["Reserved: ",re.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(B.settings.reservables??P.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,re.tableReq?.length?(0,M.jsxs)(h.T,{children:["Table requested: ",re.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===re.security&&re.depositDue?(0,M.jsxs)(h.T,{weight:"semibold",children:["Deposit due: ",(0,f.gbp)(re.depositDue),". ",B.name," will tell you how to pay it."]}):null,'deposit'===re.security&&re.depositPolicy?(0,M.jsx)(h.Muted,{children:re.depositPolicy}):null,(0,M.jsx)(h.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,M.jsxs)(h.Muted,{children:["Need to change or cancel? Call ",B.phone," and quote ",qe??re.ref,"."]})]}),Ee(re)?(0,M.jsxs)(d.default,{style:{gap:4},children:[(0,M.jsx)(h.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ee(re);e&&(0,S.openWhatsApp)(e)}}),(0,M.jsx)(h.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,M.jsx)(h.Button,{label:"Back to restaurant",onPress:()=>n.router.replace(`/customer/${B.id}`)})]})}return(0,M.jsxs)(h.Screen,{title:"Book a table",subtitle:B.name,footer:(0,M.jsx)(h.Button,{label:Re.length?Re[0]:q>(xe.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Fe,onPress:()=>Ie(),testID:"confirm-booking"}),children:[(0,M.jsx)($.FirstQuestions,{rid:B.id,value:pe,onChange:e=>{e.dog===pe.dog&&e.dogs===pe.dogs||_(null),be(e)},party:q,audience:"guest",profile:O.allergies}),(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(d.default,{style:{gap:6,alignItems:'center'},children:[(0,M.jsx)(h.H2,{children:"Party size"}),(0,M.jsx)(o.PartySizeInput,{value:q,onChange:e=>{E(e),_(null)},label:"Party size",testID:"party-size"})]}),Me?(0,M.jsx)(h.Banner,{kind:"info",title:`Deposit: ${(0,f.gbp)(Me)} for ${q} guests`,children:(0,M.jsx)(d.default,{style:{gap:4},children:Oe.map(e=>(0,M.jsx)(h.T,{size:13,children:e},e))})}):Pe.on&&Pe.perPersonPence>0?(0,M.jsxs)(h.Muted,{children:["No deposit for fewer than ",Pe.fromParty," guests."]}):null,q>(xe.autoAcceptUpTo??7)?(0,M.jsxs)(h.Muted,{children:["For ",q," people the team checks the booking first, then texts you to confirm."]}):null,fe&&De?(0,M.jsxs)(h.Muted,{children:["Dogs are welcome in the ",we.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",B.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Date"}),(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:ke.map(e=>{const t=!!(0,b.hoursFor)(B,e),o=N.some(t=>t.date===(0,k.ymd)(e));return(0,M.jsx)(h.Chip,{label:(0,k.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:H===(0,k.ymd)(e),onPress:()=>{W((0,k.ymd)(e)),_(null)}},(0,k.ymd)(e))})}),Ae.map(e=>(0,M.jsx)(h.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Time"}),0===Ce.length?(0,M.jsx)(h.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:Ce.map(e=>(0,M.jsx)(h.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left_(e.time)},e.time))}),ve.length>0&&Ce.some(e=>e.blocked)?(0,M.jsx)(h.Banner,{kind:"info",title:$e?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${ve.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(je)}. Please give us a ring on ${B.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,s.lastFoodOn)(B,H);return e&&Ce.some(e=>e.drinksOnly)?(0,M.jsx)(h.Banner,{kind:"info",title:`Last food orders ${(0,s.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),fe&&Ce.some(e=>e.noDog)?(0,M.jsx)(h.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${we.map(e=>e.name).join(' and ')}${B.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,D.closedAreasAt)(me,B.id,H,L??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,M.jsxs)(h.Muted,{children:["Times are every ",(0,y.bookingSlotMinutesOf)(B)," minutes. Covers per slot (",xe.bookingCoversPerSlot," per half hour) and table rules still apply."]})]}),(0,M.jsx)($.MoreQuestions,{rid:B.id,r:B,value:pe,onChange:be,party:q,date:H,time:L,today:(0,k.ymd)(z),bookings:he,audience:"guest",showTables:!0}),(0,M.jsxs)(h.Card,{highlight:te?void 0:v.colours.amber,children:[(0,M.jsx)(h.Field,{label:"Notes (optional)",value:Z,onChangeText:ee,placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,M.jsx)(h.Toggle,{label:"I confirm the allergy information for this booking",value:te,onChange:oe}),(0,M.jsx)(h.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Your details"}),(0,M.jsx)(h.Field,{label:"Name for the booking",value:Y,onChangeText:U}),(0,M.jsx)(h.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:G,onChangeText:Q,onBlur:()=>X(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Ne.ok||!K&&!G?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:Ne.error}),(0,M.jsx)(h.Field,{testID:"book-email",label:"Email (optional)",value:V,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),ze?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,M.jsxs)(h.Muted,{children:["We\u2019ll text you a confirmation",V.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,M.jsx)(i.Honeypot,{value:F,onChange:I})]})}},1206,[860,1114,877,30,34,1207,999,102,14,1124,794,861,878,867,1117,858,874,988,821,1168,864,1018,1021,1095,1119,1091,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return B}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=(e=r)&&e.__esModule?e:{default:e},u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),x=_r(_d[15]),k=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),D=_r(_d[21]),T=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]),P=_r(_d[25]),M=_r(_d[26]);function B(){const{rid:e,date:r}=(0,n.useLocalSearchParams)(),B=(0,k.useRestaurant)(e),A=(0,k.useCustomer)(),O=(0,k.useBookings)(e),N=(0,k.useEvents)(e),z=(0,k.useNow)(6e4),[R]=(0,l.useState)(()=>(0,a.startForm)()),[F,I]=(0,l.useState)(''),[q,L]=(0,l.useState)(2),[H,E]=(0,l.useState)(r??(0,x.ymd)(z)),[W,_]=(0,l.useState)(null),[Y,U]=(0,l.useState)(A.name),[G,Q]=(0,l.useState)(A.phone??''),[V,J]=(0,l.useState)(A.email??''),[K,X]=(0,l.useState)(!1),[Z,ee]=(0,l.useState)(''),[te,oe]=(0,l.useState)(!1),[se,ne]=(0,l.useState)([]),[le,ie]=(0,l.useState)(!1),ae=[...A.allergies,...se.filter(e=>!A.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[re,de]=(0,l.useState)(null),ue=(0,D.useBlocks)(e=>e.blocks);(0,j.usePublicDayStore)(e=>e.n);const ce=e?(0,j.publicDay)(e,H):null,he=ce?[...ce.bookings,...O.filter(e=>e.date!==H)]:O,me=ce?[...ue.filter(t=>t.rid!==e||t.date!==H),...ce.blocks]:ue,ge=(0,T.usePlan)(e),[pe,be]=(0,l.useState)((0,$.emptyNeeds)()),fe=!0===pe.dog,ye=fe?pe.dogs:0,xe=(0,l.useMemo)(()=>{const e=[],t=new Date(z);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return r&&!e.some(e=>(0,x.ymd)(e)===r)&&e.push((0,x.parseYmd)(r)),e},[z.toDateString(),r]);if(!B)return(0,M.jsx)(h.Screen,{title:"Not found",children:(0,M.jsx)(h.T,{children:"Restaurant not found."})});const ke=B.settings,je=(0,x.parseYmd)(H),ve=(0,y.onlinePartyBounds)(B),we=(0,D.blocksOn)(me,B.id,H),Se=he.filter(e=>e.date===H),De=ge.areas.filter(e=>e.dogs),Te=(0,P.dogSetUp)(ge),Ce=e=>(0,C.freeTablesAt)(ge,Se,q,new Date(`${H}${(0,t.tableNumbers)(e)}:00`),(0,C.turnFor)(q,ke.turnMins),ke.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(me,B.id,H,e)}),$e=(0,y.bookingSlots)(B,je,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),q,z,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,D.blockAt)(me,B.id,H,e.time),o=fe&&Te&&e.available&&!t&&(!Ce(e.time).length||!(0,$.dogTimeOk)(B,he,H,e.time,ye));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Pe=$e.some(e=>e.available),Me=(0,u.depositOf)(ke),Be=(0,u.depositDue)(Me,q),Ae=Be>0?'deposit':'none',Oe=(0,u.depositWords)(Me,q,B.name),Ne=N.filter(e=>e.date===H),ze=(0,S.ukPhone)(G),Re=(0,S.emailOk)(V),Fe=(0,$.needsMissing)(pe,A.allergies),Ie=!!W&&te&&!Fe.length&&Y.trim().length>1&&ze.ok&&Re,qe=async()=>{const e=(0,$.needsPatch)(pe,A.allergies),t=fe&&Te?Ce(W).map(e=>e.table):[],o=fe?pe.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await k.repo.bookings.create({restaurantId:B.id,customerId:A.id,name:Y,partySize:q,date:H,time:W,notes:Z.trim(),security:Ae,depositPaid:0,...Be?{depositDue:Be,depositPolicy:Oe.join(' '),depositRefundable:Me.refundable,depositCutoffHours:Me.cutoffHours}:{},phone:ze.pretty,email:V.trim()||void 0,source:'online',...e,...$e.find(e=>e.time===W)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??ae,...o?{table:o}:{}});(0,a.rememberGuard)(s.id,(0,a.guardFor)({...R,hp:F})),de(s)},Le=(0,k.useStore)(e=>re?e.bookings.find(e=>e.id===re.id)?.ref:void 0),He=e=>(0,w.waMeLink)(B.settings.whatsapp,(0,w.guestWhatsAppText)({name:e.name,ref:Le??e.ref,date:e.date,time:e.time,partySize:e.partySize},B.name));if(re){const e='pending'===re.status;return(0,M.jsxs)(h.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:B.name,children:[(0,M.jsx)(h.Banner,{kind:e?'info':'success',title:`Reference ${Le??re.ref}`,children:`${re.partySize} people \xb7 ${(0,x.niceDateYear)((0,x.parseYmd)(re.date))} at ${re.time}`}),e?(0,M.jsx)(h.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(h.T,{children:["Name: ",re.name]}),(0,M.jsxs)(h.T,{children:["Mobile: ",re.phone]}),re.email?(0,M.jsxs)(h.T,{children:["Email: ",re.email]}):null,(0,M.jsxs)(h.T,{children:["Allergies shared with the restaurant: ",re.allergies.length?re.allergies.map(e=>`${(0,p.allergenLabel)(e.allergen)} (${(0,p.severityLabel)(e.severity)})`).join(', '):'none']}),re.notes?(0,M.jsxs)(h.T,{children:["Notes: ",re.notes]}):null,re.dog?(0,M.jsxs)(h.T,{children:["\ud83d\udc15 Dog coming too",re.table?` \xb7 dog-friendly table ${re.table}`:'']}):null,re.holds?.length?(0,M.jsxs)(h.T,{children:["Reserved: ",re.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(B.settings.reservables??P.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,re.tableReq?.length?(0,M.jsxs)(h.T,{children:["Table requested: ",re.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===re.security&&re.depositDue?(0,M.jsxs)(h.T,{weight:"semibold",children:["Deposit due: ",(0,f.gbp)(re.depositDue),". ",B.name," will tell you how to pay it."]}):null,'deposit'===re.security&&re.depositPolicy?(0,M.jsx)(h.Muted,{children:re.depositPolicy}):null,(0,M.jsx)(h.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,M.jsxs)(h.Muted,{children:["Need to change or cancel? Call ",B.phone," and quote ",Le??re.ref,"."]})]}),He(re)?(0,M.jsxs)(d.default,{style:{gap:4},children:[(0,M.jsx)(h.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=He(re);e&&(0,w.openWhatsApp)(e)}}),(0,M.jsx)(h.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,M.jsx)(h.Button,{label:"Back to restaurant",onPress:()=>n.router.replace(`/customer/${B.id}`)})]})}return(0,M.jsxs)(h.Screen,{title:"Book a table",subtitle:B.name,footer:(0,M.jsx)(h.Button,{label:Fe.length?Fe[0]:q>(ke.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Ie,onPress:()=>qe(),testID:"confirm-booking"}),children:[(0,M.jsx)($.FirstQuestions,{rid:B.id,value:pe,onChange:e=>{e.dog===pe.dog&&e.dogs===pe.dogs||_(null),be(e)},party:q,audience:"guest",profile:A.allergies}),(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(d.default,{style:{gap:6,alignItems:'center'},children:[(0,M.jsx)(h.H2,{children:"Party size"}),(0,M.jsx)(o.PartySizeInput,{value:q,onChange:e=>{L(e),_(null)},min:ve.min,max:ve.max,label:"Party size",testID:"party-size"})]}),Be?(0,M.jsx)(h.Banner,{kind:"info",title:`Deposit: ${(0,f.gbp)(Be)} for ${q} guests`,children:(0,M.jsx)(d.default,{style:{gap:4},children:Oe.map(e=>(0,M.jsx)(h.T,{size:13,children:e},e))})}):Me.on&&Me.perPersonPence>0?(0,M.jsxs)(h.Muted,{children:["No deposit for fewer than ",Me.fromParty," guests."]}):null,q>(ke.autoAcceptUpTo??7)?(0,M.jsxs)(h.Muted,{children:["For ",q," people the team checks the booking first, then texts you to confirm."]}):null,fe&&Te?(0,M.jsxs)(h.Muted,{children:["Dogs are welcome in the ",De.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",B.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Date"}),(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:xe.map(e=>{const t=!!(0,b.hoursFor)(B,e),o=N.some(t=>t.date===(0,x.ymd)(e));return(0,M.jsx)(h.Chip,{label:(0,x.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:H===(0,x.ymd)(e),onPress:()=>{E((0,x.ymd)(e)),_(null)}},(0,x.ymd)(e))})}),Ne.map(e=>(0,M.jsx)(h.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Time"}),0===$e.length?(0,M.jsx)(h.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:$e.map(e=>(0,M.jsx)(h.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left_(e.time)},e.time))}),we.length>0&&$e.some(e=>e.blocked)?(0,M.jsx)(h.Banner,{kind:"info",title:Pe?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${we.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,x.niceDate)(je)}. Please give us a ring on ${B.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,s.lastFoodOn)(B,H);return e&&$e.some(e=>e.drinksOnly)?(0,M.jsx)(h.Banner,{kind:"info",title:`Last food orders ${(0,s.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),fe&&$e.some(e=>e.noDog)?(0,M.jsx)(h.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${De.map(e=>e.name).join(' and ')}${B.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,D.closedAreasAt)(me,B.id,H,W??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,M.jsx)(h.Muted,{children:(0,y.bookingLimitsHint)(B)})]}),(0,M.jsx)($.MoreQuestions,{rid:B.id,r:B,value:pe,onChange:be,party:q,date:H,time:W,today:(0,x.ymd)(z),bookings:he,audience:"guest",showTables:!0}),(0,M.jsxs)(h.Card,{highlight:te?void 0:v.colours.amber,children:[(0,M.jsx)(h.Field,{label:"Notes (optional)",value:Z,onChangeText:ee,placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,M.jsx)(h.Toggle,{label:"I confirm the allergy information for this booking",value:te,onChange:oe}),(0,M.jsx)(h.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Your details"}),(0,M.jsx)(h.Field,{label:"Name for the booking",value:Y,onChangeText:U}),(0,M.jsx)(h.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:G,onChangeText:Q,onBlur:()=>X(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),ze.ok||!K&&!G?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:ze.error}),(0,M.jsx)(h.Field,{testID:"book-email",label:"Email (optional)",value:V,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Re?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,M.jsxs)(h.Muted,{children:["We\u2019ll text you a confirmation",V.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,M.jsx)(i.Honeypot,{value:F,onChange:I})]})}},1206,[860,1114,877,30,34,1207,999,102,14,1124,794,861,878,867,1117,858,874,988,821,1168,864,1018,1021,1095,1119,1091,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Honeypot=function({value:t,onChange:n}){return(0,l.jsx)(o.default,{"aria-hidden":!0,pointerEvents:"none",style:{position:'absolute',left:-1e4,top:0,width:1,height:1,overflow:'hidden',opacity:0},children:(0,l.jsx)(e.TextInput,{testID:"hp-field",accessibilityLabel:"Leave this empty",value:t,onChangeText:n,tabIndex:-1,autoComplete:'off',name:'cc_extra_info','aria-hidden':!0})})};var e=r(d[0]);r(d[1]),r(d[2]);var t,n=r(d[3]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[4])},1207,[827,34,236,102,25]); __d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var t=_r(_d[0]),n=_r(_d[1]),l=e(_r(_d[2])),s=e(_r(_d[3])),r=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]);function f(){const{rid:e,did:f}=(0,t.useLocalSearchParams)(),b=(0,u.useRestaurant)(e),j=(0,u.useMenu)(e).find(e=>e.id===f),x=(0,u.useCustomer)(),m=(0,u.useRecipeCards)(e).find(e=>e.id===j?.recipeCardId),y=m?.signOff&&m.photo?(0,h.recipeCards)().photoSource(m.photo):null,k=(0,u.useStore)(e=>e.addLine),[v,w]=(0,n.useState)(()=>(j?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[S,C]=(0,n.useState)(1),[B,$]=(0,n.useState)(''),[I,P]=(0,n.useState)(!1),[L,T]=(0,n.useState)(!1),[D,O]=(0,n.useState)(!1),[A,M]=(0,n.useState)(!1),R=(0,n.useMemo)(()=>j?(0,d.effectiveAllergens)(j,v):{},[j,v]);if(!b||!j)return(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Dish not found."})});const q=(0,d.conflictsFor)(R,x.allergies),_=(j.price??0)+(j.optionGroups??[]).flatMap(e=>e.choices).filter(e=>v.includes(e.id)).reduce((e,t)=>e+t.priceDelta,0),N=j.soldOut||!j.signOff||null===j.price,G=(e,t)=>{const n=j.optionGroups.find(t=>t.id===e);w(e=>{const l=n.choices.map(e=>e.id);return n.multi?e.includes(t)?e.filter(e=>e!==t):[...e,t]:e.includes(t)&&!n.required?e.filter(e=>e!==t):[...e.filter(e=>!l.includes(e)),t]})},z=e=>{u.useStore.getState().basket.restaurantId!==b.id&&u.useStore.getState().startBasket(b.id,'takeaway'),k({itemId:j.id,qty:S,choiceIds:v,notes:B,override:e?{allergens:q.contains,at:(new Date).toISOString()}:void 0}),P(!1),M(!0)};return(0,p.jsxs)(o.Screen,{title:j.name,subtitle:b.name,right:(0,p.jsx)(a.BasketButton,{}),children:[y?(0,p.jsx)(l.default,{testID:"dish-photo",source:y,accessibilityLabel:`${j.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.T,{weight:"bold",size:20,colour:g.colours.gold,children:null===j.price?j.priceNote:(0,c.gbp)(_)}),j.dietary.map(e=>(0,p.jsx)(o.Badge,{kind:"ok",label:e},e))]}),(0,p.jsx)(o.T,{children:j.description}),q.contains.length?(0,p.jsx)(o.Banner,{kind:"danger",title:`Blocked: contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,q.may.length?(0,p.jsx)(o.Banner,{kind:"warn",title:`Warning: may contain ${q.may.map(d.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(j.optionGroups??[]).map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:e.choices.map(t=>(0,p.jsx)(o.Chip,{label:t.label,sub:t.priceDelta?`+${(0,c.gbp)(t.priceDelta)}`:void 0,selected:v.includes(t.id),onPress:()=>G(e.id,t.id)},t.id))})]},e.id)),(0,p.jsx)(o.Card,{children:(0,p.jsx)(r.AllergenPanel,{item:j,map:R,declared:x.allergies})}),b.fictional?null:(0,p.jsx)(o.ExampleAllergenNotice,{}),(0,p.jsx)(o.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:B,onChangeText:$}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Quantity"}),(0,p.jsx)(o.Stepper,{value:S,onChange:C,label:"quantity"})]}),A?(0,p.jsx)(o.Banner,{kind:"success",title:"Added to basket",children:q.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,N?(0,p.jsx)(o.Banner,{kind:"warn",children:j.soldOut?'Sold out today.':j.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):q.contains.length?(0,p.jsxs)(s.default,{style:{gap:8},children:[(0,p.jsx)(o.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,p.jsx)(o.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{T(!1),O(!1),P(!0)},testID:"override-open"})]}):(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{style:{flex:1},label:`Add ${S} to basket \xb7 ${(0,c.gbp)(_*S)}`,onPress:()=>z(!1),testID:"add-to-basket"}),A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,p.jsxs)(o.Sheet,{visible:I,onClose:()=>P(!1),title:"Allergy override",children:[(0,p.jsx)(o.Banner,{kind:"danger",title:`${j.name} contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`Your profile says: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}.`}),(0,p.jsx)(o.Toggle,{label:"I understand this dish contains an allergen I have declared",value:L,onChange:T}),(0,p.jsx)(o.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:D,onChange:O}),(0,p.jsx)(o.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,p.jsx)(o.Button,{kind:"danger",disabled:!L||!D,label:"Confirm override and add",onPress:()=>z(!0),testID:"override-confirm"})]})]})}},1208,[30,34,336,102,1209,1211,794,861,867,874,882,821,25]); __d(function(g,r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AllergenPanel=function({item:e,map:n,declared:u}){return(0,d.jsxs)(s.default,{style:{gap:6},accessibilityLabel:"Allergen panel",children:[(0,d.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,d.jsx)(o.T,{weight:"semibold",children:"Allergen panel (14 UK allergens)"}),(0,l.isLiveVenue)()?null:(0,d.jsx)(o.Badge,{label:"NOT CONNECTED",kind:"amber"})]}),(0,d.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:6},children:a.ALLERGENS.map(e=>{const l=n[e.id],c=u.find(l=>l.allergen===e.id),f='contains'===l?t.colours.redBg:'may'===l?t.colours.amberBg:t.colours.surface2,h='contains'===l?'#FFD9D4':'may'===l?'#FFE2A8':t.colours.muted;return(0,d.jsxs)(s.default,{style:{width:'48%',flexGrow:1,backgroundColor:f,borderRadius:8,padding:8,borderWidth:c?2:1,borderColor:c?t.colours.red:t.colours.border},children:[(0,d.jsx)(o.T,{size:14,weight:"medium",colour:l?h:t.colours.text,children:e.label}),(0,d.jsxs)(o.T,{size:13,colour:h,children:['contains'===l?'Contains':'may'===l?'May contain':'Not listed',c?` \xb7 YOUR ALLERGY (${(0,a.severityLabel)(c.severity)})`:'']})]},e.id)})}),e.allergenNotes?(0,d.jsxs)(o.Muted,{children:["Notes: ",e.allergenNotes]}):null,(0,d.jsx)(s.default,{testID:"allergen-signoff",children:(0,d.jsx)(o.Muted,{children:e.signOff?`From the dish's recipe card. Signed off by ${e.signOff.by} on ${c(e.signOff.at)}.`:"Awaiting the head chef's allergen sign-off: not available to order online."})}),(0,d.jsx)(o.Muted,{children:"Always tell staff about allergies when you order or arrive."})]})},_e.AllergenChips=function({map:e,declared:l}){const n=Object.entries(e);return n.length?(0,d.jsx)(o.Row,{wrap:!0,gap:5,children:n.sort((e,l)=>e[1]===l[1]?0:'contains'===e[1]?-1:1).map(([e,n])=>{const s=l.some(l=>l.allergen===e);return(0,d.jsx)(o.Badge,{label:`${s?'\u26a0 ':''}${(0,a.allergenLabel)(e)}${'may'===n?' (may)':''}`,kind:s?'contains'===n?'red':'amber':'neutral'},e)})}):(0,d.jsx)(o.Muted,{children:"No listed allergens"})},r(_d[0]);var e,l=r(_d[1]),n=r(_d[2]),s=(e=n)&&e.__esModule?e:{default:e},a=r(_d[3]),t=r(_d[4]),o=r(_d[5]),d=r(_d[6]);const c=e=>{const l=new Date(`${e.slice(0,10)}T12:00:00`);return isNaN(+l)?e:l.toLocaleDateString('en-GB',{day:'numeric',month:'long',year:'numeric'})}},1209,[34,1210,102,861,821,794,25]); @@ -1445,7 +1445,7 @@ __d(function(g,_r,i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModul __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.WipeDevice=function({compact:e}){const f=(0,u.useDisplaySettings)(p.VENUE_RID),[v,T]=(0,s.useState)(!1),[w,j]=(0,s.useState)(''),[D,C]=(0,s.useState)(!1),I='display'===h.APP_VARIANT&&f.pinOn,P=!I||(0,b.wakePinMatches)(f,w);return v?(0,x.jsxs)(o.default,{testID:"wipe-confirm-box",style:{gap:6,marginTop:6},children:[(0,x.jsx)(l.T,{size:e?12:14,children:"Sign out and remove everything CoverCharge keeps on this device: sign-ins, pairing, saved screens and any changes not sent yet. The venue\u2019s shared data is not touched. To use it again, open a personal link or pair the Display again."}),I?(0,x.jsx)(t.TextInput,{testID:"wipe-pin",value:w,onChangeText:j,placeholder:"Display wake PIN",placeholderTextColor:c.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display wake PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:c.colours.text}}):null,(0,x.jsxs)(o.default,{style:{flexDirection:'row',gap:8},children:[(0,x.jsx)(n.default,{testID:"wipe-confirm",accessibilityRole:"button",accessibilityLabel:"Yes, wipe this device",disabled:!P||D,onPress:()=>{C(!0),(0,y.wipeThisDevice)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:P?c.colours.red:'rgba(255,255,255,0.08)'},children:(0,x.jsx)(l.T,{size:12,weight:"semibold",children:D?'Wiping\u2026':'Yes, wipe this device'})}),(0,x.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:()=>{T(!1),j('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,x.jsx)(l.T,{size:12,children:"Cancel"})})]})]}):(0,x.jsx)(n.default,{testID:"wipe-device",accessibilityRole:"button",accessibilityLabel:"Sign out and wipe this device",onPress:()=>T(!0),style:{alignSelf:'flex-start',marginTop:e?4:0,minHeight:44,justifyContent:'center'},children:(0,x.jsx)(l.T,{size:e?12:14,colour:c.colours.gold,children:"Sign out and wipe this device\u2026"})})};var t=r(d[0]),s=r(d[1]),n=e(r(d[2])),o=e(r(d[3])),l=r(d[4]),c=r(d[5]),u=r(d[6]),p=r(d[7]),b=r(d[8]),h=r(d[9]),y=r(d[10]),x=r(d[11])},1362,[827,34,402,102,794,821,1021,5,1022,872,988,25]); __d(function(g,r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.PlanPhoto=function({rid:e}){const t=(0,n.usePlan)(e),b=(0,n.useFloor)(e=>e.setPlan),[y,f]=(0,a.useState)(null),[x,w]=(0,a.useState)(null),[v,j]=(0,a.useState)(null),[k,S]=(0,a.useState)(''),[P,T]=(0,a.useState)(!1),I=async e=>{let a;T(!0);try{const{data:t,error:l}=await(0,u.getSupabase)().functions.invoke('plan-photo-read',{body:{image:e}});a=l?{ok:!1,message:'The plan could not be read. The photo is still here.'}:{ok:!0,tables:(0,o.cleanFindings)(t)}}catch{a={ok:!1,message:'The plan could not be read. The photo is still here.'}}finally{T(!1)}const t=(0,o.planReadAfter)(e,a);w(t.photo),f(t.rows&&t.rows.length?t.rows:null),S(t.note)},L=async()=>{S('');const e=(await(0,c.pickPhotos)({source:'camera'}))[0];e?(w(e),await I(e)):S('No photo taken.')};return(0,p.jsxs)(l.default,{testID:"plan-photo",style:{width:'100%',alignItems:'center',gap:10},children:[(0,p.jsx)(s.Button,{testID:"plan-photo-camera",label:P?'Reading the plan\u2026':'Take a picture of the table plan',accessibilityLabel:"Take a picture of a hand-drawn table plan",disabled:P,onPress:()=>{L()}}),k?(0,p.jsx)(s.Muted,{center:!0,testID:"plan-photo-note",children:k}):null,x&&!P?(0,p.jsx)(s.Button,{kind:"ghost",testID:"plan-photo-retry",label:"Read this photo again",accessibilityLabel:"Read this photo again",onPress:()=>{I(x)}}):null,y?(0,p.jsx)(l.default,{testID:"plan-photo-review",style:{width:'100%'},children:(0,p.jsxs)(s.Card,{style:{alignItems:'center',width:'100%'},children:[(0,p.jsx)(s.T,{center:!0,weight:"bold",colour:h.colours.gold,children:"Check what was read"}),(0,p.jsx)(s.Muted,{center:!0,children:"Nothing is saved until you tap Save the plan."}),y.map((e,a)=>(0,p.jsxs)(l.default,{style:{width:'100%',gap:6},children:[(0,p.jsx)(s.Field,{label:"Area",accessibilityLabel:`Area ${a+1}`,value:e.area,onChangeText:e=>f(y.map((t,l)=>l===a?{...t,area:e}:t))}),(0,p.jsx)(s.Field,{label:"Table",accessibilityLabel:`Table ${a+1}`,value:e.name,onChangeText:e=>f(y.map((t,l)=>l===a?{...t,name:e}:t))}),(0,p.jsx)(s.Field,{label:"Seats",accessibilityLabel:`Seats at table ${a+1}`,value:String(e.seats),keyboardType:"number-pad",onChangeText:e=>f(y.map((t,l)=>l===a?{...t,seats:Math.max(1,Math.min(30,Number(e.replace(/\D/g,''))||1))}:t))}),(0,p.jsx)(s.Button,{kind:"ghost",label:`Remove ${e.name||'table'}`,accessibilityLabel:`Remove ${e.name||'table'}`,onPress:()=>f(y.filter((e,t)=>t!==a))})]},`${e.area}-${e.name}-${a}`)),(0,p.jsx)(s.Button,{testID:"plan-photo-save",label:"Save the plan",accessibilityLabel:"Save the checked table plan",disabled:!y.length,onPress:()=>{if(!y?.length)return;j(t);const a=[...t.areas],l=[...t.tables];for(const e of y){let t=a.find(a=>a.name.toLowerCase()===e.area.toLowerCase());t||(t={id:(0,i.fid)('area'),name:e.area},a.push(t));const s=(0,i.sizeFor)(e.seats),n=l.filter(e=>e.areaId===t.id).length;l.push({id:(0,i.fid)('t'),name:e.name,areaId:t.id,shape:s.shape,minSeats:1,maxSeats:e.seats,x:40+n%6*140,y:40+120*Math.floor(n/6),w:s.w,h:s.h,rot:0,online:!0})}b(e,{...t,areas:a,tables:l}),f(null),S('Plan saved. Undo puts the previous plan back.')}})]})}):null,v?(0,p.jsx)(s.Button,{kind:"ghost",testID:"plan-photo-undo",label:"Undo table plan",accessibilityLabel:"Undo the table plan and restore the previous one",onPress:()=>{b(e,v),j(null),S('Previous plan restored.')}}):null]})};var e,a=r(d[0]),t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},s=r(d[2]),n=r(d[3]),o=r(d[4]),i=r(d[5]),h=r(d[6]),c=r(d[7]),u=r(d[8]),p=r(d[9])},1363,[34,102,794,1021,1364,859,821,1066,934,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.planReadAfter=function(t,o){return o.ok?o.tables.length?{photo:t,rows:o.tables,note:''}:{photo:t,rows:[],note:'Nothing readable on that photo. The photo is still here.'}:{photo:t,rows:null,note:o.message}},e.cleanFindings=function(o){if(!o||'object'!=typeof o)return[];const n=o.tables;if(!Array.isArray(n))return[];const s=[];for(const o of n.slice(0,80)){if(!o||'object'!=typeof o)continue;const n=t(o.area,40),c=t(o.name,12),l=o.seats;!n||!c||'number'!=typeof l||!Number.isInteger(l)||l<1||l>30||s.push({area:n,name:c,seats:l})}return s};const t=(t,o)=>'string'==typeof t?t.trim().slice(0,o):''},1364,[]); -__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:n}=(0,l.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[b,h]=(0,t.useState)(String(e.settings.turnMins??'')),[y,v]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[f,k]=(0,t.useState)(!1),M=(e,t,n)=>c(s=>({...s,[e]:0===t?[n,s[e]?.[1]??'']:[s[e]?.[0]??'',n]})),S=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(b)<=360&&Number(y)>=1&&Number(y)<=1e3;return(0,r.jsxs)(s.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(n=>({...n,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>M(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>M(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:b,onChangeText:h,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:y,onChangeText:v,keyboardType:"number-pad"})]}),(0,r.jsx)(i.Button,{label:f?'Saving\u2026':'Save booking times',disabled:!S||f,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{k(!0);try{await(0,o.saveStaffBookingTimes)(n,u,Number(b),Number(y)),j('Booking times saved.')}catch(e){j(e.message)}finally{k(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),n=_r(_d[1]),s=(e=n)&&e.__esModule?e:{default:e},i=_r(_d[2]),l=_r(_d[3]),o=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1365,[34,102,794,1079,988,25]); +__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:s}=(0,o.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[h,b]=(0,t.useState)(String(e.settings.turnMins??'')),[v,y]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[k,S]=(0,t.useState)(!1),f=(e,t,s)=>c(n=>({...n,[e]:0===t?[s,n[e]?.[1]??'']:[n[e]?.[0]??'',s]})),p=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(h)<=360&&Number(v)>=1&&Number(v)<=1e3;return(0,r.jsxs)(n.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(s=>({...s,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>f(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>f(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:h,onChangeText:b,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:v,onChangeText:y,keyboardType:"number-pad"}),e.settings.bookingCoversPerStart||e.settings.bookingPartiesPerStart?(0,r.jsx)(i.Muted,{center:!0,children:"Online booking uses the covers and bookings caps at each start time (Settings \u203a Capacity & waitlist), not this half-hour figure."}):null]}),(0,r.jsx)(i.Button,{label:k?'Saving\u2026':'Save booking times',disabled:!p||k,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{S(!0);try{await(0,l.saveStaffBookingTimes)(s,u,Number(h),Number(v)),j('Booking times saved.')}catch(e){j(e.message)}finally{S(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),s=_r(_d[1]),n=(e=s)&&e.__esModule?e:{default:e},i=_r(_d[2]),o=_r(_d[3]),l=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1365,[34,102,794,1079,988,25]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffTableOrders=function({rid:e,me:l}){const p=(0,c.useOrderAtTable)(e),x=(0,c.useNow)(15e3),f=(0,c.useStore)(e=>e.bookings),w=(0,c.useOrders)(e).filter(i.isTableQr).sort((e,t)=>t.createdAt.localeCompare(e.createdAt)),S=w.filter(i.waitingForStaff),y=w.filter(e=>m(e)&&!(0,i.waitingForStaff)(e)),v=w.filter(e=>!m(e)).slice(0,8),[k,T]=(0,s.useState)(null),[$,B]=(0,s.useState)(null),M=e=>{c.repo.orders.accept(e.id,l),B(`${e.ref} accepted for table ${(0,t.tableNumbers)(e.tableNo)}: it's gone to the kitchen.`)},N=e=>{const t=(0,h.statusBlock)(e,'served',(0,h.linkedBooking)(e,f));if(t)return void B(`${e.ref}: ${t}`);const s=(new Date).toISOString();c.useStore.setState(t=>({orders:t.orders.map(t=>t.id===e.id?{...t,servedBy:{by:l,at:s}}:t)})),c.useStore.getState().setOrderStatus(e.id,'served',l),B(`${e.ref} marked served.`)},O=(e,t)=>{const s=(new Date).toISOString();c.useStore.setState(r=>({orders:r.orders.map(r=>r.id===e.id?{...r,cancelReason:t,cancelledBy:{by:l,at:s}}:r)})),c.useStore.getState().setOrderStatus(e.id,'cancelled',l),T(null),B(`${e.ref} cancelled (${t}). The guest's phone shows the reason.`)},A=({o:e,held:s})=>(0,b.jsxs)(a.Card,{highlight:s?u.colours.amber:e.allergies.length?u.colours.red:u.colours.gold,children:[(0,b.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,b.jsxs)(a.T,{weight:"semibold",children:["Table ",(0,t.tableNumbers)(e.tableNo)," \xb7 ",e.ref]}),(0,b.jsx)(a.Badge,{kind:s?'amber':'cancelled'===e.status?'neutral':'gold',label:s?'Waiting for you':'served'===e.status?'Served':'cancelled'===e.status?'Cancelled':'In the kitchen'})]}),(0,b.jsxs)(a.Muted,{children:[e.customerName," \xb7 ",j(e.createdAt,x),e.accepted?` \xb7 accepted by ${e.accepted.by}`:'']}),e.lines.map((e,t)=>(0,b.jsxs)(a.T,{children:[e.qty,"\xd7 ",e.name,e.notes?` (note: ${e.notes})`:'']},t)),e.allergies.length?(0,b.jsx)(a.Row,{wrap:!0,gap:6,children:e.allergies.map(e=>(0,b.jsx)(a.Badge,{kind:"red",label:`${(0,n.allergenLabel)(e.allergen)}: ${(0,n.severityLabel)(e.severity)}`},e.allergen))}):(0,b.jsx)(a.Muted,{children:"No allergies declared."}),e.notes?(0,b.jsxs)(a.T,{size:13,children:["Note: ",e.notes]}):null,(0,b.jsxs)(a.T,{size:13,colour:u.colours.muted,children:[(0,o.gbp)(e.total)," to pay at the bar or with the server"]}),'cancelled'===e.status&&e.cancelReason?(0,b.jsxs)(a.Muted,{children:["Reason: ",e.cancelReason]}):null,m(e)?k===e.id?(0,b.jsxs)(r.default,{style:{gap:6},children:[(0,b.jsx)(a.T,{size:13,children:"Why are you cancelling? The guest sees this."}),(0,b.jsx)(a.Row,{wrap:!0,gap:6,children:i.CANCEL_REASONS.map(t=>(0,b.jsx)(a.Chip,{label:t,onPress:()=>O(e,t)},t))}),(0,b.jsx)(a.Button,{small:!0,kind:"ghost",label:"Don't cancel",onPress:()=>T(null)})]}):(0,b.jsxs)(a.Row,{gap:8,wrap:!0,children:[s?(0,b.jsx)(a.Button,{small:!0,label:"Accept",testID:`accept-${e.ref}`,onPress:()=>M(e)}):(0,b.jsx)(a.Button,{small:!0,label:"Mark served",testID:`served-${e.ref}`,onPress:()=>N(e)}),(0,b.jsx)(a.Button,{small:!0,kind:"secondary",label:"Cancel with a reason",onPress:()=>T(e.id)})]}):null]});return(0,b.jsxs)(r.default,{style:{gap:10},children:[(0,b.jsx)(a.Muted,{children:"Tip: orders from guests' phones land here within seconds. Accept the first one from a new phone, check allergies, then mark it served. Guests pay at the bar or with their server."}),p?null:(0,b.jsx)(a.Banner,{kind:"demo",title:"Order at the table is off",children:"Managers can switch it on in Settings \u203a Advanced \u203a Order at the table."}),$?(0,b.jsx)(a.Banner,{kind:"success",children:$}):null,(0,b.jsxs)(a.T,{weight:"semibold",children:["Waiting for you to accept (",S.length,")"]}),S.length?S.map(e=>(0,b.jsx)(A,{o:e,held:!0},e.id)):(0,b.jsx)(a.Muted,{children:"Nothing waiting."}),(0,b.jsxs)(a.T,{weight:"semibold",children:["In the kitchen (",y.length,")"]}),y.length?y.map(e=>(0,b.jsx)(A,{o:e,held:!1},e.id)):(0,b.jsx)(a.Muted,{children:"No table orders being made."}),v.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a.T,{weight:"semibold",children:"Served or cancelled"}),v.map(e=>(0,b.jsx)(A,{o:e,held:!1},e.id))]}):null]})};var e,t=_r(d[0]),s=_r(d[1]),l=_r(d[2]),r=(e=l)&&e.__esModule?e:{default:e},a=_r(d[3]),n=_r(d[4]),o=_r(d[5]),i=_r(d[6]),c=_r(d[7]),h=_r(d[8]),u=_r(d[9]),b=_r(d[10]);const j=(e,t)=>{const s=Math.max(0,Math.round((t.getTime()-new Date(e).getTime())/6e4));return s<1?'just now':`${s} min ago`},m=e=>!['served','collected','closed','cancelled'].includes(e.status)},1366,[860,34,102,794,861,867,1148,874,869,821,25]); __d(function(g,_r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.customerCodeLink=y,_e.StaffLoyalty=function({venue:e,canRemove:r=!1,onOpenSettings:u}){const[p,x]=(0,t.useState)(null),[y,b]=(0,t.useState)(''),[S,k]=(0,t.useState)(null),[v,C]=(0,t.useState)(null),[M,T]=(0,t.useState)(!1),[B,R]=(0,t.useState)(''),[P,O]=(0,t.useState)(null),$=(0,c.staffServer)(),L=(0,n.can)('venue.settings'),[N,E]=(0,t.useState)(!1),[D,A]=(0,t.useState)(''),F=async e=>{if(p){E(!0),A('');try{await(0,c.saveSettings)({...p,cardOn:e}),x({...p,cardOn:e,saved:!0});const n=e?'Stamp card switched on':'Stamp card switched off';A(n),s.default.announceForAccessibility?.(n)}catch(e){R((0,o.plainError)(e))}E(!1)}},I=(0,t.useCallback)(()=>{$&&(0,c.readSettings)().then(x).catch(()=>{})},[$]);(0,t.useEffect)(()=>(I(),(0,c.watchLoyalty)(()=>{I(),C(e=>(e&&(0,c.staffCard)(e.id).then(C).catch(()=>{}),e))})),[I]);const _=async(e=y)=>{R('');try{const n=await(0,c.staffFind)(e);k(n),1===n.length&&C(n[0])}catch(e){R((0,o.plainError)(e))}},z=(0,t.useCallback)(e=>{T(!1),b((0,o.prettyCardNo)(e)),_(e)},[]);return $?(0,m.jsxs)(l.default,{style:{gap:10},children:[!p||p.cardOn||L?null:(0,m.jsx)(i.Banner,{kind:"info",title:"The stamp card is off",children:"Ask a manager to switch it on."}),p&&L?(0,m.jsx)(i.Card,{children:(0,m.jsxs)(l.default,{style:{gap:8},testID:"loy-quick",children:[p.cardOn?null:(0,m.jsx)(i.T,{weight:"semibold",children:"The stamp card is off"}),(0,m.jsx)(i.Toggle,{testID:"loy-quick-on",label:"Stamp card on",a11y:"Stamp card on. "+(p.cardOn?'On':'Off'),value:p.cardOn,disabled:N,onChange:e=>{F(e)}}),D?(0,m.jsx)(l.default,{accessibilityLiveRegion:"polite",children:(0,m.jsx)(i.Muted,{children:D})}):null,u?(0,m.jsx)(i.Button,{kind:"ghost",label:"Change the stamp card",testID:"loy-open-settings",onPress:u}):null]})}):null,p&&p.saved?(0,m.jsxs)(i.Muted,{children:[p.stampsNeeded," stamps = ",p.reward||'reward not set',". At most ",p.maxPerDay," a day",p.gapMinutes?`, ${p.gapMinutes} minutes apart`:'',"."]}):null,p&&!p.saved&&L?(0,m.jsxs)(i.Muted,{children:["Suggested settings, not saved yet: ",p.stampsNeeded," stamps = ",p.reward||'reward not set',". At most ",p.maxPerDay," a day",p.gapMinutes?`, ${p.gapMinutes} minutes apart`:'',"."]}):null,(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Find a guest"}),(0,m.jsx)(i.Field,{label:"Name, phone, email or card number",value:y,onChangeText:b,onSubmitEditing:()=>_(),autoCapitalize:"none",testID:"loyalty-search"}),(0,m.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(i.Button,{small:!0,label:"Find",disabled:y.trim().length<2,onPress:()=>_(),testID:"loyalty-find"}),(0,h.canScan)()?(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:M?'Scanning\u2026':'Scan their card',onPress:()=>T(!0)}):null]}),M?(0,m.jsx)(h.CardScanner,{onCard:z,onClose:()=>T(!1)}):null,B?(0,m.jsx)(i.Banner,{kind:"warn",children:B}):null,S&&!S.length?(0,m.jsx)(i.Muted,{children:"No one found. Check the spelling, or sign them up below."}):null,S&&S.length>1?S.map(e=>(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{children:e.name}),(0,m.jsxs)(i.Muted,{children:[(0,o.prettyCardNo)(e.cardNo)," \xb7 ",e.stamps," of ",e.needed,e.phone?` \xb7 ${e.phone}`:'']})]}),e.rewards.length?(0,m.jsx)(i.Badge,{kind:"gold",label:`${e.rewards.length} ready`}):null,(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Open",onPress:()=>C(e)})]},e.id)):null]}),v?(0,m.jsx)(f,{card:v,settings:p,canRemove:r,onChange:e=>{C(e),k(null)},onClose:()=>C(null)}):null,(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Stamp code"}),(0,m.jsx)(i.Muted,{children:"Busy? Make a one-time code and show it to the guest; they type it (or scan it) on their own phone for one stamp."}),P?(0,m.jsx)(j,{c:P,what:"One stamp."}):null,(0,m.jsx)(i.Button,{kind:"secondary",label:P?'Make another code':'Make a stamp code',disabled:!1===p?.cardOn,onPress:()=>{R(''),(0,c.staffCode)('stamp').then(O).catch(e=>R((0,o.plainError)(e)))}})]}),(0,m.jsx)(w,{venue:e,onJoined:e=>{C(e),k(null)}}),(0,m.jsx)(i.Muted,{children:"Tip: search by the last 4 digits of a phone number. Each reward can only be used once, and the card shows who used it and when."})]}):(0,m.jsxs)(l.default,{style:{gap:10},children:[(0,m.jsx)(i.Banner,{kind:"info",title:"Connect to your venue first",children:"The stamp card is saved on your venue's account. Open your invite link on this phone to connect, then you can find guests and add stamps here."}),(0,m.jsx)(i.Muted,{children:"Tip: stamps can only be added by staff of the venue, so a guest can't stamp their own card."})]})};var n=_r(d[0]),t=_r(d[1]),s=e(_r(d[2]));_r(d[3]);var l=e(_r(d[4])),r=_r(d[5]),i=_r(d[6]),o=_r(d[7]),c=_r(d[8]),u=_r(d[9]),h=_r(d[10]),m=_r(d[11]);const p=e=>{try{return new Date(e).toLocaleString('en-GB',{day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})}catch{return e}},x=e=>{try{return new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})}catch{return''}};function y(e){if('undefined'==typeof window||!window.location)return e;const n=window.location.pathname.match(/^(.*?)\/(owner|staff|customer|display|chef)-app(\/|$)/);return new URL(`${n?n[1]:''}/customer-app/index.html?loyalty=${e}`,window.location.origin).toString()}function j({c:e,what:n}){return(0,m.jsxs)(l.default,{style:{gap:4,alignItems:'center'},children:[(0,m.jsx)(i.T,{size:34,weight:"bold",colour:u.colours.gold,center:!0,children:e.code}),(0,m.jsx)(r.QR,{value:y(e.code),size:150}),(0,m.jsxs)(i.Muted,{center:!0,children:[n," Works once, until ",x(e.expiresAt),". The guest types it in Stamp card, or scans this with their phone camera."]})]})}function f({card:e,settings:n,canRemove:s,onChange:r,onClose:h}){const[x,y]=(0,t.useState)(null),[f,w]=(0,t.useState)(!1),[b,S]=(0,t.useState)(null),[k,v]=(0,t.useState)(null),C=async e=>{w(!0),y(null);try{await e()}catch(e){y({kind:'warn',text:(0,o.plainError)(e)})}finally{w(!1),S(null)}};return(0,m.jsxs)(i.Card,{highlight:u.colours.gold,children:[(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.H2,{children:e.name}),(0,m.jsxs)(i.Muted,{children:["Card ",(0,o.prettyCardNo)(e.cardNo),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']})]}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Close",onPress:h})]}),(0,m.jsxs)(i.T,{size:20,weight:"semibold",children:[e.stamps," of ",e.needed," stamps"]}),(0,m.jsxs)(i.Muted,{children:["Next reward: ",e.reward]}),x?(0,m.jsx)(i.Banner,{kind:x.kind,children:x.text}):null,(0,m.jsx)(i.Button,{label:f?'Saving\u2026':'Add a stamp',disabled:f||!1===n?.cardOn,testID:"loyalty-add-stamp",onPress:()=>C(async()=>{const n=await(0,c.staffStamp)(e.id);r(n),y({kind:'success',text:n.newReward?`Stamp added. ${e.name} has earned: ${n.rewards[n.rewards.length-1]?.title??'a reward'}.`:`Stamp added: ${n.stamps} of ${n.needed}.`})})}),!1===n?.cardOn?(0,m.jsx)(i.Muted,{children:"The stamp card is switched off in Settings \u203a Advanced \u203a Loyalty, so no stamps can be added."}):null,e.rewards.length?(0,m.jsx)(i.T,{weight:"semibold",children:"Rewards ready"}):(0,m.jsx)(i.Muted,{children:"No rewards ready yet."}),e.rewards.map(e=>(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{children:e.title}),e.expiresAt?(0,m.jsxs)(i.Muted,{children:["Use by ",p(e.expiresAt)]}):null]}),b===e.id?(0,m.jsxs)(i.Row,{gap:6,children:[(0,m.jsx)(i.Button,{small:!0,label:"Yes, used now",disabled:f,onPress:()=>C(async()=>{const n=await(0,c.staffRedeem)(e.id);r(n),y({kind:'success',text:`${n.redeemed} marked used.`})})}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Not yet",onPress:()=>S(null)})]}):(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Use reward",onPress:()=>S(e.id)})]},e.id)),(0,m.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Sign-in code for their phone",onPress:()=>C(async()=>v(await(0,c.staffCode)('link',e.id)))}),s?'remove'===b?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(i.Button,{small:!0,kind:"danger",label:"Yes, remove their details",onPress:()=>C(async()=>{await(0,c.staffRemove)(e.id),r(null),h()})}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Keep",onPress:()=>S(null)})]}):(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Remove guest",onPress:()=>S('remove')}):null]}),k?(0,m.jsx)(j,{c:k,what:`Opens ${e.name}'s card on their phone.`}):null,'remove'===b?(0,m.jsx)(i.Muted,{children:"Removing wipes their name, phone and email and closes the card (for example if they ask you to delete their data). Counts in the summary stay."}):null,(0,m.jsx)(i.T,{weight:"semibold",children:"Recent"}),e.history.length?e.history.slice(0,8).map((e,n)=>(0,m.jsxs)(i.Muted,{children:[p(e.at)," \xb7 ",e.what]},n)):(0,m.jsx)(i.Muted,{children:"Nothing yet."})]})}function w({venue:e,onJoined:n}){const[s,l]=(0,t.useState)(''),[r,u]=(0,t.useState)(''),[h,p]=(0,t.useState)(''),[x,y]=(0,t.useState)(!1),[j,f]=(0,t.useState)(!1),[w,b]=(0,t.useState)('');return(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Sign a guest up"}),(0,m.jsx)(i.Muted,{children:"Only a name is needed. Read the agreement to the guest and tick it only if they say yes."}),(0,m.jsx)(i.Field,{label:"Guest's name",value:s,onChangeText:l,maxLength:60}),(0,m.jsx)(i.Field,{label:"Phone (optional)",value:r,onChangeText:u,keyboardType:"phone-pad",maxLength:20}),(0,m.jsx)(i.Field,{label:"Email (optional)",value:h,onChangeText:p,keyboardType:"email-address",autoCapitalize:"none",maxLength:120}),(0,m.jsx)(i.Toggle,{label:`The guest agrees: \u201c${(0,o.consentText)(e)}\u201d`,value:x,onChange:y}),w?(0,m.jsx)(i.Banner,{kind:"warn",children:w}):null,(0,m.jsx)(i.Button,{label:j?'Saving\u2026':'Sign up',disabled:j||!x||!s.trim(),onPress:async()=>{f(!0),b('');try{n(await(0,c.staffJoin)({name:s,phone:r,email:h,consent:x,consentText:(0,o.consentText)(e)})),l(''),u(''),p(''),y(!1)}catch(e){b((0,o.plainError)(e))}finally{f(!1)}}})]})}},1367,[988,34,281,236,102,1242,794,1217,1220,821,1368,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"canScan",{enumerable:!0,get:function(){return l}}),_e.CardScanner=function({onCard:t,onClose:n}){const f=(0,e.useRef)(null),[h,w]=(0,e.useState)('');return(0,e.useEffect)(()=>{if(!l())return void w('This browser can\u2019t scan. Type the card number or search by name instead.');let e=!1,n=null,c=null;const o=document.createElement('video');return o.setAttribute('playsinline','true'),o.muted=!0,Object.assign(o.style,{width:'100%',maxWidth:'360px',borderRadius:'12px',border:'2px solid #CFA45F'}),(async()=>{try{if(n=await navigator.mediaDevices.getUserMedia({video:{facingMode:'environment'}}),e)return void n.getTracks().forEach(e=>e.stop());o.srcObject=n,await o.play();const u=f.current;u?.appendChild(o);const l=new(0,window.BarcodeDetector)({formats:['qr_code']}),h=async()=>{if(!e){try{const e=await l.detect(o);for(const n of e){const e=(0,s.readCardQr)(String(n.rawValue??''));if(e)return void t(e)}}catch{}c=setTimeout(h,300)}};h()}catch{w('The camera didn\u2019t start. Allow the camera, or type the card number instead.')}})(),()=>{e=!0,c&&clearTimeout(c),n?.getTracks().forEach(e=>e.stop()),o.remove()}},[t]),(0,u.jsxs)(c.default,{style:{gap:8,alignItems:'center'},children:[(0,u.jsx)(c.default,{ref:f,style:{width:'100%',alignItems:'center'}}),h?(0,u.jsx)(o.Banner,{kind:"warn",children:h}):(0,u.jsx)(o.Muted,{center:!0,children:"Point the camera at the QR on the guest\u2019s card screen."}),(0,u.jsx)(o.Button,{kind:"ghost",label:"Close camera",onPress:n})]})};var e=r(d[0]);r(d[1]);var t,n=r(d[2]),c=(t=n)&&t.__esModule?t:{default:t},o=r(d[3]),s=r(d[4]),u=r(d[5]);const l=()=>'undefined'!=typeof window&&'BarcodeDetector'in window&&!!navigator?.mediaDevices?.getUserMedia},1368,[34,236,102,794,1217,25]); diff --git a/display-app/admin.html b/display-app/admin.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/admin.html +++ b/display-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer.html b/display-app/customer.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer.html +++ b/display-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage.html b/display-app/customer/anchorage.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer/anchorage.html +++ b/display-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/book.html b/display-app/customer/anchorage/book.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer/anchorage/book.html +++ b/display-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/feedback.html b/display-app/customer/anchorage/feedback.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer/anchorage/feedback.html +++ b/display-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/gift.html b/display-app/customer/anchorage/gift.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer/anchorage/gift.html +++ b/display-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/lost.html b/display-app/customer/anchorage/lost.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer/anchorage/lost.html +++ b/display-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/loyalty.html b/display-app/customer/anchorage/loyalty.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer/anchorage/loyalty.html +++ b/display-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/merch.html b/display-app/customer/anchorage/merch.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer/anchorage/merch.html +++ b/display-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/offers.html b/display-app/customer/anchorage/offers.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer/anchorage/offers.html +++ b/display-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/refer.html b/display-app/customer/anchorage/refer.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer/anchorage/refer.html +++ b/display-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/waitlist.html b/display-app/customer/anchorage/waitlist.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer/anchorage/waitlist.html +++ b/display-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/whatson.html b/display-app/customer/anchorage/whatson.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer/anchorage/whatson.html +++ b/display-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/basket.html b/display-app/customer/basket.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer/basket.html +++ b/display-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/profile.html b/display-app/customer/profile.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/customer/profile.html +++ b/display-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/demo.html b/display-app/demo.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/demo.html +++ b/display-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/display.html b/display-app/display.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/display.html +++ b/display-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/index.html b/display-app/index.html index 60b72c88fef9cf9fc9bc70e6533b38e37ae466a9..88ca0cde37c53540cafd549cd35ba342bde8d1cd 100644 --- a/display-app/index.html +++ b/display-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/kitchen.html b/display-app/kitchen.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/kitchen.html +++ b/display-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/owner.html b/display-app/owner.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/owner.html +++ b/display-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/staff.html b/display-app/staff.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/staff.html +++ b/display-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/sw.js b/display-app/sw.js index 362dfaa7c5f25f0de7671fc6c776ead2939ca98c..bf171be8a7f0d8b9103c537c698d7e984cffe5ac 100644 --- a/display-app/sw.js +++ b/display-app/sw.js @@ -1,7 +1,7 @@ // Anchorage Display service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-display-234a10ed7d"; +const V = "cc-display-3a88610e3a"; const BASE = "/display-app/"; -const PRECACHE = ["/display-app/apple-touch-icon.png", "/display-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/display-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/display-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/display-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/display-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/display-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/display-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/display-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/display-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/display-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/display-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/display-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/display-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/display-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/display-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/display-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/display-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/display-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/display-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/display-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/display-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/display-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/display-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/display-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/display-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/display-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/display-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/display-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/display-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/display-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/display-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/display-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/display-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/display-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/display-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/display-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/display-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/display-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/display-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/display-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/display-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/display-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/display-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/display-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/display-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/display-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/display-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/display-app/brand-logo.png", "/display-app/favicon.ico", "/display-app/icon-192.png", "/display-app/icon-512.png", "/display-app/icon-maskable-192.png", "/display-app/icon-maskable-512.png", "/display-app/manifest.webmanifest", "/display-app/index.html", "/display-app/_expo/static/js/web/bundle.js?v=234a10ed7d69d15234af720d8f7e16c13889f22697005d0b7f41fa6daafc015f"]; +const PRECACHE = ["/display-app/apple-touch-icon.png", "/display-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/display-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/display-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/display-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/display-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/display-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/display-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/display-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/display-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/display-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/display-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/display-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/display-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/display-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/display-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/display-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/display-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/display-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/display-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/display-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/display-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/display-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/display-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/display-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/display-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/display-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/display-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/display-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/display-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/display-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/display-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/display-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/display-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/display-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/display-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/display-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/display-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/display-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/display-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/display-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/display-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/display-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/display-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/display-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/display-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/display-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/display-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/display-app/brand-logo.png", "/display-app/favicon.ico", "/display-app/icon-192.png", "/display-app/icon-512.png", "/display-app/icon-maskable-192.png", "/display-app/icon-maskable-512.png", "/display-app/manifest.webmanifest", "/display-app/index.html", "/display-app/_expo/static/js/web/bundle.js?v=3a88610e3a797e953a7c618eede5fdc96e70ab5f12ad3ef5b23c305b34494e59"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/display-app/team.html b/display-app/team.html index f40d78c903d1fca7e6dedee329e44497314dc408..9f82411c74a9d77e45635bff3d4a11e73dcca518 100644 --- a/display-app/team.html +++ b/display-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/index.html b/index.html index 2a78fb1a5c38d75b7be547997f6edcf9e25eacd1..7c861c399d0319845e97280d22084c6565311a7b 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ -Cover Charge: try the apps (v0.3.12.142) +Cover Charge: try the apps (v0.3.12.144) @@ -63,7 +63,7 @@ footer{margin-top:28px;color:var(--muted);font-size:.8rem;text-align:center} Cover Charge logo

covercharge

All in one restaurant booking app

-

Cover Charge: try the apps (v0.3.12.142)

+

Cover Charge: try the apps (v0.3.12.144)

The Anchorage, Harbour View, Dunure

@@ -129,7 +129,7 @@ footer{margin-top:28px;color:var(--muted);font-size:.8rem;text-align:center}
-

Cover Charge v0.3.12.142

+

Cover Charge v0.3.12.144

diff --git a/owner-app/_expo/static/js/web/bundle.js b/owner-app/_expo/static/js/web/bundle.js index ff361abba42253a9a956c01a1e20bf012086c422..3b2e4692b43367e8d9df3c0b23aab4a2c0b923ee 100644 --- a/owner-app/_expo/static/js/web/bundle.js +++ b/owner-app/_expo/static/js/web/bundle.js @@ -6,7 +6,7 @@ var __BUNDLE_START_TIME__=globalThis.nativePerformanceNow?nativePerformanceNow() __d(function(g,r,i,a,m,e,d){"use strict";r(d[0]),r(d[1])},0,[1,19]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";var e,t=_r(d[0]),o=_r(d[1]),a=_r(d[2]),n=_r(d[3]),i=_r(d[4]),c=(e=i)&&e.__esModule?e:{default:e};if(t.PITCH){const e=o.restaurants.find(e=>'anchorage'===e.id);e&&Object.assign(e,{name:n.PITCH_VENUE.name,tagline:n.PITCH_VENUE.tagline,location:n.PITCH_VENUE.location,phone:n.PITCH_VENUE.phone,website:n.PITCH_VENUE.website,hoursNote:'Kitchen (food) hours. The closing time is last food orders.',fictional:!1}),e&&(e.settings={...e.settings,whatsapp:'07700 900123'});for(const e of c.default.areas)delete e.best;for(let e=a.ROSTER.length-1;e>=0;e--){const t=n.PITCH_TEAM[a.ROSTER[e].id];t?(Object.assign(a.ROSTER[e],{name:t.name,job:t.job,hourlyPence:t.hourlyPence,...t.dept?{dept:t.dept}:{},...null!=t.salaried?{salaried:t.salaried}:{}}),delete a.ROSTER[e].nickname):a.ROSTER.splice(e,1)}if('undefined'!=typeof document){const e=t=>{if(3===t.nodeType){const e=t.nodeValue??'',o=(0,n.pitchText)(e);return void(o!==e&&(t.nodeValue=o))}if(1!==t.nodeType)return;const o=t;if('INPUT'===o.tagName||'TEXTAREA'===o.tagName){const e=o,t=(0,n.pitchText)(e.value);t!==e.value&&(e.value=t);const a=e.getAttribute('placeholder');if(a){const t=(0,n.pitchText)(a);t!==a&&e.setAttribute('placeholder',t)}}for(const e of['aria-label','title']){const t=o.getAttribute(e);if(t){const a=(0,n.pitchText)(t);a!==t&&o.setAttribute(e,a)}}o.childNodes.forEach(e)},t=()=>{e(document.body),document.title=(0,n.pitchText)(document.title),new MutationObserver(t=>{for(const o of t)'characterData'===o.type?e(o.target):o.addedNodes.forEach(e),'attributes'===o.type&&e(o.target);document.title=(0,n.pitchText)(document.title)}).observe(document.body,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:['value','placeholder','aria-label']}),document.addEventListener('input',e=>{e.target},!0)};document.body?t():document.addEventListener('DOMContentLoaded',t)}}},1,[2,3,15,17,18]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PITCH",{enumerable:!0,get:function(){return n}});const n=(['anchorage','souters','kirkmichael','wildings','kirkton','abbotsford','greenside',"3idiots","cecchinis","mrbasrais","yasmins","williewastles","rupeeroom","smokinggoat","pizzaioli","drunkencoo"].includes("anchorage"),!1)},2,[]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return t.GREENSIDE_RESTAURANT}}),Object.defineProperty(e,"ABBOTSFORD_RESTAURANT",{enumerable:!0,get:function(){return n.ABBOTSFORD_RESTAURANT}}),Object.defineProperty(e,"KIRKTON_RESTAURANT",{enumerable:!0,get:function(){return o.KIRKTON_RESTAURANT}}),Object.defineProperty(e,"WILDINGS_RESTAURANT",{enumerable:!0,get:function(){return s.WILDINGS_RESTAURANT}}),Object.defineProperty(e,"KIRKMICHAEL_RESTAURANT",{enumerable:!0,get:function(){return c.KIRKMICHAEL_RESTAURANT}}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return R}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);const u={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:16,bookingSlotMinutes:15,deposit:{...r(d[6]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},h={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},f={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},b={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},p=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:f,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...u,orderAtTable:!1,pay:h,cashUpRecord:[...l.ANCHORAGE_CASH_UP]},sections:[]},{id:'saltmarsh',name:'The Venue',tagline:'FICTIONAL demo restaurant \u2014 shows multi-tenancy',location:'Port Ailsa (fictional town)',fictional:!0,kitchenHours:{0:['12:00','20:00'],1:['12:00','20:00'],2:['12:00','20:00'],3:['12:00','20:00'],4:['12:00','21:00'],5:['12:00','21:00'],6:['12:00','21:00']},settings:{...u,slotCap:4,stampTarget:6,stampReward:'Free side',capacityPerHour:30},sections:['Small plates','Mains','Puddings']},{id:'brae',name:'Brae Bakehouse',tagline:'FICTIONAL demo caf\xe9 \u2014 shows multi-tenancy',location:'Kilbrae (fictional village)',fictional:!0,kitchenHours:{0:['09:00','16:00'],1:['09:00','16:00'],2:['09:00','16:00'],3:['09:00','16:00'],4:['09:00','16:00'],5:['09:00','20:00'],6:['09:00','20:00']},settings:{...u,slotCap:5,slotMinutes:15,stampTarget:10,stampReward:'Free coffee & cake',capacityPerHour:24,bookingCoversPerSlot:10},sections:['Bakes','Lunch','Hot drinks']}],A={by:'Fictional demo',at:'2026-10-26'},T=(t,n,o,s,c,l,u,h,f=[])=>({id:n,restaurantId:t,section:o,name:s,description:c,price:l,allergens:u,prepMins:h,dietary:f,soldOut:!1,signOff:A}),R=[T('saltmarsh','s-beets','Small plates','Roast beetroot & whipped feta','Fictional dish for the demo.',750,{milk:'contains',treenuts:'may'},6,['V']),T('saltmarsh','s-squid','Small plates','Salt & pepper squid','Fictional dish for the demo.',850,{molluscs:'contains',gluten:'contains'},7),T('saltmarsh','s-hake','Mains','Pan-roast hake, mussel broth','Fictional dish for the demo.',1950,{fish:'contains',molluscs:'contains',milk:'contains',celery:'contains'},15),T('saltmarsh','s-risotto','Mains','Wild mushroom risotto','Fictional dish for the demo.',1600,{milk:'contains',celery:'contains',sulphites:'contains'},16,['V']),T('saltmarsh','s-cranachan','Puddings','Cranachan','Fictional dish for the demo.',700,{milk:'contains',gluten:'contains'},3,['V']),T('brae','b-scone','Bakes','Cheese scone','Fictional dish for the demo.',350,{gluten:'contains',milk:'contains',eggs:'contains'},2,['V']),T('brae','b-caramel','Bakes','Millionaire\u2019s shortbread','Fictional dish for the demo.',300,{gluten:'contains',milk:'contains',soya:'may'},1,['V']),T('brae','b-toastie','Lunch','Ham & mustard toastie','Fictional dish for the demo.',750,{gluten:'contains',milk:'contains',mustard:'contains'},6),T('brae','b-soup','Lunch','Lentil soup & bread','Fictional dish for the demo.',600,{gluten:'contains',celery:'contains'},4,['VG']),T('brae','b-flat','Hot drinks','Flat white','Fictional dish for the demo.',330,{milk:'contains'},2,['V'])]},3,[4,8,9,10,12,13,14]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return t.GREENSIDE_RESTAURANT}}),Object.defineProperty(e,"ABBOTSFORD_RESTAURANT",{enumerable:!0,get:function(){return n.ABBOTSFORD_RESTAURANT}}),Object.defineProperty(e,"KIRKTON_RESTAURANT",{enumerable:!0,get:function(){return o.KIRKTON_RESTAURANT}}),Object.defineProperty(e,"WILDINGS_RESTAURANT",{enumerable:!0,get:function(){return s.WILDINGS_RESTAURANT}}),Object.defineProperty(e,"KIRKMICHAEL_RESTAURANT",{enumerable:!0,get:function(){return c.KIRKMICHAEL_RESTAURANT}}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return R}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);const u={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:20,bookingSlotMinutes:15,deposit:{...r(d[6]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},h={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},f={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},b={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},p=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:f,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...u,orderAtTable:!1,pay:h,cashUpRecord:[...l.ANCHORAGE_CASH_UP],bookingCoversPerStart:15,bookingPartiesPerStart:4,onlinePartyMin:1,onlinePartyMax:8,bookingNoticeMins:15,autoAcceptUpTo:8},sections:[]},{id:'saltmarsh',name:'The Venue',tagline:'FICTIONAL demo restaurant \u2014 shows multi-tenancy',location:'Port Ailsa (fictional town)',fictional:!0,kitchenHours:{0:['12:00','20:00'],1:['12:00','20:00'],2:['12:00','20:00'],3:['12:00','20:00'],4:['12:00','21:00'],5:['12:00','21:00'],6:['12:00','21:00']},settings:{...u,slotCap:4,stampTarget:6,stampReward:'Free side',capacityPerHour:30},sections:['Small plates','Mains','Puddings']},{id:'brae',name:'Brae Bakehouse',tagline:'FICTIONAL demo caf\xe9 \u2014 shows multi-tenancy',location:'Kilbrae (fictional village)',fictional:!0,kitchenHours:{0:['09:00','16:00'],1:['09:00','16:00'],2:['09:00','16:00'],3:['09:00','16:00'],4:['09:00','16:00'],5:['09:00','20:00'],6:['09:00','20:00']},settings:{...u,slotCap:5,slotMinutes:15,stampTarget:10,stampReward:'Free coffee & cake',capacityPerHour:24,bookingCoversPerSlot:10},sections:['Bakes','Lunch','Hot drinks']}],A={by:'Fictional demo',at:'2026-10-26'},T=(t,n,o,s,c,l,u,h,f=[])=>({id:n,restaurantId:t,section:o,name:s,description:c,price:l,allergens:u,prepMins:h,dietary:f,soldOut:!1,signOff:A}),R=[T('saltmarsh','s-beets','Small plates','Roast beetroot & whipped feta','Fictional dish for the demo.',750,{milk:'contains',treenuts:'may'},6,['V']),T('saltmarsh','s-squid','Small plates','Salt & pepper squid','Fictional dish for the demo.',850,{molluscs:'contains',gluten:'contains'},7),T('saltmarsh','s-hake','Mains','Pan-roast hake, mussel broth','Fictional dish for the demo.',1950,{fish:'contains',molluscs:'contains',milk:'contains',celery:'contains'},15),T('saltmarsh','s-risotto','Mains','Wild mushroom risotto','Fictional dish for the demo.',1600,{milk:'contains',celery:'contains',sulphites:'contains'},16,['V']),T('saltmarsh','s-cranachan','Puddings','Cranachan','Fictional dish for the demo.',700,{milk:'contains',gluten:'contains'},3,['V']),T('brae','b-scone','Bakes','Cheese scone','Fictional dish for the demo.',350,{gluten:'contains',milk:'contains',eggs:'contains'},2,['V']),T('brae','b-caramel','Bakes','Millionaire\u2019s shortbread','Fictional dish for the demo.',300,{gluten:'contains',milk:'contains',soya:'may'},1,['V']),T('brae','b-toastie','Lunch','Ham & mustard toastie','Fictional dish for the demo.',750,{gluten:'contains',milk:'contains',mustard:'contains'},6),T('brae','b-soup','Lunch','Lentil soup & bread','Fictional dish for the demo.',600,{gluten:'contains',celery:'contains'},4,['VG']),T('brae','b-flat','Hot drinks','Flat white','Fictional dish for the demo.',330,{milk:'contains'},2,['V'])]},3,[4,8,9,10,12,13,14]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_UUID",{enumerable:!0,get:function(){return n.GREENSIDE_UUID}}),Object.defineProperty(e,"GREENSIDE_BOOKING_PHONE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"GREENSIDE_VENUE_HOURS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"GREENSIDE_KITCHEN_HOURS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return u}});var n=r(d[0]);const t='tel:01655889685',o={0:['10:00','00:00'],1:null,2:null,3:['10:00','23:00'],4:['10:00','23:00'],5:['10:00','00:00'],6:['10:00','00:00']},s={0:['10:00','20:00'],1:null,2:null,3:['10:00','20:00'],4:['10:00','20:00'],5:['10:00','21:00'],6:['10:00','21:00']},u={id:'greenside',name:'The Greenside Restaurant',tagline:'Restaurant \xb7 Wood Fired Pizza \xb7 Maybole',location:'5 Greenside, Maybole, South Ayrshire KA19 7DG',address:'5 Greenside, Maybole, South Ayrshire KA19 7DG',phone:'01655 889685',email:'info@thegreensiderestaurant.co.uk',emailNeedsConfirmation:!0,website:'thegreensiderestaurant.co.uk',fictional:!1,cashOnly:!0,kitchenHours:s,venueHours:o,hoursNote:'Closed Monday and Tuesday. Venue Wednesday and Thursday 10:00\u201323:00, Friday to Sunday 10:00\u201300:00. Kitchen Wednesday, Thursday and Sunday 10:00\u201320:00; Friday and Saturday 10:00\u201321:00. Cash only.',sections:[],settings:{slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!0,bookingCoversPerSlot:0,stampTarget:8,stampReward:'',stampMinSpend:0,capacityPerHour:0,walkInShare:0,turnMins:75,orderAtTable:!1,showTakeaway:!1,shortName:'The Greenside',reserveStock:!1,tableRequests:!0,deposit:{on:!1,perPersonPence:null,fromParty:null,refundable:null,cutoffHours:null,needsConfirmation:!0,wixLinksOn:!1,policy:'Deposit policy needs confirmation. Deposits and payments are off. Requests need a manager to confirm.'}}}},4,[5]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VENUE_RID",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ISOLATED_VENUE_IDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"IS_GREENSIDE",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"GREENSIDE_UUID",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"IS_ABBOTSFORD",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ABBOTSFORD_UUID",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"IS_KIRKTON",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"KIRKTON_UUID",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"IS_QUEUED_VENUE",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"IS_SOUTERS",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"IS_WILDINGS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"IS_KIRKMICHAEL",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"IS_ISOLATED_VENUE",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"SOUTERS_UUID",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"KIRKMICHAEL_UUID",{enumerable:!0,get:function(){return U}}),Object.defineProperty(e,"WILDINGS_UUID",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"VENUE_UUID",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"venueKey",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"venueIdentityAllowed",{enumerable:!0,get:function(){return D}});var n=r(d[0]);const t="anchorage".toLowerCase().replace(/[^a-z0-9-]/g,'')||'anchorage',c={"3idiots":"59766322-119e-4036-a18a-f6909f60a8d2",cecchinis:"596c6f7e-9797-4e16-84fe-db4a99fa1bdc",mrbasrais:"5d500571-e205-4ead-bb58-60e986b6f40e",yasmins:"f43f20ad-55d0-4008-88c8-7738dc1698df",williewastles:"6abc2793-93ab-4e23-a705-b4011a5cc011",rupeeroom:"78bff97d-5f07-440a-bb99-f6a6118da7a3",smokinggoat:"cd985ff5-2443-458d-ac8b-342d553628cf",pizzaioli:"35f870fc-772c-4aad-bb9e-09a9a16bc925",drunkencoo:"f500ef12-b405-438b-9671-e54289bec5dd",abbotsford:'24624ea5-d1e3-4182-b0d1-73402b8a1532',kirkton:'e0afad1d-cbc1-414a-add6-92e47d302139',greenside:'1bc2a056-2ef6-4585-abfd-b7d21c84f215',souters:'41ce63ca-ae46-432d-a5ba-25e1b801e64d',kirkmichael:'43c8da91-b8b8-4ce9-9ab7-f00c84c5f4f6',wildings:'47f86b36-4c99-466a-be9c-30eb3d79f1e1'},b='greenside'===t,u=c.greenside,f='abbotsford'===t,o=c.abbotsford,l='kirkton'===t,s=c.kirkton,I=(0,n.isQueuedVenue)(t),O='souters'===t,p='wildings'===t,y='kirkmichael'===t,E=Object.prototype.hasOwnProperty.call(c,t),_=c.souters,U=c.kirkmichael,S=c.wildings,j=c[t],P=n=>E?`cc-venue:${t}:${n}`:n,D=(c,b)=>!E||c===j&&b===(0,n.queuedDatabaseSlug)(t)},5,[6]); __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"queuedVenues",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"isQueuedVenue",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"queuedDatabaseSlug",{enumerable:!0,get:function(){return o}}),_e.queuedRestaurant=function(e){const t=n[e];if(!t)throw Error('Unknown venue');const s=t.kitchenSessionsByDay??t.hours.sessionsByDay,o=Object.fromEntries(Array.from({length:7},(e,t)=>[t,s?.[t]?.length?[s[t][0][0],s[t][s[t].length-1][1]]:null]));return{id:e,name:t.name,location:t.address,address:t.address,phone:t.phone||'',email:t.email||'',website:t.website||'',fictional:!1,tagline:'Restaurant',kitchenHours:o,...s?{kitchenSessionsByDay:s}:{},hoursNeedsConfirmation:!0,hoursNote:t.hours.note,sections:[],settings:{slotMinutes:15,slotCap:0,bufferMins:0,leadMins:0,takeawayPaused:!0,bookingCoversPerSlot:0,stampTarget:0,stampReward:'',stampMinSpend:0,capacityPerHour:0,walkInShare:0,turnMins:0,orderAtTable:!1,showTakeaway:!1,shortName:t.name,reserveStock:!1,tableRequests:!0,deposit:{on:!1,perPersonPence:null,fromParty:null,refundable:null,cutoffHours:null,needsConfirmation:!0,wixLinksOn:!1,policy:'Deposit terms to confirm. No payment is taken for requests.'}}}};var e,t=r(d[0]);const n=((e=t)&&e.__esModule?e:{default:e}).default,s=e=>Object.prototype.hasOwnProperty.call(n,e),o=e=>s(e)?n[e].databaseSlug:e},6,[7]); @@ -1092,7 +1092,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},1009,[34,1010]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},1010,[1007,978,1011]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},1011,[1007]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.142'},1012,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.144'},1012,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:h}=await r.select();c&&s(c,h);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},h='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,h.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),h}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),h={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:h})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},1013,[1014,1015,934,978,1010]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},1015,[978]); @@ -1193,11 +1193,11 @@ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{ __d(function(_g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.saveBookingTables=$,_e.TablePicker=function({rid:e,booking:u,name:p,turnBase:k=90,onClose:v,onSaved:w,onPickOnPlan:T}){const C=(0,b.usePlan)(e),L=(0,c.useBookings)(e),[S,W]=(0,t.useState)(()=>(0,b.tablesOf)((0,h.tableKey)((0,b.tablesOf)(u.table)))),P=(0,t.useMemo)(()=>(0,h.pickGroups)(C),[C]),z=L.filter(e=>e.date===u.date),O=(0,h.seatsOf)(C,S),D=(0,h.seatLine)(O.total,u.partySize),I=(0,h.pickClashes)(u,S,z,k),B=e=>(0,h.pickClashes)(u,[e],z,k)[0]?.with,M=(0,h.tableKey)(S)!==(0,h.tableKey)((0,b.tablesOf)(u.table)),N=(0,f.useBlocks)(e=>e.blocks),R=(0,f.blockAt)(N,e,u.date,u.time),_=e=>W(s=>(0,h.toggleTable)(s,e)),Y=async s=>{try{await $(e,u,s),w?.((0,h.savedWords)(p,u.partySize,s,(0,h.seatsOf)(C,s).total)),v()}catch(e){w?.(`Couldn\u2019t save tables for ${p}: ${String(e?.message??e).slice(0,120)}`)}},G=(0,x.jsxs)(n.default,{style:{gap:8},children:[(0,x.jsxs)(n.default,{testID:"table-pick-total",accessible:!0,accessibilityLabel:`${(0,h.tablesWords)(S)} picked. ${D.text}.`,children:[(0,x.jsx)(y.T,{size:18,weight:"semibold",colour:g.colours.goldLight,children:(0,h.tablesWords)(S)}),(0,x.jsx)(y.T,{size:17,colour:g.colours.text,children:D.text})]}),R?(0,x.jsx)(n.default,{testID:"table-pick-pause",accessible:!0,accessibilityLabel:`Note. New bookings are paused ${R.from} to ${R.to}${R.reason?` (${R.reason})`:''}. You can still assign tables to this booking.`,style:{padding:10,borderRadius:10,borderWidth:1,borderColor:g.colours.goldMuted},children:(0,x.jsxs)(y.T,{size:16,colour:g.colours.goldLight,children:["New bookings paused ",R.from,"\u2013",R.to,R.reason?` \xb7 ${R.reason}`:'',". You can still save tables for this booking."]})}):null,I.length?(0,x.jsx)(n.default,{testID:"table-pick-clash",accessible:!0,accessibilityLabel:`Warning. ${(0,h.clashWords)(I)} You can still save.`,style:{padding:10,borderRadius:10,borderWidth:1,borderColor:g.colours.gold},children:(0,x.jsxs)(y.T,{size:16,weight:"semibold",colour:g.colours.goldLight,children:[(0,h.clashWords)(I)," You can still save."]})}):null,(0,x.jsxs)(y.Row,{gap:8,wrap:!0,children:[(0,x.jsx)(y.Button,{testID:"table-pick-save",label:I.length?'Save anyway':'Save tables',disabled:!M||!S.length,accessibilityLabel:`${I.length?'Save anyway, ':'Save, '}${(0,h.tablesWords)(S)} for ${p}. ${D.text}.${I.length?` ${(0,h.clashWords)(I)}`:''}`,onPress:()=>Y(S),style:[j,{flexGrow:1}]}),(0,b.tablesOf)(u.table).length?(0,x.jsx)(y.Button,{testID:"table-pick-clear",kind:"secondary",label:"Clear table",accessibilityLabel:`Clear table, take ${(0,h.tablesWords)((0,b.tablesOf)(u.table)).toLowerCase()} off ${p}`,onPress:()=>Y([]),style:j}):null,(0,x.jsx)(y.Button,{testID:"table-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",onPress:v,style:j})]})]});return(0,x.jsxs)(y.Sheet,{visible:!0,onClose:v,title:`Tables \xb7 ${u.time} ${p} \xb7 ${u.partySize} Covers`,maxWidth:760,testID:"table-picker",footer:G,children:[(0,x.jsx)(s.TableNumberWarning,{plan:C}),(0,x.jsx)(y.T,{size:16,colour:g.colours.text,children:"Tap one table, or several to join them. Tap again to take one off."}),T?(0,x.jsx)(y.Button,{kind:"secondary",testID:"table-pick-on-plan",label:"Pick on the table plan",accessibilityLabel:`Pick on the table plan instead, for ${p}`,onPress:()=>T(S),style:j}):null,P.map(e=>(0,x.jsxs)(n.default,{style:{gap:6},accessibilityLabel:e.area,children:[(0,x.jsx)(y.T,{size:15,weight:"semibold",colour:g.colours.gold,children:e.area}),(0,x.jsx)(y.Row,{gap:8,wrap:!0,children:e.tables.map(e=>{const s=S.includes(e.name),t=B(e.name);return(0,x.jsxs)(o.default,{testID:`table-pick-${e.name}`,accessibilityRole:"checkbox",accessibilityState:{checked:s},'aria-checked':s,accessibilityLabel:(0,h.pickA11y)(e.name,e.seats,s,t),onPress:()=>_(e.name),style:({pressed:e})=>({minWidth:92,minHeight:64,paddingHorizontal:10,paddingVertical:6,borderRadius:12,alignItems:'center',justifyContent:'center',borderWidth:s?2:1,borderColor:s?g.colours.gold:t?g.colours.goldMuted:g.colours.hairline,borderStyle:t&&!s?'dashed':'solid',backgroundColor:s?g.colours.gold:e?g.colours.tilePressed:g.colours.tile}),children:[(0,x.jsx)(y.T,{size:18,weight:"semibold",colour:s?g.colours.onGold:g.colours.text,children:(0,l.tableNumbers)(e.name)}),(0,x.jsxs)(y.T,{size:14,colour:s?g.colours.onGold:g.colours.muted,children:[e.seats," seats",t?' \xb7 booked':'']})]},e.name)})})]},e.area)),P.length?null:(0,x.jsx)(y.Muted,{children:"No tables on the plan yet. Add them in Setup \u203a Table plan."})]})};var s=r(d[0]),l=r(d[1]),t=r(d[2]),o=e(r(d[3])),n=e(r(d[4])),c=r(d[5]),b=r(d[6]),u=r(d[7]),h=r(d[8]),g=r(d[9]),p=r(d[10]),y=r(d[11]),k=r(d[12]),f=r(d[13]),x=r(d[14]);const j={minHeight:56};async function $(e,s,l){const t=(0,h.tableKey)(l),o=(0,b.tablesOf)(s.table);await c.repo.bookings.update(s.id,(0,u.tablePatch)(t||null)),'seated'===s.status&&s.date===(0,p.venueYmd)(new Date)&&(o.filter(e=>!(0,b.tablesOf)(t).includes(e)).forEach(s=>b.useFloor.getState().setLive(e,s,{stage:void 0,dirty:!0})),t&&(0,k.resetTableLive)(e,t))}},1110,[1111,860,34,402,102,874,1021,1109,1112,821,858,794,1113,1018,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.TableNumberWarning=function({plan:u}){const c=(0,n.numberClashes)(u.tables),o=[...new Set([...c.acrossAreas,...u.tables.filter(n=>c.sameArea.has(n.name)).map(n.tableNumber)])];return o.length?(0,l.jsxs)(t.T,{testID:"duplicate-table-numbers",size:16,colour:s.colours.goldLight,children:["Duplicate table numbers: ",o.join(', '),". Kept unchanged. Ask a manager to check the areas before assigning."]}):null},r(d[0]);var n=r(d[1]),s=r(d[2]),t=r(d[3]),l=r(d[4])},1111,[34,859,821,794,25]); __d(function(_g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"byNum",{enumerable:!0,get:function(){return s}}),e.tableKey=o,e.toggleTable=function(t,n){return t.includes(n)?t.filter(t=>t!==n):a(o([...t,n]))},e.seatsOf=function(t,n){const a={};for(const s of n)a[s]=t.tables.find(t=>t.name===s)?.maxSeats??0;return{per:a,total:Object.values(a).reduce((t,n)=>t+n,0)}},e.seatLine=function(t,n){const a=Math.max(0,n-t);return{text:`${t} ${1===t?'seat':'seats'} for ${l(n)}${a?`: ${a} short`:''}`,short:a,fits:0===a&&t>0}},e.pickClashes=function(t,l,u,c=90){if(!l.length)return[];const f={...t,table:o(l)},b=[];for(const s of u)if(s.id!==t.id&&s.date===t.date&&!['cancelled','noshow','finished'].includes(s.status)&&(0,n.startOf)(f)<(0,n.endOf)(s,c)&&(0,n.startOf)(s)<(0,n.endOf)(f,c))for(const t of a(s.table))l.includes(t)&&b.push({table:t,with:s});return b.sort((t,n)=>s(t.table,n.table))},e.clashWords=function(n){return n.map(n=>`${(0,t.tableNumbers)(n.table)} has ${n.with.walkIn?'a walk-in':(n.with.name||'a booking').replace(' (example)','')} at ${n.with.time}`).join('. ')+(n.length?'.':'')},e.tablesWords=u,e.pickA11y=function(n,a,s,l){return`Table ${(0,t.tableNumbers)(n)}, ${a} ${1===a?'seat':'seats'}${s?', selected':''}${l?`, has ${l.walkIn?'a walk-in':l.name} at ${l.time}`:''}`},e.pickGroups=function(t){return t.areas.map(n=>({area:n.name,tables:t.tables.filter(t=>t.areaId===n.id).map(t=>({name:t.name,seats:t.maxSeats})).sort((t,n)=>s(t.name,n.name))})).filter(t=>t.tables.length)},e.savedWords=function(t,n,a,s){return a.length?`${t}, ${l(n)}: ${u(a)} (${s} seats).`:`${t}: table taken off.`},e.tableActions=function(t,n){const s=a(t.table);if(['cancelled','noshow'].includes(t.status))return[];const o=[s.length?{id:'assign',label:'Change table',a11y:`Change table for ${n}, ${l(t.partySize)}, now ${u(s).toLowerCase()}. You can pick several tables to join.`}:{id:'assign',label:'Assign table',a11y:`Assign table for ${n}, ${l(t.partySize)}. You can pick several tables to join.`}];s.length&&o.push({id:'clear',label:'Clear table',a11y:`Clear table for ${n}, take ${u(s).toLowerCase()} off this booking`});return o},e.dragTables=function(t,n,s){if(!s||'__none'===s||s===n)return null;const l=a(t);if(l.includes(s))return null;return o('__none'!==n&&l.includes(n)?l.map(t=>t===n?s:t):[s])};var t=r(d[0]),n=r(d[1]);const a=t=>t?t.split('+').map(t=>t.trim()).filter(Boolean):[],s=(t,n)=>t.localeCompare(n,'en-GB',{numeric:!0}),l=t=>`${t} ${1===t?'person':'people'}`;function o(t){return[...new Set(t.map(t=>String(t).trim()).filter(Boolean))].sort(s).join('+')}function u(n){const s=a(o(n));return s.length?(0,t.tableListNumbers)(s):'No table'}},1112,[860,1095]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return O}}),_e.useTableNames=N,_e.resetTableLive=M,_e.seatBookingNow=F,_e.finishBookingNow=async function(e,t){await f.repo.bookings.setStatus(t.id,'finished'),(0,S.tablesOf)(t.table).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=L,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return R}}),_e.TablePicker=W,_e.WalkInSheet=E,_e.WalkInMatchPrompt=H,_e.AssignTableSheet=_,_e.undoNotice=Y,_e.NewBookingSheet=U,_e.useFrontDoor=function(e,t){const[s,o]=(0,r.useState)(!1),[l,a]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>d({b:e}),combineTables:e=>d({b:e,combine:!0}),elements:(0,B.jsxs)(B.Fragment,{children:[s?(0,B.jsx)(E,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,B.jsx)(U,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,n.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,x.niceDate)((0,x.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,B.jsx)(_,{booking:i.b,combine:i.combine,onClose:()=>d(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=e(r),u=_r(_d[8]),c=e(_r(_d[9])),b=e(_r(_d[10])),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),w=_r(_d[18]),T=_r(_d[19]),S=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),D=_r(_d[23]),I=_r(_d[24]),$=_r(_d[25]),P=_r(_d[26]),z=_r(_d[27]),B=_r(_d[28]);const O=Array.from({length:12},(e,t)=>String(t+1));function N(e){const t=(0,S.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function M(e,t){(0,S.tablesOf)(t).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}async function F(e,t){await f.repo.bookings.setStatus(t.id,'seated'),M(e,t.table)}function L(e,t){const s=(0,f.useBookings)(e),o=(0,f.useOrders)(e),l=N(e),a=(0,S.useFloor)(t=>t.live[e])??{},i=(0,S.usePlan)(e),n=(0,v.useBlocks)(e=>e.blocks),r=(0,x.ymd)(t),d=(0,v.closedAreasAt)(n,e,r,(0,x.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,S.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,x.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const R=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function W({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:d}){const u=Object.keys(e),[h,p]=(0,r.useState)(0),f=i?6:8,y=i?64:o?92:76,k=h?Math.max(3,Math.floor((h+f)/(y+f))):0,x=k?Math.floor((h-f*(k-1))/k):y,w=new Set(n??[]),v=a?(0,S.tablesOf)(a)[0]:null;return(0,B.jsx)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:f},testID:"table-picker",onLayout:e=>p(Math.floor(e.nativeEvent.layout.width)),children:u.map(o=>{const a=e[o],n=t===o||!!d?.includes(o),r=w.has(o),u=v===o&&!n,h=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,B.jsxs)(c.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${d?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${r?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:x,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?j.colours.gold:a.busy?j.colours.red:j.colours.ok,backgroundColor:n?j.colours.goldTint:a.busy?j.colours.redBg:j.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,B.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,B.jsx)(T.T,{weight:"bold",size:22,colour:n?j.colours.goldLight:j.colours.text,children:(0,l.tableNumbers)(o)}),r?(0,B.jsx)(b.default,{testID:"best-table",style:{backgroundColor:j.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,B.jsx)(T.T,{size:11,weight:"bold",colour:j.colours.onGold,children:"BEST"})}):null]}),(0,B.jsx)(T.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:h})]},o)})})}const A=[1,2,3,4,5,6,7,8];function E({onClose:e,onSeated:a,wide:i,initialTable:y}){const{rid:w,r:C,now:D}=(0,p.useCtx)(15e3),I=L(w,D),[$,P]=(0,r.useState)(2),[O,N]=(0,r.useState)(!1),[R,E]=(0,r.useState)(y??null),_=(0,S.usePlan)(w),Y=(0,f.useBookings)(w),U=(0,v.useBlocks)(e=>e.blocks),q=(0,v.closedAreasAt)(U,w,(0,x.ymd)(D),(0,x.hm)(D)),Q=d.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(_,Y.filter(e=>e.date===(0,x.ymd)(D)),e,$,D,(0,k.turnFor)($,C.settings.turnMins),90,void 0,{closed:q})?.table??null},[_,Y,I,$,q.size,D.getTime()]);(0,r.useEffect)(()=>{R&&(0,S.tablesOf)(R).some(e=>'Closed'===I[e]?.label)&&E(null)},[R,q.size]);const[V,G]=(0,r.useState)(!1),[K,X]=(0,r.useState)(''),J=(e,t=String(e),s=()=>{N(!1),P(e)})=>{const o='9+'===t?O:!O&&$===e;return(0,B.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?j.colours.gold:'transparent'},children:(0,B.jsx)(T.T,{weight:"bold",size:22,colour:o?j.colours.onGold:j.colours.gold,children:t})},t)},Z=(0,B.jsx)(s.PartySizeInput,{value:$,onChange:P,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),ee=(0,B.jsxs)(b.default,{style:{gap:8,width:i?256:void 0},children:[(0,B.jsx)(T.T,{weight:"semibold",children:"How many people?"}),(0,B.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[A.map(e=>J(e)),J(9,'9+',()=>{N(!0),P(e=>e>=9?e:9)})]}),O?Z:null]}),[te,se]=(0,r.useState)(!1),[oe,le]=(0,r.useState)(null),ae=async(t=R,s=!1)=>{if(!te){if(!s){const e=(0,z.bookingsNearWalkIn)(Y,D,$);if(e.length)return void le({at:t,list:e})}se(!0);try{const s=await f.repo.bookings.seatWalkIn(w,$,t??void 0,K);M(w,t??void 0),a(s),e()}finally{se(!1)}}},ie=async(t,s)=>{if(!te){se(!0);try{const o=s??t.table??null;o&&o!==t.table&&await f.repo.bookings.assignTable(t.id,o),await F(w,{...t,table:o??void 0}),(0,n.notify)({id:`seated:${t.id}`,testID:'walkin-match-toast',timeoutMs:5e3,icon:'\u2713',title:`${t.name} seated \xb7 ${t.partySize} \xb7 ${o?(0,l.tableNumbers)(o):'table to assign'} (booking ${t.ref})`}),le(null),e()}finally{se(!1)}}},ne=(0,B.jsxs)(b.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,B.jsxs)(T.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(T.T,{weight:"semibold",children:["Table ",(0,B.jsx)(T.T,{colour:j.colours.muted,size:14,children:"(optional)"})]}),R?(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>E(null)}):null]}),(0,B.jsx)(W,{use:I,value:R,onPick:e=>{I[e]&&!I[e].busy?ae(e):E(R===e?null:e)},big:i,dense:i,best:Q,bestSet:(0,u.bestTables)(_)}),(0,B.jsxs)(T.Muted,{children:["Tap a free table to seat them there",Q&&!R?` (suggested for ${$}: ${(0,l.tableNumbers)(Q)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,x.hm)(D)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,B.jsx)(T.Button,{label:`Seat walk-in \xb7 ${$} ${1===$?'person':'people'}${R?` \xb7 ${(0,l.tableNumbers)(R)}`:''}`,disabled:te,onPress:()=>{ae()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,B.jsxs)(T.Row,{gap:16,style:{alignItems:'flex-start'},children:[ee,ne]}):(0,B.jsxs)(B.Fragment,{children:[ee,ne]}),(0,B.jsxs)(T.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[V?(0,B.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:K,onChangeText:X,style:[T.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>G(!0)}),(0,B.jsx)(b.default,{style:{flex:1,minWidth:220},children:(0,B.jsxs)(T.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==h.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]}),oe?(0,B.jsx)(H,{list:oe.list,busy:te,onYes:e=>{ie(e,oe.at)},onNo:()=>{const e=oe.at;le(null),ae(e,!0)},onClose:()=>le(null)}):null]})}function H({list:e,busy:t,onYes:s,onNo:o,onClose:a}){return(0,B.jsx)(T.Sheet,{visible:!0,onClose:a,title:"Booked party?",maxWidth:720,testID:"walkin-match",children:(0,B.jsxs)(b.default,{style:{gap:14},children:[e.map((e,o)=>(0,B.jsxs)(b.default,{testID:`walkin-match-${o}`,style:{gap:12,padding:16,borderRadius:16,borderWidth:2,borderColor:j.colours.gold,backgroundColor:'#15130F'},children:[(0,B.jsx)(b.default,{accessibilityRole:"header",accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:26,weight:"bold",colour:j.colours.goldLight,testID:"walkin-match-question",children:(0,z.walkInMatchQuestion)(e)})}),e.table?(0,B.jsxs)(T.T,{size:17,colour:j.colours.text,children:["Booked table ",(0,l.tableNumbers)(e.table)," \xb7 ",e.ref]}):(0,B.jsx)(T.T,{size:17,colour:j.colours.text,children:e.ref}),(0,B.jsx)(T.Button,{label:"Yes, seat booking",testID:"walkin-match-yes",disabled:t,accessibilityLabel:`Yes, seat ${e.name}'s booking, ${e.partySize} people`,onPress:()=>s(e),style:{minHeight:64}})]},e.id)),(0,B.jsx)(T.Button,{kind:"secondary",label:"No, new walk-in",testID:"walkin-match-no",disabled:t,onPress:o,style:{minHeight:64}})]})})}function _({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,p.useCtx)(15e3),n=L(o,i),c=(0,S.usePlan)(o),h=(0,f.useBookings)(o),y=(0,S.tablesOf)(e.table),w=d.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,y.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),v=d.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(w).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(c,h.filter(e=>e.date===(0,x.ymd)(i)),t,e.partySize,i,(0,k.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[c,h,w,e.partySize,i.getTime()]),[C,D]=(0,r.useState)(!!s||y.length>1),[I,$]=(0,r.useState)(y),P=e=>c.tables.find(t=>t.name===e)?.maxSeats??0,z=I.reduce((e,t)=>e+P(t),0),O=I.length>0&&z{const l=(0,S.joinTables)(s);await f.repo.bookings.assignTable(e.id,l);y.filter(e=>!s.includes(e)).forEach(t=>S.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&M(o,l),t()},F=C?(0,B.jsxs)(b.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,B.jsx)(b.default,{accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:17,weight:"semibold",colour:j.colours.text,children:I.length?`${(0,S.tablesLabel)((0,S.joinTables)(I))} \xb7 ${z} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,B.jsx)(b.default,{testID:"combine-short",children:(0,B.jsxs)(T.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-z," more needed. Add another table."]})}):null,(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,B.jsxs)(T.Row,{gap:8,wrap:!0,children:[(0,B.jsx)(T.Button,{label:"Done",testID:"combine-done",disabled:!I.length,accessibilityLabel:I.length?`Done, save ${(0,S.tableCardLabel)((0,S.joinTables)(I))}`:'Done',onPress:()=>N(I)}),(0,B.jsx)(T.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,B.jsx)(b.default,{style:{gap:8},testID:"assign-table-tip",children:(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`${C?'Combine tables':'Assign table'} \xb7 ${R(e)}`,testID:"assign-table-sheet",footer:F,children:[v&&!C?(0,B.jsx)(b.default,{testID:"assign-suggested",children:(0,B.jsxs)(T.T,{size:16,weight:"semibold",colour:j.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,S.tableCardLabel)(v)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(v)]})}):null,C?null:(0,B.jsx)(T.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>D(!0)}),(0,B.jsx)(W,{use:w,best:C?null:v,bestSet:(0,u.bestTables)(c),picked:C?I:void 0,onPick:C?e=>$(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await N([e])}})]})}function Y(e){(0,n.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${R(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>f.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function U({date:e,onClose:t,wide:n,onSaved:d}){const{rid:u,r:c,now:h,role:z,meId:O}=(0,p.useCtx)(6e4),N=(0,x.ymd)(h),[M,F]=(0,r.useState)(ee.blocks),[W,A]=(0,r.useState)(!1),[E,H]=(0,r.useState)(''),[_,Y]=(0,r.useState)(2),[U,q]=(0,r.useState)(null),[Q,V]=(0,r.useState)(''),[G,K]=(0,r.useState)(''),[X,J]=(0,r.useState)(''),[Z,ee]=(0,r.useState)('phone'),[te,se]=(0,r.useState)((0,D.emptyNeeds)()),oe=(0,D.needsMissing)(te),[le,ae]=(0,r.useState)(null),ie=(0,S.usePlan)(u),ne=(0,P.dogSetUp)(ie),re=!0===te.dog&&ne,de=te.dog?te.dogs:0,ue=(0,x.parseYmd)(M),ce=(0,k.turnFor)(_,c.settings.turnMins),be=L.filter(e=>e.date===M),he=e=>(0,k.freeTablesAt)(ie,be,_,new Date(`${M}${(0,l.tableNumbers)(e)}:00`),ce,c.settings.turnMins,{dog:!0,closed:(0,v.closedAreasAt)(R,u,M,e)}),ge=re&&U?he(U):[];(0,r.useEffect)(()=>{ae(null)},[re,U,_]);const pe=(0,y.bookingSlots)(c,ue,e=>L.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),_,M===(0,x.ymd)(h)?h:(0,x.addMins)(ue,0)),me=(0,w.ukPhone)(G),[fe,ye]=(0,r.useState)(!1),ke=U?pe.find(e=>e.time===U):void 0,xe=ke&&ke.left<_?{left:Math.max(0,ke.left),time:ke.time}:null,je=U?(0,v.blockAt)(R,u,M,U):void 0,we='staff'!==z,Te=!!U&&!(0,D.dogTimeOk)(c,L,M,U,de),Se=!oe.length&&E.trim().length>=2&&!!U&&(!xe||fe)&&(0,o.validParty)(_)&&me.ok&&(0,w.emailOk)(X)&&(!je||we&&W)&&(!re||ge.length>0)&&!Te,ve=te.wheelchair>0||te.stepFree;return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,x.niceDate)(ue)}`,maxWidth:n?760:void 0,testID:"booking-sheet",children:[(0,B.jsx)(D.FirstQuestions,{rid:u,value:te,onChange:se,party:_,audience:"staff"}),te.dog&&!ne?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,B.jsx)(C.BookingDatePicker,{r:c,today:h,value:M,onChange:e=>{e!==M&&(F(e),q(null),A(!1))}}),(0,B.jsxs)(T.Row,{gap:6,children:[(0,B.jsx)(T.Chip,{label:"Phone",selected:'phone'===Z,onPress:()=>ee('phone')}),(0,B.jsx)(T.Chip,{label:"In person",selected:'in-person'===Z,onPress:()=>ee('in-person')})]}),(0,B.jsx)(T.Field,{label:"Name",value:E,onChangeText:H,placeholder:"e.g. Reid",testID:"nb-name"}),(0,B.jsx)(T.Field,{label:"Mobile or phone number (needed)",value:G,onChangeText:K,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!me.ok&&G?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:me.error}):null,(0,B.jsx)(T.Field,{label:"Email (optional)",value:X,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,w.emailOk)(X)?null:(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,B.jsxs)(b.default,{style:{gap:6,alignItems:'center'},children:[(0,B.jsx)(T.T,{center:!0,children:"Covers"}),(0,B.jsx)(s.PartySizeInput,{value:_,onChange:e=>{Y(e),ye(!1)},label:"Covers",testID:"nb-party"})]}),(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:pe.map(e=>{const t=re&&e.available&&!he(e.time).length||!(0,D.dogTimeOk)(c,L,M,e.time,de);return(0,B.jsx)(T.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,v.blockAt)(R,u,M,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':e.left>0?`${e.left} left`:'Full',disabled:(e.past??!e.available)||t,selected:U===e.time,onPress:()=>{q(e.time),A(!1),ye(!1)}},e.time)})}),xe?(0,B.jsxs)(b.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overCapacityNote)(_,xe.left,xe.time)}),(0,B.jsx)(T.Chip,{label:fe?'Booking over the limit: on':'Book anyway (over the limit)',selected:fe,onPress:()=>ye(e=>!e),testID:"nb-over-ok"})]}):null,re&&U?(0,B.jsxs)(b.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,B.jsxs)(T.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,B.jsxs)(T.T,{size:13,colour:j.colours.muted,children:["(",ie.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),ge.length?(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:ge.slice(0,10).map((e,t)=>(0,B.jsx)(T.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${ve&&(0,P.accessibleSetUp)(ie)&&!(0,P.isAccessible)(ie,e.table)?' \xb7 not step-free':''}`,selected:(le??ge[0].table)===e.table,onPress:()=>ae(e.table)},e.table))}):(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["No dog-friendly table free for ",_," at ",U,". Try another time."]})]}):null,je?(0,B.jsxs)(b.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsxs)(T.T,{weight:"semibold",colour:j.colours.amber,children:["Bookings are paused ",je.from,"\u2013",je.to,je.reason?` (${je.reason})`:'']}),we?(0,B.jsx)(T.Chip,{label:W?'Manager override on':'Override and book anyway',selected:W,onPress:()=>A(e=>!e)}):(0,B.jsx)(T.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,pe.length?null:(0,B.jsx)(b.default,{testID:"nb-closed",children:(0,B.jsxs)(T.T,{size:14,weight:"semibold",colour:j.colours.amber,children:["Closed on ",(0,x.niceDate)(ue)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,B.jsx)(D.MoreQuestions,{rid:u,r:c,value:te,onChange:se,party:_,date:M,time:U,today:(0,x.ymd)(h),bookings:L,audience:"staff",showTables:!1!==c.settings.tableRequests}),ve&&!(0,P.accessibleSetUp)(ie)?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,B.jsx)(T.Field,{label:"Notes (optional)",value:Q,onChangeText:V,placeholder:I.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(c.settings),_)?(0,B.jsxs)(T.Muted,{children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(c.settings),_))," (",(0,a.gbp)((0,i.depositOf)(c.settings).perPersonPence)," per person for ",(0,i.depositOf)(c.settings).fromParty,"+). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,B.jsxs)(T.Muted,{children:["The guest gets a confirmation text",X.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Te?(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["We already have the most dogs we can look after at ",U,". Try another time: dogs are very welcome then."]}):null,(0,B.jsx)(T.Button,{label:oe.length?oe[0]:'Save booking',testID:"nb-save",disabled:!Se,onPress:()=>{if(M<(0,x.ymd)(h))return;const e=(0,D.needsPatch)(te),s=te.tableReq.find(e=>!re||ge.some(t=>t.table===e));f.repo.bookings.create({restaurantId:u,customerId:null,name:E.trim(),partySize:_,date:M,time:U,notes:Q.trim(),security:(0,i.depositDue)((0,i.depositOf)(c.settings),_)?'deposit':'none',depositPaid:0,...(0,i.depositDue)((0,i.depositOf)(c.settings),_)?{depositDue:(0,i.depositDue)((0,i.depositOf)(c.settings),_),depositPolicy:(0,i.depositWords)((0,i.depositOf)(c.settings),_,c.name).join(' '),depositRefundable:(0,i.depositOf)(c.settings).refundable,depositCutoffHours:(0,i.depositOf)(c.settings).cutoffHours}:{},phone:me.pretty,email:X.trim()||void 0,source:Z,...e,...pe.find(e=>e.time===U)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...re?{table:le??s??ge[0]?.table}:{}}).then(e=>(0,$.postNewBookingToKitchen)(e,O)).catch(()=>{}),d?.({date:M,time:U,name:E.trim()}),t()}})]})}},1113,[827,1114,1115,860,867,14,1116,34,859,402,102,872,1079,874,1117,1095,858,821,864,794,1021,1018,1118,1119,1124,1097,1091,1125,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return O}}),_e.useTableNames=N,_e.resetTableLive=M,_e.seatBookingNow=L,_e.finishBookingNow=async function(e,t){await f.repo.bookings.setStatus(t.id,'finished'),(0,S.tablesOf)(t.table).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=F,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return R}}),_e.TablePicker=W,_e.WalkInSheet=E,_e.WalkInMatchPrompt=H,_e.AssignTableSheet=_,_e.undoNotice=Y,_e.NewBookingSheet=U,_e.useFrontDoor=function(e,t){const[s,o]=(0,r.useState)(!1),[l,a]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>d({b:e}),combineTables:e=>d({b:e,combine:!0}),elements:(0,B.jsxs)(B.Fragment,{children:[s?(0,B.jsx)(E,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,B.jsx)(U,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,n.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,x.niceDate)((0,x.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,B.jsx)(_,{booking:i.b,combine:i.combine,onClose:()=>d(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=e(r),u=_r(_d[8]),c=e(_r(_d[9])),b=e(_r(_d[10])),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),w=_r(_d[18]),T=_r(_d[19]),S=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),D=_r(_d[23]),I=_r(_d[24]),$=_r(_d[25]),P=_r(_d[26]),z=_r(_d[27]),B=_r(_d[28]);const O=Array.from({length:12},(e,t)=>String(t+1));function N(e){const t=(0,S.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function M(e,t){(0,S.tablesOf)(t).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}async function L(e,t){await f.repo.bookings.setStatus(t.id,'seated'),M(e,t.table)}function F(e,t){const s=(0,f.useBookings)(e),o=(0,f.useOrders)(e),l=N(e),a=(0,S.useFloor)(t=>t.live[e])??{},i=(0,S.usePlan)(e),n=(0,v.useBlocks)(e=>e.blocks),r=(0,x.ymd)(t),d=(0,v.closedAreasAt)(n,e,r,(0,x.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,S.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,x.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const R=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function W({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:d}){const u=Object.keys(e),[h,p]=(0,r.useState)(0),f=i?6:8,y=i?64:o?92:76,k=h?Math.max(3,Math.floor((h+f)/(y+f))):0,x=k?Math.floor((h-f*(k-1))/k):y,w=new Set(n??[]),v=a?(0,S.tablesOf)(a)[0]:null;return(0,B.jsx)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:f},testID:"table-picker",onLayout:e=>p(Math.floor(e.nativeEvent.layout.width)),children:u.map(o=>{const a=e[o],n=t===o||!!d?.includes(o),r=w.has(o),u=v===o&&!n,h=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,B.jsxs)(c.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${d?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${r?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:x,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?j.colours.gold:a.busy?j.colours.red:j.colours.ok,backgroundColor:n?j.colours.goldTint:a.busy?j.colours.redBg:j.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,B.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,B.jsx)(T.T,{weight:"bold",size:22,colour:n?j.colours.goldLight:j.colours.text,children:(0,l.tableNumbers)(o)}),r?(0,B.jsx)(b.default,{testID:"best-table",style:{backgroundColor:j.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,B.jsx)(T.T,{size:11,weight:"bold",colour:j.colours.onGold,children:"BEST"})}):null]}),(0,B.jsx)(T.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:h})]},o)})})}const A=[1,2,3,4,5,6,7,8];function E({onClose:e,onSeated:a,wide:i,initialTable:y}){const{rid:w,r:C,now:D}=(0,p.useCtx)(15e3),I=F(w,D),[$,P]=(0,r.useState)(2),[O,N]=(0,r.useState)(!1),[R,E]=(0,r.useState)(y??null),_=(0,S.usePlan)(w),Y=(0,f.useBookings)(w),U=(0,v.useBlocks)(e=>e.blocks),q=(0,v.closedAreasAt)(U,w,(0,x.ymd)(D),(0,x.hm)(D)),Q=d.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(_,Y.filter(e=>e.date===(0,x.ymd)(D)),e,$,D,(0,k.turnFor)($,C.settings.turnMins),90,void 0,{closed:q})?.table??null},[_,Y,I,$,q.size,D.getTime()]);(0,r.useEffect)(()=>{R&&(0,S.tablesOf)(R).some(e=>'Closed'===I[e]?.label)&&E(null)},[R,q.size]);const[V,G]=(0,r.useState)(!1),[K,X]=(0,r.useState)(''),J=(e,t=String(e),s=()=>{N(!1),P(e)})=>{const o='9+'===t?O:!O&&$===e;return(0,B.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?j.colours.gold:'transparent'},children:(0,B.jsx)(T.T,{weight:"bold",size:22,colour:o?j.colours.onGold:j.colours.gold,children:t})},t)},Z=(0,B.jsx)(s.PartySizeInput,{value:$,onChange:P,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),ee=(0,B.jsxs)(b.default,{style:{gap:8,width:i?256:void 0},children:[(0,B.jsx)(T.T,{weight:"semibold",children:"How many people?"}),(0,B.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[A.map(e=>J(e)),J(9,'9+',()=>{N(!0),P(e=>e>=9?e:9)})]}),O?Z:null]}),[te,se]=(0,r.useState)(!1),[oe,le]=(0,r.useState)(null),ae=async(t=R,s=!1)=>{if(!te){if(!s){const e=(0,z.bookingsNearWalkIn)(Y,D,$);if(e.length)return void le({at:t,list:e})}se(!0);try{const s=await f.repo.bookings.seatWalkIn(w,$,t??void 0,K);M(w,t??void 0),a(s),e()}finally{se(!1)}}},ie=async(t,s)=>{if(!te){se(!0);try{const o=s??t.table??null;o&&o!==t.table&&await f.repo.bookings.assignTable(t.id,o),await L(w,{...t,table:o??void 0}),(0,n.notify)({id:`seated:${t.id}`,testID:'walkin-match-toast',timeoutMs:5e3,icon:'\u2713',title:`${t.name} seated \xb7 ${t.partySize} \xb7 ${o?(0,l.tableNumbers)(o):'table to assign'} (booking ${t.ref})`}),le(null),e()}finally{se(!1)}}},ne=(0,B.jsxs)(b.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,B.jsxs)(T.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(T.T,{weight:"semibold",children:["Table ",(0,B.jsx)(T.T,{colour:j.colours.muted,size:14,children:"(optional)"})]}),R?(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>E(null)}):null]}),(0,B.jsx)(W,{use:I,value:R,onPick:e=>{I[e]&&!I[e].busy?ae(e):E(R===e?null:e)},big:i,dense:i,best:Q,bestSet:(0,u.bestTables)(_)}),(0,B.jsxs)(T.Muted,{children:["Tap a free table to seat them there",Q&&!R?` (suggested for ${$}: ${(0,l.tableNumbers)(Q)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,x.hm)(D)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,B.jsx)(T.Button,{label:`Seat walk-in \xb7 ${$} ${1===$?'person':'people'}${R?` \xb7 ${(0,l.tableNumbers)(R)}`:''}`,disabled:te,onPress:()=>{ae()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,B.jsxs)(T.Row,{gap:16,style:{alignItems:'flex-start'},children:[ee,ne]}):(0,B.jsxs)(B.Fragment,{children:[ee,ne]}),(0,B.jsxs)(T.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[V?(0,B.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:K,onChangeText:X,style:[T.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>G(!0)}),(0,B.jsx)(b.default,{style:{flex:1,minWidth:220},children:(0,B.jsxs)(T.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==h.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]}),oe?(0,B.jsx)(H,{list:oe.list,busy:te,onYes:e=>{ie(e,oe.at)},onNo:()=>{const e=oe.at;le(null),ae(e,!0)},onClose:()=>le(null)}):null]})}function H({list:e,busy:t,onYes:s,onNo:o,onClose:a}){return(0,B.jsx)(T.Sheet,{visible:!0,onClose:a,title:"Booked party?",maxWidth:720,testID:"walkin-match",children:(0,B.jsxs)(b.default,{style:{gap:14},children:[e.map((e,o)=>(0,B.jsxs)(b.default,{testID:`walkin-match-${o}`,style:{gap:12,padding:16,borderRadius:16,borderWidth:2,borderColor:j.colours.gold,backgroundColor:'#15130F'},children:[(0,B.jsx)(b.default,{accessibilityRole:"header",accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:26,weight:"bold",colour:j.colours.goldLight,testID:"walkin-match-question",children:(0,z.walkInMatchQuestion)(e)})}),e.table?(0,B.jsxs)(T.T,{size:17,colour:j.colours.text,children:["Booked table ",(0,l.tableNumbers)(e.table)," \xb7 ",e.ref]}):(0,B.jsx)(T.T,{size:17,colour:j.colours.text,children:e.ref}),(0,B.jsx)(T.Button,{label:"Yes, seat booking",testID:"walkin-match-yes",disabled:t,accessibilityLabel:`Yes, seat ${e.name}'s booking, ${e.partySize} people`,onPress:()=>s(e),style:{minHeight:64}})]},e.id)),(0,B.jsx)(T.Button,{kind:"secondary",label:"No, new walk-in",testID:"walkin-match-no",disabled:t,onPress:o,style:{minHeight:64}})]})})}function _({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,p.useCtx)(15e3),n=F(o,i),c=(0,S.usePlan)(o),h=(0,f.useBookings)(o),y=(0,S.tablesOf)(e.table),w=d.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,y.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),v=d.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(w).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(c,h.filter(e=>e.date===(0,x.ymd)(i)),t,e.partySize,i,(0,k.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[c,h,w,e.partySize,i.getTime()]),[C,D]=(0,r.useState)(!!s||y.length>1),[I,$]=(0,r.useState)(y),P=e=>c.tables.find(t=>t.name===e)?.maxSeats??0,z=I.reduce((e,t)=>e+P(t),0),O=I.length>0&&z{const l=(0,S.joinTables)(s);await f.repo.bookings.assignTable(e.id,l);y.filter(e=>!s.includes(e)).forEach(t=>S.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&M(o,l),t()},L=C?(0,B.jsxs)(b.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,B.jsx)(b.default,{accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:17,weight:"semibold",colour:j.colours.text,children:I.length?`${(0,S.tablesLabel)((0,S.joinTables)(I))} \xb7 ${z} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,B.jsx)(b.default,{testID:"combine-short",children:(0,B.jsxs)(T.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-z," more needed. Add another table."]})}):null,(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,B.jsxs)(T.Row,{gap:8,wrap:!0,children:[(0,B.jsx)(T.Button,{label:"Done",testID:"combine-done",disabled:!I.length,accessibilityLabel:I.length?`Done, save ${(0,S.tableCardLabel)((0,S.joinTables)(I))}`:'Done',onPress:()=>N(I)}),(0,B.jsx)(T.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,B.jsx)(b.default,{style:{gap:8},testID:"assign-table-tip",children:(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`${C?'Combine tables':'Assign table'} \xb7 ${R(e)}`,testID:"assign-table-sheet",footer:L,children:[v&&!C?(0,B.jsx)(b.default,{testID:"assign-suggested",children:(0,B.jsxs)(T.T,{size:16,weight:"semibold",colour:j.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,S.tableCardLabel)(v)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(v)]})}):null,C?null:(0,B.jsx)(T.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>D(!0)}),(0,B.jsx)(W,{use:w,best:C?null:v,bestSet:(0,u.bestTables)(c),picked:C?I:void 0,onPick:C?e=>$(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await N([e])}})]})}function Y(e){(0,n.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${R(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>f.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function U({date:e,onClose:t,wide:n,onSaved:d}){const{rid:u,r:c,now:h,role:z,meId:O}=(0,p.useCtx)(6e4),N=(0,x.ymd)(h),[M,L]=(0,r.useState)(ee.blocks),[W,A]=(0,r.useState)(!1),[E,H]=(0,r.useState)(''),[_,Y]=(0,r.useState)(2),[U,q]=(0,r.useState)(null),[Q,V]=(0,r.useState)(''),[G,K]=(0,r.useState)(''),[X,J]=(0,r.useState)(''),[Z,ee]=(0,r.useState)('phone'),[te,se]=(0,r.useState)((0,D.emptyNeeds)()),oe=(0,D.needsMissing)(te),[le,ae]=(0,r.useState)(null),ie=(0,S.usePlan)(u),ne=(0,P.dogSetUp)(ie),re=!0===te.dog&&ne,de=te.dog?te.dogs:0,ue=(0,x.parseYmd)(M),ce=(0,k.turnFor)(_,c.settings.turnMins),be=F.filter(e=>e.date===M),he=e=>(0,k.freeTablesAt)(ie,be,_,new Date(`${M}${(0,l.tableNumbers)(e)}:00`),ce,c.settings.turnMins,{dog:!0,closed:(0,v.closedAreasAt)(R,u,M,e)}),ge=re&&U?he(U):[];(0,r.useEffect)(()=>{ae(null)},[re,U,_]);const pe=(0,y.bookingSlots)(c,ue,e=>F.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),_,M===(0,x.ymd)(h)?h:(0,x.addMins)(ue,0),e=>F.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),me=(0,w.ukPhone)(G),[fe,ye]=(0,r.useState)(!1),ke=U?pe.find(e=>e.time===U):void 0,xe=ke&&ke.left<_?{left:Math.max(0,ke.left),time:ke.time}:null,je=ke&&null!=ke.partiesLeft&&ke.partiesLeft<1?{time:ke.time,cap:ke.partiesCap??0}:null,we=xe||je,Te=U?(0,v.blockAt)(R,u,M,U):void 0,Se='staff'!==z,ve=!!U&&!(0,D.dogTimeOk)(c,F,M,U,de),Ce=!oe.length&&E.trim().length>=2&&!!U&&(!we||fe)&&(0,o.validParty)(_)&&me.ok&&(0,w.emailOk)(X)&&(!Te||Se&&W)&&(!re||ge.length>0)&&!ve,De=te.wheelchair>0||te.stepFree;return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,x.niceDate)(ue)}`,maxWidth:n?760:void 0,testID:"booking-sheet",children:[(0,B.jsx)(D.FirstQuestions,{rid:u,value:te,onChange:se,party:_,audience:"staff"}),te.dog&&!ne?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,B.jsx)(C.BookingDatePicker,{r:c,today:h,value:M,onChange:e=>{e!==M&&(L(e),q(null),A(!1))}}),(0,B.jsxs)(T.Row,{gap:6,children:[(0,B.jsx)(T.Chip,{label:"Phone",selected:'phone'===Z,onPress:()=>ee('phone')}),(0,B.jsx)(T.Chip,{label:"In person",selected:'in-person'===Z,onPress:()=>ee('in-person')})]}),(0,B.jsx)(T.Field,{label:"Name",value:E,onChangeText:H,placeholder:"e.g. Reid",testID:"nb-name"}),(0,B.jsx)(T.Field,{label:"Mobile or phone number (needed)",value:G,onChangeText:K,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!me.ok&&G?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:me.error}):null,(0,B.jsx)(T.Field,{label:"Email (optional)",value:X,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,w.emailOk)(X)?null:(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,B.jsxs)(b.default,{style:{gap:6,alignItems:'center'},children:[(0,B.jsx)(T.T,{center:!0,children:"Covers"}),(0,B.jsx)(s.PartySizeInput,{value:_,onChange:e=>{Y(e),ye(!1)},label:"Covers",testID:"nb-party"})]}),(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:pe.map(e=>{const t=re&&e.available&&!he(e.time).length||!(0,D.dogTimeOk)(c,F,M,e.time,de);return(0,B.jsx)(T.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,v.blockAt)(R,u,M,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:U===e.time,onPress:()=>{q(e.time),A(!1),ye(!1)}},e.time)})}),we?(0,B.jsxs)(b.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[xe?(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overCapacityNote)(_,xe.left,xe.time)}):null,je?(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overPartiesNote)(je.time,je.cap)}):null,(0,B.jsx)(T.Chip,{label:fe?'Booking over the limit: on':'Book anyway (over the limit)',selected:fe,onPress:()=>ye(e=>!e),testID:"nb-over-ok"})]}):null,re&&U?(0,B.jsxs)(b.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,B.jsxs)(T.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,B.jsxs)(T.T,{size:13,colour:j.colours.muted,children:["(",ie.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),ge.length?(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:ge.slice(0,10).map((e,t)=>(0,B.jsx)(T.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${De&&(0,P.accessibleSetUp)(ie)&&!(0,P.isAccessible)(ie,e.table)?' \xb7 not step-free':''}`,selected:(le??ge[0].table)===e.table,onPress:()=>ae(e.table)},e.table))}):(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["No dog-friendly table free for ",_," at ",U,". Try another time."]})]}):null,Te?(0,B.jsxs)(b.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsxs)(T.T,{weight:"semibold",colour:j.colours.amber,children:["Bookings are paused ",Te.from,"\u2013",Te.to,Te.reason?` (${Te.reason})`:'']}),Se?(0,B.jsx)(T.Chip,{label:W?'Manager override on':'Override and book anyway',selected:W,onPress:()=>A(e=>!e)}):(0,B.jsx)(T.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,pe.length?null:(0,B.jsx)(b.default,{testID:"nb-closed",children:(0,B.jsxs)(T.T,{size:14,weight:"semibold",colour:j.colours.amber,children:["Closed on ",(0,x.niceDate)(ue)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,B.jsx)(D.MoreQuestions,{rid:u,r:c,value:te,onChange:se,party:_,date:M,time:U,today:(0,x.ymd)(h),bookings:F,audience:"staff",showTables:!1!==c.settings.tableRequests}),De&&!(0,P.accessibleSetUp)(ie)?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,B.jsx)(T.Field,{label:"Notes (optional)",value:Q,onChangeText:V,placeholder:I.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(c.settings),_)?(0,B.jsxs)(T.Muted,{children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(c.settings),_))," (",(0,a.gbp)((0,i.depositOf)(c.settings).perPersonPence)," per person for ",(0,i.depositOf)(c.settings).fromParty,"+). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,B.jsxs)(T.Muted,{children:["The guest gets a confirmation text",X.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),ve?(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["We already have the most dogs we can look after at ",U,". Try another time: dogs are very welcome then."]}):null,(0,B.jsx)(T.Button,{label:oe.length?oe[0]:'Save booking',testID:"nb-save",disabled:!Ce,onPress:()=>{if(M<(0,x.ymd)(h))return;const e=(0,D.needsPatch)(te),s=te.tableReq.find(e=>!re||ge.some(t=>t.table===e));f.repo.bookings.create({restaurantId:u,customerId:null,name:E.trim(),partySize:_,date:M,time:U,notes:Q.trim(),security:(0,i.depositDue)((0,i.depositOf)(c.settings),_)?'deposit':'none',depositPaid:0,...(0,i.depositDue)((0,i.depositOf)(c.settings),_)?{depositDue:(0,i.depositDue)((0,i.depositOf)(c.settings),_),depositPolicy:(0,i.depositWords)((0,i.depositOf)(c.settings),_,c.name).join(' '),depositRefundable:(0,i.depositOf)(c.settings).refundable,depositCutoffHours:(0,i.depositOf)(c.settings).cutoffHours}:{},phone:me.pretty,email:X.trim()||void 0,source:Z,...e,...pe.find(e=>e.time===U)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...re?{table:le??s??ge[0]?.table}:{}}).then(e=>(0,$.postNewBookingToKitchen)(e,O)).catch(()=>{}),d?.({date:M,time:U,name:E.trim()}),t()}})]})}},1113,[827,1114,1115,860,867,14,1116,34,859,402,102,872,1079,874,1117,1095,858,821,864,794,1021,1018,1118,1119,1124,1097,1091,1125,25]); __d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PartySizeInput=function({value:e,onChange:p,min:b=s.MIN_PARTY,max:y=s.MAX_PARTY,label:f="Party size",testID:h="party-size"}){const[x,$]=(0,t.useState)(String(e));(0,t.useEffect)(()=>{$(String(e))},[e]);const w=e=>p((0,s.clampParty)(e,b,y)),I=(t,n,l)=>{const s=t<0?e<=b:e>=y;return(0,d.jsx)(o.default,{testID:`${h}-${t>0?'up':'down'}${10===Math.abs(t)?'10':''}`,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:s},disabled:s,onPress:()=>w(e+t),hitSlop:4,style:{minWidth:44,height:44,paddingHorizontal:8,borderRadius:22,borderWidth:1.5,borderColor:c.colours.gold,alignItems:'center',justifyContent:'center',opacity:s?.4:1},children:(0,d.jsx)(u.T,{size:10===Math.abs(t)?14:20,weight:"semibold",colour:c.colours.gold,center:!0,children:n})},t)};return(0,d.jsxs)(l.default,{testID:h,style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap',justifyContent:'center'},children:[y-b>=20?I(-10,'\u221210',"10 fewer people"):null,I(-1,'\u2212','One fewer person'),(0,d.jsx)(n.default,{testID:`${h}-input`,value:x,keyboardType:"number-pad",inputMode:"numeric",maxLength:3,selectTextOnFocus:!0,accessibilityLabel:`${f}, ${b} to ${y} people`,accessibilityValue:{min:b,max:y,now:e,text:`${e} ${1===e?'person':'people'}`},onChangeText:e=>{$(e.replace(/\D/g,'')),e.replace(/\D/g,'')&&w((0,s.partyFromText)(e,b,y))},onBlur:()=>{const e=(0,s.partyFromText)(x,b,y);$(String(e)),w(e)},style:{width:64,height:44,borderRadius:10,borderWidth:1,borderColor:c.colours.border,color:c.colours.text,backgroundColor:c.colours.surface,textAlign:'center',fontSize:20,fontFamily:c.fonts.semibold}}),I(1,'+','One more person'),y-b>=20?I(10,'+10',"10 more people"):null]})};var t=r(_d[0]),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),s=r(_d[4]),c=r(_d[5]),u=r(_d[6]),d=r(_d[7])},1114,[34,402,412,102,1115,821,794,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const f=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(f)?f:u))},f=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),b=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`},1115,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overPartiesNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const s=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(s)?s:u))},s=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),f=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`,b=(t,n)=>`${t} already has the most bookings we take at one start time (${n}). Booking another goes over the venue\u2019s limit: check tables and staffing.`},1115,[]); __d(function(g,r,i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"dismissNotice",{enumerable:!0,get:function(){return u.dismissNotice}}),Object.defineProperty(_e,"notify",{enumerable:!0,get:function(){return u.notify}}),Object.defineProperty(_e,"useSliders",{enumerable:!0,get:function(){return u.useSliders}}),Object.defineProperty(_e,"SLIDER",{enumerable:!0,get:function(){return j}}),_e.SliderButton=k,_e.SliderCard=C,_e.SliderHost=function(){y();const e=(0,u.useSliders)(e=>e.queue),n=e[0],o=(0,t.useRef)(null);(0,t.useEffect)(()=>{if(p)return window.ccSlider=e=>(0,u.notify)(e),()=>{delete window.ccSlider}},[]),(0,t.useEffect)(()=>{if(o.current&&clearTimeout(o.current),!n)return;const e=void 0!==n.timeoutMs?n.timeoutMs:n.actions?.length||n.content?null:6e3;return e&&(o.current=setTimeout(()=>u.useSliders.getState().dismiss(n.id),e)),()=>{o.current&&clearTimeout(o.current)}},[n?.id,n?.timeoutMs]);const[l,c]=(0,t.useState)(0);if((0,t.useEffect)(()=>{if(!p||!n)return;const e=()=>{const e=document.querySelector('[data-testid="app-bottom-tabs"]');c(e?Math.max(0,Math.round(window.innerHeight-e.getBoundingClientRect().top)):0)};e();const t=setTimeout(e,300);return window.addEventListener('resize',e),()=>{clearTimeout(t),window.removeEventListener('resize',e)}},[n?.id]),!n)return null;const a=p?'fixed':'absolute';return(0,f.jsxs)(f.Fragment,{children:[n.modal?(0,f.jsx)(s.default,{...x('dim'),style:{position:a,left:0,right:0,top:0,bottom:0,zIndex:2147482990,backgroundColor:'rgba(0,0,0,0.72)'}}):null,(0,f.jsx)(s.default,{testID:"cc-slider-host",pointerEvents:"box-none",style:{position:a,left:12,right:12,bottom:12,zIndex:2147483e3,alignItems:'center',...p?{bottom:l?`${12+l}px`:'calc(12px + env(safe-area-inset-bottom))'}:{}},children:(0,f.jsx)(C,{n:n,waiting:e.length-1,onClose:()=>u.useSliders.getState().dismiss(n.id)},n.id+':'+(n.seq??0))})]})};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),s=e(r(d[4])),l=e(r(d[5])),c=r(d[6]),a=r(d[7]),u=r(d[8]),b=r(d[9]),f=r(d[10]);const p='undefined'!=typeof document,h="\n[data-ccsl=\"in\"]{animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both}\n@keyframes ccsl-in{from{opacity:0;transform:translate3d(0,110%,0)}to{opacity:1;transform:none}}\n[data-ccsl=\"urgent\"]{animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both,ccsl-red 1.6s ease-in-out .45s infinite}\n@keyframes ccsl-red{0%,100%{box-shadow:0 10px 30px rgba(0,0,0,.6),0 0 0 1px rgba(255,107,94,.55)}50%{box-shadow:0 10px 40px rgba(0,0,0,.6),0 0 0 2px #FF6B5E,0 0 34px rgba(255,107,94,.45)}}\n[data-ccsl=\"dim\"]{animation:ccsl-dim .3s ease both}\n@keyframes ccsl-dim{from{opacity:0}to{opacity:1}}\n@media (prefers-reduced-motion: reduce){[data-ccsl]{animation:none !important}}\n",x=e=>p?{dataSet:{ccsl:e}}:{};function y(){(0,t.useEffect)(()=>{if(!p||document.getElementById('cc-slider-css'))return;const e=document.createElement('style');e.id='cc-slider-css',e.textContent=h,document.head.appendChild(e)},[])}const j={bg:'#17140F',border:'rgba(207,164,95,.55)',text:'#F5F1E8',quiet:'#A89A80',gold:c.colours.gold,ink:'#17130D'},w=(e="normal")=>'urgent'===e?c.colours.red:'warn'===e?c.colours.amber:c.colours.gold,S=(e="normal")=>'urgent'===e?'rgba(255,107,94,.75)':'warn'===e?'rgba(255,181,71,.65)':j.border;function k({a:e,onDone:t,big:o}){const s=e.kind??'primary';return(0,f.jsx)(n.default,{testID:e.testID,accessibilityRole:"button",accessibilityLabel:e.label,onPress:()=>{try{e.onPress?.()}finally{e.keepOpen||t()}},style:({pressed:e})=>({minHeight:o?56:44,minWidth:44,paddingHorizontal:'ghost'===s?10:o?24:18,borderRadius:12,alignItems:'center',justifyContent:'center',backgroundColor:'primary'===s?j.gold:'transparent',borderWidth:'danger'===s?1:0,borderColor:c.colours.red,opacity:e?.8:1}),children:(0,f.jsx)(a.T,{size:o?18:'ghost'===s?14:15,weight:'primary'===s?'bold':'medium',colour:'primary'===s?j.ink:'danger'===s?c.colours.red:j.quiet,children:e.label})})}function C({n:e,onClose:t,waiting:n=0,maxWidth:c=520}){y();const u=e.tone??'normal',h=w(u),C=e.content,z=!!e.big,{height:I}=(0,l.default)(),D=e.actions??[];return(0,f.jsxs)(s.default,{testID:e.testID??'cc-slider',accessibilityRole:"summary",accessibilityLabel:`${e.kicker?e.kicker+': ':''}${e.title}`,...x('urgent'===u?'urgent':'in'),style:{width:'100%',maxWidth:z?Math.max(c,900):c,alignSelf:'center',borderRadius:14,backgroundColor:j.bg,borderWidth:1,borderColor:S(u),overflow:'hidden',...p?{boxShadow:'0 10px 30px rgba(0,0,0,.6)'}:{elevation:12}},children:['normal'!==u?(0,f.jsx)(s.default,{style:{position:'absolute',left:0,top:0,bottom:0,width:5,backgroundColor:h}}):null,(0,f.jsxs)(o.default,{style:{maxHeight:Math.max(220,I-40)},contentContainerStyle:{paddingVertical:z?18:12,paddingLeft:'normal'!==u?z?24:18:z?20:14,paddingRight:z?20:14,gap:z?10:6},children:[(0,f.jsxs)(s.default,{style:{flexDirection:'row',alignItems:'center',gap:12},children:[e.icon?(0,f.jsx)(a.T,{size:z?34:22,children:e.icon}):null,(0,f.jsxs)(s.default,{style:{flex:1,gap:2},children:[e.kicker?(0,f.jsx)(a.T,{size:z?15:11,weight:"bold",colour:h,style:{letterSpacing:1.4},children:e.kicker}):null,(0,f.jsx)(a.T,{size:z?24:15,weight:"medium",colour:j.text,children:e.title}),e.body?(0,f.jsx)(a.T,{size:z?18:13,colour:j.quiet,children:e.body}):null]}),D.length||C?null:(0,f.jsx)(b.ToastClose,{testID:"cc-slider-ok",label:`Close: ${e.title}`,onPress:t,size:z?'lg':'md',colour:j.quiet})]}),C?(0,f.jsx)(C,{close:t}):null,D.length?(0,f.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',alignItems:'center',gap:8,justifyContent:'flex-end'},children:D.map(e=>(0,f.jsx)(k,{a:e,onDone:t,big:z},e.label))}):null,n>0?(0,f.jsxs)(a.T,{size:z?14:11,colour:j.quiet,center:!0,style:{alignSelf:'stretch'},children:[n," more waiting"]}):null]})]})}},1116,[34,236,402,295,102,426,821,794,998,796,25]); -__d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.bookingSlotMinutesOf=s,Object.defineProperty(e,"COVERS_WINDOW_MINS",{enumerable:!0,get:function(){return r}}),e.coversInHalfHour=l,e.takeawaySlots=function(o,s,r){const l=(0,t.hoursFor)(o,r);if(!l)return[];const u=o.settings.slotMinutes,c=(0,n.addMins)(r,o.settings.leadMins),f=[];for(let t=new Date(l.open);t<=l.close;t=(0,n.addMins)(t,u)){if(tn.restaurantId===o.id&&'takeaway'===n.type&&'cancelled'!==n.status&&n.slotTime&&new Date(n.slotTime).getTime()===t.getTime()).length;f.push({time:new Date(t),label:(0,n.hm)(t),taken:r,cap:o.settings.slotCap,full:r>=o.settings.slotCap})}return f},e.bookingSlots=function(r,c,f,d,m){const p=(0,t.hoursFor)(r,c);if(!p)return[];const M=[],S=p.close,b=(0,o.lastFoodOn)(r,u(c)),h=b?(0,n.atTime)(c,b.time):S,k='drinks'===(0,o.afterLastFood)(r),O=s(r);for(let t=new Date(p.open);t<=S;t=(0,n.addMins)(t,O)){const o=(0,n.hm)(t),s=t>h;if(s&&!k)continue;const u=r.settings.bookingCoversPerSlot-l(f,o),c=t.getTime()=d,past:c,...s?{drinksOnly:!0}:{}})}return M};var t=_r(_d[0]),n=_r(_d[1]),o=_r(_d[2]);function s(t){const n=t.settings.bookingSlotMinutes;return 5===n||10===n||15===n||20===n||30===n?n:15}const r=30;function l(t,o){const s=Math.floor((0,n.toMins)(o)/r)*r;let l=0;for(let o=0;o`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},1117,[878,858,877]); +__d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.bookingSlotMinutesOf=s,e.bookingNoticeMinsOf=r,e.bookingCoversPerStartOf=u,e.bookingPartiesPerStartOf=l,e.onlinePartyBounds=c,Object.defineProperty(e,"COVERS_WINDOW_MINS",{enumerable:!0,get:function(){return f}}),e.coversInHalfHour=m,e.countInStartSlot=p,e.bookingLimitsHint=function(t){const n=s(t),o=u(t),f=l(t),m=r(t),p=c(t);if(null!=o||null!=f){const t=[];return null!=o&&null!=f?t.push(`up to ${o} people and ${f} bookings at each start time`):null!=o?t.push(`up to ${o} people at each start time`):t.push(`up to ${f} bookings at each start time`),(p.max<100||p.min>1)&&t.push(`parties of ${p.min} to ${p.max}`),t.push(`from ${m} minutes ahead`),t.push('table rules still apply'),`Times are every ${n} minutes: ${t.join(', ')}.`}return`Times are every ${n} minutes. Covers per slot (${t.settings.bookingCoversPerSlot} per half hour) and table rules still apply.`},e.takeawaySlots=function(o,s,r){const u=(0,t.hoursFor)(o,r);if(!u)return[];const l=o.settings.slotMinutes,c=(0,n.addMins)(r,o.settings.leadMins),f=[];for(let t=new Date(u.open);t<=u.close;t=(0,n.addMins)(t,l)){if(tn.restaurantId===o.id&&'takeaway'===n.type&&'cancelled'!==n.status&&n.slotTime&&new Date(n.slotTime).getTime()===t.getTime()).length;f.push({time:new Date(t),label:(0,n.hm)(t),taken:r,cap:o.settings.slotCap,full:r>=o.settings.slotCap})}return f},e.bookingSlots=function(c,f,d,h,k,M=()=>0){const y=(0,t.hoursFor)(c,f);if(!y)return[];const S=[],$=y.close,P=(0,o.lastFoodOn)(c,b(f)),v=P?(0,n.atTime)(f,P.time):$,I='drinks'===(0,o.afterLastFood)(c),O=s(c),C=r(c),N=u(c),T=l(c);for(let t=new Date(y.open);t<=$;t=(0,n.addMins)(t,O)){const o=(0,n.hm)(t),s=t>v;if(s&&!I)continue;const r=null!=N?p(d,o,O):m(d,o),u=(N??c.settings.bookingCoversPerSlot)-r,l=null!=T?p(M,o,O):0,f=null!=T?T-l:void 0,b=t.getTime()=1;S.push({time:o,left:u,available:!b&&u>=h&&y,past:b,...s?{drinksOnly:!0}:{},...null!=f?{partiesLeft:f,partiesCap:T}:{}})}return S};var t=_r(_d[0]),n=_r(_d[1]),o=_r(_d[2]);function s(t){const n=t.settings.bookingSlotMinutes;return 5===n||10===n||15===n||20===n||30===n?n:15}function r(t){const n=t.settings.bookingNoticeMins;return'number'==typeof n&&Number.isInteger(n)&&n>=0&&n<=1440?n:30}function u(t){const n=t.settings.bookingCoversPerStart;return'number'==typeof n&&Number.isInteger(n)&&n>0&&n<=200?n:null}function l(t){const n=t.settings.bookingPartiesPerStart;return'number'==typeof n&&Number.isInteger(n)&&n>0&&n<=50?n:null}function c(t){const n=t.settings.onlinePartyMin,o=t.settings.onlinePartyMax,s='number'==typeof n&&Number.isInteger(n)&&n>=1&&n<=100?n:1;return{min:s,max:'number'==typeof o&&Number.isInteger(o)&&o>=s&&o<=100?o:100}}const f=30;function m(t,o){const s=Math.floor((0,n.toMins)(o)/f)*f;let r=0;for(let o=0;o`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},1117,[878,858,877]); __d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.nextDays=c,Object.defineProperty(_e,"openOn",{enumerable:!0,get:function(){return u}}),_e.BookingDatePicker=function({r:e,today:l,value:b,onChange:m}){const[f,x]=(0,t.useState)(!1),p=(0,r.ymd)(l),j=c(l,9),D=(e,t)=>0===t?'Today':1===t?'Tomorrow':`${(0,r.dayShort)(e)} ${e.getDate()}`,w=j.some(e=>(0,r.ymd)(e)===b),C=(0,r.parseYmd)(b),[P,T]=(0,t.useState)(()=>({y:C.getFullYear(),m:C.getMonth()})),v=(new Date(P.y,P.m,1,12).getDay()+6)%7,M=new Date(P.y,P.m+1,0).getDate(),R=[...Array.from({length:v},()=>null),...Array.from({length:M},(e,t)=>new Date(P.y,P.m,t+1,12))];for(;R.length%7;)R.push(null);const k=12*(P.y-l.getFullYear())+P.m-l.getMonth(),F=e=>T(({y:t,m:o})=>{const s=new Date(t,o+e,1);return{y:s.getFullYear(),m:s.getMonth()}});return(0,i.jsxs)(s.default,{testID:"nb-date",style:{gap:6},children:[(0,i.jsxs)(d.Row,{wrap:!0,gap:6,children:[j.map((t,o)=>(0,i.jsx)(d.Chip,{label:D(t,o),sub:u(e,t)?void 0:'Closed',selected:b===(0,r.ymd)(t),onPress:()=>{m((0,r.ymd)(t)),x(!1)}},(0,r.ymd)(t))),w?null:(0,i.jsx)(d.Chip,{label:(0,r.niceDate)(C),sub:u(e,C)?void 0:'Closed',selected:!0,onPress:()=>x(!0)}),(0,i.jsx)(d.Chip,{label:f?'Close calendar':'\ud83d\udcc5 Pick date',selected:f,onPress:()=>{f||T({y:C.getFullYear(),m:C.getMonth()}),x(!f)}})]}),f?(0,i.jsxs)(s.default,{testID:"nb-calendar",style:{borderWidth:1,borderColor:n.colours.border,borderRadius:14,padding:10,gap:6,backgroundColor:n.colours.surface2,maxWidth:420},children:[(0,i.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,i.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Previous month",disabled:k<=0,onPress:()=>F(-1),style:{padding:8,opacity:k<=0?.3:1},children:(0,i.jsx)(d.T,{size:20,colour:n.colours.gold,children:"\u2039"})}),(0,i.jsxs)(d.T,{weight:"semibold",children:[(0,r.monthLong)(P.m)," ",P.y]}),(0,i.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Next month",disabled:k>=h,onPress:()=>F(1),style:{padding:8,opacity:k>=h?.3:1},children:(0,i.jsx)(d.T,{size:20,colour:n.colours.gold,children:"\u203a"})})]}),(0,i.jsx)(s.default,{style:{flexDirection:'row'},children:y.map(e=>(0,i.jsx)(d.T,{size:12,colour:n.colours.muted,center:!0,style:{flex:1},children:e},e))}),Array.from({length:R.length/7},(t,l)=>(0,i.jsx)(s.default,{style:{flexDirection:'row',gap:4},children:R.slice(7*l,7*l+7).map((t,l)=>{if(!t)return(0,i.jsx)(s.default,{style:{flex:1,height:40}},l);const c=(0,r.ymd)(t),y=c{m(c),x(!1)},style:{flex:1,height:40,borderRadius:10,alignItems:'center',justifyContent:'center',borderWidth:c===p?1.5:0,borderColor:n.colours.gold,backgroundColor:h?n.colours.gold:'transparent',opacity:y?.3:1},children:(0,i.jsx)(d.T,{size:15,weight:h?'bold':'regular',colour:h?n.colours.onGold:f?n.colours.muted:n.colours.text,style:f&&!y?{textDecorationLine:'line-through'}:void 0,children:t.getDate()})},l)})},l)),(0,i.jsx)(d.Muted,{children:"Past dates can\u2019t be booked. Crossed-out days: closed (per the venue\u2019s hours)."})]}):null]})};var t=_r(_d[0]),o=e(_r(_d[1])),s=e(_r(_d[2])),l=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),d=_r(_d[6]),i=_r(_d[7]);function c(e,t){const o=new Date(e);return o.setHours(12,0,0,0),Array.from({length:t},(e,t)=>{const s=new Date(o);return s.setDate(o.getDate()+t),s})}const u=(e,t)=>!!(0,l.hoursFor)(e,t),y=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],h=12},1118,[34,402,102,878,858,821,794,25]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"emptyNeeds",{enumerable:!0,get:function(){return w}}),_e.needsMissing=function(e,l=[]){const s=[];null===e.allergy?s.push('Answer the allergy question first'):'yes'!==e.allergy||e.allergens.length||l.length||e.allergyNote.trim()||s.push('Pick the allergens or describe them');null===e.dog&&s.push('Say whether a dog is coming');return s},_e.needsPatch=function(e,l=[]){const s='yes'===e.allergy?e.allergens.filter(e=>!l.some(l=>l.allergen===e)).map(l=>({allergen:l,severity:e.severity})):[],t=Object.entries(e.holds).filter(([,e])=>e>0).map(([e,l])=>({kind:e.startsWith('item:')?'item':'stock',id:e.slice(5),qty:l})),a=e.dog?Math.max(1,e.dogs):0,n={...e.wheelchair?{wheelchair:e.wheelchair}:{},...e.stepFree?{stepFree:!0}:{},...e.toilet?{toilet:!0}:{},...e.assistDog?{assistDog:!0}:{},...e.accessNote.trim()?{note:e.accessNote.trim()}:{}},r={...e.vegan?{vegan:e.vegan}:{},...e.vegetarian?{vegetarian:e.vegetarian}:{}};return{allergies:[...l,...s],allergyNone:'none'===e.allergy&&!l.length||void 0,allergyPeople:'yes'===e.allergy?e.allergyPeople:void 0,allergyNote:'yes'===e.allergy&&e.allergyNote.trim()?e.allergyNote.trim():void 0,dog:a>0,dogs:a||void 0,access:Object.keys(n).length?n:void 0,diet:Object.keys(r).length?r:void 0,holds:t.length?t:void 0,tableReq:e.tableReq.length?e.tableReq:void 0}},_e.FirstQuestions=function({rid:e,value:l,onChange:a,party:r,audience:i,profile:o=[]}){const y=e=>a({...l,...e}),b=(0,p.usePlan)(e),[x,j]=(0,t.useState)(!1),k=(0,s.dogQuestionOn)((0,u.useRestaurant)(e));(0,t.useEffect)(()=>{k||null!==l.dog||a({...l,dog:!1})},[k,l.dog]);const w=x?m.ALLERGENS:m.ALLERGENS.filter(e=>['gluten','milk','peanuts','treenuts','crustaceans','molluscs','fish','eggs','sesame'].includes(e.id)||l.allergens.includes(e.id)),q=[...o.map(e=>e.allergen),...l.allergens],M=(0,f.dogSetUp)(b);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(R,{tone:"red",testID:"q-allergens",children:[(0,v.jsx)(C,{sub:'guest'===i?'We ask everyone first, so the kitchen can keep you safe.':'Ask every guest first. It goes to the kitchen in red.',children:"\u26a0\ufe0f Does anyone in the party have a food allergy?"}),o.length?(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:o.map(e=>(0,v.jsx)(h.Badge,{kind:"red",label:`${m.ALLERGENS.find(l=>l.id===e.allergen)?.short} (from your profile)`},e.allergen))}):null,(0,v.jsxs)(h.Row,{gap:8,children:[(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"No allergies",selected:'none'===l.allergy,onPress:()=>y({allergy:'none',allergens:[]})})}),(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"Yes, allergies",selected:'yes'===l.allergy,onPress:()=>y({allergy:'yes'})})})]}),'none'===l.allergy&&o.length?(0,v.jsx)(h.Muted,{children:"Your profile allergies above are still shared with the kitchen."}):null,'yes'===l.allergy?(0,v.jsxs)(n.default,{style:{gap:10},testID:"allergen-picker",children:[(0,v.jsx)(h.T,{size:14,weight:"semibold",children:"Which allergens? (the 14 UK allergens)"}),(0,v.jsxs)(h.Row,{wrap:!0,gap:6,children:[w.map(e=>(0,v.jsx)(h.Chip,{label:e.short,selected:l.allergens.includes(e.id)||o.some(l=>l.allergen===e.id),disabled:o.some(l=>l.allergen===e.id),onPress:()=>y({allergens:l.allergens.includes(e.id)?l.allergens.filter(l=>l!==e.id):[...l.allergens,e.id]})},e.id)),x?null:(0,v.jsx)(h.Chip,{label:"All 14\u2026",onPress:()=>j(!0)})]}),(0,v.jsx)(h.T,{size:14,weight:"semibold",children:"How serious?"}),(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:m.SEVERITIES.map(e=>(0,v.jsx)(h.Chip,{label:e.label,selected:l.severity===e.id,onPress:()=>y({severity:e.id})},e.id))}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"How many people with allergies?"}),(0,v.jsx)(h.Stepper,{value:Math.min(l.allergyPeople,r),onChange:e=>y({allergyPeople:e}),min:1,max:Math.max(1,r),label:"people with allergies"})]}),(0,v.jsx)(h.Field,{label:"Anything else the kitchen should know? (optional)",value:l.allergyNote,onChangeText:e=>y({allergyNote:e}),placeholder:"e.g. traces of sesame, one child with coeliac disease",testID:"allergy-note"}),q.length?(0,v.jsx)(c.MenuAllergyCheck,{rid:e,allergens:q,audience:i}):null]}):null]}),k?(0,v.jsxs)(R,{tone:"gold",testID:"q-dogs",children:[(0,v.jsx)(C,{sub:M?'Well-behaved dogs are welcome at our dog-friendly tables.':'staff'===i?'Dog-friendly tables aren\u2019t marked yet (Managers \u203a Booking options), so any table is offered for now.':void 0,children:"\ud83d\udc15 Are you bringing a dog?"}),(0,v.jsxs)(h.Row,{gap:8,children:[(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"No",selected:!1===l.dog,onPress:()=>y({dog:!1})})}),(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"Yes",selected:!0===l.dog,onPress:()=>y({dog:!0,dogs:Math.max(1,l.dogs)})})})]}),l.dog?(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"How many dogs?"}),(0,v.jsx)(h.Stepper,{value:l.dogs,onChange:e=>y({dogs:e}),min:1,max:4,label:"dogs"})]}):null]}):null]})},_e.useReserveAvailability=q,_e.MoreQuestions=function({rid:e,r:l,value:a,onChange:r,party:i,date:o,time:c,today:y,bookings:m,audience:b,showTables:x}){const j=e=>r({...a,...e}),w=l.settings,S=(0,u.useMenu)(e),P=(0,t.useMemo)(()=>S.filter(e=>/\((V|VG|Ve)\)|vegan|vegetarian/i.test(`${e.name} ${e.tags?.join(' ')??''}`)).slice(0,4),[S.length]),N=q(e,l,o,y,m,b),T=e=>a.holds[e]??0,D=(0,f.stockNeed)({holds:Object.entries(a.holds).map(([e,l])=>({kind:e.startsWith('item:')?'item':'stock',id:e.slice(5),qty:l}))},N.items),$=(e,l)=>Math.min(10,...e.map(e=>{const s=(D[e.key]??0)-T(l)*e.qty;return Math.floor(((N.free[e.key]??0)-s)/e.qty)})),I=(e,l,s,t)=>{const r=T(e),i=t<=0&&0===r;return(0,v.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:10,opacity:i?.55:1},testID:`reserve-${e.replace(':','-')}`,children:[(0,v.jsxs)(n.default,{style:{flex:1,minWidth:0},children:[(0,v.jsx)(h.T,{weight:"semibold",children:l}),(0,v.jsx)(h.Muted,{children:i?'Unavailable \u2014 none left for this day':s})]}),i?(0,v.jsx)(h.Badge,{kind:"neutral",label:"Unavailable"}):(0,v.jsx)(h.Stepper,{value:r,onChange:l=>j({holds:{...a.holds,[e]:Math.max(0,Math.min(l,Math.max(r,t)))}}),min:0,max:Math.max(r,Math.min(10,t)),label:l})]},e)},A=N.items.length>0||!1!==w.reserveStock&&N.stock.length>0,O=(0,p.usePlan)(e);return(0,v.jsxs)(v.Fragment,{children:[(0,s.accessQuestionOn)(l)?(0,v.jsxs)(R,{tone:"plain",testID:"q-access",children:[(0,v.jsx)(C,{sub:"Optional. Tell us and we\u2019ll have the right table ready.",children:"\u267f Access needs"}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Wheelchair users"}),(0,v.jsx)(h.Stepper,{value:a.wheelchair,onChange:e=>j({wheelchair:e}),min:0,max:Math.max(1,i),label:"wheelchair users"})]}),(0,v.jsxs)(h.Row,{wrap:!0,gap:6,children:[(0,v.jsx)(h.Chip,{label:"Step-free access",selected:a.stepFree,onPress:()=>j({stepFree:!a.stepFree})}),(0,v.jsx)(h.Chip,{label:"Accessible toilet",selected:a.toilet,onPress:()=>j({toilet:!a.toilet})}),(0,v.jsx)(h.Chip,{label:"Assistance dog",selected:a.assistDog,onPress:()=>j({assistDog:!a.assistDog})})]}),(0,v.jsx)(h.Field,{label:"Anything else? (optional)",value:a.accessNote,onChangeText:e=>j({accessNote:e}),placeholder:"e.g. needs a chair with arms"}),w.accessStatement?.trim()?(0,v.jsx)(h.Muted,{children:w.accessStatement.trim()}):null]}):null,(0,s.dietQuestionOn)(l)?(0,v.jsxs)(R,{tone:"plain",testID:"q-veg",children:[(0,v.jsx)(C,{sub:"We\u2019d love to look after you. Optional.",children:"\u24cb Any vegans or vegetarians?"}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Vegan"}),(0,v.jsx)(h.Stepper,{value:a.vegan,onChange:e=>j({vegan:e}),min:0,max:Math.max(1,i),label:"vegans"})]}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Vegetarian"}),(0,v.jsx)(h.Stepper,{value:a.vegetarian,onChange:e=>j({vegetarian:e}),min:0,max:Math.max(1,i),label:"vegetarians"})]}),!1!==w.vegTeaser&&P.length&&(a.vegan||a.vegetarian)?(0,v.jsxs)(h.Muted,{children:["On the menu: ",P.map(e=>e.name).join(' \xb7 ')]}):null]}):null,A?(0,v.jsxs)(R,{tone:"gold",testID:"q-reserve",children:[(0,v.jsx)(C,{sub:N.known?'Held for you from today\u2019s count.':o>y||'guest'===b?'Held for you; the kitchen confirms and orders in.':void 0,children:"\ud83e\udd9e Reserve with your table"}),N.items.map(e=>I(`item:${e.id}`,`${e.name}${k(e.price)}`,e.description||e.uses.map(e=>`${e.qty} ${N.stock.find(l=>l.key===e.key)?.name.toLowerCase()??e.key}`).join(' + '),$(e.uses,`item:${e.id}`))),!1!==w.reserveStock?N.stock.map(e=>I(`stock:${e.key}`,`Reserve ${e.name.toLowerCase()}`,N.known?`${N.free[e.key]} available today`:'Held for the kitchen to order',$([{key:e.key,qty:1}],`stock:${e.key}`))):null,'staff'===b&&N.known?(0,v.jsxs)(h.Muted,{children:["Today: ",N.stock.map(e=>`${N.free[e.key]} ${e.plural.toLowerCase()} free (${N.reserved[e.key]??0} reserved)`).join(' \xb7 ')]}):null]}):null,x&&!1!==w.tableRequests&&O.tables.length?(0,v.jsx)(M,{rid:e,value:a,onChange:r,party:i,hide:w.tableRequestHide??[]}):null]})},_e.dogTimeOk=function(e,l,s,t,a){if(!a)return!0;const n=e.settings.maxDogsPerSlot;return!n||(0,f.dogsAt)(l,s,t)+a<=n},Object.defineProperty(_e,"accessibleSetUp",{enumerable:!0,get:function(){return f.accessibleSetUp}});var e,l=_r(d[0]),s=_r(d[1]),t=_r(d[2]),a=_r(d[3]),n=(e=a)&&e.__esModule?e:{default:e},r=_r(d[4]),i=_r(d[5]),o=_r(d[6]),c=_r(d[7]),h=_r(d[8]),u=_r(d[9]),p=_r(d[10]),y=_r(d[11]),m=_r(d[12]),b=_r(d[13]),x=_r(d[14]),f=_r(d[15]),j=_r(d[16]),v=_r(d[17]);const k=e=>'display'===x.APP_VARIANT?'':` \xb7 ${(0,b.gbp)(e)}`,w=()=>({allergy:null,allergens:[],severity:'allergy',allergyPeople:1,allergyNote:'',dog:null,dogs:1,wheelchair:0,stepFree:!1,toilet:!1,assistDog:!1,accessNote:'',vegan:0,vegetarian:0,holds:{},tableReq:[]});const R=({children:e,tone:l,testID:s})=>(0,v.jsx)(n.default,{testID:s,style:{gap:10,padding:16,borderRadius:16,borderWidth:'plain'===l?1:1.5,borderColor:'red'===l?j.colours.red:'gold'===l?j.colours.accentBorder:j.colours.hairline,backgroundColor:'red'===l?'#1E1110':j.colours.surface},children:e}),C=({children:e,sub:l})=>(0,v.jsxs)(n.default,{style:{gap:2},children:[(0,v.jsx)(h.T,{weight:"semibold",size:17,children:e}),l?(0,v.jsx)(h.Muted,{children:l}):null]});function q(e,l,s,t,a,n,i){const o=(0,f.reservablesOf)(l),c=(0,y.useStockItems)(e),h=(0,y.useShellStore)((0,r.useShallow)(l=>(0,y.venueCounts)(l,e))),u=(0,y.useShellStore)(l=>!!l.server[e]),p=(0,f.reservedOn)(a,s,o,i),m=s===t&&('staff'===n||u),b={};for(const e of c)b[e.key]=m?Math.max(0,Math.floor((h[e.key]??0)-(p[e.key]??0))):1/0;return{items:o,stock:c,free:b,reserved:p,known:m}}function M({rid:e,value:s,onChange:a,party:r,hide:c}){const u=(0,p.usePlan)(e),y=u.areas.filter(e=>u.tables.some(l=>l.areaId===e.id&&!c.includes(l.name))),[m,b]=(0,t.useState)(y[0]?.id??''),x=s.dog?s.dogs:0,k=e=>c.includes(e)?'Not bookable':(0,f.tableBlockReason)(u,e,r,x,s.wheelchair>0||s.stepFree),w=Object.fromEntries(u.tables.map(e=>[e.name,{table:e,status:k(e.name)?'blocked':'free',covers:0,allergy:!1}])),q=e=>{if(k(e))return;const l=s.tableReq.includes(e)?s.tableReq.filter(l=>l!==e):[...s.tableReq,e].slice(-2);a({...s,tableReq:l})},M=u.tables.filter(e=>e.areaId===m&&!c.includes(e.name));return(0,v.jsxs)(R,{tone:"plain",testID:"q-table",children:[(0,v.jsx)(C,{sub:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best.",children:"\ud83e\ude91 Request a table (optional)"}),y.length>1?(0,v.jsx)(i.AreaTabs,{plan:u,area:m,onPick:b}):null,(0,v.jsx)(n.default,{testID:"q-table-plan",style:{height:240,borderRadius:12,overflow:'hidden',borderWidth:1,borderColor:j.colours.hairline},children:(0,v.jsx)(o.FloorCanvas,{plan:u,areaId:m,mode:"live",view:w,privacy:!0,fit:"contain",crop:!0,maxH:260,highlight:s.tableReq,onTap:e=>q(e.name)})}),(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:M.map(e=>{const t=k(e.name),a=s.tableReq.indexOf(e.name);return(0,v.jsx)(h.Chip,{label:`${(0,l.tableNumbers)(e.name)}`,sub:t||(0===a?'1st choice':1===a?'2nd choice':`${e.maxSeats} seats`),selected:a>=0,disabled:!!t,onPress:()=>q(e.name)},e.name)})}),s.tableReq.length?(0,v.jsxs)(h.T,{size:14,colour:j.colours.goldLight,children:["Requested: ",s.tableReq.map((e,s)=>`${(0,l.tableNumbers)(e)}${s?' (2nd choice)':''}`).join(', ')]}):(0,v.jsx)(h.Muted,{children:"Tap a table; tap another for a second choice."})]})}},1119,[860,877,34,102,879,1120,1121,1123,794,874,1021,984,861,867,872,1091,821,25]); __d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"areaMarks",{enumerable:!0,get:function(){return n}}),_e.AreaTabs=function({plan:o,area:e,onPick:u,counts:a,closed:b}){return(0,c.jsx)(t.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:o.areas.map(o=>{const h=o.id===e,f=b?.has(o.id);return(0,c.jsx)(l.default,{testID:`area-${o.id}`,accessibilityRole:"tab",accessibilityLabel:`Area ${o.name}${o.dogs?', dogs allowed':''}${o.outdoor?', outdoor':''}${f?', closed for weather':''}`,accessibilityState:{selected:h},onPress:()=>u(o.id),style:{maxWidth:'100%',minWidth:0,flexShrink:1,minHeight:48,paddingHorizontal:16,borderRadius:24,borderWidth:1.5,borderColor:h?s.colours.gold:f?s.colours.blue:s.colours.border,backgroundColor:h?s.colours.gold:s.colours.surface,justifyContent:'center'},children:(0,c.jsxs)(t.T,{weight:"semibold",size:15,colour:h?s.colours.onGold:s.colours.text,children:[o.name,n(o),f?(0,c.jsx)(t.T,{size:12,colour:h?s.colours.onGold:s.colours.blue,children:" closed"}):null,a?.[o.id]?(0,c.jsxs)(t.T,{size:12,colour:h?s.colours.onGold:s.colours.muted,children:[" ",a[o.id]]}):null]})},o.id)})})},r(d[0]);var o,e=r(d[1]),l=(o=e)&&o.__esModule?o:{default:o},s=r(d[2]),t=r(d[3]),c=r(d[4]);const n=o=>`${o.dogs?' \ud83d\udc3e':''}${o.outdoor?' \ud83c\udf26':''}`},1120,[34,402,821,794,25]); @@ -1295,7 +1295,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useChefAssistant",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"CHEF_PROMPTS",{enumerable:!0,get:function(){return P}}),_e.ChefAssistantButton=function({compact:e}){return e?(0,S.jsx)(u.default,{testID:"chef-assistant-open",accessibilityRole:"button",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0),style:{borderRadius:12,backgroundColor:w.colours.accentBg,borderWidth:1,borderColor:w.colours.accentBorder,paddingVertical:6,paddingHorizontal:12,minHeight:36,justifyContent:'center'},children:(0,S.jsx)(m.T,{weight:"semibold",colour:w.colours.goldLight,size:13,children:"\u2726 Assistant"})}):(0,S.jsx)(d.ActionTile,{primary:!0,testID:"chef-assistant-open",icon:"sparkle",label:"Assistant",sub:"Recipe card, order, allergens, GP, temps",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0)})},_e.ChefAssistantSheet=function({go:e}){const l=I(e=>e.open),d=()=>I.getState().setOpen(!1),{rid:f,me:W,menu:L,k:B,c:F}=(0,$.useChef)(3e4),G=(0,T.useSuggestions)(),E=(0,r.useSafetyView)('chef').points,[M,H]=(0,o.useState)([]),[N,_]=(0,o.useState)(''),[V,K]=(0,o.useState)(!1),[Y,q]=(0,o.useState)(!1),Q=(0,o.useRef)(null),U=(0,o.useRef)(null);if((0,o.useEffect)(()=>{setTimeout(()=>Q.current?.scrollToEnd?.({animated:!0}),50)},[M.length]),!l)return null;const J=(e,t=!1)=>H(n=>[...n,{id:R(),from:'bot',text:e,demo:t}]),X=e=>H(t=>[...t,{id:R(),from:'bot',plan:e,state:'open'}]),Z=L.filter(e=>!e.name.includes('(example)')||!0),ee=(t,n)=>{const r=A(t);if(!(0,s.chefCanSee)(f,t))return void J('That check is managed in the Managers app.');if(/\b(send|email|text|pay|delete|remove|order now|place the order)\b/.test(r)&&!/\b(build|draft|make|prepare)\b/.test(r))return void J('I can\u2019t send, pay for or delete anything. I can prepare it for you to check and do yourself, for example \u201cbuild the fish order\u201d.');const o=(0,y.parseQuick)(t,E).filter(e=>e.point&&(0,y.isTempKind)(e.point.kind));if(o.length&&(/\b(fridge|freezer|walk ?in|core|probe|cool|hot|deliver|degree|temp)/.test(r)||o.some(e=>null!=e.value))){const t=o.filter(e=>null!=e.value),r=o.filter(e=>null==e.value);if(r.length&&J(`I didn\u2019t hear a temperature for ${r.map(e=>e.point.name).join(', ')}. Say or type the reading, for example \u201c${r[0].point.name} 4 degrees\u201d. I never fill one in.`),!t.length)return;const s=t.filter(e=>!(0,y.inRange)(e.point,e.value));return void X({title:`Log ${1===t.length?'a reading':`${t.length} readings`} in the food safety log`,detail:t.map(e=>`${e.point.name}: ${e.value}\xb0C (${(0,y.limitText)(e.point)})${(0,y.inRange)(e.point,e.value)?'':' \xb7 OUT OF RANGE'}`).join('\n')+`\nSigned ${(0,y.initialsOf)(W)} \xb7 ${n?'voice':'typed'}`,warn:s.length?`${s.map(e=>e.point.name).join(', ')} out of range: you\u2019ll need to add the corrective action in the food safety log.`:void 0,confirm:'Log it',run:()=>{const r=(new Date).toISOString();return v.useSafety.getState().addEntries(t.map(e=>({pointId:e.point.id,name:e.point.name,kind:e.point.kind,at:r,by:W.replace(' (example)',''),byId:$.CHEF_ID,app:'chef',value:e.value,ok:(0,y.inRange)(e.point,e.value),source:n?'voice':'typed',initials:(0,y.initialsOf)(W)}))),s.length&&setTimeout(()=>e('haccp'),600),`Logged ${t.map(e=>`${e.point.name} ${e.value}\xb0C`).join(', ')}.${s.length?' Opening the food safety log for the corrective action.':''}`}})}if(/\b(fridge|freezer|temp|temperature|degrees)\b/.test(r))return void J('Which unit, and what does it read? For example \u201cprep fridge 4 degrees\u201d or \u201cfreezer minus 19\u201d. I only log the number you give me.');if(/allergen|allerg|contain|gluten|nut|dairy|milk|shellfish|crustacean|coeliac/.test(r)){const e=D(t,Z,e=>e.name);if(!e)return void J('Which dish? For example \u201callergens in the fish and chips\u201d.');const n=(0,j.recipeCards)().byMenuItem(e.id),r=e=>b.ALLERGENS.find(t=>t.id===e)?.label??e,s=Object.entries(e.allergens??{}).filter(([,e])=>'contains'===e).map(([e])=>r(e)),a=Object.entries(e.allergens??{}).filter(([,e])=>'may'===e).map(([e])=>r(e));return void J(`${e.name}: ${s.length?`contains ${s.join(', ')}`:'no allergens recorded as \u201ccontains\u201d'}${a.length?`; may contain ${a.join(', ')}`:''}. ${n?n.signOff?`From the signed-off recipe card (${n.signOff.by}).`:'The recipe card is awaiting your sign-off, so check it before telling a guest.':'There\u2019s no recipe card for it yet.'} Always check the card and the ingredients with the guest.`)}if(/\bgp\b|gross profit|margin|price for|what price|cost of|costing/.test(r)){const e=D(t,F,e=>e.item.name),n=Number((t.toLowerCase().match(/(\d{2})\s*(?:%|percent|per cent)/)??[])[1])||B.targetGp;if(!e)return void J(`Which dish? I can cost the dishes that have a recipe in GP & costing (${F.length} do). For example \u201cGP on the haddock\u201d.`);const r=(0,C.priceForTarget)(e.cost,n);return void J(`${e.item.name}: food cost ${(0,x.gbp)(e.cost)}, sells at ${(0,x.gbp)(e.priceInc)} (inc VAT) = ${e.gp.toFixed(1)}% GP. For ${n}% GP it would need ${(0,x.gbp)(r)} inc VAT. Prices are changed by a manager; I haven\u2019t changed anything.`)}if(/\border|supplier|delivery|par\b|restock/.test(r)){const n=D(t,G,e=>`${e.s.name} ${e.s.category??''}`)??(1===G.length?G[0]:void 0);return n?void X({title:`Build an order for ${n.s.name}`,detail:(n.lines.length?n.lines.map(e=>`${e.i.name}: ${(0,a.fishQtyText)(f,e.i,e.qty)}`).join('\n')+`\nAbout ${(0,x.gbp)(n.total)} at the latest prices.`:'Nothing is below par for this supplier yet.')+'\nI\u2019ll open it in Ordering for you to check, change and place yourself. Nothing is sent.',confirm:'Open the order',run:()=>(setTimeout(()=>{d(),e('orders',n.s.id)},400),`Opening the ${n.s.name} order. You check it and place it yourself.`)}):void J(G.length?`Which supplier? ${G.map(e=>e.s.name).join(', ')}.`:'Nothing is below par and no supplier orders today.')}if(/recipe|card|new dish|write up|spec/.test(r)){const n=t.replace(/^.*?(?:recipe card|card|recipe|dish|spec)\s*(?:for|of)?\s*/i,'').replace(/[.?!]+$/,'').trim();if(!n||n.length<3)return void J('What\u2019s the dish called? For example \u201cdraft a recipe card for crab linguine\u201d.');const r=n.replace(/^the\s+/i,'').replace(/^./,e=>e.toUpperCase()).slice(0,60),s=(0,j.recipeCards)().list(f).find(e=>A(e.dish)===A(r));return s?(J(`There\u2019s already a card for ${s.dish}. Opening Recipe cards.`),void setTimeout(()=>{d(),e('recipes')},600)):void X({title:`Draft a recipe card: ${r}`,detail:'A new card, awaiting your sign-off, with the dish name and section filled in. You add the ingredients, method, allergens, photo and price, then sign it off. It isn\u2019t shown to guests until you do.',confirm:'Make the draft',run:async()=>(await(0,j.recipeCards)().create(f,{dish:r,section:'Specials',price:null,ingredients:[],steps:[]},{name:W,role:'head-chef'}),setTimeout(()=>{d(),e('recipes')},500),`Draft card for ${r} saved, awaiting sign-off. Opening Recipe cards.`)})}const l='I can help with: drafting a recipe card, building a supplier order, a dish\u2019s allergens, GP pricing, and logging a temperature you read out. Try one of the suggestions.';(0,k.askServer)('chef',t,[]).then(e=>J('text'===e.kind?e.text:l)).catch(()=>J(l))},te=(e,t=!1)=>{const n=e.trim();if(n){_(''),H(e=>[...e,{id:R(),from:'you',text:n}]);try{ee(n,t)}catch(e){J(`Sorry, that didn\u2019t work: ${e.message}`)}}},ne=async e=>{if(e.plan){H(t=>t.map(t=>t.id===e.id?{...t,state:'done'}:t));try{J(String(await e.plan.run()))}catch(e){J(`Couldn\u2019t do that: ${e.message}`)}}},ie=e=>{H(t=>t.map(t=>t.id===e.id?{...t,state:'cancelled'}:t)),J('Cancelled. Nothing was changed.')},re=()=>{te(N,Y),q(!1)};return(0,S.jsx)(c.default,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:d,children:(0,S.jsx)(p.default,{style:[m.styles.overlay,{justifyContent:'flex-end',padding:0}],children:(0,S.jsxs)(p.default,{testID:"chef-assistant",style:{backgroundColor:w.colours.surface,borderTopLeftRadius:18,borderTopRightRadius:18,borderWidth:1,borderColor:w.colours.border,width:'100%',maxWidth:640,alignSelf:'center',maxHeight:'92%',minHeight:'70%',padding:14,gap:10},children:[(0,S.jsxs)(m.Row,{style:{justifyContent:'space-between'},children:[(0,S.jsx)(m.T,{size:20,weight:"semibold",children:"\u2726 Kitchen Assistant"}),(0,S.jsx)(n.GoldClose,{testID:"chef-assistant-close",onPress:d,style:{marginRight:-6}})]}),(0,S.jsx)(p.default,{testID:"chef-assistant-demo",children:(0,S.jsx)(m.Badge,{kind:"amber",label:O})}),(0,S.jsxs)(h.default,{ref:Q,style:{flex:1},contentContainerStyle:{gap:10,paddingBottom:6},keyboardShouldPersistTaps:"handled",children:[0===M.length?(0,S.jsxs)(p.default,{style:{gap:8},children:[(0,S.jsxs)(m.T,{children:["Hi ",W.split(' ')[0],". Type or tap \ud83c\udfa4 and say what you need. I\u2019ll show you what I\u2019m about to do and wait for you to confirm. I never send, pay or delete."]}),P.map(e=>(0,S.jsx)(u.default,{accessibilityRole:"button",onPress:()=>te(e),style:{borderWidth:1,borderColor:w.colours.border,borderRadius:12,paddingVertical:9,paddingHorizontal:12,backgroundColor:w.colours.surface2},children:(0,S.jsx)(m.T,{size:14,children:e})},e))]}):null,M.map(e=>'you'===e.from?(0,S.jsx)(p.default,{style:{alignSelf:'flex-end',maxWidth:'85%',backgroundColor:'#3A2F12',borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id):e.plan?(0,S.jsxs)(p.default,{testID:"chef-confirm-card",style:{borderWidth:1.5,borderColor:'open'===e.state?w.colours.gold:w.colours.border,borderRadius:14,padding:12,gap:8,backgroundColor:w.colours.surface2},children:[(0,S.jsx)(m.T,{weight:"semibold",children:e.plan.title}),(0,S.jsx)(m.T,{size:14,colour:w.colours.muted,children:e.plan.detail}),e.plan.warn?(0,S.jsxs)(m.T,{size:13,colour:w.colours.amber,children:["\u26a0 ",e.plan.warn]}):null,'open'===e.state?(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(m.Button,{small:!0,testID:"chef-confirm",label:e.plan.confirm,onPress:()=>ne(e)}),(0,S.jsx)(m.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ie(e)})]}):(0,S.jsx)(m.Badge,{kind:'done'===e.state?'ok':'neutral',label:'done'===e.state?'Confirmed':'Cancelled: nothing done'}),'open'===e.state?(0,S.jsxs)(m.Muted,{children:["Nothing happens until you tap ",e.plan.confirm,"."]}):null]},e.id):(0,S.jsx)(p.default,{testID:"chef-assistant-reply",style:{alignSelf:'flex-start',maxWidth:'92%',backgroundColor:w.colours.surface2,borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id))]}),(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(t.TextInput,{testID:"chef-assistant-input",accessibilityLabel:"Ask the Assistant",placeholder:"Type a kitchen task\u2026",placeholderTextColor:"#7D776C",value:N,onChangeText:e=>{_(e),e||q(!1)},onSubmitEditing:re,returnKeyType:"send",style:[m.styles.input,{flex:1,minWidth:0,width:40}]}),(0,S.jsx)(u.default,{testID:"chef-assistant-mic",accessibilityRole:"button",accessibilityLabel:V?'Stop listening':'Speak',onPress:()=>{const e=z();if(e)if(V)U.current?.stop?.();else try{const t=new e;U.current=t,t.lang='en-GB',t.interimResults=!1,t.maxAlternatives=1,t.onresult=e=>{const t=e.results?.[0]?.[0]?.transcript;t&&(_(t),q(!0))},t.onend=()=>K(!1),t.onerror=()=>{K(!1),J('Sorry, I didn\u2019t catch that. You can type instead.')},K(!0),t.start()}catch{K(!1),J('Voice input isn\u2019t available here. Please type instead.')}else J('Voice input isn\u2019t available in this browser. Please type instead.')},style:{width:48,height:48,borderRadius:24,borderWidth:1.5,borderColor:w.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:V?w.colours.gold:'transparent'},children:(0,S.jsx)(m.T,{size:20,children:"\ud83c\udfa4"})}),(0,S.jsx)(m.Button,{label:"Send",disabled:!N.trim(),onPress:re})]}),(0,S.jsx)(m.Muted,{center:!0,children:"Every action waits for your Confirm \xb7 nothing is sent, paid or deleted"})]})})})};var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),s=_r(_d[3]),a=_r(_d[4]),o=_r(_d[5]),l=_r(_d[6]),d=_r(_d[7]),c=e(_r(_d[8]));_r(_d[9]);var u=e(_r(_d[10])),h=e(_r(_d[11])),p=e(_r(_d[12])),f=_r(_d[13]),m=_r(_d[14]),b=_r(_d[15]),y=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),v=_r(_d[19]),w=_r(_d[20]),$=_r(_d[21]),C=_r(_d[22]),T=_r(_d[23]),k=_r(_d[24]),S=_r(_d[25]);const I=(0,f.create)(e=>({open:!1,setOpen:t=>e({open:t})})),R=()=>Math.random().toString(36).slice(2,9),P=['Draft a recipe card for crab linguine','Build the fish order','What allergens are in the fish and chips?','What price gives 70% GP on the lobster?','Walk-in fridge 3.5 degrees'],O='The secure AI server: not set up yet',A=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').replace(/\s+/g,' ').trim(),W=new Set(['the','and','with','for','our','house','served','side','of','in','on','from']);function D(e,t,n){const r=` ${A(e)} `;let s,a=0;for(const e of t){const t=A(n(e).replace(/\(example\)/i,'')).split(' ').filter(e=>e.length>2&&!W.has(e)),o=t.filter(e=>r.includes(` ${e} `)||r.includes(` ${e}s `)).length,l=t.length?o/t.length+.01*o:0;o&&l>a&&(s=e,a=l)}return s}function z(){return'undefined'==typeof window?null:(0,l.speechRecognizer)()}},1212,[827,796,1184,835,985,34,932,1170,395,236,402,295,102,846,794,861,1027,867,882,1026,821,1138,1132,1157,933,25]); __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTTOM_TABS_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.BottomTabs=function({tabs:e,active:b,onPress:y,background:x,tablist:p}){const{width:j}=(0,s.default)(),v=j/Math.max(1,e.length),w=v>=60?11:10,I=v<56?20:22,[F,S]=(0,t.useState)({}),[H,_]=(0,t.useState)(0),M=H>0&&e.some(e=>(F[e.id]??0)>H-6),z={flexDirection:'row',flexWrap:'nowrap',alignItems:'stretch',borderTopWidth:1,borderColor:c.colours.border,backgroundColor:x};return(0,f.jsx)(l.default,{testID:"app-bottom-tabs",accessibilityRole:p?'tablist':void 0,style:z,children:e.map(t=>{const s=b===t.id,x=s?c.colours.gold:c.colours.muted;return(0,f.jsxs)(n.default,{onLayout:t===e[0]?e=>_(e.nativeEvent.layout.width):void 0,testID:`tab-${t.id}`,accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:t.a11y??t.label,onPress:()=>y(t.id),style:{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:44,minHeight:h,alignItems:'center',justifyContent:'center',paddingVertical:4,paddingHorizontal:1,gap:2},children:[(0,f.jsxs)(l.default,{style:{width:I,height:I,alignItems:'center',justifyContent:'center'},children:[(0,f.jsx)(u.Icon,{name:t.icon,size:I,colour:x}),t.badge?(0,f.jsx)(l.default,{testID:t.badge.testID,style:{position:'absolute',right:-10,top:-5,backgroundColor:t.badge.bg,borderRadius:8,minWidth:16,height:16,paddingHorizontal:3,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(o.default,{style:{fontFamily:c.fonts.bold,fontSize:10,lineHeight:12,color:t.badge.fg??'#FFFFFF'},children:t.badge.text})}):null]}),(0,f.jsx)(l.default,{pointerEvents:"none","aria-hidden":!0,importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,style:{position:'absolute',left:0,top:0,width:0,height:0,overflow:'hidden',opacity:0},children:(0,f.jsx)(l.default,{style:{width:400,flexDirection:'row',alignItems:'flex-start'},children:(0,f.jsx)(o.default,{onLayout:e=>{const n=Math.ceil(e.nativeEvent.layout.width);S(e=>e[t.id]===n?e:{...e,[t.id]:n})},style:{fontFamily:c.fonts.semibold,fontSize:w,lineHeight:Math.round(1.3*w),flexShrink:0},children:t.short??t.label})})}),M?null:(0,f.jsx)(o.default,{numberOfLines:1,style:{fontFamily:s?c.fonts.semibold:c.fonts.regular,fontSize:w,lineHeight:Math.round(1.3*w),color:x,textAlign:'center',alignSelf:'center',maxWidth:'100%'},children:t.short??t.label})]},t.id)})})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=r(d[5]),u=r(d[6]),f=r(d[7]);const h=56},1213,[34,402,346,102,426,821,1171,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return(0,u.canShow)('chef')?(0,c.jsx)(n.ChefApp,{}):(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]})}},1214,[30,34,792,872,25]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return B}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=(e=r)&&e.__esModule?e:{default:e},u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),S=_r(_d[19]),w=_r(_d[20]),D=_r(_d[21]),T=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]),P=_r(_d[25]),M=_r(_d[26]);function B(){const{rid:e,date:r}=(0,n.useLocalSearchParams)(),B=(0,x.useRestaurant)(e),O=(0,x.useCustomer)(),A=(0,x.useBookings)(e),N=(0,x.useEvents)(e),z=(0,x.useNow)(6e4),[R]=(0,l.useState)(()=>(0,a.startForm)()),[F,I]=(0,l.useState)(''),[q,E]=(0,l.useState)(2),[H,W]=(0,l.useState)(r??(0,k.ymd)(z)),[L,_]=(0,l.useState)(null),[Y,U]=(0,l.useState)(O.name),[G,Q]=(0,l.useState)(O.phone??''),[V,J]=(0,l.useState)(O.email??''),[K,X]=(0,l.useState)(!1),[Z,ee]=(0,l.useState)(''),[te,oe]=(0,l.useState)(!1),[se,ne]=(0,l.useState)([]),[le,ie]=(0,l.useState)(!1),ae=[...O.allergies,...se.filter(e=>!O.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[re,de]=(0,l.useState)(null),ue=(0,D.useBlocks)(e=>e.blocks);(0,j.usePublicDayStore)(e=>e.n);const ce=e?(0,j.publicDay)(e,H):null,he=ce?[...ce.bookings,...A.filter(e=>e.date!==H)]:A,me=ce?[...ue.filter(t=>t.rid!==e||t.date!==H),...ce.blocks]:ue,ge=(0,T.usePlan)(e),[pe,be]=(0,l.useState)((0,$.emptyNeeds)()),fe=!0===pe.dog,ye=fe?pe.dogs:0,ke=(0,l.useMemo)(()=>{const e=[],t=new Date(z);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return r&&!e.some(e=>(0,k.ymd)(e)===r)&&e.push((0,k.parseYmd)(r)),e},[z.toDateString(),r]);if(!B)return(0,M.jsx)(h.Screen,{title:"Not found",children:(0,M.jsx)(h.T,{children:"Restaurant not found."})});const xe=B.settings,je=(0,k.parseYmd)(H),ve=(0,D.blocksOn)(me,B.id,H),Se=he.filter(e=>e.date===H),we=ge.areas.filter(e=>e.dogs),De=(0,P.dogSetUp)(ge),Te=e=>(0,C.freeTablesAt)(ge,Se,q,new Date(`${H}${(0,t.tableNumbers)(e)}:00`),(0,C.turnFor)(q,xe.turnMins),xe.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(me,B.id,H,e)}),Ce=(0,y.bookingSlots)(B,je,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),q,z).map(e=>{const t=(0,D.blockAt)(me,B.id,H,e.time),o=fe&&De&&e.available&&!t&&(!Te(e.time).length||!(0,$.dogTimeOk)(B,he,H,e.time,ye));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),$e=Ce.some(e=>e.available),Pe=(0,u.depositOf)(xe),Me=(0,u.depositDue)(Pe,q),Be=Me>0?'deposit':'none',Oe=(0,u.depositWords)(Pe,q,B.name),Ae=N.filter(e=>e.date===H),Ne=(0,w.ukPhone)(G),ze=(0,w.emailOk)(V),Re=(0,$.needsMissing)(pe,O.allergies),Fe=!!L&&te&&!Re.length&&Y.trim().length>1&&Ne.ok&&ze,Ie=async()=>{const e=(0,$.needsPatch)(pe,O.allergies),t=fe&&De?Te(L).map(e=>e.table):[],o=fe?pe.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await x.repo.bookings.create({restaurantId:B.id,customerId:O.id,name:Y,partySize:q,date:H,time:L,notes:Z.trim(),security:Be,depositPaid:0,...Me?{depositDue:Me,depositPolicy:Oe.join(' '),depositRefundable:Pe.refundable,depositCutoffHours:Pe.cutoffHours}:{},phone:Ne.pretty,email:V.trim()||void 0,source:'online',...e,...Ce.find(e=>e.time===L)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??ae,...o?{table:o}:{}});(0,a.rememberGuard)(s.id,(0,a.guardFor)({...R,hp:F})),de(s)},qe=(0,x.useStore)(e=>re?e.bookings.find(e=>e.id===re.id)?.ref:void 0),Ee=e=>(0,S.waMeLink)(B.settings.whatsapp,(0,S.guestWhatsAppText)({name:e.name,ref:qe??e.ref,date:e.date,time:e.time,partySize:e.partySize},B.name));if(re){const e='pending'===re.status;return(0,M.jsxs)(h.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:B.name,children:[(0,M.jsx)(h.Banner,{kind:e?'info':'success',title:`Reference ${qe??re.ref}`,children:`${re.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(re.date))} at ${re.time}`}),e?(0,M.jsx)(h.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(h.T,{children:["Name: ",re.name]}),(0,M.jsxs)(h.T,{children:["Mobile: ",re.phone]}),re.email?(0,M.jsxs)(h.T,{children:["Email: ",re.email]}):null,(0,M.jsxs)(h.T,{children:["Allergies shared with the restaurant: ",re.allergies.length?re.allergies.map(e=>`${(0,p.allergenLabel)(e.allergen)} (${(0,p.severityLabel)(e.severity)})`).join(', '):'none']}),re.notes?(0,M.jsxs)(h.T,{children:["Notes: ",re.notes]}):null,re.dog?(0,M.jsxs)(h.T,{children:["\ud83d\udc15 Dog coming too",re.table?` \xb7 dog-friendly table ${re.table}`:'']}):null,re.holds?.length?(0,M.jsxs)(h.T,{children:["Reserved: ",re.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(B.settings.reservables??P.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,re.tableReq?.length?(0,M.jsxs)(h.T,{children:["Table requested: ",re.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===re.security&&re.depositDue?(0,M.jsxs)(h.T,{weight:"semibold",children:["Deposit due: ",(0,f.gbp)(re.depositDue),". ",B.name," will tell you how to pay it."]}):null,'deposit'===re.security&&re.depositPolicy?(0,M.jsx)(h.Muted,{children:re.depositPolicy}):null,(0,M.jsx)(h.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,M.jsxs)(h.Muted,{children:["Need to change or cancel? Call ",B.phone," and quote ",qe??re.ref,"."]})]}),Ee(re)?(0,M.jsxs)(d.default,{style:{gap:4},children:[(0,M.jsx)(h.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ee(re);e&&(0,S.openWhatsApp)(e)}}),(0,M.jsx)(h.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,M.jsx)(h.Button,{label:"Back to restaurant",onPress:()=>n.router.replace(`/customer/${B.id}`)})]})}return(0,M.jsxs)(h.Screen,{title:"Book a table",subtitle:B.name,footer:(0,M.jsx)(h.Button,{label:Re.length?Re[0]:q>(xe.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Fe,onPress:()=>Ie(),testID:"confirm-booking"}),children:[(0,M.jsx)($.FirstQuestions,{rid:B.id,value:pe,onChange:e=>{e.dog===pe.dog&&e.dogs===pe.dogs||_(null),be(e)},party:q,audience:"guest",profile:O.allergies}),(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(d.default,{style:{gap:6,alignItems:'center'},children:[(0,M.jsx)(h.H2,{children:"Party size"}),(0,M.jsx)(o.PartySizeInput,{value:q,onChange:e=>{E(e),_(null)},label:"Party size",testID:"party-size"})]}),Me?(0,M.jsx)(h.Banner,{kind:"info",title:`Deposit: ${(0,f.gbp)(Me)} for ${q} guests`,children:(0,M.jsx)(d.default,{style:{gap:4},children:Oe.map(e=>(0,M.jsx)(h.T,{size:13,children:e},e))})}):Pe.on&&Pe.perPersonPence>0?(0,M.jsxs)(h.Muted,{children:["No deposit for fewer than ",Pe.fromParty," guests."]}):null,q>(xe.autoAcceptUpTo??7)?(0,M.jsxs)(h.Muted,{children:["For ",q," people the team checks the booking first, then texts you to confirm."]}):null,fe&&De?(0,M.jsxs)(h.Muted,{children:["Dogs are welcome in the ",we.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",B.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Date"}),(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:ke.map(e=>{const t=!!(0,b.hoursFor)(B,e),o=N.some(t=>t.date===(0,k.ymd)(e));return(0,M.jsx)(h.Chip,{label:(0,k.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:H===(0,k.ymd)(e),onPress:()=>{W((0,k.ymd)(e)),_(null)}},(0,k.ymd)(e))})}),Ae.map(e=>(0,M.jsx)(h.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Time"}),0===Ce.length?(0,M.jsx)(h.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:Ce.map(e=>(0,M.jsx)(h.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left_(e.time)},e.time))}),ve.length>0&&Ce.some(e=>e.blocked)?(0,M.jsx)(h.Banner,{kind:"info",title:$e?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${ve.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(je)}. Please give us a ring on ${B.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,s.lastFoodOn)(B,H);return e&&Ce.some(e=>e.drinksOnly)?(0,M.jsx)(h.Banner,{kind:"info",title:`Last food orders ${(0,s.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),fe&&Ce.some(e=>e.noDog)?(0,M.jsx)(h.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${we.map(e=>e.name).join(' and ')}${B.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,D.closedAreasAt)(me,B.id,H,L??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,M.jsxs)(h.Muted,{children:["Times are every ",(0,y.bookingSlotMinutesOf)(B)," minutes. Covers per slot (",xe.bookingCoversPerSlot," per half hour) and table rules still apply."]})]}),(0,M.jsx)($.MoreQuestions,{rid:B.id,r:B,value:pe,onChange:be,party:q,date:H,time:L,today:(0,k.ymd)(z),bookings:he,audience:"guest",showTables:!0}),(0,M.jsxs)(h.Card,{highlight:te?void 0:v.colours.amber,children:[(0,M.jsx)(h.Field,{label:"Notes (optional)",value:Z,onChangeText:ee,placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,M.jsx)(h.Toggle,{label:"I confirm the allergy information for this booking",value:te,onChange:oe}),(0,M.jsx)(h.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Your details"}),(0,M.jsx)(h.Field,{label:"Name for the booking",value:Y,onChangeText:U}),(0,M.jsx)(h.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:G,onChangeText:Q,onBlur:()=>X(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Ne.ok||!K&&!G?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:Ne.error}),(0,M.jsx)(h.Field,{testID:"book-email",label:"Email (optional)",value:V,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),ze?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,M.jsxs)(h.Muted,{children:["We\u2019ll text you a confirmation",V.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,M.jsx)(i.Honeypot,{value:F,onChange:I})]})}},1215,[860,1114,877,30,34,1216,999,102,14,1124,794,861,878,867,1117,858,874,988,821,1168,864,1018,1021,1095,1119,1091,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return B}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=(e=r)&&e.__esModule?e:{default:e},u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),x=_r(_d[15]),k=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),D=_r(_d[21]),T=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]),P=_r(_d[25]),M=_r(_d[26]);function B(){const{rid:e,date:r}=(0,n.useLocalSearchParams)(),B=(0,k.useRestaurant)(e),A=(0,k.useCustomer)(),O=(0,k.useBookings)(e),N=(0,k.useEvents)(e),z=(0,k.useNow)(6e4),[R]=(0,l.useState)(()=>(0,a.startForm)()),[F,I]=(0,l.useState)(''),[q,L]=(0,l.useState)(2),[H,E]=(0,l.useState)(r??(0,x.ymd)(z)),[W,_]=(0,l.useState)(null),[Y,U]=(0,l.useState)(A.name),[G,Q]=(0,l.useState)(A.phone??''),[V,J]=(0,l.useState)(A.email??''),[K,X]=(0,l.useState)(!1),[Z,ee]=(0,l.useState)(''),[te,oe]=(0,l.useState)(!1),[se,ne]=(0,l.useState)([]),[le,ie]=(0,l.useState)(!1),ae=[...A.allergies,...se.filter(e=>!A.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[re,de]=(0,l.useState)(null),ue=(0,D.useBlocks)(e=>e.blocks);(0,j.usePublicDayStore)(e=>e.n);const ce=e?(0,j.publicDay)(e,H):null,he=ce?[...ce.bookings,...O.filter(e=>e.date!==H)]:O,me=ce?[...ue.filter(t=>t.rid!==e||t.date!==H),...ce.blocks]:ue,ge=(0,T.usePlan)(e),[pe,be]=(0,l.useState)((0,$.emptyNeeds)()),fe=!0===pe.dog,ye=fe?pe.dogs:0,xe=(0,l.useMemo)(()=>{const e=[],t=new Date(z);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return r&&!e.some(e=>(0,x.ymd)(e)===r)&&e.push((0,x.parseYmd)(r)),e},[z.toDateString(),r]);if(!B)return(0,M.jsx)(h.Screen,{title:"Not found",children:(0,M.jsx)(h.T,{children:"Restaurant not found."})});const ke=B.settings,je=(0,x.parseYmd)(H),ve=(0,y.onlinePartyBounds)(B),we=(0,D.blocksOn)(me,B.id,H),Se=he.filter(e=>e.date===H),De=ge.areas.filter(e=>e.dogs),Te=(0,P.dogSetUp)(ge),Ce=e=>(0,C.freeTablesAt)(ge,Se,q,new Date(`${H}${(0,t.tableNumbers)(e)}:00`),(0,C.turnFor)(q,ke.turnMins),ke.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(me,B.id,H,e)}),$e=(0,y.bookingSlots)(B,je,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),q,z,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,D.blockAt)(me,B.id,H,e.time),o=fe&&Te&&e.available&&!t&&(!Ce(e.time).length||!(0,$.dogTimeOk)(B,he,H,e.time,ye));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Pe=$e.some(e=>e.available),Me=(0,u.depositOf)(ke),Be=(0,u.depositDue)(Me,q),Ae=Be>0?'deposit':'none',Oe=(0,u.depositWords)(Me,q,B.name),Ne=N.filter(e=>e.date===H),ze=(0,S.ukPhone)(G),Re=(0,S.emailOk)(V),Fe=(0,$.needsMissing)(pe,A.allergies),Ie=!!W&&te&&!Fe.length&&Y.trim().length>1&&ze.ok&&Re,qe=async()=>{const e=(0,$.needsPatch)(pe,A.allergies),t=fe&&Te?Ce(W).map(e=>e.table):[],o=fe?pe.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await k.repo.bookings.create({restaurantId:B.id,customerId:A.id,name:Y,partySize:q,date:H,time:W,notes:Z.trim(),security:Ae,depositPaid:0,...Be?{depositDue:Be,depositPolicy:Oe.join(' '),depositRefundable:Me.refundable,depositCutoffHours:Me.cutoffHours}:{},phone:ze.pretty,email:V.trim()||void 0,source:'online',...e,...$e.find(e=>e.time===W)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??ae,...o?{table:o}:{}});(0,a.rememberGuard)(s.id,(0,a.guardFor)({...R,hp:F})),de(s)},Le=(0,k.useStore)(e=>re?e.bookings.find(e=>e.id===re.id)?.ref:void 0),He=e=>(0,w.waMeLink)(B.settings.whatsapp,(0,w.guestWhatsAppText)({name:e.name,ref:Le??e.ref,date:e.date,time:e.time,partySize:e.partySize},B.name));if(re){const e='pending'===re.status;return(0,M.jsxs)(h.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:B.name,children:[(0,M.jsx)(h.Banner,{kind:e?'info':'success',title:`Reference ${Le??re.ref}`,children:`${re.partySize} people \xb7 ${(0,x.niceDateYear)((0,x.parseYmd)(re.date))} at ${re.time}`}),e?(0,M.jsx)(h.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(h.T,{children:["Name: ",re.name]}),(0,M.jsxs)(h.T,{children:["Mobile: ",re.phone]}),re.email?(0,M.jsxs)(h.T,{children:["Email: ",re.email]}):null,(0,M.jsxs)(h.T,{children:["Allergies shared with the restaurant: ",re.allergies.length?re.allergies.map(e=>`${(0,p.allergenLabel)(e.allergen)} (${(0,p.severityLabel)(e.severity)})`).join(', '):'none']}),re.notes?(0,M.jsxs)(h.T,{children:["Notes: ",re.notes]}):null,re.dog?(0,M.jsxs)(h.T,{children:["\ud83d\udc15 Dog coming too",re.table?` \xb7 dog-friendly table ${re.table}`:'']}):null,re.holds?.length?(0,M.jsxs)(h.T,{children:["Reserved: ",re.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(B.settings.reservables??P.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,re.tableReq?.length?(0,M.jsxs)(h.T,{children:["Table requested: ",re.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===re.security&&re.depositDue?(0,M.jsxs)(h.T,{weight:"semibold",children:["Deposit due: ",(0,f.gbp)(re.depositDue),". ",B.name," will tell you how to pay it."]}):null,'deposit'===re.security&&re.depositPolicy?(0,M.jsx)(h.Muted,{children:re.depositPolicy}):null,(0,M.jsx)(h.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,M.jsxs)(h.Muted,{children:["Need to change or cancel? Call ",B.phone," and quote ",Le??re.ref,"."]})]}),He(re)?(0,M.jsxs)(d.default,{style:{gap:4},children:[(0,M.jsx)(h.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=He(re);e&&(0,w.openWhatsApp)(e)}}),(0,M.jsx)(h.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,M.jsx)(h.Button,{label:"Back to restaurant",onPress:()=>n.router.replace(`/customer/${B.id}`)})]})}return(0,M.jsxs)(h.Screen,{title:"Book a table",subtitle:B.name,footer:(0,M.jsx)(h.Button,{label:Fe.length?Fe[0]:q>(ke.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Ie,onPress:()=>qe(),testID:"confirm-booking"}),children:[(0,M.jsx)($.FirstQuestions,{rid:B.id,value:pe,onChange:e=>{e.dog===pe.dog&&e.dogs===pe.dogs||_(null),be(e)},party:q,audience:"guest",profile:A.allergies}),(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(d.default,{style:{gap:6,alignItems:'center'},children:[(0,M.jsx)(h.H2,{children:"Party size"}),(0,M.jsx)(o.PartySizeInput,{value:q,onChange:e=>{L(e),_(null)},min:ve.min,max:ve.max,label:"Party size",testID:"party-size"})]}),Be?(0,M.jsx)(h.Banner,{kind:"info",title:`Deposit: ${(0,f.gbp)(Be)} for ${q} guests`,children:(0,M.jsx)(d.default,{style:{gap:4},children:Oe.map(e=>(0,M.jsx)(h.T,{size:13,children:e},e))})}):Me.on&&Me.perPersonPence>0?(0,M.jsxs)(h.Muted,{children:["No deposit for fewer than ",Me.fromParty," guests."]}):null,q>(ke.autoAcceptUpTo??7)?(0,M.jsxs)(h.Muted,{children:["For ",q," people the team checks the booking first, then texts you to confirm."]}):null,fe&&Te?(0,M.jsxs)(h.Muted,{children:["Dogs are welcome in the ",De.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",B.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Date"}),(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:xe.map(e=>{const t=!!(0,b.hoursFor)(B,e),o=N.some(t=>t.date===(0,x.ymd)(e));return(0,M.jsx)(h.Chip,{label:(0,x.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:H===(0,x.ymd)(e),onPress:()=>{E((0,x.ymd)(e)),_(null)}},(0,x.ymd)(e))})}),Ne.map(e=>(0,M.jsx)(h.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Time"}),0===$e.length?(0,M.jsx)(h.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:$e.map(e=>(0,M.jsx)(h.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left_(e.time)},e.time))}),we.length>0&&$e.some(e=>e.blocked)?(0,M.jsx)(h.Banner,{kind:"info",title:Pe?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${we.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,x.niceDate)(je)}. Please give us a ring on ${B.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,s.lastFoodOn)(B,H);return e&&$e.some(e=>e.drinksOnly)?(0,M.jsx)(h.Banner,{kind:"info",title:`Last food orders ${(0,s.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),fe&&$e.some(e=>e.noDog)?(0,M.jsx)(h.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${De.map(e=>e.name).join(' and ')}${B.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,D.closedAreasAt)(me,B.id,H,W??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,M.jsx)(h.Muted,{children:(0,y.bookingLimitsHint)(B)})]}),(0,M.jsx)($.MoreQuestions,{rid:B.id,r:B,value:pe,onChange:be,party:q,date:H,time:W,today:(0,x.ymd)(z),bookings:he,audience:"guest",showTables:!0}),(0,M.jsxs)(h.Card,{highlight:te?void 0:v.colours.amber,children:[(0,M.jsx)(h.Field,{label:"Notes (optional)",value:Z,onChangeText:ee,placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,M.jsx)(h.Toggle,{label:"I confirm the allergy information for this booking",value:te,onChange:oe}),(0,M.jsx)(h.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Your details"}),(0,M.jsx)(h.Field,{label:"Name for the booking",value:Y,onChangeText:U}),(0,M.jsx)(h.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:G,onChangeText:Q,onBlur:()=>X(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),ze.ok||!K&&!G?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:ze.error}),(0,M.jsx)(h.Field,{testID:"book-email",label:"Email (optional)",value:V,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Re?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,M.jsxs)(h.Muted,{children:["We\u2019ll text you a confirmation",V.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,M.jsx)(i.Honeypot,{value:F,onChange:I})]})}},1215,[860,1114,877,30,34,1216,999,102,14,1124,794,861,878,867,1117,858,874,988,821,1168,864,1018,1021,1095,1119,1091,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Honeypot=function({value:t,onChange:n}){return(0,l.jsx)(o.default,{"aria-hidden":!0,pointerEvents:"none",style:{position:'absolute',left:-1e4,top:0,width:1,height:1,overflow:'hidden',opacity:0},children:(0,l.jsx)(e.TextInput,{testID:"hp-field",accessibilityLabel:"Leave this empty",value:t,onChangeText:n,tabIndex:-1,autoComplete:'off',name:'cc_extra_info','aria-hidden':!0})})};var e=r(d[0]);r(d[1]),r(d[2]);var t,n=r(d[3]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[4])},1216,[827,34,236,102,25]); __d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var t=_r(_d[0]),n=_r(_d[1]),l=e(_r(_d[2])),s=e(_r(_d[3])),r=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]);function f(){const{rid:e,did:f}=(0,t.useLocalSearchParams)(),b=(0,u.useRestaurant)(e),j=(0,u.useMenu)(e).find(e=>e.id===f),x=(0,u.useCustomer)(),m=(0,u.useRecipeCards)(e).find(e=>e.id===j?.recipeCardId),y=m?.signOff&&m.photo?(0,h.recipeCards)().photoSource(m.photo):null,k=(0,u.useStore)(e=>e.addLine),[v,w]=(0,n.useState)(()=>(j?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[S,C]=(0,n.useState)(1),[B,$]=(0,n.useState)(''),[I,P]=(0,n.useState)(!1),[L,T]=(0,n.useState)(!1),[D,O]=(0,n.useState)(!1),[A,M]=(0,n.useState)(!1),R=(0,n.useMemo)(()=>j?(0,d.effectiveAllergens)(j,v):{},[j,v]);if(!b||!j)return(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Dish not found."})});const q=(0,d.conflictsFor)(R,x.allergies),_=(j.price??0)+(j.optionGroups??[]).flatMap(e=>e.choices).filter(e=>v.includes(e.id)).reduce((e,t)=>e+t.priceDelta,0),N=j.soldOut||!j.signOff||null===j.price,G=(e,t)=>{const n=j.optionGroups.find(t=>t.id===e);w(e=>{const l=n.choices.map(e=>e.id);return n.multi?e.includes(t)?e.filter(e=>e!==t):[...e,t]:e.includes(t)&&!n.required?e.filter(e=>e!==t):[...e.filter(e=>!l.includes(e)),t]})},z=e=>{u.useStore.getState().basket.restaurantId!==b.id&&u.useStore.getState().startBasket(b.id,'takeaway'),k({itemId:j.id,qty:S,choiceIds:v,notes:B,override:e?{allergens:q.contains,at:(new Date).toISOString()}:void 0}),P(!1),M(!0)};return(0,p.jsxs)(o.Screen,{title:j.name,subtitle:b.name,right:(0,p.jsx)(a.BasketButton,{}),children:[y?(0,p.jsx)(l.default,{testID:"dish-photo",source:y,accessibilityLabel:`${j.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.T,{weight:"bold",size:20,colour:g.colours.gold,children:null===j.price?j.priceNote:(0,c.gbp)(_)}),j.dietary.map(e=>(0,p.jsx)(o.Badge,{kind:"ok",label:e},e))]}),(0,p.jsx)(o.T,{children:j.description}),q.contains.length?(0,p.jsx)(o.Banner,{kind:"danger",title:`Blocked: contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,q.may.length?(0,p.jsx)(o.Banner,{kind:"warn",title:`Warning: may contain ${q.may.map(d.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(j.optionGroups??[]).map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:e.choices.map(t=>(0,p.jsx)(o.Chip,{label:t.label,sub:t.priceDelta?`+${(0,c.gbp)(t.priceDelta)}`:void 0,selected:v.includes(t.id),onPress:()=>G(e.id,t.id)},t.id))})]},e.id)),(0,p.jsx)(o.Card,{children:(0,p.jsx)(r.AllergenPanel,{item:j,map:R,declared:x.allergies})}),b.fictional?null:(0,p.jsx)(o.ExampleAllergenNotice,{}),(0,p.jsx)(o.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:B,onChangeText:$}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Quantity"}),(0,p.jsx)(o.Stepper,{value:S,onChange:C,label:"quantity"})]}),A?(0,p.jsx)(o.Banner,{kind:"success",title:"Added to basket",children:q.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,N?(0,p.jsx)(o.Banner,{kind:"warn",children:j.soldOut?'Sold out today.':j.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):q.contains.length?(0,p.jsxs)(s.default,{style:{gap:8},children:[(0,p.jsx)(o.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,p.jsx)(o.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{T(!1),O(!1),P(!0)},testID:"override-open"})]}):(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{style:{flex:1},label:`Add ${S} to basket \xb7 ${(0,c.gbp)(_*S)}`,onPress:()=>z(!1),testID:"add-to-basket"}),A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,p.jsxs)(o.Sheet,{visible:I,onClose:()=>P(!1),title:"Allergy override",children:[(0,p.jsx)(o.Banner,{kind:"danger",title:`${j.name} contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`Your profile says: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}.`}),(0,p.jsx)(o.Toggle,{label:"I understand this dish contains an allergen I have declared",value:L,onChange:T}),(0,p.jsx)(o.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:D,onChange:O}),(0,p.jsx)(o.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,p.jsx)(o.Button,{kind:"danger",disabled:!L||!D,label:"Confirm override and add",onPress:()=>z(!0),testID:"override-confirm"})]})]})}},1217,[30,34,336,102,1192,1218,794,861,867,874,882,821,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BasketButton=function(){const s=(0,l.useBasket)().lines.reduce((e,s)=>e+s.qty,0);return s?(0,c.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:`Basket, ${s} items`,onPress:()=>e.router.push('/customer/basket'),style:{backgroundColor:u.colours.gold,borderRadius:999,paddingHorizontal:12,paddingVertical:6},children:(0,c.jsxs)(n.T,{weight:"semibold",colour:u.colours.onGold,size:14,children:["Basket \xb7 ",s]})}):null};var e=r(d[0]);r(d[1]);var s,t=r(d[2]),o=(s=t)&&s.__esModule?s:{default:s},l=r(d[3]),u=r(d[4]),n=r(d[5]),c=r(d[6])},1218,[30,34,402,874,821,794,25]); @@ -1530,7 +1530,7 @@ __d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{ __d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.TrendLine=y,_e.SpendPerHeadPage=function(){const{rid:e,today:s}=(0,c.useCtx)(6e4),a=(0,r.useBookings)(e),n=(0,o.useCashUp)(e=>e.cashUps),[b,j]=(0,t.useState)('day'),k=(0,d.hasAnyTakings)(n,e),w=(0,d.dayRows)(n,a,e,s,14),f=(0,d.weekRows)(n,a,e,s,8),v=(0,d.averageSph)(w),$=(e,t,s,a,n)=>(0,u.jsxs)(l.default,{testID:`sph-row-${e}`,style:{alignItems:'center',paddingVertical:8,borderTopWidth:1,borderTopColor:h.colours.hairline,gap:2},accessible:!0,accessibilityLabel:`${t}: ${'No takings entered'===a?'no takings entered':`spend per head ${a}`}, ${s}${n?`, ${n}`:''}`,children:[(0,u.jsx)(i.T,{center:!0,children:t}),(0,u.jsx)(i.T,{center:!0,colour:h.colours.muted,children:s}),(0,u.jsx)(i.T,{center:!0,weight:"semibold",colour:'No takings entered'===a?h.colours.muted:h.colours.goldLight,size:'No takings entered'===a?13:16,children:a}),n?(0,u.jsx)(i.Muted,{center:!0,children:n}):null]},e);return(0,u.jsxs)(l.default,{style:{gap:12},testID:"sph-screen",children:[(0,u.jsx)(i.Muted,{children:"Tip: spend per head is Gross takings \xf7 Covers. Enter the gross on the cash up (Take a picture of the taking sheet, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out."}),(0,u.jsxs)(i.Card,{highlight:h.colours.gold,children:[(0,u.jsx)(i.T,{size:12,weight:"semibold",colour:h.colours.gold,style:{letterSpacing:1.5},children:"LAST 14 DAYS"}),null==v?(0,u.jsx)(i.T,{size:22,weight:"semibold",colour:h.colours.muted,testID:"sph-none",children:"No takings entered"}):(0,u.jsxs)(i.T,{size:34,weight:"bold",colour:h.colours.goldLight,testID:"sph-avg",children:[p(v)," ",(0,u.jsx)(i.T,{size:16,colour:h.colours.muted,children:"per head"})]}),(0,u.jsx)(i.Muted,{children:k?'Only days with gross takings entered are counted.':'Nothing has been entered yet. Spend per head appears once a cash up has Gross takings.'})]}),(0,u.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,u.jsx)(i.Chip,{testID:"sph-day",label:"By day",selected:'day'===b,onPress:()=>j('day')}),(0,u.jsx)(i.Chip,{testID:"sph-week",label:"By week",selected:'week'===b,onPress:()=>j('week')})]}),'day'===b?(0,u.jsxs)(i.Card,{children:[(0,u.jsx)(i.T,{weight:"semibold",children:"Spend per head by day"}),(0,u.jsx)(y,{testID:"sph-trend-day",label:"Spend per head trend by day",points:w.map(e=>({label:x(e.date),value:e.sph}))}),[...w].reverse().map(e=>$(e.date,x(e.date),`${e.covers} Covers`,null==e.sph?'No takings entered':p(e.sph),null!=e.foodPh||null!=e.drinkPh?`food ${p(e.foodPh)}, drink ${p(e.drinkPh)} per head`:void 0))]}):null,'week'===b?(0,u.jsxs)(i.Card,{children:[(0,u.jsx)(i.T,{weight:"semibold",children:"Spend per head by week (Mon\u2013Sun)"}),(0,u.jsx)(y,{testID:"sph-trend-week",label:"Spend per head trend by week",points:f.map(e=>({label:`w/c ${x(e.weekStart).split(' ').slice(1).join(' ')}`,value:e.sph}))}),[...f].reverse().map(e=>$(e.weekStart,`w/c ${x(e.weekStart)}`,e.days?`${e.covers} Covers \xb7 ${e.days} day${1===e.days?'':'s'}`:'\u2014',null==e.sph?'No takings entered':p(e.sph)))]}):null,(0,u.jsx)(i.Muted,{children:"Order-at-table totals will be added here when order at table is switched on. Nothing on this page is estimated."})]})};var t=_r(_d[0]),s=e(t),l=e(_r(_d[1])),a=_r(_d[2]),n=e(a),i=_r(_d[3]),r=_r(_d[4]),o=_r(_d[5]),d=_r(_d[6]),h=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]);const p=e=>null==e?'\u2014':`\xa3${e.toLocaleString('en-GB',{minimumFractionDigits:2,maximumFractionDigits:2})}`,x=e=>new Date(`${e}T12:00:00Z`).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short',timeZone:'UTC'});function y({points:e,testID:r,label:o}){const[d,c]=(0,t.useState)(320),[x,y]=(0,t.useState)(e.length);(0,t.useEffect)(()=>y(e.length),[e.length,r]);const b=d<340?2:3,j=Math.min(e.length,Math.max(b,x)),k=Math.max(0,j-b),w=e.slice(k,j),f=Math.max(140,d-68),v=e.map(e=>e.value).filter(e=>null!=e),$=Math.max(5,5*Math.ceil(Math.max(0,...v)/5)),T=e=>38+e*(f-76)/Math.max(1,w.length-1),S=e=>140-e/$*106,L=[];let D=[];w.forEach((e,t)=>{null==e.value?(D.length&&L.push(D),D=[]):D.push({i:t,v:e.value})}),D.length&&L.push(D);const M=e.filter(e=>null!=e.value).map(e=>`${e.label} ${p(e.value)}`).join(', ');return(0,u.jsxs)(l.default,{testID:r,onLayout:e=>c(e.nativeEvent.layout.width),style:{gap:8},children:[(0,u.jsxs)(l.default,{accessible:!0,accessibilityLabel:`${o}. ${M||'No takings entered'}`,style:{flexDirection:'row',minWidth:0},children:[(0,u.jsx)(n.default,{width:64,height:170,children:[0,1,2,3,4].map(e=>(0,u.jsx)(a.Text,{x:60,y:S($*e/4)+4,textAnchor:"end",fontSize:11,fill:h.colours.muted,children:p($*e/4)},e))}),(0,u.jsxs)(n.default,{width:f,height:170,children:[[0,1,2,3,4].map(e=>(0,u.jsx)(a.Line,{x1:0,x2:f,y1:S($*e/4),y2:S($*e/4),stroke:h.colours.border,strokeWidth:1},e)),L.map((e,t)=>(0,u.jsx)(a.Polyline,{points:e.map(e=>`${T(e.i)},${S(e.v)}`).join(' '),fill:"none",stroke:h.colours.gold,strokeWidth:2.5},t)),w.map((e,t)=>(0,u.jsx)(s.default.Fragment,{children:null==e.value?(0,u.jsx)(a.Circle,{cx:T(t),cy:140,r:2,fill:"#444"}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(a.Circle,{cx:T(t),cy:S(e.value),r:4,fill:h.colours.goldLight}),(0,u.jsx)(a.Text,{x:T(t),y:S(e.value)-10,textAnchor:"middle",fontSize:12,fontWeight:"bold",fill:h.colours.goldLight,children:p(e.value)})]})},k+t))]})]}),(0,u.jsx)(l.default,{style:{flexDirection:'row',gap:12},children:w.map((e,t)=>(0,u.jsxs)(l.default,{style:{flex:1,minWidth:0},accessible:!0,accessibilityLabel:`${e.label}: ${null==e.value?'No takings entered':p(e.value)}`,children:[(0,u.jsx)(i.T,{center:!0,size:12,colour:h.colours.muted,children:e.label}),(0,u.jsx)(i.T,{center:!0,size:14,weight:"semibold",colour:null==e.value?h.colours.muted:h.colours.goldLight,children:null==e.value?'No takings entered':p(e.value)})]},k+t))}),(0,u.jsxs)(i.Row,{wrap:!0,gap:8,style:{justifyContent:'center'},children:[(0,u.jsx)(i.Button,{small:!0,kind:"secondary",label:"Earlier",accessibilityLabel:"Earlier spend per head chart points",disabled:0===k,onPress:()=>y(Math.max(b,j-b))}),(0,u.jsx)(i.Button,{small:!0,kind:"secondary",label:"Later",accessibilityLabel:"Later spend per head chart points",disabled:j>=e.length,onPress:()=>y(Math.min(e.length,j+b))})]})]})}},1447,[34,102,797,794,874,1031,1448,821,1079,25]); __d(function(g,_r,_i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"COUNTED",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"serviceOfBooking",{enumerable:!0,get:function(){return o}}),e.coversOn=d,e.dayRows=i,e.weekRows=function(n,t,s,o,d){const u=(0,r.weekStartOf)(o);return Array.from({length:d},(l,f)=>{const h=(0,r.addDaysYmd)(u,7*(f-d+1)),m=i(n,t,s,(0,r.addDaysYmd)(h,6),7).filter(r=>r.date<=o&&null!=r.gross),p=m.length?Math.round(100*m.reduce((r,n)=>r+n.gross,0))/100:null,v=m.reduce((r,n)=>r+n.covers,0);return{weekStart:h,gross:p,covers:v,days:m.length,sph:c(p,v)}})},e.serviceRows=function(n,t,s,o,i,l=1020){const f=new Map(n.filter(r=>r.rid===s&&r.confirmedAt).map(r=>[r.date,r])),h=[];for(let n=0;nnull!=r.gross&&r.covers>0);return n.length?c(n.reduce((r,n)=>r+n.gross,0),n.reduce((r,n)=>r+n.covers,0)):null},Object.defineProperty(e,"hasAnyTakings",{enumerable:!0,get:function(){return l}});var r=_r(_d[0]);const n=['seated','finished'],t=r=>n.includes(r.status),s=r=>{const[n,t]=r.split(':').map(Number);return 60*n+(t||0)},o=(r,n)=>s(r.time)r.restaurantId===n&&r.date===s&&t(r)&&(!d||o(r,u)===d)).reduce((r,n)=>r+(n.partySize||0),0)}const u=r=>'number'==typeof r&&Number.isFinite(r)?r:null,c=(r,n)=>null==r||n<=0?null:Math.round(r/n*100)/100;function i(n,t,s,o,i){const l=new Map(n.filter(r=>r.rid===s&&r.confirmedAt).map(r=>[r.date,r]));return Array.from({length:i},(n,f)=>{const h=(0,r.addDaysYmd)(o,f-i+1),m=l.get(h)?.vals??{},p=(0,r.grossOf)(m),v=d(t,s,h),y=u(m.food),b=u(m.drink);return{date:h,gross:p,covers:v,sph:c(p,v),food:y,drink:b,foodPh:c(y,v),drinkPh:c(b,v)}})}const l=(n,t)=>n.some(n=>n.rid===t&&n.confirmedAt&&null!=(0,r.grossOf)(n.vals))},1448,[13]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.MyAvatar=function(){const{meId:s,me:c}=(0,n.useCtx)(6e4);return(0,u.jsx)(t.AvatarMaker,{meId:s,me:c})},r(d[0]);var t=r(d[1]),n=r(d[2]),u=r(d[3])},1449,[34,793,1079,25]); -__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.GiftVouchers=function(){return n.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(Q,{}):(0,V.jsx)(W,{})},_e.Merch=function(){return n.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(Q,{}):(0,V.jsx)(X,{})},_e.TablesQr=function({go:e}={}){const{rid:s,r:t,now:r,me:a}=(0,A.useCtx)(1e4);return n.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(l.StaffTableOrders,{rid:s,me:a}),(0,V.jsx)(v.Muted,{children:"QR codes, tables and hours: Settings \u203a Advanced \u203a Order at the table."})]}):(0,M.orderAtTableOn)(t)?(0,V.jsx)(q,{rid:s,now:r,me:a}):(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Banner,{kind:"info",title:"Order at table is off",children:"In-house orders go through your till. Switch it on in Settings \u203a Order at table if this venue takes orders at the table."}),e?(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Open Order at table settings",onPress:()=>e('more','orderattable')}):null]})},_e.TakeawaySettings=function({go:e}){const{rid:s,r:t,now:r}=(0,A.useCtx)(3e4),n=(0,T.useOrders)(s),a=t.settings,l=(0,P.takeawaySlots)(t,n,r).slice(0,10),i=e=>G().updateSettings(s,e),o=n.filter(e=>'takeaway'===e.type&&(0,B.LIVE)(e));return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Card,{highlight:a.takeawayPaused?I.colours.red:I.colours.ok,children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",children:a.takeawayPaused?'Takeaway paused':'Taking takeaway orders'}),(0,V.jsx)(v.Toggle,{label:"Takeaway on",value:!a.takeawayPaused,onChange:e=>i({takeawayPaused:!e})})]}),(0,V.jsx)(v.Muted,{children:"Direct ordering, no delivery-app commission."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Collection slots & capacity"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Slot length (min)"}),(0,V.jsx)(v.Stepper,{value:a.slotMinutes,min:5,max:30,onChange:e=>i({slotMinutes:e}),label:"slot minutes"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Orders per slot"}),(0,V.jsx)(v.Stepper,{value:a.slotCap,min:1,max:20,onChange:e=>i({slotCap:e}),label:"orders per slot"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Earliest pickup (min ahead)"}),(0,V.jsx)(v.Stepper,{value:a.leadMins,min:5,max:60,onChange:e=>i({leadMins:e}),label:"lead minutes"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Readiness buffer (min)"}),(0,V.jsx)(v.Stepper,{value:a.bufferMins,min:0,max:20,onChange:e=>i({bufferMins:e}),label:"buffer minutes"})]}),(0,V.jsx)(v.Muted,{children:"Readiness alerts (start cooking \u2192 bag it \u2192 ready) are for takeaway only, timed from the pickup slot. Dine-in starts when the table is seated and has ordered."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Next slots"}),l.map(e=>(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{size:14,children:e.label}),(0,V.jsx)(w.default,{style:{flex:1,height:8,marginHorizontal:8,backgroundColor:I.colours.border,borderRadius:4},children:(0,V.jsx)(w.default,{style:{width:e.taken/e.cap*100+"%",height:8,backgroundColor:e.full?I.colours.red:I.colours.gold,borderRadius:4}})}),(0,V.jsxs)(v.Muted,{children:[e.taken,"/",e.cap]})]},e.label))]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",children:["Live queue: ",o.length]}),(0,V.jsx)(v.Button,{small:!0,label:"Open orders",onPress:()=>e('orders')})]}),o.map(e=>(0,V.jsxs)(v.Muted,{children:[e.slotTime?(0,O.hm)(new Date(e.slotTime)):'\u2013'," \xb7 ",e.ref," ",e.customerName," \xb7 ",(0,B.statusLabel)(e)]},e.id))]})]})},_e.BookingSettings=function({go:e}){const{rid:r,r:n}=(0,A.useCtx)(6e4),a=n.settings,l=(0,S.useOwner)(e=>e.reminders),i=e=>G().updateSettings(r,e),o=e=>S.useOwner.getState().setOwner({reminders:{...l,...e}});return(0,V.jsxs)(w.default,{style:{gap:10},children:[s.IS_GREENSIDE?(0,V.jsx)(t.GreensideCashOnly,{}):(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Deposits"}),(0,V.jsxs)(v.Muted,{children:[(()=>{const e=(0,c.depositOf)(a);return e.on&&e.perPersonPence>0?`On: ${(0,R.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more.`:'Off.'})()," Deposits are paid through website bookings: website bookings show Deposit paid on website bookings by themselves; staff tick phone and walk-in deposits paid."]}),(0,V.jsx)(v.Muted,{children:"Tip: change the amount, party size, refunds and the words guests see in Settings \u203a Advanced \u203a Deposits."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Reminders"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Reminder 24 hours before"}),(0,V.jsx)(v.Toggle,{label:"24h reminder",value:l.h24,onChange:e=>o({h24:e})})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Reminder 2 hours before"}),(0,V.jsx)(v.Toggle,{label:"2h reminder",value:l.h2,onChange:e=>o({h2:e})})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Ask guests to confirm or cancel"}),(0,V.jsx)(v.Toggle,{label:"confirm",value:l.confirmText,onChange:e=>o({confirmText:e})})]}),(0,V.jsx)(v.Muted,{children:"Guest reminders are not connected; nothing is sent."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Capacity & waitlist"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Booking start times (min)"}),(0,V.jsx)(v.Stepper,{value:(0,P.bookingSlotMinutesOf)(n),min:15,max:30,step:15,onChange:e=>i({bookingSlotMinutes:e}),label:"booking start times"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Covers per 30-min slot"}),(0,V.jsx)(v.Stepper,{value:a.bookingCoversPerSlot,min:2,max:60,onChange:e=>i({bookingCoversPerSlot:e}),label:"Covers per slot"})]}),(0,V.jsx)(v.Muted,{children:"Guests can pick a start every 15 or 30 minutes. The covers cap is still for each half hour, so 19:00 and 19:15 share the same limit."}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Typical table turn (min)"}),(0,V.jsx)(v.Stepper,{value:a.turnMins,min:30,max:180,onChange:e=>i({turnMins:e}),label:"turn minutes"})]}),(0,V.jsx)(v.Muted,{children:"The online waitlist estimate uses the table turn time."}),(0,V.jsx)(v.Button,{small:!0,label:"Open bookings & waitlist",onPress:()=>e('bookings')})]})]})},_e.AllergyHub=function({go:e}){const{rid:s,today:t,role:r,me:n}=(0,A.useCtx)(1e4),[a,l]=(0,m.useState)(null),i=(0,T.useOrders)(s),o=(0,T.useStore)((0,k.useShallow)(e=>e.bookings.filter(e=>e.restaurantId===s&&e.date===t))),d=(0,T.useAudit)(s).filter(e=>'allergy'===e.kind),c=(0,z.useUnsignedDishes)(s),h=(0,T.useStore)(e=>e.bookings),u=i.filter(e=>(0,B.LIVE)(e)&&(0,D.chainNeedsAction)(e,h)).length+o.filter(e=>'cancelled'!==e.status&&(0,D.bookingNeedsAction)(e,i.filter(B.LIVE))).length,g=(0,A.useSignedIn)(),p=(0,F.cardActorFor)(n,'owner'===r?'owner':'manager'===r?'manager':'staff',g);if('unsigned'===a)return(0,V.jsx)(z.UnsignedDishList,{rid:s,actor:p,onClose:()=>l(null),onOpenCards:()=>e('more','recipecards')});if('pending'===a)return(0,V.jsx)(K,{go:e,onClose:()=>l(null)});const b={flex:1,minHeight:48};return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Banner,{kind:"info",title:"Supports staff, doesn't replace them",children:"CoverCharge flags the 14 UK allergens and asks a named person to verify. Staff still check with the guest and the recipe every time."}),(0,V.jsxs)(v.Row,{gap:8,children:[(0,V.jsx)(y.default,{testID:"tile-awaiting-verification",accessibilityRole:"button",accessibilityLabel:`Awaiting verification, ${u}. Opens the list.`,onPress:()=>l('pending'),style:({pressed:e})=>[b,{opacity:e?.85:1}],children:(0,V.jsxs)(v.Card,{style:{flex:1,alignItems:'center'},highlight:u?I.colours.red:void 0,children:[(0,V.jsx)(v.Muted,{center:!0,children:"Awaiting verification"}),(0,V.jsx)(v.T,{center:!0,size:20,weight:"bold",children:u})]})}),(0,V.jsx)(y.default,{testID:"tile-not-signed-off",accessibilityRole:"button",accessibilityLabel:`Dishes not signed off, ${c.length}. Opens the list.`,onPress:()=>l('unsigned'),style:({pressed:e})=>[b,{opacity:e?.85:1}],children:(0,V.jsxs)(v.Card,{style:{flex:1,alignItems:'center'},highlight:c.length?I.colours.amber:void 0,children:[(0,V.jsx)(v.Muted,{center:!0,children:"Dishes not signed off"}),(0,V.jsx)(v.T,{center:!0,size:20,weight:"bold",children:c.length})]})})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"1. Allergens per dish (14 UK allergens)"}),(0,V.jsx)(v.Muted,{children:"Each dish\u2019s recipe card lists contains / may contain, suggested from its ingredients. The head chef signs each card off; the menu, takeaway and booking checks all read the cards."}),(0,V.jsx)(v.Button,{small:!0,label:"Recipe cards",onPress:()=>e('more','recipecards')})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"2. Kitchen alerts on orders & bookings"}),(0,V.jsx)(v.Muted,{children:"Red allergy cards; cooking is blocked until the Kitchen sign-off."}),(0,V.jsxs)(v.Row,{gap:6,children:[(0,V.jsx)(v.Button,{small:!0,label:"Orders",onPress:()=>e('orders')}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Bookings",onPress:()=>e('bookings')})]})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"3. Five-step sign-off chain"}),(0,V.jsx)(v.Muted,{children:"Booked, Ordered, Kitchen, Pass and Table: a named person taps Sign off at each step, in order."}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Allergen sign-off log",onPress:()=>e('more','allergen-signoffs')})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"4. Audit log"}),d.slice(0,6).map(e=>(0,V.jsxs)(v.Muted,{children:[(0,O.hm)(new Date(e.at))," \xb7 ",e.text]},e.id)),d.length?null:(0,V.jsx)(v.Muted,{children:"No allergy events yet."}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Full log & daily checks",onPress:()=>e('more','compliance')})]})]})},_e.TabletPreview=function(){return(0,V.jsx)(w.default,{style:{gap:10},children:(0,V.jsxs)(v.Card,{highlight:I.colours.gold,style:{alignItems:'center'},children:[(0,V.jsxs)(w.default,{style:{width:240,height:160,borderRadius:14,borderWidth:3,borderColor:I.colours.border,alignItems:'center',justifyContent:'center'},children:[(0,V.jsx)(v.T,{size:30,children:"\ud83d\udda5\ufe0f"}),(0,V.jsx)(v.T,{weight:"semibold",children:"Kitchen & front-of-house tablet"})]}),(0,V.jsx)(v.T,{size:20,weight:"bold",colour:I.colours.gold,children:"CoverCharge for Display"}),(0,V.jsx)(v.Muted,{center:!0,children:"The in-restaurant tablet and kitchen display is its own app, CoverCharge for Display (landscape). Everything it shows (orders, readiness alerts, allergies, bookings) is also live in this app."})]})})},_e.AllFeatures=function({go:e}){const{role:s,r:t}=(0,A.useCtx)(6e4),r=(0,d.useLiveVenue)(),n=s=>s.startsWith('tab:')?e(s.slice(4)):e('more',s),a=e=>e.startsWith('tab:')?'tab:forecast'!==e||S.CAN.forecasts(s):(()=>{const t=L.PAGES.find(s=>s.id===e);return!!t&&(!t.can||t.can(s))})();return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Card,{highlight:I.colours.gold,children:[(0,V.jsx)(v.T,{weight:"semibold",children:"CoverCharge is five apps that share one set of venue data"}),[['CoverCharge for Managers','This app. Run the venue: orders, bookings, forecasts, team, menu, marketing, social posting, billing.','This app'],['CoverCharge for Staff','Clock in/out with break prompt, rota, swaps & leave, chat, my hours & pay, my tips.','Separate app'],['CoverCharge',`For customers: menu, takeaway ordering, table bookings, loyalty, gift cards${(0,M.orderAtTableOn)(t)?', QR table ordering':''}.`,'Separate app'],['CoverCharge for Display','Restaurant tablet / kitchen display: live orders, readiness, allergy alerts.','Separate app'],['CoverCharge for Head Chef','Stock and deliveries, recipe costing and GP, menu engineering, waste, ordering, prep lists, allergens, kitchen compliance, kitchen rota and chat, plus My pay & tips (their own hours, tips, tip goal and paydays only). No other staff pay, customer data or billing.','Separate app']].map(([e,s,t])=>(0,V.jsxs)(v.Row,{style:{alignItems:'flex-start'},children:[(0,V.jsxs)(w.default,{style:{flex:1},children:[(0,V.jsx)(v.T,{weight:"medium",children:e}),(0,V.jsx)(v.Muted,{children:s})]}),(0,V.jsx)(v.Badge,{kind:'This app'===t?'ok':'gold',label:t})]},e)),'owner'===s?(0,V.jsx)(v.Chip,{label:"Open the Staff app preview \u203a",onPress:()=>{S.useOwner.getState().setPreviewRole('staff'),e('home')}}):null,(0,V.jsx)(v.Muted,{children:r?'All five share your venue\u2019s live data. Each is installed separately, and your venue\u2019s own logo leads (Settings \u203a Branding).':'This copy isn\u2019t connected to a venue yet, so it only shows what is saved on this device. Each app is installed separately, and the venue\u2019s own logo leads (Settings \u203a Branding).'})]}),(0,V.jsx)(v.Muted,{children:"Every CoverCharge feature and where to manage it."}),[...Y].filter(e=>4!==e.n||(0,M.orderAtTableOn)(t)).sort((e,s)=>e.n-s.n).map(e=>(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{alignItems:'flex-start'},children:[(0,V.jsxs)(v.T,{weight:"bold",colour:I.colours.gold,style:{width:26},children:[e.n,"."]}),(0,V.jsxs)(w.default,{style:{flex:1},children:[(0,V.jsx)(v.T,{weight:"semibold",children:e.title}),(0,V.jsx)(v.Muted,{children:e.note})]})]}),(0,V.jsx)(v.Row,{wrap:!0,gap:6,children:e.links.filter(([,e])=>a(e)).map(([e,s])=>(0,V.jsx)(v.Chip,{label:`${e} \u203a`,onPress:()=>n(s)},s))})]},e.n))]})},Object.defineProperty(_e,"Divider",{enumerable:!0,get:function(){return v.Divider}}),_e.Loyalty=function(){return n.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(ee,{kind:"card"}):(0,V.jsx)(_,{})},_e.Referrals=function(){return n.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(ee,{kind:"referrals"}):(0,V.jsx)(H,{})};var s=_r(_d[0]),t=_r(_d[1]),r=_r(_d[2]),n=_r(_d[3]),a=_r(_d[4]),l=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),u=_r(_d[11]),g=_r(_d[12]),p=_r(_d[13]),b=_r(_d[14]),m=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),y=e(_r(_d[19])),w=e(_r(_d[20])),k=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),T=_r(_d[24]),S=_r(_d[25]),R=_r(_d[26]),M=_r(_d[27]),P=_r(_d[28]),O=_r(_d[29]),I=_r(_d[30]),B=_r(_d[31]),A=_r(_d[32]),N=_r(_d[33]),$=_r(_d[34]),L=_r(_d[35]),D=_r(_d[36]),E=_r(_d[37]),z=_r(_d[38]),F=_r(_d[39]),U=_r(_d[40]),V=_r(_d[41]);const G=()=>T.useStore.getState();function _(){const{rid:e,r:t,me:n}=(0,A.useCtx)(3e4),a=t.settings,l=(0,T.useStore)((0,k.useShallow)(s=>s.stampCards.filter(s=>s.restaurantId===e))),i=(0,T.useStore)(e=>e.customer.name),o=(0,T.useAudit)(e).filter(e=>'stamp'===e.kind),d=(0,m.useMemo)(()=>(0,N.crmCustomers)(),[]),[c,h]=(0,m.useState)(a.stampReward),[u,g]=(0,m.useState)('');(0,m.useEffect)(()=>{(0,$.examplesAllowed)()&&e===s.VENUE_RID&&!l.some(e=>e.customerId.startsWith('cr-'))&&T.useStore.setState(s=>({stampCards:[...s.stampCards,...d.filter(e=>'cust-demo'!==e.id).map((s,t)=>({restaurantId:e,customerId:s.id,stamps:s.stamps%a.stampTarget,rewardsAvailable:t%5==0?1:0,history:[{at:'2026-10-20',source:t%2?'Takeaway':'Dine-in'}]}))]}))},[e]);const p=e=>d.find(s=>s.id===e)?.name??(e===T.useStore.getState().customer.id?i||'Guest':e),b=l.filter(e=>!u||p(e.customerId).toLowerCase().includes(u.toLowerCase())).sort((e,s)=>s.stamps-e.stamps),x=(0,$.examplesAllowed)(),f=o.filter(e=>/redeemed/.test(e.text)).length+(x?31:0);return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Row,{gap:8,children:[(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Active cards"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:l.length})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Rewards ready"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:l.reduce((e,s)=>e+s.rewardsAvailable,0)})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Redeemed"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:f}),(0,V.jsx)(v.Muted,{children:x?'all time (example)':'all time'})]})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Card settings"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Stamps for a reward"}),(0,V.jsx)(v.Stepper,{value:a.stampTarget,min:3,max:15,onChange:s=>G().updateSettings(e,{stampTarget:s}),label:"stamps"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Min spend \xa3"}),(0,V.jsx)(v.Stepper,{value:a.stampMinSpend/100,min:0,max:50,onChange:s=>G().updateSettings(e,{stampMinSpend:100*s}),label:"minimum spend"})]}),(0,V.jsx)(v.Field,{label:"Reward",value:c,onChangeText:h}),(0,V.jsx)(v.Button,{small:!0,label:"Save reward",onPress:()=>G().updateSettings(e,{stampReward:c.trim()||a.stampReward})}),(0,V.jsx)(v.Muted,{children:"One card per customer account, shared across dine-in, table QR and takeaway."})]}),(0,V.jsx)(B.SectionHead,{title:"Members"}),(0,V.jsx)(r.TextInput,{accessibilityLabel:"Search members",placeholder:"Search members",placeholderTextColor:"#7D776C",value:u,onChangeText:g,style:v.styles.input}),b.map(s=>(0,V.jsxs)(w.default,{style:v.styles.card,children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",style:{flex:1},children:p(s.customerId)}),s.rewardsAvailable?(0,V.jsx)(v.Badge,{kind:"ok",label:`${s.rewardsAvailable} reward ready`}):null]}),(0,V.jsx)(v.Row,{gap:4,children:Array.from({length:a.stampTarget},(e,t)=>(0,V.jsx)(w.default,{style:{flex:1,height:8,borderRadius:4,backgroundColor:te.source))).join(', ')||'\u2013']}),(0,V.jsxs)(v.Row,{gap:6,children:[(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Add stamp",onPress:()=>G().addStamp(e,s.customerId,`Manual (${n})`)}),(0,V.jsx)(v.Button,{small:!0,label:"Redeem reward",disabled:!s.rewardsAvailable,onPress:()=>G().redeemReward(e,s.customerId)})]})]},s.customerId))]})}function H(){const e=(0,S.useOwner)(e=>e.referral),s=(0,S.useOwner)(e=>e.referrals),[t,r]=(0,m.useState)(e.giverReward),[n,a]=(0,m.useState)(e.friendReward),l=e=>s.filter(s=>s.status===e).length,i=(0,$.examplesAllowed)();return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Row,{gap:8,children:[i?(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Invites sent"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:"64"}),(0,V.jsx)(v.Muted,{children:"example"})]}):null,(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Sign-ups"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:s.length+(i?23:0)})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Ordered"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:l('first order')+l('rewarded')+(i?9:0)})]})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Bring a friend"}),(0,V.jsx)(v.Toggle,{label:"Referrals on",value:e.active,onChange:s=>S.useOwner.getState().setOwner({referral:{...e,active:s}})})]}),(0,V.jsx)(v.Field,{label:"Reward for the customer who invites",value:t,onChangeText:r}),(0,V.jsx)(v.Field,{label:"Reward for the friend (first order)",value:n,onChangeText:a}),(0,V.jsx)(v.Button,{small:!0,label:"Save rewards",onPress:()=>S.useOwner.getState().setOwner({referral:{...e,giverReward:t.trim(),friendReward:n.trim()}})}),(0,V.jsx)(v.Muted,{children:"The inviter\u2019s reward is added to their account after the friend\u2019s first order."})]}),(0,V.jsx)(B.SectionHead,{title:"Referrals"}),s.map(e=>(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",style:{flex:1},children:[e.referrer," \u2192 ",e.friend]}),(0,V.jsx)(v.Badge,{kind:'rewarded'===e.status?'ok':'first order'===e.status?'gold':'neutral',label:e.status})]}),(0,V.jsx)(v.Muted,{children:e.at})]},e.id))]})}function Q(){const{me:e}=(0,A.useCtx)(6e4),s=(0,A.useSignedIn)();return(0,V.jsx)(p.GiftCardsPage,{me:(s?.name??e).replace(' (example)','')})}function W(){const{rid:e,me:s}=(0,A.useCtx)(6e4),t=(0,T.useStore)((0,k.useShallow)(s=>s.giftCards.filter(s=>s.restaurantId===e))),[n,a]=(0,m.useState)(25),[l,i]=(0,m.useState)(''),[o,d]=(0,m.useState)(''),[c,h]=(0,m.useState)(''),[u,g]=(0,m.useState)(''),[p,b]=(0,m.useState)(''),[x,f]=(0,m.useState)(null),j=t.find(e=>e.code.toUpperCase()===o.trim().toUpperCase()),y=t.find(e=>e.legacy&&e.code.toUpperCase()===u.trim().toUpperCase());return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Row,{gap:8,children:[(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Sold"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:(0,R.gbp)(t.reduce((e,s)=>e+s.initial,0))})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Outstanding"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:(0,R.gbp)(t.reduce((e,s)=>e+s.balance,0))})]})]}),x?(0,V.jsx)(v.Banner,{kind:"success",title:x}):null,(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Check balance & redeem"}),(0,V.jsx)(r.TextInput,{accessibilityLabel:"Gift card code",placeholder:"Code, e.g. ANC-G7QX-4M2P-9TRE",placeholderTextColor:"#7D776C",autoCapitalize:"characters",value:o,onChangeText:d,style:v.styles.input}),o.trim().length>5?j?(0,V.jsxs)(v.Muted,{children:[j.recipientName," \xb7 balance ",(0,R.gbp)(j.balance)," of ",(0,R.gbp)(j.initial),j.legacy?' \xb7 legacy website bookings':'']}):(0,V.jsx)(v.T,{size:13,colour:I.colours.red,children:"No card with that code."}):null,(0,V.jsx)(v.Field,{label:"Amount to redeem \xa3",value:c,onChangeText:h,keyboardType:"decimal-pad"}),(0,V.jsx)(v.Button,{small:!0,label:"Redeem",disabled:!j||!(Number(c)>0)||100*Number(c)>(j?.balance??0),onPress:()=>{G().redeemGiftCard(o,Math.round(100*Number(c)),s)&&(f(`Redeemed \xa3${Number(c).toFixed(2)} from ${j.code}`),h(''))}})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Honour an old website bookings gift card"}),(0,V.jsx)(r.TextInput,{accessibilityLabel:"Website bookings gift card code",placeholder:"Old gift card code, e.g. WEB-OLD-10-EXAMPLE",placeholderTextColor:"#7D776C",autoCapitalize:"characters",value:u,onChangeText:g,style:v.styles.input}),u.trim().length>4?y?(0,V.jsxs)(v.Muted,{children:["Found in imported website bookings cards: balance ",(0,R.gbp)(y.balance),". Redeem it above."]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(v.Muted,{children:"Not in the imported list. Check it in your website bookings dashboard, then honour it here:"}),(0,V.jsx)(v.Field,{label:"Balance confirmed in website bookings \xa3",value:p,onChangeText:b,keyboardType:"decimal-pad"}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Honour & add to CoverCharge",disabled:!(Number(p)>0),onPress:()=>{const t=G().honourLegacyCard(e,u,Math.round(100*Number(p)),s);f(`Website bookings card ${t.code} honoured`),d(t.code),g(''),b('')}})]}):null]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Create / sell a gift card"}),(0,V.jsx)(v.Row,{wrap:!0,gap:6,children:[10,25,50,100].map(e=>(0,V.jsx)(v.Chip,{label:`\xa3${e}`,selected:n===e,onPress:()=>a(e)},e))}),(0,V.jsx)(v.Field,{label:"Recipient",value:l,onChangeText:i}),(0,V.jsx)(v.Button,{label:`Record a \xa3${n} card paid at the till`,disabled:l.trim().length<2,onPress:()=>{const s=G().buyGiftCard(e,100*n,l.trim(),'Sold at the till');f(`Created ${s.code}`),i('')}}),(0,V.jsx)(v.Muted,{children:"Gift cards are sold through your website. Record one here only when it was paid at the till."})]}),(0,V.jsx)(B.SectionHead,{title:"All cards"}),t.map(e=>(0,V.jsxs)(v.Card,{onPress:()=>d(e.code),children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",style:{flex:1},children:e.recipientName}),e.legacy?(0,V.jsx)(v.Badge,{kind:"neutral",label:"Legacy website bookings"}):null]}),(0,V.jsxs)(v.Muted,{children:[e.code," \xb7 ",(0,R.gbp)(e.balance)," of ",(0,R.gbp)(e.initial)]})]},e.id))]})}function q({rid:e,now:s,me:t}){const r=(0,T.useOrders)(e).filter(e=>'table'===e.type),[n,l]=(0,m.useState)(null),i=(0,x.useTableUse)(e,s),o=(0,x.useTableNames)(e);return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Muted,{children:"Each table has its own QR code. Guests scan, order and pay (or split) from their phone. Dine-in cooking starts once the table is seated and has ordered."}),(0,V.jsx)(v.Button,{kind:"secondary",label:"Preview customer table ordering (5)",onPress:()=>j.router.push('/table/5'),testID:"preview-table-ordering"}),(0,V.jsx)(v.Row,{wrap:!0,gap:8,children:o.map(e=>{const s=r.filter(s=>s.tableNo===e&&(0,B.LIVE)(s)),t=s.reduce((e,s)=>e+s.total-s.paid,0);return(0,V.jsxs)(y.default,{accessibilityRole:"button",accessibilityLabel:`Table ${(0,a.tableNumbers)(e)}`,onPress:()=>l(e),style:{width:'31%',padding:10,borderRadius:12,borderWidth:1,borderColor:s.length?I.colours.gold:I.colours.border,backgroundColor:I.colours.surface,gap:2},children:[(0,V.jsx)(v.T,{weight:"bold",children:(0,a.tableNumbers)(e)}),(0,V.jsx)(v.T,{size:12,colour:i[e]?.busy?'#FFD9D4':'#E2C489',children:i[e]?.busy?i[e].label:'Free'}),(0,V.jsx)(v.Muted,{children:s.length?`${s.length} order${s.length>1?'s':''}`:'No orders'}),t?(0,V.jsxs)(v.T,{size:12,colour:I.colours.amber,children:[(0,R.gbp)(t)," to pay"]}):(0,V.jsx)(v.T,{size:12,colour:I.colours.muted,children:"View QR"})]},e)})}),(0,V.jsx)(B.SectionHead,{title:"Live table orders"}),r.filter(B.LIVE).map(e=>(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",children:[(0,a.tableNumbers)(e.tableNo)," \xb7 ",e.ref]}),(0,V.jsx)(v.Badge,{kind:(0,B.statusKind)(e.status),label:(0,B.statusLabel)(e)})]}),(0,V.jsxs)(v.Muted,{children:[e.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",(0,O.minsBetween)(new Date(e.createdAt),s)," min ago \xb7 ",(0,R.gbp)(e.paid)," of ",(0,R.gbp)(e.total)," paid",e.split?` \xb7 split ${e.split.paidShares}/${e.split.ways}`:'']})]},e.id)),r.filter(B.LIVE).length?null:(0,V.jsx)(v.Muted,{children:"No live table orders."}),n?(0,V.jsxs)(v.Sheet,{visible:!0,onClose:()=>l(null),title:`${(0,a.tableNumbers)(n)} QR code`,children:[(0,V.jsx)(w.default,{style:{alignItems:'center',backgroundColor:'#fff',padding:16,borderRadius:12},children:(0,V.jsx)(C.QR,{value:`https://covercharge.example/t/${e}/${n}`,size:200})}),(0,V.jsxs)(v.Muted,{center:!0,children:["Example link (table ordering links aren\u2019t live yet): covercharge.example/t/",e,"/",n]}),(0,V.jsx)(v.Banner,{kind:"demo",title:"Print later",children:"Printing table cards from here isn\u2019t set up yet. Nothing is printed or sent."}),(0,V.jsx)(v.Button,{label:`Preview customer table ordering (${(0,a.tableNumbers)(n)})`,onPress:()=>{const e=n;l(null),j.router.push(`/table/${e}`)}}),(0,V.jsx)(v.Button,{kind:"secondary",label:"Show the code again",onPress:()=>l(n)})]}):null]})}function K({go:e,onClose:s}){const{rid:t,today:r,role:n}=(0,A.useCtx)(1e4),a=(0,T.useOrders)(t),l=(0,T.useStore)(e=>e.bookings);(0,E.useBackLayer)(!0,s);const i=a.filter(B.LIVE),o=[...i.filter(e=>(0,D.chainNeedsAction)(e,l)).map(e=>{const s=(0,D.nextStep)(e,(0,D.linkedBooking)(e,l)),t=D.CHAIN_STEPS.find(e=>e.id===s);return{id:`o-${e.id}`,at:e.createdAt,title:`${e.ref} \xb7 ${'table'===e.type?`Table ${e.tableNo??''}`.trim():'Takeaway'}${e.customerName?` \xb7 ${e.customerName}`:''}`,when:`Ordered ${(0,O.hm)(new Date(e.createdAt))}`,allergies:e.allergies.map(e=>(0,U.allergenLabel)(e.allergen)).join(', '),next:t?`Next: ${t.n}. ${t.label} sign-off`:'Sign-off waiting',tab:'orders',open:'Open Orders to sign off'}}),...l.filter(e=>e.restaurantId===t&&e.date===r&&'cancelled'!==e.status&&(0,D.bookingNeedsAction)(e,i)).map(e=>({id:`b-${e.id}`,at:`${e.date}T${e.time}`,title:`${e.name} \xb7 ${e.partySize} at ${e.time}`,when:`Booking ${e.ref??''}`.trim(),allergies:e.allergies.map(e=>(0,U.allergenLabel)(e.allergen)).join(', '),next:'Next: 1. Booked sign-off',tab:'bookings',open:'Open Bookings to sign off'}))].sort((e,s)=>e.at.localeCompare(s.at));return(0,V.jsxs)(w.default,{testID:"pending-list",style:{gap:12,alignItems:'stretch'},children:[(0,V.jsx)(E.BackButton,{onPress:s,testID:"pending-back"}),(0,V.jsx)(v.T,{center:!0,size:22,weight:"bold",colour:I.colours.gold,accessibilityRole:"header",style:{alignSelf:'stretch'},children:"Awaiting verification"}),(0,V.jsx)(v.Muted,{center:!0,testID:"pending-status",children:o.length?`${o.length} allergy ${1===o.length?'sign-off':'sign-offs'} waiting, oldest first.`:'Nothing is waiting for an allergy sign-off.'}),o.map(s=>(0,V.jsxs)(v.Card,{highlight:I.colours.red,style:{alignItems:'center',gap:8},children:[(0,V.jsxs)(w.default,{testID:`pending-row-${s.id}`,accessible:!0,accessibilityLabel:`${s.title}, ${s.when}, allergies: ${s.allergies}. ${s.next}.`,style:{alignItems:'center',gap:4,width:'100%'},children:[(0,V.jsx)(v.T,{center:!0,weight:"bold",size:18,children:s.title}),(0,V.jsx)(v.T,{center:!0,children:s.when}),(0,V.jsxs)(v.Muted,{center:!0,children:["Allergies: ",s.allergies]}),(0,V.jsx)(v.T,{center:!0,colour:I.colours.gold,children:s.next})]}),(0,V.jsx)(v.Button,{small:!0,label:s.open,onPress:()=>e(s.tab),style:{alignSelf:'stretch'}})]},s.id)),'owner'===n||'manager'===n?(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Allergen sign-off log",onPress:()=>e('more','allergen-signoffs')}):null]})}function X(){const e=(0,S.useOwner)(e=>e.merch),s=(0,S.useOwner)(e=>e.merchOrders),[t,r]=(0,m.useState)(''),[n,a]=(0,m.useState)(''),l=(s,t)=>S.useOwner.getState().setOwner({merch:e.map(e=>e.id===s?{...e,...t}:e)});return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Banner,{kind:"demo",title:"Optional add-on",children:"Sell branded items in the customer app for collection. Example only on this device; nothing is charged."}),(0,V.jsx)(B.SectionHead,{title:"Products & stock"}),e.map(e=>(0,V.jsxs)(w.default,{style:v.styles.card,children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",style:{flex:1},children:e.name}),(0,V.jsx)(v.T,{children:(0,R.gbp)(e.price)})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(w.default,{style:{flex:1,minWidth:0},children:(0,V.jsx)(v.Toggle,{label:e.live?'In shop':'Hidden',a11y:`${e.name} live`,value:e.live,onChange:s=>l(e.id,{live:s})})}),(0,V.jsx)(v.Stepper,{value:e.stock,min:0,max:500,onChange:s=>l(e.id,{stock:s}),label:`${e.name} stock`})]}),0===e.stock?(0,V.jsx)(v.T,{size:13,colour:I.colours.red,children:"Out of stock"}):e.stock<8?(0,V.jsx)(v.T,{size:13,colour:I.colours.amber,children:"Low stock"}):null]},e.id)),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Add a product"}),(0,V.jsx)(v.Field,{label:"Name",value:t,onChangeText:r}),(0,V.jsx)(v.Field,{label:"Price \xa3",value:n,onChangeText:a,keyboardType:"decimal-pad"}),(0,V.jsx)(v.Button,{small:!0,label:"Add product",disabled:t.trim().length<2||!(Number(n)>0),onPress:()=>{S.useOwner.getState().setOwner({merch:[...e,{id:`mc-${Date.now()}`,name:t.trim(),price:Math.round(100*Number(n)),stock:10,live:!0}]}),r(''),a('')}})]}),(0,V.jsx)(B.SectionHead,{title:"Shop orders"}),s.map(t=>{const r=e.find(e=>e.id===t.productId);return(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",style:{flex:1},children:[t.qty,"\xd7 ",r?.name," \xb7 ",t.customer]}),(0,V.jsx)(v.Badge,{kind:'new'===t.status?'amber':'ready'===t.status?'blue':'ok',label:t.status})]}),(0,V.jsxs)(v.Muted,{children:[t.at," \xb7 ",(0,R.gbp)((r?.price??0)*t.qty)]}),'collected'!==t.status?(0,V.jsx)(v.Button,{small:!0,label:'new'===t.status?'Mark ready':'Mark collected',onPress:()=>S.useOwner.getState().setOwner({merchOrders:s.map(e=>e.id===t.id?{...e,status:'new'===t.status?'ready':'collected'}:e)})}):null]},t.id)})]})}const Y=[{n:1,title:'Loyalty stamp card',links:[['Stamp card','loyalty']],note:'Settings, members, add/redeem, stats. One card across dine-in & takeaway.'},{n:2,title:'Bring-a-friend referrals',links:[['Referrals','referrals']],note:'Rewards, referral list and stats.'},{n:3,title:'Gift cards & vouchers',links:[['Gift cards','giftcards']],note:'Sold through your website. Check a balance, take it off the bill, honour website bookings cards.'},{n:4,title:'QR order & pay at table',links:[['Tables & QR codes','tables']],note:'Table list, QR per table, live table orders.'},{n:5,title:'Direct takeaway ordering',links:[['Takeaway settings','takeaway'],['Orders','tab:orders']],note:'Slots, capacity, live queue, readiness alerts (takeaway only).'},{n:6,title:'Table bookings, no-shows & waitlist',links:[['Bookings','tab:bookings'],['Booking settings','bookingsettings']],note:'Deposits (Deposit due / paid, set in Settings \u203a Advanced), no-show marking, reminders, online waitlist.'},{n:7,title:'Allergy verification',links:[['Allergy hub','allergy'],['Menu & allergens','menu']],note:'14 UK allergens per dish, kitchen alerts, named verification, audit log.'},{n:8,title:'Push offers & specials (opt-in)',links:[['Marketing','marketing'],['Specials & offers','offers']],note:'Saved campaign drafts. Delivery is not connected.'},{n:9,title:'Calendar & marketing hooks',links:[['Forecast calendar','tab:forecast'],['Events','events']],note:'Scottish bank holidays, school holidays, local & own events, promo hooks.'},{n:10,title:'Private feedback',links:[['Feedback inbox','feedback'],['Reviews','reviews']],note:'Low-rating alerts. No review gating.'},{n:11,title:'Lost property & coat check',links:[['Lost property','lost']],note:'Found items and coat-check tickets.'},{n:12,title:'Merch shop (optional)',links:[['Merch shop','merch']],note:'Products, stock and orders.'},{n:14,title:'Staff group chat',links:[['Chat','tab:chat']],note:'Channels, DMs, photos, reactions, read receipts, pins, auto-posts, cover requests. Local only.'},{n:16,title:'Suppliers',links:[['Suppliers','suppliers'],['Prep & stock list','prep']],note:'Contacts, categories, favourites, cut-offs and delivery days, tap to call/email/website, orders due today, order log, staff permission.'},{n:17,title:'Hours & pay',links:[['My hours & pay','mypay'],['Payroll & pay rates','payroll'],['Timesheets','timesheets']],note:'Staff see their own hours and gross pay (before tax, estimate) plus tips; owner sets hourly rates and sees the team payroll summary.'},{n:15,title:'Tip splitter',links:[['Tips','tips'],['My tips','mytips']],note:'Pay periods, card + cash pot, 4 split methods, approve & lock, compliance checklist.'},{n:18,title:'Post to social',links:[['Post to social','social'],['Connected accounts','socialaccounts'],['Marketing','marketing']],note:'Social publishing is not connected. No accounts are linked and nothing is posted.'},{n:20,title:'Head Chef app',links:[['Menu & allergens','menu'],['Suppliers','suppliers']],note:'CoverCharge for Head Chef: stock with par levels and alerts, stock take, deliveries checked against the order, recipe cards with dish cost, GP % and cash GP against a target, price-change impact, theoretical vs actual GP, menu engineering, waste log, ordering from par and forecast, prep lists, 14-allergen matrix with sign-off, temperatures, cleaning and daily checks, kitchen rota, chat, live tickets and a Sold out list (a reminder for staff, shown on the Display). Uses this menu and these suppliers.'},{n:21,title:'Branding',links:[['Branding','branding']],note:'Your logo and accent colour lead all five apps, with a small "powered by CoverCharge". Pick any colour with the colour picker or a hex code; text on it stays readable.'},{n:19,title:'Quick links',links:[['Quick links','quicklinks'],['Dashboard','tab:home']],note:'One-tap Work email (Gmail) and Website bookings view/edit for owners and managers, plus up to 6 of your own links. Staff never see the website bookings links; per-link staff visibility for the rest (off by default). Head Chef: no quick links or email at all. Opens the app or site only.'},{n:13,title:'Forecasting, dashboard & running the business',links:[['Forecast','tab:forecast'],['Dashboard','tab:home'],['Tablet preview','tablet'],['Rota','rota'],['Clock in/out','clock'],['Timesheets','timesheets'],['Analytics','analytics'],['CRM','crm'],['Plan & billing','plan']],note:'Headline forecast, rotas, geofenced clock in/out with break prompt, analytics, CRM'+f.PLAN_FEATURE_NOTE+'.'}];const J=async e=>{try{return'undefined'!=typeof localStorage&&'1'===localStorage.getItem(e)}catch{return!1}},Z=async e=>{try{'undefined'!=typeof localStorage&&localStorage.setItem(e,'1')}catch{}};function ee({kind:e}){const{r:s}=(0,A.useCtx)(6e4),t=(0,S.useOwner)(e=>e.offers);(0,m.useEffect)(()=>{(0,h.migrateLocalOnce)({offers:t},J,Z).catch(()=>{})},[]);const r=(0,u.can)('venue.settings');return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(b.LoyaltySummaryCard,{kind:e}),(0,V.jsx)(g.StaffLoyalty,{venue:s.name,canRemove:r,onOpenSettings:r?()=>{i.advancedPrefill.q='loyalty',o.useVoiceNav.getState().go?.('more','advanced')}:void 0}),r?(0,V.jsx)(v.Card,{children:(0,V.jsxs)(w.default,{style:{gap:8},children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Card, offers and bring-a-friend settings"}),(0,V.jsx)(b.LoyaltySettingsPanel,{})]})}):null]})}},1450,[5,1366,827,837,860,1451,1388,1422,1193,14,1227,988,1452,1454,1389,34,1113,1430,30,402,102,879,1247,794,874,892,867,881,1117,858,821,1165,1079,1133,884,1403,869,1048,1149,863,861,25]); +__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.GiftVouchers=function(){return r.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(Q,{}):(0,V.jsx)(W,{})},_e.Merch=function(){return r.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(Q,{}):(0,V.jsx)(X,{})},_e.TablesQr=function({go:e}={}){const{rid:t,r:s,now:n,me:a}=(0,N.useCtx)(1e4);return r.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(i.StaffTableOrders,{rid:t,me:a}),(0,V.jsx)(v.Muted,{children:"QR codes, tables and hours: Settings \u203a Advanced \u203a Order at the table."})]}):(0,M.orderAtTableOn)(s)?(0,V.jsx)(q,{rid:t,now:n,me:a}):(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Banner,{kind:"info",title:"Order at table is off",children:"In-house orders go through your till. Switch it on in Settings \u203a Order at table if this venue takes orders at the table."}),e?(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Open Order at table settings",onPress:()=>e('more','orderattable')}):null]})},_e.TakeawaySettings=function({go:e}){const{rid:t,r:s,now:n}=(0,N.useCtx)(3e4),r=(0,S.useOrders)(t),a=s.settings,i=(0,P.takeawaySlots)(s,r,n).slice(0,10),l=e=>G().updateSettings(t,e),o=r.filter(e=>'takeaway'===e.type&&(0,I.LIVE)(e));return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Card,{highlight:a.takeawayPaused?B.colours.red:B.colours.ok,children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",children:a.takeawayPaused?'Takeaway paused':'Taking takeaway orders'}),(0,V.jsx)(v.Toggle,{label:"Takeaway on",value:!a.takeawayPaused,onChange:e=>l({takeawayPaused:!e})})]}),(0,V.jsx)(v.Muted,{children:"Direct ordering, no delivery-app commission."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Collection slots & capacity"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Slot length (min)"}),(0,V.jsx)(v.Stepper,{value:a.slotMinutes,min:5,max:30,onChange:e=>l({slotMinutes:e}),label:"slot minutes"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Orders per slot"}),(0,V.jsx)(v.Stepper,{value:a.slotCap,min:1,max:20,onChange:e=>l({slotCap:e}),label:"orders per slot"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Earliest pickup (min ahead)"}),(0,V.jsx)(v.Stepper,{value:a.leadMins,min:5,max:60,onChange:e=>l({leadMins:e}),label:"lead minutes"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Readiness buffer (min)"}),(0,V.jsx)(v.Stepper,{value:a.bufferMins,min:0,max:20,onChange:e=>l({bufferMins:e}),label:"buffer minutes"})]}),(0,V.jsx)(v.Muted,{children:"Readiness alerts (start cooking \u2192 bag it \u2192 ready) are for takeaway only, timed from the pickup slot. Dine-in starts when the table is seated and has ordered."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Next slots"}),i.map(e=>(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{size:14,children:e.label}),(0,V.jsx)(w.default,{style:{flex:1,height:8,marginHorizontal:8,backgroundColor:B.colours.border,borderRadius:4},children:(0,V.jsx)(w.default,{style:{width:e.taken/e.cap*100+"%",height:8,backgroundColor:e.full?B.colours.red:B.colours.gold,borderRadius:4}})}),(0,V.jsxs)(v.Muted,{children:[e.taken,"/",e.cap]})]},e.label))]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",children:["Live queue: ",o.length]}),(0,V.jsx)(v.Button,{small:!0,label:"Open orders",onPress:()=>e('orders')})]}),o.map(e=>(0,V.jsxs)(v.Muted,{children:[e.slotTime?(0,O.hm)(new Date(e.slotTime)):'\u2013'," \xb7 ",e.ref," ",e.customerName," \xb7 ",(0,I.statusLabel)(e)]},e.id))]})]})},_e.BookingSettings=function({go:e}){const{rid:n,r:r}=(0,N.useCtx)(6e4),a=r.settings,i=(0,T.useOwner)(e=>e.reminders),l=e=>G().updateSettings(n,e),o=e=>T.useOwner.getState().setOwner({reminders:{...i,...e}});return(0,V.jsxs)(w.default,{style:{gap:10},children:[t.IS_GREENSIDE?(0,V.jsx)(s.GreensideCashOnly,{}):(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Deposits"}),(0,V.jsxs)(v.Muted,{children:[(()=>{const e=(0,c.depositOf)(a);return e.on&&e.perPersonPence>0?`On: ${(0,R.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more.`:'Off.'})()," Deposits are paid through website bookings: website bookings show Deposit paid on website bookings by themselves; staff tick phone and walk-in deposits paid."]}),(0,V.jsx)(v.Muted,{children:"Tip: change the amount, party size, refunds and the words guests see in Settings \u203a Advanced \u203a Deposits."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Reminders"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Reminder 24 hours before"}),(0,V.jsx)(v.Toggle,{label:"24h reminder",value:i.h24,onChange:e=>o({h24:e})})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Reminder 2 hours before"}),(0,V.jsx)(v.Toggle,{label:"2h reminder",value:i.h2,onChange:e=>o({h2:e})})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Ask guests to confirm or cancel"}),(0,V.jsx)(v.Toggle,{label:"confirm",value:i.confirmText,onChange:e=>o({confirmText:e})})]}),(0,V.jsx)(v.Muted,{children:"Guest reminders are not connected; nothing is sent."})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Capacity & waitlist"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Booking start times (min)"}),(0,V.jsx)(v.Stepper,{value:(0,P.bookingSlotMinutesOf)(r),min:15,max:30,step:15,onChange:e=>l({bookingSlotMinutes:e}),label:"booking start times"})]}),null!=(0,P.bookingCoversPerStartOf)(r)||null!=(0,P.bookingPartiesPerStartOf)(r)?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Covers at each start time"}),(0,V.jsx)(v.Stepper,{value:a.bookingCoversPerStart??15,min:1,max:60,onChange:e=>l({bookingCoversPerStart:e}),label:"covers at each start time"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Bookings at each start time"}),(0,V.jsx)(v.Stepper,{value:a.bookingPartiesPerStart??4,min:1,max:20,onChange:e=>l({bookingPartiesPerStart:e}),label:"bookings at each start time"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Online party size, from"}),(0,V.jsx)(v.Stepper,{value:(0,P.onlinePartyBounds)(r).min,min:1,max:(0,P.onlinePartyBounds)(r).max,onChange:e=>l({onlinePartyMin:e}),label:"online party from"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Online party size, up to"}),(0,V.jsx)(v.Stepper,{value:(0,P.onlinePartyBounds)(r).max,min:(0,P.onlinePartyBounds)(r).min,max:100,onChange:e=>l({onlinePartyMax:e}),label:"online party up to"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Minimum notice (min)"}),(0,V.jsx)(v.Stepper,{value:(0,P.bookingNoticeMinsOf)(r),min:0,max:180,step:5,onChange:e=>l({bookingNoticeMins:e}),label:"minimum notice"})]}),(0,V.jsx)(v.Muted,{children:"Each start time has its own covers and bookings cap, so 19:00 and 19:15 do not share a limit. Last booking is still the closing time. Staff can still book over the limit from New booking."})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Covers per 30-min slot"}),(0,V.jsx)(v.Stepper,{value:a.bookingCoversPerSlot,min:2,max:60,onChange:e=>l({bookingCoversPerSlot:e}),label:"Covers per slot"})]}),(0,V.jsx)(v.Muted,{children:"Guests can pick a start every 15 or 30 minutes. The covers cap is still for each half hour, so 19:00 and 19:15 share the same limit."})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Typical table turn (min)"}),(0,V.jsx)(v.Stepper,{value:a.turnMins,min:30,max:180,onChange:e=>l({turnMins:e}),label:"turn minutes"})]}),(0,V.jsx)(v.Muted,{children:"The online waitlist estimate uses the table turn time."}),(0,V.jsx)(v.Button,{small:!0,label:"Open bookings & waitlist",onPress:()=>e('bookings')})]})]})},_e.AllergyHub=function({go:e}){const{rid:t,today:s,role:n,me:r}=(0,N.useCtx)(1e4),[a,i]=(0,x.useState)(null),l=(0,S.useOrders)(t),o=(0,S.useStore)((0,k.useShallow)(e=>e.bookings.filter(e=>e.restaurantId===t&&e.date===s))),d=(0,S.useAudit)(t).filter(e=>'allergy'===e.kind),c=(0,z.useUnsignedDishes)(t),h=(0,S.useStore)(e=>e.bookings),u=l.filter(e=>(0,I.LIVE)(e)&&(0,D.chainNeedsAction)(e,h)).length+o.filter(e=>'cancelled'!==e.status&&(0,D.bookingNeedsAction)(e,l.filter(I.LIVE))).length,g=(0,N.useSignedIn)(),p=(0,F.cardActorFor)(r,'owner'===n?'owner':'manager'===n?'manager':'staff',g);if('unsigned'===a)return(0,V.jsx)(z.UnsignedDishList,{rid:t,actor:p,onClose:()=>i(null),onOpenCards:()=>e('more','recipecards')});if('pending'===a)return(0,V.jsx)(K,{go:e,onClose:()=>i(null)});const m={flex:1,minHeight:48};return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Banner,{kind:"info",title:"Supports staff, doesn't replace them",children:"CoverCharge flags the 14 UK allergens and asks a named person to verify. Staff still check with the guest and the recipe every time."}),(0,V.jsxs)(v.Row,{gap:8,children:[(0,V.jsx)(y.default,{testID:"tile-awaiting-verification",accessibilityRole:"button",accessibilityLabel:`Awaiting verification, ${u}. Opens the list.`,onPress:()=>i('pending'),style:({pressed:e})=>[m,{opacity:e?.85:1}],children:(0,V.jsxs)(v.Card,{style:{flex:1,alignItems:'center'},highlight:u?B.colours.red:void 0,children:[(0,V.jsx)(v.Muted,{center:!0,children:"Awaiting verification"}),(0,V.jsx)(v.T,{center:!0,size:20,weight:"bold",children:u})]})}),(0,V.jsx)(y.default,{testID:"tile-not-signed-off",accessibilityRole:"button",accessibilityLabel:`Dishes not signed off, ${c.length}. Opens the list.`,onPress:()=>i('unsigned'),style:({pressed:e})=>[m,{opacity:e?.85:1}],children:(0,V.jsxs)(v.Card,{style:{flex:1,alignItems:'center'},highlight:c.length?B.colours.amber:void 0,children:[(0,V.jsx)(v.Muted,{center:!0,children:"Dishes not signed off"}),(0,V.jsx)(v.T,{center:!0,size:20,weight:"bold",children:c.length})]})})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"1. Allergens per dish (14 UK allergens)"}),(0,V.jsx)(v.Muted,{children:"Each dish\u2019s recipe card lists contains / may contain, suggested from its ingredients. The head chef signs each card off; the menu, takeaway and booking checks all read the cards."}),(0,V.jsx)(v.Button,{small:!0,label:"Recipe cards",onPress:()=>e('more','recipecards')})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"2. Kitchen alerts on orders & bookings"}),(0,V.jsx)(v.Muted,{children:"Red allergy cards; cooking is blocked until the Kitchen sign-off."}),(0,V.jsxs)(v.Row,{gap:6,children:[(0,V.jsx)(v.Button,{small:!0,label:"Orders",onPress:()=>e('orders')}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Bookings",onPress:()=>e('bookings')})]})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"3. Five-step sign-off chain"}),(0,V.jsx)(v.Muted,{children:"Booked, Ordered, Kitchen, Pass and Table: a named person taps Sign off at each step, in order."}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Allergen sign-off log",onPress:()=>e('more','allergen-signoffs')})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"4. Audit log"}),d.slice(0,6).map(e=>(0,V.jsxs)(v.Muted,{children:[(0,O.hm)(new Date(e.at))," \xb7 ",e.text]},e.id)),d.length?null:(0,V.jsx)(v.Muted,{children:"No allergy events yet."}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Full log & daily checks",onPress:()=>e('more','compliance')})]})]})},_e.TabletPreview=function(){return(0,V.jsx)(w.default,{style:{gap:10},children:(0,V.jsxs)(v.Card,{highlight:B.colours.gold,style:{alignItems:'center'},children:[(0,V.jsxs)(w.default,{style:{width:240,height:160,borderRadius:14,borderWidth:3,borderColor:B.colours.border,alignItems:'center',justifyContent:'center'},children:[(0,V.jsx)(v.T,{size:30,children:"\ud83d\udda5\ufe0f"}),(0,V.jsx)(v.T,{weight:"semibold",children:"Kitchen & front-of-house tablet"})]}),(0,V.jsx)(v.T,{size:20,weight:"bold",colour:B.colours.gold,children:"CoverCharge for Display"}),(0,V.jsx)(v.Muted,{center:!0,children:"The in-restaurant tablet and kitchen display is its own app, CoverCharge for Display (landscape). Everything it shows (orders, readiness alerts, allergies, bookings) is also live in this app."})]})})},_e.AllFeatures=function({go:e}){const{role:t,r:s}=(0,N.useCtx)(6e4),n=(0,d.useLiveVenue)(),r=t=>t.startsWith('tab:')?e(t.slice(4)):e('more',t),a=e=>e.startsWith('tab:')?'tab:forecast'!==e||T.CAN.forecasts(t):(()=>{const s=$.PAGES.find(t=>t.id===e);return!!s&&(!s.can||s.can(t))})();return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Card,{highlight:B.colours.gold,children:[(0,V.jsx)(v.T,{weight:"semibold",children:"CoverCharge is five apps that share one set of venue data"}),[['CoverCharge for Managers','This app. Run the venue: orders, bookings, forecasts, team, menu, marketing, social posting, billing.','This app'],['CoverCharge for Staff','Clock in/out with break prompt, rota, swaps & leave, chat, my hours & pay, my tips.','Separate app'],['CoverCharge',`For customers: menu, takeaway ordering, table bookings, loyalty, gift cards${(0,M.orderAtTableOn)(s)?', QR table ordering':''}.`,'Separate app'],['CoverCharge for Display','Restaurant tablet / kitchen display: live orders, readiness, allergy alerts.','Separate app'],['CoverCharge for Head Chef','Stock and deliveries, recipe costing and GP, menu engineering, waste, ordering, prep lists, allergens, kitchen compliance, kitchen rota and chat, plus My pay & tips (their own hours, tips, tip goal and paydays only). No other staff pay, customer data or billing.','Separate app']].map(([e,t,s])=>(0,V.jsxs)(v.Row,{style:{alignItems:'flex-start'},children:[(0,V.jsxs)(w.default,{style:{flex:1},children:[(0,V.jsx)(v.T,{weight:"medium",children:e}),(0,V.jsx)(v.Muted,{children:t})]}),(0,V.jsx)(v.Badge,{kind:'This app'===s?'ok':'gold',label:s})]},e)),'owner'===t?(0,V.jsx)(v.Chip,{label:"Open the Staff app preview \u203a",onPress:()=>{T.useOwner.getState().setPreviewRole('staff'),e('home')}}):null,(0,V.jsx)(v.Muted,{children:n?'All five share your venue\u2019s live data. Each is installed separately, and your venue\u2019s own logo leads (Settings \u203a Branding).':'This copy isn\u2019t connected to a venue yet, so it only shows what is saved on this device. Each app is installed separately, and the venue\u2019s own logo leads (Settings \u203a Branding).'})]}),(0,V.jsx)(v.Muted,{children:"Every CoverCharge feature and where to manage it."}),[...Y].filter(e=>4!==e.n||(0,M.orderAtTableOn)(s)).sort((e,t)=>e.n-t.n).map(e=>(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{alignItems:'flex-start'},children:[(0,V.jsxs)(v.T,{weight:"bold",colour:B.colours.gold,style:{width:26},children:[e.n,"."]}),(0,V.jsxs)(w.default,{style:{flex:1},children:[(0,V.jsx)(v.T,{weight:"semibold",children:e.title}),(0,V.jsx)(v.Muted,{children:e.note})]})]}),(0,V.jsx)(v.Row,{wrap:!0,gap:6,children:e.links.filter(([,e])=>a(e)).map(([e,t])=>(0,V.jsx)(v.Chip,{label:`${e} \u203a`,onPress:()=>r(t)},t))})]},e.n))]})},Object.defineProperty(_e,"Divider",{enumerable:!0,get:function(){return v.Divider}}),_e.Loyalty=function(){return r.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(ee,{kind:"card"}):(0,V.jsx)(_,{})},_e.Referrals=function(){return r.LIVE_VENUE_BUILD||(0,h.staffServer)()?(0,V.jsx)(ee,{kind:"referrals"}):(0,V.jsx)(H,{})};var t=_r(_d[0]),s=_r(_d[1]),n=_r(_d[2]),r=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),l=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),u=_r(_d[11]),g=_r(_d[12]),p=_r(_d[13]),m=_r(_d[14]),x=_r(_d[15]),b=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),y=e(_r(_d[19])),w=e(_r(_d[20])),k=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),S=_r(_d[24]),T=_r(_d[25]),R=_r(_d[26]),M=_r(_d[27]),P=_r(_d[28]),O=_r(_d[29]),B=_r(_d[30]),I=_r(_d[31]),N=_r(_d[32]),A=_r(_d[33]),L=_r(_d[34]),$=_r(_d[35]),D=_r(_d[36]),E=_r(_d[37]),z=_r(_d[38]),F=_r(_d[39]),U=_r(_d[40]),V=_r(_d[41]);const G=()=>S.useStore.getState();function _(){const{rid:e,r:s,me:r}=(0,N.useCtx)(3e4),a=s.settings,i=(0,S.useStore)((0,k.useShallow)(t=>t.stampCards.filter(t=>t.restaurantId===e))),l=(0,S.useStore)(e=>e.customer.name),o=(0,S.useAudit)(e).filter(e=>'stamp'===e.kind),d=(0,x.useMemo)(()=>(0,A.crmCustomers)(),[]),[c,h]=(0,x.useState)(a.stampReward),[u,g]=(0,x.useState)('');(0,x.useEffect)(()=>{(0,L.examplesAllowed)()&&e===t.VENUE_RID&&!i.some(e=>e.customerId.startsWith('cr-'))&&S.useStore.setState(t=>({stampCards:[...t.stampCards,...d.filter(e=>'cust-demo'!==e.id).map((t,s)=>({restaurantId:e,customerId:t.id,stamps:t.stamps%a.stampTarget,rewardsAvailable:s%5==0?1:0,history:[{at:'2026-10-20',source:s%2?'Takeaway':'Dine-in'}]}))]}))},[e]);const p=e=>d.find(t=>t.id===e)?.name??(e===S.useStore.getState().customer.id?l||'Guest':e),m=i.filter(e=>!u||p(e.customerId).toLowerCase().includes(u.toLowerCase())).sort((e,t)=>t.stamps-e.stamps),b=(0,L.examplesAllowed)(),f=o.filter(e=>/redeemed/.test(e.text)).length+(b?31:0);return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Row,{gap:8,children:[(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Active cards"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:i.length})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Rewards ready"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:i.reduce((e,t)=>e+t.rewardsAvailable,0)})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Redeemed"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:f}),(0,V.jsx)(v.Muted,{children:b?'all time (example)':'all time'})]})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Card settings"}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Stamps for a reward"}),(0,V.jsx)(v.Stepper,{value:a.stampTarget,min:3,max:15,onChange:t=>G().updateSettings(e,{stampTarget:t}),label:"stamps"})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{children:"Min spend \xa3"}),(0,V.jsx)(v.Stepper,{value:a.stampMinSpend/100,min:0,max:50,onChange:t=>G().updateSettings(e,{stampMinSpend:100*t}),label:"minimum spend"})]}),(0,V.jsx)(v.Field,{label:"Reward",value:c,onChangeText:h}),(0,V.jsx)(v.Button,{small:!0,label:"Save reward",onPress:()=>G().updateSettings(e,{stampReward:c.trim()||a.stampReward})}),(0,V.jsx)(v.Muted,{children:"One card per customer account, shared across dine-in, table QR and takeaway."})]}),(0,V.jsx)(I.SectionHead,{title:"Members"}),(0,V.jsx)(n.TextInput,{accessibilityLabel:"Search members",placeholder:"Search members",placeholderTextColor:"#7D776C",value:u,onChangeText:g,style:v.styles.input}),m.map(t=>(0,V.jsxs)(w.default,{style:v.styles.card,children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",style:{flex:1},children:p(t.customerId)}),t.rewardsAvailable?(0,V.jsx)(v.Badge,{kind:"ok",label:`${t.rewardsAvailable} reward ready`}):null]}),(0,V.jsx)(v.Row,{gap:4,children:Array.from({length:a.stampTarget},(e,s)=>(0,V.jsx)(w.default,{style:{flex:1,height:8,borderRadius:4,backgroundColor:se.source))).join(', ')||'\u2013']}),(0,V.jsxs)(v.Row,{gap:6,children:[(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Add stamp",onPress:()=>G().addStamp(e,t.customerId,`Manual (${r})`)}),(0,V.jsx)(v.Button,{small:!0,label:"Redeem reward",disabled:!t.rewardsAvailable,onPress:()=>G().redeemReward(e,t.customerId)})]})]},t.customerId))]})}function H(){const e=(0,T.useOwner)(e=>e.referral),t=(0,T.useOwner)(e=>e.referrals),[s,n]=(0,x.useState)(e.giverReward),[r,a]=(0,x.useState)(e.friendReward),i=e=>t.filter(t=>t.status===e).length,l=(0,L.examplesAllowed)();return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Row,{gap:8,children:[l?(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Invites sent"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:"64"}),(0,V.jsx)(v.Muted,{children:"example"})]}):null,(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Sign-ups"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:t.length+(l?23:0)})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Ordered"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:i('first order')+i('rewarded')+(l?9:0)})]})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Bring a friend"}),(0,V.jsx)(v.Toggle,{label:"Referrals on",value:e.active,onChange:t=>T.useOwner.getState().setOwner({referral:{...e,active:t}})})]}),(0,V.jsx)(v.Field,{label:"Reward for the customer who invites",value:s,onChangeText:n}),(0,V.jsx)(v.Field,{label:"Reward for the friend (first order)",value:r,onChangeText:a}),(0,V.jsx)(v.Button,{small:!0,label:"Save rewards",onPress:()=>T.useOwner.getState().setOwner({referral:{...e,giverReward:s.trim(),friendReward:r.trim()}})}),(0,V.jsx)(v.Muted,{children:"The inviter\u2019s reward is added to their account after the friend\u2019s first order."})]}),(0,V.jsx)(I.SectionHead,{title:"Referrals"}),t.map(e=>(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",style:{flex:1},children:[e.referrer," \u2192 ",e.friend]}),(0,V.jsx)(v.Badge,{kind:'rewarded'===e.status?'ok':'first order'===e.status?'gold':'neutral',label:e.status})]}),(0,V.jsx)(v.Muted,{children:e.at})]},e.id))]})}function Q(){const{me:e}=(0,N.useCtx)(6e4),t=(0,N.useSignedIn)();return(0,V.jsx)(p.GiftCardsPage,{me:(t?.name??e).replace(' (example)','')})}function W(){const{rid:e,me:t}=(0,N.useCtx)(6e4),s=(0,S.useStore)((0,k.useShallow)(t=>t.giftCards.filter(t=>t.restaurantId===e))),[r,a]=(0,x.useState)(25),[i,l]=(0,x.useState)(''),[o,d]=(0,x.useState)(''),[c,h]=(0,x.useState)(''),[u,g]=(0,x.useState)(''),[p,m]=(0,x.useState)(''),[b,f]=(0,x.useState)(null),j=s.find(e=>e.code.toUpperCase()===o.trim().toUpperCase()),y=s.find(e=>e.legacy&&e.code.toUpperCase()===u.trim().toUpperCase());return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsxs)(v.Row,{gap:8,children:[(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Sold"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:(0,R.gbp)(s.reduce((e,t)=>e+t.initial,0))})]}),(0,V.jsxs)(v.Card,{style:{flex:1},children:[(0,V.jsx)(v.Muted,{children:"Outstanding"}),(0,V.jsx)(v.T,{size:20,weight:"bold",children:(0,R.gbp)(s.reduce((e,t)=>e+t.balance,0))})]})]}),b?(0,V.jsx)(v.Banner,{kind:"success",title:b}):null,(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Check balance & redeem"}),(0,V.jsx)(n.TextInput,{accessibilityLabel:"Gift card code",placeholder:"Code, e.g. ANC-G7QX-4M2P-9TRE",placeholderTextColor:"#7D776C",autoCapitalize:"characters",value:o,onChangeText:d,style:v.styles.input}),o.trim().length>5?j?(0,V.jsxs)(v.Muted,{children:[j.recipientName," \xb7 balance ",(0,R.gbp)(j.balance)," of ",(0,R.gbp)(j.initial),j.legacy?' \xb7 legacy website bookings':'']}):(0,V.jsx)(v.T,{size:13,colour:B.colours.red,children:"No card with that code."}):null,(0,V.jsx)(v.Field,{label:"Amount to redeem \xa3",value:c,onChangeText:h,keyboardType:"decimal-pad"}),(0,V.jsx)(v.Button,{small:!0,label:"Redeem",disabled:!j||!(Number(c)>0)||100*Number(c)>(j?.balance??0),onPress:()=>{G().redeemGiftCard(o,Math.round(100*Number(c)),t)&&(f(`Redeemed \xa3${Number(c).toFixed(2)} from ${j.code}`),h(''))}})]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Honour an old website bookings gift card"}),(0,V.jsx)(n.TextInput,{accessibilityLabel:"Website bookings gift card code",placeholder:"Old gift card code, e.g. WEB-OLD-10-EXAMPLE",placeholderTextColor:"#7D776C",autoCapitalize:"characters",value:u,onChangeText:g,style:v.styles.input}),u.trim().length>4?y?(0,V.jsxs)(v.Muted,{children:["Found in imported website bookings cards: balance ",(0,R.gbp)(y.balance),". Redeem it above."]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(v.Muted,{children:"Not in the imported list. Check it in your website bookings dashboard, then honour it here:"}),(0,V.jsx)(v.Field,{label:"Balance confirmed in website bookings \xa3",value:p,onChangeText:m,keyboardType:"decimal-pad"}),(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Honour & add to CoverCharge",disabled:!(Number(p)>0),onPress:()=>{const s=G().honourLegacyCard(e,u,Math.round(100*Number(p)),t);f(`Website bookings card ${s.code} honoured`),d(s.code),g(''),m('')}})]}):null]}),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Create / sell a gift card"}),(0,V.jsx)(v.Row,{wrap:!0,gap:6,children:[10,25,50,100].map(e=>(0,V.jsx)(v.Chip,{label:`\xa3${e}`,selected:r===e,onPress:()=>a(e)},e))}),(0,V.jsx)(v.Field,{label:"Recipient",value:i,onChangeText:l}),(0,V.jsx)(v.Button,{label:`Record a \xa3${r} card paid at the till`,disabled:i.trim().length<2,onPress:()=>{const t=G().buyGiftCard(e,100*r,i.trim(),'Sold at the till');f(`Created ${t.code}`),l('')}}),(0,V.jsx)(v.Muted,{children:"Gift cards are sold through your website. Record one here only when it was paid at the till."})]}),(0,V.jsx)(I.SectionHead,{title:"All cards"}),s.map(e=>(0,V.jsxs)(v.Card,{onPress:()=>d(e.code),children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",style:{flex:1},children:e.recipientName}),e.legacy?(0,V.jsx)(v.Badge,{kind:"neutral",label:"Legacy website bookings"}):null]}),(0,V.jsxs)(v.Muted,{children:[e.code," \xb7 ",(0,R.gbp)(e.balance)," of ",(0,R.gbp)(e.initial)]})]},e.id))]})}function q({rid:e,now:t,me:s}){const n=(0,S.useOrders)(e).filter(e=>'table'===e.type),[r,i]=(0,x.useState)(null),l=(0,b.useTableUse)(e,t),o=(0,b.useTableNames)(e);return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Muted,{children:"Each table has its own QR code. Guests scan, order and pay (or split) from their phone. Dine-in cooking starts once the table is seated and has ordered."}),(0,V.jsx)(v.Button,{kind:"secondary",label:"Preview customer table ordering (5)",onPress:()=>j.router.push('/table/5'),testID:"preview-table-ordering"}),(0,V.jsx)(v.Row,{wrap:!0,gap:8,children:o.map(e=>{const t=n.filter(t=>t.tableNo===e&&(0,I.LIVE)(t)),s=t.reduce((e,t)=>e+t.total-t.paid,0);return(0,V.jsxs)(y.default,{accessibilityRole:"button",accessibilityLabel:`Table ${(0,a.tableNumbers)(e)}`,onPress:()=>i(e),style:{width:'31%',padding:10,borderRadius:12,borderWidth:1,borderColor:t.length?B.colours.gold:B.colours.border,backgroundColor:B.colours.surface,gap:2},children:[(0,V.jsx)(v.T,{weight:"bold",children:(0,a.tableNumbers)(e)}),(0,V.jsx)(v.T,{size:12,colour:l[e]?.busy?'#FFD9D4':'#E2C489',children:l[e]?.busy?l[e].label:'Free'}),(0,V.jsx)(v.Muted,{children:t.length?`${t.length} order${t.length>1?'s':''}`:'No orders'}),s?(0,V.jsxs)(v.T,{size:12,colour:B.colours.amber,children:[(0,R.gbp)(s)," to pay"]}):(0,V.jsx)(v.T,{size:12,colour:B.colours.muted,children:"View QR"})]},e)})}),(0,V.jsx)(I.SectionHead,{title:"Live table orders"}),n.filter(I.LIVE).map(e=>(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",children:[(0,a.tableNumbers)(e.tableNo)," \xb7 ",e.ref]}),(0,V.jsx)(v.Badge,{kind:(0,I.statusKind)(e.status),label:(0,I.statusLabel)(e)})]}),(0,V.jsxs)(v.Muted,{children:[e.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",(0,O.minsBetween)(new Date(e.createdAt),t)," min ago \xb7 ",(0,R.gbp)(e.paid)," of ",(0,R.gbp)(e.total)," paid",e.split?` \xb7 split ${e.split.paidShares}/${e.split.ways}`:'']})]},e.id)),n.filter(I.LIVE).length?null:(0,V.jsx)(v.Muted,{children:"No live table orders."}),r?(0,V.jsxs)(v.Sheet,{visible:!0,onClose:()=>i(null),title:`${(0,a.tableNumbers)(r)} QR code`,children:[(0,V.jsx)(w.default,{style:{alignItems:'center',backgroundColor:'#fff',padding:16,borderRadius:12},children:(0,V.jsx)(C.QR,{value:`https://covercharge.example/t/${e}/${r}`,size:200})}),(0,V.jsxs)(v.Muted,{center:!0,children:["Example link (table ordering links aren\u2019t live yet): covercharge.example/t/",e,"/",r]}),(0,V.jsx)(v.Banner,{kind:"demo",title:"Print later",children:"Printing table cards from here isn\u2019t set up yet. Nothing is printed or sent."}),(0,V.jsx)(v.Button,{label:`Preview customer table ordering (${(0,a.tableNumbers)(r)})`,onPress:()=>{const e=r;i(null),j.router.push(`/table/${e}`)}}),(0,V.jsx)(v.Button,{kind:"secondary",label:"Show the code again",onPress:()=>i(r)})]}):null]})}function K({go:e,onClose:t}){const{rid:s,today:n,role:r}=(0,N.useCtx)(1e4),a=(0,S.useOrders)(s),i=(0,S.useStore)(e=>e.bookings);(0,E.useBackLayer)(!0,t);const l=a.filter(I.LIVE),o=[...l.filter(e=>(0,D.chainNeedsAction)(e,i)).map(e=>{const t=(0,D.nextStep)(e,(0,D.linkedBooking)(e,i)),s=D.CHAIN_STEPS.find(e=>e.id===t);return{id:`o-${e.id}`,at:e.createdAt,title:`${e.ref} \xb7 ${'table'===e.type?`Table ${e.tableNo??''}`.trim():'Takeaway'}${e.customerName?` \xb7 ${e.customerName}`:''}`,when:`Ordered ${(0,O.hm)(new Date(e.createdAt))}`,allergies:e.allergies.map(e=>(0,U.allergenLabel)(e.allergen)).join(', '),next:s?`Next: ${s.n}. ${s.label} sign-off`:'Sign-off waiting',tab:'orders',open:'Open Orders to sign off'}}),...i.filter(e=>e.restaurantId===s&&e.date===n&&'cancelled'!==e.status&&(0,D.bookingNeedsAction)(e,l)).map(e=>({id:`b-${e.id}`,at:`${e.date}T${e.time}`,title:`${e.name} \xb7 ${e.partySize} at ${e.time}`,when:`Booking ${e.ref??''}`.trim(),allergies:e.allergies.map(e=>(0,U.allergenLabel)(e.allergen)).join(', '),next:'Next: 1. Booked sign-off',tab:'bookings',open:'Open Bookings to sign off'}))].sort((e,t)=>e.at.localeCompare(t.at));return(0,V.jsxs)(w.default,{testID:"pending-list",style:{gap:12,alignItems:'stretch'},children:[(0,V.jsx)(E.BackButton,{onPress:t,testID:"pending-back"}),(0,V.jsx)(v.T,{center:!0,size:22,weight:"bold",colour:B.colours.gold,accessibilityRole:"header",style:{alignSelf:'stretch'},children:"Awaiting verification"}),(0,V.jsx)(v.Muted,{center:!0,testID:"pending-status",children:o.length?`${o.length} allergy ${1===o.length?'sign-off':'sign-offs'} waiting, oldest first.`:'Nothing is waiting for an allergy sign-off.'}),o.map(t=>(0,V.jsxs)(v.Card,{highlight:B.colours.red,style:{alignItems:'center',gap:8},children:[(0,V.jsxs)(w.default,{testID:`pending-row-${t.id}`,accessible:!0,accessibilityLabel:`${t.title}, ${t.when}, allergies: ${t.allergies}. ${t.next}.`,style:{alignItems:'center',gap:4,width:'100%'},children:[(0,V.jsx)(v.T,{center:!0,weight:"bold",size:18,children:t.title}),(0,V.jsx)(v.T,{center:!0,children:t.when}),(0,V.jsxs)(v.Muted,{center:!0,children:["Allergies: ",t.allergies]}),(0,V.jsx)(v.T,{center:!0,colour:B.colours.gold,children:t.next})]}),(0,V.jsx)(v.Button,{small:!0,label:t.open,onPress:()=>e(t.tab),style:{alignSelf:'stretch'}})]},t.id)),'owner'===r||'manager'===r?(0,V.jsx)(v.Button,{small:!0,kind:"secondary",label:"Allergen sign-off log",onPress:()=>e('more','allergen-signoffs')}):null]})}function X(){const e=(0,T.useOwner)(e=>e.merch),t=(0,T.useOwner)(e=>e.merchOrders),[s,n]=(0,x.useState)(''),[r,a]=(0,x.useState)(''),i=(t,s)=>T.useOwner.getState().setOwner({merch:e.map(e=>e.id===t?{...e,...s}:e)});return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(v.Banner,{kind:"demo",title:"Optional add-on",children:"Sell branded items in the customer app for collection. Example only on this device; nothing is charged."}),(0,V.jsx)(I.SectionHead,{title:"Products & stock"}),e.map(e=>(0,V.jsxs)(w.default,{style:v.styles.card,children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(v.T,{weight:"semibold",style:{flex:1},children:e.name}),(0,V.jsx)(v.T,{children:(0,R.gbp)(e.price)})]}),(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsx)(w.default,{style:{flex:1,minWidth:0},children:(0,V.jsx)(v.Toggle,{label:e.live?'In shop':'Hidden',a11y:`${e.name} live`,value:e.live,onChange:t=>i(e.id,{live:t})})}),(0,V.jsx)(v.Stepper,{value:e.stock,min:0,max:500,onChange:t=>i(e.id,{stock:t}),label:`${e.name} stock`})]}),0===e.stock?(0,V.jsx)(v.T,{size:13,colour:B.colours.red,children:"Out of stock"}):e.stock<8?(0,V.jsx)(v.T,{size:13,colour:B.colours.amber,children:"Low stock"}):null]},e.id)),(0,V.jsxs)(v.Card,{children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Add a product"}),(0,V.jsx)(v.Field,{label:"Name",value:s,onChangeText:n}),(0,V.jsx)(v.Field,{label:"Price \xa3",value:r,onChangeText:a,keyboardType:"decimal-pad"}),(0,V.jsx)(v.Button,{small:!0,label:"Add product",disabled:s.trim().length<2||!(Number(r)>0),onPress:()=>{T.useOwner.getState().setOwner({merch:[...e,{id:`mc-${Date.now()}`,name:s.trim(),price:Math.round(100*Number(r)),stock:10,live:!0}]}),n(''),a('')}})]}),(0,V.jsx)(I.SectionHead,{title:"Shop orders"}),t.map(s=>{const n=e.find(e=>e.id===s.productId);return(0,V.jsxs)(v.Card,{children:[(0,V.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,V.jsxs)(v.T,{weight:"semibold",style:{flex:1},children:[s.qty,"\xd7 ",n?.name," \xb7 ",s.customer]}),(0,V.jsx)(v.Badge,{kind:'new'===s.status?'amber':'ready'===s.status?'blue':'ok',label:s.status})]}),(0,V.jsxs)(v.Muted,{children:[s.at," \xb7 ",(0,R.gbp)((n?.price??0)*s.qty)]}),'collected'!==s.status?(0,V.jsx)(v.Button,{small:!0,label:'new'===s.status?'Mark ready':'Mark collected',onPress:()=>T.useOwner.getState().setOwner({merchOrders:t.map(e=>e.id===s.id?{...e,status:'new'===s.status?'ready':'collected'}:e)})}):null]},s.id)})]})}const Y=[{n:1,title:'Loyalty stamp card',links:[['Stamp card','loyalty']],note:'Settings, members, add/redeem, stats. One card across dine-in & takeaway.'},{n:2,title:'Bring-a-friend referrals',links:[['Referrals','referrals']],note:'Rewards, referral list and stats.'},{n:3,title:'Gift cards & vouchers',links:[['Gift cards','giftcards']],note:'Sold through your website. Check a balance, take it off the bill, honour website bookings cards.'},{n:4,title:'QR order & pay at table',links:[['Tables & QR codes','tables']],note:'Table list, QR per table, live table orders.'},{n:5,title:'Direct takeaway ordering',links:[['Takeaway settings','takeaway'],['Orders','tab:orders']],note:'Slots, capacity, live queue, readiness alerts (takeaway only).'},{n:6,title:'Table bookings, no-shows & waitlist',links:[['Bookings','tab:bookings'],['Booking settings','bookingsettings']],note:'Deposits (Deposit due / paid, set in Settings \u203a Advanced), no-show marking, reminders, online waitlist.'},{n:7,title:'Allergy verification',links:[['Allergy hub','allergy'],['Menu & allergens','menu']],note:'14 UK allergens per dish, kitchen alerts, named verification, audit log.'},{n:8,title:'Push offers & specials (opt-in)',links:[['Marketing','marketing'],['Specials & offers','offers']],note:'Saved campaign drafts. Delivery is not connected.'},{n:9,title:'Calendar & marketing hooks',links:[['Forecast calendar','tab:forecast'],['Events','events']],note:'Scottish bank holidays, school holidays, local & own events, promo hooks.'},{n:10,title:'Private feedback',links:[['Feedback inbox','feedback'],['Reviews','reviews']],note:'Low-rating alerts. No review gating.'},{n:11,title:'Lost property & coat check',links:[['Lost property','lost']],note:'Found items and coat-check tickets.'},{n:12,title:'Merch shop (optional)',links:[['Merch shop','merch']],note:'Products, stock and orders.'},{n:14,title:'Staff group chat',links:[['Chat','tab:chat']],note:'Channels, DMs, photos, reactions, read receipts, pins, auto-posts, cover requests. Local only.'},{n:16,title:'Suppliers',links:[['Suppliers','suppliers'],['Prep & stock list','prep']],note:'Contacts, categories, favourites, cut-offs and delivery days, tap to call/email/website, orders due today, order log, staff permission.'},{n:17,title:'Hours & pay',links:[['My hours & pay','mypay'],['Payroll & pay rates','payroll'],['Timesheets','timesheets']],note:'Staff see their own hours and gross pay (before tax, estimate) plus tips; owner sets hourly rates and sees the team payroll summary.'},{n:15,title:'Tip splitter',links:[['Tips','tips'],['My tips','mytips']],note:'Pay periods, card + cash pot, 4 split methods, approve & lock, compliance checklist.'},{n:18,title:'Post to social',links:[['Post to social','social'],['Connected accounts','socialaccounts'],['Marketing','marketing']],note:'Social publishing is not connected. No accounts are linked and nothing is posted.'},{n:20,title:'Head Chef app',links:[['Menu & allergens','menu'],['Suppliers','suppliers']],note:'CoverCharge for Head Chef: stock with par levels and alerts, stock take, deliveries checked against the order, recipe cards with dish cost, GP % and cash GP against a target, price-change impact, theoretical vs actual GP, menu engineering, waste log, ordering from par and forecast, prep lists, 14-allergen matrix with sign-off, temperatures, cleaning and daily checks, kitchen rota, chat, live tickets and a Sold out list (a reminder for staff, shown on the Display). Uses this menu and these suppliers.'},{n:21,title:'Branding',links:[['Branding','branding']],note:'Your logo and accent colour lead all five apps, with a small "powered by CoverCharge". Pick any colour with the colour picker or a hex code; text on it stays readable.'},{n:19,title:'Quick links',links:[['Quick links','quicklinks'],['Dashboard','tab:home']],note:'One-tap Work email (Gmail) and Website bookings view/edit for owners and managers, plus up to 6 of your own links. Staff never see the website bookings links; per-link staff visibility for the rest (off by default). Head Chef: no quick links or email at all. Opens the app or site only.'},{n:13,title:'Forecasting, dashboard & running the business',links:[['Forecast','tab:forecast'],['Dashboard','tab:home'],['Tablet preview','tablet'],['Rota','rota'],['Clock in/out','clock'],['Timesheets','timesheets'],['Analytics','analytics'],['CRM','crm'],['Plan & billing','plan']],note:'Headline forecast, rotas, geofenced clock in/out with break prompt, analytics, CRM'+f.PLAN_FEATURE_NOTE+'.'}];const J=async e=>{try{return'undefined'!=typeof localStorage&&'1'===localStorage.getItem(e)}catch{return!1}},Z=async e=>{try{'undefined'!=typeof localStorage&&localStorage.setItem(e,'1')}catch{}};function ee({kind:e}){const{r:t}=(0,N.useCtx)(6e4),s=(0,T.useOwner)(e=>e.offers);(0,x.useEffect)(()=>{(0,h.migrateLocalOnce)({offers:s},J,Z).catch(()=>{})},[]);const n=(0,u.can)('venue.settings');return(0,V.jsxs)(w.default,{style:{gap:10},children:[(0,V.jsx)(m.LoyaltySummaryCard,{kind:e}),(0,V.jsx)(g.StaffLoyalty,{venue:t.name,canRemove:n,onOpenSettings:n?()=>{l.advancedPrefill.q='loyalty',o.useVoiceNav.getState().go?.('more','advanced')}:void 0}),n?(0,V.jsx)(v.Card,{children:(0,V.jsxs)(w.default,{style:{gap:8},children:[(0,V.jsx)(v.T,{weight:"semibold",children:"Card, offers and bring-a-friend settings"}),(0,V.jsx)(m.LoyaltySettingsPanel,{})]})}):null]})}},1450,[5,1366,827,837,860,1451,1388,1422,1193,14,1227,988,1452,1454,1389,34,1113,1430,30,402,102,879,1247,794,874,892,867,881,1117,858,821,1165,1079,1133,884,1403,869,1048,1149,863,861,25]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffTableOrders=function({rid:e,me:l}){const p=(0,c.useOrderAtTable)(e),x=(0,c.useNow)(15e3),f=(0,c.useStore)(e=>e.bookings),w=(0,c.useOrders)(e).filter(i.isTableQr).sort((e,t)=>t.createdAt.localeCompare(e.createdAt)),S=w.filter(i.waitingForStaff),y=w.filter(e=>m(e)&&!(0,i.waitingForStaff)(e)),v=w.filter(e=>!m(e)).slice(0,8),[k,T]=(0,s.useState)(null),[$,B]=(0,s.useState)(null),M=e=>{c.repo.orders.accept(e.id,l),B(`${e.ref} accepted for table ${(0,t.tableNumbers)(e.tableNo)}: it's gone to the kitchen.`)},N=e=>{const t=(0,h.statusBlock)(e,'served',(0,h.linkedBooking)(e,f));if(t)return void B(`${e.ref}: ${t}`);const s=(new Date).toISOString();c.useStore.setState(t=>({orders:t.orders.map(t=>t.id===e.id?{...t,servedBy:{by:l,at:s}}:t)})),c.useStore.getState().setOrderStatus(e.id,'served',l),B(`${e.ref} marked served.`)},O=(e,t)=>{const s=(new Date).toISOString();c.useStore.setState(r=>({orders:r.orders.map(r=>r.id===e.id?{...r,cancelReason:t,cancelledBy:{by:l,at:s}}:r)})),c.useStore.getState().setOrderStatus(e.id,'cancelled',l),T(null),B(`${e.ref} cancelled (${t}). The guest's phone shows the reason.`)},A=({o:e,held:s})=>(0,b.jsxs)(a.Card,{highlight:s?u.colours.amber:e.allergies.length?u.colours.red:u.colours.gold,children:[(0,b.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,b.jsxs)(a.T,{weight:"semibold",children:["Table ",(0,t.tableNumbers)(e.tableNo)," \xb7 ",e.ref]}),(0,b.jsx)(a.Badge,{kind:s?'amber':'cancelled'===e.status?'neutral':'gold',label:s?'Waiting for you':'served'===e.status?'Served':'cancelled'===e.status?'Cancelled':'In the kitchen'})]}),(0,b.jsxs)(a.Muted,{children:[e.customerName," \xb7 ",j(e.createdAt,x),e.accepted?` \xb7 accepted by ${e.accepted.by}`:'']}),e.lines.map((e,t)=>(0,b.jsxs)(a.T,{children:[e.qty,"\xd7 ",e.name,e.notes?` (note: ${e.notes})`:'']},t)),e.allergies.length?(0,b.jsx)(a.Row,{wrap:!0,gap:6,children:e.allergies.map(e=>(0,b.jsx)(a.Badge,{kind:"red",label:`${(0,n.allergenLabel)(e.allergen)}: ${(0,n.severityLabel)(e.severity)}`},e.allergen))}):(0,b.jsx)(a.Muted,{children:"No allergies declared."}),e.notes?(0,b.jsxs)(a.T,{size:13,children:["Note: ",e.notes]}):null,(0,b.jsxs)(a.T,{size:13,colour:u.colours.muted,children:[(0,o.gbp)(e.total)," to pay at the bar or with the server"]}),'cancelled'===e.status&&e.cancelReason?(0,b.jsxs)(a.Muted,{children:["Reason: ",e.cancelReason]}):null,m(e)?k===e.id?(0,b.jsxs)(r.default,{style:{gap:6},children:[(0,b.jsx)(a.T,{size:13,children:"Why are you cancelling? The guest sees this."}),(0,b.jsx)(a.Row,{wrap:!0,gap:6,children:i.CANCEL_REASONS.map(t=>(0,b.jsx)(a.Chip,{label:t,onPress:()=>O(e,t)},t))}),(0,b.jsx)(a.Button,{small:!0,kind:"ghost",label:"Don't cancel",onPress:()=>T(null)})]}):(0,b.jsxs)(a.Row,{gap:8,wrap:!0,children:[s?(0,b.jsx)(a.Button,{small:!0,label:"Accept",testID:`accept-${e.ref}`,onPress:()=>M(e)}):(0,b.jsx)(a.Button,{small:!0,label:"Mark served",testID:`served-${e.ref}`,onPress:()=>N(e)}),(0,b.jsx)(a.Button,{small:!0,kind:"secondary",label:"Cancel with a reason",onPress:()=>T(e.id)})]}):null]});return(0,b.jsxs)(r.default,{style:{gap:10},children:[(0,b.jsx)(a.Muted,{children:"Tip: orders from guests' phones land here within seconds. Accept the first one from a new phone, check allergies, then mark it served. Guests pay at the bar or with their server."}),p?null:(0,b.jsx)(a.Banner,{kind:"demo",title:"Order at the table is off",children:"Managers can switch it on in Settings \u203a Advanced \u203a Order at the table."}),$?(0,b.jsx)(a.Banner,{kind:"success",children:$}):null,(0,b.jsxs)(a.T,{weight:"semibold",children:["Waiting for you to accept (",S.length,")"]}),S.length?S.map(e=>(0,b.jsx)(A,{o:e,held:!0},e.id)):(0,b.jsx)(a.Muted,{children:"Nothing waiting."}),(0,b.jsxs)(a.T,{weight:"semibold",children:["In the kitchen (",y.length,")"]}),y.length?y.map(e=>(0,b.jsx)(A,{o:e,held:!1},e.id)):(0,b.jsx)(a.Muted,{children:"No table orders being made."}),v.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a.T,{weight:"semibold",children:"Served or cancelled"}),v.map(e=>(0,b.jsx)(A,{o:e,held:!1},e.id))]}):null]})};var e,t=_r(d[0]),s=_r(d[1]),l=_r(d[2]),r=(e=l)&&e.__esModule?e:{default:e},a=_r(d[3]),n=_r(d[4]),o=_r(d[5]),i=_r(d[6]),c=_r(d[7]),h=_r(d[8]),u=_r(d[9]),b=_r(d[10]);const j=(e,t)=>{const s=Math.max(0,Math.round((t.getTime()-new Date(e).getTime())/6e4));return s<1?'just now':`${s} min ago`},m=e=>!['served','collected','closed','cancelled'].includes(e.status)},1451,[860,34,102,794,861,867,1148,874,869,821,25]); __d(function(g,_r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.customerCodeLink=y,_e.StaffLoyalty=function({venue:e,canRemove:r=!1,onOpenSettings:u}){const[p,x]=(0,t.useState)(null),[y,b]=(0,t.useState)(''),[S,k]=(0,t.useState)(null),[v,C]=(0,t.useState)(null),[M,T]=(0,t.useState)(!1),[B,R]=(0,t.useState)(''),[P,O]=(0,t.useState)(null),$=(0,c.staffServer)(),L=(0,n.can)('venue.settings'),[N,E]=(0,t.useState)(!1),[D,A]=(0,t.useState)(''),F=async e=>{if(p){E(!0),A('');try{await(0,c.saveSettings)({...p,cardOn:e}),x({...p,cardOn:e,saved:!0});const n=e?'Stamp card switched on':'Stamp card switched off';A(n),s.default.announceForAccessibility?.(n)}catch(e){R((0,o.plainError)(e))}E(!1)}},I=(0,t.useCallback)(()=>{$&&(0,c.readSettings)().then(x).catch(()=>{})},[$]);(0,t.useEffect)(()=>(I(),(0,c.watchLoyalty)(()=>{I(),C(e=>(e&&(0,c.staffCard)(e.id).then(C).catch(()=>{}),e))})),[I]);const _=async(e=y)=>{R('');try{const n=await(0,c.staffFind)(e);k(n),1===n.length&&C(n[0])}catch(e){R((0,o.plainError)(e))}},z=(0,t.useCallback)(e=>{T(!1),b((0,o.prettyCardNo)(e)),_(e)},[]);return $?(0,m.jsxs)(l.default,{style:{gap:10},children:[!p||p.cardOn||L?null:(0,m.jsx)(i.Banner,{kind:"info",title:"The stamp card is off",children:"Ask a manager to switch it on."}),p&&L?(0,m.jsx)(i.Card,{children:(0,m.jsxs)(l.default,{style:{gap:8},testID:"loy-quick",children:[p.cardOn?null:(0,m.jsx)(i.T,{weight:"semibold",children:"The stamp card is off"}),(0,m.jsx)(i.Toggle,{testID:"loy-quick-on",label:"Stamp card on",a11y:"Stamp card on. "+(p.cardOn?'On':'Off'),value:p.cardOn,disabled:N,onChange:e=>{F(e)}}),D?(0,m.jsx)(l.default,{accessibilityLiveRegion:"polite",children:(0,m.jsx)(i.Muted,{children:D})}):null,u?(0,m.jsx)(i.Button,{kind:"ghost",label:"Change the stamp card",testID:"loy-open-settings",onPress:u}):null]})}):null,p&&p.saved?(0,m.jsxs)(i.Muted,{children:[p.stampsNeeded," stamps = ",p.reward||'reward not set',". At most ",p.maxPerDay," a day",p.gapMinutes?`, ${p.gapMinutes} minutes apart`:'',"."]}):null,p&&!p.saved&&L?(0,m.jsxs)(i.Muted,{children:["Suggested settings, not saved yet: ",p.stampsNeeded," stamps = ",p.reward||'reward not set',". At most ",p.maxPerDay," a day",p.gapMinutes?`, ${p.gapMinutes} minutes apart`:'',"."]}):null,(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Find a guest"}),(0,m.jsx)(i.Field,{label:"Name, phone, email or card number",value:y,onChangeText:b,onSubmitEditing:()=>_(),autoCapitalize:"none",testID:"loyalty-search"}),(0,m.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(i.Button,{small:!0,label:"Find",disabled:y.trim().length<2,onPress:()=>_(),testID:"loyalty-find"}),(0,h.canScan)()?(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:M?'Scanning\u2026':'Scan their card',onPress:()=>T(!0)}):null]}),M?(0,m.jsx)(h.CardScanner,{onCard:z,onClose:()=>T(!1)}):null,B?(0,m.jsx)(i.Banner,{kind:"warn",children:B}):null,S&&!S.length?(0,m.jsx)(i.Muted,{children:"No one found. Check the spelling, or sign them up below."}):null,S&&S.length>1?S.map(e=>(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{children:e.name}),(0,m.jsxs)(i.Muted,{children:[(0,o.prettyCardNo)(e.cardNo)," \xb7 ",e.stamps," of ",e.needed,e.phone?` \xb7 ${e.phone}`:'']})]}),e.rewards.length?(0,m.jsx)(i.Badge,{kind:"gold",label:`${e.rewards.length} ready`}):null,(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Open",onPress:()=>C(e)})]},e.id)):null]}),v?(0,m.jsx)(f,{card:v,settings:p,canRemove:r,onChange:e=>{C(e),k(null)},onClose:()=>C(null)}):null,(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Stamp code"}),(0,m.jsx)(i.Muted,{children:"Busy? Make a one-time code and show it to the guest; they type it (or scan it) on their own phone for one stamp."}),P?(0,m.jsx)(j,{c:P,what:"One stamp."}):null,(0,m.jsx)(i.Button,{kind:"secondary",label:P?'Make another code':'Make a stamp code',disabled:!1===p?.cardOn,onPress:()=>{R(''),(0,c.staffCode)('stamp').then(O).catch(e=>R((0,o.plainError)(e)))}})]}),(0,m.jsx)(w,{venue:e,onJoined:e=>{C(e),k(null)}}),(0,m.jsx)(i.Muted,{children:"Tip: search by the last 4 digits of a phone number. Each reward can only be used once, and the card shows who used it and when."})]}):(0,m.jsxs)(l.default,{style:{gap:10},children:[(0,m.jsx)(i.Banner,{kind:"info",title:"Connect to your venue first",children:"The stamp card is saved on your venue's account. Open your invite link on this phone to connect, then you can find guests and add stamps here."}),(0,m.jsx)(i.Muted,{children:"Tip: stamps can only be added by staff of the venue, so a guest can't stamp their own card."})]})};var n=_r(d[0]),t=_r(d[1]),s=e(_r(d[2]));_r(d[3]);var l=e(_r(d[4])),r=_r(d[5]),i=_r(d[6]),o=_r(d[7]),c=_r(d[8]),u=_r(d[9]),h=_r(d[10]),m=_r(d[11]);const p=e=>{try{return new Date(e).toLocaleString('en-GB',{day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})}catch{return e}},x=e=>{try{return new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})}catch{return''}};function y(e){if('undefined'==typeof window||!window.location)return e;const n=window.location.pathname.match(/^(.*?)\/(owner|staff|customer|display|chef)-app(\/|$)/);return new URL(`${n?n[1]:''}/customer-app/index.html?loyalty=${e}`,window.location.origin).toString()}function j({c:e,what:n}){return(0,m.jsxs)(l.default,{style:{gap:4,alignItems:'center'},children:[(0,m.jsx)(i.T,{size:34,weight:"bold",colour:u.colours.gold,center:!0,children:e.code}),(0,m.jsx)(r.QR,{value:y(e.code),size:150}),(0,m.jsxs)(i.Muted,{center:!0,children:[n," Works once, until ",x(e.expiresAt),". The guest types it in Stamp card, or scans this with their phone camera."]})]})}function f({card:e,settings:n,canRemove:s,onChange:r,onClose:h}){const[x,y]=(0,t.useState)(null),[f,w]=(0,t.useState)(!1),[b,S]=(0,t.useState)(null),[k,v]=(0,t.useState)(null),C=async e=>{w(!0),y(null);try{await e()}catch(e){y({kind:'warn',text:(0,o.plainError)(e)})}finally{w(!1),S(null)}};return(0,m.jsxs)(i.Card,{highlight:u.colours.gold,children:[(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.H2,{children:e.name}),(0,m.jsxs)(i.Muted,{children:["Card ",(0,o.prettyCardNo)(e.cardNo),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']})]}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Close",onPress:h})]}),(0,m.jsxs)(i.T,{size:20,weight:"semibold",children:[e.stamps," of ",e.needed," stamps"]}),(0,m.jsxs)(i.Muted,{children:["Next reward: ",e.reward]}),x?(0,m.jsx)(i.Banner,{kind:x.kind,children:x.text}):null,(0,m.jsx)(i.Button,{label:f?'Saving\u2026':'Add a stamp',disabled:f||!1===n?.cardOn,testID:"loyalty-add-stamp",onPress:()=>C(async()=>{const n=await(0,c.staffStamp)(e.id);r(n),y({kind:'success',text:n.newReward?`Stamp added. ${e.name} has earned: ${n.rewards[n.rewards.length-1]?.title??'a reward'}.`:`Stamp added: ${n.stamps} of ${n.needed}.`})})}),!1===n?.cardOn?(0,m.jsx)(i.Muted,{children:"The stamp card is switched off in Settings \u203a Advanced \u203a Loyalty, so no stamps can be added."}):null,e.rewards.length?(0,m.jsx)(i.T,{weight:"semibold",children:"Rewards ready"}):(0,m.jsx)(i.Muted,{children:"No rewards ready yet."}),e.rewards.map(e=>(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{children:e.title}),e.expiresAt?(0,m.jsxs)(i.Muted,{children:["Use by ",p(e.expiresAt)]}):null]}),b===e.id?(0,m.jsxs)(i.Row,{gap:6,children:[(0,m.jsx)(i.Button,{small:!0,label:"Yes, used now",disabled:f,onPress:()=>C(async()=>{const n=await(0,c.staffRedeem)(e.id);r(n),y({kind:'success',text:`${n.redeemed} marked used.`})})}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Not yet",onPress:()=>S(null)})]}):(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Use reward",onPress:()=>S(e.id)})]},e.id)),(0,m.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Sign-in code for their phone",onPress:()=>C(async()=>v(await(0,c.staffCode)('link',e.id)))}),s?'remove'===b?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(i.Button,{small:!0,kind:"danger",label:"Yes, remove their details",onPress:()=>C(async()=>{await(0,c.staffRemove)(e.id),r(null),h()})}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Keep",onPress:()=>S(null)})]}):(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Remove guest",onPress:()=>S('remove')}):null]}),k?(0,m.jsx)(j,{c:k,what:`Opens ${e.name}'s card on their phone.`}):null,'remove'===b?(0,m.jsx)(i.Muted,{children:"Removing wipes their name, phone and email and closes the card (for example if they ask you to delete their data). Counts in the summary stay."}):null,(0,m.jsx)(i.T,{weight:"semibold",children:"Recent"}),e.history.length?e.history.slice(0,8).map((e,n)=>(0,m.jsxs)(i.Muted,{children:[p(e.at)," \xb7 ",e.what]},n)):(0,m.jsx)(i.Muted,{children:"Nothing yet."})]})}function w({venue:e,onJoined:n}){const[s,l]=(0,t.useState)(''),[r,u]=(0,t.useState)(''),[h,p]=(0,t.useState)(''),[x,y]=(0,t.useState)(!1),[j,f]=(0,t.useState)(!1),[w,b]=(0,t.useState)('');return(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Sign a guest up"}),(0,m.jsx)(i.Muted,{children:"Only a name is needed. Read the agreement to the guest and tick it only if they say yes."}),(0,m.jsx)(i.Field,{label:"Guest's name",value:s,onChangeText:l,maxLength:60}),(0,m.jsx)(i.Field,{label:"Phone (optional)",value:r,onChangeText:u,keyboardType:"phone-pad",maxLength:20}),(0,m.jsx)(i.Field,{label:"Email (optional)",value:h,onChangeText:p,keyboardType:"email-address",autoCapitalize:"none",maxLength:120}),(0,m.jsx)(i.Toggle,{label:`The guest agrees: \u201c${(0,o.consentText)(e)}\u201d`,value:x,onChange:y}),w?(0,m.jsx)(i.Banner,{kind:"warn",children:w}):null,(0,m.jsx)(i.Button,{label:j?'Saving\u2026':'Sign up',disabled:j||!x||!s.trim(),onPress:async()=>{f(!0),b('');try{n(await(0,c.staffJoin)({name:s,phone:r,email:h,consent:x,consentText:(0,o.consentText)(e)})),l(''),u(''),p(''),y(!1)}catch(e){b((0,o.plainError)(e))}finally{f(!1)}}})]})}},1452,[988,34,281,236,102,1247,794,1224,1227,821,1453,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"canScan",{enumerable:!0,get:function(){return l}}),_e.CardScanner=function({onCard:t,onClose:n}){const f=(0,e.useRef)(null),[h,w]=(0,e.useState)('');return(0,e.useEffect)(()=>{if(!l())return void w('This browser can\u2019t scan. Type the card number or search by name instead.');let e=!1,n=null,c=null;const o=document.createElement('video');return o.setAttribute('playsinline','true'),o.muted=!0,Object.assign(o.style,{width:'100%',maxWidth:'360px',borderRadius:'12px',border:'2px solid #CFA45F'}),(async()=>{try{if(n=await navigator.mediaDevices.getUserMedia({video:{facingMode:'environment'}}),e)return void n.getTracks().forEach(e=>e.stop());o.srcObject=n,await o.play();const u=f.current;u?.appendChild(o);const l=new(0,window.BarcodeDetector)({formats:['qr_code']}),h=async()=>{if(!e){try{const e=await l.detect(o);for(const n of e){const e=(0,s.readCardQr)(String(n.rawValue??''));if(e)return void t(e)}}catch{}c=setTimeout(h,300)}};h()}catch{w('The camera didn\u2019t start. Allow the camera, or type the card number instead.')}})(),()=>{e=!0,c&&clearTimeout(c),n?.getTracks().forEach(e=>e.stop()),o.remove()}},[t]),(0,u.jsxs)(c.default,{style:{gap:8,alignItems:'center'},children:[(0,u.jsx)(c.default,{ref:f,style:{width:'100%',alignItems:'center'}}),h?(0,u.jsx)(o.Banner,{kind:"warn",children:h}):(0,u.jsx)(o.Muted,{center:!0,children:"Point the camera at the QR on the guest\u2019s card screen."}),(0,u.jsx)(o.Button,{kind:"ghost",label:"Close camera",onPress:n})]})};var e=r(d[0]);r(d[1]);var t,n=r(d[2]),c=(t=n)&&t.__esModule?t:{default:t},o=r(d[3]),s=r(d[4]),u=r(d[5]);const l=()=>'undefined'!=typeof window&&'BarcodeDetector'in window&&!!navigator?.mediaDevices?.getUserMedia},1453,[34,236,102,794,1224,25]); @@ -1583,7 +1583,7 @@ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule', __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useCarViewport=function(){(0,t.useEffect)(()=>{if(!o)return;const t=document.documentElement,n=document.body,s=[t.style.cssText,n.style.cssText];for(const o of[t.style,n.style])o.height='100%',o.margin='0',o.overflow='hidden',o.overscrollBehavior='none',o.touchAction='manipulation';return()=>{t.style.cssText=s[0],n.style.cssText=s[1]}},[])};var t=r(d[0]);r(d[1]);const o='undefined'!=typeof document},1500,[34,236]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),f=r(d[3]),u=r(d[4]);function c(){return(0,n.canShow)('staff')?(0,u.jsx)(f.StaffApp,{}):(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1501,[30,34,872,1502,25]); __d(function(g,_r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffApp=function(){return(0,ye.jsx)(q.StaffAppCtx.Provider,{value:!0,children:(0,ye.jsx)(Se,{})})};var s=_r(d[0]),t=_r(d[1]),o=_r(d[2]),r=_r(d[3]),i=_r(d[4]),l=_r(d[5]),n=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),f=_r(d[10]),p=_r(d[11]),b=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),w=_r(d[17]),v=_r(d[18]),S=_r(d[19]),C=_r(d[20]),T=_r(d[21]),M=_r(d[22]),R=_r(d[23]),B=_r(d[24]),A=_r(d[25]),I=_r(d[26]),P=e(_r(d[27])),O=e(_r(d[28])),L=e(_r(d[29])),W=e(_r(d[30])),z=e(_r(d[31])),E=_r(d[32]),H=_r(d[33]),_=_r(d[34]),D=_r(d[35]),N=_r(d[36]),F=_r(d[37]),U=_r(d[38]),V=_r(d[39]),$=_r(d[40]),G=_r(d[41]),Y=_r(d[42]),Q=_r(d[43]),J=_r(d[44]),K=_r(d[45]),q=_r(d[46]),X=_r(d[47]),Z=_r(d[48]),ee=_r(d[49]),se=_r(d[50]),te=_r(d[51]),ae=_r(d[52]);_r(d[53]);var oe=_r(d[54]),re=_r(d[55]),ie=_r(d[56]),le=_r(d[57]),ne=_r(d[58]),de=_r(d[59]),ce=_r(d[60]),ue=_r(d[61]),he=_r(d[62]),fe=_r(d[63]),pe=_r(d[64]),ge=_r(d[65]),me=_r(d[66]),be=_r(d[67]),ye=_r(d[68]);const xe=he.ROSTER.find(e=>'chef'===e.app)?.id,ke=[{id:'home',label:'Home',icon:'home'},{id:'clock',label:'Clock',icon:'clock'},{id:'rota',label:'Rota',icon:'bookings'},{id:'chat',label:'Chat',icon:'chat'},{id:'me',label:'Me',icon:'user'}],je={home:'Today',clock:'Clock in / out',rota:'Rota, swaps & leave',chat:'Staff chat',me:'Me'},we=[{id:'mytips',title:'Tips',sub:'The venue tip pot and today\u2019s tips'},{id:'reviews',title:'Reviews',sub:'Published reviews, newest first'},{id:'bookings',title:'Bookings',sub:'Any day, back or forward: tables, Covers, Unseat and Undo'},{id:'loyalty',title:'Stamp card',sub:'Find a guest, add a stamp or use a reward'},{id:'guests',title:'Guest profiles',sub:'Look a guest up: visits, Covers, allergies they told us, preferences'},{id:'giftcards',title:'Gift cards',sub:'Check a balance, take it off the bill, mark paid at the till'},{id:'tableorders',title:'Table orders',sub:'Orders from guests\u2019 phones at the table: accept, mark served or cancel'},{id:'soldout',title:'Sold out',sub:'What\u2019s run out today. Mark sold out or Back on; shows on the Display'},{id:'board',title:'Question board',sub:'Ask the team anything anonymously, and vote'},{id:'recipecards',title:'Recipe cards',sub:'Signed-off dishes: photo, ingredients, method and allergens (read-only)'},{id:'avatar',title:'My avatar',sub:'Your space-age avatar, or create one from a photo'},{id:'cashup',title:'Cash up',sub:'End-of-night takings: take a picture of the taking sheet or upload a spreadsheet (if a manager has switched it on for you)'},{id:'haccp',title:'Food safety checks',sub:'Record fridge, freezer, cooking and other checks (say or type)'},{id:'accidents',title:'Accident book',sub:'Report an accident or near miss; see your own entries'},{id:'mypay',title:'My hours & pay',sub:'Shifts, paid hours and estimated pay'},{id:'timesheets',title:'My timesheets',sub:'Your clock-ins, breaks and any changes'},{id:'orderlists',title:'Order lists',sub:'Add what\u2019s running low (Alsons drinks, Cash and carry)'},{id:'phone',title:'Turn on alerts',sub:'Get your reminders on this phone, even with the app closed'},{id:'suppliers',title:'Suppliers',sub:'Contacts and order days (if your manager allows)'},{id:'privacy',title:'Privacy & location',sub:'What CoverCharge for Staff stores about you'}],ve=[{id:'mgr-plan',title:'Tables & areas',sub:'Edit the table plan, areas, seats and joined tables'},{id:'mgr-times',title:'Booking times',sub:'Kitchen hours, table times and Covers per booking slot'},{id:'mgr-bookings',title:'Bookings (manager)',sub:'New, edit and cancel bookings, walk-ins, seat, move and finish tables, deposit status'},{id:'mgr-clear',title:'Tables to clear',sub:'Tables waiting to be cleared; mark them cleared'},{id:'mgr-blocks',title:'Block bookings',sub:'Block now, add a block, close the garden'},{id:'mgr-allergy',title:'Allergy checks',sub:'Every allergy order\u2019s sign-offs and the allergen log'},{id:'mgr-stock',title:'Tracked stock',sub:'What\u2019s counted live through service; add or change items'},{id:'mgr-clock',title:'Who\u2019s clocked in',sub:'Today\u2019s clock-ins for the team (read only)'},{id:'mgr-swaps',title:'Shift swaps',sub:'Approve swaps and cover, or give a shift to someone else'}];function Se(){const{r:e,rid:i,me:n,meId:S,today:C,now:T}=(0,q.useCtx)(3e4);(0,A.useReviewAlerts)(i),(0,de.useStaffTipsNotice)(i,C);const ce=(0,q.useSignedIn)(),ue=ce?.ownerAccess&&'owner'!==ce.role?'owner privileges':ce?.managerAccess&&'staff'===ce.role?'manager privileges':'',he=(0,q.useShiftManager)(),Se=(0,be.useSync)(e=>e.perms),Me=ve.filter(e=>'mgr-swaps'===e.id?Se.includes('rota.swap'):'mgr-times'!==e.id||(Se.includes('bookings.settings')||Se.includes('*')));(0,y.useSoldOutLink)(!0,n);(0,N.useOwner)(e=>e.staff);const Re=(0,N.useOwner)(e=>e.staffCanViewSuppliers),[Be,Ae]=(0,M.useState)('home'),[Ie,Pe]=(0,M.useState)(null),[Oe,Le]=(0,M.useState)(!1),We=(0,M.useRef)(null);(0,M.useEffect)(()=>{(0,q.ensureAttendance)(C,T),(0,U.ensureChat)(T)},[C]),globalThis.__ccNow=T.getTime();const ze=(0,U.useChatUnread)().total,Ee=(0,M.useRef)({t:'home',s:null});Ee.current={t:Be,s:Ie};const He=(0,M.useRef)([]),De=(0,M.useCallback)((e,s=null)=>{const t=Ee.current;t.t===e&&t.s===s||(He.current=[...He.current,{...t,y:Ue.leave()}].slice(-30),Ue.restore(0)),Ae(e),Pe(s)},[]),Ne=(0,M.useCallback)(()=>{if((0,u.runBackLayer)())return!0;const e=Ee.current;let s=He.current.pop();for(;s&&s.t===e.t&&s.s===e.s;)s=He.current.pop();if(!s&&'home'===e.t&&!e.s)return!1;const t=s??{t:'home',s:null};return Ue.leave(),Ae(t.t),Pe(t.s),Ue.restore(t.y??0),!0},[]);(0,u.useWebBack)(Ne);const Fe=(0,u.useInnerBackShown)();(0,M.useEffect)(()=>{w.PITCH&&(globalThis.__pitchGo=De,globalThis.__pitchClock={setClockServer:j.setClockServer,markClockSent:j.markClockSent,markClockUnsent:j.markClockUnsent})},[De]),(0,M.useEffect)(()=>(0,k.startForegroundRefresh)(),[]),(0,$.useShiftReminders)({rid:i,staffId:S,name:n,onStartBreak:()=>De('clock')}),(0,G.useScheduledNotices)({rid:i,staffId:ce?.id??'',name:n,onOpen:e=>{'orderlists'===e&&De('me','orderlists')}}),(0,Y.useOffRotaPrompt)({rid:i,staffId:ce?.id??''});const Ue=(0,c.useScrollMemory)(We),Ve=(0,M.useCallback)((e,s=null)=>'chat'===e?De('chat'):'clock'===s?De('clock'):'rota'===s?De('rota'):s&&we.some(e=>e.id===s)?De('me',s):'blocks'===s&&he?De('me','mgr-blocks'):void De('home'===e?'home':'me'),[De,he]);(0,M.useEffect)(()=>{const e=P.default.addEventListener('hardwareBackPress',Ne);return()=>e.remove()},[Ne]);const $e='me'===Be&&Ie?we.find(e=>e.id===Ie)??(he?Me.find(e=>e.id===Ie):void 0):void 0,Ge=(0,K.useOrderLists)(e=>e.settings[i]?.allowStaff??!0),Ye=we.filter(e=>('suppliers'!==e.id||Re)&&('orderlists'!==e.id||Ge||ce&&'staff'!==ce.role));(0,M.useEffect)(()=>{N.useOwner.getState().staffAs&&N.useOwner.setState({staffAs:void 0})},[]);(0,z.default)().width;return(0,ye.jsxs)(E.SafeAreaView,{style:{flex:1,backgroundColor:F.colours.bg},edges:['top','left','right','bottom'],children:[(0,ye.jsxs)(W.default,{style:{position:'relative',paddingHorizontal:14,paddingTop:6,paddingBottom:8,borderBottomWidth:1,borderColor:F.colours.border,gap:6},children:[(0,ye.jsx)(W.default,{style:{position:'absolute',top:4,right:6,zIndex:5,flexDirection:'row',alignItems:'center'},children:(0,ye.jsx)(D.VoiceSlot,{size:44})}),(0,ye.jsx)(W.default,{testID:"header-me-wrap",style:{alignItems:'flex-start',minHeight:44,justifyContent:'center',maxWidth:'70%'},children:(0,ye.jsx)(O.default,{testID:"header-me",accessibilityRole:"button",accessibilityLabel:`${(0,r.privateClockVenue)(i)?`Signed in as ${n}`:'Signed in as'}${ue?`, ${ue}`:''}`,onPress:()=>Le(!0),hitSlop:6,style:{borderWidth:1,borderColor:F.colours.gold,borderRadius:22,paddingHorizontal:10,paddingVertical:4,maxWidth:'100%',minHeight:44,justifyContent:'center'},children:(0,ye.jsxs)(H.Row,{gap:6,style:{justifyContent:'flex-start'},children:[(0,ye.jsx)(ge.StaffAvatar,{id:S,size:24,ring:!1}),(0,ye.jsxs)(W.default,{style:{flexShrink:1},children:[(0,ye.jsxs)(H.T,{size:13,weight:"semibold",colour:F.colours.gold,numberOfLines:1,style:{flexShrink:1},children:[n.replace(' (example)',''),ce?'':' (preview)'," \u25be"]}),ue?(0,ye.jsx)(H.Muted,{center:!1,size:10,numberOfLines:1,children:ue}):null]})]})})}),(0,ye.jsx)(_.VenueHeaderBlock,{rid:e.id,name:e.name,badge:"STAFF",place:"Front of House"+(e.location?` \xb7 ${e.location.split(',').slice(0,2).join(',')}`:'')})]}),(0,ye.jsxs)(L.default,{ref:We,...Ue.props,contentContainerStyle:{padding:14,paddingBottom:16,gap:12,width:'100%',maxWidth:760,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:[(0,ye.jsx)(u.BackTitleRow,{back:!('home'===Be&&!Ie||Fe),onBack:Ne,title:$e?$e.title:je[Be]}),'home'===Be&&he?(0,ye.jsx)(se.ManagerFeaturesNote,{}):null,'home'===Be&&ce&&'staff'!==ce.role&&!he&&'undefined'!=typeof window?(0,ye.jsxs)(W.default,{testID:"manager-access-banner",style:{borderWidth:1,borderColor:F.colours.gold,borderRadius:12,padding:10,gap:6},children:[(0,ye.jsx)(H.T,{weight:"semibold",colour:F.colours.gold,children:"You have manager access"}),(0,ye.jsx)(H.Muted,{children:"The Manager app has everything here plus bookings, the rota, staff and settings."}),(0,ye.jsx)(O.default,{accessibilityRole:"button",onPress:()=>{const e=(0,ae.appUrl)('owner');e&&window.location.assign(e)},style:{alignSelf:'flex-start',borderWidth:1,borderColor:F.colours.gold,borderRadius:14,paddingHorizontal:12,paddingVertical:5,minHeight:44,justifyContent:'center'},children:(0,ye.jsx)(H.T,{size:14,colour:F.colours.gold,children:"Open the Managers app \u203a"})})]}):null,'home'===Be&&ce?(0,ye.jsx)(v.MyTasksToday,{rid:i,staffId:ce.id,name:ce.name,onShift:(0,$.shiftNow)(ce.id,T.getTime()).on}):null,'home'===Be?(0,ye.jsx)(Ce,{go:Ve}):null,'clock'===Be?(0,ye.jsx)(ne.ClockInOut,{}):null,'rota'===Be?(0,ye.jsx)(ne.Rota,{}):null,'chat'===Be?(0,ye.jsx)(U.Chat,{go:Ve}):null,'me'!==Be||$e?null:(0,ye.jsxs)(W.default,{style:{gap:10},children:[(0,ye.jsx)(W.default,{style:{borderRadius:14,borderWidth:1,borderColor:F.colours.border,backgroundColor:F.colours.surface,overflow:'hidden'},children:Ye.map((e,s)=>(0,ye.jsx)(O.default,{testID:`audit-page-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.title,onPress:()=>De('me',e.id),style:({pressed:e})=>({padding:12,borderTopWidth:s?1:0,borderColor:F.colours.border,backgroundColor:e?'#1d1a14':'transparent'}),children:(0,ye.jsxs)(H.Row,{style:{justifyContent:'space-between'},children:[(0,ye.jsxs)(W.default,{style:{flex:1},children:[(0,ye.jsx)(H.T,{weight:"medium",children:e.title}),(0,ye.jsx)(H.Muted,{children:e.sub})]}),(0,ye.jsx)(H.T,{colour:F.colours.muted,children:"\u203a"})]})},e.id))}),he?(0,ye.jsxs)(W.default,{testID:"manager-features",style:{gap:6},children:[(0,ye.jsx)(H.T,{weight:"semibold",colour:F.colours.gold,children:"Manager features"}),(0,ye.jsx)(W.default,{style:{borderRadius:14,borderWidth:1,borderColor:F.colours.gold,backgroundColor:F.colours.surface,overflow:'hidden'},children:Me.map((e,s)=>(0,ye.jsx)(O.default,{testID:`audit-page-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.title,onPress:()=>De('me',e.id),style:({pressed:e})=>({padding:12,borderTopWidth:s?1:0,borderColor:F.colours.border,backgroundColor:e?'#1d1a14':'transparent'}),children:(0,ye.jsxs)(H.Row,{style:{justifyContent:'space-between'},children:[(0,ye.jsxs)(W.default,{style:{flex:1},children:[(0,ye.jsx)(H.T,{weight:"medium",children:e.title}),(0,ye.jsx)(H.Muted,{children:e.sub})]}),(0,ye.jsx)(H.T,{colour:F.colours.muted,children:"\u203a"})]})},e.id))}),(0,ye.jsx)(se.ManagerFeaturesAbout,{})]}):null,Re?null:(0,ye.jsx)(H.Muted,{children:"Suppliers are hidden: your manager hasn\u2019t shared them with staff."}),(0,ye.jsxs)(H.Muted,{center:!0,children:["Staff app \xb7 ",x.APP_VERSION," \xb7 ",'live'===be.useSync.getState().mode?'shared with your team':'saved on this device until it connects']})]}),he&&$e?.id.startsWith('mgr-')?(0,ye.jsxs)(q.ShiftMgrScope.Provider,{value:!0,children:['mgr-plan'===$e.id?(0,ye.jsx)(s.TablePlan,{}):null,'mgr-times'===$e.id?(0,ye.jsx)(t.StaffBookingTimes,{}):null,'mgr-bookings'===$e.id?(0,ye.jsx)(V.Bookings,{}):null,'mgr-clear'===$e.id?(0,ye.jsx)(se.TablesToClear,{rid:i}):null,'mgr-blocks'===$e.id?(0,ye.jsx)(X.BlocksPage,{}):null,'mgr-allergy'===$e.id?(0,ye.jsx)(Z.AllergenSignOffLog,{}):null,'mgr-stock'===$e.id?(0,ye.jsxs)(W.default,{style:{gap:10},children:[(0,ye.jsx)(ee.TrackedStockPage,{}),(0,ye.jsx)(b.SoldOutList,{rid:i,by:n.replace(' (example)','')})]}):null,'mgr-clock'===$e.id?(0,ye.jsx)(se.ClockOverview,{today:C,now:T}):null,'mgr-swaps'===$e.id?(0,ye.jsx)(se.SwapApprovals,{today:C,me:n}):null]}):null,'loyalty'===$e?.id?(0,ye.jsx)(h.StaffLoyalty,{venue:e.name}):null,'guests'===$e?.id?(0,ye.jsx)(f.GuestProfiles,{me:n.replace(' (example)',''),manager:!1}):null,'bookings'===$e?.id?(0,ye.jsx)(V.Bookings,{}):null,'giftcards'===$e?.id?(0,ye.jsx)(p.GiftCardsPage,{me:n.replace(' (example)','')}):null,'tableorders'===$e?.id?(0,ye.jsx)(l.StaffTableOrders,{rid:i,me:n.replace(' (example)','')}):null,'soldout'===$e?.id?(0,ye.jsx)(b.SoldOutList,{rid:i,by:n.replace(' (example)','')}):null,'board'===$e?.id?(0,ye.jsx)(I.QuestionBoard,{rid:i,today:C,manager:!1,by:""}):null,'recipecards'===$e?.id?(0,ye.jsx)(R.RecipeCards,{rid:e.id,actor:{name:n,role:'staff'},mode:"read"}):null,'avatar'===$e?.id?(0,ye.jsx)(me.AvatarMaker,{meId:S,me:n}):null,'cashup'===$e?.id?(0,ye.jsx)(Te,{rid:i,today:C,meId:S,me:n}):null,'haccp'===$e?.id?(0,ye.jsx)(pe.HaccpLog,{mode:"staff",me:n,meId:S,now:T}):null,'accidents'===$e?.id?(0,ye.jsx)(fe.AccidentBook,{app:"staff",me:n,meId:S,now:T,seeAll:!1}):null,'mypay'===$e?.id?(0,ye.jsxs)(W.default,{style:{gap:10},children:[(0,ye.jsx)(ie.MyPeriods,{staffId:S}),(0,ye.jsx)(re.MyHoursPay,{staffId:S})]}):null,'mytips'===$e?.id?(0,ye.jsx)(de.MyTips,{}):null,'reviews'===$e?.id?(0,ye.jsx)(B.ReviewsSection,{rid:i,mode:"read",venueName:e.name}):null,'timesheets'===$e?.id?(0,ye.jsxs)(W.default,{style:{gap:10},children:[(0,ye.jsx)(ie.MyPeriods,{staffId:S}),(0,ye.jsx)(ne.Timesheets,{})]}):null,'orderlists'===$e?.id?(0,ye.jsx)(Q.OrderListsScreen,{rid:i,today:C,editor:!!ce&&'staff'!==ce.role&&!he,who:{id:S,name:n.replace(' (example)','')}}):null,'phone'===$e?.id?(0,ye.jsx)(J.PhoneAlerts,{}):null,'suppliers'===$e?.id?Re?(0,ye.jsx)(le.Suppliers,{}):(0,ye.jsx)(H.Muted,{children:"Your manager hasn\u2019t shared suppliers with staff."}):null,'privacy'===$e?.id?(0,ye.jsxs)(W.default,{style:{gap:8},children:[(0,r.privateClockVenue)(i)?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(H.T,{size:14,children:"Location is checked only when you choose Clock in at the pub. Only a pass or fail is saved with the clock-in time, or an audited manager override."}),(0,ye.jsx)(H.T,{size:14,children:"Your position, accuracy and distance are never saved. There are no location trails, background/arrival checks, clock-out checks or break checks."})]}):(0,ye.jsxs)(ye.Fragment,{children:[" ",(0,ye.jsx)(H.T,{size:14,children:"\u2022 Location is checked when you tap Clock in, Clock out, Start break or End break, and (if you allowed location) while the app is open to ask if you want to clock in when you\u2019re at the venue but not on the rota. Never in the background."}),(0,ye.jsx)(H.T,{size:14,children:"\u2022 Each clock record keeps the location reading, how accurate it was, whether it was inside the venue area, and the time. Managers can see these."})]}),(0,ye.jsx)(H.T,{size:14,children:"\u2022 You see only your own hours, pay estimates and tips. Managers see the team\u2019s."}),(0,ye.jsxs)(H.T,{size:14,children:["\u2022 Chat messages stay within ",e.name,"\u2019s team."]}),(0,ye.jsx)(H.T,{size:14,children:"\u2022 Pay figures are estimates before tax and deductions; your payslip is the official record."})]}):null]}),(0,ye.jsx)(oe.BottomTabs,{background:(0,o.soutersSurface)('#0d0d0d'),active:Be,onPress:e=>De(e),tabs:ke.map(e=>({id:e.id,label:e.label,icon:e.icon,badge:'chat'===e.id&&ze?{text:String(ze),bg:F.colours.red}:null}))}),(0,ye.jsx)(H.Sheet,{visible:Oe,onClose:()=>Le(!1),title:"Signed in as",children:ce?(0,ye.jsxs)(W.default,{style:{gap:8},children:[(0,ye.jsxs)(H.Row,{gap:10,children:[(0,ye.jsx)(ge.StaffAvatar,{id:ce.id,size:48}),(0,ye.jsxs)(W.default,{style:{flex:1},children:[(0,ye.jsx)(H.T,{weight:"semibold",children:ce.name}),(0,ye.jsx)(H.Muted,{children:(0,ae.levelJob)(ce.level??'Staff',ce.job)})]})]}),(0,ye.jsx)(H.Muted,{children:"Signed in with your personal link. This phone remembers you."}),he?(0,ye.jsx)(H.Muted,{children:"Manager features are on for you in this app."}):null,'staff'===ce.role||he?null:(0,ye.jsx)(H.Button,{kind:"secondary",label:"Back to CoverCharge for Managers",onPress:()=>{const e=(0,ae.appUrl)('owner');e&&window.location.assign(e)}}),ce.id===xe?(0,ye.jsx)(H.Button,{kind:"secondary",label:"Back to CoverCharge for Head Chef",onPress:()=>{const e=(0,ae.appUrl)('chef');e&&window.location.assign(e)}}):null]}):(0,ye.jsxs)(W.default,{style:{gap:8},children:[(0,ye.jsx)(H.Muted,{children:"Not signed in: this is a preview. Open your personal link, or paste it here, to sign in as yourself."}),(0,ye.jsx)(te.SignInWithLink,{})]})})]})}function Ce({go:e}){const{rid:s,today:t}=(0,q.useCtx)(3e4),o=(0,ue.useTravelDay)('staff',t);return(0,ye.jsxs)(W.default,{style:{gap:10},children:[(0,ye.jsx)(n.WhoBar,{}),(0,ye.jsx)(ue.DayBar,{app:"staff",today:t}),o?null:(0,ye.jsx)(i.CoversToday,{rid:s}),o?(0,ye.jsx)(ue.DayView,{rid:s,day:o,today:t,app:"staff"}):(0,ye.jsx)(ce.StaffHome,{go:e})]})}function Te({rid:e,today:s,meId:t,me:o}){return!0!==(0,T.useCashAccess)(e=>e.mine)?(0,ye.jsx)(C.NoCashUpAccess,{}):(0,ye.jsx)(S.CashUpScreen,{rid:e,today:s,canEdit:!0,who:{id:t??'me',name:o.replace(' (example)','')}})}},1502,[1404,1503,828,995,1089,1451,1181,1047,1048,1452,1476,1454,1147,980,1012,1504,1009,2,1052,1053,1428,997,34,1149,1207,1211,1177,373,402,295,102,426,36,794,873,1130,892,821,1152,1365,1085,1102,1103,1098,1049,1032,1079,1446,1441,1460,1505,1374,1001,236,1213,1163,1169,1402,1176,1175,1416,1166,15,1182,1183,926,793,988,25]); -__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:n}=(0,l.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[b,h]=(0,t.useState)(String(e.settings.turnMins??'')),[y,v]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[f,k]=(0,t.useState)(!1),M=(e,t,n)=>c(s=>({...s,[e]:0===t?[n,s[e]?.[1]??'']:[s[e]?.[0]??'',n]})),S=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(b)<=360&&Number(y)>=1&&Number(y)<=1e3;return(0,r.jsxs)(s.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(n=>({...n,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>M(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>M(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:b,onChangeText:h,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:y,onChangeText:v,keyboardType:"number-pad"})]}),(0,r.jsx)(i.Button,{label:f?'Saving\u2026':'Save booking times',disabled:!S||f,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{k(!0);try{await(0,o.saveStaffBookingTimes)(n,u,Number(b),Number(y)),j('Booking times saved.')}catch(e){j(e.message)}finally{k(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),n=_r(_d[1]),s=(e=n)&&e.__esModule?e:{default:e},i=_r(_d[2]),l=_r(_d[3]),o=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1503,[34,102,794,1079,988,25]); +__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:s}=(0,o.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[h,b]=(0,t.useState)(String(e.settings.turnMins??'')),[v,y]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[k,S]=(0,t.useState)(!1),f=(e,t,s)=>c(n=>({...n,[e]:0===t?[s,n[e]?.[1]??'']:[n[e]?.[0]??'',s]})),p=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(h)<=360&&Number(v)>=1&&Number(v)<=1e3;return(0,r.jsxs)(n.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(s=>({...s,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>f(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>f(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:h,onChangeText:b,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:v,onChangeText:y,keyboardType:"number-pad"}),e.settings.bookingCoversPerStart||e.settings.bookingPartiesPerStart?(0,r.jsx)(i.Muted,{center:!0,children:"Online booking uses the covers and bookings caps at each start time (Settings \u203a Capacity & waitlist), not this half-hour figure."}):null]}),(0,r.jsx)(i.Button,{label:k?'Saving\u2026':'Save booking times',disabled:!p||k,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{S(!0);try{await(0,l.saveStaffBookingTimes)(s,u,Number(h),Number(v)),j('Booking times saved.')}catch(e){j(e.message)}finally{S(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),s=_r(_d[1]),n=(e=s)&&e.__esModule?e:{default:e},i=_r(_d[2]),o=_r(_d[3]),l=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1503,[34,102,794,1079,988,25]); __d(function(g,_r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.newerRelease=r,_e.startForegroundRefresh=function(n={}){if('undefined'==typeof document)return()=>{};let o='hidden'===document.visibilityState?Date.now():0,c=!1;const s=n.reload??(()=>location.reload()),u=async()=>{if(!c){c=!0;try{await Promise.race([e.mutationQueue.retryNow(),new Promise(e=>setTimeout(e,4e3))]),n.onWake?.();const t=await(navigator.serviceWorker?.getRegistration?.().catch(()=>{}));if(await(t?.update?.().catch(()=>{})),t?.waiting){try{t.waiting.postMessage({type:'SKIP_WAITING'})}catch{}return void setTimeout(s,3e3)}await r().catch(()=>!1)&&s()}finally{c=!1}}},l=()=>{if('hidden'===document.visibilityState)return void(o=Date.now());const n=o?Date.now()-o:0;o=0,e.mutationQueue.retryNow(),n>=t&&u()},f=()=>{e.mutationQueue.retryNow()};document.addEventListener('visibilitychange',l);for(const e of['focus','online','pageshow'])window.addEventListener(e,f);return()=>{document.removeEventListener('visibilitychange',l);for(const e of['focus','online','pageshow'])window.removeEventListener(e,f)}},_r(d[0]);var e=_r(d[1]);const t=3e4,n=e=>(e.match(/_expo\/static\/js\/web\/[A-Za-z0-9_.-]+\.js(\?v=[0-9a-f]+)?/)??[])[0]??null;function o(){try{const e=[...document.querySelectorAll('script[src]')].map(e=>e.src).find(e=>/_expo\/static\/js\/web\//.test(e));return e?n(e):null}catch{return null}}async function r(e=fetch){const t=o();if(!t)return!1;const r=location.pathname.replace(/[^/]*$/,''),c=await e(`${r}index.html?fresh=${Date.now()}`,{cache:'no-store'});if(!c.ok)return!1;const s=n(await c.text());return!!s&&s!==t}},1504,[236,1010]); __d(function(g,_r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ManagerFeaturesNote=function(){return(0,j.jsxs)(a.default,{testID:"manager-features-banner",style:{borderWidth:1,borderColor:b.colours.gold,borderRadius:12,padding:10,gap:4},children:[(0,j.jsx)(d.T,{weight:"semibold",colour:b.colours.gold,children:"Manager features are on"}),(0,j.jsx)(d.Muted,{children:"Open Me \u203a Manager features for bookings, tables, blocks, allergy checks, stock, who\u2019s clocked in and shift swaps."})]})},_e.ManagerFeaturesAbout=function(){return(0,j.jsxs)(d.Card,{children:[(0,j.jsx)(d.T,{weight:"semibold",children:"What manager features include"}),c.SHIFT_MANAGER_FEATURES.map(e=>(0,j.jsxs)(d.T,{size:14,children:["\u2022 ",e]},e)),(0,j.jsxs)(d.Muted,{children:["Not included: ",c.SHIFT_MANAGER_EXCLUDED_WORDS,". Those stay in the Managers app."]})]})},_e.ClockOverview=function({today:e,now:t}){const s=(0,o.useOwner)(e=>e.staff),n=(0,o.useOwner)(e=>e.attendance).filter(t=>t.date===e&&t.in),r=e=>x(s.find(t=>t.id===e)?.name)||'Team member',h=n.filter(e=>!e.out).sort((e,t)=>(e.in??'').localeCompare(t.in??'')),c=n.filter(e=>e.out).sort((e,t)=>(e.out??'').localeCompare(t.out??'')),u=e=>(e.breaks??[]).some(e=>!e.end);return(0,j.jsxs)(a.default,{style:{gap:10},testID:"clock-overview",children:[(0,j.jsxs)(d.T,{weight:"semibold",children:["Clocked in now (",h.length,")"]}),h.length?h.map(e=>(0,j.jsxs)(d.Card,{children:[(0,j.jsx)(d.T,{weight:"medium",children:r(e.staffId)}),(0,j.jsxs)(d.Muted,{children:["In at ",(0,l.hm)(new Date(e.in)),u(e)?' \xb7 on a break':'',!1===e.inSite?' \xb7 clocked in away from the venue':'']})]},e.id)):(0,j.jsx)(d.Muted,{children:"Nobody is clocked in right now."}),(0,j.jsxs)(d.T,{weight:"semibold",children:["Finished today (",c.length,")"]}),c.length?c.map(e=>(0,j.jsxs)(d.Card,{children:[(0,j.jsx)(d.T,{weight:"medium",children:r(e.staffId)}),(0,j.jsxs)(d.Muted,{children:[(0,l.hm)(new Date(e.in))," to ",(0,l.hm)(new Date(e.out))]})]},e.id)):(0,j.jsx)(d.Muted,{children:"Nobody has clocked out yet today."}),(0,j.jsxs)(d.Muted,{children:["Read only. To change someone\u2019s clock record, ask a manager in the Managers app. Checked at ",(0,l.hm)(t),"."]})]})},_e.TablesToClear=function({rid:e}){const s=(0,r.useFloor)(t=>t.live[e])??{},n=Object.entries(s).filter(([,e])=>e?.dirty).map(([e])=>e).sort((e,t)=>e.localeCompare(t,'en',{numeric:!0}));return(0,j.jsx)(a.default,{style:{gap:8},testID:"tables-to-clear",children:n.length?n.map(s=>(0,j.jsx)(d.Card,{children:(0,j.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(d.T,{weight:"semibold",children:(0,t.tableNumbers)(s)}),(0,j.jsx)(d.Button,{small:!0,kind:"success",label:"Mark cleared",accessibilityLabel:`Mark table ${s} cleared, table free`,testID:`clear-${s}`,onPress:()=>{r.useFloor.getState().setLive(e,s,{dirty:!1,stage:void 0}),(0,w.notify)({id:`clear-${s}`,title:`${(0,t.tableNumbers)(s)} is free`,timeoutMs:4e3})}})]})},s)):(0,j.jsx)(d.Muted,{children:"No tables need clearing."})})},_e.SwapApprovals=function({today:e,me:t}){const n=(0,o.useOwner)(e=>e.staff),r=(0,o.useOwner)(e=>e.shifts),y=(0,o.useOwner)(e=>e.swaps),[M,k]=(0,s.useState)(null),[I,v]=(0,s.useState)(null),[T,S]=(0,s.useState)(!1),C=e=>x(n.find(t=>t.id===e)?.name)||'Team member',D=(()=>{const t=(0,l.parseYmd)(e);return t.setDate(t.getDate()+13),t})(),N=r.filter(t=>{return!1!==t.published&&t.date>=e&&(0,l.parseYmd)(t.date)<=D&&(s=t.staffId,!('owner'===n.find(e=>e.id===s)?.role));var s}).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start),O=e=>`${(0,l.niceDate)((0,l.parseYmd)(e.date))}, ${(0,h.fmtH)(e.start)} to ${(0,h.fmtH)(e.end)}`,R=async(e,s,n,a)=>{S(!0);const d=await(0,u.approveShiftSwap)(e.id,s,n);S(!1),d.ok?(o.useOwner.setState(t=>({shifts:t.shifts.map(t=>t.id===e.id?{...t,staffId:s}:t)})),a&&o.useOwner.getState().setSwap(a,'approved'),(0,w.notify)({id:'swap-ok',title:'Shift changed',body:`${C(e.staffId)}\u2019s shift on ${O(e)} is now ${C(s)}\u2019s. Approved by ${x(t)}.`,timeoutMs:6e3}),k(null),v(null)):(0,w.notify)({id:'swap-fail',title:'Not changed',body:d.message,timeoutMs:6e3})},$=y.filter(e=>'open'===e.status);return(0,j.jsxs)(a.default,{style:{gap:10},testID:"swap-approvals",children:[(0,j.jsxs)(d.T,{weight:"semibold",children:["Requests (",$.length,")"]}),$.length?$.map(e=>{const t=r.find(t=>t.id===e.shiftId);return(0,j.jsxs)(d.Card,{children:[(0,j.jsxs)(d.T,{weight:"medium",children:[C(e.fromId)," \xb7 ",'cover'===e.kind?'needs cover':'swap']}),(0,j.jsxs)(d.Muted,{children:[t?O(t):'Shift not found',e.toId?` \xb7 to ${C(e.toId)}`:'',e.note?` \xb7 ${e.note}`:'']}),(0,j.jsxs)(d.Row,{gap:6,children:[(0,j.jsx)(d.Button,{small:!0,label:"Approve",disabled:!t||!e.toId||T||!(0,p.canSwapWith)(n.find(t=>t.id===e.fromId),n.find(t=>t.id===e.toId),f.VENUE_RID),onPress:()=>t&&e.toId&&R(t,e.toId,e.kind,e.id)}),(0,j.jsx)(d.Button,{small:!0,kind:"ghost",label:"Decline",onPress:()=>o.useOwner.getState().setSwap(e.id,'declined')})]})]},e.id)}):(0,j.jsx)(d.Muted,{children:"No open requests on this phone. Swap requests made on other phones aren\u2019t shared yet, so if someone asks you in person, use Give a shift to someone else below."}),(0,j.jsx)(d.T,{weight:"semibold",children:"Give a shift to someone else"}),M?(0,j.jsxs)(d.Card,{highlight:b.colours.gold,children:[(0,j.jsxs)(d.T,{weight:"semibold",children:[C(M.staffId)," \xb7 ",O(M)]}),(0,j.jsx)(d.Muted,{children:"Who takes it? Only someone they are allowed to swap with."}),(0,j.jsx)(d.Row,{wrap:!0,gap:6,children:(0,c.swapTargets)(n,M.staffId,f.VENUE_RID).map(e=>(0,j.jsx)(d.Chip,{label:x(e.name),selected:I===e.id,onPress:()=>v(e.id)},e.id))}),(0,j.jsxs)(d.Row,{gap:6,children:[(0,j.jsx)(d.Button,{label:"Approve",disabled:!I||T,onPress:()=>I&&R(M,I,'swap'),testID:"swap-give"}),(0,j.jsx)(d.Button,{kind:"secondary",label:"Cancel",onPress:()=>{k(null),v(null)}})]})]}):N.length?N.map(e=>(0,j.jsxs)(d.Card,{onPress:()=>{k(e),v(null)},children:[(0,j.jsx)(d.T,{weight:"medium",children:C(e.staffId)}),(0,j.jsx)(d.Muted,{children:O(e)})]},e.id)):(0,j.jsx)(d.Muted,{children:"No published shifts in the next two weeks."}),(0,j.jsx)(d.Banner,{kind:"info",children:"Approving moves the shift on the rota for everyone and records who approved it. Writing or publishing the rota stays in the Managers app."})]})};var e,t=_r(_d[0]),s=_r(_d[1]),n=_r(_d[2]),a=(e=n)&&e.__esModule?e:{default:e},d=_r(_d[3]),o=_r(_d[4]),r=_r(_d[5]),l=_r(_d[6]),h=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),p=_r(_d[10]),f=_r(_d[11]),w=_r(_d[12]),b=_r(_d[13]),j=_r(_d[14]);const x=e=>(e??'').replace(' (example)','')},1505,[860,34,102,794,892,1021,858,1082,1080,988,1081,5,998,821,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1506,[30,34,872,25]); diff --git a/owner-app/admin.html b/owner-app/admin.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/admin.html +++ b/owner-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer.html b/owner-app/customer.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer.html +++ b/owner-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage.html b/owner-app/customer/anchorage.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer/anchorage.html +++ b/owner-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/book.html b/owner-app/customer/anchorage/book.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer/anchorage/book.html +++ b/owner-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/feedback.html b/owner-app/customer/anchorage/feedback.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer/anchorage/feedback.html +++ b/owner-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/gift.html b/owner-app/customer/anchorage/gift.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer/anchorage/gift.html +++ b/owner-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/lost.html b/owner-app/customer/anchorage/lost.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer/anchorage/lost.html +++ b/owner-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/loyalty.html b/owner-app/customer/anchorage/loyalty.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer/anchorage/loyalty.html +++ b/owner-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/merch.html b/owner-app/customer/anchorage/merch.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer/anchorage/merch.html +++ b/owner-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/offers.html b/owner-app/customer/anchorage/offers.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer/anchorage/offers.html +++ b/owner-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/refer.html b/owner-app/customer/anchorage/refer.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer/anchorage/refer.html +++ b/owner-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/waitlist.html b/owner-app/customer/anchorage/waitlist.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer/anchorage/waitlist.html +++ b/owner-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/whatson.html b/owner-app/customer/anchorage/whatson.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer/anchorage/whatson.html +++ b/owner-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/basket.html b/owner-app/customer/basket.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer/basket.html +++ b/owner-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/profile.html b/owner-app/customer/profile.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/customer/profile.html +++ b/owner-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/demo.html b/owner-app/demo.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/demo.html +++ b/owner-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/display.html b/owner-app/display.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/display.html +++ b/owner-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/index.html b/owner-app/index.html index ec1ff98fe425ea334f64dbb9c7b146fcae35fc0d..e3b2d4b10b1724e887b1c96f2224d54c03b8db2c 100644 --- a/owner-app/index.html +++ b/owner-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/kitchen.html b/owner-app/kitchen.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/kitchen.html +++ b/owner-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/owner.html b/owner-app/owner.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/owner.html +++ b/owner-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/staff.html b/owner-app/staff.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/staff.html +++ b/owner-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/sw.js b/owner-app/sw.js index 7b110e417e745596444683aa08d074d2ffc108ab..83c4070540a1faeaaf920a3b1906342939c2ab1d 100644 --- a/owner-app/sw.js +++ b/owner-app/sw.js @@ -1,7 +1,7 @@ // Anchorage Manager service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-owner-c50b7bfa79"; +const V = "cc-owner-456ddb886c"; const BASE = "/owner-app/"; -const PRECACHE = ["/owner-app/apple-touch-icon.png", "/owner-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/owner-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/owner-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/owner-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/owner-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/owner-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/owner-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/owner-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/owner-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/owner-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/owner-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/owner-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/owner-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/owner-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/owner-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/owner-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/owner-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/owner-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/owner-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/owner-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/owner-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/owner-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/owner-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/owner-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/owner-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/owner-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/owner-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/owner-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/owner-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/owner-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/owner-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/owner-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/owner-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/owner-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/owner-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/owner-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/owner-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/owner-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/owner-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/owner-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/owner-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/owner-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/owner-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/owner-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/owner-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/owner-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/owner-app/brand-logo.png", "/owner-app/favicon.ico", "/owner-app/icon-192.png", "/owner-app/icon-512.png", "/owner-app/icon-maskable-192.png", "/owner-app/icon-maskable-512.png", "/owner-app/manifest.webmanifest", "/owner-app/index.html", "/owner-app/_expo/static/js/web/bundle.js?v=c50b7bfa793ef1162d319296bef22a3b9780829f7d12aaf75c7d7d3cf923536b"]; +const PRECACHE = ["/owner-app/apple-touch-icon.png", "/owner-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/owner-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/owner-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/owner-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/owner-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/owner-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/owner-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/owner-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/owner-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/owner-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/owner-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/owner-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/owner-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/owner-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/owner-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/owner-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/owner-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/owner-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/owner-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/owner-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/owner-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/owner-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/owner-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/owner-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/owner-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/owner-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/owner-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/owner-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/owner-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/owner-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/owner-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/owner-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/owner-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/owner-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/owner-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/owner-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/owner-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/owner-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/owner-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/owner-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/owner-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/owner-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/owner-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/owner-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/owner-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/owner-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/owner-app/brand-logo.png", "/owner-app/favicon.ico", "/owner-app/icon-192.png", "/owner-app/icon-512.png", "/owner-app/icon-maskable-192.png", "/owner-app/icon-maskable-512.png", "/owner-app/manifest.webmanifest", "/owner-app/index.html", "/owner-app/_expo/static/js/web/bundle.js?v=456ddb886cb1ab7b02964fd06ba4eeb83120f05a099e76c837e031bcccc89814"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/owner-app/team.html b/owner-app/team.html index 3cf0c6c20fa5f9b5b9abfe26ffbf03351ae60381..7e19661d839048913456bc2c10c058dc9e89f73f 100644 --- a/owner-app/team.html +++ b/owner-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/_expo/static/js/web/bundle.js b/staff-app/_expo/static/js/web/bundle.js index 90d0b10a77289771e37b8372d32839e35b5fe864..8b2d9d2663a64814f0b35bf42b60738d6c32b8e2 100644 --- a/staff-app/_expo/static/js/web/bundle.js +++ b/staff-app/_expo/static/js/web/bundle.js @@ -6,7 +6,7 @@ var __BUNDLE_START_TIME__=globalThis.nativePerformanceNow?nativePerformanceNow() __d(function(g,r,i,a,m,e,d){"use strict";r(d[0]),r(d[1])},0,[1,19]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";var e,t=_r(d[0]),o=_r(d[1]),a=_r(d[2]),n=_r(d[3]),i=_r(d[4]),c=(e=i)&&e.__esModule?e:{default:e};if(t.PITCH){const e=o.restaurants.find(e=>'anchorage'===e.id);e&&Object.assign(e,{name:n.PITCH_VENUE.name,tagline:n.PITCH_VENUE.tagline,location:n.PITCH_VENUE.location,phone:n.PITCH_VENUE.phone,website:n.PITCH_VENUE.website,hoursNote:'Kitchen (food) hours. The closing time is last food orders.',fictional:!1}),e&&(e.settings={...e.settings,whatsapp:'07700 900123'});for(const e of c.default.areas)delete e.best;for(let e=a.ROSTER.length-1;e>=0;e--){const t=n.PITCH_TEAM[a.ROSTER[e].id];t?(Object.assign(a.ROSTER[e],{name:t.name,job:t.job,hourlyPence:t.hourlyPence,...t.dept?{dept:t.dept}:{},...null!=t.salaried?{salaried:t.salaried}:{}}),delete a.ROSTER[e].nickname):a.ROSTER.splice(e,1)}if('undefined'!=typeof document){const e=t=>{if(3===t.nodeType){const e=t.nodeValue??'',o=(0,n.pitchText)(e);return void(o!==e&&(t.nodeValue=o))}if(1!==t.nodeType)return;const o=t;if('INPUT'===o.tagName||'TEXTAREA'===o.tagName){const e=o,t=(0,n.pitchText)(e.value);t!==e.value&&(e.value=t);const a=e.getAttribute('placeholder');if(a){const t=(0,n.pitchText)(a);t!==a&&e.setAttribute('placeholder',t)}}for(const e of['aria-label','title']){const t=o.getAttribute(e);if(t){const a=(0,n.pitchText)(t);a!==t&&o.setAttribute(e,a)}}o.childNodes.forEach(e)},t=()=>{e(document.body),document.title=(0,n.pitchText)(document.title),new MutationObserver(t=>{for(const o of t)'characterData'===o.type?e(o.target):o.addedNodes.forEach(e),'attributes'===o.type&&e(o.target);document.title=(0,n.pitchText)(document.title)}).observe(document.body,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:['value','placeholder','aria-label']}),document.addEventListener('input',e=>{e.target},!0)};document.body?t():document.addEventListener('DOMContentLoaded',t)}}},1,[2,3,15,17,18]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PITCH",{enumerable:!0,get:function(){return n}});const n=(['anchorage','souters','kirkmichael','wildings','kirkton','abbotsford','greenside',"3idiots","cecchinis","mrbasrais","yasmins","williewastles","rupeeroom","smokinggoat","pizzaioli","drunkencoo"].includes("anchorage"),!1)},2,[]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return t.GREENSIDE_RESTAURANT}}),Object.defineProperty(e,"ABBOTSFORD_RESTAURANT",{enumerable:!0,get:function(){return n.ABBOTSFORD_RESTAURANT}}),Object.defineProperty(e,"KIRKTON_RESTAURANT",{enumerable:!0,get:function(){return o.KIRKTON_RESTAURANT}}),Object.defineProperty(e,"WILDINGS_RESTAURANT",{enumerable:!0,get:function(){return s.WILDINGS_RESTAURANT}}),Object.defineProperty(e,"KIRKMICHAEL_RESTAURANT",{enumerable:!0,get:function(){return c.KIRKMICHAEL_RESTAURANT}}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return R}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);const u={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:16,bookingSlotMinutes:15,deposit:{...r(d[6]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},h={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},f={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},b={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},p=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:f,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...u,orderAtTable:!1,pay:h,cashUpRecord:[...l.ANCHORAGE_CASH_UP]},sections:[]},{id:'saltmarsh',name:'The Venue',tagline:'FICTIONAL demo restaurant \u2014 shows multi-tenancy',location:'Port Ailsa (fictional town)',fictional:!0,kitchenHours:{0:['12:00','20:00'],1:['12:00','20:00'],2:['12:00','20:00'],3:['12:00','20:00'],4:['12:00','21:00'],5:['12:00','21:00'],6:['12:00','21:00']},settings:{...u,slotCap:4,stampTarget:6,stampReward:'Free side',capacityPerHour:30},sections:['Small plates','Mains','Puddings']},{id:'brae',name:'Brae Bakehouse',tagline:'FICTIONAL demo caf\xe9 \u2014 shows multi-tenancy',location:'Kilbrae (fictional village)',fictional:!0,kitchenHours:{0:['09:00','16:00'],1:['09:00','16:00'],2:['09:00','16:00'],3:['09:00','16:00'],4:['09:00','16:00'],5:['09:00','20:00'],6:['09:00','20:00']},settings:{...u,slotCap:5,slotMinutes:15,stampTarget:10,stampReward:'Free coffee & cake',capacityPerHour:24,bookingCoversPerSlot:10},sections:['Bakes','Lunch','Hot drinks']}],A={by:'Fictional demo',at:'2026-10-26'},T=(t,n,o,s,c,l,u,h,f=[])=>({id:n,restaurantId:t,section:o,name:s,description:c,price:l,allergens:u,prepMins:h,dietary:f,soldOut:!1,signOff:A}),R=[T('saltmarsh','s-beets','Small plates','Roast beetroot & whipped feta','Fictional dish for the demo.',750,{milk:'contains',treenuts:'may'},6,['V']),T('saltmarsh','s-squid','Small plates','Salt & pepper squid','Fictional dish for the demo.',850,{molluscs:'contains',gluten:'contains'},7),T('saltmarsh','s-hake','Mains','Pan-roast hake, mussel broth','Fictional dish for the demo.',1950,{fish:'contains',molluscs:'contains',milk:'contains',celery:'contains'},15),T('saltmarsh','s-risotto','Mains','Wild mushroom risotto','Fictional dish for the demo.',1600,{milk:'contains',celery:'contains',sulphites:'contains'},16,['V']),T('saltmarsh','s-cranachan','Puddings','Cranachan','Fictional dish for the demo.',700,{milk:'contains',gluten:'contains'},3,['V']),T('brae','b-scone','Bakes','Cheese scone','Fictional dish for the demo.',350,{gluten:'contains',milk:'contains',eggs:'contains'},2,['V']),T('brae','b-caramel','Bakes','Millionaire\u2019s shortbread','Fictional dish for the demo.',300,{gluten:'contains',milk:'contains',soya:'may'},1,['V']),T('brae','b-toastie','Lunch','Ham & mustard toastie','Fictional dish for the demo.',750,{gluten:'contains',milk:'contains',mustard:'contains'},6),T('brae','b-soup','Lunch','Lentil soup & bread','Fictional dish for the demo.',600,{gluten:'contains',celery:'contains'},4,['VG']),T('brae','b-flat','Hot drinks','Flat white','Fictional dish for the demo.',330,{milk:'contains'},2,['V'])]},3,[4,8,9,10,12,13,14]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return t.GREENSIDE_RESTAURANT}}),Object.defineProperty(e,"ABBOTSFORD_RESTAURANT",{enumerable:!0,get:function(){return n.ABBOTSFORD_RESTAURANT}}),Object.defineProperty(e,"KIRKTON_RESTAURANT",{enumerable:!0,get:function(){return o.KIRKTON_RESTAURANT}}),Object.defineProperty(e,"WILDINGS_RESTAURANT",{enumerable:!0,get:function(){return s.WILDINGS_RESTAURANT}}),Object.defineProperty(e,"KIRKMICHAEL_RESTAURANT",{enumerable:!0,get:function(){return c.KIRKMICHAEL_RESTAURANT}}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return R}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);const u={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:20,bookingSlotMinutes:15,deposit:{...r(d[6]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},h={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},f={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},b={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},p=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:f,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...u,orderAtTable:!1,pay:h,cashUpRecord:[...l.ANCHORAGE_CASH_UP],bookingCoversPerStart:15,bookingPartiesPerStart:4,onlinePartyMin:1,onlinePartyMax:8,bookingNoticeMins:15,autoAcceptUpTo:8},sections:[]},{id:'saltmarsh',name:'The Venue',tagline:'FICTIONAL demo restaurant \u2014 shows multi-tenancy',location:'Port Ailsa (fictional town)',fictional:!0,kitchenHours:{0:['12:00','20:00'],1:['12:00','20:00'],2:['12:00','20:00'],3:['12:00','20:00'],4:['12:00','21:00'],5:['12:00','21:00'],6:['12:00','21:00']},settings:{...u,slotCap:4,stampTarget:6,stampReward:'Free side',capacityPerHour:30},sections:['Small plates','Mains','Puddings']},{id:'brae',name:'Brae Bakehouse',tagline:'FICTIONAL demo caf\xe9 \u2014 shows multi-tenancy',location:'Kilbrae (fictional village)',fictional:!0,kitchenHours:{0:['09:00','16:00'],1:['09:00','16:00'],2:['09:00','16:00'],3:['09:00','16:00'],4:['09:00','16:00'],5:['09:00','20:00'],6:['09:00','20:00']},settings:{...u,slotCap:5,slotMinutes:15,stampTarget:10,stampReward:'Free coffee & cake',capacityPerHour:24,bookingCoversPerSlot:10},sections:['Bakes','Lunch','Hot drinks']}],A={by:'Fictional demo',at:'2026-10-26'},T=(t,n,o,s,c,l,u,h,f=[])=>({id:n,restaurantId:t,section:o,name:s,description:c,price:l,allergens:u,prepMins:h,dietary:f,soldOut:!1,signOff:A}),R=[T('saltmarsh','s-beets','Small plates','Roast beetroot & whipped feta','Fictional dish for the demo.',750,{milk:'contains',treenuts:'may'},6,['V']),T('saltmarsh','s-squid','Small plates','Salt & pepper squid','Fictional dish for the demo.',850,{molluscs:'contains',gluten:'contains'},7),T('saltmarsh','s-hake','Mains','Pan-roast hake, mussel broth','Fictional dish for the demo.',1950,{fish:'contains',molluscs:'contains',milk:'contains',celery:'contains'},15),T('saltmarsh','s-risotto','Mains','Wild mushroom risotto','Fictional dish for the demo.',1600,{milk:'contains',celery:'contains',sulphites:'contains'},16,['V']),T('saltmarsh','s-cranachan','Puddings','Cranachan','Fictional dish for the demo.',700,{milk:'contains',gluten:'contains'},3,['V']),T('brae','b-scone','Bakes','Cheese scone','Fictional dish for the demo.',350,{gluten:'contains',milk:'contains',eggs:'contains'},2,['V']),T('brae','b-caramel','Bakes','Millionaire\u2019s shortbread','Fictional dish for the demo.',300,{gluten:'contains',milk:'contains',soya:'may'},1,['V']),T('brae','b-toastie','Lunch','Ham & mustard toastie','Fictional dish for the demo.',750,{gluten:'contains',milk:'contains',mustard:'contains'},6),T('brae','b-soup','Lunch','Lentil soup & bread','Fictional dish for the demo.',600,{gluten:'contains',celery:'contains'},4,['VG']),T('brae','b-flat','Hot drinks','Flat white','Fictional dish for the demo.',330,{milk:'contains'},2,['V'])]},3,[4,8,9,10,12,13,14]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"GREENSIDE_UUID",{enumerable:!0,get:function(){return n.GREENSIDE_UUID}}),Object.defineProperty(e,"GREENSIDE_BOOKING_PHONE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"GREENSIDE_VENUE_HOURS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"GREENSIDE_KITCHEN_HOURS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"GREENSIDE_RESTAURANT",{enumerable:!0,get:function(){return u}});var n=r(d[0]);const t='tel:01655889685',o={0:['10:00','00:00'],1:null,2:null,3:['10:00','23:00'],4:['10:00','23:00'],5:['10:00','00:00'],6:['10:00','00:00']},s={0:['10:00','20:00'],1:null,2:null,3:['10:00','20:00'],4:['10:00','20:00'],5:['10:00','21:00'],6:['10:00','21:00']},u={id:'greenside',name:'The Greenside Restaurant',tagline:'Restaurant \xb7 Wood Fired Pizza \xb7 Maybole',location:'5 Greenside, Maybole, South Ayrshire KA19 7DG',address:'5 Greenside, Maybole, South Ayrshire KA19 7DG',phone:'01655 889685',email:'info@thegreensiderestaurant.co.uk',emailNeedsConfirmation:!0,website:'thegreensiderestaurant.co.uk',fictional:!1,cashOnly:!0,kitchenHours:s,venueHours:o,hoursNote:'Closed Monday and Tuesday. Venue Wednesday and Thursday 10:00\u201323:00, Friday to Sunday 10:00\u201300:00. Kitchen Wednesday, Thursday and Sunday 10:00\u201320:00; Friday and Saturday 10:00\u201321:00. Cash only.',sections:[],settings:{slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!0,bookingCoversPerSlot:0,stampTarget:8,stampReward:'',stampMinSpend:0,capacityPerHour:0,walkInShare:0,turnMins:75,orderAtTable:!1,showTakeaway:!1,shortName:'The Greenside',reserveStock:!1,tableRequests:!0,deposit:{on:!1,perPersonPence:null,fromParty:null,refundable:null,cutoffHours:null,needsConfirmation:!0,wixLinksOn:!1,policy:'Deposit policy needs confirmation. Deposits and payments are off. Requests need a manager to confirm.'}}}},4,[5]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VENUE_RID",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ISOLATED_VENUE_IDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"IS_GREENSIDE",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"GREENSIDE_UUID",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"IS_ABBOTSFORD",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"ABBOTSFORD_UUID",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"IS_KIRKTON",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"KIRKTON_UUID",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"IS_QUEUED_VENUE",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"IS_SOUTERS",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"IS_WILDINGS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"IS_KIRKMICHAEL",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"IS_ISOLATED_VENUE",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"SOUTERS_UUID",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"KIRKMICHAEL_UUID",{enumerable:!0,get:function(){return U}}),Object.defineProperty(e,"WILDINGS_UUID",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"VENUE_UUID",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"venueKey",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"venueIdentityAllowed",{enumerable:!0,get:function(){return D}});var n=r(d[0]);const t="anchorage".toLowerCase().replace(/[^a-z0-9-]/g,'')||'anchorage',c={"3idiots":"59766322-119e-4036-a18a-f6909f60a8d2",cecchinis:"596c6f7e-9797-4e16-84fe-db4a99fa1bdc",mrbasrais:"5d500571-e205-4ead-bb58-60e986b6f40e",yasmins:"f43f20ad-55d0-4008-88c8-7738dc1698df",williewastles:"6abc2793-93ab-4e23-a705-b4011a5cc011",rupeeroom:"78bff97d-5f07-440a-bb99-f6a6118da7a3",smokinggoat:"cd985ff5-2443-458d-ac8b-342d553628cf",pizzaioli:"35f870fc-772c-4aad-bb9e-09a9a16bc925",drunkencoo:"f500ef12-b405-438b-9671-e54289bec5dd",abbotsford:'24624ea5-d1e3-4182-b0d1-73402b8a1532',kirkton:'e0afad1d-cbc1-414a-add6-92e47d302139',greenside:'1bc2a056-2ef6-4585-abfd-b7d21c84f215',souters:'41ce63ca-ae46-432d-a5ba-25e1b801e64d',kirkmichael:'43c8da91-b8b8-4ce9-9ab7-f00c84c5f4f6',wildings:'47f86b36-4c99-466a-be9c-30eb3d79f1e1'},b='greenside'===t,u=c.greenside,f='abbotsford'===t,o=c.abbotsford,l='kirkton'===t,s=c.kirkton,I=(0,n.isQueuedVenue)(t),O='souters'===t,p='wildings'===t,y='kirkmichael'===t,E=Object.prototype.hasOwnProperty.call(c,t),_=c.souters,U=c.kirkmichael,S=c.wildings,j=c[t],P=n=>E?`cc-venue:${t}:${n}`:n,D=(c,b)=>!E||c===j&&b===(0,n.queuedDatabaseSlug)(t)},5,[6]); __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"queuedVenues",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"isQueuedVenue",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"queuedDatabaseSlug",{enumerable:!0,get:function(){return o}}),_e.queuedRestaurant=function(e){const t=n[e];if(!t)throw Error('Unknown venue');const s=t.kitchenSessionsByDay??t.hours.sessionsByDay,o=Object.fromEntries(Array.from({length:7},(e,t)=>[t,s?.[t]?.length?[s[t][0][0],s[t][s[t].length-1][1]]:null]));return{id:e,name:t.name,location:t.address,address:t.address,phone:t.phone||'',email:t.email||'',website:t.website||'',fictional:!1,tagline:'Restaurant',kitchenHours:o,...s?{kitchenSessionsByDay:s}:{},hoursNeedsConfirmation:!0,hoursNote:t.hours.note,sections:[],settings:{slotMinutes:15,slotCap:0,bufferMins:0,leadMins:0,takeawayPaused:!0,bookingCoversPerSlot:0,stampTarget:0,stampReward:'',stampMinSpend:0,capacityPerHour:0,walkInShare:0,turnMins:0,orderAtTable:!1,showTakeaway:!1,shortName:t.name,reserveStock:!1,tableRequests:!0,deposit:{on:!1,perPersonPence:null,fromParty:null,refundable:null,cutoffHours:null,needsConfirmation:!0,wixLinksOn:!1,policy:'Deposit terms to confirm. No payment is taken for requests.'}}}};var e,t=r(d[0]);const n=((e=t)&&e.__esModule?e:{default:e}).default,s=e=>Object.prototype.hasOwnProperty.call(n,e),o=e=>s(e)?n[e].databaseSlug:e},6,[7]); @@ -1092,7 +1092,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},1009,[34,1010]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},1010,[1007,978,1011]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},1011,[1007]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.142'},1012,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.144'},1012,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:h}=await r.select();c&&s(c,h);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},h='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,h.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),h}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),h={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:h})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},1013,[1014,1015,934,978,1010]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},1015,[978]); @@ -1193,11 +1193,11 @@ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{ __d(function(_g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.saveBookingTables=$,_e.TablePicker=function({rid:e,booking:u,name:p,turnBase:k=90,onClose:v,onSaved:w,onPickOnPlan:T}){const C=(0,b.usePlan)(e),L=(0,c.useBookings)(e),[S,W]=(0,t.useState)(()=>(0,b.tablesOf)((0,h.tableKey)((0,b.tablesOf)(u.table)))),P=(0,t.useMemo)(()=>(0,h.pickGroups)(C),[C]),z=L.filter(e=>e.date===u.date),O=(0,h.seatsOf)(C,S),D=(0,h.seatLine)(O.total,u.partySize),I=(0,h.pickClashes)(u,S,z,k),B=e=>(0,h.pickClashes)(u,[e],z,k)[0]?.with,M=(0,h.tableKey)(S)!==(0,h.tableKey)((0,b.tablesOf)(u.table)),N=(0,f.useBlocks)(e=>e.blocks),R=(0,f.blockAt)(N,e,u.date,u.time),_=e=>W(s=>(0,h.toggleTable)(s,e)),Y=async s=>{try{await $(e,u,s),w?.((0,h.savedWords)(p,u.partySize,s,(0,h.seatsOf)(C,s).total)),v()}catch(e){w?.(`Couldn\u2019t save tables for ${p}: ${String(e?.message??e).slice(0,120)}`)}},G=(0,x.jsxs)(n.default,{style:{gap:8},children:[(0,x.jsxs)(n.default,{testID:"table-pick-total",accessible:!0,accessibilityLabel:`${(0,h.tablesWords)(S)} picked. ${D.text}.`,children:[(0,x.jsx)(y.T,{size:18,weight:"semibold",colour:g.colours.goldLight,children:(0,h.tablesWords)(S)}),(0,x.jsx)(y.T,{size:17,colour:g.colours.text,children:D.text})]}),R?(0,x.jsx)(n.default,{testID:"table-pick-pause",accessible:!0,accessibilityLabel:`Note. New bookings are paused ${R.from} to ${R.to}${R.reason?` (${R.reason})`:''}. You can still assign tables to this booking.`,style:{padding:10,borderRadius:10,borderWidth:1,borderColor:g.colours.goldMuted},children:(0,x.jsxs)(y.T,{size:16,colour:g.colours.goldLight,children:["New bookings paused ",R.from,"\u2013",R.to,R.reason?` \xb7 ${R.reason}`:'',". You can still save tables for this booking."]})}):null,I.length?(0,x.jsx)(n.default,{testID:"table-pick-clash",accessible:!0,accessibilityLabel:`Warning. ${(0,h.clashWords)(I)} You can still save.`,style:{padding:10,borderRadius:10,borderWidth:1,borderColor:g.colours.gold},children:(0,x.jsxs)(y.T,{size:16,weight:"semibold",colour:g.colours.goldLight,children:[(0,h.clashWords)(I)," You can still save."]})}):null,(0,x.jsxs)(y.Row,{gap:8,wrap:!0,children:[(0,x.jsx)(y.Button,{testID:"table-pick-save",label:I.length?'Save anyway':'Save tables',disabled:!M||!S.length,accessibilityLabel:`${I.length?'Save anyway, ':'Save, '}${(0,h.tablesWords)(S)} for ${p}. ${D.text}.${I.length?` ${(0,h.clashWords)(I)}`:''}`,onPress:()=>Y(S),style:[j,{flexGrow:1}]}),(0,b.tablesOf)(u.table).length?(0,x.jsx)(y.Button,{testID:"table-pick-clear",kind:"secondary",label:"Clear table",accessibilityLabel:`Clear table, take ${(0,h.tablesWords)((0,b.tablesOf)(u.table)).toLowerCase()} off ${p}`,onPress:()=>Y([]),style:j}):null,(0,x.jsx)(y.Button,{testID:"table-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",onPress:v,style:j})]})]});return(0,x.jsxs)(y.Sheet,{visible:!0,onClose:v,title:`Tables \xb7 ${u.time} ${p} \xb7 ${u.partySize} Covers`,maxWidth:760,testID:"table-picker",footer:G,children:[(0,x.jsx)(s.TableNumberWarning,{plan:C}),(0,x.jsx)(y.T,{size:16,colour:g.colours.text,children:"Tap one table, or several to join them. Tap again to take one off."}),T?(0,x.jsx)(y.Button,{kind:"secondary",testID:"table-pick-on-plan",label:"Pick on the table plan",accessibilityLabel:`Pick on the table plan instead, for ${p}`,onPress:()=>T(S),style:j}):null,P.map(e=>(0,x.jsxs)(n.default,{style:{gap:6},accessibilityLabel:e.area,children:[(0,x.jsx)(y.T,{size:15,weight:"semibold",colour:g.colours.gold,children:e.area}),(0,x.jsx)(y.Row,{gap:8,wrap:!0,children:e.tables.map(e=>{const s=S.includes(e.name),t=B(e.name);return(0,x.jsxs)(o.default,{testID:`table-pick-${e.name}`,accessibilityRole:"checkbox",accessibilityState:{checked:s},'aria-checked':s,accessibilityLabel:(0,h.pickA11y)(e.name,e.seats,s,t),onPress:()=>_(e.name),style:({pressed:e})=>({minWidth:92,minHeight:64,paddingHorizontal:10,paddingVertical:6,borderRadius:12,alignItems:'center',justifyContent:'center',borderWidth:s?2:1,borderColor:s?g.colours.gold:t?g.colours.goldMuted:g.colours.hairline,borderStyle:t&&!s?'dashed':'solid',backgroundColor:s?g.colours.gold:e?g.colours.tilePressed:g.colours.tile}),children:[(0,x.jsx)(y.T,{size:18,weight:"semibold",colour:s?g.colours.onGold:g.colours.text,children:(0,l.tableNumbers)(e.name)}),(0,x.jsxs)(y.T,{size:14,colour:s?g.colours.onGold:g.colours.muted,children:[e.seats," seats",t?' \xb7 booked':'']})]},e.name)})})]},e.area)),P.length?null:(0,x.jsx)(y.Muted,{children:"No tables on the plan yet. Add them in Setup \u203a Table plan."})]})};var s=r(d[0]),l=r(d[1]),t=r(d[2]),o=e(r(d[3])),n=e(r(d[4])),c=r(d[5]),b=r(d[6]),u=r(d[7]),h=r(d[8]),g=r(d[9]),p=r(d[10]),y=r(d[11]),k=r(d[12]),f=r(d[13]),x=r(d[14]);const j={minHeight:56};async function $(e,s,l){const t=(0,h.tableKey)(l),o=(0,b.tablesOf)(s.table);await c.repo.bookings.update(s.id,(0,u.tablePatch)(t||null)),'seated'===s.status&&s.date===(0,p.venueYmd)(new Date)&&(o.filter(e=>!(0,b.tablesOf)(t).includes(e)).forEach(s=>b.useFloor.getState().setLive(e,s,{stage:void 0,dirty:!0})),t&&(0,k.resetTableLive)(e,t))}},1110,[1111,860,34,402,102,874,1021,1109,1112,821,858,794,1113,1018,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.TableNumberWarning=function({plan:u}){const c=(0,n.numberClashes)(u.tables),o=[...new Set([...c.acrossAreas,...u.tables.filter(n=>c.sameArea.has(n.name)).map(n.tableNumber)])];return o.length?(0,l.jsxs)(t.T,{testID:"duplicate-table-numbers",size:16,colour:s.colours.goldLight,children:["Duplicate table numbers: ",o.join(', '),". Kept unchanged. Ask a manager to check the areas before assigning."]}):null},r(d[0]);var n=r(d[1]),s=r(d[2]),t=r(d[3]),l=r(d[4])},1111,[34,859,821,794,25]); __d(function(_g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"byNum",{enumerable:!0,get:function(){return s}}),e.tableKey=o,e.toggleTable=function(t,n){return t.includes(n)?t.filter(t=>t!==n):a(o([...t,n]))},e.seatsOf=function(t,n){const a={};for(const s of n)a[s]=t.tables.find(t=>t.name===s)?.maxSeats??0;return{per:a,total:Object.values(a).reduce((t,n)=>t+n,0)}},e.seatLine=function(t,n){const a=Math.max(0,n-t);return{text:`${t} ${1===t?'seat':'seats'} for ${l(n)}${a?`: ${a} short`:''}`,short:a,fits:0===a&&t>0}},e.pickClashes=function(t,l,u,c=90){if(!l.length)return[];const f={...t,table:o(l)},b=[];for(const s of u)if(s.id!==t.id&&s.date===t.date&&!['cancelled','noshow','finished'].includes(s.status)&&(0,n.startOf)(f)<(0,n.endOf)(s,c)&&(0,n.startOf)(s)<(0,n.endOf)(f,c))for(const t of a(s.table))l.includes(t)&&b.push({table:t,with:s});return b.sort((t,n)=>s(t.table,n.table))},e.clashWords=function(n){return n.map(n=>`${(0,t.tableNumbers)(n.table)} has ${n.with.walkIn?'a walk-in':(n.with.name||'a booking').replace(' (example)','')} at ${n.with.time}`).join('. ')+(n.length?'.':'')},e.tablesWords=u,e.pickA11y=function(n,a,s,l){return`Table ${(0,t.tableNumbers)(n)}, ${a} ${1===a?'seat':'seats'}${s?', selected':''}${l?`, has ${l.walkIn?'a walk-in':l.name} at ${l.time}`:''}`},e.pickGroups=function(t){return t.areas.map(n=>({area:n.name,tables:t.tables.filter(t=>t.areaId===n.id).map(t=>({name:t.name,seats:t.maxSeats})).sort((t,n)=>s(t.name,n.name))})).filter(t=>t.tables.length)},e.savedWords=function(t,n,a,s){return a.length?`${t}, ${l(n)}: ${u(a)} (${s} seats).`:`${t}: table taken off.`},e.tableActions=function(t,n){const s=a(t.table);if(['cancelled','noshow'].includes(t.status))return[];const o=[s.length?{id:'assign',label:'Change table',a11y:`Change table for ${n}, ${l(t.partySize)}, now ${u(s).toLowerCase()}. You can pick several tables to join.`}:{id:'assign',label:'Assign table',a11y:`Assign table for ${n}, ${l(t.partySize)}. You can pick several tables to join.`}];s.length&&o.push({id:'clear',label:'Clear table',a11y:`Clear table for ${n}, take ${u(s).toLowerCase()} off this booking`});return o},e.dragTables=function(t,n,s){if(!s||'__none'===s||s===n)return null;const l=a(t);if(l.includes(s))return null;return o('__none'!==n&&l.includes(n)?l.map(t=>t===n?s:t):[s])};var t=r(d[0]),n=r(d[1]);const a=t=>t?t.split('+').map(t=>t.trim()).filter(Boolean):[],s=(t,n)=>t.localeCompare(n,'en-GB',{numeric:!0}),l=t=>`${t} ${1===t?'person':'people'}`;function o(t){return[...new Set(t.map(t=>String(t).trim()).filter(Boolean))].sort(s).join('+')}function u(n){const s=a(o(n));return s.length?(0,t.tableListNumbers)(s):'No table'}},1112,[860,1095]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return O}}),_e.useTableNames=N,_e.resetTableLive=M,_e.seatBookingNow=F,_e.finishBookingNow=async function(e,t){await f.repo.bookings.setStatus(t.id,'finished'),(0,S.tablesOf)(t.table).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=L,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return R}}),_e.TablePicker=W,_e.WalkInSheet=E,_e.WalkInMatchPrompt=H,_e.AssignTableSheet=_,_e.undoNotice=Y,_e.NewBookingSheet=U,_e.useFrontDoor=function(e,t){const[s,o]=(0,r.useState)(!1),[l,a]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>d({b:e}),combineTables:e=>d({b:e,combine:!0}),elements:(0,B.jsxs)(B.Fragment,{children:[s?(0,B.jsx)(E,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,B.jsx)(U,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,n.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,x.niceDate)((0,x.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,B.jsx)(_,{booking:i.b,combine:i.combine,onClose:()=>d(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=e(r),u=_r(_d[8]),c=e(_r(_d[9])),b=e(_r(_d[10])),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),w=_r(_d[18]),T=_r(_d[19]),S=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),D=_r(_d[23]),I=_r(_d[24]),$=_r(_d[25]),P=_r(_d[26]),z=_r(_d[27]),B=_r(_d[28]);const O=Array.from({length:12},(e,t)=>String(t+1));function N(e){const t=(0,S.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function M(e,t){(0,S.tablesOf)(t).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}async function F(e,t){await f.repo.bookings.setStatus(t.id,'seated'),M(e,t.table)}function L(e,t){const s=(0,f.useBookings)(e),o=(0,f.useOrders)(e),l=N(e),a=(0,S.useFloor)(t=>t.live[e])??{},i=(0,S.usePlan)(e),n=(0,v.useBlocks)(e=>e.blocks),r=(0,x.ymd)(t),d=(0,v.closedAreasAt)(n,e,r,(0,x.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,S.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,x.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const R=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function W({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:d}){const u=Object.keys(e),[h,p]=(0,r.useState)(0),f=i?6:8,y=i?64:o?92:76,k=h?Math.max(3,Math.floor((h+f)/(y+f))):0,x=k?Math.floor((h-f*(k-1))/k):y,w=new Set(n??[]),v=a?(0,S.tablesOf)(a)[0]:null;return(0,B.jsx)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:f},testID:"table-picker",onLayout:e=>p(Math.floor(e.nativeEvent.layout.width)),children:u.map(o=>{const a=e[o],n=t===o||!!d?.includes(o),r=w.has(o),u=v===o&&!n,h=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,B.jsxs)(c.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${d?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${r?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:x,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?j.colours.gold:a.busy?j.colours.red:j.colours.ok,backgroundColor:n?j.colours.goldTint:a.busy?j.colours.redBg:j.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,B.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,B.jsx)(T.T,{weight:"bold",size:22,colour:n?j.colours.goldLight:j.colours.text,children:(0,l.tableNumbers)(o)}),r?(0,B.jsx)(b.default,{testID:"best-table",style:{backgroundColor:j.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,B.jsx)(T.T,{size:11,weight:"bold",colour:j.colours.onGold,children:"BEST"})}):null]}),(0,B.jsx)(T.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:h})]},o)})})}const A=[1,2,3,4,5,6,7,8];function E({onClose:e,onSeated:a,wide:i,initialTable:y}){const{rid:w,r:C,now:D}=(0,p.useCtx)(15e3),I=L(w,D),[$,P]=(0,r.useState)(2),[O,N]=(0,r.useState)(!1),[R,E]=(0,r.useState)(y??null),_=(0,S.usePlan)(w),Y=(0,f.useBookings)(w),U=(0,v.useBlocks)(e=>e.blocks),q=(0,v.closedAreasAt)(U,w,(0,x.ymd)(D),(0,x.hm)(D)),Q=d.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(_,Y.filter(e=>e.date===(0,x.ymd)(D)),e,$,D,(0,k.turnFor)($,C.settings.turnMins),90,void 0,{closed:q})?.table??null},[_,Y,I,$,q.size,D.getTime()]);(0,r.useEffect)(()=>{R&&(0,S.tablesOf)(R).some(e=>'Closed'===I[e]?.label)&&E(null)},[R,q.size]);const[V,G]=(0,r.useState)(!1),[K,X]=(0,r.useState)(''),J=(e,t=String(e),s=()=>{N(!1),P(e)})=>{const o='9+'===t?O:!O&&$===e;return(0,B.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?j.colours.gold:'transparent'},children:(0,B.jsx)(T.T,{weight:"bold",size:22,colour:o?j.colours.onGold:j.colours.gold,children:t})},t)},Z=(0,B.jsx)(s.PartySizeInput,{value:$,onChange:P,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),ee=(0,B.jsxs)(b.default,{style:{gap:8,width:i?256:void 0},children:[(0,B.jsx)(T.T,{weight:"semibold",children:"How many people?"}),(0,B.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[A.map(e=>J(e)),J(9,'9+',()=>{N(!0),P(e=>e>=9?e:9)})]}),O?Z:null]}),[te,se]=(0,r.useState)(!1),[oe,le]=(0,r.useState)(null),ae=async(t=R,s=!1)=>{if(!te){if(!s){const e=(0,z.bookingsNearWalkIn)(Y,D,$);if(e.length)return void le({at:t,list:e})}se(!0);try{const s=await f.repo.bookings.seatWalkIn(w,$,t??void 0,K);M(w,t??void 0),a(s),e()}finally{se(!1)}}},ie=async(t,s)=>{if(!te){se(!0);try{const o=s??t.table??null;o&&o!==t.table&&await f.repo.bookings.assignTable(t.id,o),await F(w,{...t,table:o??void 0}),(0,n.notify)({id:`seated:${t.id}`,testID:'walkin-match-toast',timeoutMs:5e3,icon:'\u2713',title:`${t.name} seated \xb7 ${t.partySize} \xb7 ${o?(0,l.tableNumbers)(o):'table to assign'} (booking ${t.ref})`}),le(null),e()}finally{se(!1)}}},ne=(0,B.jsxs)(b.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,B.jsxs)(T.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(T.T,{weight:"semibold",children:["Table ",(0,B.jsx)(T.T,{colour:j.colours.muted,size:14,children:"(optional)"})]}),R?(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>E(null)}):null]}),(0,B.jsx)(W,{use:I,value:R,onPick:e=>{I[e]&&!I[e].busy?ae(e):E(R===e?null:e)},big:i,dense:i,best:Q,bestSet:(0,u.bestTables)(_)}),(0,B.jsxs)(T.Muted,{children:["Tap a free table to seat them there",Q&&!R?` (suggested for ${$}: ${(0,l.tableNumbers)(Q)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,x.hm)(D)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,B.jsx)(T.Button,{label:`Seat walk-in \xb7 ${$} ${1===$?'person':'people'}${R?` \xb7 ${(0,l.tableNumbers)(R)}`:''}`,disabled:te,onPress:()=>{ae()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,B.jsxs)(T.Row,{gap:16,style:{alignItems:'flex-start'},children:[ee,ne]}):(0,B.jsxs)(B.Fragment,{children:[ee,ne]}),(0,B.jsxs)(T.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[V?(0,B.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:K,onChangeText:X,style:[T.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>G(!0)}),(0,B.jsx)(b.default,{style:{flex:1,minWidth:220},children:(0,B.jsxs)(T.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==h.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]}),oe?(0,B.jsx)(H,{list:oe.list,busy:te,onYes:e=>{ie(e,oe.at)},onNo:()=>{const e=oe.at;le(null),ae(e,!0)},onClose:()=>le(null)}):null]})}function H({list:e,busy:t,onYes:s,onNo:o,onClose:a}){return(0,B.jsx)(T.Sheet,{visible:!0,onClose:a,title:"Booked party?",maxWidth:720,testID:"walkin-match",children:(0,B.jsxs)(b.default,{style:{gap:14},children:[e.map((e,o)=>(0,B.jsxs)(b.default,{testID:`walkin-match-${o}`,style:{gap:12,padding:16,borderRadius:16,borderWidth:2,borderColor:j.colours.gold,backgroundColor:'#15130F'},children:[(0,B.jsx)(b.default,{accessibilityRole:"header",accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:26,weight:"bold",colour:j.colours.goldLight,testID:"walkin-match-question",children:(0,z.walkInMatchQuestion)(e)})}),e.table?(0,B.jsxs)(T.T,{size:17,colour:j.colours.text,children:["Booked table ",(0,l.tableNumbers)(e.table)," \xb7 ",e.ref]}):(0,B.jsx)(T.T,{size:17,colour:j.colours.text,children:e.ref}),(0,B.jsx)(T.Button,{label:"Yes, seat booking",testID:"walkin-match-yes",disabled:t,accessibilityLabel:`Yes, seat ${e.name}'s booking, ${e.partySize} people`,onPress:()=>s(e),style:{minHeight:64}})]},e.id)),(0,B.jsx)(T.Button,{kind:"secondary",label:"No, new walk-in",testID:"walkin-match-no",disabled:t,onPress:o,style:{minHeight:64}})]})})}function _({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,p.useCtx)(15e3),n=L(o,i),c=(0,S.usePlan)(o),h=(0,f.useBookings)(o),y=(0,S.tablesOf)(e.table),w=d.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,y.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),v=d.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(w).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(c,h.filter(e=>e.date===(0,x.ymd)(i)),t,e.partySize,i,(0,k.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[c,h,w,e.partySize,i.getTime()]),[C,D]=(0,r.useState)(!!s||y.length>1),[I,$]=(0,r.useState)(y),P=e=>c.tables.find(t=>t.name===e)?.maxSeats??0,z=I.reduce((e,t)=>e+P(t),0),O=I.length>0&&z{const l=(0,S.joinTables)(s);await f.repo.bookings.assignTable(e.id,l);y.filter(e=>!s.includes(e)).forEach(t=>S.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&M(o,l),t()},F=C?(0,B.jsxs)(b.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,B.jsx)(b.default,{accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:17,weight:"semibold",colour:j.colours.text,children:I.length?`${(0,S.tablesLabel)((0,S.joinTables)(I))} \xb7 ${z} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,B.jsx)(b.default,{testID:"combine-short",children:(0,B.jsxs)(T.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-z," more needed. Add another table."]})}):null,(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,B.jsxs)(T.Row,{gap:8,wrap:!0,children:[(0,B.jsx)(T.Button,{label:"Done",testID:"combine-done",disabled:!I.length,accessibilityLabel:I.length?`Done, save ${(0,S.tableCardLabel)((0,S.joinTables)(I))}`:'Done',onPress:()=>N(I)}),(0,B.jsx)(T.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,B.jsx)(b.default,{style:{gap:8},testID:"assign-table-tip",children:(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`${C?'Combine tables':'Assign table'} \xb7 ${R(e)}`,testID:"assign-table-sheet",footer:F,children:[v&&!C?(0,B.jsx)(b.default,{testID:"assign-suggested",children:(0,B.jsxs)(T.T,{size:16,weight:"semibold",colour:j.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,S.tableCardLabel)(v)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(v)]})}):null,C?null:(0,B.jsx)(T.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>D(!0)}),(0,B.jsx)(W,{use:w,best:C?null:v,bestSet:(0,u.bestTables)(c),picked:C?I:void 0,onPick:C?e=>$(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await N([e])}})]})}function Y(e){(0,n.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${R(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>f.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function U({date:e,onClose:t,wide:n,onSaved:d}){const{rid:u,r:c,now:h,role:z,meId:O}=(0,p.useCtx)(6e4),N=(0,x.ymd)(h),[M,F]=(0,r.useState)(ee.blocks),[W,A]=(0,r.useState)(!1),[E,H]=(0,r.useState)(''),[_,Y]=(0,r.useState)(2),[U,q]=(0,r.useState)(null),[Q,V]=(0,r.useState)(''),[G,K]=(0,r.useState)(''),[X,J]=(0,r.useState)(''),[Z,ee]=(0,r.useState)('phone'),[te,se]=(0,r.useState)((0,D.emptyNeeds)()),oe=(0,D.needsMissing)(te),[le,ae]=(0,r.useState)(null),ie=(0,S.usePlan)(u),ne=(0,P.dogSetUp)(ie),re=!0===te.dog&&ne,de=te.dog?te.dogs:0,ue=(0,x.parseYmd)(M),ce=(0,k.turnFor)(_,c.settings.turnMins),be=L.filter(e=>e.date===M),he=e=>(0,k.freeTablesAt)(ie,be,_,new Date(`${M}${(0,l.tableNumbers)(e)}:00`),ce,c.settings.turnMins,{dog:!0,closed:(0,v.closedAreasAt)(R,u,M,e)}),ge=re&&U?he(U):[];(0,r.useEffect)(()=>{ae(null)},[re,U,_]);const pe=(0,y.bookingSlots)(c,ue,e=>L.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),_,M===(0,x.ymd)(h)?h:(0,x.addMins)(ue,0)),me=(0,w.ukPhone)(G),[fe,ye]=(0,r.useState)(!1),ke=U?pe.find(e=>e.time===U):void 0,xe=ke&&ke.left<_?{left:Math.max(0,ke.left),time:ke.time}:null,je=U?(0,v.blockAt)(R,u,M,U):void 0,we='staff'!==z,Te=!!U&&!(0,D.dogTimeOk)(c,L,M,U,de),Se=!oe.length&&E.trim().length>=2&&!!U&&(!xe||fe)&&(0,o.validParty)(_)&&me.ok&&(0,w.emailOk)(X)&&(!je||we&&W)&&(!re||ge.length>0)&&!Te,ve=te.wheelchair>0||te.stepFree;return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,x.niceDate)(ue)}`,maxWidth:n?760:void 0,testID:"booking-sheet",children:[(0,B.jsx)(D.FirstQuestions,{rid:u,value:te,onChange:se,party:_,audience:"staff"}),te.dog&&!ne?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,B.jsx)(C.BookingDatePicker,{r:c,today:h,value:M,onChange:e=>{e!==M&&(F(e),q(null),A(!1))}}),(0,B.jsxs)(T.Row,{gap:6,children:[(0,B.jsx)(T.Chip,{label:"Phone",selected:'phone'===Z,onPress:()=>ee('phone')}),(0,B.jsx)(T.Chip,{label:"In person",selected:'in-person'===Z,onPress:()=>ee('in-person')})]}),(0,B.jsx)(T.Field,{label:"Name",value:E,onChangeText:H,placeholder:"e.g. Reid",testID:"nb-name"}),(0,B.jsx)(T.Field,{label:"Mobile or phone number (needed)",value:G,onChangeText:K,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!me.ok&&G?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:me.error}):null,(0,B.jsx)(T.Field,{label:"Email (optional)",value:X,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,w.emailOk)(X)?null:(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,B.jsxs)(b.default,{style:{gap:6,alignItems:'center'},children:[(0,B.jsx)(T.T,{center:!0,children:"Covers"}),(0,B.jsx)(s.PartySizeInput,{value:_,onChange:e=>{Y(e),ye(!1)},label:"Covers",testID:"nb-party"})]}),(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:pe.map(e=>{const t=re&&e.available&&!he(e.time).length||!(0,D.dogTimeOk)(c,L,M,e.time,de);return(0,B.jsx)(T.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,v.blockAt)(R,u,M,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':e.left>0?`${e.left} left`:'Full',disabled:(e.past??!e.available)||t,selected:U===e.time,onPress:()=>{q(e.time),A(!1),ye(!1)}},e.time)})}),xe?(0,B.jsxs)(b.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overCapacityNote)(_,xe.left,xe.time)}),(0,B.jsx)(T.Chip,{label:fe?'Booking over the limit: on':'Book anyway (over the limit)',selected:fe,onPress:()=>ye(e=>!e),testID:"nb-over-ok"})]}):null,re&&U?(0,B.jsxs)(b.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,B.jsxs)(T.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,B.jsxs)(T.T,{size:13,colour:j.colours.muted,children:["(",ie.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),ge.length?(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:ge.slice(0,10).map((e,t)=>(0,B.jsx)(T.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${ve&&(0,P.accessibleSetUp)(ie)&&!(0,P.isAccessible)(ie,e.table)?' \xb7 not step-free':''}`,selected:(le??ge[0].table)===e.table,onPress:()=>ae(e.table)},e.table))}):(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["No dog-friendly table free for ",_," at ",U,". Try another time."]})]}):null,je?(0,B.jsxs)(b.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsxs)(T.T,{weight:"semibold",colour:j.colours.amber,children:["Bookings are paused ",je.from,"\u2013",je.to,je.reason?` (${je.reason})`:'']}),we?(0,B.jsx)(T.Chip,{label:W?'Manager override on':'Override and book anyway',selected:W,onPress:()=>A(e=>!e)}):(0,B.jsx)(T.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,pe.length?null:(0,B.jsx)(b.default,{testID:"nb-closed",children:(0,B.jsxs)(T.T,{size:14,weight:"semibold",colour:j.colours.amber,children:["Closed on ",(0,x.niceDate)(ue)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,B.jsx)(D.MoreQuestions,{rid:u,r:c,value:te,onChange:se,party:_,date:M,time:U,today:(0,x.ymd)(h),bookings:L,audience:"staff",showTables:!1!==c.settings.tableRequests}),ve&&!(0,P.accessibleSetUp)(ie)?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,B.jsx)(T.Field,{label:"Notes (optional)",value:Q,onChangeText:V,placeholder:I.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(c.settings),_)?(0,B.jsxs)(T.Muted,{children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(c.settings),_))," (",(0,a.gbp)((0,i.depositOf)(c.settings).perPersonPence)," per person for ",(0,i.depositOf)(c.settings).fromParty,"+). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,B.jsxs)(T.Muted,{children:["The guest gets a confirmation text",X.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Te?(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["We already have the most dogs we can look after at ",U,". Try another time: dogs are very welcome then."]}):null,(0,B.jsx)(T.Button,{label:oe.length?oe[0]:'Save booking',testID:"nb-save",disabled:!Se,onPress:()=>{if(M<(0,x.ymd)(h))return;const e=(0,D.needsPatch)(te),s=te.tableReq.find(e=>!re||ge.some(t=>t.table===e));f.repo.bookings.create({restaurantId:u,customerId:null,name:E.trim(),partySize:_,date:M,time:U,notes:Q.trim(),security:(0,i.depositDue)((0,i.depositOf)(c.settings),_)?'deposit':'none',depositPaid:0,...(0,i.depositDue)((0,i.depositOf)(c.settings),_)?{depositDue:(0,i.depositDue)((0,i.depositOf)(c.settings),_),depositPolicy:(0,i.depositWords)((0,i.depositOf)(c.settings),_,c.name).join(' '),depositRefundable:(0,i.depositOf)(c.settings).refundable,depositCutoffHours:(0,i.depositOf)(c.settings).cutoffHours}:{},phone:me.pretty,email:X.trim()||void 0,source:Z,...e,...pe.find(e=>e.time===U)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...re?{table:le??s??ge[0]?.table}:{}}).then(e=>(0,$.postNewBookingToKitchen)(e,O)).catch(()=>{}),d?.({date:M,time:U,name:E.trim()}),t()}})]})}},1113,[827,1114,1115,860,867,14,1116,34,859,402,102,872,1079,874,1117,1095,858,821,864,794,1021,1018,1118,1119,1124,1097,1091,1125,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return O}}),_e.useTableNames=N,_e.resetTableLive=M,_e.seatBookingNow=L,_e.finishBookingNow=async function(e,t){await f.repo.bookings.setStatus(t.id,'finished'),(0,S.tablesOf)(t.table).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=F,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return R}}),_e.TablePicker=W,_e.WalkInSheet=E,_e.WalkInMatchPrompt=H,_e.AssignTableSheet=_,_e.undoNotice=Y,_e.NewBookingSheet=U,_e.useFrontDoor=function(e,t){const[s,o]=(0,r.useState)(!1),[l,a]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>d({b:e}),combineTables:e=>d({b:e,combine:!0}),elements:(0,B.jsxs)(B.Fragment,{children:[s?(0,B.jsx)(E,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,B.jsx)(U,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,n.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,x.niceDate)((0,x.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,B.jsx)(_,{booking:i.b,combine:i.combine,onClose:()=>d(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=e(r),u=_r(_d[8]),c=e(_r(_d[9])),b=e(_r(_d[10])),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),w=_r(_d[18]),T=_r(_d[19]),S=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),D=_r(_d[23]),I=_r(_d[24]),$=_r(_d[25]),P=_r(_d[26]),z=_r(_d[27]),B=_r(_d[28]);const O=Array.from({length:12},(e,t)=>String(t+1));function N(e){const t=(0,S.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function M(e,t){(0,S.tablesOf)(t).forEach(t=>S.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}async function L(e,t){await f.repo.bookings.setStatus(t.id,'seated'),M(e,t.table)}function F(e,t){const s=(0,f.useBookings)(e),o=(0,f.useOrders)(e),l=N(e),a=(0,S.useFloor)(t=>t.live[e])??{},i=(0,S.usePlan)(e),n=(0,v.useBlocks)(e=>e.blocks),r=(0,x.ymd)(t),d=(0,v.closedAreasAt)(n,e,r,(0,x.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,S.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,x.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const R=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function W({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:d}){const u=Object.keys(e),[h,p]=(0,r.useState)(0),f=i?6:8,y=i?64:o?92:76,k=h?Math.max(3,Math.floor((h+f)/(y+f))):0,x=k?Math.floor((h-f*(k-1))/k):y,w=new Set(n??[]),v=a?(0,S.tablesOf)(a)[0]:null;return(0,B.jsx)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:f},testID:"table-picker",onLayout:e=>p(Math.floor(e.nativeEvent.layout.width)),children:u.map(o=>{const a=e[o],n=t===o||!!d?.includes(o),r=w.has(o),u=v===o&&!n,h=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,B.jsxs)(c.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${d?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${r?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:x,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?j.colours.gold:a.busy?j.colours.red:j.colours.ok,backgroundColor:n?j.colours.goldTint:a.busy?j.colours.redBg:j.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,B.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,B.jsx)(T.T,{weight:"bold",size:22,colour:n?j.colours.goldLight:j.colours.text,children:(0,l.tableNumbers)(o)}),r?(0,B.jsx)(b.default,{testID:"best-table",style:{backgroundColor:j.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,B.jsx)(T.T,{size:11,weight:"bold",colour:j.colours.onGold,children:"BEST"})}):null]}),(0,B.jsx)(T.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:h})]},o)})})}const A=[1,2,3,4,5,6,7,8];function E({onClose:e,onSeated:a,wide:i,initialTable:y}){const{rid:w,r:C,now:D}=(0,p.useCtx)(15e3),I=F(w,D),[$,P]=(0,r.useState)(2),[O,N]=(0,r.useState)(!1),[R,E]=(0,r.useState)(y??null),_=(0,S.usePlan)(w),Y=(0,f.useBookings)(w),U=(0,v.useBlocks)(e=>e.blocks),q=(0,v.closedAreasAt)(U,w,(0,x.ymd)(D),(0,x.hm)(D)),Q=d.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(_,Y.filter(e=>e.date===(0,x.ymd)(D)),e,$,D,(0,k.turnFor)($,C.settings.turnMins),90,void 0,{closed:q})?.table??null},[_,Y,I,$,q.size,D.getTime()]);(0,r.useEffect)(()=>{R&&(0,S.tablesOf)(R).some(e=>'Closed'===I[e]?.label)&&E(null)},[R,q.size]);const[V,G]=(0,r.useState)(!1),[K,X]=(0,r.useState)(''),J=(e,t=String(e),s=()=>{N(!1),P(e)})=>{const o='9+'===t?O:!O&&$===e;return(0,B.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?j.colours.gold:'transparent'},children:(0,B.jsx)(T.T,{weight:"bold",size:22,colour:o?j.colours.onGold:j.colours.gold,children:t})},t)},Z=(0,B.jsx)(s.PartySizeInput,{value:$,onChange:P,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),ee=(0,B.jsxs)(b.default,{style:{gap:8,width:i?256:void 0},children:[(0,B.jsx)(T.T,{weight:"semibold",children:"How many people?"}),(0,B.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[A.map(e=>J(e)),J(9,'9+',()=>{N(!0),P(e=>e>=9?e:9)})]}),O?Z:null]}),[te,se]=(0,r.useState)(!1),[oe,le]=(0,r.useState)(null),ae=async(t=R,s=!1)=>{if(!te){if(!s){const e=(0,z.bookingsNearWalkIn)(Y,D,$);if(e.length)return void le({at:t,list:e})}se(!0);try{const s=await f.repo.bookings.seatWalkIn(w,$,t??void 0,K);M(w,t??void 0),a(s),e()}finally{se(!1)}}},ie=async(t,s)=>{if(!te){se(!0);try{const o=s??t.table??null;o&&o!==t.table&&await f.repo.bookings.assignTable(t.id,o),await L(w,{...t,table:o??void 0}),(0,n.notify)({id:`seated:${t.id}`,testID:'walkin-match-toast',timeoutMs:5e3,icon:'\u2713',title:`${t.name} seated \xb7 ${t.partySize} \xb7 ${o?(0,l.tableNumbers)(o):'table to assign'} (booking ${t.ref})`}),le(null),e()}finally{se(!1)}}},ne=(0,B.jsxs)(b.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,B.jsxs)(T.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(T.T,{weight:"semibold",children:["Table ",(0,B.jsx)(T.T,{colour:j.colours.muted,size:14,children:"(optional)"})]}),R?(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>E(null)}):null]}),(0,B.jsx)(W,{use:I,value:R,onPick:e=>{I[e]&&!I[e].busy?ae(e):E(R===e?null:e)},big:i,dense:i,best:Q,bestSet:(0,u.bestTables)(_)}),(0,B.jsxs)(T.Muted,{children:["Tap a free table to seat them there",Q&&!R?` (suggested for ${$}: ${(0,l.tableNumbers)(Q)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,x.hm)(D)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,B.jsx)(T.Button,{label:`Seat walk-in \xb7 ${$} ${1===$?'person':'people'}${R?` \xb7 ${(0,l.tableNumbers)(R)}`:''}`,disabled:te,onPress:()=>{ae()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,B.jsxs)(T.Row,{gap:16,style:{alignItems:'flex-start'},children:[ee,ne]}):(0,B.jsxs)(B.Fragment,{children:[ee,ne]}),(0,B.jsxs)(T.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[V?(0,B.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:K,onChangeText:X,style:[T.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,B.jsx)(T.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>G(!0)}),(0,B.jsx)(b.default,{style:{flex:1,minWidth:220},children:(0,B.jsxs)(T.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==h.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]}),oe?(0,B.jsx)(H,{list:oe.list,busy:te,onYes:e=>{ie(e,oe.at)},onNo:()=>{const e=oe.at;le(null),ae(e,!0)},onClose:()=>le(null)}):null]})}function H({list:e,busy:t,onYes:s,onNo:o,onClose:a}){return(0,B.jsx)(T.Sheet,{visible:!0,onClose:a,title:"Booked party?",maxWidth:720,testID:"walkin-match",children:(0,B.jsxs)(b.default,{style:{gap:14},children:[e.map((e,o)=>(0,B.jsxs)(b.default,{testID:`walkin-match-${o}`,style:{gap:12,padding:16,borderRadius:16,borderWidth:2,borderColor:j.colours.gold,backgroundColor:'#15130F'},children:[(0,B.jsx)(b.default,{accessibilityRole:"header",accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:26,weight:"bold",colour:j.colours.goldLight,testID:"walkin-match-question",children:(0,z.walkInMatchQuestion)(e)})}),e.table?(0,B.jsxs)(T.T,{size:17,colour:j.colours.text,children:["Booked table ",(0,l.tableNumbers)(e.table)," \xb7 ",e.ref]}):(0,B.jsx)(T.T,{size:17,colour:j.colours.text,children:e.ref}),(0,B.jsx)(T.Button,{label:"Yes, seat booking",testID:"walkin-match-yes",disabled:t,accessibilityLabel:`Yes, seat ${e.name}'s booking, ${e.partySize} people`,onPress:()=>s(e),style:{minHeight:64}})]},e.id)),(0,B.jsx)(T.Button,{kind:"secondary",label:"No, new walk-in",testID:"walkin-match-no",disabled:t,onPress:o,style:{minHeight:64}})]})})}function _({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,p.useCtx)(15e3),n=F(o,i),c=(0,S.usePlan)(o),h=(0,f.useBookings)(o),y=(0,S.tablesOf)(e.table),w=d.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,y.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),v=d.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(w).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,k.suggestTable)(c,h.filter(e=>e.date===(0,x.ymd)(i)),t,e.partySize,i,(0,k.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[c,h,w,e.partySize,i.getTime()]),[C,D]=(0,r.useState)(!!s||y.length>1),[I,$]=(0,r.useState)(y),P=e=>c.tables.find(t=>t.name===e)?.maxSeats??0,z=I.reduce((e,t)=>e+P(t),0),O=I.length>0&&z{const l=(0,S.joinTables)(s);await f.repo.bookings.assignTable(e.id,l);y.filter(e=>!s.includes(e)).forEach(t=>S.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&M(o,l),t()},L=C?(0,B.jsxs)(b.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,B.jsx)(b.default,{accessibilityLiveRegion:"polite",children:(0,B.jsx)(T.T,{size:17,weight:"semibold",colour:j.colours.text,children:I.length?`${(0,S.tablesLabel)((0,S.joinTables)(I))} \xb7 ${z} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,B.jsx)(b.default,{testID:"combine-short",children:(0,B.jsxs)(T.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-z," more needed. Add another table."]})}):null,(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,B.jsxs)(T.Row,{gap:8,wrap:!0,children:[(0,B.jsx)(T.Button,{label:"Done",testID:"combine-done",disabled:!I.length,accessibilityLabel:I.length?`Done, save ${(0,S.tableCardLabel)((0,S.joinTables)(I))}`:'Done',onPress:()=>N(I)}),(0,B.jsx)(T.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,B.jsx)(b.default,{style:{gap:8},testID:"assign-table-tip",children:(0,B.jsx)(T.T,{size:15,colour:j.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`${C?'Combine tables':'Assign table'} \xb7 ${R(e)}`,testID:"assign-table-sheet",footer:L,children:[v&&!C?(0,B.jsx)(b.default,{testID:"assign-suggested",children:(0,B.jsxs)(T.T,{size:16,weight:"semibold",colour:j.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,S.tableCardLabel)(v)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(v)]})}):null,C?null:(0,B.jsx)(T.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>D(!0)}),(0,B.jsx)(W,{use:w,best:C?null:v,bestSet:(0,u.bestTables)(c),picked:C?I:void 0,onPick:C?e=>$(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await N([e])}})]})}function Y(e){(0,n.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${R(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>f.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function U({date:e,onClose:t,wide:n,onSaved:d}){const{rid:u,r:c,now:h,role:z,meId:O}=(0,p.useCtx)(6e4),N=(0,x.ymd)(h),[M,L]=(0,r.useState)(ee.blocks),[W,A]=(0,r.useState)(!1),[E,H]=(0,r.useState)(''),[_,Y]=(0,r.useState)(2),[U,q]=(0,r.useState)(null),[Q,V]=(0,r.useState)(''),[G,K]=(0,r.useState)(''),[X,J]=(0,r.useState)(''),[Z,ee]=(0,r.useState)('phone'),[te,se]=(0,r.useState)((0,D.emptyNeeds)()),oe=(0,D.needsMissing)(te),[le,ae]=(0,r.useState)(null),ie=(0,S.usePlan)(u),ne=(0,P.dogSetUp)(ie),re=!0===te.dog&&ne,de=te.dog?te.dogs:0,ue=(0,x.parseYmd)(M),ce=(0,k.turnFor)(_,c.settings.turnMins),be=F.filter(e=>e.date===M),he=e=>(0,k.freeTablesAt)(ie,be,_,new Date(`${M}${(0,l.tableNumbers)(e)}:00`),ce,c.settings.turnMins,{dog:!0,closed:(0,v.closedAreasAt)(R,u,M,e)}),ge=re&&U?he(U):[];(0,r.useEffect)(()=>{ae(null)},[re,U,_]);const pe=(0,y.bookingSlots)(c,ue,e=>F.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),_,M===(0,x.ymd)(h)?h:(0,x.addMins)(ue,0),e=>F.filter(t=>t.date===M&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),me=(0,w.ukPhone)(G),[fe,ye]=(0,r.useState)(!1),ke=U?pe.find(e=>e.time===U):void 0,xe=ke&&ke.left<_?{left:Math.max(0,ke.left),time:ke.time}:null,je=ke&&null!=ke.partiesLeft&&ke.partiesLeft<1?{time:ke.time,cap:ke.partiesCap??0}:null,we=xe||je,Te=U?(0,v.blockAt)(R,u,M,U):void 0,Se='staff'!==z,ve=!!U&&!(0,D.dogTimeOk)(c,F,M,U,de),Ce=!oe.length&&E.trim().length>=2&&!!U&&(!we||fe)&&(0,o.validParty)(_)&&me.ok&&(0,w.emailOk)(X)&&(!Te||Se&&W)&&(!re||ge.length>0)&&!ve,De=te.wheelchair>0||te.stepFree;return(0,B.jsxs)(T.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,x.niceDate)(ue)}`,maxWidth:n?760:void 0,testID:"booking-sheet",children:[(0,B.jsx)(D.FirstQuestions,{rid:u,value:te,onChange:se,party:_,audience:"staff"}),te.dog&&!ne?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,B.jsx)(C.BookingDatePicker,{r:c,today:h,value:M,onChange:e=>{e!==M&&(L(e),q(null),A(!1))}}),(0,B.jsxs)(T.Row,{gap:6,children:[(0,B.jsx)(T.Chip,{label:"Phone",selected:'phone'===Z,onPress:()=>ee('phone')}),(0,B.jsx)(T.Chip,{label:"In person",selected:'in-person'===Z,onPress:()=>ee('in-person')})]}),(0,B.jsx)(T.Field,{label:"Name",value:E,onChangeText:H,placeholder:"e.g. Reid",testID:"nb-name"}),(0,B.jsx)(T.Field,{label:"Mobile or phone number (needed)",value:G,onChangeText:K,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!me.ok&&G?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:me.error}):null,(0,B.jsx)(T.Field,{label:"Email (optional)",value:X,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,w.emailOk)(X)?null:(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,B.jsxs)(b.default,{style:{gap:6,alignItems:'center'},children:[(0,B.jsx)(T.T,{center:!0,children:"Covers"}),(0,B.jsx)(s.PartySizeInput,{value:_,onChange:e=>{Y(e),ye(!1)},label:"Covers",testID:"nb-party"})]}),(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:pe.map(e=>{const t=re&&e.available&&!he(e.time).length||!(0,D.dogTimeOk)(c,F,M,e.time,de);return(0,B.jsx)(T.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,v.blockAt)(R,u,M,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:U===e.time,onPress:()=>{q(e.time),A(!1),ye(!1)}},e.time)})}),we?(0,B.jsxs)(b.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[xe?(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overCapacityNote)(_,xe.left,xe.time)}):null,je?(0,B.jsx)(T.T,{weight:"semibold",colour:j.colours.amber,children:(0,o.overPartiesNote)(je.time,je.cap)}):null,(0,B.jsx)(T.Chip,{label:fe?'Booking over the limit: on':'Book anyway (over the limit)',selected:fe,onPress:()=>ye(e=>!e),testID:"nb-over-ok"})]}):null,re&&U?(0,B.jsxs)(b.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,B.jsxs)(T.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,B.jsxs)(T.T,{size:13,colour:j.colours.muted,children:["(",ie.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),ge.length?(0,B.jsx)(T.Row,{wrap:!0,gap:6,children:ge.slice(0,10).map((e,t)=>(0,B.jsx)(T.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${De&&(0,P.accessibleSetUp)(ie)&&!(0,P.isAccessible)(ie,e.table)?' \xb7 not step-free':''}`,selected:(le??ge[0].table)===e.table,onPress:()=>ae(e.table)},e.table))}):(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["No dog-friendly table free for ",_," at ",U,". Try another time."]})]}):null,Te?(0,B.jsxs)(b.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:j.colours.amber,backgroundColor:j.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,B.jsxs)(T.T,{weight:"semibold",colour:j.colours.amber,children:["Bookings are paused ",Te.from,"\u2013",Te.to,Te.reason?` (${Te.reason})`:'']}),Se?(0,B.jsx)(T.Chip,{label:W?'Manager override on':'Override and book anyway',selected:W,onPress:()=>A(e=>!e)}):(0,B.jsx)(T.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,pe.length?null:(0,B.jsx)(b.default,{testID:"nb-closed",children:(0,B.jsxs)(T.T,{size:14,weight:"semibold",colour:j.colours.amber,children:["Closed on ",(0,x.niceDate)(ue)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,B.jsx)(D.MoreQuestions,{rid:u,r:c,value:te,onChange:se,party:_,date:M,time:U,today:(0,x.ymd)(h),bookings:F,audience:"staff",showTables:!1!==c.settings.tableRequests}),De&&!(0,P.accessibleSetUp)(ie)?(0,B.jsx)(T.T,{size:13,colour:j.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,B.jsx)(T.Field,{label:"Notes (optional)",value:Q,onChangeText:V,placeholder:I.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(c.settings),_)?(0,B.jsxs)(T.Muted,{children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(c.settings),_))," (",(0,a.gbp)((0,i.depositOf)(c.settings).perPersonPence)," per person for ",(0,i.depositOf)(c.settings).fromParty,"+). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,B.jsxs)(T.Muted,{children:["The guest gets a confirmation text",X.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),ve?(0,B.jsxs)(T.T,{size:14,colour:j.colours.amber,children:["We already have the most dogs we can look after at ",U,". Try another time: dogs are very welcome then."]}):null,(0,B.jsx)(T.Button,{label:oe.length?oe[0]:'Save booking',testID:"nb-save",disabled:!Ce,onPress:()=>{if(M<(0,x.ymd)(h))return;const e=(0,D.needsPatch)(te),s=te.tableReq.find(e=>!re||ge.some(t=>t.table===e));f.repo.bookings.create({restaurantId:u,customerId:null,name:E.trim(),partySize:_,date:M,time:U,notes:Q.trim(),security:(0,i.depositDue)((0,i.depositOf)(c.settings),_)?'deposit':'none',depositPaid:0,...(0,i.depositDue)((0,i.depositOf)(c.settings),_)?{depositDue:(0,i.depositDue)((0,i.depositOf)(c.settings),_),depositPolicy:(0,i.depositWords)((0,i.depositOf)(c.settings),_,c.name).join(' '),depositRefundable:(0,i.depositOf)(c.settings).refundable,depositCutoffHours:(0,i.depositOf)(c.settings).cutoffHours}:{},phone:me.pretty,email:X.trim()||void 0,source:Z,...e,...pe.find(e=>e.time===U)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...re?{table:le??s??ge[0]?.table}:{}}).then(e=>(0,$.postNewBookingToKitchen)(e,O)).catch(()=>{}),d?.({date:M,time:U,name:E.trim()}),t()}})]})}},1113,[827,1114,1115,860,867,14,1116,34,859,402,102,872,1079,874,1117,1095,858,821,864,794,1021,1018,1118,1119,1124,1097,1091,1125,25]); __d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PartySizeInput=function({value:e,onChange:p,min:b=s.MIN_PARTY,max:y=s.MAX_PARTY,label:f="Party size",testID:h="party-size"}){const[x,$]=(0,t.useState)(String(e));(0,t.useEffect)(()=>{$(String(e))},[e]);const w=e=>p((0,s.clampParty)(e,b,y)),I=(t,n,l)=>{const s=t<0?e<=b:e>=y;return(0,d.jsx)(o.default,{testID:`${h}-${t>0?'up':'down'}${10===Math.abs(t)?'10':''}`,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:s},disabled:s,onPress:()=>w(e+t),hitSlop:4,style:{minWidth:44,height:44,paddingHorizontal:8,borderRadius:22,borderWidth:1.5,borderColor:c.colours.gold,alignItems:'center',justifyContent:'center',opacity:s?.4:1},children:(0,d.jsx)(u.T,{size:10===Math.abs(t)?14:20,weight:"semibold",colour:c.colours.gold,center:!0,children:n})},t)};return(0,d.jsxs)(l.default,{testID:h,style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap',justifyContent:'center'},children:[y-b>=20?I(-10,'\u221210',"10 fewer people"):null,I(-1,'\u2212','One fewer person'),(0,d.jsx)(n.default,{testID:`${h}-input`,value:x,keyboardType:"number-pad",inputMode:"numeric",maxLength:3,selectTextOnFocus:!0,accessibilityLabel:`${f}, ${b} to ${y} people`,accessibilityValue:{min:b,max:y,now:e,text:`${e} ${1===e?'person':'people'}`},onChangeText:e=>{$(e.replace(/\D/g,'')),e.replace(/\D/g,'')&&w((0,s.partyFromText)(e,b,y))},onBlur:()=>{const e=(0,s.partyFromText)(x,b,y);$(String(e)),w(e)},style:{width:64,height:44,borderRadius:10,borderWidth:1,borderColor:c.colours.border,color:c.colours.text,backgroundColor:c.colours.surface,textAlign:'center',fontSize:20,fontFamily:c.fonts.semibold}}),I(1,'+','One more person'),y-b>=20?I(10,'+10',"10 more people"):null]})};var t=r(_d[0]),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),s=r(_d[4]),c=r(_d[5]),u=r(_d[6]),d=r(_d[7])},1114,[34,402,412,102,1115,821,794,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const f=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(f)?f:u))},f=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),b=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`},1115,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overPartiesNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const s=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(s)?s:u))},s=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),f=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`,b=(t,n)=>`${t} already has the most bookings we take at one start time (${n}). Booking another goes over the venue\u2019s limit: check tables and staffing.`},1115,[]); __d(function(g,r,i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"dismissNotice",{enumerable:!0,get:function(){return u.dismissNotice}}),Object.defineProperty(_e,"notify",{enumerable:!0,get:function(){return u.notify}}),Object.defineProperty(_e,"useSliders",{enumerable:!0,get:function(){return u.useSliders}}),Object.defineProperty(_e,"SLIDER",{enumerable:!0,get:function(){return j}}),_e.SliderButton=k,_e.SliderCard=C,_e.SliderHost=function(){y();const e=(0,u.useSliders)(e=>e.queue),n=e[0],o=(0,t.useRef)(null);(0,t.useEffect)(()=>{if(p)return window.ccSlider=e=>(0,u.notify)(e),()=>{delete window.ccSlider}},[]),(0,t.useEffect)(()=>{if(o.current&&clearTimeout(o.current),!n)return;const e=void 0!==n.timeoutMs?n.timeoutMs:n.actions?.length||n.content?null:6e3;return e&&(o.current=setTimeout(()=>u.useSliders.getState().dismiss(n.id),e)),()=>{o.current&&clearTimeout(o.current)}},[n?.id,n?.timeoutMs]);const[l,c]=(0,t.useState)(0);if((0,t.useEffect)(()=>{if(!p||!n)return;const e=()=>{const e=document.querySelector('[data-testid="app-bottom-tabs"]');c(e?Math.max(0,Math.round(window.innerHeight-e.getBoundingClientRect().top)):0)};e();const t=setTimeout(e,300);return window.addEventListener('resize',e),()=>{clearTimeout(t),window.removeEventListener('resize',e)}},[n?.id]),!n)return null;const a=p?'fixed':'absolute';return(0,f.jsxs)(f.Fragment,{children:[n.modal?(0,f.jsx)(s.default,{...x('dim'),style:{position:a,left:0,right:0,top:0,bottom:0,zIndex:2147482990,backgroundColor:'rgba(0,0,0,0.72)'}}):null,(0,f.jsx)(s.default,{testID:"cc-slider-host",pointerEvents:"box-none",style:{position:a,left:12,right:12,bottom:12,zIndex:2147483e3,alignItems:'center',...p?{bottom:l?`${12+l}px`:'calc(12px + env(safe-area-inset-bottom))'}:{}},children:(0,f.jsx)(C,{n:n,waiting:e.length-1,onClose:()=>u.useSliders.getState().dismiss(n.id)},n.id+':'+(n.seq??0))})]})};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),s=e(r(d[4])),l=e(r(d[5])),c=r(d[6]),a=r(d[7]),u=r(d[8]),b=r(d[9]),f=r(d[10]);const p='undefined'!=typeof document,h="\n[data-ccsl=\"in\"]{animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both}\n@keyframes ccsl-in{from{opacity:0;transform:translate3d(0,110%,0)}to{opacity:1;transform:none}}\n[data-ccsl=\"urgent\"]{animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both,ccsl-red 1.6s ease-in-out .45s infinite}\n@keyframes ccsl-red{0%,100%{box-shadow:0 10px 30px rgba(0,0,0,.6),0 0 0 1px rgba(255,107,94,.55)}50%{box-shadow:0 10px 40px rgba(0,0,0,.6),0 0 0 2px #FF6B5E,0 0 34px rgba(255,107,94,.45)}}\n[data-ccsl=\"dim\"]{animation:ccsl-dim .3s ease both}\n@keyframes ccsl-dim{from{opacity:0}to{opacity:1}}\n@media (prefers-reduced-motion: reduce){[data-ccsl]{animation:none !important}}\n",x=e=>p?{dataSet:{ccsl:e}}:{};function y(){(0,t.useEffect)(()=>{if(!p||document.getElementById('cc-slider-css'))return;const e=document.createElement('style');e.id='cc-slider-css',e.textContent=h,document.head.appendChild(e)},[])}const j={bg:'#17140F',border:'rgba(207,164,95,.55)',text:'#F5F1E8',quiet:'#A89A80',gold:c.colours.gold,ink:'#17130D'},w=(e="normal")=>'urgent'===e?c.colours.red:'warn'===e?c.colours.amber:c.colours.gold,S=(e="normal")=>'urgent'===e?'rgba(255,107,94,.75)':'warn'===e?'rgba(255,181,71,.65)':j.border;function k({a:e,onDone:t,big:o}){const s=e.kind??'primary';return(0,f.jsx)(n.default,{testID:e.testID,accessibilityRole:"button",accessibilityLabel:e.label,onPress:()=>{try{e.onPress?.()}finally{e.keepOpen||t()}},style:({pressed:e})=>({minHeight:o?56:44,minWidth:44,paddingHorizontal:'ghost'===s?10:o?24:18,borderRadius:12,alignItems:'center',justifyContent:'center',backgroundColor:'primary'===s?j.gold:'transparent',borderWidth:'danger'===s?1:0,borderColor:c.colours.red,opacity:e?.8:1}),children:(0,f.jsx)(a.T,{size:o?18:'ghost'===s?14:15,weight:'primary'===s?'bold':'medium',colour:'primary'===s?j.ink:'danger'===s?c.colours.red:j.quiet,children:e.label})})}function C({n:e,onClose:t,waiting:n=0,maxWidth:c=520}){y();const u=e.tone??'normal',h=w(u),C=e.content,z=!!e.big,{height:I}=(0,l.default)(),D=e.actions??[];return(0,f.jsxs)(s.default,{testID:e.testID??'cc-slider',accessibilityRole:"summary",accessibilityLabel:`${e.kicker?e.kicker+': ':''}${e.title}`,...x('urgent'===u?'urgent':'in'),style:{width:'100%',maxWidth:z?Math.max(c,900):c,alignSelf:'center',borderRadius:14,backgroundColor:j.bg,borderWidth:1,borderColor:S(u),overflow:'hidden',...p?{boxShadow:'0 10px 30px rgba(0,0,0,.6)'}:{elevation:12}},children:['normal'!==u?(0,f.jsx)(s.default,{style:{position:'absolute',left:0,top:0,bottom:0,width:5,backgroundColor:h}}):null,(0,f.jsxs)(o.default,{style:{maxHeight:Math.max(220,I-40)},contentContainerStyle:{paddingVertical:z?18:12,paddingLeft:'normal'!==u?z?24:18:z?20:14,paddingRight:z?20:14,gap:z?10:6},children:[(0,f.jsxs)(s.default,{style:{flexDirection:'row',alignItems:'center',gap:12},children:[e.icon?(0,f.jsx)(a.T,{size:z?34:22,children:e.icon}):null,(0,f.jsxs)(s.default,{style:{flex:1,gap:2},children:[e.kicker?(0,f.jsx)(a.T,{size:z?15:11,weight:"bold",colour:h,style:{letterSpacing:1.4},children:e.kicker}):null,(0,f.jsx)(a.T,{size:z?24:15,weight:"medium",colour:j.text,children:e.title}),e.body?(0,f.jsx)(a.T,{size:z?18:13,colour:j.quiet,children:e.body}):null]}),D.length||C?null:(0,f.jsx)(b.ToastClose,{testID:"cc-slider-ok",label:`Close: ${e.title}`,onPress:t,size:z?'lg':'md',colour:j.quiet})]}),C?(0,f.jsx)(C,{close:t}):null,D.length?(0,f.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',alignItems:'center',gap:8,justifyContent:'flex-end'},children:D.map(e=>(0,f.jsx)(k,{a:e,onDone:t,big:z},e.label))}):null,n>0?(0,f.jsxs)(a.T,{size:z?14:11,colour:j.quiet,center:!0,style:{alignSelf:'stretch'},children:[n," more waiting"]}):null]})]})}},1116,[34,236,402,295,102,426,821,794,998,796,25]); -__d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.bookingSlotMinutesOf=s,Object.defineProperty(e,"COVERS_WINDOW_MINS",{enumerable:!0,get:function(){return r}}),e.coversInHalfHour=l,e.takeawaySlots=function(o,s,r){const l=(0,t.hoursFor)(o,r);if(!l)return[];const u=o.settings.slotMinutes,c=(0,n.addMins)(r,o.settings.leadMins),f=[];for(let t=new Date(l.open);t<=l.close;t=(0,n.addMins)(t,u)){if(tn.restaurantId===o.id&&'takeaway'===n.type&&'cancelled'!==n.status&&n.slotTime&&new Date(n.slotTime).getTime()===t.getTime()).length;f.push({time:new Date(t),label:(0,n.hm)(t),taken:r,cap:o.settings.slotCap,full:r>=o.settings.slotCap})}return f},e.bookingSlots=function(r,c,f,d,m){const p=(0,t.hoursFor)(r,c);if(!p)return[];const M=[],S=p.close,b=(0,o.lastFoodOn)(r,u(c)),h=b?(0,n.atTime)(c,b.time):S,k='drinks'===(0,o.afterLastFood)(r),O=s(r);for(let t=new Date(p.open);t<=S;t=(0,n.addMins)(t,O)){const o=(0,n.hm)(t),s=t>h;if(s&&!k)continue;const u=r.settings.bookingCoversPerSlot-l(f,o),c=t.getTime()=d,past:c,...s?{drinksOnly:!0}:{}})}return M};var t=_r(_d[0]),n=_r(_d[1]),o=_r(_d[2]);function s(t){const n=t.settings.bookingSlotMinutes;return 5===n||10===n||15===n||20===n||30===n?n:15}const r=30;function l(t,o){const s=Math.floor((0,n.toMins)(o)/r)*r;let l=0;for(let o=0;o`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},1117,[878,858,877]); +__d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.bookingSlotMinutesOf=s,e.bookingNoticeMinsOf=r,e.bookingCoversPerStartOf=u,e.bookingPartiesPerStartOf=l,e.onlinePartyBounds=c,Object.defineProperty(e,"COVERS_WINDOW_MINS",{enumerable:!0,get:function(){return f}}),e.coversInHalfHour=m,e.countInStartSlot=p,e.bookingLimitsHint=function(t){const n=s(t),o=u(t),f=l(t),m=r(t),p=c(t);if(null!=o||null!=f){const t=[];return null!=o&&null!=f?t.push(`up to ${o} people and ${f} bookings at each start time`):null!=o?t.push(`up to ${o} people at each start time`):t.push(`up to ${f} bookings at each start time`),(p.max<100||p.min>1)&&t.push(`parties of ${p.min} to ${p.max}`),t.push(`from ${m} minutes ahead`),t.push('table rules still apply'),`Times are every ${n} minutes: ${t.join(', ')}.`}return`Times are every ${n} minutes. Covers per slot (${t.settings.bookingCoversPerSlot} per half hour) and table rules still apply.`},e.takeawaySlots=function(o,s,r){const u=(0,t.hoursFor)(o,r);if(!u)return[];const l=o.settings.slotMinutes,c=(0,n.addMins)(r,o.settings.leadMins),f=[];for(let t=new Date(u.open);t<=u.close;t=(0,n.addMins)(t,l)){if(tn.restaurantId===o.id&&'takeaway'===n.type&&'cancelled'!==n.status&&n.slotTime&&new Date(n.slotTime).getTime()===t.getTime()).length;f.push({time:new Date(t),label:(0,n.hm)(t),taken:r,cap:o.settings.slotCap,full:r>=o.settings.slotCap})}return f},e.bookingSlots=function(c,f,d,h,k,M=()=>0){const y=(0,t.hoursFor)(c,f);if(!y)return[];const S=[],$=y.close,P=(0,o.lastFoodOn)(c,b(f)),v=P?(0,n.atTime)(f,P.time):$,I='drinks'===(0,o.afterLastFood)(c),O=s(c),C=r(c),N=u(c),T=l(c);for(let t=new Date(y.open);t<=$;t=(0,n.addMins)(t,O)){const o=(0,n.hm)(t),s=t>v;if(s&&!I)continue;const r=null!=N?p(d,o,O):m(d,o),u=(N??c.settings.bookingCoversPerSlot)-r,l=null!=T?p(M,o,O):0,f=null!=T?T-l:void 0,b=t.getTime()=1;S.push({time:o,left:u,available:!b&&u>=h&&y,past:b,...s?{drinksOnly:!0}:{},...null!=f?{partiesLeft:f,partiesCap:T}:{}})}return S};var t=_r(_d[0]),n=_r(_d[1]),o=_r(_d[2]);function s(t){const n=t.settings.bookingSlotMinutes;return 5===n||10===n||15===n||20===n||30===n?n:15}function r(t){const n=t.settings.bookingNoticeMins;return'number'==typeof n&&Number.isInteger(n)&&n>=0&&n<=1440?n:30}function u(t){const n=t.settings.bookingCoversPerStart;return'number'==typeof n&&Number.isInteger(n)&&n>0&&n<=200?n:null}function l(t){const n=t.settings.bookingPartiesPerStart;return'number'==typeof n&&Number.isInteger(n)&&n>0&&n<=50?n:null}function c(t){const n=t.settings.onlinePartyMin,o=t.settings.onlinePartyMax,s='number'==typeof n&&Number.isInteger(n)&&n>=1&&n<=100?n:1;return{min:s,max:'number'==typeof o&&Number.isInteger(o)&&o>=s&&o<=100?o:100}}const f=30;function m(t,o){const s=Math.floor((0,n.toMins)(o)/f)*f;let r=0;for(let o=0;o`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},1117,[878,858,877]); __d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.nextDays=c,Object.defineProperty(_e,"openOn",{enumerable:!0,get:function(){return u}}),_e.BookingDatePicker=function({r:e,today:l,value:b,onChange:m}){const[f,x]=(0,t.useState)(!1),p=(0,r.ymd)(l),j=c(l,9),D=(e,t)=>0===t?'Today':1===t?'Tomorrow':`${(0,r.dayShort)(e)} ${e.getDate()}`,w=j.some(e=>(0,r.ymd)(e)===b),C=(0,r.parseYmd)(b),[P,T]=(0,t.useState)(()=>({y:C.getFullYear(),m:C.getMonth()})),v=(new Date(P.y,P.m,1,12).getDay()+6)%7,M=new Date(P.y,P.m+1,0).getDate(),R=[...Array.from({length:v},()=>null),...Array.from({length:M},(e,t)=>new Date(P.y,P.m,t+1,12))];for(;R.length%7;)R.push(null);const k=12*(P.y-l.getFullYear())+P.m-l.getMonth(),F=e=>T(({y:t,m:o})=>{const s=new Date(t,o+e,1);return{y:s.getFullYear(),m:s.getMonth()}});return(0,i.jsxs)(s.default,{testID:"nb-date",style:{gap:6},children:[(0,i.jsxs)(d.Row,{wrap:!0,gap:6,children:[j.map((t,o)=>(0,i.jsx)(d.Chip,{label:D(t,o),sub:u(e,t)?void 0:'Closed',selected:b===(0,r.ymd)(t),onPress:()=>{m((0,r.ymd)(t)),x(!1)}},(0,r.ymd)(t))),w?null:(0,i.jsx)(d.Chip,{label:(0,r.niceDate)(C),sub:u(e,C)?void 0:'Closed',selected:!0,onPress:()=>x(!0)}),(0,i.jsx)(d.Chip,{label:f?'Close calendar':'\ud83d\udcc5 Pick date',selected:f,onPress:()=>{f||T({y:C.getFullYear(),m:C.getMonth()}),x(!f)}})]}),f?(0,i.jsxs)(s.default,{testID:"nb-calendar",style:{borderWidth:1,borderColor:n.colours.border,borderRadius:14,padding:10,gap:6,backgroundColor:n.colours.surface2,maxWidth:420},children:[(0,i.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,i.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Previous month",disabled:k<=0,onPress:()=>F(-1),style:{padding:8,opacity:k<=0?.3:1},children:(0,i.jsx)(d.T,{size:20,colour:n.colours.gold,children:"\u2039"})}),(0,i.jsxs)(d.T,{weight:"semibold",children:[(0,r.monthLong)(P.m)," ",P.y]}),(0,i.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Next month",disabled:k>=h,onPress:()=>F(1),style:{padding:8,opacity:k>=h?.3:1},children:(0,i.jsx)(d.T,{size:20,colour:n.colours.gold,children:"\u203a"})})]}),(0,i.jsx)(s.default,{style:{flexDirection:'row'},children:y.map(e=>(0,i.jsx)(d.T,{size:12,colour:n.colours.muted,center:!0,style:{flex:1},children:e},e))}),Array.from({length:R.length/7},(t,l)=>(0,i.jsx)(s.default,{style:{flexDirection:'row',gap:4},children:R.slice(7*l,7*l+7).map((t,l)=>{if(!t)return(0,i.jsx)(s.default,{style:{flex:1,height:40}},l);const c=(0,r.ymd)(t),y=c{m(c),x(!1)},style:{flex:1,height:40,borderRadius:10,alignItems:'center',justifyContent:'center',borderWidth:c===p?1.5:0,borderColor:n.colours.gold,backgroundColor:h?n.colours.gold:'transparent',opacity:y?.3:1},children:(0,i.jsx)(d.T,{size:15,weight:h?'bold':'regular',colour:h?n.colours.onGold:f?n.colours.muted:n.colours.text,style:f&&!y?{textDecorationLine:'line-through'}:void 0,children:t.getDate()})},l)})},l)),(0,i.jsx)(d.Muted,{children:"Past dates can\u2019t be booked. Crossed-out days: closed (per the venue\u2019s hours)."})]}):null]})};var t=_r(_d[0]),o=e(_r(_d[1])),s=e(_r(_d[2])),l=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),d=_r(_d[6]),i=_r(_d[7]);function c(e,t){const o=new Date(e);return o.setHours(12,0,0,0),Array.from({length:t},(e,t)=>{const s=new Date(o);return s.setDate(o.getDate()+t),s})}const u=(e,t)=>!!(0,l.hoursFor)(e,t),y=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],h=12},1118,[34,402,102,878,858,821,794,25]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"emptyNeeds",{enumerable:!0,get:function(){return w}}),_e.needsMissing=function(e,l=[]){const s=[];null===e.allergy?s.push('Answer the allergy question first'):'yes'!==e.allergy||e.allergens.length||l.length||e.allergyNote.trim()||s.push('Pick the allergens or describe them');null===e.dog&&s.push('Say whether a dog is coming');return s},_e.needsPatch=function(e,l=[]){const s='yes'===e.allergy?e.allergens.filter(e=>!l.some(l=>l.allergen===e)).map(l=>({allergen:l,severity:e.severity})):[],t=Object.entries(e.holds).filter(([,e])=>e>0).map(([e,l])=>({kind:e.startsWith('item:')?'item':'stock',id:e.slice(5),qty:l})),a=e.dog?Math.max(1,e.dogs):0,n={...e.wheelchair?{wheelchair:e.wheelchair}:{},...e.stepFree?{stepFree:!0}:{},...e.toilet?{toilet:!0}:{},...e.assistDog?{assistDog:!0}:{},...e.accessNote.trim()?{note:e.accessNote.trim()}:{}},r={...e.vegan?{vegan:e.vegan}:{},...e.vegetarian?{vegetarian:e.vegetarian}:{}};return{allergies:[...l,...s],allergyNone:'none'===e.allergy&&!l.length||void 0,allergyPeople:'yes'===e.allergy?e.allergyPeople:void 0,allergyNote:'yes'===e.allergy&&e.allergyNote.trim()?e.allergyNote.trim():void 0,dog:a>0,dogs:a||void 0,access:Object.keys(n).length?n:void 0,diet:Object.keys(r).length?r:void 0,holds:t.length?t:void 0,tableReq:e.tableReq.length?e.tableReq:void 0}},_e.FirstQuestions=function({rid:e,value:l,onChange:a,party:r,audience:i,profile:o=[]}){const y=e=>a({...l,...e}),b=(0,p.usePlan)(e),[x,j]=(0,t.useState)(!1),k=(0,s.dogQuestionOn)((0,u.useRestaurant)(e));(0,t.useEffect)(()=>{k||null!==l.dog||a({...l,dog:!1})},[k,l.dog]);const w=x?m.ALLERGENS:m.ALLERGENS.filter(e=>['gluten','milk','peanuts','treenuts','crustaceans','molluscs','fish','eggs','sesame'].includes(e.id)||l.allergens.includes(e.id)),q=[...o.map(e=>e.allergen),...l.allergens],M=(0,f.dogSetUp)(b);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(R,{tone:"red",testID:"q-allergens",children:[(0,v.jsx)(C,{sub:'guest'===i?'We ask everyone first, so the kitchen can keep you safe.':'Ask every guest first. It goes to the kitchen in red.',children:"\u26a0\ufe0f Does anyone in the party have a food allergy?"}),o.length?(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:o.map(e=>(0,v.jsx)(h.Badge,{kind:"red",label:`${m.ALLERGENS.find(l=>l.id===e.allergen)?.short} (from your profile)`},e.allergen))}):null,(0,v.jsxs)(h.Row,{gap:8,children:[(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"No allergies",selected:'none'===l.allergy,onPress:()=>y({allergy:'none',allergens:[]})})}),(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"Yes, allergies",selected:'yes'===l.allergy,onPress:()=>y({allergy:'yes'})})})]}),'none'===l.allergy&&o.length?(0,v.jsx)(h.Muted,{children:"Your profile allergies above are still shared with the kitchen."}):null,'yes'===l.allergy?(0,v.jsxs)(n.default,{style:{gap:10},testID:"allergen-picker",children:[(0,v.jsx)(h.T,{size:14,weight:"semibold",children:"Which allergens? (the 14 UK allergens)"}),(0,v.jsxs)(h.Row,{wrap:!0,gap:6,children:[w.map(e=>(0,v.jsx)(h.Chip,{label:e.short,selected:l.allergens.includes(e.id)||o.some(l=>l.allergen===e.id),disabled:o.some(l=>l.allergen===e.id),onPress:()=>y({allergens:l.allergens.includes(e.id)?l.allergens.filter(l=>l!==e.id):[...l.allergens,e.id]})},e.id)),x?null:(0,v.jsx)(h.Chip,{label:"All 14\u2026",onPress:()=>j(!0)})]}),(0,v.jsx)(h.T,{size:14,weight:"semibold",children:"How serious?"}),(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:m.SEVERITIES.map(e=>(0,v.jsx)(h.Chip,{label:e.label,selected:l.severity===e.id,onPress:()=>y({severity:e.id})},e.id))}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"How many people with allergies?"}),(0,v.jsx)(h.Stepper,{value:Math.min(l.allergyPeople,r),onChange:e=>y({allergyPeople:e}),min:1,max:Math.max(1,r),label:"people with allergies"})]}),(0,v.jsx)(h.Field,{label:"Anything else the kitchen should know? (optional)",value:l.allergyNote,onChangeText:e=>y({allergyNote:e}),placeholder:"e.g. traces of sesame, one child with coeliac disease",testID:"allergy-note"}),q.length?(0,v.jsx)(c.MenuAllergyCheck,{rid:e,allergens:q,audience:i}):null]}):null]}),k?(0,v.jsxs)(R,{tone:"gold",testID:"q-dogs",children:[(0,v.jsx)(C,{sub:M?'Well-behaved dogs are welcome at our dog-friendly tables.':'staff'===i?'Dog-friendly tables aren\u2019t marked yet (Managers \u203a Booking options), so any table is offered for now.':void 0,children:"\ud83d\udc15 Are you bringing a dog?"}),(0,v.jsxs)(h.Row,{gap:8,children:[(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"No",selected:!1===l.dog,onPress:()=>y({dog:!1})})}),(0,v.jsx)(n.default,{style:{flex:1},children:(0,v.jsx)(h.Chip,{label:"Yes",selected:!0===l.dog,onPress:()=>y({dog:!0,dogs:Math.max(1,l.dogs)})})})]}),l.dog?(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"How many dogs?"}),(0,v.jsx)(h.Stepper,{value:l.dogs,onChange:e=>y({dogs:e}),min:1,max:4,label:"dogs"})]}):null]}):null]})},_e.useReserveAvailability=q,_e.MoreQuestions=function({rid:e,r:l,value:a,onChange:r,party:i,date:o,time:c,today:y,bookings:m,audience:b,showTables:x}){const j=e=>r({...a,...e}),w=l.settings,S=(0,u.useMenu)(e),P=(0,t.useMemo)(()=>S.filter(e=>/\((V|VG|Ve)\)|vegan|vegetarian/i.test(`${e.name} ${e.tags?.join(' ')??''}`)).slice(0,4),[S.length]),N=q(e,l,o,y,m,b),T=e=>a.holds[e]??0,D=(0,f.stockNeed)({holds:Object.entries(a.holds).map(([e,l])=>({kind:e.startsWith('item:')?'item':'stock',id:e.slice(5),qty:l}))},N.items),$=(e,l)=>Math.min(10,...e.map(e=>{const s=(D[e.key]??0)-T(l)*e.qty;return Math.floor(((N.free[e.key]??0)-s)/e.qty)})),I=(e,l,s,t)=>{const r=T(e),i=t<=0&&0===r;return(0,v.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:10,opacity:i?.55:1},testID:`reserve-${e.replace(':','-')}`,children:[(0,v.jsxs)(n.default,{style:{flex:1,minWidth:0},children:[(0,v.jsx)(h.T,{weight:"semibold",children:l}),(0,v.jsx)(h.Muted,{children:i?'Unavailable \u2014 none left for this day':s})]}),i?(0,v.jsx)(h.Badge,{kind:"neutral",label:"Unavailable"}):(0,v.jsx)(h.Stepper,{value:r,onChange:l=>j({holds:{...a.holds,[e]:Math.max(0,Math.min(l,Math.max(r,t)))}}),min:0,max:Math.max(r,Math.min(10,t)),label:l})]},e)},A=N.items.length>0||!1!==w.reserveStock&&N.stock.length>0,O=(0,p.usePlan)(e);return(0,v.jsxs)(v.Fragment,{children:[(0,s.accessQuestionOn)(l)?(0,v.jsxs)(R,{tone:"plain",testID:"q-access",children:[(0,v.jsx)(C,{sub:"Optional. Tell us and we\u2019ll have the right table ready.",children:"\u267f Access needs"}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Wheelchair users"}),(0,v.jsx)(h.Stepper,{value:a.wheelchair,onChange:e=>j({wheelchair:e}),min:0,max:Math.max(1,i),label:"wheelchair users"})]}),(0,v.jsxs)(h.Row,{wrap:!0,gap:6,children:[(0,v.jsx)(h.Chip,{label:"Step-free access",selected:a.stepFree,onPress:()=>j({stepFree:!a.stepFree})}),(0,v.jsx)(h.Chip,{label:"Accessible toilet",selected:a.toilet,onPress:()=>j({toilet:!a.toilet})}),(0,v.jsx)(h.Chip,{label:"Assistance dog",selected:a.assistDog,onPress:()=>j({assistDog:!a.assistDog})})]}),(0,v.jsx)(h.Field,{label:"Anything else? (optional)",value:a.accessNote,onChangeText:e=>j({accessNote:e}),placeholder:"e.g. needs a chair with arms"}),w.accessStatement?.trim()?(0,v.jsx)(h.Muted,{children:w.accessStatement.trim()}):null]}):null,(0,s.dietQuestionOn)(l)?(0,v.jsxs)(R,{tone:"plain",testID:"q-veg",children:[(0,v.jsx)(C,{sub:"We\u2019d love to look after you. Optional.",children:"\u24cb Any vegans or vegetarians?"}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Vegan"}),(0,v.jsx)(h.Stepper,{value:a.vegan,onChange:e=>j({vegan:e}),min:0,max:Math.max(1,i),label:"vegans"})]}),(0,v.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(h.T,{size:14,children:"Vegetarian"}),(0,v.jsx)(h.Stepper,{value:a.vegetarian,onChange:e=>j({vegetarian:e}),min:0,max:Math.max(1,i),label:"vegetarians"})]}),!1!==w.vegTeaser&&P.length&&(a.vegan||a.vegetarian)?(0,v.jsxs)(h.Muted,{children:["On the menu: ",P.map(e=>e.name).join(' \xb7 ')]}):null]}):null,A?(0,v.jsxs)(R,{tone:"gold",testID:"q-reserve",children:[(0,v.jsx)(C,{sub:N.known?'Held for you from today\u2019s count.':o>y||'guest'===b?'Held for you; the kitchen confirms and orders in.':void 0,children:"\ud83e\udd9e Reserve with your table"}),N.items.map(e=>I(`item:${e.id}`,`${e.name}${k(e.price)}`,e.description||e.uses.map(e=>`${e.qty} ${N.stock.find(l=>l.key===e.key)?.name.toLowerCase()??e.key}`).join(' + '),$(e.uses,`item:${e.id}`))),!1!==w.reserveStock?N.stock.map(e=>I(`stock:${e.key}`,`Reserve ${e.name.toLowerCase()}`,N.known?`${N.free[e.key]} available today`:'Held for the kitchen to order',$([{key:e.key,qty:1}],`stock:${e.key}`))):null,'staff'===b&&N.known?(0,v.jsxs)(h.Muted,{children:["Today: ",N.stock.map(e=>`${N.free[e.key]} ${e.plural.toLowerCase()} free (${N.reserved[e.key]??0} reserved)`).join(' \xb7 ')]}):null]}):null,x&&!1!==w.tableRequests&&O.tables.length?(0,v.jsx)(M,{rid:e,value:a,onChange:r,party:i,hide:w.tableRequestHide??[]}):null]})},_e.dogTimeOk=function(e,l,s,t,a){if(!a)return!0;const n=e.settings.maxDogsPerSlot;return!n||(0,f.dogsAt)(l,s,t)+a<=n},Object.defineProperty(_e,"accessibleSetUp",{enumerable:!0,get:function(){return f.accessibleSetUp}});var e,l=_r(d[0]),s=_r(d[1]),t=_r(d[2]),a=_r(d[3]),n=(e=a)&&e.__esModule?e:{default:e},r=_r(d[4]),i=_r(d[5]),o=_r(d[6]),c=_r(d[7]),h=_r(d[8]),u=_r(d[9]),p=_r(d[10]),y=_r(d[11]),m=_r(d[12]),b=_r(d[13]),x=_r(d[14]),f=_r(d[15]),j=_r(d[16]),v=_r(d[17]);const k=e=>'display'===x.APP_VARIANT?'':` \xb7 ${(0,b.gbp)(e)}`,w=()=>({allergy:null,allergens:[],severity:'allergy',allergyPeople:1,allergyNote:'',dog:null,dogs:1,wheelchair:0,stepFree:!1,toilet:!1,assistDog:!1,accessNote:'',vegan:0,vegetarian:0,holds:{},tableReq:[]});const R=({children:e,tone:l,testID:s})=>(0,v.jsx)(n.default,{testID:s,style:{gap:10,padding:16,borderRadius:16,borderWidth:'plain'===l?1:1.5,borderColor:'red'===l?j.colours.red:'gold'===l?j.colours.accentBorder:j.colours.hairline,backgroundColor:'red'===l?'#1E1110':j.colours.surface},children:e}),C=({children:e,sub:l})=>(0,v.jsxs)(n.default,{style:{gap:2},children:[(0,v.jsx)(h.T,{weight:"semibold",size:17,children:e}),l?(0,v.jsx)(h.Muted,{children:l}):null]});function q(e,l,s,t,a,n,i){const o=(0,f.reservablesOf)(l),c=(0,y.useStockItems)(e),h=(0,y.useShellStore)((0,r.useShallow)(l=>(0,y.venueCounts)(l,e))),u=(0,y.useShellStore)(l=>!!l.server[e]),p=(0,f.reservedOn)(a,s,o,i),m=s===t&&('staff'===n||u),b={};for(const e of c)b[e.key]=m?Math.max(0,Math.floor((h[e.key]??0)-(p[e.key]??0))):1/0;return{items:o,stock:c,free:b,reserved:p,known:m}}function M({rid:e,value:s,onChange:a,party:r,hide:c}){const u=(0,p.usePlan)(e),y=u.areas.filter(e=>u.tables.some(l=>l.areaId===e.id&&!c.includes(l.name))),[m,b]=(0,t.useState)(y[0]?.id??''),x=s.dog?s.dogs:0,k=e=>c.includes(e)?'Not bookable':(0,f.tableBlockReason)(u,e,r,x,s.wheelchair>0||s.stepFree),w=Object.fromEntries(u.tables.map(e=>[e.name,{table:e,status:k(e.name)?'blocked':'free',covers:0,allergy:!1}])),q=e=>{if(k(e))return;const l=s.tableReq.includes(e)?s.tableReq.filter(l=>l!==e):[...s.tableReq,e].slice(-2);a({...s,tableReq:l})},M=u.tables.filter(e=>e.areaId===m&&!c.includes(e.name));return(0,v.jsxs)(R,{tone:"plain",testID:"q-table",children:[(0,v.jsx)(C,{sub:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best.",children:"\ud83e\ude91 Request a table (optional)"}),y.length>1?(0,v.jsx)(i.AreaTabs,{plan:u,area:m,onPick:b}):null,(0,v.jsx)(n.default,{testID:"q-table-plan",style:{height:240,borderRadius:12,overflow:'hidden',borderWidth:1,borderColor:j.colours.hairline},children:(0,v.jsx)(o.FloorCanvas,{plan:u,areaId:m,mode:"live",view:w,privacy:!0,fit:"contain",crop:!0,maxH:260,highlight:s.tableReq,onTap:e=>q(e.name)})}),(0,v.jsx)(h.Row,{wrap:!0,gap:6,children:M.map(e=>{const t=k(e.name),a=s.tableReq.indexOf(e.name);return(0,v.jsx)(h.Chip,{label:`${(0,l.tableNumbers)(e.name)}`,sub:t||(0===a?'1st choice':1===a?'2nd choice':`${e.maxSeats} seats`),selected:a>=0,disabled:!!t,onPress:()=>q(e.name)},e.name)})}),s.tableReq.length?(0,v.jsxs)(h.T,{size:14,colour:j.colours.goldLight,children:["Requested: ",s.tableReq.map((e,s)=>`${(0,l.tableNumbers)(e)}${s?' (2nd choice)':''}`).join(', ')]}):(0,v.jsx)(h.Muted,{children:"Tap a table; tap another for a second choice."})]})}},1119,[860,877,34,102,879,1120,1121,1123,794,874,1021,984,861,867,872,1091,821,25]); __d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"areaMarks",{enumerable:!0,get:function(){return n}}),_e.AreaTabs=function({plan:o,area:e,onPick:u,counts:a,closed:b}){return(0,c.jsx)(t.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:o.areas.map(o=>{const h=o.id===e,f=b?.has(o.id);return(0,c.jsx)(l.default,{testID:`area-${o.id}`,accessibilityRole:"tab",accessibilityLabel:`Area ${o.name}${o.dogs?', dogs allowed':''}${o.outdoor?', outdoor':''}${f?', closed for weather':''}`,accessibilityState:{selected:h},onPress:()=>u(o.id),style:{maxWidth:'100%',minWidth:0,flexShrink:1,minHeight:48,paddingHorizontal:16,borderRadius:24,borderWidth:1.5,borderColor:h?s.colours.gold:f?s.colours.blue:s.colours.border,backgroundColor:h?s.colours.gold:s.colours.surface,justifyContent:'center'},children:(0,c.jsxs)(t.T,{weight:"semibold",size:15,colour:h?s.colours.onGold:s.colours.text,children:[o.name,n(o),f?(0,c.jsx)(t.T,{size:12,colour:h?s.colours.onGold:s.colours.blue,children:" closed"}):null,a?.[o.id]?(0,c.jsxs)(t.T,{size:12,colour:h?s.colours.onGold:s.colours.muted,children:[" ",a[o.id]]}):null]})},o.id)})})},r(d[0]);var o,e=r(d[1]),l=(o=e)&&o.__esModule?o:{default:o},s=r(d[2]),t=r(d[3]),c=r(d[4]);const n=o=>`${o.dogs?' \ud83d\udc3e':''}${o.outdoor?' \ud83c\udf26':''}`},1120,[34,402,821,794,25]); @@ -1291,7 +1291,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useChefAssistant",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"CHEF_PROMPTS",{enumerable:!0,get:function(){return P}}),_e.ChefAssistantButton=function({compact:e}){return e?(0,S.jsx)(u.default,{testID:"chef-assistant-open",accessibilityRole:"button",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0),style:{borderRadius:12,backgroundColor:w.colours.accentBg,borderWidth:1,borderColor:w.colours.accentBorder,paddingVertical:6,paddingHorizontal:12,minHeight:36,justifyContent:'center'},children:(0,S.jsx)(m.T,{weight:"semibold",colour:w.colours.goldLight,size:13,children:"\u2726 Assistant"})}):(0,S.jsx)(d.ActionTile,{primary:!0,testID:"chef-assistant-open",icon:"sparkle",label:"Assistant",sub:"Recipe card, order, allergens, GP, temps",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0)})},_e.ChefAssistantSheet=function({go:e}){const l=I(e=>e.open),d=()=>I.getState().setOpen(!1),{rid:f,me:W,menu:L,k:B,c:F}=(0,$.useChef)(3e4),G=(0,T.useSuggestions)(),E=(0,r.useSafetyView)('chef').points,[M,H]=(0,o.useState)([]),[N,_]=(0,o.useState)(''),[V,K]=(0,o.useState)(!1),[Y,q]=(0,o.useState)(!1),Q=(0,o.useRef)(null),U=(0,o.useRef)(null);if((0,o.useEffect)(()=>{setTimeout(()=>Q.current?.scrollToEnd?.({animated:!0}),50)},[M.length]),!l)return null;const J=(e,t=!1)=>H(n=>[...n,{id:R(),from:'bot',text:e,demo:t}]),X=e=>H(t=>[...t,{id:R(),from:'bot',plan:e,state:'open'}]),Z=L.filter(e=>!e.name.includes('(example)')||!0),ee=(t,n)=>{const r=A(t);if(!(0,s.chefCanSee)(f,t))return void J('That check is managed in the Managers app.');if(/\b(send|email|text|pay|delete|remove|order now|place the order)\b/.test(r)&&!/\b(build|draft|make|prepare)\b/.test(r))return void J('I can\u2019t send, pay for or delete anything. I can prepare it for you to check and do yourself, for example \u201cbuild the fish order\u201d.');const o=(0,y.parseQuick)(t,E).filter(e=>e.point&&(0,y.isTempKind)(e.point.kind));if(o.length&&(/\b(fridge|freezer|walk ?in|core|probe|cool|hot|deliver|degree|temp)/.test(r)||o.some(e=>null!=e.value))){const t=o.filter(e=>null!=e.value),r=o.filter(e=>null==e.value);if(r.length&&J(`I didn\u2019t hear a temperature for ${r.map(e=>e.point.name).join(', ')}. Say or type the reading, for example \u201c${r[0].point.name} 4 degrees\u201d. I never fill one in.`),!t.length)return;const s=t.filter(e=>!(0,y.inRange)(e.point,e.value));return void X({title:`Log ${1===t.length?'a reading':`${t.length} readings`} in the food safety log`,detail:t.map(e=>`${e.point.name}: ${e.value}\xb0C (${(0,y.limitText)(e.point)})${(0,y.inRange)(e.point,e.value)?'':' \xb7 OUT OF RANGE'}`).join('\n')+`\nSigned ${(0,y.initialsOf)(W)} \xb7 ${n?'voice':'typed'}`,warn:s.length?`${s.map(e=>e.point.name).join(', ')} out of range: you\u2019ll need to add the corrective action in the food safety log.`:void 0,confirm:'Log it',run:()=>{const r=(new Date).toISOString();return v.useSafety.getState().addEntries(t.map(e=>({pointId:e.point.id,name:e.point.name,kind:e.point.kind,at:r,by:W.replace(' (example)',''),byId:$.CHEF_ID,app:'chef',value:e.value,ok:(0,y.inRange)(e.point,e.value),source:n?'voice':'typed',initials:(0,y.initialsOf)(W)}))),s.length&&setTimeout(()=>e('haccp'),600),`Logged ${t.map(e=>`${e.point.name} ${e.value}\xb0C`).join(', ')}.${s.length?' Opening the food safety log for the corrective action.':''}`}})}if(/\b(fridge|freezer|temp|temperature|degrees)\b/.test(r))return void J('Which unit, and what does it read? For example \u201cprep fridge 4 degrees\u201d or \u201cfreezer minus 19\u201d. I only log the number you give me.');if(/allergen|allerg|contain|gluten|nut|dairy|milk|shellfish|crustacean|coeliac/.test(r)){const e=D(t,Z,e=>e.name);if(!e)return void J('Which dish? For example \u201callergens in the fish and chips\u201d.');const n=(0,j.recipeCards)().byMenuItem(e.id),r=e=>b.ALLERGENS.find(t=>t.id===e)?.label??e,s=Object.entries(e.allergens??{}).filter(([,e])=>'contains'===e).map(([e])=>r(e)),a=Object.entries(e.allergens??{}).filter(([,e])=>'may'===e).map(([e])=>r(e));return void J(`${e.name}: ${s.length?`contains ${s.join(', ')}`:'no allergens recorded as \u201ccontains\u201d'}${a.length?`; may contain ${a.join(', ')}`:''}. ${n?n.signOff?`From the signed-off recipe card (${n.signOff.by}).`:'The recipe card is awaiting your sign-off, so check it before telling a guest.':'There\u2019s no recipe card for it yet.'} Always check the card and the ingredients with the guest.`)}if(/\bgp\b|gross profit|margin|price for|what price|cost of|costing/.test(r)){const e=D(t,F,e=>e.item.name),n=Number((t.toLowerCase().match(/(\d{2})\s*(?:%|percent|per cent)/)??[])[1])||B.targetGp;if(!e)return void J(`Which dish? I can cost the dishes that have a recipe in GP & costing (${F.length} do). For example \u201cGP on the haddock\u201d.`);const r=(0,C.priceForTarget)(e.cost,n);return void J(`${e.item.name}: food cost ${(0,x.gbp)(e.cost)}, sells at ${(0,x.gbp)(e.priceInc)} (inc VAT) = ${e.gp.toFixed(1)}% GP. For ${n}% GP it would need ${(0,x.gbp)(r)} inc VAT. Prices are changed by a manager; I haven\u2019t changed anything.`)}if(/\border|supplier|delivery|par\b|restock/.test(r)){const n=D(t,G,e=>`${e.s.name} ${e.s.category??''}`)??(1===G.length?G[0]:void 0);return n?void X({title:`Build an order for ${n.s.name}`,detail:(n.lines.length?n.lines.map(e=>`${e.i.name}: ${(0,a.fishQtyText)(f,e.i,e.qty)}`).join('\n')+`\nAbout ${(0,x.gbp)(n.total)} at the latest prices.`:'Nothing is below par for this supplier yet.')+'\nI\u2019ll open it in Ordering for you to check, change and place yourself. Nothing is sent.',confirm:'Open the order',run:()=>(setTimeout(()=>{d(),e('orders',n.s.id)},400),`Opening the ${n.s.name} order. You check it and place it yourself.`)}):void J(G.length?`Which supplier? ${G.map(e=>e.s.name).join(', ')}.`:'Nothing is below par and no supplier orders today.')}if(/recipe|card|new dish|write up|spec/.test(r)){const n=t.replace(/^.*?(?:recipe card|card|recipe|dish|spec)\s*(?:for|of)?\s*/i,'').replace(/[.?!]+$/,'').trim();if(!n||n.length<3)return void J('What\u2019s the dish called? For example \u201cdraft a recipe card for crab linguine\u201d.');const r=n.replace(/^the\s+/i,'').replace(/^./,e=>e.toUpperCase()).slice(0,60),s=(0,j.recipeCards)().list(f).find(e=>A(e.dish)===A(r));return s?(J(`There\u2019s already a card for ${s.dish}. Opening Recipe cards.`),void setTimeout(()=>{d(),e('recipes')},600)):void X({title:`Draft a recipe card: ${r}`,detail:'A new card, awaiting your sign-off, with the dish name and section filled in. You add the ingredients, method, allergens, photo and price, then sign it off. It isn\u2019t shown to guests until you do.',confirm:'Make the draft',run:async()=>(await(0,j.recipeCards)().create(f,{dish:r,section:'Specials',price:null,ingredients:[],steps:[]},{name:W,role:'head-chef'}),setTimeout(()=>{d(),e('recipes')},500),`Draft card for ${r} saved, awaiting sign-off. Opening Recipe cards.`)})}const l='I can help with: drafting a recipe card, building a supplier order, a dish\u2019s allergens, GP pricing, and logging a temperature you read out. Try one of the suggestions.';(0,k.askServer)('chef',t,[]).then(e=>J('text'===e.kind?e.text:l)).catch(()=>J(l))},te=(e,t=!1)=>{const n=e.trim();if(n){_(''),H(e=>[...e,{id:R(),from:'you',text:n}]);try{ee(n,t)}catch(e){J(`Sorry, that didn\u2019t work: ${e.message}`)}}},ne=async e=>{if(e.plan){H(t=>t.map(t=>t.id===e.id?{...t,state:'done'}:t));try{J(String(await e.plan.run()))}catch(e){J(`Couldn\u2019t do that: ${e.message}`)}}},ie=e=>{H(t=>t.map(t=>t.id===e.id?{...t,state:'cancelled'}:t)),J('Cancelled. Nothing was changed.')},re=()=>{te(N,Y),q(!1)};return(0,S.jsx)(c.default,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:d,children:(0,S.jsx)(p.default,{style:[m.styles.overlay,{justifyContent:'flex-end',padding:0}],children:(0,S.jsxs)(p.default,{testID:"chef-assistant",style:{backgroundColor:w.colours.surface,borderTopLeftRadius:18,borderTopRightRadius:18,borderWidth:1,borderColor:w.colours.border,width:'100%',maxWidth:640,alignSelf:'center',maxHeight:'92%',minHeight:'70%',padding:14,gap:10},children:[(0,S.jsxs)(m.Row,{style:{justifyContent:'space-between'},children:[(0,S.jsx)(m.T,{size:20,weight:"semibold",children:"\u2726 Kitchen Assistant"}),(0,S.jsx)(n.GoldClose,{testID:"chef-assistant-close",onPress:d,style:{marginRight:-6}})]}),(0,S.jsx)(p.default,{testID:"chef-assistant-demo",children:(0,S.jsx)(m.Badge,{kind:"amber",label:O})}),(0,S.jsxs)(h.default,{ref:Q,style:{flex:1},contentContainerStyle:{gap:10,paddingBottom:6},keyboardShouldPersistTaps:"handled",children:[0===M.length?(0,S.jsxs)(p.default,{style:{gap:8},children:[(0,S.jsxs)(m.T,{children:["Hi ",W.split(' ')[0],". Type or tap \ud83c\udfa4 and say what you need. I\u2019ll show you what I\u2019m about to do and wait for you to confirm. I never send, pay or delete."]}),P.map(e=>(0,S.jsx)(u.default,{accessibilityRole:"button",onPress:()=>te(e),style:{borderWidth:1,borderColor:w.colours.border,borderRadius:12,paddingVertical:9,paddingHorizontal:12,backgroundColor:w.colours.surface2},children:(0,S.jsx)(m.T,{size:14,children:e})},e))]}):null,M.map(e=>'you'===e.from?(0,S.jsx)(p.default,{style:{alignSelf:'flex-end',maxWidth:'85%',backgroundColor:'#3A2F12',borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id):e.plan?(0,S.jsxs)(p.default,{testID:"chef-confirm-card",style:{borderWidth:1.5,borderColor:'open'===e.state?w.colours.gold:w.colours.border,borderRadius:14,padding:12,gap:8,backgroundColor:w.colours.surface2},children:[(0,S.jsx)(m.T,{weight:"semibold",children:e.plan.title}),(0,S.jsx)(m.T,{size:14,colour:w.colours.muted,children:e.plan.detail}),e.plan.warn?(0,S.jsxs)(m.T,{size:13,colour:w.colours.amber,children:["\u26a0 ",e.plan.warn]}):null,'open'===e.state?(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(m.Button,{small:!0,testID:"chef-confirm",label:e.plan.confirm,onPress:()=>ne(e)}),(0,S.jsx)(m.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ie(e)})]}):(0,S.jsx)(m.Badge,{kind:'done'===e.state?'ok':'neutral',label:'done'===e.state?'Confirmed':'Cancelled: nothing done'}),'open'===e.state?(0,S.jsxs)(m.Muted,{children:["Nothing happens until you tap ",e.plan.confirm,"."]}):null]},e.id):(0,S.jsx)(p.default,{testID:"chef-assistant-reply",style:{alignSelf:'flex-start',maxWidth:'92%',backgroundColor:w.colours.surface2,borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id))]}),(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(t.TextInput,{testID:"chef-assistant-input",accessibilityLabel:"Ask the Assistant",placeholder:"Type a kitchen task\u2026",placeholderTextColor:"#7D776C",value:N,onChangeText:e=>{_(e),e||q(!1)},onSubmitEditing:re,returnKeyType:"send",style:[m.styles.input,{flex:1,minWidth:0,width:40}]}),(0,S.jsx)(u.default,{testID:"chef-assistant-mic",accessibilityRole:"button",accessibilityLabel:V?'Stop listening':'Speak',onPress:()=>{const e=z();if(e)if(V)U.current?.stop?.();else try{const t=new e;U.current=t,t.lang='en-GB',t.interimResults=!1,t.maxAlternatives=1,t.onresult=e=>{const t=e.results?.[0]?.[0]?.transcript;t&&(_(t),q(!0))},t.onend=()=>K(!1),t.onerror=()=>{K(!1),J('Sorry, I didn\u2019t catch that. You can type instead.')},K(!0),t.start()}catch{K(!1),J('Voice input isn\u2019t available here. Please type instead.')}else J('Voice input isn\u2019t available in this browser. Please type instead.')},style:{width:48,height:48,borderRadius:24,borderWidth:1.5,borderColor:w.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:V?w.colours.gold:'transparent'},children:(0,S.jsx)(m.T,{size:20,children:"\ud83c\udfa4"})}),(0,S.jsx)(m.Button,{label:"Send",disabled:!N.trim(),onPress:re})]}),(0,S.jsx)(m.Muted,{center:!0,children:"Every action waits for your Confirm \xb7 nothing is sent, paid or deleted"})]})})})};var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),s=_r(_d[3]),a=_r(_d[4]),o=_r(_d[5]),l=_r(_d[6]),d=_r(_d[7]),c=e(_r(_d[8]));_r(_d[9]);var u=e(_r(_d[10])),h=e(_r(_d[11])),p=e(_r(_d[12])),f=_r(_d[13]),m=_r(_d[14]),b=_r(_d[15]),y=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),v=_r(_d[19]),w=_r(_d[20]),$=_r(_d[21]),C=_r(_d[22]),T=_r(_d[23]),k=_r(_d[24]),S=_r(_d[25]);const I=(0,f.create)(e=>({open:!1,setOpen:t=>e({open:t})})),R=()=>Math.random().toString(36).slice(2,9),P=['Draft a recipe card for crab linguine','Build the fish order','What allergens are in the fish and chips?','What price gives 70% GP on the lobster?','Walk-in fridge 3.5 degrees'],O='The secure AI server: not set up yet',A=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').replace(/\s+/g,' ').trim(),W=new Set(['the','and','with','for','our','house','served','side','of','in','on','from']);function D(e,t,n){const r=` ${A(e)} `;let s,a=0;for(const e of t){const t=A(n(e).replace(/\(example\)/i,'')).split(' ').filter(e=>e.length>2&&!W.has(e)),o=t.filter(e=>r.includes(` ${e} `)||r.includes(` ${e}s `)).length,l=t.length?o/t.length+.01*o:0;o&&l>a&&(s=e,a=l)}return s}function z(){return'undefined'==typeof window?null:(0,l.speechRecognizer)()}},1208,[827,796,1184,835,985,34,932,1170,395,236,402,295,102,846,794,861,1027,867,882,1026,821,1138,1132,1157,933,25]); __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTTOM_TABS_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.BottomTabs=function({tabs:e,active:b,onPress:y,background:x,tablist:p}){const{width:j}=(0,s.default)(),v=j/Math.max(1,e.length),w=v>=60?11:10,I=v<56?20:22,[F,S]=(0,t.useState)({}),[H,_]=(0,t.useState)(0),M=H>0&&e.some(e=>(F[e.id]??0)>H-6),z={flexDirection:'row',flexWrap:'nowrap',alignItems:'stretch',borderTopWidth:1,borderColor:c.colours.border,backgroundColor:x};return(0,f.jsx)(l.default,{testID:"app-bottom-tabs",accessibilityRole:p?'tablist':void 0,style:z,children:e.map(t=>{const s=b===t.id,x=s?c.colours.gold:c.colours.muted;return(0,f.jsxs)(n.default,{onLayout:t===e[0]?e=>_(e.nativeEvent.layout.width):void 0,testID:`tab-${t.id}`,accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:t.a11y??t.label,onPress:()=>y(t.id),style:{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:44,minHeight:h,alignItems:'center',justifyContent:'center',paddingVertical:4,paddingHorizontal:1,gap:2},children:[(0,f.jsxs)(l.default,{style:{width:I,height:I,alignItems:'center',justifyContent:'center'},children:[(0,f.jsx)(u.Icon,{name:t.icon,size:I,colour:x}),t.badge?(0,f.jsx)(l.default,{testID:t.badge.testID,style:{position:'absolute',right:-10,top:-5,backgroundColor:t.badge.bg,borderRadius:8,minWidth:16,height:16,paddingHorizontal:3,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(o.default,{style:{fontFamily:c.fonts.bold,fontSize:10,lineHeight:12,color:t.badge.fg??'#FFFFFF'},children:t.badge.text})}):null]}),(0,f.jsx)(l.default,{pointerEvents:"none","aria-hidden":!0,importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,style:{position:'absolute',left:0,top:0,width:0,height:0,overflow:'hidden',opacity:0},children:(0,f.jsx)(l.default,{style:{width:400,flexDirection:'row',alignItems:'flex-start'},children:(0,f.jsx)(o.default,{onLayout:e=>{const n=Math.ceil(e.nativeEvent.layout.width);S(e=>e[t.id]===n?e:{...e,[t.id]:n})},style:{fontFamily:c.fonts.semibold,fontSize:w,lineHeight:Math.round(1.3*w),flexShrink:0},children:t.short??t.label})})}),M?null:(0,f.jsx)(o.default,{numberOfLines:1,style:{fontFamily:s?c.fonts.semibold:c.fonts.regular,fontSize:w,lineHeight:Math.round(1.3*w),color:x,textAlign:'center',alignSelf:'center',maxWidth:'100%'},children:t.short??t.label})]},t.id)})})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=r(d[5]),u=r(d[6]),f=r(d[7]);const h=56},1209,[34,402,346,102,426,821,1171,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return(0,u.canShow)('chef')?(0,c.jsx)(n.ChefApp,{}):(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]})}},1210,[30,34,792,872,25]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return B}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=(e=r)&&e.__esModule?e:{default:e},u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),S=_r(_d[19]),w=_r(_d[20]),D=_r(_d[21]),T=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]),P=_r(_d[25]),M=_r(_d[26]);function B(){const{rid:e,date:r}=(0,n.useLocalSearchParams)(),B=(0,x.useRestaurant)(e),O=(0,x.useCustomer)(),A=(0,x.useBookings)(e),N=(0,x.useEvents)(e),z=(0,x.useNow)(6e4),[R]=(0,l.useState)(()=>(0,a.startForm)()),[F,I]=(0,l.useState)(''),[q,E]=(0,l.useState)(2),[H,W]=(0,l.useState)(r??(0,k.ymd)(z)),[L,_]=(0,l.useState)(null),[Y,U]=(0,l.useState)(O.name),[G,Q]=(0,l.useState)(O.phone??''),[V,J]=(0,l.useState)(O.email??''),[K,X]=(0,l.useState)(!1),[Z,ee]=(0,l.useState)(''),[te,oe]=(0,l.useState)(!1),[se,ne]=(0,l.useState)([]),[le,ie]=(0,l.useState)(!1),ae=[...O.allergies,...se.filter(e=>!O.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[re,de]=(0,l.useState)(null),ue=(0,D.useBlocks)(e=>e.blocks);(0,j.usePublicDayStore)(e=>e.n);const ce=e?(0,j.publicDay)(e,H):null,he=ce?[...ce.bookings,...A.filter(e=>e.date!==H)]:A,me=ce?[...ue.filter(t=>t.rid!==e||t.date!==H),...ce.blocks]:ue,ge=(0,T.usePlan)(e),[pe,be]=(0,l.useState)((0,$.emptyNeeds)()),fe=!0===pe.dog,ye=fe?pe.dogs:0,ke=(0,l.useMemo)(()=>{const e=[],t=new Date(z);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return r&&!e.some(e=>(0,k.ymd)(e)===r)&&e.push((0,k.parseYmd)(r)),e},[z.toDateString(),r]);if(!B)return(0,M.jsx)(h.Screen,{title:"Not found",children:(0,M.jsx)(h.T,{children:"Restaurant not found."})});const xe=B.settings,je=(0,k.parseYmd)(H),ve=(0,D.blocksOn)(me,B.id,H),Se=he.filter(e=>e.date===H),we=ge.areas.filter(e=>e.dogs),De=(0,P.dogSetUp)(ge),Te=e=>(0,C.freeTablesAt)(ge,Se,q,new Date(`${H}${(0,t.tableNumbers)(e)}:00`),(0,C.turnFor)(q,xe.turnMins),xe.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(me,B.id,H,e)}),Ce=(0,y.bookingSlots)(B,je,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),q,z).map(e=>{const t=(0,D.blockAt)(me,B.id,H,e.time),o=fe&&De&&e.available&&!t&&(!Te(e.time).length||!(0,$.dogTimeOk)(B,he,H,e.time,ye));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),$e=Ce.some(e=>e.available),Pe=(0,u.depositOf)(xe),Me=(0,u.depositDue)(Pe,q),Be=Me>0?'deposit':'none',Oe=(0,u.depositWords)(Pe,q,B.name),Ae=N.filter(e=>e.date===H),Ne=(0,w.ukPhone)(G),ze=(0,w.emailOk)(V),Re=(0,$.needsMissing)(pe,O.allergies),Fe=!!L&&te&&!Re.length&&Y.trim().length>1&&Ne.ok&&ze,Ie=async()=>{const e=(0,$.needsPatch)(pe,O.allergies),t=fe&&De?Te(L).map(e=>e.table):[],o=fe?pe.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await x.repo.bookings.create({restaurantId:B.id,customerId:O.id,name:Y,partySize:q,date:H,time:L,notes:Z.trim(),security:Be,depositPaid:0,...Me?{depositDue:Me,depositPolicy:Oe.join(' '),depositRefundable:Pe.refundable,depositCutoffHours:Pe.cutoffHours}:{},phone:Ne.pretty,email:V.trim()||void 0,source:'online',...e,...Ce.find(e=>e.time===L)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??ae,...o?{table:o}:{}});(0,a.rememberGuard)(s.id,(0,a.guardFor)({...R,hp:F})),de(s)},qe=(0,x.useStore)(e=>re?e.bookings.find(e=>e.id===re.id)?.ref:void 0),Ee=e=>(0,S.waMeLink)(B.settings.whatsapp,(0,S.guestWhatsAppText)({name:e.name,ref:qe??e.ref,date:e.date,time:e.time,partySize:e.partySize},B.name));if(re){const e='pending'===re.status;return(0,M.jsxs)(h.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:B.name,children:[(0,M.jsx)(h.Banner,{kind:e?'info':'success',title:`Reference ${qe??re.ref}`,children:`${re.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(re.date))} at ${re.time}`}),e?(0,M.jsx)(h.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(h.T,{children:["Name: ",re.name]}),(0,M.jsxs)(h.T,{children:["Mobile: ",re.phone]}),re.email?(0,M.jsxs)(h.T,{children:["Email: ",re.email]}):null,(0,M.jsxs)(h.T,{children:["Allergies shared with the restaurant: ",re.allergies.length?re.allergies.map(e=>`${(0,p.allergenLabel)(e.allergen)} (${(0,p.severityLabel)(e.severity)})`).join(', '):'none']}),re.notes?(0,M.jsxs)(h.T,{children:["Notes: ",re.notes]}):null,re.dog?(0,M.jsxs)(h.T,{children:["\ud83d\udc15 Dog coming too",re.table?` \xb7 dog-friendly table ${re.table}`:'']}):null,re.holds?.length?(0,M.jsxs)(h.T,{children:["Reserved: ",re.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(B.settings.reservables??P.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,re.tableReq?.length?(0,M.jsxs)(h.T,{children:["Table requested: ",re.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===re.security&&re.depositDue?(0,M.jsxs)(h.T,{weight:"semibold",children:["Deposit due: ",(0,f.gbp)(re.depositDue),". ",B.name," will tell you how to pay it."]}):null,'deposit'===re.security&&re.depositPolicy?(0,M.jsx)(h.Muted,{children:re.depositPolicy}):null,(0,M.jsx)(h.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,M.jsxs)(h.Muted,{children:["Need to change or cancel? Call ",B.phone," and quote ",qe??re.ref,"."]})]}),Ee(re)?(0,M.jsxs)(d.default,{style:{gap:4},children:[(0,M.jsx)(h.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ee(re);e&&(0,S.openWhatsApp)(e)}}),(0,M.jsx)(h.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,M.jsx)(h.Button,{label:"Back to restaurant",onPress:()=>n.router.replace(`/customer/${B.id}`)})]})}return(0,M.jsxs)(h.Screen,{title:"Book a table",subtitle:B.name,footer:(0,M.jsx)(h.Button,{label:Re.length?Re[0]:q>(xe.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Fe,onPress:()=>Ie(),testID:"confirm-booking"}),children:[(0,M.jsx)($.FirstQuestions,{rid:B.id,value:pe,onChange:e=>{e.dog===pe.dog&&e.dogs===pe.dogs||_(null),be(e)},party:q,audience:"guest",profile:O.allergies}),(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(d.default,{style:{gap:6,alignItems:'center'},children:[(0,M.jsx)(h.H2,{children:"Party size"}),(0,M.jsx)(o.PartySizeInput,{value:q,onChange:e=>{E(e),_(null)},label:"Party size",testID:"party-size"})]}),Me?(0,M.jsx)(h.Banner,{kind:"info",title:`Deposit: ${(0,f.gbp)(Me)} for ${q} guests`,children:(0,M.jsx)(d.default,{style:{gap:4},children:Oe.map(e=>(0,M.jsx)(h.T,{size:13,children:e},e))})}):Pe.on&&Pe.perPersonPence>0?(0,M.jsxs)(h.Muted,{children:["No deposit for fewer than ",Pe.fromParty," guests."]}):null,q>(xe.autoAcceptUpTo??7)?(0,M.jsxs)(h.Muted,{children:["For ",q," people the team checks the booking first, then texts you to confirm."]}):null,fe&&De?(0,M.jsxs)(h.Muted,{children:["Dogs are welcome in the ",we.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",B.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Date"}),(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:ke.map(e=>{const t=!!(0,b.hoursFor)(B,e),o=N.some(t=>t.date===(0,k.ymd)(e));return(0,M.jsx)(h.Chip,{label:(0,k.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:H===(0,k.ymd)(e),onPress:()=>{W((0,k.ymd)(e)),_(null)}},(0,k.ymd)(e))})}),Ae.map(e=>(0,M.jsx)(h.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Time"}),0===Ce.length?(0,M.jsx)(h.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:Ce.map(e=>(0,M.jsx)(h.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left_(e.time)},e.time))}),ve.length>0&&Ce.some(e=>e.blocked)?(0,M.jsx)(h.Banner,{kind:"info",title:$e?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${ve.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(je)}. Please give us a ring on ${B.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,s.lastFoodOn)(B,H);return e&&Ce.some(e=>e.drinksOnly)?(0,M.jsx)(h.Banner,{kind:"info",title:`Last food orders ${(0,s.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),fe&&Ce.some(e=>e.noDog)?(0,M.jsx)(h.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${we.map(e=>e.name).join(' and ')}${B.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,D.closedAreasAt)(me,B.id,H,L??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,M.jsxs)(h.Muted,{children:["Times are every ",(0,y.bookingSlotMinutesOf)(B)," minutes. Covers per slot (",xe.bookingCoversPerSlot," per half hour) and table rules still apply."]})]}),(0,M.jsx)($.MoreQuestions,{rid:B.id,r:B,value:pe,onChange:be,party:q,date:H,time:L,today:(0,k.ymd)(z),bookings:he,audience:"guest",showTables:!0}),(0,M.jsxs)(h.Card,{highlight:te?void 0:v.colours.amber,children:[(0,M.jsx)(h.Field,{label:"Notes (optional)",value:Z,onChangeText:ee,placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,M.jsx)(h.Toggle,{label:"I confirm the allergy information for this booking",value:te,onChange:oe}),(0,M.jsx)(h.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Your details"}),(0,M.jsx)(h.Field,{label:"Name for the booking",value:Y,onChangeText:U}),(0,M.jsx)(h.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:G,onChangeText:Q,onBlur:()=>X(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Ne.ok||!K&&!G?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:Ne.error}),(0,M.jsx)(h.Field,{testID:"book-email",label:"Email (optional)",value:V,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),ze?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,M.jsxs)(h.Muted,{children:["We\u2019ll text you a confirmation",V.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,M.jsx)(i.Honeypot,{value:F,onChange:I})]})}},1211,[860,1114,877,30,34,1212,999,102,14,1124,794,861,878,867,1117,858,874,988,821,1168,864,1018,1021,1095,1119,1091,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return B}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=(e=r)&&e.__esModule?e:{default:e},u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),x=_r(_d[15]),k=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),D=_r(_d[21]),T=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]),P=_r(_d[25]),M=_r(_d[26]);function B(){const{rid:e,date:r}=(0,n.useLocalSearchParams)(),B=(0,k.useRestaurant)(e),A=(0,k.useCustomer)(),O=(0,k.useBookings)(e),N=(0,k.useEvents)(e),z=(0,k.useNow)(6e4),[R]=(0,l.useState)(()=>(0,a.startForm)()),[F,I]=(0,l.useState)(''),[q,L]=(0,l.useState)(2),[H,E]=(0,l.useState)(r??(0,x.ymd)(z)),[W,_]=(0,l.useState)(null),[Y,U]=(0,l.useState)(A.name),[G,Q]=(0,l.useState)(A.phone??''),[V,J]=(0,l.useState)(A.email??''),[K,X]=(0,l.useState)(!1),[Z,ee]=(0,l.useState)(''),[te,oe]=(0,l.useState)(!1),[se,ne]=(0,l.useState)([]),[le,ie]=(0,l.useState)(!1),ae=[...A.allergies,...se.filter(e=>!A.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[re,de]=(0,l.useState)(null),ue=(0,D.useBlocks)(e=>e.blocks);(0,j.usePublicDayStore)(e=>e.n);const ce=e?(0,j.publicDay)(e,H):null,he=ce?[...ce.bookings,...O.filter(e=>e.date!==H)]:O,me=ce?[...ue.filter(t=>t.rid!==e||t.date!==H),...ce.blocks]:ue,ge=(0,T.usePlan)(e),[pe,be]=(0,l.useState)((0,$.emptyNeeds)()),fe=!0===pe.dog,ye=fe?pe.dogs:0,xe=(0,l.useMemo)(()=>{const e=[],t=new Date(z);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return r&&!e.some(e=>(0,x.ymd)(e)===r)&&e.push((0,x.parseYmd)(r)),e},[z.toDateString(),r]);if(!B)return(0,M.jsx)(h.Screen,{title:"Not found",children:(0,M.jsx)(h.T,{children:"Restaurant not found."})});const ke=B.settings,je=(0,x.parseYmd)(H),ve=(0,y.onlinePartyBounds)(B),we=(0,D.blocksOn)(me,B.id,H),Se=he.filter(e=>e.date===H),De=ge.areas.filter(e=>e.dogs),Te=(0,P.dogSetUp)(ge),Ce=e=>(0,C.freeTablesAt)(ge,Se,q,new Date(`${H}${(0,t.tableNumbers)(e)}:00`),(0,C.turnFor)(q,ke.turnMins),ke.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(me,B.id,H,e)}),$e=(0,y.bookingSlots)(B,je,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),q,z,e=>he.filter(t=>t.date===H&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,D.blockAt)(me,B.id,H,e.time),o=fe&&Te&&e.available&&!t&&(!Ce(e.time).length||!(0,$.dogTimeOk)(B,he,H,e.time,ye));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Pe=$e.some(e=>e.available),Me=(0,u.depositOf)(ke),Be=(0,u.depositDue)(Me,q),Ae=Be>0?'deposit':'none',Oe=(0,u.depositWords)(Me,q,B.name),Ne=N.filter(e=>e.date===H),ze=(0,S.ukPhone)(G),Re=(0,S.emailOk)(V),Fe=(0,$.needsMissing)(pe,A.allergies),Ie=!!W&&te&&!Fe.length&&Y.trim().length>1&&ze.ok&&Re,qe=async()=>{const e=(0,$.needsPatch)(pe,A.allergies),t=fe&&Te?Ce(W).map(e=>e.table):[],o=fe?pe.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await k.repo.bookings.create({restaurantId:B.id,customerId:A.id,name:Y,partySize:q,date:H,time:W,notes:Z.trim(),security:Ae,depositPaid:0,...Be?{depositDue:Be,depositPolicy:Oe.join(' '),depositRefundable:Me.refundable,depositCutoffHours:Me.cutoffHours}:{},phone:ze.pretty,email:V.trim()||void 0,source:'online',...e,...$e.find(e=>e.time===W)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??ae,...o?{table:o}:{}});(0,a.rememberGuard)(s.id,(0,a.guardFor)({...R,hp:F})),de(s)},Le=(0,k.useStore)(e=>re?e.bookings.find(e=>e.id===re.id)?.ref:void 0),He=e=>(0,w.waMeLink)(B.settings.whatsapp,(0,w.guestWhatsAppText)({name:e.name,ref:Le??e.ref,date:e.date,time:e.time,partySize:e.partySize},B.name));if(re){const e='pending'===re.status;return(0,M.jsxs)(h.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:B.name,children:[(0,M.jsx)(h.Banner,{kind:e?'info':'success',title:`Reference ${Le??re.ref}`,children:`${re.partySize} people \xb7 ${(0,x.niceDateYear)((0,x.parseYmd)(re.date))} at ${re.time}`}),e?(0,M.jsx)(h.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(h.T,{children:["Name: ",re.name]}),(0,M.jsxs)(h.T,{children:["Mobile: ",re.phone]}),re.email?(0,M.jsxs)(h.T,{children:["Email: ",re.email]}):null,(0,M.jsxs)(h.T,{children:["Allergies shared with the restaurant: ",re.allergies.length?re.allergies.map(e=>`${(0,p.allergenLabel)(e.allergen)} (${(0,p.severityLabel)(e.severity)})`).join(', '):'none']}),re.notes?(0,M.jsxs)(h.T,{children:["Notes: ",re.notes]}):null,re.dog?(0,M.jsxs)(h.T,{children:["\ud83d\udc15 Dog coming too",re.table?` \xb7 dog-friendly table ${re.table}`:'']}):null,re.holds?.length?(0,M.jsxs)(h.T,{children:["Reserved: ",re.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(B.settings.reservables??P.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,re.tableReq?.length?(0,M.jsxs)(h.T,{children:["Table requested: ",re.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===re.security&&re.depositDue?(0,M.jsxs)(h.T,{weight:"semibold",children:["Deposit due: ",(0,f.gbp)(re.depositDue),". ",B.name," will tell you how to pay it."]}):null,'deposit'===re.security&&re.depositPolicy?(0,M.jsx)(h.Muted,{children:re.depositPolicy}):null,(0,M.jsx)(h.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,M.jsxs)(h.Muted,{children:["Need to change or cancel? Call ",B.phone," and quote ",Le??re.ref,"."]})]}),He(re)?(0,M.jsxs)(d.default,{style:{gap:4},children:[(0,M.jsx)(h.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=He(re);e&&(0,w.openWhatsApp)(e)}}),(0,M.jsx)(h.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,M.jsx)(h.Button,{label:"Back to restaurant",onPress:()=>n.router.replace(`/customer/${B.id}`)})]})}return(0,M.jsxs)(h.Screen,{title:"Book a table",subtitle:B.name,footer:(0,M.jsx)(h.Button,{label:Fe.length?Fe[0]:q>(ke.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Ie,onPress:()=>qe(),testID:"confirm-booking"}),children:[(0,M.jsx)($.FirstQuestions,{rid:B.id,value:pe,onChange:e=>{e.dog===pe.dog&&e.dogs===pe.dogs||_(null),be(e)},party:q,audience:"guest",profile:A.allergies}),(0,M.jsxs)(h.Card,{children:[(0,M.jsxs)(d.default,{style:{gap:6,alignItems:'center'},children:[(0,M.jsx)(h.H2,{children:"Party size"}),(0,M.jsx)(o.PartySizeInput,{value:q,onChange:e=>{L(e),_(null)},min:ve.min,max:ve.max,label:"Party size",testID:"party-size"})]}),Be?(0,M.jsx)(h.Banner,{kind:"info",title:`Deposit: ${(0,f.gbp)(Be)} for ${q} guests`,children:(0,M.jsx)(d.default,{style:{gap:4},children:Oe.map(e=>(0,M.jsx)(h.T,{size:13,children:e},e))})}):Me.on&&Me.perPersonPence>0?(0,M.jsxs)(h.Muted,{children:["No deposit for fewer than ",Me.fromParty," guests."]}):null,q>(ke.autoAcceptUpTo??7)?(0,M.jsxs)(h.Muted,{children:["For ",q," people the team checks the booking first, then texts you to confirm."]}):null,fe&&Te?(0,M.jsxs)(h.Muted,{children:["Dogs are welcome in the ",De.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",B.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Date"}),(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:xe.map(e=>{const t=!!(0,b.hoursFor)(B,e),o=N.some(t=>t.date===(0,x.ymd)(e));return(0,M.jsx)(h.Chip,{label:(0,x.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:H===(0,x.ymd)(e),onPress:()=>{E((0,x.ymd)(e)),_(null)}},(0,x.ymd)(e))})}),Ne.map(e=>(0,M.jsx)(h.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Time"}),0===$e.length?(0,M.jsx)(h.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,M.jsx)(h.Row,{wrap:!0,gap:6,children:$e.map(e=>(0,M.jsx)(h.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left_(e.time)},e.time))}),we.length>0&&$e.some(e=>e.blocked)?(0,M.jsx)(h.Banner,{kind:"info",title:Pe?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${we.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,x.niceDate)(je)}. Please give us a ring on ${B.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,s.lastFoodOn)(B,H);return e&&$e.some(e=>e.drinksOnly)?(0,M.jsx)(h.Banner,{kind:"info",title:`Last food orders ${(0,s.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),fe&&$e.some(e=>e.noDog)?(0,M.jsx)(h.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${De.map(e=>e.name).join(' and ')}${B.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,D.closedAreasAt)(me,B.id,H,W??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,M.jsx)(h.Muted,{children:(0,y.bookingLimitsHint)(B)})]}),(0,M.jsx)($.MoreQuestions,{rid:B.id,r:B,value:pe,onChange:be,party:q,date:H,time:W,today:(0,x.ymd)(z),bookings:he,audience:"guest",showTables:!0}),(0,M.jsxs)(h.Card,{highlight:te?void 0:v.colours.amber,children:[(0,M.jsx)(h.Field,{label:"Notes (optional)",value:Z,onChangeText:ee,placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,M.jsx)(h.Toggle,{label:"I confirm the allergy information for this booking",value:te,onChange:oe}),(0,M.jsx)(h.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,M.jsxs)(h.Card,{children:[(0,M.jsx)(h.H2,{children:"Your details"}),(0,M.jsx)(h.Field,{label:"Name for the booking",value:Y,onChangeText:U}),(0,M.jsx)(h.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:G,onChangeText:Q,onBlur:()=>X(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),ze.ok||!K&&!G?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:ze.error}),(0,M.jsx)(h.Field,{testID:"book-email",label:"Email (optional)",value:V,onChangeText:J,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Re?null:(0,M.jsx)(h.T,{size:13,colour:v.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,M.jsxs)(h.Muted,{children:["We\u2019ll text you a confirmation",V.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,M.jsx)(i.Honeypot,{value:F,onChange:I})]})}},1211,[860,1114,877,30,34,1212,999,102,14,1124,794,861,878,867,1117,858,874,988,821,1168,864,1018,1021,1095,1119,1091,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Honeypot=function({value:t,onChange:n}){return(0,l.jsx)(o.default,{"aria-hidden":!0,pointerEvents:"none",style:{position:'absolute',left:-1e4,top:0,width:1,height:1,overflow:'hidden',opacity:0},children:(0,l.jsx)(e.TextInput,{testID:"hp-field",accessibilityLabel:"Leave this empty",value:t,onChangeText:n,tabIndex:-1,autoComplete:'off',name:'cc_extra_info','aria-hidden':!0})})};var e=r(d[0]);r(d[1]),r(d[2]);var t,n=r(d[3]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[4])},1212,[827,34,236,102,25]); __d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var t=_r(_d[0]),n=_r(_d[1]),l=e(_r(_d[2])),s=e(_r(_d[3])),r=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]);function f(){const{rid:e,did:f}=(0,t.useLocalSearchParams)(),b=(0,u.useRestaurant)(e),j=(0,u.useMenu)(e).find(e=>e.id===f),x=(0,u.useCustomer)(),m=(0,u.useRecipeCards)(e).find(e=>e.id===j?.recipeCardId),y=m?.signOff&&m.photo?(0,h.recipeCards)().photoSource(m.photo):null,k=(0,u.useStore)(e=>e.addLine),[v,w]=(0,n.useState)(()=>(j?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[S,C]=(0,n.useState)(1),[B,$]=(0,n.useState)(''),[I,P]=(0,n.useState)(!1),[L,T]=(0,n.useState)(!1),[D,O]=(0,n.useState)(!1),[A,M]=(0,n.useState)(!1),R=(0,n.useMemo)(()=>j?(0,d.effectiveAllergens)(j,v):{},[j,v]);if(!b||!j)return(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Dish not found."})});const q=(0,d.conflictsFor)(R,x.allergies),_=(j.price??0)+(j.optionGroups??[]).flatMap(e=>e.choices).filter(e=>v.includes(e.id)).reduce((e,t)=>e+t.priceDelta,0),N=j.soldOut||!j.signOff||null===j.price,G=(e,t)=>{const n=j.optionGroups.find(t=>t.id===e);w(e=>{const l=n.choices.map(e=>e.id);return n.multi?e.includes(t)?e.filter(e=>e!==t):[...e,t]:e.includes(t)&&!n.required?e.filter(e=>e!==t):[...e.filter(e=>!l.includes(e)),t]})},z=e=>{u.useStore.getState().basket.restaurantId!==b.id&&u.useStore.getState().startBasket(b.id,'takeaway'),k({itemId:j.id,qty:S,choiceIds:v,notes:B,override:e?{allergens:q.contains,at:(new Date).toISOString()}:void 0}),P(!1),M(!0)};return(0,p.jsxs)(o.Screen,{title:j.name,subtitle:b.name,right:(0,p.jsx)(a.BasketButton,{}),children:[y?(0,p.jsx)(l.default,{testID:"dish-photo",source:y,accessibilityLabel:`${j.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.T,{weight:"bold",size:20,colour:g.colours.gold,children:null===j.price?j.priceNote:(0,c.gbp)(_)}),j.dietary.map(e=>(0,p.jsx)(o.Badge,{kind:"ok",label:e},e))]}),(0,p.jsx)(o.T,{children:j.description}),q.contains.length?(0,p.jsx)(o.Banner,{kind:"danger",title:`Blocked: contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,q.may.length?(0,p.jsx)(o.Banner,{kind:"warn",title:`Warning: may contain ${q.may.map(d.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(j.optionGroups??[]).map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:e.choices.map(t=>(0,p.jsx)(o.Chip,{label:t.label,sub:t.priceDelta?`+${(0,c.gbp)(t.priceDelta)}`:void 0,selected:v.includes(t.id),onPress:()=>G(e.id,t.id)},t.id))})]},e.id)),(0,p.jsx)(o.Card,{children:(0,p.jsx)(r.AllergenPanel,{item:j,map:R,declared:x.allergies})}),b.fictional?null:(0,p.jsx)(o.ExampleAllergenNotice,{}),(0,p.jsx)(o.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:B,onChangeText:$}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Quantity"}),(0,p.jsx)(o.Stepper,{value:S,onChange:C,label:"quantity"})]}),A?(0,p.jsx)(o.Banner,{kind:"success",title:"Added to basket",children:q.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,N?(0,p.jsx)(o.Banner,{kind:"warn",children:j.soldOut?'Sold out today.':j.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):q.contains.length?(0,p.jsxs)(s.default,{style:{gap:8},children:[(0,p.jsx)(o.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,p.jsx)(o.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{T(!1),O(!1),P(!0)},testID:"override-open"})]}):(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{style:{flex:1},label:`Add ${S} to basket \xb7 ${(0,c.gbp)(_*S)}`,onPress:()=>z(!1),testID:"add-to-basket"}),A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,p.jsxs)(o.Sheet,{visible:I,onClose:()=>P(!1),title:"Allergy override",children:[(0,p.jsx)(o.Banner,{kind:"danger",title:`${j.name} contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`Your profile says: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}.`}),(0,p.jsx)(o.Toggle,{label:"I understand this dish contains an allergen I have declared",value:L,onChange:T}),(0,p.jsx)(o.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:D,onChange:O}),(0,p.jsx)(o.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,p.jsx)(o.Button,{kind:"danger",disabled:!L||!D,label:"Confirm override and add",onPress:()=>z(!0),testID:"override-confirm"})]})]})}},1213,[30,34,336,102,1214,1216,794,861,867,874,882,821,25]); __d(function(g,r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AllergenPanel=function({item:e,map:n,declared:u}){return(0,d.jsxs)(s.default,{style:{gap:6},accessibilityLabel:"Allergen panel",children:[(0,d.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,d.jsx)(o.T,{weight:"semibold",children:"Allergen panel (14 UK allergens)"}),(0,l.isLiveVenue)()?null:(0,d.jsx)(o.Badge,{label:"NOT CONNECTED",kind:"amber"})]}),(0,d.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:6},children:a.ALLERGENS.map(e=>{const l=n[e.id],c=u.find(l=>l.allergen===e.id),f='contains'===l?t.colours.redBg:'may'===l?t.colours.amberBg:t.colours.surface2,h='contains'===l?'#FFD9D4':'may'===l?'#FFE2A8':t.colours.muted;return(0,d.jsxs)(s.default,{style:{width:'48%',flexGrow:1,backgroundColor:f,borderRadius:8,padding:8,borderWidth:c?2:1,borderColor:c?t.colours.red:t.colours.border},children:[(0,d.jsx)(o.T,{size:14,weight:"medium",colour:l?h:t.colours.text,children:e.label}),(0,d.jsxs)(o.T,{size:13,colour:h,children:['contains'===l?'Contains':'may'===l?'May contain':'Not listed',c?` \xb7 YOUR ALLERGY (${(0,a.severityLabel)(c.severity)})`:'']})]},e.id)})}),e.allergenNotes?(0,d.jsxs)(o.Muted,{children:["Notes: ",e.allergenNotes]}):null,(0,d.jsx)(s.default,{testID:"allergen-signoff",children:(0,d.jsx)(o.Muted,{children:e.signOff?`From the dish's recipe card. Signed off by ${e.signOff.by} on ${c(e.signOff.at)}.`:"Awaiting the head chef's allergen sign-off: not available to order online."})}),(0,d.jsx)(o.Muted,{children:"Always tell staff about allergies when you order or arrive."})]})},_e.AllergenChips=function({map:e,declared:l}){const n=Object.entries(e);return n.length?(0,d.jsx)(o.Row,{wrap:!0,gap:5,children:n.sort((e,l)=>e[1]===l[1]?0:'contains'===e[1]?-1:1).map(([e,n])=>{const s=l.some(l=>l.allergen===e);return(0,d.jsx)(o.Badge,{label:`${s?'\u26a0 ':''}${(0,a.allergenLabel)(e)}${'may'===n?' (may)':''}`,kind:s?'contains'===n?'red':'amber':'neutral'},e)})}):(0,d.jsx)(o.Muted,{children:"No listed allergens"})},r(_d[0]);var e,l=r(_d[1]),n=r(_d[2]),s=(e=n)&&e.__esModule?e:{default:e},a=r(_d[3]),t=r(_d[4]),o=r(_d[5]),d=r(_d[6]);const c=e=>{const l=new Date(`${e.slice(0,10)}T12:00:00`);return isNaN(+l)?e:l.toLocaleDateString('en-GB',{day:'numeric',month:'long',year:'numeric'})}},1214,[34,1215,102,861,821,794,25]); @@ -1450,7 +1450,7 @@ __d(function(g,_r,i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModul __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.WipeDevice=function({compact:e}){const f=(0,u.useDisplaySettings)(p.VENUE_RID),[v,T]=(0,s.useState)(!1),[w,j]=(0,s.useState)(''),[D,C]=(0,s.useState)(!1),I='display'===h.APP_VARIANT&&f.pinOn,P=!I||(0,b.wakePinMatches)(f,w);return v?(0,x.jsxs)(o.default,{testID:"wipe-confirm-box",style:{gap:6,marginTop:6},children:[(0,x.jsx)(l.T,{size:e?12:14,children:"Sign out and remove everything CoverCharge keeps on this device: sign-ins, pairing, saved screens and any changes not sent yet. The venue\u2019s shared data is not touched. To use it again, open a personal link or pair the Display again."}),I?(0,x.jsx)(t.TextInput,{testID:"wipe-pin",value:w,onChangeText:j,placeholder:"Display wake PIN",placeholderTextColor:c.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display wake PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:c.colours.text}}):null,(0,x.jsxs)(o.default,{style:{flexDirection:'row',gap:8},children:[(0,x.jsx)(n.default,{testID:"wipe-confirm",accessibilityRole:"button",accessibilityLabel:"Yes, wipe this device",disabled:!P||D,onPress:()=>{C(!0),(0,y.wipeThisDevice)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:P?c.colours.red:'rgba(255,255,255,0.08)'},children:(0,x.jsx)(l.T,{size:12,weight:"semibold",children:D?'Wiping\u2026':'Yes, wipe this device'})}),(0,x.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:()=>{T(!1),j('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,x.jsx)(l.T,{size:12,children:"Cancel"})})]})]}):(0,x.jsx)(n.default,{testID:"wipe-device",accessibilityRole:"button",accessibilityLabel:"Sign out and wipe this device",onPress:()=>T(!0),style:{alignSelf:'flex-start',marginTop:e?4:0,minHeight:44,justifyContent:'center'},children:(0,x.jsx)(l.T,{size:e?12:14,colour:c.colours.gold,children:"Sign out and wipe this device\u2026"})})};var t=r(d[0]),s=r(d[1]),n=e(r(d[2])),o=e(r(d[3])),l=r(d[4]),c=r(d[5]),u=r(d[6]),p=r(d[7]),b=r(d[8]),h=r(d[9]),y=r(d[10]),x=r(d[11])},1367,[827,34,402,102,794,821,1021,5,1022,872,988,25]); __d(function(g,r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.PlanPhoto=function({rid:e}){const t=(0,n.usePlan)(e),b=(0,n.useFloor)(e=>e.setPlan),[y,f]=(0,a.useState)(null),[x,w]=(0,a.useState)(null),[v,j]=(0,a.useState)(null),[k,S]=(0,a.useState)(''),[P,T]=(0,a.useState)(!1),I=async e=>{let a;T(!0);try{const{data:t,error:l}=await(0,u.getSupabase)().functions.invoke('plan-photo-read',{body:{image:e}});a=l?{ok:!1,message:'The plan could not be read. The photo is still here.'}:{ok:!0,tables:(0,o.cleanFindings)(t)}}catch{a={ok:!1,message:'The plan could not be read. The photo is still here.'}}finally{T(!1)}const t=(0,o.planReadAfter)(e,a);w(t.photo),f(t.rows&&t.rows.length?t.rows:null),S(t.note)},L=async()=>{S('');const e=(await(0,c.pickPhotos)({source:'camera'}))[0];e?(w(e),await I(e)):S('No photo taken.')};return(0,p.jsxs)(l.default,{testID:"plan-photo",style:{width:'100%',alignItems:'center',gap:10},children:[(0,p.jsx)(s.Button,{testID:"plan-photo-camera",label:P?'Reading the plan\u2026':'Take a picture of the table plan',accessibilityLabel:"Take a picture of a hand-drawn table plan",disabled:P,onPress:()=>{L()}}),k?(0,p.jsx)(s.Muted,{center:!0,testID:"plan-photo-note",children:k}):null,x&&!P?(0,p.jsx)(s.Button,{kind:"ghost",testID:"plan-photo-retry",label:"Read this photo again",accessibilityLabel:"Read this photo again",onPress:()=>{I(x)}}):null,y?(0,p.jsx)(l.default,{testID:"plan-photo-review",style:{width:'100%'},children:(0,p.jsxs)(s.Card,{style:{alignItems:'center',width:'100%'},children:[(0,p.jsx)(s.T,{center:!0,weight:"bold",colour:h.colours.gold,children:"Check what was read"}),(0,p.jsx)(s.Muted,{center:!0,children:"Nothing is saved until you tap Save the plan."}),y.map((e,a)=>(0,p.jsxs)(l.default,{style:{width:'100%',gap:6},children:[(0,p.jsx)(s.Field,{label:"Area",accessibilityLabel:`Area ${a+1}`,value:e.area,onChangeText:e=>f(y.map((t,l)=>l===a?{...t,area:e}:t))}),(0,p.jsx)(s.Field,{label:"Table",accessibilityLabel:`Table ${a+1}`,value:e.name,onChangeText:e=>f(y.map((t,l)=>l===a?{...t,name:e}:t))}),(0,p.jsx)(s.Field,{label:"Seats",accessibilityLabel:`Seats at table ${a+1}`,value:String(e.seats),keyboardType:"number-pad",onChangeText:e=>f(y.map((t,l)=>l===a?{...t,seats:Math.max(1,Math.min(30,Number(e.replace(/\D/g,''))||1))}:t))}),(0,p.jsx)(s.Button,{kind:"ghost",label:`Remove ${e.name||'table'}`,accessibilityLabel:`Remove ${e.name||'table'}`,onPress:()=>f(y.filter((e,t)=>t!==a))})]},`${e.area}-${e.name}-${a}`)),(0,p.jsx)(s.Button,{testID:"plan-photo-save",label:"Save the plan",accessibilityLabel:"Save the checked table plan",disabled:!y.length,onPress:()=>{if(!y?.length)return;j(t);const a=[...t.areas],l=[...t.tables];for(const e of y){let t=a.find(a=>a.name.toLowerCase()===e.area.toLowerCase());t||(t={id:(0,i.fid)('area'),name:e.area},a.push(t));const s=(0,i.sizeFor)(e.seats),n=l.filter(e=>e.areaId===t.id).length;l.push({id:(0,i.fid)('t'),name:e.name,areaId:t.id,shape:s.shape,minSeats:1,maxSeats:e.seats,x:40+n%6*140,y:40+120*Math.floor(n/6),w:s.w,h:s.h,rot:0,online:!0})}b(e,{...t,areas:a,tables:l}),f(null),S('Plan saved. Undo puts the previous plan back.')}})]})}):null,v?(0,p.jsx)(s.Button,{kind:"ghost",testID:"plan-photo-undo",label:"Undo table plan",accessibilityLabel:"Undo the table plan and restore the previous one",onPress:()=>{b(e,v),j(null),S('Previous plan restored.')}}):null]})};var e,a=r(d[0]),t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},s=r(d[2]),n=r(d[3]),o=r(d[4]),i=r(d[5]),h=r(d[6]),c=r(d[7]),u=r(d[8]),p=r(d[9])},1368,[34,102,794,1021,1369,859,821,1066,934,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.planReadAfter=function(t,o){return o.ok?o.tables.length?{photo:t,rows:o.tables,note:''}:{photo:t,rows:[],note:'Nothing readable on that photo. The photo is still here.'}:{photo:t,rows:null,note:o.message}},e.cleanFindings=function(o){if(!o||'object'!=typeof o)return[];const n=o.tables;if(!Array.isArray(n))return[];const s=[];for(const o of n.slice(0,80)){if(!o||'object'!=typeof o)continue;const n=t(o.area,40),c=t(o.name,12),l=o.seats;!n||!c||'number'!=typeof l||!Number.isInteger(l)||l<1||l>30||s.push({area:n,name:c,seats:l})}return s};const t=(t,o)=>'string'==typeof t?t.trim().slice(0,o):''},1369,[]); -__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:n}=(0,l.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[b,h]=(0,t.useState)(String(e.settings.turnMins??'')),[y,v]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[f,k]=(0,t.useState)(!1),M=(e,t,n)=>c(s=>({...s,[e]:0===t?[n,s[e]?.[1]??'']:[s[e]?.[0]??'',n]})),S=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(b)<=360&&Number(y)>=1&&Number(y)<=1e3;return(0,r.jsxs)(s.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(n=>({...n,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>M(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>M(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:b,onChangeText:h,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:y,onChangeText:v,keyboardType:"number-pad"})]}),(0,r.jsx)(i.Button,{label:f?'Saving\u2026':'Save booking times',disabled:!S||f,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{k(!0);try{await(0,o.saveStaffBookingTimes)(n,u,Number(b),Number(y)),j('Booking times saved.')}catch(e){j(e.message)}finally{k(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),n=_r(_d[1]),s=(e=n)&&e.__esModule?e:{default:e},i=_r(_d[2]),l=_r(_d[3]),o=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1370,[34,102,794,1079,988,25]); +__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:s}=(0,o.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[h,b]=(0,t.useState)(String(e.settings.turnMins??'')),[v,y]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[k,S]=(0,t.useState)(!1),f=(e,t,s)=>c(n=>({...n,[e]:0===t?[s,n[e]?.[1]??'']:[n[e]?.[0]??'',s]})),p=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(h)<=360&&Number(v)>=1&&Number(v)<=1e3;return(0,r.jsxs)(n.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(s=>({...s,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>f(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>f(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:h,onChangeText:b,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:v,onChangeText:y,keyboardType:"number-pad"}),e.settings.bookingCoversPerStart||e.settings.bookingPartiesPerStart?(0,r.jsx)(i.Muted,{center:!0,children:"Online booking uses the covers and bookings caps at each start time (Settings \u203a Capacity & waitlist), not this half-hour figure."}):null]}),(0,r.jsx)(i.Button,{label:k?'Saving\u2026':'Save booking times',disabled:!p||k,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{S(!0);try{await(0,l.saveStaffBookingTimes)(s,u,Number(h),Number(v)),j('Booking times saved.')}catch(e){j(e.message)}finally{S(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),s=_r(_d[1]),n=(e=s)&&e.__esModule?e:{default:e},i=_r(_d[2]),o=_r(_d[3]),l=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1370,[34,102,794,1079,988,25]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffTableOrders=function({rid:e,me:l}){const p=(0,c.useOrderAtTable)(e),x=(0,c.useNow)(15e3),f=(0,c.useStore)(e=>e.bookings),w=(0,c.useOrders)(e).filter(i.isTableQr).sort((e,t)=>t.createdAt.localeCompare(e.createdAt)),S=w.filter(i.waitingForStaff),y=w.filter(e=>m(e)&&!(0,i.waitingForStaff)(e)),v=w.filter(e=>!m(e)).slice(0,8),[k,T]=(0,s.useState)(null),[$,B]=(0,s.useState)(null),M=e=>{c.repo.orders.accept(e.id,l),B(`${e.ref} accepted for table ${(0,t.tableNumbers)(e.tableNo)}: it's gone to the kitchen.`)},N=e=>{const t=(0,h.statusBlock)(e,'served',(0,h.linkedBooking)(e,f));if(t)return void B(`${e.ref}: ${t}`);const s=(new Date).toISOString();c.useStore.setState(t=>({orders:t.orders.map(t=>t.id===e.id?{...t,servedBy:{by:l,at:s}}:t)})),c.useStore.getState().setOrderStatus(e.id,'served',l),B(`${e.ref} marked served.`)},O=(e,t)=>{const s=(new Date).toISOString();c.useStore.setState(r=>({orders:r.orders.map(r=>r.id===e.id?{...r,cancelReason:t,cancelledBy:{by:l,at:s}}:r)})),c.useStore.getState().setOrderStatus(e.id,'cancelled',l),T(null),B(`${e.ref} cancelled (${t}). The guest's phone shows the reason.`)},A=({o:e,held:s})=>(0,b.jsxs)(a.Card,{highlight:s?u.colours.amber:e.allergies.length?u.colours.red:u.colours.gold,children:[(0,b.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,b.jsxs)(a.T,{weight:"semibold",children:["Table ",(0,t.tableNumbers)(e.tableNo)," \xb7 ",e.ref]}),(0,b.jsx)(a.Badge,{kind:s?'amber':'cancelled'===e.status?'neutral':'gold',label:s?'Waiting for you':'served'===e.status?'Served':'cancelled'===e.status?'Cancelled':'In the kitchen'})]}),(0,b.jsxs)(a.Muted,{children:[e.customerName," \xb7 ",j(e.createdAt,x),e.accepted?` \xb7 accepted by ${e.accepted.by}`:'']}),e.lines.map((e,t)=>(0,b.jsxs)(a.T,{children:[e.qty,"\xd7 ",e.name,e.notes?` (note: ${e.notes})`:'']},t)),e.allergies.length?(0,b.jsx)(a.Row,{wrap:!0,gap:6,children:e.allergies.map(e=>(0,b.jsx)(a.Badge,{kind:"red",label:`${(0,n.allergenLabel)(e.allergen)}: ${(0,n.severityLabel)(e.severity)}`},e.allergen))}):(0,b.jsx)(a.Muted,{children:"No allergies declared."}),e.notes?(0,b.jsxs)(a.T,{size:13,children:["Note: ",e.notes]}):null,(0,b.jsxs)(a.T,{size:13,colour:u.colours.muted,children:[(0,o.gbp)(e.total)," to pay at the bar or with the server"]}),'cancelled'===e.status&&e.cancelReason?(0,b.jsxs)(a.Muted,{children:["Reason: ",e.cancelReason]}):null,m(e)?k===e.id?(0,b.jsxs)(r.default,{style:{gap:6},children:[(0,b.jsx)(a.T,{size:13,children:"Why are you cancelling? The guest sees this."}),(0,b.jsx)(a.Row,{wrap:!0,gap:6,children:i.CANCEL_REASONS.map(t=>(0,b.jsx)(a.Chip,{label:t,onPress:()=>O(e,t)},t))}),(0,b.jsx)(a.Button,{small:!0,kind:"ghost",label:"Don't cancel",onPress:()=>T(null)})]}):(0,b.jsxs)(a.Row,{gap:8,wrap:!0,children:[s?(0,b.jsx)(a.Button,{small:!0,label:"Accept",testID:`accept-${e.ref}`,onPress:()=>M(e)}):(0,b.jsx)(a.Button,{small:!0,label:"Mark served",testID:`served-${e.ref}`,onPress:()=>N(e)}),(0,b.jsx)(a.Button,{small:!0,kind:"secondary",label:"Cancel with a reason",onPress:()=>T(e.id)})]}):null]});return(0,b.jsxs)(r.default,{style:{gap:10},children:[(0,b.jsx)(a.Muted,{children:"Tip: orders from guests' phones land here within seconds. Accept the first one from a new phone, check allergies, then mark it served. Guests pay at the bar or with their server."}),p?null:(0,b.jsx)(a.Banner,{kind:"demo",title:"Order at the table is off",children:"Managers can switch it on in Settings \u203a Advanced \u203a Order at the table."}),$?(0,b.jsx)(a.Banner,{kind:"success",children:$}):null,(0,b.jsxs)(a.T,{weight:"semibold",children:["Waiting for you to accept (",S.length,")"]}),S.length?S.map(e=>(0,b.jsx)(A,{o:e,held:!0},e.id)):(0,b.jsx)(a.Muted,{children:"Nothing waiting."}),(0,b.jsxs)(a.T,{weight:"semibold",children:["In the kitchen (",y.length,")"]}),y.length?y.map(e=>(0,b.jsx)(A,{o:e,held:!1},e.id)):(0,b.jsx)(a.Muted,{children:"No table orders being made."}),v.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a.T,{weight:"semibold",children:"Served or cancelled"}),v.map(e=>(0,b.jsx)(A,{o:e,held:!1},e.id))]}):null]})};var e,t=_r(d[0]),s=_r(d[1]),l=_r(d[2]),r=(e=l)&&e.__esModule?e:{default:e},a=_r(d[3]),n=_r(d[4]),o=_r(d[5]),i=_r(d[6]),c=_r(d[7]),h=_r(d[8]),u=_r(d[9]),b=_r(d[10]);const j=(e,t)=>{const s=Math.max(0,Math.round((t.getTime()-new Date(e).getTime())/6e4));return s<1?'just now':`${s} min ago`},m=e=>!['served','collected','closed','cancelled'].includes(e.status)},1371,[860,34,102,794,861,867,1148,874,869,821,25]); __d(function(g,_r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.customerCodeLink=y,_e.StaffLoyalty=function({venue:e,canRemove:r=!1,onOpenSettings:u}){const[p,x]=(0,t.useState)(null),[y,b]=(0,t.useState)(''),[S,k]=(0,t.useState)(null),[v,C]=(0,t.useState)(null),[M,T]=(0,t.useState)(!1),[B,R]=(0,t.useState)(''),[P,O]=(0,t.useState)(null),$=(0,c.staffServer)(),L=(0,n.can)('venue.settings'),[N,E]=(0,t.useState)(!1),[D,A]=(0,t.useState)(''),F=async e=>{if(p){E(!0),A('');try{await(0,c.saveSettings)({...p,cardOn:e}),x({...p,cardOn:e,saved:!0});const n=e?'Stamp card switched on':'Stamp card switched off';A(n),s.default.announceForAccessibility?.(n)}catch(e){R((0,o.plainError)(e))}E(!1)}},I=(0,t.useCallback)(()=>{$&&(0,c.readSettings)().then(x).catch(()=>{})},[$]);(0,t.useEffect)(()=>(I(),(0,c.watchLoyalty)(()=>{I(),C(e=>(e&&(0,c.staffCard)(e.id).then(C).catch(()=>{}),e))})),[I]);const _=async(e=y)=>{R('');try{const n=await(0,c.staffFind)(e);k(n),1===n.length&&C(n[0])}catch(e){R((0,o.plainError)(e))}},z=(0,t.useCallback)(e=>{T(!1),b((0,o.prettyCardNo)(e)),_(e)},[]);return $?(0,m.jsxs)(l.default,{style:{gap:10},children:[!p||p.cardOn||L?null:(0,m.jsx)(i.Banner,{kind:"info",title:"The stamp card is off",children:"Ask a manager to switch it on."}),p&&L?(0,m.jsx)(i.Card,{children:(0,m.jsxs)(l.default,{style:{gap:8},testID:"loy-quick",children:[p.cardOn?null:(0,m.jsx)(i.T,{weight:"semibold",children:"The stamp card is off"}),(0,m.jsx)(i.Toggle,{testID:"loy-quick-on",label:"Stamp card on",a11y:"Stamp card on. "+(p.cardOn?'On':'Off'),value:p.cardOn,disabled:N,onChange:e=>{F(e)}}),D?(0,m.jsx)(l.default,{accessibilityLiveRegion:"polite",children:(0,m.jsx)(i.Muted,{children:D})}):null,u?(0,m.jsx)(i.Button,{kind:"ghost",label:"Change the stamp card",testID:"loy-open-settings",onPress:u}):null]})}):null,p&&p.saved?(0,m.jsxs)(i.Muted,{children:[p.stampsNeeded," stamps = ",p.reward||'reward not set',". At most ",p.maxPerDay," a day",p.gapMinutes?`, ${p.gapMinutes} minutes apart`:'',"."]}):null,p&&!p.saved&&L?(0,m.jsxs)(i.Muted,{children:["Suggested settings, not saved yet: ",p.stampsNeeded," stamps = ",p.reward||'reward not set',". At most ",p.maxPerDay," a day",p.gapMinutes?`, ${p.gapMinutes} minutes apart`:'',"."]}):null,(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Find a guest"}),(0,m.jsx)(i.Field,{label:"Name, phone, email or card number",value:y,onChangeText:b,onSubmitEditing:()=>_(),autoCapitalize:"none",testID:"loyalty-search"}),(0,m.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(i.Button,{small:!0,label:"Find",disabled:y.trim().length<2,onPress:()=>_(),testID:"loyalty-find"}),(0,h.canScan)()?(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:M?'Scanning\u2026':'Scan their card',onPress:()=>T(!0)}):null]}),M?(0,m.jsx)(h.CardScanner,{onCard:z,onClose:()=>T(!1)}):null,B?(0,m.jsx)(i.Banner,{kind:"warn",children:B}):null,S&&!S.length?(0,m.jsx)(i.Muted,{children:"No one found. Check the spelling, or sign them up below."}):null,S&&S.length>1?S.map(e=>(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{children:e.name}),(0,m.jsxs)(i.Muted,{children:[(0,o.prettyCardNo)(e.cardNo)," \xb7 ",e.stamps," of ",e.needed,e.phone?` \xb7 ${e.phone}`:'']})]}),e.rewards.length?(0,m.jsx)(i.Badge,{kind:"gold",label:`${e.rewards.length} ready`}):null,(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Open",onPress:()=>C(e)})]},e.id)):null]}),v?(0,m.jsx)(f,{card:v,settings:p,canRemove:r,onChange:e=>{C(e),k(null)},onClose:()=>C(null)}):null,(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Stamp code"}),(0,m.jsx)(i.Muted,{children:"Busy? Make a one-time code and show it to the guest; they type it (or scan it) on their own phone for one stamp."}),P?(0,m.jsx)(j,{c:P,what:"One stamp."}):null,(0,m.jsx)(i.Button,{kind:"secondary",label:P?'Make another code':'Make a stamp code',disabled:!1===p?.cardOn,onPress:()=>{R(''),(0,c.staffCode)('stamp').then(O).catch(e=>R((0,o.plainError)(e)))}})]}),(0,m.jsx)(w,{venue:e,onJoined:e=>{C(e),k(null)}}),(0,m.jsx)(i.Muted,{children:"Tip: search by the last 4 digits of a phone number. Each reward can only be used once, and the card shows who used it and when."})]}):(0,m.jsxs)(l.default,{style:{gap:10},children:[(0,m.jsx)(i.Banner,{kind:"info",title:"Connect to your venue first",children:"The stamp card is saved on your venue's account. Open your invite link on this phone to connect, then you can find guests and add stamps here."}),(0,m.jsx)(i.Muted,{children:"Tip: stamps can only be added by staff of the venue, so a guest can't stamp their own card."})]})};var n=_r(d[0]),t=_r(d[1]),s=e(_r(d[2]));_r(d[3]);var l=e(_r(d[4])),r=_r(d[5]),i=_r(d[6]),o=_r(d[7]),c=_r(d[8]),u=_r(d[9]),h=_r(d[10]),m=_r(d[11]);const p=e=>{try{return new Date(e).toLocaleString('en-GB',{day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})}catch{return e}},x=e=>{try{return new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})}catch{return''}};function y(e){if('undefined'==typeof window||!window.location)return e;const n=window.location.pathname.match(/^(.*?)\/(owner|staff|customer|display|chef)-app(\/|$)/);return new URL(`${n?n[1]:''}/customer-app/index.html?loyalty=${e}`,window.location.origin).toString()}function j({c:e,what:n}){return(0,m.jsxs)(l.default,{style:{gap:4,alignItems:'center'},children:[(0,m.jsx)(i.T,{size:34,weight:"bold",colour:u.colours.gold,center:!0,children:e.code}),(0,m.jsx)(r.QR,{value:y(e.code),size:150}),(0,m.jsxs)(i.Muted,{center:!0,children:[n," Works once, until ",x(e.expiresAt),". The guest types it in Stamp card, or scans this with their phone camera."]})]})}function f({card:e,settings:n,canRemove:s,onChange:r,onClose:h}){const[x,y]=(0,t.useState)(null),[f,w]=(0,t.useState)(!1),[b,S]=(0,t.useState)(null),[k,v]=(0,t.useState)(null),C=async e=>{w(!0),y(null);try{await e()}catch(e){y({kind:'warn',text:(0,o.plainError)(e)})}finally{w(!1),S(null)}};return(0,m.jsxs)(i.Card,{highlight:u.colours.gold,children:[(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.H2,{children:e.name}),(0,m.jsxs)(i.Muted,{children:["Card ",(0,o.prettyCardNo)(e.cardNo),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']})]}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Close",onPress:h})]}),(0,m.jsxs)(i.T,{size:20,weight:"semibold",children:[e.stamps," of ",e.needed," stamps"]}),(0,m.jsxs)(i.Muted,{children:["Next reward: ",e.reward]}),x?(0,m.jsx)(i.Banner,{kind:x.kind,children:x.text}):null,(0,m.jsx)(i.Button,{label:f?'Saving\u2026':'Add a stamp',disabled:f||!1===n?.cardOn,testID:"loyalty-add-stamp",onPress:()=>C(async()=>{const n=await(0,c.staffStamp)(e.id);r(n),y({kind:'success',text:n.newReward?`Stamp added. ${e.name} has earned: ${n.rewards[n.rewards.length-1]?.title??'a reward'}.`:`Stamp added: ${n.stamps} of ${n.needed}.`})})}),!1===n?.cardOn?(0,m.jsx)(i.Muted,{children:"The stamp card is switched off in Settings \u203a Advanced \u203a Loyalty, so no stamps can be added."}):null,e.rewards.length?(0,m.jsx)(i.T,{weight:"semibold",children:"Rewards ready"}):(0,m.jsx)(i.Muted,{children:"No rewards ready yet."}),e.rewards.map(e=>(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{children:e.title}),e.expiresAt?(0,m.jsxs)(i.Muted,{children:["Use by ",p(e.expiresAt)]}):null]}),b===e.id?(0,m.jsxs)(i.Row,{gap:6,children:[(0,m.jsx)(i.Button,{small:!0,label:"Yes, used now",disabled:f,onPress:()=>C(async()=>{const n=await(0,c.staffRedeem)(e.id);r(n),y({kind:'success',text:`${n.redeemed} marked used.`})})}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Not yet",onPress:()=>S(null)})]}):(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Use reward",onPress:()=>S(e.id)})]},e.id)),(0,m.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Sign-in code for their phone",onPress:()=>C(async()=>v(await(0,c.staffCode)('link',e.id)))}),s?'remove'===b?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(i.Button,{small:!0,kind:"danger",label:"Yes, remove their details",onPress:()=>C(async()=>{await(0,c.staffRemove)(e.id),r(null),h()})}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Keep",onPress:()=>S(null)})]}):(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"Remove guest",onPress:()=>S('remove')}):null]}),k?(0,m.jsx)(j,{c:k,what:`Opens ${e.name}'s card on their phone.`}):null,'remove'===b?(0,m.jsx)(i.Muted,{children:"Removing wipes their name, phone and email and closes the card (for example if they ask you to delete their data). Counts in the summary stay."}):null,(0,m.jsx)(i.T,{weight:"semibold",children:"Recent"}),e.history.length?e.history.slice(0,8).map((e,n)=>(0,m.jsxs)(i.Muted,{children:[p(e.at)," \xb7 ",e.what]},n)):(0,m.jsx)(i.Muted,{children:"Nothing yet."})]})}function w({venue:e,onJoined:n}){const[s,l]=(0,t.useState)(''),[r,u]=(0,t.useState)(''),[h,p]=(0,t.useState)(''),[x,y]=(0,t.useState)(!1),[j,f]=(0,t.useState)(!1),[w,b]=(0,t.useState)('');return(0,m.jsxs)(i.Card,{children:[(0,m.jsx)(i.H2,{children:"Sign a guest up"}),(0,m.jsx)(i.Muted,{children:"Only a name is needed. Read the agreement to the guest and tick it only if they say yes."}),(0,m.jsx)(i.Field,{label:"Guest's name",value:s,onChangeText:l,maxLength:60}),(0,m.jsx)(i.Field,{label:"Phone (optional)",value:r,onChangeText:u,keyboardType:"phone-pad",maxLength:20}),(0,m.jsx)(i.Field,{label:"Email (optional)",value:h,onChangeText:p,keyboardType:"email-address",autoCapitalize:"none",maxLength:120}),(0,m.jsx)(i.Toggle,{label:`The guest agrees: \u201c${(0,o.consentText)(e)}\u201d`,value:x,onChange:y}),w?(0,m.jsx)(i.Banner,{kind:"warn",children:w}):null,(0,m.jsx)(i.Button,{label:j?'Saving\u2026':'Sign up',disabled:j||!x||!s.trim(),onPress:async()=>{f(!0),b('');try{n(await(0,c.staffJoin)({name:s,phone:r,email:h,consent:x,consentText:(0,o.consentText)(e)})),l(''),u(''),p(''),y(!1)}catch(e){b((0,o.plainError)(e))}finally{f(!1)}}})]})}},1372,[988,34,281,236,102,1247,794,1222,1225,821,1373,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"canScan",{enumerable:!0,get:function(){return l}}),_e.CardScanner=function({onCard:t,onClose:n}){const f=(0,e.useRef)(null),[h,w]=(0,e.useState)('');return(0,e.useEffect)(()=>{if(!l())return void w('This browser can\u2019t scan. Type the card number or search by name instead.');let e=!1,n=null,c=null;const o=document.createElement('video');return o.setAttribute('playsinline','true'),o.muted=!0,Object.assign(o.style,{width:'100%',maxWidth:'360px',borderRadius:'12px',border:'2px solid #CFA45F'}),(async()=>{try{if(n=await navigator.mediaDevices.getUserMedia({video:{facingMode:'environment'}}),e)return void n.getTracks().forEach(e=>e.stop());o.srcObject=n,await o.play();const u=f.current;u?.appendChild(o);const l=new(0,window.BarcodeDetector)({formats:['qr_code']}),h=async()=>{if(!e){try{const e=await l.detect(o);for(const n of e){const e=(0,s.readCardQr)(String(n.rawValue??''));if(e)return void t(e)}}catch{}c=setTimeout(h,300)}};h()}catch{w('The camera didn\u2019t start. Allow the camera, or type the card number instead.')}})(),()=>{e=!0,c&&clearTimeout(c),n?.getTracks().forEach(e=>e.stop()),o.remove()}},[t]),(0,u.jsxs)(c.default,{style:{gap:8,alignItems:'center'},children:[(0,u.jsx)(c.default,{ref:f,style:{width:'100%',alignItems:'center'}}),h?(0,u.jsx)(o.Banner,{kind:"warn",children:h}):(0,u.jsx)(o.Muted,{center:!0,children:"Point the camera at the QR on the guest\u2019s card screen."}),(0,u.jsx)(o.Button,{kind:"ghost",label:"Close camera",onPress:n})]})};var e=r(d[0]);r(d[1]);var t,n=r(d[2]),c=(t=n)&&t.__esModule?t:{default:t},o=r(d[3]),s=r(d[4]),u=r(d[5]);const l=()=>'undefined'!=typeof window&&'BarcodeDetector'in window&&!!navigator?.mediaDevices?.getUserMedia},1373,[34,236,102,794,1222,25]); diff --git a/staff-app/admin.html b/staff-app/admin.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/admin.html +++ b/staff-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer.html b/staff-app/customer.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer.html +++ b/staff-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage.html b/staff-app/customer/anchorage.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer/anchorage.html +++ b/staff-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/book.html b/staff-app/customer/anchorage/book.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer/anchorage/book.html +++ b/staff-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/feedback.html b/staff-app/customer/anchorage/feedback.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer/anchorage/feedback.html +++ b/staff-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/gift.html b/staff-app/customer/anchorage/gift.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer/anchorage/gift.html +++ b/staff-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/lost.html b/staff-app/customer/anchorage/lost.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer/anchorage/lost.html +++ b/staff-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/loyalty.html b/staff-app/customer/anchorage/loyalty.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer/anchorage/loyalty.html +++ b/staff-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/merch.html b/staff-app/customer/anchorage/merch.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer/anchorage/merch.html +++ b/staff-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/offers.html b/staff-app/customer/anchorage/offers.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer/anchorage/offers.html +++ b/staff-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/refer.html b/staff-app/customer/anchorage/refer.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer/anchorage/refer.html +++ b/staff-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/waitlist.html b/staff-app/customer/anchorage/waitlist.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer/anchorage/waitlist.html +++ b/staff-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/whatson.html b/staff-app/customer/anchorage/whatson.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer/anchorage/whatson.html +++ b/staff-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/basket.html b/staff-app/customer/basket.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer/basket.html +++ b/staff-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/profile.html b/staff-app/customer/profile.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/customer/profile.html +++ b/staff-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/demo.html b/staff-app/demo.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/demo.html +++ b/staff-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/display.html b/staff-app/display.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/display.html +++ b/staff-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/index.html b/staff-app/index.html index cd82da23741d9a615f5ead8b2ff4ed54a781ea2b..e90b73de2fc6dd0e89996edd08a35dd4cc3a6dca 100644 --- a/staff-app/index.html +++ b/staff-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/kitchen.html b/staff-app/kitchen.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/kitchen.html +++ b/staff-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/owner.html b/staff-app/owner.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/owner.html +++ b/staff-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/staff.html b/staff-app/staff.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/staff.html +++ b/staff-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/sw.js b/staff-app/sw.js index 006f79d25f7258c88fb134c3cf5abcc27772d90b..b8ef0272816bd7be985ced5c673ad1af26516242 100644 --- a/staff-app/sw.js +++ b/staff-app/sw.js @@ -1,7 +1,7 @@ // Anchorage Staff service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-staff-bdbbf50f5d"; +const V = "cc-staff-aaa38149d4"; const BASE = "/staff-app/"; -const PRECACHE = ["/staff-app/apple-touch-icon.png", "/staff-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/staff-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/staff-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/staff-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/staff-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/staff-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/staff-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/staff-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/staff-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/staff-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/staff-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/staff-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/staff-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/staff-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/staff-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/staff-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/staff-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/staff-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/staff-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/staff-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/staff-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/staff-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/staff-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/staff-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/staff-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/staff-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/staff-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/staff-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/staff-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/staff-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/staff-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/staff-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/staff-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/staff-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/staff-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/staff-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/staff-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/staff-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/staff-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/staff-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/staff-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/staff-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/staff-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/staff-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/staff-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/staff-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/staff-app/brand-logo.png", "/staff-app/favicon.ico", "/staff-app/icon-192.png", "/staff-app/icon-512.png", "/staff-app/icon-maskable-192.png", "/staff-app/icon-maskable-512.png", "/staff-app/manifest.webmanifest", "/staff-app/index.html", "/staff-app/_expo/static/js/web/bundle.js?v=bdbbf50f5df76d94ac4a32df95b352ebaa80c4a87a2192aa078c0f39b89b062a"]; +const PRECACHE = ["/staff-app/apple-touch-icon.png", "/staff-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/staff-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/staff-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/staff-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/staff-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/staff-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/staff-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/staff-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/staff-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/staff-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/staff-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/staff-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/staff-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/staff-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/staff-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/staff-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/staff-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/staff-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/staff-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/staff-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/staff-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/staff-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/staff-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/staff-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/staff-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/staff-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/staff-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/staff-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/staff-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/staff-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/staff-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/staff-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/staff-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/staff-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/staff-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/staff-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/staff-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/staff-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/staff-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/staff-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/staff-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/staff-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/staff-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/staff-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/staff-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/staff-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/staff-app/brand-logo.png", "/staff-app/favicon.ico", "/staff-app/icon-192.png", "/staff-app/icon-512.png", "/staff-app/icon-maskable-192.png", "/staff-app/icon-maskable-512.png", "/staff-app/manifest.webmanifest", "/staff-app/index.html", "/staff-app/_expo/static/js/web/bundle.js?v=aaa38149d4e9095ab8f2a437f73eb509d892a07bbc40c94341909a03c9aab488"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/staff-app/team.html b/staff-app/team.html index 4782c50a4b45a7394adc601ec0c05d2ac013c1fa..3067d6dd0b9ac777be1f38c6665e630384002296 100644 --- a/staff-app/team.html +++ b/staff-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - +