diff --git a/CHECKSUMS.txt b/CHECKSUMS.txt index e2bb33ca701cef9bd3589539147e816277409cb3..3c48889932119679bbac363b12683bcc3d93cfc9 100644 --- a/CHECKSUMS.txt +++ b/CHECKSUMS.txt @@ -1,23 +1,23 @@ -Cover Charge prototype v0.1.10: web apps only. No APKs were built for v0.1.2 to v0.1.10. +Cover Charge prototype v0.1.11: web apps only. No APKs were built for v0.1.2 to v0.1.11. SHA-256 of each web app's start page, service worker, manifest and logo: -07a6eaaa1f0e7de4b83941c85248587e2715e863f0f100bce65d84b2329a997e owner-app/index.html -2a2028cad2d92837ad4e61c1168b91c0ae7431a00bd04f25daee23c756e4b558 owner-app/sw.js +4105a9f68a61cf4995ac878504bdce92f3efc90c4862e3bc4c9ca2eb6cd1c30d owner-app/index.html +5cf576471550d901896d3a7614be5dfc0a7c0aa5eec5e7cadde577f13f97c080 owner-app/sw.js f55e319dbc2c60a4fdc484584098bc3c80b780d7ee8b8df280c30a673f94e69d owner-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 owner-app/brand-logo.png -83f1d8796df5a293ce1aa14ce2124ccbaae1b866e2c8d3ac81adc1d3c822484d staff-app/index.html -2692c0672b532f97b8853692a7cc00f4ad4a0a1ff76aebab947886dc9471d3a1 staff-app/sw.js +f81ef0adb1a557d20c21a7fd8eaa77c10e9bf3503ce5f8176493ae213e2ec1f7 staff-app/index.html +4b4424fc6c5a73b852dfa318ea1ad96909c7b1e456b5ba78f7c7ddc2173b0885 staff-app/sw.js 18923b63d620744c81e8ae77204858313f0e3c54683b0c68a4ef6417975b92e3 staff-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 staff-app/brand-logo.png -028ca5b6ff30447e6b8012319dbca6b513567d449c526213b4a59faea6f32b71 customer-app/index.html -6fbafd872e2287196a03b726b47233146860270b7df2c9683a12e8afc01ec0a0 customer-app/sw.js +2896937781bead31d2cd30f8b2c20c94a710a5b3df80d29f63d8289cd95b5360 customer-app/index.html +3fd8d5e517c3cea2500e4723f930996168690fb35e51fccb1fe67377b91ff6e5 customer-app/sw.js 559816eba2698515c255da3cb9240a338f5bf8f5a4826a64e332cf51d5522e09 customer-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 customer-app/brand-logo.png -318d227f6b6ac4dcb31c90f4668233469705c1eff918d34ba5bc99a63581d13f display-app/index.html -f607ca7fe8cf6899724cbcba333766fd7beaffc216d0e3de2d417d5b3ddf8d9d display-app/sw.js +a12aa574fc0887bc0e1ef485ba70768c57f329284a1364ef733d4dcbff768d2a display-app/index.html +38c5ec447a4e36eea59351060b0b7dbf90ab30c57dc0cc3df828ec7737d6f878 display-app/sw.js 8212811f397e23840df0b7ecb6a753ce5532c9383d6fdcad71b2deea30665077 display-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 display-app/brand-logo.png -b80d9eb7ada56bd758c1d8f634d1b911ae174018e92df96d60e2562387301b84 chef-app/index.html -8a436c6de6ab8a301284ef212572691e6b0841b4a7d4686a383e02dd48106e79 chef-app/sw.js +31d9132f4c82b037d312bb6d214ddfa56053be1f3b96005c943b657f9f2449fd chef-app/index.html +ec87dc0129d6bf31d715bfe85744247f085e9b912fa7251c6d41e27732205e2e chef-app/sw.js 7aa962371046330167f56dd74180ed58cba417770e3e4bae9ec8289b1837c461 chef-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 chef-app/brand-logo.png diff --git a/HOW-TO-INSTALL.txt b/HOW-TO-INSTALL.txt index 08a3b31ca027e082247975292004b2df546cdea0..dd9f176f76b7961af01778ca3909729da7aef4fb 100644 --- a/HOW-TO-INSTALL.txt +++ b/HOW-TO-INSTALL.txt @@ -1,4 +1,4 @@ -Cover Charge prototype apps, v0.1.10 (web apps) +Cover Charge prototype apps, v0.1.11 (web apps) Pilot restaurant: The Anchorage, Harbour View, Dunure These are test versions with made-up demo data. No real payments, messages, social posts or location tracking happen. @@ -40,6 +40,7 @@ TIPS - Food safety (HACCP): Head Chef > Kitchen > Food safety log; Staff > Me > Food safety checks; Managers > More > Food safety log. Today shows a progress ring and the opening, midday and closing checks with what is due or overdue; tap a check, type the temperature on the big keypad or say it, and it is signed with your initials and the time. Out of range needs a corrective action (and can take a photo). Fridges & units shows each unit green, amber or red with its trend. Diary for notes and the daily sign-off, Weekly sign-off for the Head Chef or a manager, and EHO report for a PDF, print or CSV for any dates. The app never fills in a reading. Wireless probes: add a probe and follow Connect your probe; there is no probe hardware in the prototype, so probes show Not connected and no probe readings appear. - My avatar (Staff > Me > My avatar; Managers > More > My avatar): everyone has a retro space-age avatar. Create my avatar from a photo turns a photo or selfie into a stylised avatar on the phone itself; the photo is never uploaded. You can only change your own; managers can reset one. - New dish creator: add each price you pay for an ingredient and cost dishes at the latest price or the average of the last 3, 5 or 10. Booking counts show Tables and Pax. +- Specials board (Managers > More > Specials board; Head Chef > Kitchen > Specials board): take or upload a photo of the chalkboard and/or type each special with its price and allergens, tick the allergen check, then Post to customer app. Update today's specials, Clear board (asks first) and Use again on a past board. In the customer app the menu has Main menu, Specials and Takeaway tabs; Specials shows the photo (tap to zoom) and typed specials with allergens and when it was updated. The sample board uses example dishes. - Accident book: in Managers, Staff and Head Chef. Staff and Head Chef see their own entries; managers see all, with a RIDDOR prompt for serious ones. Nothing is reported automatically. - Cover Charge for Managers: tap the role pill at the top to preview what staff see. More > All features gives a guided tour. - Cover Charge for Display: best on a tablet held sideways. The big Walk-in and New booking buttons are always at the top. diff --git a/README.md b/README.md index fca0699e73503dd19d9f2f639daf238bcf7c1b4a..3c17a8a0632e60cade89708dd19bc9689561e8d7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ pinned: false short_description: Cover Charge prototype, five web apps, demo data --- -# Cover Charge apps (prototype v0.1.10) +# Cover Charge apps (prototype v0.1.11) Web apps (PWAs) for The Anchorage, Harbour View, Dunure: Managers, Staff, the customer app, Display and Head Chef. Each one opens in the browser and can be added to the Home screen (Chrome, Huawei Browser, Safari). diff --git a/chef-app/_expo/static/js/web/__common-b7c06dc0c9f4ad0c0d56c33437571b54.js b/chef-app/_expo/static/js/web/__common-b7c06dc0c9f4ad0c0d56c33437571b54.js new file mode 100644 index 0000000000000000000000000000000000000000..d2f80fe27982a103a92fafc34d8a1b7c0fc372db --- /dev/null +++ b/chef-app/_expo/static/js/web/__common-b7c06dc0c9f4ad0c0d56c33437571b54.js @@ -0,0 +1,121 @@ +__d(function(g,r,i,a,m,e,d){"use strict";function t(t,n){return Object.keys(t).forEach(function(c){"default"===c||Object.prototype.hasOwnProperty.call(n,c)||Object.defineProperty(n,c,{enumerable:!0,get:function(){return t[c]}})}),t}Object.defineProperty(e,"__esModule",{value:!0}),r(d[0]),t(r(d[1]),e),t(r(d[2]),e),t(r(d[3]),e),t(r(d[4]),e)},785,[920,921,931,932,934]); +__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.ChefApp=function({section:e}={}){const{r:d,rid:p,me:$,now:H}=(0,b.useChef)(3e4),L=e?R[e]:void 0,[E,I]=(0,s.useState)(L?.tab??'home'),[O,B]=(0,s.useState)(L?.k??null),[G,W]=(0,s.useState)(L?.stock??'levels'),[_,z]=(0,s.useState)(L?.gp??'dishes'),D=(0,s.useRef)(null);(0,s.useEffect)(()=>{(0,h.ensureAttendance)((new Date).toISOString().slice(0,10),H)},[]);const F=(0,s.useCallback)((e,s=null)=>{I(e),B(s),D.current?.scrollTo({y:0,animated:!1})},[]);(0,s.useEffect)(()=>{const e=t.default.addEventListener('hardwareBackPress',()=>O?(B(null),!0):'home'!==E&&(I('home'),!0));return()=>e.remove()},[E,O]);const M=O?S.find(e=>e.id===O):null,K=M?M.title:{home:'Today in the kitchen',stock:'Stock',gp:'GP & costing',creator:w.CREATOR_TITLE,orders:'Ordering',kitchen:'Kitchen'}[E];return(0,C.jsxs)(n.SafeAreaView,{style:{flex:1,backgroundColor:u.colours.bg},edges:['top','bottom'],children:[(0,C.jsxs)(i.default,{style:{paddingHorizontal:14,paddingTop:8,paddingBottom:8,borderBottomWidth:1,borderColor:u.colours.border,gap:2},children:[(0,C.jsx)(r.PoweredBy,{}),(0,C.jsxs)(c.Row,{children:[(0,C.jsx)(r.RestaurantLogo,{rid:p}),(0,C.jsxs)(i.default,{style:{flex:1},children:[(0,C.jsx)(c.T,{weight:"semibold",size:17,numberOfLines:1,children:d.name}),(0,C.jsxs)(c.T,{size:12,colour:u.colours.gold,numberOfLines:1,children:["Head Chef \xb7 ",$.replace(' (example)','')]})]})]})]}),(0,C.jsxs)(o.default,{ref:D,contentContainerStyle:{padding:14,paddingBottom:30,gap:12,width:'100%',maxWidth:760,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:[(0,C.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[M?(0,C.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"Back",onPress:()=>B(null),hitSlop:10,children:(0,C.jsx)(c.T,{size:15,colour:u.colours.gold,children:"\u2039 Kitchen"})}):null,(0,C.jsx)(c.T,{size:22,weight:"bold",style:{flex:1,textAlign:M?'right':'left'},children:K})]}),'home'===E?(0,C.jsx)(A,{go:(e,s)=>{'stock'===e&&s&&W(s),'gp'===e&&s&&z(s),F(e,'kitchen'===e?s??null:null)}}):null,'stock'===E?(0,C.jsx)(j.StockScreen,{initial:G},G):null,'gp'===E?(0,C.jsx)(k.GpScreen,{initial:_},_):null,'creator'===E?(0,C.jsx)(w.DishCreator,{rid:p,canPublish:!1}):null,'orders'===E?(0,C.jsx)(x.OrdersScreen,{}):null,'kitchen'!==E||M?null:(0,C.jsxs)(i.default,{style:{gap:10},children:[(0,C.jsx)(i.default,{style:{borderRadius:14,borderWidth:1,borderColor:u.colours.border,backgroundColor:u.colours.surface,overflow:'hidden'},children:S.map((e,s)=>(0,C.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:e.title,onPress:()=>B(e.id),style:({pressed:e})=>({padding:12,borderTopWidth:s?1:0,borderColor:u.colours.border,backgroundColor:e?'#1d1a14':'transparent'}),children:(0,C.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,C.jsxs)(i.default,{style:{flex:1},children:[(0,C.jsx)(c.T,{weight:"medium",children:e.title}),(0,C.jsx)(c.Muted,{children:e.sub})]}),(0,C.jsx)(c.T,{colour:u.colours.muted,children:"\u203a"})]})},e.id))}),(0,C.jsx)(c.Muted,{children:"Head Chef sees kitchen, stock, food costs and GP. Payroll, wages and the restaurant's billing stay in Cover Charge for Managers."}),(0,C.jsx)(c.Muted,{center:!0,children:"Head Chef app \xb7 prototype v0.1.11 \xb7 demo data on this device only"})]}),'specials'===O?(0,C.jsx)(T.SpecialsEditor,{rid:p,me:$,app:"chef",now:H}):null,'prep'===O?(0,C.jsx)(f.PrepScreen,{}):null,'live'===O?(0,C.jsx)(f.TeamScreen,{}):null,'waste'===O?(0,C.jsx)(f.WasteScreen,{}):null,'allergens'===O?(0,C.jsx)(f.AllergenScreen,{}):null,'compliance'===O?(0,C.jsx)(f.ComplianceScreen,{}):null,'haccp'===O?(0,C.jsx)(v.HaccpLog,{mode:"chef",me:$,meId:b.CHEF_ID,now:H}):null,'accidents'===O?(0,C.jsx)(y.AccidentBook,{app:"chef",me:$,meId:b.CHEF_ID,now:H,seeAll:!1}):null]}),(0,C.jsx)(i.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderTopWidth:1,borderColor:u.colours.border,backgroundColor:u.colours.surface},children:P.map(e=>{const s=E===e.id;return(0,C.jsxs)(l.default,{accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:e.label,onPress:()=>F(e.id),style:{flex:1,alignItems:'center',paddingVertical:8,paddingHorizontal:2,minHeight:52},children:[(0,C.jsx)(c.T,{size:18,colour:s?u.colours.gold:u.colours.muted,children:e.icon}),(0,C.jsx)(c.T,{size:e.label.length>10?10:11,weight:s?'semibold':'regular',colour:s?u.colours.gold:u.colours.muted,center:!0,children:e.label})]},e.id)})})]})};var s=_r(_d[0]),t=e(_r(_d[1])),l=e(_r(_d[2])),o=e(_r(_d[3])),i=e(_r(_d[4])),n=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),k=_r(_d[13]),f=_r(_d[14]),x=_r(_d[15]),j=_r(_d[16]),y=_r(_d[17]),w=_r(_d[18]),v=_r(_d[19]),T=_r(_d[20]),C=_r(_d[21]);const P=[{id:'home',label:'Home',icon:'\u2302'},{id:'stock',label:'Stock',icon:'\u25a4'},{id:'gp',label:'GP',icon:'%'},{id:'creator',label:w.CREATOR_TITLE,icon:'\u271a'},{id:'orders',label:'Orders',icon:'\u270e'},{id:'kitchen',label:'Kitchen',icon:'\u2668'}],S=[{id:'specials',title:'Specials board',sub:'Photo of the chalkboard or typed specials with allergens; shown in the customer app'},{id:'haccp',title:'Food safety log (HACCP)',sub:'Temperatures, cleaning and allergen checks; voice entry; limits; EHO export'},{id:'accidents',title:'Accident book',sub:'Accidents and near misses; you see your own entries'},{id:'prep',title:'Prep list',sub:'From the forecast and bookings, tick off as you go'},{id:'live',title:'Live tickets, 86 & team',sub:'Orders, readiness alerts, sold out, who\u2019s on, rota, kitchen chat'},{id:'waste',title:'Waste log',sub:'Item, quantity, reason and cost; weekly total and % of sales'},{id:'allergens',title:'Allergens',sub:'14-allergen matrix from recipe cards, sign-off and audit log'},{id:'compliance',title:'Kitchen compliance',sub:'Fridge, freezer, cooking and cooling temps; cleaning; daily checks'}],R={stock:{tab:'stock',stock:'levels'},'stock-take':{tab:'stock',stock:'take'},deliveries:{tab:'stock',stock:'deliveries'},gp:{tab:'gp',gp:'dishes'},'price-changes':{tab:'gp',gp:'changes'},'gp-week':{tab:'gp',gp:'week'},'menu-engineering':{tab:'gp',gp:'engineering'},orders:{tab:'orders'},prep:{tab:'kitchen',k:'prep'},live:{tab:'kitchen',k:'live'},waste:{tab:'kitchen',k:'waste'},allergens:{tab:'kitchen',k:'allergens'},compliance:{tab:'kitchen',k:'compliance'},haccp:{tab:'kitchen',k:'haccp'},specials:{tab:'kitchen',k:'specials'},accidents:{tab:'kitchen',k:'accidents'},'new-dish':{tab:'creator'}};function A({go:e}){const{k:s,c:t,menu:o,now:n}=(0,b.useChef)(3e4),r=(0,b.useWeek)(),{covers:h,label:k}=(0,b.useForecast)(),f=(0,x.useSuggestions)(),j=s.ingredients.filter(e=>e.onHand<=0||(0,b.isLow)(e.onHand,e.par)),y=f.filter(e=>e.ordersToday&&!e.placedToday),T=(0,p.priceImpacts)(o,s.recipes,s.ingredients,s.targetGp).filter(e=>e.dropped.length),P=s.deliveries.filter(e=>'expected'===e.status),S=t.filter(e=>e.below);return(0,C.jsxs)(i.default,{style:{gap:12},testID:"chef-dashboard",children:[(0,C.jsx)(v.MissedBanner,{now:n,onPress:()=>e('kitchen','haccp')}),(0,C.jsxs)(c.Row,{wrap:!0,gap:10,children:[(0,C.jsx)(b.Tile,{testID:"tile-gp",label:"GP this week vs target",value:(0,b.pct1)(r.theo),sub:`Target ${s.targetGp}% \xb7 actual ${(0,b.pct1)(r.actual)}`,tone:r.theoe('gp','week')}),(0,C.jsx)(b.Tile,{label:"Stock value",value:(0,d.gbp)((0,b.stockValue)(s.ingredients)),sub:"At cost",onPress:()=>e('stock','levels')}),(0,C.jsx)(b.Tile,{label:"Items low or out",value:`${j.length}`,sub:j.slice(0,3).map(e=>e.name).join(', '),tone:j.some(e=>e.onHand<=0)?'red':j.length?'amber':'green',onPress:()=>e('stock','levels')}),(0,C.jsx)(b.Tile,{label:"Waste this week",value:(0,d.gbp)(r.wasteWeek),sub:r.sales?`${(0,b.pct1)(r.wasteWeek/r.sales*100)} of food sales`:'',onPress:()=>e('kitchen','waste')}),(0,C.jsx)(b.Tile,{label:"Covers forecast today",value:`${h}`,sub:k,onPress:()=>e('kitchen','prep')}),(0,C.jsx)(b.Tile,{label:"Orders due today",value:`${y.length}`,sub:y.map(e=>`${e.s.name.replace(/^(Example|Sample) /,'')} by ${e.s.cutoff}`).join(' \xb7 ')||'None',tone:y.some(e=>e.cutPassed)?'red':y.length?'amber':'green',onPress:()=>e('orders')})]}),T.map(e=>(0,C.jsxs)(c.Banner,{kind:"danger",title:`${e.ing.name} ${e.pct>0?'+':''}${e.pct.toFixed(0)}%: ${e.dropped.length} dish${1===e.dropped.length?'':'es'} drop below target`,children:[e.dropped.map(e=>e.item.name).join(', '),". Open GP \u203a Price changes."]},e.ing.id)),P.length?(0,C.jsx)(l.default,{accessibilityRole:"button",onPress:()=>e('stock','deliveries'),children:(0,C.jsx)(c.Banner,{kind:"info",title:`${P.length} deliver${1===P.length?'y':'ies'} to check in today`,children:"Count in against the order, flag shorts and price changes."})}):null,S.length?(0,C.jsx)(l.default,{accessibilityRole:"button",onPress:()=>e('gp','dishes'),children:(0,C.jsxs)(c.Banner,{kind:"warn",title:`${S.length} dishes below ${s.targetGp}% GP`,children:[S.slice(0,4).map(e=>e.item.name).join(', '),S.length>4?'\u2026':'']})}):null,(0,C.jsx)(c.Row,{wrap:!0,gap:8,children:[['Food safety log','haccp'],['Specials board','specials'],[w.CREATOR_TITLE,'creator'],['Prep list','prep'],['Live tickets & 86','live'],['Allergens','allergens'],['Accident book','accidents']].map(([s,t])=>(0,C.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:s,onPress:()=>'creator'===t?e('creator'):e('kitchen',t),style:{flexGrow:1,flexBasis:140,padding:12,borderRadius:12,borderWidth:1.5,borderColor:u.colours.gold,backgroundColor:u.colours.surface},children:(0,C.jsxs)(c.T,{weight:"semibold",children:[s," \u203a"]})},t))}),(0,C.jsx)(c.Badge,{kind:"neutral",label:"Demo data \xb7 nothing is ordered or sent"})]})}},786,[12,215,245,133,109,271,855,790,793,797,859,961,962,964,965,989,990,881,993,882,998,6]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"APP_VARIANT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"ENTRY",{enumerable:!0,get:function(){return u}}),_e.isAllowedPath=function(e,t=c){return'/'===e||''===e||s[t].test(e)},_e.canShow=function(e,t=c){return t===e||'owner'===t&&'customer'===e};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};const o=n.default.expoConfig?.extra?.appVariant??void 0??'owner',c=['owner','staff','customer','display','chef'].includes(o)?o:'owner',u={owner:'/owner',staff:'/team',customer:'/customer/anchorage',display:'/display',chef:'/kitchen'},s={owner:/^\/(owner|customer|table)(\/|$)/,customer:/^\/(customer|table)(\/|$)/,staff:/^\/team(\/|$)/,display:/^\/display(\/|$)/,chef:/^\/kitchen(\/|$)/}},787,[390]); +__d(function(g,r,i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"PERMISSIONS",{enumerable:!0,get:function(){return e}}),Object.defineProperty(_e,"can",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"CHEF_SECTIONS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"chefSectionAllowed",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"rotaView",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"chatView",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"ticketView",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"supplierView",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"auditView",{enumerable:!0,get:function(){return f}});const e={owner:'all',manager:'all',staff:new Set(['rota-shifts','tickets','eighty-six','allergens']),chef:new Set(['stock','costing','gp','waste','dish-sales','prep','ordering','allergens','compliance','rota-shifts','kitchen-chat','tickets','eighty-six','specials'])},t=(t,n)=>{const a=e[t];return'all'===a||a.has(n)},n={stock:'stock','stock-take':'stock',deliveries:'stock',gp:'gp','price-changes':'gp','gp-week':'gp','menu-engineering':'dish-sales',orders:'ordering',prep:'prep',live:'tickets',waste:'waste',allergens:'allergens',compliance:'compliance',haccp:'compliance',accidents:'compliance','new-dish':'gp',specials:'specials'},a=e=>e in n&&t('chef',n[e]),s=(e,n,a)=>t(e,'staff-personal')?{staff:n,shifts:a}:{staff:n.filter(e=>e.active).map(e=>({id:e.id,name:e.name,job:e.job})),shifts:a.map(({id:e,staffId:t,day:n,start:a,end:s})=>({id:e,staffId:t,day:n,start:a,end:s}))},c=(e,t)=>'chef'===e?t.filter(e=>'kitchen'===e.ch&&!e.removed):t,l=(e,n)=>t(e,'customer-personal')?n:n.map(({id:e,ref:t,type:n,tableNo:a,slotTime:s,lines:c,status:l,allergies:o,allergyAck:f,handoverCheck:p,allergyChain:u,bookingId:m,readiness:h,createdAt:b,restaurantId:k,notes:y})=>({id:e,ref:t,type:n,tableNo:a,slotTime:s,lines:c,status:l,allergies:o,allergyAck:f,handoverCheck:p,allergyChain:u,bookingId:m,readiness:h,createdAt:b,restaurantId:k,notes:y})),o=(e,n)=>t(e,'supplier-email')?n:n.map(e=>({...e,email:''})),f=(e,n)=>t(e,'audit-all')?n:n.filter(e=>'menu'===e.kind&&/allergen|sign-off/i.test(e.text))},788,[]); +__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.MockPay=function({visible:e,onClose:j,amount:p,restaurantId:b,allowGiftCard:m=!0,onPaid:x,title:f="Pay",allowSaveCardOnly:y}){const g=(0,t.useGiftCards)(b).filter(e=>e.balance>0),[w,C]=(0,s.useState)(),[P,v]=(0,s.useState)('Demo card \u2022\u2022\u2022\u2022 4242'),[T,M]=(0,s.useState)(!1),S=g.find(e=>e.code===w),_=S?Math.min(S.balance,p):0,R=p-_;return(0,h.jsxs)(u.Sheet,{visible:e,onClose:j,title:f,children:[(0,h.jsx)(u.DemoPaymentNotice,{}),m&&g.length>0?(0,h.jsxs)(o.default,{style:{gap:6},children:[(0,h.jsx)(u.T,{weight:"semibold",children:"Use a gift card"}),(0,h.jsxs)(u.Row,{wrap:!0,children:[(0,h.jsx)(u.Chip,{label:"None",selected:!w,onPress:()=>C(void 0)}),g.map(e=>(0,h.jsx)(u.Chip,{label:`${e.code.slice(0,8)}\u2026`,sub:`${(0,n.gbp)(e.balance)} left`,selected:w===e.code,onPress:()=>C(e.code)},e.id))]})]}):null,(0,h.jsx)(u.T,{weight:"semibold",children:"Payment method"}),(0,h.jsx)(u.Row,{wrap:!0,children:['Demo card \u2022\u2022\u2022\u2022 4242','Apple Pay (demo)','Google Pay (demo)'].map(e=>(0,h.jsx)(u.Chip,{label:e,selected:P===e,onPress:()=>v(e)},e))}),(0,h.jsxs)(o.default,{style:{gap:2},children:[(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.Muted,{children:"Amount"}),(0,h.jsx)(u.T,{children:(0,n.gbp)(p)})]}),_?(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.Muted,{children:"Gift card"}),(0,h.jsxs)(u.T,{colour:c.colours.green,children:["\u2212",(0,n.gbp)(_)]})]}):null,(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{weight:"semibold",children:"To pay now"}),(0,h.jsx)(u.T,{weight:"bold",size:20,colour:c.colours.gold,children:(0,n.gbp)(R)})]})]}),y?(0,h.jsx)(u.Banner,{kind:"info",children:"A card is saved now (demo). It would only be charged under the stated no-show policy."}):null,T?(0,h.jsx)(l.default,{color:c.colours.gold}):(0,h.jsx)(u.Button,{label:y?'Save card (demo)':`Pay ${(0,n.gbp)(R)} \u2014 demo`,onPress:()=>{M(!0),setTimeout(()=>{M(!1),x({giftCardCode:w,giftApplied:_,method:P})},700)},testID:"mock-pay-confirm"})]})};var s=r(d[0]),l=e(r(d[1])),o=e(r(d[2])),t=r(d[3]),n=r(d[4]),c=r(d[5]),u=r(d[6]),h=r(d[7])},789,[12,228,109,796,793,797,790,6]); +__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.T=F,Object.defineProperty(_e,"H1",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"H2",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"Muted",{enumerable:!0,get:function(){return w}}),_e.BrandBar=z,_e.Screen=function({children:e,title:o,subtitle:l,back:t=!0,right:n,maxWidth:c=640,footer:u,scroll:b=!0}){const h=(0,C.jsx)(f.default,{style:{width:'100%',maxWidth:c,alignSelf:'center',padding:16,gap:12},children:e});return(0,C.jsxs)(y.SafeAreaView,{style:{flex:1,backgroundColor:p.colours.bg},edges:['top','left','right'],children:[(0,C.jsx)(f.default,{style:{width:'100%',maxWidth:c,alignSelf:'center'},children:(0,C.jsx)(z,{title:o,subtitle:l,back:t,right:n})}),b?(0,C.jsx)(s.default,{contentContainerStyle:{paddingBottom:40},children:h}):(0,C.jsx)(f.default,{style:{flex:1},children:h}),u?(0,C.jsx)(f.default,{style:A.footer,children:(0,C.jsx)(f.default,{style:{width:'100%',maxWidth:c,alignSelf:'center'},children:u})}):null]})},_e.Button=function({label:e,onPress:o,kind:l="primary",disabled:t,small:s,style:c,accessibilityLabel:u,testID:b}){const h={primary:p.colours.gold,secondary:'transparent',danger:p.colours.redSolid,ghost:'transparent',success:'#2F7D45'}[l],f={primary:p.colours.onGold,secondary:p.colours.gold,danger:'#FFFFFF',ghost:p.colours.gold,success:'#FFFFFF'}[l];return(0,C.jsx)(n.default,{testID:b,accessibilityRole:"button",accessibilityLabel:u??e,accessibilityState:{disabled:!!t},disabled:t,onPress:o,style:({pressed:e})=>[A.btn,{backgroundColor:h,borderColor:'secondary'===l?p.colours.gold:'transparent',opacity:t?.4:e?.8:1},s&&{paddingVertical:7,paddingHorizontal:12,minHeight:36},c],children:(0,C.jsx)(F,{weight:"semibold",size:s?p.font.small:p.font.body,colour:f,center:!0,children:e})})},_e.Card=function({children:e,style:o,onPress:l,highlight:t}){const s=(0,C.jsx)(f.default,{style:[A.card,t?{borderColor:t,borderWidth:2}:null,o],children:e});return l?(0,C.jsx)(n.default,{accessibilityRole:"button",onPress:l,style:({pressed:e})=>({opacity:e?.85:1}),children:s}):s},_e.Badge=function({label:e,kind:o="neutral"}){const l={neutral:[p.colours.surface2,p.colours.muted,p.colours.border],gold:[p.colours.goldTint,p.colours.goldLight,p.colours.gold],red:[p.colours.redBg,'#FFD9D4',p.colours.red],amber:[p.colours.amberBg,'#FFE2A8',p.colours.amber],green:[p.colours.greenBg,'#CFF3D7',p.colours.green],blue:[p.colours.blueBg,'#D6E9FF',p.colours.blue]}[o];return(0,C.jsx)(f.default,{style:[A.badge,{backgroundColor:l[0],borderColor:l[2]}],children:(0,C.jsx)(F,{size:13,weight:"medium",colour:l[1],children:e})})},_e.Banner=P,Object.defineProperty(_e,"ExampleAllergenNotice",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"DemoPaymentNotice",{enumerable:!0,get:function(){return W}}),_e.Row=D,Object.defineProperty(_e,"Divider",{enumerable:!0,get:function(){return S}}),_e.Field=function({label:e,...o}){return(0,C.jsxs)(f.default,{style:{gap:4},children:[(0,C.jsx)(F,{size:p.font.small,weight:"medium",colour:p.colours.muted,children:e}),(0,C.jsx)(h.default,{accessibilityLabel:e,placeholderTextColor:"#7D776C",...o,style:[A.input,o.multiline&&{minHeight:70,textAlignVertical:'top'},o.style]})]})},_e.Chip=function({label:e,selected:o,onPress:l,disabled:t,sub:s}){return(0,C.jsxs)(n.default,{accessibilityRole:"button",accessibilityState:{selected:!!o,disabled:!!t},disabled:t,onPress:l,style:[A.chip,o&&{backgroundColor:p.colours.gold,borderColor:p.colours.gold},t&&{opacity:.35}],children:[(0,C.jsx)(F,{size:p.font.small,weight:"medium",colour:o?p.colours.onGold:p.colours.text,center:!0,children:e}),s?(0,C.jsx)(F,{size:12,colour:o?p.colours.onGold:p.colours.muted,center:!0,children:s}):null]})},_e.Toggle=function({value:e,onChange:o,label:l}){return(0,C.jsxs)(D,{style:{justifyContent:'space-between'},children:[(0,C.jsx)(F,{style:{flex:1},children:l}),(0,C.jsx)(u.default,{accessibilityLabel:l,value:e,onValueChange:o,trackColor:{true:p.colours.gold,false:'#444'},thumbColor:e?'#FFF6E0':'#BBB'})]})},_e.Stepper=function({value:e,onChange:o,min:l=1,max:t=20,label:s}){return(0,C.jsxs)(D,{gap:10,children:[(0,C.jsx)(n.default,{accessibilityLabel:`Decrease ${s??''}`,onPress:()=>o(Math.max(l,e-1)),style:A.stepBtn,children:(0,C.jsx)(F,{size:20,colour:p.colours.gold,children:"\u2212"})}),(0,C.jsx)(F,{weight:"semibold",size:p.font.large,style:{minWidth:28,textAlign:'center'},children:e}),(0,C.jsx)(n.default,{accessibilityLabel:`Increase ${s??''}`,onPress:()=>o(Math.min(t,e+1)),style:A.stepBtn,children:(0,C.jsx)(F,{size:20,colour:p.colours.gold,children:"+"})})]})},_e.Sheet=function({visible:e,onClose:o,title:l,children:c,maxWidth:u,testID:b}){return(0,C.jsx)(t.default,{visible:e,transparent:!0,animationType:"fade",onRequestClose:o,children:(0,C.jsx)(f.default,{style:A.overlay,children:(0,C.jsxs)(f.default,{style:[A.sheet,u?{maxWidth:u}:null],testID:b,children:[(0,C.jsxs)(D,{style:{justifyContent:'space-between',marginBottom:8},children:[(0,C.jsx)(k,{style:{flex:1},children:l}),(0,C.jsx)(n.default,{accessibilityLabel:"Close",onPress:o,hitSlop:10,children:(0,C.jsx)(F,{size:22,colour:p.colours.muted,children:"\u2715"})})]}),(0,C.jsx)(s.default,{contentContainerStyle:{gap:12},children:c})]})})})},_e.SectionTitle=function({children:e}){return(0,C.jsx)(F,{weight:"semibold",size:p.font.small,colour:p.colours.gold,style:{textTransform:'uppercase',letterSpacing:1.5,marginTop:8},children:e})},Object.defineProperty(_e,"styles",{enumerable:!0,get:function(){return A}});var o=r(d[0]),l=e(r(d[1])),t=e(r(d[2])),n=e(r(d[3])),s=e(r(d[4])),c=e(r(d[5])),u=e(r(d[6])),b=e(r(d[7])),h=e(r(d[8])),f=e(r(d[9])),y=r(d[10]),p=r(d[11]),x=r(d[12]),j=r(d[13]),C=r(d[14]);function F({children:e,style:o,size:l=p.font.body,weight:t="regular",colour:n=p.colours.text,numberOfLines:s,center:c}){return(0,C.jsx)(b.default,{numberOfLines:s,style:[{fontFamily:p.fonts[t],fontSize:l,color:n,lineHeight:Math.round(1.4*l)},c&&{textAlign:'center'},o],children:e})}const B=e=>(0,C.jsx)(F,{size:p.font.title,weight:"semibold",...e}),k=e=>(0,C.jsx)(F,{size:p.font.large,weight:"semibold",...e}),w=e=>(0,C.jsx)(F,{colour:p.colours.muted,size:p.font.small,...e});function z({title:e,back:l=!0,right:t,subtitle:s}){return(0,C.jsxs)(f.default,{style:A.brandBar,children:[(0,C.jsxs)(f.default,{style:A.row,children:[l?(0,C.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Back",onPress:()=>o.router.canGoBack()?o.router.back():o.router.replace(x.ENTRY[x.APP_VARIANT]),style:A.backBtn,hitSlop:10,children:(0,C.jsx)(F,{size:22,colour:p.colours.gold,children:"\u2039"})}):null,(0,C.jsx)(n.default,{onPress:()=>o.router.push(x.ENTRY[x.APP_VARIANT]),accessibilityLabel:"Home",style:[A.row,{gap:8}],children:(0,C.jsx)(j.RestaurantBrand,{size:j.HEADER_LOGO})}),(0,C.jsx)(f.default,{style:{flex:1}}),t]}),e?(0,C.jsx)(B,{style:{marginTop:10},children:e}):null,s?(0,C.jsx)(w,{children:s}):null]})}function P({kind:e="info",title:o,children:t}){const n={info:[p.colours.blueBg,p.colours.blue,'#D6E9FF'],warn:[p.colours.amberBg,p.colours.amber,'#FFE2A8'],danger:[p.colours.redBg,p.colours.red,'#FFE3DF'],success:[p.colours.greenBg,p.colours.green,'#CFF3D7'],example:[p.colours.amberBg,p.colours.amber,'#FFE2A8'],demo:[p.colours.goldTint,p.colours.gold,p.colours.goldLight]}[e];return(0,C.jsxs)(f.default,{accessibilityRole:"alert",style:[A.banner,{backgroundColor:n[0],borderLeftColor:n[1]}],children:[o?(0,C.jsx)(F,{weight:"semibold",colour:n[2],children:o}):null,l.default.Children.toArray(t).every(e=>'string'==typeof e||'number'==typeof e)?(0,C.jsx)(F,{size:p.font.small,colour:n[2],children:t}):t]})}const R=()=>(0,C.jsx)(P,{kind:"example",title:"Example allergen data \u2014 not verified by the kitchen",children:"Allergen information in this prototype is illustrative only. Real data needs head chef sign-off. Always speak to staff about allergies."}),W=()=>(0,C.jsx)(P,{kind:"demo",title:"Demo, no real payment",children:"No card is charged and no payment provider is contacted."});function D({children:e,style:o,gap:l=8,wrap:t}){return(0,C.jsx)(f.default,{style:[A.row,{gap:l},t&&{flexWrap:'wrap'},o],children:e})}const S=()=>(0,C.jsx)(f.default,{style:{height:1,backgroundColor:p.colours.border,marginVertical:4}});const A=c.default.create({row:{flexDirection:'row',alignItems:'center'},brandBar:{paddingHorizontal:16,paddingTop:8,paddingBottom:8,borderBottomWidth:1,borderBottomColor:p.colours.border},backBtn:{paddingRight:10,paddingVertical:2},btn:{borderRadius:p.radius.m,paddingVertical:12,paddingHorizontal:18,borderWidth:1.5,alignItems:'center',justifyContent:'center',minHeight:48},card:{backgroundColor:p.colours.surface,borderRadius:p.radius.l,padding:14,borderWidth:1,borderColor:p.colours.border,gap:8},badge:{borderRadius:999,paddingHorizontal:9,paddingVertical:2,borderWidth:1,alignSelf:'flex-start'},banner:{borderRadius:p.radius.m,padding:12,borderLeftWidth:5,gap:2},input:{backgroundColor:p.colours.surface2,borderColor:p.colours.border,borderWidth:1,borderRadius:p.radius.m,paddingHorizontal:12,paddingVertical:10,color:p.colours.text,fontSize:p.font.body,fontFamily:p.fonts.regular},chip:{borderWidth:1,borderColor:p.colours.border,borderRadius:p.radius.m,paddingHorizontal:12,paddingVertical:8,backgroundColor:p.colours.surface2,minWidth:64},stepBtn:{width:40,height:40,borderRadius:20,borderWidth:1.5,borderColor:p.colours.gold,alignItems:'center',justifyContent:'center'},overlay:{flex:1,backgroundColor:'rgba(0,0,0,0.7)',justifyContent:'center',alignItems:'center',padding:16},sheet:{backgroundColor:p.colours.surface,borderRadius:p.radius.l,padding:18,width:'100%',maxWidth:520,maxHeight:'90%',borderWidth:1,borderColor:p.colours.gold},footer:{borderTopWidth:1,borderTopColor:p.colours.border,backgroundColor:p.colours.surface,padding:12}})},790,[785,12,238,245,133,28,253,188,255,109,271,797,787,855,6]); +__d(function(_g,r,i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ALLERGENS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"allergenLabel",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"SEVERITIES",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"severityLabel",{enumerable:!0,get:function(){return s}}),e.effectiveAllergens=function(l,n=[]){const t={...l.allergens};for(const s of l.optionGroups??[])for(const l of s.choices)if(n.includes(l.id)&&l.allergens)for(const[n,s]of Object.entries(l.allergens))'contains'!==t[n]&&(t[n]=s);return t},e.conflictsFor=function(l,n){const t=[],s=[];for(const a of n)'contains'===l[a.allergen]?t.push(a.allergen):'may'===l[a.allergen]&&s.push(a.allergen);return{contains:t,may:s}},Object.defineProperty(e,"hasConflict",{enumerable:!0,get:function(){return a}});const l=[{id:'gluten',label:'Cereals containing gluten',short:'Gluten'},{id:'crustaceans',label:'Crustaceans',short:'Crustaceans'},{id:'molluscs',label:'Molluscs',short:'Molluscs'},{id:'eggs',label:'Eggs',short:'Eggs'},{id:'fish',label:'Fish',short:'Fish'},{id:'peanuts',label:'Peanuts',short:'Peanuts'},{id:'treenuts',label:'Tree nuts',short:'Tree nuts'},{id:'soya',label:'Soya',short:'Soya'},{id:'milk',label:'Milk',short:'Milk'},{id:'celery',label:'Celery',short:'Celery'},{id:'mustard',label:'Mustard',short:'Mustard'},{id:'sesame',label:'Sesame',short:'Sesame'},{id:'sulphites',label:'Sulphur dioxide / sulphites',short:'Sulphites'},{id:'lupin',label:'Lupin',short:'Lupin'}],n=n=>l.find(l=>l.id===n)?.short??n,t=[{id:'intolerance',label:'Intolerance'},{id:'allergy',label:'Allergy'},{id:'coeliac',label:'Coeliac disease'},{id:'anaphylaxis',label:'Severe \u2014 anaphylaxis risk'}],s=l=>t.find(n=>n.id===l)?.label??l;const a=l=>l.contains.length>0||l.may.length>0},791,[]); +__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.hoursFor=function(n,o){const r=n.kitchenHours[o.getDay()];return r?{open:(0,t.atTime)(o,r[0]),close:(0,t.atTime)(o,r[1])}:null};var t=_r(d[0])},792,[795]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gbp",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"pounds",{enumerable:!0,get:function(){return n}});const t=t=>`\xa3${(t/100).toFixed(2)}`,n=t=>Math.round(100*t)},793,[]); +__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.takeawaySlots=function(s,o,l){const r=(0,t.hoursFor)(s,l);if(!r)return[];const u=s.settings.slotMinutes,c=(0,n.addMins)(l,s.settings.leadMins),f=[];for(let t=new Date(r.open);t<=r.close;t=(0,n.addMins)(t,u)){if(tn.restaurantId===s.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:l,cap:s.settings.slotCap,full:l>=s.settings.slotCap})}return f},e.bookingSlots=function(s,o,l,r,u){const c=(0,t.hoursFor)(s,o);if(!c)return[];const f=[],p=(0,n.addMins)(c.close,-60);for(let t=new Date(c.open);t<=p;t=(0,n.addMins)(t,30)){const o=(0,n.hm)(t),c=s.settings.bookingCoversPerSlot-l(o),p=t.getTime()=r})}return f};var t=_r(d[0]),n=_r(d[1])},794,[792,795]); +__d(function(g,r,i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"pad",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ymd",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"hm",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"parseYmd",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"toMins",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"fromMins",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"atTime",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"addMins",{enumerable:!0,get:function(){return d}}),Object.defineProperty(e,"dayShort",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"dayLong",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"monthLong",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"niceDate",{enumerable:!0,get:function(){return M}}),Object.defineProperty(e,"niceDateYear",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"minsBetween",{enumerable:!0,get:function(){return P}});const t=t=>String(t).padStart(2,'0'),n=n=>`${n.getFullYear()}-${t(n.getMonth()+1)}-${t(n.getDate())}`,u=n=>`${t(n.getHours())}:${t(n.getMinutes())}`,a=t=>{const[n,u,a]=t.split('-').map(Number);return new Date(n,u-1,a)},o=t=>{const[n,u]=t.split(':').map(Number);return 60*n+u},c=n=>`${t(Math.floor(n/60))}:${t(n%60)}`,b=(t,n)=>{const u=new Date(t);return u.setHours(0,0,0,0),u.setMinutes(o(n)),u},d=(t,n)=>new Date(t.getTime()+6e4*n),y=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],f=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],m=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],l=['January','February','March','April','May','June','July','August','September','October','November','December'],p=t=>y[t.getDay()],s=t=>f[t.getDay()],O=t=>l[t],M=t=>`${y[t.getDay()]} ${t.getDate()} ${m[t.getMonth()]}`,j=t=>`${M(t)} ${t.getFullYear()}`,P=(t,n)=>Math.round((n.getTime()-t.getTime())/6e4)},795,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"repo",{enumerable:!0,get:function(){return o}});var t=r(d[0]),n=r(d[1]);Object.keys(n).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});const o=t.localRepositories},796,[941,884]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"colours",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"fonts",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"font",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"radius",{enumerable:!0,get:function(){return u}});const t={bg:'#0B0B0B',surface:'#141414',surface2:'#1D1C1A',border:'#34302A',gold:'#CFA45F',goldLight:'#E2C489',goldTint:'#2A2216',text:'#F5F1E8',muted:'#B8B0A0',onGold:'#0B0B0B',red:'#FF6B5E',redBg:'#4A1310',redSolid:'#C62F22',amber:'#FFB547',amberBg:'#3F2C05',green:'#7BD88F',greenBg:'#12301A',blue:'#8EC5FF',blueBg:'#12263D'},n={regular:'Poppins_400Regular',medium:'Poppins_500Medium',semibold:'Poppins_600SemiBold',bold:'Poppins_700Bold'},o={small:14,body:16,large:18,title:22,hero:30},u={s:6,m:10,l:16}},797,[]); +__d(function(g,r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AllergenPanel=function({item:e,map:l,declared:d}){return(0,t.jsxs)(n.default,{style:{gap:6},accessibilityLabel:"Allergen panel",children:[(0,t.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,t.jsx)(o.T,{weight:"semibold",children:"Allergen panel (14 UK allergens)"}),(0,t.jsx)(o.Badge,{label:"EXAMPLE DATA",kind:"amber"})]}),(0,t.jsx)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:6},children:a.ALLERGENS.map(e=>{const c=l[e.id],u=d.find(l=>l.allergen===e.id),f='contains'===c?s.colours.redBg:'may'===c?s.colours.amberBg:s.colours.surface2,b='contains'===c?'#FFD9D4':'may'===c?'#FFE2A8':s.colours.muted;return(0,t.jsxs)(n.default,{style:{width:'48%',flexGrow:1,backgroundColor:f,borderRadius:8,padding:8,borderWidth:u?2:1,borderColor:u?s.colours.red:s.colours.border},children:[(0,t.jsx)(o.T,{size:14,weight:"medium",colour:c?b:s.colours.text,children:e.label}),(0,t.jsxs)(o.T,{size:13,colour:b,children:['contains'===c?'Contains':'may'===c?'May contain':'Not listed',u?` \xb7 YOUR ALLERGY (${(0,a.severityLabel)(u.severity)})`:'']})]},e.id)})}),e.allergenNotes?(0,t.jsxs)(o.Muted,{children:["Notes: ",e.allergenNotes]}):null,(0,t.jsx)(o.Muted,{children:e.signOff?`Sign-off: ${e.signOff.by}, ${e.signOff.at} (prototype placeholder \u2014 not a real kitchen sign-off)`:'Awaiting head chef allergen sign-off \u2014 not available to order online.'})]})},_e.AllergenChips=function({map:e,declared:l}){const n=Object.entries(e);return n.length?(0,t.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,t.jsx)(o.Badge,{label:`${s?'\u26a0 ':''}${(0,a.allergenLabel)(e)}${'may'===n?' (may)':''}`,kind:s?'contains'===n?'red':'amber':'neutral'},e)})}):(0,t.jsx)(o.Muted,{children:"No listed allergens (example data)"})},r(_d[0]);var e,l=r(_d[1]),n=(e=l)&&e.__esModule?e:{default:e},a=r(_d[2]),s=r(_d[3]),o=r(_d[4]),t=r(_d[5])},798,[12,109,791,797,790,6]); +__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])},799,[785,12,245,796,797,790,6]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Stars=function({value:e,onChange:s,size:n=36}){return(0,c.jsx)(t.Row,{gap:6,children:[1,2,3,4,5].map(u=>(0,c.jsx)(l.default,{disabled:!s,accessibilityRole:"button",accessibilityLabel:`${u} star${u>1?'s':''}`,onPress:()=>s?.(u),hitSlop:4,children:(0,c.jsx)(t.T,{size:n,colour:u<=e?o.colours.gold:'#555',children:"\u2605"})},u))})},r(d[0]);var e,s=r(d[1]),l=(e=s)&&e.__esModule?e:{default:e},o=r(d[2]),t=r(d[3]),c=r(d[4])},800,[12,245,797,790,6]); +__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,"LAUNCHER_LINE",{enumerable:!0,get:function(){return u}}),_e.LauncherLine=function(){return(0,s.jsx)(l.default,{style:{borderTopWidth:1,borderColor:t.colours.border,paddingTop:10,marginTop:4},children:(0,s.jsx)(n.Muted,{center:!0,children:u})})},_e.HubTile=function({icon:e,label:u,sub:c,onPress:b,badge:h}){return(0,s.jsxs)(o.default,{accessibilityRole:"button",accessibilityLabel:u,onPress:b,style:({pressed:e})=>({flexBasis:'30%',flexGrow:1,maxWidth:'31.5%',minWidth:96,backgroundColor:e?'#1d1a14':t.colours.surface,borderRadius:14,borderWidth:1,borderColor:t.colours.border,padding:10,gap:2,alignItems:'center'}),children:[(0,s.jsx)(n.T,{size:22,children:e}),(0,s.jsx)(n.T,{size:13,weight:"semibold",center:!0,children:u}),c?(0,s.jsx)(n.T,{size:11,colour:t.colours.muted,center:!0,children:c}):null,h?(0,s.jsx)(l.default,{style:{position:'absolute',top:6,right:6,backgroundColor:t.colours.gold,borderRadius:8,paddingHorizontal:5},children:(0,s.jsx)(n.T,{size:10,weight:"bold",colour:t.colours.onGold,children:h})}):null]})},r(d[0]);var o=e(r(d[1])),l=e(r(d[2])),n=r(d[3]),t=r(d[4]),s=r(d[5]);const u='Prototype \xb7 demo data, no real payments'},801,[12,245,109,790,797,6]); +__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SUPPLIER_CATS",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"NLW_PENCE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"MAX_CUSTOM_LINKS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"WIX_IDS",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"isWixLink",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"DEFAULT_QUICK_LINKS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"useOwner",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"ROLE_LABEL",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"CAN",{enumerable:!0,get:function(){return g}});var e,t=_r(_d[0]),a=(e=t)&&e.__esModule?e:{default:e},s=_r(_d[1]),r=_r(_d[2]);const i=['Fish & seafood','Meat','Fruit & veg','Dairy','Dry goods','Drinks/brewery','Cleaning','Packaging','Equipment/maintenance'],o=1271,n=6,d=['ql-wix-view','ql-wix-edit'],c=e=>d.includes(e.id)||'Website (Wix)'===e.group,l=[{id:'ql-gmail',label:'Work email (Gmail)',url:'',icon:'\u2709\ufe0f',kind:'gmail',staff:!1,builtIn:!0},{id:'ql-wix-view',label:'View site',url:'https://www.anchoragedunure.com',icon:'\ud83c\udf10',kind:'link',group:'Website (Wix)',staff:!1,builtIn:!0},{id:'ql-wix-edit',label:'Edit site',url:'https://manage.wix.com',icon:'\u270f\ufe0f',kind:'link',group:'Website (Wix)',staff:!1,builtIn:!0}],p=e=>`${e}-${Math.random().toString(36).slice(2,8)}`,m=['#2A3B4C','#4A3A22','#26403A','#3E2A2A','#2E2E40'];const u=()=>({tronc:{method:'hours',points:{FOH:1,Bar:1,Kitchen:.8,KP:.6,Manager:1},includeManagers:!0,includeOwner:!1,custom:{},text:'The Anchorage tipping policy (template)\n\n1. 100% of tips paid by card and cash tips put in the tip jar go to staff. Nothing is deducted.\n2. Tips are pooled and shared by paid hours worked in each pay period (breaks excluded).\n3. The owner does not take a share. Managers share only for hours worked on the floor or in the kitchen.\n4. Tips are paid with wages, no later than the end of the month after the tip was paid.\n5. Tip records are kept for 3 years. Ask a manager for your records at any time.'},troncCash:{},troncHistory:[],troncLog:[],chat:[],chatMuted:{},referral:{giverReward:'Free dessert',friendReward:'\xa35 off first order',active:!0},referrals:[{id:'rf-1',referrer:'Fiona Campbell (example)',friend:'Ailsa Ross (example)',at:'2026-10-21',status:'rewarded'},{id:'rf-2',referrer:'Iain Fraser (example)',friend:'Neil Grant (example)',at:'2026-10-23',status:'first order'},{id:'rf-3',referrer:'Alex Morgan',friend:'Jamie (example)',at:'2026-10-25',status:'signed up'},{id:'rf-4',referrer:'Kirsty Hamilton (example)',friend:'Craig Reid (example)',at:'2026-10-26',status:'signed up'}],reminders:{h24:!0,h2:!0,confirmText:!0},coats:[{id:'ct-1',ticket:14,desc:'Black wool coat',at:'17:05',status:'in'},{id:'ct-2',ticket:15,desc:'Green Barbour jacket + umbrella',at:'17:20',status:'in'}],merch:[{id:'mc-1',name:'Anchorage tote bag',price:1200,stock:18,live:!0},{id:'mc-2',name:'House tartare sauce jar',price:650,stock:6,live:!0},{id:'mc-3',name:'Harbour View mug',price:1e3,stock:0,live:!1}],merchOrders:[{id:'mo-1',productId:'mc-2',qty:2,customer:'Morag (example)',at:'2026-10-26',status:'new'},{id:'mo-2',productId:'mc-1',qty:1,customer:'Callum (example)',at:'2026-10-24',status:'collected'}],marketingDraft:void 0,socialAccounts:{facebook:!0,instagram:!0,tiktok:!0,youtube:!0},socialPosts:[],socialDraft:void 0,quickLinks:l.map(e=>({...e})),workEmail:'',staff:[{id:'st-gordon',name:'Gordon Munro',role:'owner',job:'Owner / GM',active:!0},{id:'st-2',name:'Duty Manager (example)',role:'manager',job:'Front of house manager',active:!0},{id:'st-3',name:'Head Chef (example)',role:'staff',job:'Kitchen',active:!0},{id:'st-4',name:'Server (example)',role:'staff',job:'Front of house',active:!0},{id:'st-5',name:'Bar (example)',role:'staff',job:'Bar',active:!0}],previewRole:'owner',staffAs:'st-4',offers:[{id:'of-1',title:'Catch of the day: Dunure lobster (example)',body:'Half or whole, garlic butter or thermidor. Ask your server \u2014 board price.',kind:'special',live:!0},{id:'of-2',title:'Midweek fish supper deal (example)',body:'Two fish suppers for \xa330, Wed\u2013Thu takeaway.',kind:'offer',until:'2026-11-30',live:!0}],photos:[{id:'ph-1',caption:'Harbour view from the terrace (placeholder)',tone:m[0]},{id:'ph-2',caption:'Fish supper (placeholder)',tone:m[1]},{id:'ph-3',caption:'Dining room (placeholder)',tone:m[2]}],changeRequests:[{id:'cr-1',text:'Add the Christmas party menu page (example)',at:'2026-10-05',status:'done'},{id:'cr-2',text:'New header photo for the app (example)',at:'2026-10-19',status:'in progress'}],changesUsed:2,site:'anchorage',branding:{},checks:{},lost:[{id:'lp-1',item:'Navy umbrella',where:'Table 7',foundAt:'2026-10-24 19:40',foundBy:'Server (example)',status:'held'},{id:'lp-2',item:'Child\u2019s blue cardigan',where:'Terrace',foundAt:'2026-10-18 14:10',foundBy:'Bar (example)',status:'held'},{id:'lp-3',item:'Car keys (Ford)',where:'Bar',foundAt:'2026-10-11 21:05',foundBy:'Duty Manager (example)',status:'returned',contact:'Collected by owner'}],lostReports:[],campaigns:[{id:'cp-1',title:'Halloween weekend (example)',body:'Spooky specials all weekend at The Anchorage. Book now!',segment:'All opted-in',sendAt:'2026-10-29 10:00',status:'scheduled',reach:412},{id:'cp-2',title:'Fish supper Friday (example)',body:'2 fish suppers for \xa330 tonight, order ahead in the app.',segment:'Takeaway regulars',sendAt:'2026-10-23 15:00',status:'sent (demo)',reach:188}],shifts:Object.entries({'st-2':[[2,11,19.5],[4,15,23],[5,15,23],[6,11.5,20.5]],'st-3':[[2,10.5,19.5],[3,10.5,19.5],[4,10.5,21],[5,10.5,21],[6,11,20.5]],'st-4':[[3,11.5,19.5],[4,16,22],[5,16,22],[6,12,20.5]],'st-5':[[4,17,23],[5,17,23.5],[6,12,18]]}).flatMap(([e,t])=>t.map(([t,a,s])=>({id:`sh-${e}-${t}`,staffId:e,day:t,start:a,end:s}))),rotaPublished:void 0,leave:[{id:'lv-1',staffId:'st-4',from:'2026-11-09',to:'2026-11-13',reason:'Family holiday',status:'pending'},{id:'lv-2',staffId:'st-3',from:'2026-12-27',to:'2026-12-28',reason:'Christmas leave',status:'approved'}],swaps:[{id:'sw-1',shiftId:'sh-st-5-5',fromId:'st-5',toId:'st-4',kind:'swap',note:'Can we swap Saturday? (example)',status:'open'},{id:'sw-2',shiftId:'sh-st-4-6',fromId:'st-4',kind:'cover',note:'Need cover Sunday lunch (example)',status:'open'}],availability:{'st-4':[0,1],'st-5':[2]},attendance:[],attLog:[],geofence:{lat:55.4047,lng:-4.7606,radius:100},simLocation:'venue',consent:{'st-gordon':'2026-10-01T09:00:00Z','st-2':'2026-10-01T09:05:00Z','st-3':'2026-10-02T11:00:00Z'},hourly:{'st-gordon':0,'st-2':1500,'st-3':1650,'st-4':1275,'st-5':1275},payPeriod:'weekly',suppliers:[{id:'sup-1',name:'Example Fish Co.',category:'Fish & seafood',contact:'Alex Sample',phones:['01632 960001','07700 900001'],email:'orders@example.com',website:'https://example.com/fish',account:'ANC-0001',cutoff:'14:00',orderDays:[0,1,2,3,4],deliveryDays:[1,2,3,4,5],minOrder:7500,terms:'30 days',notes:'Day boat landings. Ask for the langoustine grade before ordering.',fav:!0,archived:!1},{id:'sup-2',name:'Example Butchers Ltd',category:'Meat',contact:'Sam Example',phones:['01632 960002'],email:'butcher@example.com',website:'https://example.com/meat',account:'ANC-0002',cutoff:'12:00',orderDays:[0,2,4],deliveryDays:[1,3,5],minOrder:5e3,terms:'14 days',notes:'Burger patties made to our spec (6 oz).',fav:!1,archived:!1},{id:'sup-3',name:'Sample Fruit & Veg',category:'Fruit & veg',contact:'Jo Placeholder',phones:['01632 960003'],email:'veg@example.com',website:'https://example.com/veg',account:'ANC-0003',cutoff:'20:00',orderDays:[0,1,2,3,4,5],deliveryDays:[1,2,3,4,5,6],minOrder:4e3,terms:'7 days',notes:'Chipping potatoes: ask for Maris Piper.',fav:!0,archived:!1},{id:'sup-4',name:'Sample Dairy Ltd',category:'Dairy',contact:'Chris Example',phones:['01632 960004'],email:'dairy@example.com',website:'https://example.com/dairy',account:'ANC-0004',cutoff:'16:00',orderDays:[0,3],deliveryDays:[1,4],minOrder:3e3,terms:'14 days',notes:'',fav:!1,archived:!1},{id:'sup-5',name:'Example Dry Goods Wholesale',category:'Dry goods',contact:'Pat Sample',phones:['01632 960005'],email:'drygoods@example.com',website:'https://example.com/drygoods',account:'ANC-0005',cutoff:'15:00',orderDays:[1],deliveryDays:[3],minOrder:15e3,terms:'30 days',notes:'Weekly order. Oil, flour, sauces, tins.',fav:!1,archived:!1},{id:'sup-6',name:'Sample Brewing Co.',category:'Drinks/brewery',contact:'Robin Example',phones:['01632 960006','07700 900006'],email:'trade@example.com',website:'https://example.com/brewery',account:'ANC-0006',cutoff:'11:00',orderDays:[2],deliveryDays:[4],minOrder:2e4,terms:'30 days',notes:'Cask returns collected on delivery.',fav:!0,archived:!1},{id:'sup-7',name:'Example Cleaning Supplies',category:'Cleaning',contact:'Lee Placeholder',phones:['01632 960007'],email:'clean@example.com',website:'https://example.com/cleaning',account:'ANC-0007',cutoff:'17:00',orderDays:[3],deliveryDays:[5],minOrder:6e3,terms:'30 days',notes:'',fav:!1,archived:!1},{id:'sup-8',name:'Sample Packaging Ltd',category:'Packaging',contact:'Morgan Sample',phones:['01632 960008'],email:'packaging@example.com',website:'https://example.com/packaging',account:'ANC-0008',cutoff:'13:00',orderDays:[0],deliveryDays:[2],minOrder:1e4,terms:'30 days',notes:'Compostable takeaway boxes and paper bags.',fav:!1,archived:!1},{id:'sup-9',name:'Example Kitchen Repairs',category:'Equipment/maintenance',contact:'Taylor Example',phones:['01632 960009','07700 900009'],email:'repairs@example.com',website:'https://example.com/repairs',account:'ANC-0009',cutoff:'',orderDays:[],deliveryDays:[],minOrder:0,terms:'On invoice',notes:'Fryer and fridge servicing. Emergency call-out line is the mobile.',fav:!1,archived:!1}],supplierOrders:[{id:'so-1',supplierId:'sup-1',date:'',items:'Haddock 40 portions, langoustines 4 kg',amount:21450,by:'Head Chef (example)',at:''},{id:'so-2',supplierId:'sup-6',date:'',items:'6 casks, 4 kegs',amount:64800,by:'Gordon Munro',at:''}],staffCanViewSuppliers:!1,readNotes:{},customerTags:{'cust-demo':['Allergy','Regular'],'cr-2':['VIP'],'cr-5':['Takeaway']}}),f=(0,s.create)()((0,r.persist)(e=>({...u(),setPreviewRole:t=>e({previewRole:t}),addStaff:(t,a,s)=>e(e=>{const r=p('st');return{staff:[...e.staff,{id:r,name:t,role:a,job:s,active:!0}],hourly:{...e.hourly,[r]:o}}}),saveSupplier:t=>e(e=>({suppliers:e.suppliers.some(e=>e.id===t.id)?e.suppliers.map(e=>e.id===t.id?t:e):[...e.suppliers,t]})),setRate:(t,a)=>e(e=>({hourly:{...e.hourly,[t]:Math.max(0,Math.round(a))}})),updateStaff:(t,a)=>e(e=>({staff:e.staff.map(e=>e.id===t?{...e,...a}:e)})),addOffer:t=>e(e=>({offers:[{...t,id:p('of')},...e.offers]})),updateOffer:(t,a)=>e(e=>({offers:e.offers.map(e=>e.id===t?{...e,...a}:e)})),addPhoto:t=>e(e=>({photos:[...e.photos,{id:p('ph'),caption:t,tone:m[e.photos.length%m.length]}]})),removePhoto:t=>e(e=>({photos:e.photos.filter(e=>e.id!==t)})),requestChange:(t,a)=>e(e=>e.changesUsed>=5?e:{changesUsed:e.changesUsed+1,changeRequests:[{id:p('cr'),text:t,at:a,status:'requested'},...e.changeRequests]}),setSite:t=>e({site:t}),setBranding:(t,a)=>e(e=>{const s={...e.branding};return a?s[t]={...s[t],...a}:delete s[t],{branding:s}}),setOwner:t=>e(t),addSocialPost:t=>e(e=>({socialPosts:[{...t,id:p('sp')},...e.socialPosts]})),setSocialPost:(t,a)=>e(e=>({socialPosts:e.socialPosts.map(e=>e.id===t?{...e,...a}:e)})),chatSend:t=>e(e=>({chat:[...e.chat,{...t,id:p('m'),reactions:{},seenBy:t.seenBy??('system'===t.from?[]:[t.from])}]})),chatReact:(t,a,s)=>e(e=>({chat:e.chat.map(e=>{if(e.id!==t)return e;const r=e.reactions[a]??[];return{...e,reactions:{...e.reactions,[a]:r.includes(s)?r.filter(e=>e!==s):[...r,s]}}})})),chatSeen:(t,a)=>e(e=>e.chat.some(e=>e.ch===t&&!e.seenBy.includes(a))?{chat:e.chat.map(e=>e.ch!==t||e.seenBy.includes(a)?e:{...e,seenBy:[...e.seenBy,a]})}:e),chatPatch:(t,a)=>e(e=>({chat:e.chat.map(e=>e.id===t?{...e,...a}:e)})),chatMute:(t,a)=>e(e=>{const s=e.chatMuted[t]??[];return{chatMuted:{...e.chatMuted,[t]:s.includes(a)?s.filter(e=>e!==a):[...s,a]}}}),sys:(t,a,s)=>e(e=>({chat:[...e.chat,{id:p('m'),ch:t,from:'system',text:a,at:s,reactions:{},seenBy:[]}]})),tick:(t,a,s,r)=>e(e=>({checks:{...e.checks,[t]:{by:a,at:s,value:r}}})),untick:t=>e(e=>{const a={...e.checks};return delete a[t],{checks:a}}),addLost:t=>e(e=>({lost:[{...t,id:p('lp'),status:'held'},...e.lost]})),setLost:(t,a)=>e(e=>({lost:e.lost.map(e=>e.id===t?{...e,...a}:e)})),addCampaign:t=>e(e=>({campaigns:[{...t,id:p('cp')},...e.campaigns]})),setCampaign:(t,a)=>e(e=>({campaigns:e.campaigns.map(e=>e.id===t?{...e,...a}:e)})),setShifts:t=>e({shifts:t}),addShift:t=>e(e=>({shifts:[...e.shifts,{...t,id:p('sh')}]})),removeShift:t=>e(e=>({shifts:e.shifts.filter(e=>e.id!==t)})),markRead:t=>e(e=>({readNotes:{...e.readNotes,...Object.fromEntries(t.map(e=>[e,!0]))}})),toggleTag:(t,a)=>e(e=>{const s=e.customerTags[t]??[];return{customerTags:{...e.customerTags,[t]:s.includes(a)?s.filter(e=>e!==a):[...s,a]}}}),publishRota:t=>e({rotaPublished:t}),addLeave:t=>e(e=>({leave:[{...t,id:p('lv'),status:'pending'},...e.leave]})),setLeave:(t,a)=>e(e=>({leave:e.leave.map(e=>e.id===t?{...e,status:a}:e)})),addSwap:t=>e(e=>({swaps:[{...t,id:p('sw'),status:'open'},...e.swaps]})),setSwap:(t,a)=>e(e=>{const s=e.swaps.find(e=>e.id===t);return{shifts:'approved'===a&&s?.toId?e.shifts.map(e=>e.id===s.shiftId?{...e,staffId:s.toId}:e):e.shifts,swaps:e.swaps.map(e=>e.id===t?{...e,status:a}:e)}}),toggleAvail:(t,a)=>e(e=>{const s=e.availability[t]??[];return{availability:{...e.availability,[t]:s.includes(a)?s.filter(e=>e!==a):[...s,a]}}}),clock:(t,a,s,r,i,o)=>e(e=>{const n=e.attendance.filter(e=>e.staffId===t&&e.in&&!e.out&&new Date(r).getTime()-new Date(e.in).getTime()<72e6).sort((e,t)=>t.in.localeCompare(e.in))[0];return'in'===s?n?e:{attendance:[...e.attendance,{id:p('at'),staffId:t,date:a,in:r,inSite:i}]}:n?{attendance:e.attendance.map(e=>e.id===n.id?{...e,out:r,outSite:i,breakMins:o??0}:e)}:e}),adjustClock:(t,a,s,r,i,o)=>e(e=>{const n=e.attendance.find(e=>e.id===t),d=e.staff.find(e=>e.id===n?.staffId),c=n?.[a]?new Date(n[a]).toTimeString().slice(0,5):'none';return{attendance:e.attendance.map(e=>e.id===t?{...e,[a]:s,adjusted:{by:r,at:o,reason:i}}:e),attLog:[{id:p('al'),at:o,text:`${r} changed ${d?.name??'staff'} clock-${a} from ${c} to ${new Date(s).toTimeString().slice(0,5)}: ${i}`},...e.attLog]}}),adjustBreak:(t,a,s,r,i)=>e(e=>{const o=e.attendance.find(e=>e.id===t),n=e.staff.find(e=>e.id===o?.staffId);return{attendance:e.attendance.map(e=>e.id===t?{...e,breakMins:a,adjusted:{by:s,at:i,reason:r}}:e),attLog:[{id:p('al'),at:i,text:`${s} changed ${n?.name??'staff'} break from ${o?.breakMins??0}m to ${a}m: ${r}`},...e.attLog]}}),setGeofence:t=>e(e=>({geofence:{...e.geofence,...t}})),setSimLocation:t=>e({simLocation:t}),giveConsent:(t,a)=>e(e=>({consent:{...e.consent,[t]:a}})),resetOwner:()=>e(u())}),{name:'covercharge-owner-v1',version:2,storage:(0,r.createJSONStorage)(()=>a.default),migrate:(e,t)=>(e&&t<2&&Array.isArray(e.quickLinks)&&(e.quickLinks=e.quickLinks.map(e=>d.includes(e.id)||'Website (Wix)'===e.group?{...e,staff:!1}:e)),e)})),h={owner:'Owner',manager:'Manager',staff:'Staff'},g={forecasts:e=>'staff'!==e,manage:e=>'staff'!==e,staffAdmin:e=>'owner'===e,billing:e=>'owner'===e,takings:e=>'staff'!==e,publishSocial:e=>'staff'!==e}},802,[942,948,951]); +__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,"photoSource",{enumerable:!0,get:function(){return C}}),_e.BoardPhoto=T,_e.PhotoZoom=k,_e.SpecialRow=M,_e.SpecialsTab=function({rid:e,declared:s,now:l}){const n=(0,p.useSpecials)(t=>t.current[e]??null),[o,u]=(0,t.useState)(null);if(!n)return(0,b.jsx)(h.Card,{children:(0,b.jsxs)(c.default,{testID:"specials-empty",style:{alignItems:'center',gap:6,paddingVertical:18},children:[(0,b.jsx)(h.T,{size:34,children:"\ud83e\uddd1\u200d\ud83c\udf73"}),(0,b.jsx)(h.T,{weight:"semibold",size:18,center:!0,children:"Today\u2019s specials are on their way"}),(0,b.jsx)(h.Muted,{center:!0,children:"The kitchen posts the specials board here as soon as it\u2019s written up. Check back soon, or ask a member of staff."})]})});const f=n.allergenCheck;return(0,b.jsxs)(c.default,{style:{gap:10},testID:"specials-tab",children:[(0,b.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,b.jsx)(c.default,{testID:"specials-updated",style:{flex:1},children:(0,b.jsx)(h.T,{weight:"semibold",colour:j.colours.goldLight,children:(0,x.freshness)(n,l)})}),(0,x.isToday)(n.postedAt,l)?(0,b.jsx)(h.Badge,{kind:"green",label:"Today"}):(0,b.jsx)(h.Badge,{kind:"amber",label:"Not updated today"})]}),(0,x.isToday)(n.postedAt,l)?null:(0,b.jsx)(h.Muted,{children:"These are the most recent specials posted. Today\u2019s may differ, so please ask."}),n.photo?(0,b.jsxs)(c.default,{style:{gap:4},children:[(0,b.jsx)(T,{photo:n.photo,testID:"specials-photo",onPress:()=>u(n.photo)}),(0,b.jsx)(h.Muted,{center:!0,children:"Tap the photo to zoom"})]}):null,n.items.map(e=>(0,b.jsx)(M,{it:e,declared:s,signedBy:f?.by},e.id)),f?(0,b.jsxs)(h.Muted,{children:["Allergens for the typed specials were checked by ",f.by.replace(' (example)','')," at ",(0,y.hm)(new Date(f.at)),". Example data in this prototype."]}):null,n.photo&&!n.items.length?(0,b.jsx)(h.Muted,{children:"For allergens in these specials, please ask a member of staff before you order."}):null,(0,b.jsx)(h.Muted,{children:"Specials are served in the restaurant while they last. Ask your server to order one."}),(0,b.jsx)(k,{photo:o,onClose:()=>u(null)})]})};var t=r(d[0]),s=e(r(d[1])),l=e(r(d[2])),n=e(r(d[3])),o=e(r(d[4])),c=e(r(d[5])),u=r(d[6]),h=r(d[7]),p=r(d[8]),f=r(d[9]),x=r(d[10]),y=r(d[11]),j=r(d[12]),b=r(d[13]);const w=r(d[14]),C=e=>e===x.SAMPLE_PHOTO?w:{uri:e};function T({photo:e,width:l,onPress:o,testID:u,label:h="Photo of the specials board"}){const[p,f]=(0,t.useState)(.75);(0,t.useEffect)(()=>{e!==x.SAMPLE_PHOTO?s.default.getSize(e,(e,t)=>e&&t&&f(e/t),()=>{}):f(.75)},[e]);const y=(0,b.jsx)(s.default,{source:C(e),resizeMode:"contain",accessibilityLabel:h,style:{width:l??'100%',aspectRatio:p,borderRadius:12,backgroundColor:'#1b1f1d'}});return o?(0,b.jsx)(n.default,{testID:u,accessibilityRole:"button",accessibilityLabel:`${h}. Tap to zoom`,onPress:o,children:y}):(0,b.jsx)(c.default,{testID:u,children:y})}function k({photo:e,onClose:s}){const[u,p]=(0,t.useState)(!1);return(0,t.useEffect)(()=>p(!1),[e]),(0,b.jsx)(l.default,{visible:!!e,transparent:!0,animationType:"fade",onRequestClose:s,children:(0,b.jsxs)(c.default,{testID:"specials-zoom",style:{flex:1,backgroundColor:'rgba(5,5,5,0.97)'},children:[(0,b.jsxs)(h.Row,{style:{justifyContent:'space-between',padding:12},children:[(0,b.jsx)(h.Button,{small:!0,kind:"secondary",label:u?'Zoom out':'Zoom in',onPress:()=>p(!u)}),(0,b.jsx)(h.Button,{small:!0,label:"Close",accessibilityLabel:"Close photo",onPress:s})]}),(0,b.jsx)(o.default,{horizontal:u,contentContainerStyle:{padding:12,alignItems:'center',justifyContent:'center',flexGrow:1},children:(0,b.jsx)(o.default,{contentContainerStyle:{alignItems:'center'},children:e?(0,b.jsx)(n.default,{onPress:()=>p(!u),accessibilityLabel:u?'Zoom out':'Zoom in',children:(0,b.jsx)(T,{photo:e,width:u?820:360})}):null})})]})})}function M({it:e,declared:t,signedBy:s}){const l=(0,f.conflictsFor)(e.allergens,t);return(0,b.jsx)(h.Card,{highlight:l.contains.length?j.colours.red:l.may.length?j.colours.amber:void 0,children:(0,b.jsxs)(c.default,{testID:"special-item",style:{gap:6},children:[(0,b.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,b.jsx)(h.T,{weight:"semibold",style:{flex:1,paddingRight:8},children:e.name}),(0,b.jsx)(h.T,{weight:"semibold",colour:j.colours.gold,children:(0,x.priceText)(e.price)})]}),e.description?(0,b.jsx)(h.Muted,{children:e.description}):null,l.contains.length?(0,b.jsx)(h.Badge,{kind:"red",label:"\u26a0 Contains your allergen"}):l.may.length?(0,b.jsx)(h.Badge,{kind:"amber",label:"\u26a0 May contain your allergen"}):null,e.noAllergens&&!Object.keys(e.allergens).length?(0,b.jsx)(h.Muted,{children:"None of the 14 allergens listed"}):(0,b.jsx)(u.AllergenChips,{map:e.allergens,declared:t}),s?(0,b.jsxs)(h.Muted,{children:["Allergens checked by ",s.replace(' (example)','')]}):null]})})}},803,[12,178,238,245,133,109,798,790,804,791,805,795,797,6,999]); +__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useSpecials",{enumerable:!0,get:function(){return y}});var e,t=r(_d[0]),s=(e=t)&&e.__esModule?e:{default:e},o=r(_d[1]),n=r(_d[2]),l=r(_d[3]),c=r(_d[4]);const d=()=>{try{return(0,c.nowFrom)(c.useStore.getState().clock)}catch{return new Date}};let u=0;const p=()=>`sb-${Date.now().toString(36)}${(u++).toString(36)}`,S=(e,t)=>c.useStore.setState(s=>({audit:[{id:`au-${p()}`,restaurantId:e,at:d().toISOString(),kind:'allergy',text:t},...s.audit].slice(0,300)})),y=(0,o.create)()((0,n.persist)((e,t)=>({...(0,l.seedSpecials)(d()),post:(t,s,o,n)=>{e(e=>(0,l.postBoard)(e,t,s,o,n,d(),p())),s.items.length&&S(t,`Specials board: allergens for ${s.items.length} typed special${1===s.items.length?'':'s'} checked and signed off by ${o}`)},clear:(t,s)=>{e(e=>(0,l.clearBoard)(e,t)),S(t,`Specials board cleared by ${s}`)},reuse:(s,o,n,c)=>{const u=t().history.find(e=>e.id===o);e(e=>(0,l.reuseBoard)(e,s,o,n,c,d(),p())),u?.items.length&&S(s,`Specials board re-used: ${u.items.length} typed special${1===u.items.length?'':'s'}, allergens as previously checked, signed off by ${n}`)},remove:t=>e(e=>(0,l.deleteFromHistory)(e,t))}),{name:'covercharge-specials-v1',storage:(0,n.createJSONStorage)(()=>s.default),version:1,partialize:e=>({current:e.current,history:e.history})}))},804,[942,948,951,805,844]); +__d(function(g,r,_i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SAMPLE_PHOTO",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HISTORY_MAX",{enumerable:!0,get:function(){return n}}),e.parsePrice=function(t){const n=t.trim().replace(/^\xa3\s*/,'');return n?/^\d{1,3}(\.\d{1,2})?$/.test(n)?Math.round(100*parseFloat(n)):NaN:null},Object.defineProperty(e,"priceText",{enumerable:!0,get:function(){return s}}),e.itemProblems=a,e.draftProblems=i,e.cycleAllergen=function(t,n){const s={...t};s[n]?'contains'===s[n]?s[n]='may':delete s[n]:s[n]='contains';return s},e.postBoard=function(t,n,s,a,l,c,d){const u=i(s);if(u.length)throw new Error(u[0]);const p={id:d,restaurantId:n,photo:s.photo,app:l,postedBy:a,postedAt:c.toISOString(),items:s.items.map(t=>({...t,name:t.name.trim(),description:t.description.trim()})),allergenCheck:s.items.length?{by:a,at:c.toISOString()}:null};return{current:{...t.current,[n]:p},history:o(t.history,t.current[n],n)}},e.clearBoard=function(t,n){return{current:{...t.current,[n]:null},history:o(t.history,t.current[n],n)}},e.reuseBoard=function(t,n,s,a,i,l,c){const d=t.history.find(t=>t.id===s&&t.restaurantId===n);if(!d)return t;const u={...d,id:c,app:i,postedBy:a,postedAt:l.toISOString(),reusedFrom:d.id,allergenCheck:d.items.length?{by:a,at:l.toISOString()}:null},p={...t,history:t.history.filter(t=>t.id!==s)};return{current:{...t.current,[n]:u},history:o(p.history,t.current[n],n)}},e.deleteFromHistory=function(t,n){return{...t,history:t.history.filter(t=>t.id!==n)}},Object.defineProperty(e,"historyFor",{enumerable:!0,get:function(){return l}}),e.whenText=h,Object.defineProperty(e,"isToday",{enumerable:!0,get:function(){return m}}),Object.defineProperty(e,"freshness",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"lastUpdated",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"boardSummary",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"SAMPLE_ITEMS",{enumerable:!0,get:function(){return k}}),e.seedSpecials=function(n){const s=60*n.getHours()+n.getMinutes()>=702?S(n,0,11,42):new Date(n.getTime()-6e5),a=S(n,1,11,20),i=S(n,3,12,5);return{current:{anchorage:{id:'sb-seed-today',restaurantId:'anchorage',photo:null,items:k,postedAt:s.toISOString(),postedBy:'Head Chef (example)',app:'chef',allergenCheck:{by:'Head Chef (example)',at:s.toISOString()}}},history:[{id:'sb-seed-yday',restaurantId:'anchorage',photo:null,postedAt:a.toISOString(),postedBy:'Duty Manager (example)',app:'managers',allergenCheck:{by:'Duty Manager (example)',at:a.toISOString()},items:[{id:'sp-y1',name:'Pan-fried sea bass, samphire, brown shrimp butter (sample)',description:'Sample dish.',price:2100,allergens:{fish:'contains',crustaceans:'contains',milk:'contains'}},{id:'sp-y2',name:'Smoked haddock fishcake, poached egg (sample)',description:'Sample dish: with wholegrain mustard sauce.',price:1250,allergens:{fish:'contains',eggs:'contains',gluten:'contains',milk:'contains',mustard:'contains'}},{id:'sp-y3',name:'Lemon posset, shortbread (sample)',description:'Sample pudding.',price:750,allergens:{milk:'contains',gluten:'contains'}}]},{id:'sb-seed-photo',restaurantId:'anchorage',photo:t,items:[],postedAt:i.toISOString(),postedBy:'Head Chef (example)',app:'chef',allergenCheck:null}]}};const t='sample:chalkboard',n=8;const s=t=>null===t?'Ask your server':`\xa3${(t/100).toFixed(2)}`;function a(t){const n=[];t.name.trim().length<3&&n.push('Add a dish name'),null!==t.price&&(!Number.isFinite(t.price)||t.price<=0||t.price>5e4)&&n.push('Check the price');const s=Object.keys(t.allergens).length;return s||t.noAllergens||n.push('Choose its allergens, or tick \u201cNone of the 14\u201d'),s&&t.noAllergens&&n.push('Allergens chosen and \u201cNone of the 14\u201d both ticked'),n}function i(t){const n=[];return t.photo||t.items.length||n.push('Add a photo of the board or type at least one special'),t.items.forEach((t,s)=>a(t).forEach(t=>n.push(`Special ${s+1}: ${t}`))),t.items.length&&!t.allergensChecked&&n.push('Confirm you have checked the allergens'),n}const o=(t,s,a)=>{if(!s)return t;return[...[s,...t.filter(t=>t.restaurantId===a&&t.id!==s.id)].slice(0,n),...t.filter(t=>t.restaurantId!==a)]};const l=(t,n)=>t.history.filter(t=>t.restaurantId===n),c=t=>String(t).padStart(2,'0'),d=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],u=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],p=(t,n)=>t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate();function h(t,n){const s=new Date(t),a=`${c(s.getHours())}:${c(s.getMinutes())}`;if(p(s,n))return`today at ${a}`;const i=new Date(n);return i.setDate(i.getDate()-1),p(s,i)?`yesterday at ${a}`:`${d[s.getDay()]} ${s.getDate()} ${u[s.getMonth()]} at ${a}`}const m=(t,n)=>p(new Date(t),n),y=(t,n)=>`Updated ${h(t.postedAt,n)}`,f=(t,n)=>`Last updated ${h(t.postedAt,n)} by ${t.postedBy}`,b=t=>[t.photo?'Photo':'',t.items.length?`${t.items.length} typed special${1===t.items.length?'':'s'}`:''].filter(Boolean).join(' + '),S=(t,n,s,a)=>{const i=new Date(t);return i.setDate(i.getDate()-n),i.setHours(s,a,0,0),i},k=[{id:'sp-hake',name:'Grilled hake, crushed new potatoes, salsa verde (sample)',description:'Sample dish: day-boat hake, lemon and caper salsa verde.',price:1950,allergens:{fish:'contains',mustard:'contains',sulphites:'may'}},{id:'sp-scallops',name:'Half-shell scallops, garlic and herb butter (sample)',description:'Sample dish: three scallops grilled in the shell, crusty bread.',price:1400,allergens:{molluscs:'contains',milk:'contains',gluten:'contains'}},{id:'sp-crab',name:'Crab and chilli linguine (sample)',description:'Sample dish: brown and white crab meat, chilli, parsley, lemon.',price:1850,allergens:{crustaceans:'contains',gluten:'contains',eggs:'contains',molluscs:'may'}},{id:'sp-mussels',name:'Mussels in cider and leek cream (sample)',description:'Sample dish: rope-grown mussels, dry cider, leeks, cream. Main with chips.',price:1300,allergens:{molluscs:'contains',milk:'contains',sulphites:'contains',celery:'may'}}]},805,[]); +__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 n.default}});var e=r(d[0]);Object.keys(e).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(_e,t)||Object.defineProperty(_e,t,{enumerable:!0,get:function(){return e[t]}})});var t,n=(t=e)&&t.__esModule?t:{default:t}},841,[966]); +__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.forecastToday=function(o,r,s,n,u){const c=(0,t.hoursFor)(o,u),l=[],h=(0,a.ymd)(u);let y=1;for(const e of n.filter(e=>e.date===h&&(null===e.restaurantId||e.restaurantId===o.id)))l.push(e.title),y*='bank-holiday'===e.kind?1.25:'event'===e.kind?1.15:1.1;if(!c)return{open:!1,hours:[],restOfDay:{covers:0,low:0,high:0,takeaway:0,booked:0},flags:l,suggestions:['Kitchen closed today (per listed hours).'],multiplier:y};const p=e.EXAMPLE_HISTORY[o.id]??e.EXAMPLE_HISTORY.default,k=u.getDay(),f=c.open.getHours(),v=c.close.getMinutes()>0?c.close.getHours():c.close.getHours()-1,w=[];for(let e=f;e<=v;e++){const t=p.covers[k]?.[e]??0,n=p.takeaway[k]?.[e]??0,u=r.filter(t=>t.restaurantId===o.id&&t.date===h&&!t.walkIn&&['confirmed','seated'].includes(t.status)&&Number(t.time.slice(0,2))===e).reduce((e,t)=>e+t.partySize,0),c=r.filter(t=>t.restaurantId===o.id&&t.date===h&&t.walkIn&&['seated','finished'].includes(t.status)&&Number(t.time.slice(0,2))===e).reduce((e,t)=>e+t.partySize,0),l=Math.max(c,Math.round(t*o.settings.walkInShare*y)),f=u+l,v=s.filter(t=>t.restaurantId===o.id&&'takeaway'===t.type&&'cancelled'!==t.status&&t.slotTime&&new Date(t.slotTime).getHours()===e&&(0,a.ymd)(new Date(t.slotTime))===h).length,M=Math.max(v,Math.round(n*y));w.push({hour:e,booked:u,walkIns:l,covers:f,coversLow:Math.round(.8*f),coversHigh:Math.round(1.2*f),takeawayPlaced:v,takeaway:M,historicalCovers:t})}const M=u.getHours()+(u.getMinutes()>=30?1:0),H=w.filter(e=>e.hour>=M),I=H[0],S=e=>H.reduce((t,a)=>t+e(a),0),b={covers:S(e=>e.covers),low:S(e=>e.coversLow),high:S(e=>e.coversHigh),takeaway:S(e=>e.takeaway),booked:S(e=>e.booked)},T=[],D=o.settings.capacityPerHour,$=H.reduce((e,t)=>!e||t.covers>e.covers?t:e,void 0);$&&$.covers>=.85*D&&T.push(`Dining room near capacity around ${String($.hour).padStart(2,'0')}:00 (~${$.covers} of ${D} covers) \u2014 consider pausing or capping takeaway slots then.`);const _=H.find(e=>e.historicalCovers>0&&e.covers>1.1*e.historicalCovers);_&&T.push(`Busier than a usual ${['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'][k]} from ${String(_.hour).padStart(2,'0')}:00 \u2014 consider one more on the floor.`);b.takeaway>=10&&T.push(`~${b.takeaway} takeaway orders expected \u2014 prep extra haddock and chips.`);T.length||T.push('Looks like a normal service \u2014 no action suggested.');return{open:!0,nextHour:I,hours:w,restOfDay:b,flags:l,suggestions:T,multiplier:y}};var e=_r(d[0]),t=_r(d[1]),a=_r(d[2])},842,[857,792,795]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.estimateWait=function(t,n,u){const o=Math.max(6,Math.round(n/6*u));return t*o}},843,[]); +__d(function(_g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.nowFrom=c,_e.linesFromBasket=g,Object.defineProperty(_e,"useStore",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"DEMO_CUSTOMER_ID",{enumerable:!0,get:function(){return s.DEMO_CUSTOMER_ID}});var e,t=_r(d[0]),a=(e=t)&&e.__esModule?e:{default:e},r=_r(d[1]),n=_r(d[2]),s=_r(d[3]),i=_r(d[4]),o=_r(d[5]);const l=e=>`${e}-${Math.random().toString(36).slice(2,8)}${Date.now().toString(36).slice(-3)}`;function c(e){return'live'===e.mode?new Date:new Date(e.simStartMs+(Date.now()-e.anchorRealMs))}function u(){const e=(0,s.defaultSimStart)();return{clock:{mode:'simulated',simStartMs:e.getTime(),anchorRealMs:Date.now()},...(0,s.buildSeed)(e)}}function g(e,t,a){return e.lines.flatMap(e=>{const r=t.find(t=>t.id===e.itemId);if(!r)return[];const n=(r.optionGroups??[]).flatMap(t=>t.choices.filter(t=>e.choiceIds.includes(t.id))),s=(r.price??0)+n.reduce((e,t)=>e+t.priceDelta,0),o=(0,i.conflictsFor)((0,i.effectiveAllergens)(r,e.choiceIds),a);return[{itemId:r.id,name:r.name,qty:e.qty,unitPrice:s,choices:n.map(e=>e.label),notes:e.notes,contains:o.contains,may:o.may,overridden:!!e.override&&o.contains.every(t=>e.override.allergens.includes(t)),prepMins:r.prepMins}]})}const m=e=>{const t='ABCDEFGHJKLMNPQRSTUVWXYZ23456789',a=()=>Array.from({length:4},()=>t[Math.floor(32*Math.random())]).join('');return`${e}-${a()}-${a()}-${a()}`},f=(0,r.create)()((0,n.persist)((e,t)=>{const a=()=>c(t().clock),r=(t,r,n)=>e(e=>({audit:[{id:l('au'),restaurantId:t,at:a().toISOString(),kind:r,text:n},...e.audit].slice(0,300)})),n=(a,n,s)=>{if(!a||s<=0)return 0;const i=t().giftCards.find(e=>e.code===a&&e.restaurantId===n);if(!i||i.balance<=0)return 0;const o=Math.min(i.balance,s);return e(e=>({giftCards:e.giftCards.map(e=>e.id===i.id?{...e,balance:e.balance-o}:e)})),r(n,'giftcard',`Gift card ${a.slice(0,8)}\u2026 redeemed \xa3${(o/100).toFixed(2)} (balance \xa3${((i.balance-o)/100).toFixed(2)})`),o},f=e=>{const a=t().restaurants.find(t=>t.id===e.restaurantId);a&&e.customerId===t().customer.id&&e.subtotal>=a.settings.stampMinSpend&&t().addStamp(e.restaurantId,e.customerId,'takeaway'===e.type?'Takeaway (auto on collection)':'Table QR bill (auto on payment)')};return{...u(),resetDemo:()=>e(u()),setClockMode:t=>{const a=(0,s.defaultSimStart)();e({clock:{mode:t,simStartMs:a.getTime(),anchorRealMs:Date.now()}})},skipMinutes:t=>e(e=>({clock:{...e.clock,simStartMs:e.clock.simStartMs+6e4*t}})),updateCustomer:t=>e(e=>({customer:{...e.customer,...t}})),setAllergy:(t,a)=>e(e=>{const r=e.customer.allergies.filter(e=>e.allergen!==t);return{customer:{...e.customer,allergies:a?[...r,{allergen:t,severity:a}]:r}}}),startBasket:(t,a,r)=>e(e=>{const n=e.basket.restaurantId===t&&e.basket.mode===a&&e.basket.tableNo===r;return{basket:{restaurantId:t,mode:a,tableNo:r,lines:n?e.basket.lines:[]}}}),addLine:t=>e(e=>({basket:{...e.basket,lines:[...e.basket.lines,{...t,key:l('ln')}]}})),setLineQty:(t,a)=>e(e=>({basket:{...e.basket,lines:a<=0?e.basket.lines.filter(e=>e.key!==t):e.basket.lines.map(e=>e.key===t?{...e,qty:a}:e)}})),overrideLine:(t,r)=>e(e=>({basket:{...e.basket,lines:e.basket.lines.map(e=>e.key===t?{...e,override:{allergens:r,at:a().toISOString()}}:e)}})),clearBasket:()=>e(e=>({basket:{...e.basket,lines:[]}})),placeOrder:({slotTime:s,tip:i,giftCardCode:o,notes:c,paidNow:u})=>{const m=t(),f=m.basket,k=f.restaurantId,p=g(f,m.menu,m.customer.allergies),b=p.reduce((e,t)=>e+t.unitPrice*t.qty,0),$='table'===f.mode,y=$?m.counters.table+1:m.counters.order+1,I=u?n(o,k,b+i):0,S=b+i,h={id:l('ord'),ref:`${$?'Q':'T'}-${y}`,restaurantId:k,customerId:m.customer.id,customerName:m.customer.name,type:f.mode,tableNo:f.tableNo,slotTime:s,lines:p,subtotal:b,tip:i,giftCardApplied:I,giftCardCode:I?o:void 0,total:S,paid:u?S:0,status:'new',createdAt:a().toISOString(),allergies:m.customer.allergies,readiness:{},notes:c};e(e=>({orders:[h,...e.orders],basket:{...e.basket,lines:[]},counters:$?{...e.counters,table:y}:{...e.counters,order:y}}));const w=p.filter(e=>e.overridden);return r(k,'order',`Order ${h.ref} placed (${$?`Table ${f.tableNo}`:'takeaway'})${w.length?` \u2014 ALLERGY OVERRIDE on ${w.map(e=>e.name).join(', ')}`:''}`),h.allergies.length&&r(k,'allergy',`Allergies declared and confirmed by customer on ${h.ref}: ${h.allergies.map(e=>`${e.allergen} (${e.severity})`).join(', ')}`),h},setOrderStatus:(a,n,s)=>{const i=t().orders.find(e=>e.id===a);i&&((0,o.statusBlock)(i,n,(0,o.linkedBooking)(i,t().bookings))||(e(e=>({orders:e.orders.map(e=>e.id===a?{...e,status:n}:e)})),r(i.restaurantId,'order',`${i.ref} \u2192 ${n}${s?` by ${s}`:''}`),'collected'===n&&'takeaway'===i.type&&f(i)))},ackOrderAllergy:(n,s)=>{const i=t().orders.find(e=>e.id===n);if(!i||!(0,o.canSign)(i,'kitchen',(0,o.linkedBooking)(i,t().bookings)))return;const l={by:s,at:a().toISOString()};e(e=>({orders:e.orders.map(e=>e.id===n?{...e,allergyAck:l,status:'new'===e.status?'acknowledged':e.status}:e)})),r(i.restaurantId,'allergy',`Allergen sign-off 3/5 Kitchen on ${i.ref}: ${s} (chef signed off before cooking)`)},ackReadiness:(n,s,i)=>{const l=t().orders.find(e=>e.id===n);l&&('cook'===s&&(0,o.statusBlock)(l,'preparing',(0,o.linkedBooking)(l,t().bookings))||(e(e=>({orders:e.orders.map(e=>e.id===n?{...e,readiness:{...e.readiness,[s]:{by:i,at:a().toISOString()}},status:'cook'===s&&['new','acknowledged'].includes(e.status)?'preparing':e.status}:e)})),r(l.restaurantId,'order',`${l.ref}: ${'cook'===s?'started cooking':'bagged'} (${i})`)))},handoverCheck:(n,s)=>{const i=t().orders.find(e=>e.id===n);i&&(0,o.canSign)(i,'table',(0,o.linkedBooking)(i,t().bookings))&&(e(e=>({orders:e.orders.map(e=>e.id===n?{...e,handoverCheck:{by:s,at:a().toISOString()}}:e)})),r(i.restaurantId,'allergy',`Allergen sign-off 5/5 Table on ${i.ref}: ${s} (served and checked with the guest; chain complete)`))},signAllergyStep:(n,s,i)=>{const l=t().orders.find(e=>e.id===n);if(!l||!i.trim())return!1;const c=(0,o.linkedBooking)(l,t().bookings);if(!(0,o.canSign)(l,s,c))return!1;if('kitchen'===s)return t().ackOrderAllergy(n,i),!0;if('table'===s)return t().handoverCheck(n,i),!0;const u={by:i,at:a().toISOString()};'booked'===s&&c&&c.allergies.length&&!c.allergyAck?e(e=>({bookings:e.bookings.map(e=>e.id===c.id?{...e,allergyAck:u}:e)})):e(e=>({orders:e.orders.map(e=>e.id===n?{...e,allergyChain:{...e.allergyChain,[s]:u}}:e)}));const g=(0,o.stepInfo)(s);return r(l.restaurantId,'allergy',`Allergen sign-off ${g.n}/5 ${g.label} on ${l.ref}: ${i} (${g.what.toLowerCase()})`),!0},customerSignal:(t,a)=>e(e=>({orders:e.orders.map(e=>e.id===t?{...e,customerSignal:a}:e)})),setSplit:(t,a,r)=>e(e=>({orders:e.orders.map(e=>e.id===t?{...e,tip:r,total:e.subtotal+r,split:{ways:a,paidShares:e.split?.paidShares??0}}:e)})),payTable:(a,{shares:s,giftCardCode:i})=>{const o=t().orders.find(e=>e.id===a);if(!o)return;const l=o.split?.ways??1,c=Math.ceil(o.total/l),u=Math.min(l,(o.split?.paidShares??0)+s),g=u>=l,m=g?o.total-o.paid:Math.min(o.total-o.paid,c*s),k=n(i,o.restaurantId,m),p={...o,giftCardApplied:o.giftCardApplied+k,giftCardCode:k?i:o.giftCardCode,paid:o.paid+m,split:{ways:l,paidShares:u},status:g?'closed':o.status};e(e=>({orders:e.orders.map(e=>e.id===a?p:e)})),r(o.restaurantId,'order',`${o.ref} (Table ${o.tableNo}) ${g?'bill paid in full':`share ${u}/${l} paid`} (demo payment)`),g&&f(p)},createBooking:n=>{const s=t().counters.booking+1,i={...n,id:l('bk'),ref:`BK-${s}`,status:'confirmed',createdAt:a().toISOString()};return e(e=>({bookings:[...e.bookings,i],counters:{...e.counters,booking:s}})),r(i.restaurantId,'booking',`Booking ${i.ref}: ${i.name}, ${i.partySize} on ${i.date} ${i.time}${i.allergies.length?' \u2014 allergies declared':''}`),i},setBookingStatus:(n,s)=>{const i=t().bookings.find(e=>e.id===n),o=a().toISOString();e(e=>({bookings:e.bookings.map(e=>e.id===n?{...e,status:s,...'seated'===s?{seatedAt:o}:'finished'===s?{finishedAt:o}:{}}:e)})),i&&r(i.restaurantId,'booking',`${i.ref} ${i.name} \u2192 ${s}`)},seatWalkIn:(n,s,i,o)=>{const c=a(),u=`${c.getFullYear()}-${String(c.getMonth()+1).padStart(2,'0')}-${String(c.getDate()).padStart(2,'0')}`,g=`${String(c.getHours()).padStart(2,'0')}:${String(c.getMinutes()).padStart(2,'0')}`,m=t().bookings.filter(e=>e.restaurantId===n&&e.walkIn&&e.date===u).reduce((e,t)=>Math.max(e,Number(t.ref.slice(2))||0),0)+1,f={id:l('wk'),ref:`W-${m}`,restaurantId:n,customerId:null,name:'Walk-in',partySize:s,date:u,time:g,table:i||void 0,allergies:[],notes:(o??'').trim(),status:'seated',security:'none',depositPaid:0,createdAt:c.toISOString(),seatedAt:c.toISOString(),walkIn:!0};return e(e=>({bookings:[...e.bookings,f]})),r(n,'walkin',`Walk-in ${f.ref} seated: ${s} cover(s)${i?`, Table ${i}`:', table to assign'}`),f},setBookingTable:(a,n)=>{const s=t().bookings.find(e=>e.id===a);e(e=>({bookings:e.bookings.map(e=>e.id===a?{...e,table:n}:e)})),s&&r(s.restaurantId,'booking',`${s.ref} ${s.name} \u2192 Table ${n}`)},updateBooking:(a,n)=>{const s=t().bookings.find(e=>e.id===a);e(e=>({bookings:e.bookings.map(e=>e.id===a?{...e,...n}:e)})),s&&r(s.restaurantId,'booking',`${s.ref} ${s.walkIn?'Walk-in':s.name} moved/updated${n.table?` \u2192 Table ${n.table}`:''}${n.time?` at ${n.time}`:''}${n.durationMins?` for ${n.durationMins} min`:''}`)},undoWalkIn:a=>{const n=t().bookings.find(e=>e.id===a);n&&n.walkIn&&(e(e=>({bookings:e.bookings.filter(e=>e.id!==a)})),r(n.restaurantId,'walkin',`Walk-in ${n.ref} undone`))},ackBookingAllergy:(n,s)=>{const i=t().bookings.find(e=>e.id===n);i&&!i.allergyAck&&(e(e=>({bookings:e.bookings.map(e=>e.id===n?{...e,allergyAck:{by:s,at:a().toISOString()}}:e)})),r(i.restaurantId,'allergy',`Allergen sign-off 1/5 Booked on ${i.ref} (${i.name}): ${s} (allergy recorded)`))},joinWaitlist:(n,s,i,o)=>{const c=t().waitlist.filter(e=>e.restaurantId===n).reduce((e,t)=>Math.max(e,t.number),0)+1,u={id:l('wl'),restaurantId:n,number:c,name:s,partySize:i,joinedAt:a().toISOString(),status:'waiting',customerId:o};return e(e=>({waitlist:[...e.waitlist,u]})),r(n,'waitlist',`${s} (${i}) joined the waitlist as #${c}`),u},setWaitlistStatus:(a,n)=>{const s=t().waitlist.find(e=>e.id===a);e(e=>({waitlist:e.waitlist.map(e=>e.id===a?{...e,status:n}:e)})),s&&(r(s.restaurantId,'waitlist',`Waitlist #${s.number} ${s.name} \u2192 ${n}`),'seated'===n&&t().addWalkIn(s.restaurantId,s.partySize))},addWalkIn:(t,a)=>{e(e=>({walkIns:{...e.walkIns,[t]:(e.walkIns[t]??0)+a}})),r(t,'walkin',`Walk-in seated: ${a} cover(s)`)},addStamp:(n,s,i)=>{const o=t().restaurants.find(e=>e.id===n);o&&(e(e=>{const t=e.stampCards.find(e=>e.restaurantId===n&&e.customerId===s),r=t??{restaurantId:n,customerId:s,stamps:0,rewardsAvailable:0,history:[]};let l=r.stamps+1,c=r.rewardsAvailable;l>=o.settings.stampTarget&&(l=0,c+=1);const u={...r,stamps:l,rewardsAvailable:c,history:[{at:a().toISOString(),source:i},...r.history]};return{stampCards:t?e.stampCards.map(e=>e===t?u:e):[...e.stampCards,u]}}),r(n,'stamp',`Stamp added (${i})`))},redeemReward:(t,a)=>{e(e=>({stampCards:e.stampCards.map(e=>e.restaurantId===t&&e.customerId===a&&e.rewardsAvailable>0?{...e,rewardsAvailable:e.rewardsAvailable-1}:e)})),r(t,'stamp','Loyalty reward redeemed')},buyGiftCard:(n,s,i,o)=>{const c=n.slice(0,3).toUpperCase(),u={id:l('gc'),code:m(c),restaurantId:n,initial:s,balance:s,ownerId:t().customer.id,recipientName:i,message:o,createdAt:a().toISOString()};return e(e=>({giftCards:[u,...e.giftCards]})),r(n,'giftcard',`Gift card sold \xa3${(s/100).toFixed(2)} (demo payment)`),u},redeemGiftCard:(a,n,s)=>{const i=t().giftCards.find(e=>e.code.toUpperCase()===a.trim().toUpperCase());return!(!i||n<=0||n>i.balance)&&(e(e=>({giftCards:e.giftCards.map(e=>e.id===i.id?{...e,balance:e.balance-n}:e)})),r(i.restaurantId,'giftcard',`Gift card ${i.code} redeemed \xa3${(n/100).toFixed(2)} by ${s}`),!0)},honourLegacyCard:(t,n,s,i)=>{const o={id:l('gc'),code:n.trim().toUpperCase(),restaurantId:t,initial:s,balance:s,ownerId:'legacy',recipientName:'Legacy Wix gift card',message:`Honoured by ${i}`,createdAt:a().toISOString().slice(0,10),legacy:!0};return e(e=>({giftCards:[o,...e.giftCards]})),r(t,'giftcard',`Legacy Wix gift card ${o.code} honoured (\xa3${(s/100).toFixed(2)}) by ${i}`),o},addEvent:t=>e(e=>({events:[...e.events,{...t,id:l('ev')}]})),addRating:t=>{e(e=>({ratings:[{...t,id:l('rt'),createdAt:a().toISOString()},...e.ratings],orders:t.orderId?e.orders.map(e=>e.id===t.orderId?{...e,rated:!0}:e):e.orders})),r(t.restaurantId,'rating',`Private rating ${t.stars}/5 from ${t.customerName}`)},updateMenuItem:(a,n)=>{const s='allergens'in n||'description'in n||'optionGroups'in n;e(e=>({menu:e.menu.map(e=>e.id===a?{...e,...n,signOff:s?null:e.signOff}:e)}));const i=t().menu.find(e=>e.id===a);i&&r(i.restaurantId,'menu',`Menu: ${i.name} updated${s?' \u2014 allergen sign-off reset':''}`)},setSignOff:(n,s)=>{e(e=>({menu:e.menu.map(e=>e.id===n?{...e,signOff:s?{by:s,at:a().toISOString().slice(0,10)}:null}:e)}));const i=t().menu.find(e=>e.id===n);i&&r(i.restaurantId,'menu',`Allergen sign-off ${s?`given by ${s}`:'removed'}: ${i.name}`)},updateSettings:(t,a)=>{e(e=>({restaurants:e.restaurants.map(e=>e.id===t?{...e,settings:{...e.settings,...a}}:e)})),'takeawayPaused'in a&&r(t,'order',"Takeaway slots "+(a.takeawayPaused?'PAUSED':'resumed'))},addMenuItem:t=>{const a=l('m');return e(e=>({menu:[...e.menu,{...t,id:a}]})),r(t.restaurantId,'menu',`Menu: ${t.name} added (needs allergen sign-off)`),a},updateRestaurant:(t,a)=>{e(e=>({restaurants:e.restaurants.map(e=>e.id===t?{...e,...a}:e)})),r(t,'menu',`Restaurant info updated (${Object.keys(a).join(', ')})`)},placeManualOrder:({restaurantId:n,type:s,channel:o,customerName:c,tableNo:u,slotTime:g,lines:m,allergies:f,notes:k,by:p})=>{const b=t(),$=m.flatMap(({itemId:e,qty:t})=>{const a=b.menu.find(t=>t.id===e);if(!a||t<=0)return[];const r=(0,i.conflictsFor)((0,i.effectiveAllergens)(a),f);return[{itemId:e,name:a.name,qty:t,unitPrice:a.price??0,choices:[],notes:'',contains:r.contains,may:r.may,overridden:!1,prepMins:a.prepMins}]}),y=$.reduce((e,t)=>e+t.unitPrice*t.qty,0),I='table'===s,S=I?b.counters.table+1:b.counters.order+1,h={id:l('ord'),ref:`${I?'Q':'T'}-${S}`,restaurantId:n,customerId:`manual-${o}`,customerName:c||(I?`Table ${u}`:'Walk-in'),type:s,tableNo:u,slotTime:g,lines:$,subtotal:y,tip:0,giftCardApplied:0,total:y,paid:0,status:'new',createdAt:a().toISOString(),allergies:f,readiness:{},notes:k,channel:o,...f.length?{allergyChain:{booked:{by:p,at:a().toISOString()}}}:{}};return e(e=>({orders:[h,...e.orders],counters:I?{...e.counters,table:S}:{...e.counters,order:S}})),r(n,'order',`Order ${h.ref} taken by ${p} (${'phone'===o?'phone':'walk-in'===o?'walk-in takeaway':`Table ${u}`})`),f.length&&r(n,'allergy',`Allergen sign-off 1/5 Booked on ${h.ref}: ${p} recorded ${f.map(e=>`${e.allergen} (${e.severity})`).join(', ')}`),h},ackAlert:(t,r)=>e(e=>({alertAcks:{...e.alertAcks,[t]:{by:r,at:a().toISOString()}}}))}},{name:'covercharge-demo-v1',version:1,storage:(0,n.createJSONStorage)(()=>a.default)}))},844,[942,948,951,952,791,862]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useShallow",{enumerable:!0,get:function(){return o}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]);function o(e){const t=u.default.useRef(void 0);return u=>{const o=e(u);return(0,n.shallow)(t.current,o)?t.current:t.current=o}}},845,[12,956]); +__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,"BUILTIN_LOGOS",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"HERO_LOGOS",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"HEADER_LOGO",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"ACCENTS",{enumerable:!0,get:function(){return b}}),_e.useBrandRid=x,_e.useBrand=j,_e.PoweredBy=p,_e.RestaurantLogo=O,_e.RestaurantHero=function({rid:e,size:t=200,showPlace:l=!0}){const s=j(e),f=s.custom?s.logo:h[s.rid]??s.logo;return(0,u.jsxs)(o.default,{testID:"restaurant-hero",style:{alignItems:'center',gap:6},children:[f?(0,u.jsx)(n.default,{source:f,accessibilityLabel:`${s.name} logo`,style:{width:t,height:t,borderRadius:s.custom?t/2:0},resizeMode:"contain"}):(0,u.jsx)(O,{rid:s.rid,size:t}),(0,u.jsx)(r.default,{style:{fontFamily:c.fonts.semibold,fontSize:26,lineHeight:34,color:c.colours.text,textAlign:'center'},children:s.name}),l&&s.place?(0,u.jsx)(r.default,{style:{fontFamily:c.fonts.regular,fontSize:14,lineHeight:20,color:s.accent,textAlign:'center'},children:s.place}):null]})},_e.RestaurantBrand=function({rid:e,sub:t,size:n=y,nameSuffix:l}){const s=j(e);return(0,u.jsxs)(o.default,{style:{gap:2,flexShrink:1},children:[(0,u.jsx)(p,{}),(0,u.jsxs)(o.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,u.jsx)(O,{rid:s.rid,size:n}),(0,u.jsxs)(o.default,{style:{flexShrink:1},children:[(0,u.jsxs)(r.default,{numberOfLines:1,style:{fontFamily:c.fonts.semibold,fontSize:17,lineHeight:22,color:c.colours.text},children:[s.name,l??'']}),t?(0,u.jsx)(r.default,{numberOfLines:1,style:{fontFamily:c.fonts.regular,fontSize:12,lineHeight:16,color:s.accent},children:t}):null]})]})]})};var t=_r(d[0]);_r(d[1]);var n=e(_r(d[2])),r=e(_r(d[3])),o=e(_r(d[4])),l=_r(d[5]),s=_r(d[6]),c=_r(d[7]),u=_r(d[8]);const f={anchorage:_r(d[9]),saltmarsh:_r(d[10]),brae:_r(d[11])},h={anchorage:_r(d[12])},y=48,b=['#CFA45F','#D4AF61','#C9A24A','#E2C489','#F2EDE4','#5FA8CF','#7FB069','#D9774B'];function x(e){const n=(0,t.useGlobalSearchParams)(),r=(0,s.useOwner)(e=>e.site),o='string'==typeof n.rid?n.rid:void 0;return e??o??r??'anchorage'}function j(e){const t=x(e),n=(0,l.useStore)(e=>e.restaurants.find(e=>e.id===t)),r=(0,s.useOwner)(e=>e.branding[t]),o=r?.logoUri?{uri:r.logoUri}:f[t];return{rid:t,name:n?.name??'Restaurant',place:n?.location??'',logo:o,accent:r?.accent??c.colours.gold,custom:!!r?.logoUri}}function p({size:e=10}){return(0,u.jsxs)(r.default,{accessibilityLabel:"powered by CoverCharge",style:{fontFamily:c.fonts.regular,fontSize:e,lineHeight:Math.round(1.35*e),color:c.colours.muted},children:["powered by ",(0,u.jsx)(r.default,{style:{fontFamily:c.fonts.semibold,color:c.colours.text},children:"Cover"}),(0,u.jsx)(r.default,{style:{fontFamily:c.fonts.semibold,color:c.colours.gold},children:"Charge"})]})}function O({rid:e,size:t=y}){const l=j(e);if(l.logo)return(0,u.jsx)(n.default,{source:l.logo,accessibilityLabel:`${l.name} logo`,style:{width:t,height:t,borderRadius:l.custom?t/2:0},resizeMode:"contain"});const s=l.name.replace(/^The /,'').split(/\s+/).map(e=>e[0]).join('').slice(0,2).toUpperCase();return(0,u.jsx)(o.default,{accessibilityLabel:`${l.name} logo`,style:{width:t,height:t,borderRadius:t/2,borderWidth:2,borderColor:l.accent,alignItems:'center',justifyContent:'center'},children:(0,u.jsx)(r.default,{style:{fontFamily:c.fonts.bold,color:l.accent,fontSize:.36*t},children:s})})}},855,[785,12,178,188,109,796,802,797,6,957,958,959,960]); +__d(function(g,_r,i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readinessFor=function(a,d,r){if('takeaway'!==a.type||!a.slotTime)return[];if(['collected','cancelled','closed'].includes(a.status))return[];const s=new Date(a.slotTime),n=d.settings.bufferMins,o=a.lines.map(a=>({name:a.name,qty:a.qty,at:(0,t.addMins)(s,-(a.prepMins+n))})),u=o.reduce((t,a)=>a.at{if(a)return'done';const d=r.getTime()-t.getTime();return d<0?'upcoming':d>3e5?'overdue':'due'},y=['ready','collected'].includes(a.status);return[{id:`${a.id}:cook`,orderId:a.id,stage:'cook',due:u,state:l(u,!!a.readiness.cook||y),detail:o.sort((t,a)=>t.at.getTime()-a.at.getTime()).map(t=>{return`${t.qty}\xd7 ${t.name} at ${a=t.at,`${String(a.getHours()).padStart(2,'0')}:${String(a.getMinutes()).padStart(2,'0')}`}`;var a}).join(' \xb7 ')},{id:`${a.id}:bag`,orderId:a.id,stage:'bag',due:c,state:l(c,!!a.readiness.bag||y),detail:'Bag, add sauces/drinks, check against ticket and allergy flags'},{id:`${a.id}:ready`,orderId:a.id,stage:'ready',due:s,state:l(s,y),detail:'Mark ready \u2014 sends the customer a "your order is ready" notification'}]};var t=_r(_d[0])},856,[795]); +__d(function(g,r,i,a,m,e,_d){"use strict";function t(t,n){const o={};for(let c=0;c<7;c++){o[c]={};const u=n[c]??0;for(const[n,s]of Object.entries(t))o[c][Number(n)]=Math.round(s*u)}return o}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"EXAMPLE_HISTORY",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"EXAMPLE_ACCURACY",{enumerable:!0,get:function(){return f}});const n={12:18,13:26,14:16,15:9,16:10,17:22,18:36,19:38,20:20},o={12:2,13:2,14:1,15:1,16:2,17:4,18:6,19:5,20:2},c={0:1.05,1:0,2:0,3:.6,4:.7,5:1,6:1.15},u={0:.6,1:.5,2:.5,3:.6,4:.7,5:.9,6:1},s={anchorage:{covers:t(n,c),takeaway:t(o,c)},default:{covers:t(n,u),takeaway:t(o,u)}},f='Example: last 4 weeks within \xb118% of actual covers'},857,[]); +__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,"CHANNELS",{enumerable:!0,get:function(){return f}}),_e.inChannel=y,Object.defineProperty(_e,"dmId",{enumerable:!0,get:function(){return j}}),_e.autoPost=function(e,t){const s=new Date(globalThis.__ccNow??Date.now()).toISOString();(Array.isArray(e)?e:[e]).forEach(e=>l.useOwner.getState().sys(e,t,s))},_e.ensureChat=p,_e.useChatUnread=w,_e.Chat=function({go:e}){const{now:n,meId:h,role:x}=(0,c.useCtx)(3e4),v=(0,l.useOwner)(e=>e.staff),S=(0,l.useOwner)(e=>e.chat),k=(0,l.useOwner)(e=>e.chatMuted[h]??m),{by:O}=w(),[T,B]=(0,t.useState)(null),[M,A]=(0,t.useState)(!1),[L,P]=(0,t.useState)(!1);(0,t.useEffect)(()=>{p(n)},[]),(0,t.useEffect)(()=>{B(null)},[h]);const z=v.find(e=>e.id===h);if(T)return(0,u.jsx)(R,{ch:T,go:e,back:()=>B(null)});const D=Array.from(new Set(S.filter(e=>e.ch.startsWith('dm:')&&y(e.ch,z)).map(e=>e.ch))),I=({id:e,name:t,icon:n,avatar:l})=>{const c=(h=e,S.filter(e=>e.ch===h).sort((e,t)=>t.at.localeCompare(e.at))[0]);var h;const f=O[e]??0,m=k.includes(e);return(0,u.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:`Open ${t}`,onPress:()=>B(e),style:{padding:12,borderTopWidth:1,borderColor:d.colours.border},children:(0,u.jsxs)(i.Row,{children:[l?(0,u.jsx)(C,{s:l}):(0,u.jsx)(o.default,{style:{width:34,height:34,borderRadius:17,backgroundColor:'#222',alignItems:'center',justifyContent:'center'},children:(0,u.jsx)(i.T,{size:16,children:n})}),(0,u.jsxs)(o.default,{style:{flex:1},children:[(0,u.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsxs)(i.T,{weight:f?'bold':'medium',children:[t,m?' \ud83d\udd15':'']}),c?(0,u.jsx)(i.Muted,{children:(0,a.hm)(new Date(c.at))}):null]}),(0,u.jsx)(i.Muted,{numberOfLines:1,children:c?c.removed?'Message removed':`${'system'===c.from?'Cover Charge':b(v.find(e=>e.id===c.from)?.name)}: ${c.text??'\ud83d\udcf7 Photo'}`:'No messages yet'})]}),f?(0,u.jsx)(o.default,{style:{backgroundColor:m?'#555':d.colours.red,borderRadius:10,minWidth:20,height:20,alignItems:'center',justifyContent:'center',paddingHorizontal:5},children:(0,u.jsx)(i.T,{size:11,weight:"bold",children:f})}):null]})})};return(0,u.jsxs)(o.default,{style:{gap:10},children:[(0,u.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsxs)(i.Muted,{children:["Signed in as ",b(z?.name)," (",l.ROLE_LABEL[x],")"]}),(0,u.jsx)(i.Button,{small:!0,kind:"ghost",label:"Chat settings",onPress:()=>P(!0)})]}),(0,u.jsxs)(o.default,{style:{borderRadius:14,borderWidth:1,borderColor:d.colours.border,backgroundColor:d.colours.surface,overflow:'hidden'},children:[(0,u.jsx)(i.T,{size:12,weight:"semibold",colour:d.colours.gold,style:{padding:10},children:"CHANNELS"}),f.filter(e=>y(e.id,z)).map(e=>(0,u.jsx)(I,{id:e.id,name:e.name,icon:e.icon},e.id))]}),(0,u.jsxs)(o.default,{style:{borderRadius:14,borderWidth:1,borderColor:d.colours.border,backgroundColor:d.colours.surface,overflow:'hidden'},children:[(0,u.jsxs)(i.Row,{style:{justifyContent:'space-between',padding:10},children:[(0,u.jsx)(i.T,{size:12,weight:"semibold",colour:d.colours.gold,children:"DIRECT MESSAGES"}),(0,u.jsx)(i.Button,{small:!0,kind:"ghost",label:"+ New",onPress:()=>A(!0)})]}),D.map(e=>{const t=v.find(t=>t.id===e.split(':').slice(1).find(e=>e!==h));return(0,u.jsx)(I,{id:e,name:b(t?.name),avatar:t},e)}),D.length?null:(0,u.jsx)(i.Muted,{style:{padding:10},children:"No direct messages yet."})]}),'owner'===x?(0,u.jsx)(i.Muted,{children:"As owner you can view every channel and remove messages (tap a message). Direct messages are private to the two people in them."}):null,(0,u.jsx)(i.Sheet,{visible:M,onClose:()=>A(!1),title:"New direct message",children:v.filter(e=>e.active&&e.id!==h).map(e=>(0,u.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:`Message ${e.name}`,onPress:()=>{A(!1),B(j(h,e.id))},style:{paddingVertical:8},children:(0,u.jsxs)(i.Row,{children:[(0,u.jsx)(C,{s:e}),(0,u.jsxs)(o.default,{children:[(0,u.jsx)(i.T,{children:b(e.name)}),(0,u.jsxs)(i.Muted,{children:[l.ROLE_LABEL[e.role]," \xb7 ",e.job]})]})]})},e.id))}),(0,u.jsxs)(i.Sheet,{visible:L,onClose:()=>P(!1),title:"Chat settings",children:[(0,u.jsx)(i.Banner,{kind:"info",title:"Privacy",children:"Chat is for work. Managers and the owner can see messages in channels they belong to, and the owner can view and moderate all channels. Direct messages are only visible to the two people in them. Don't share customer card or health details beyond what's needed for service."}),(0,u.jsx)(i.T,{weight:"semibold",children:"Mute channels"}),f.filter(e=>y(e.id,z)).map(e=>(0,u.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsxs)(i.T,{children:[e.icon," ",e.name]}),(0,u.jsx)(i.Toggle,{label:`Mute ${e.name}`,value:k.includes(e.id),onChange:()=>l.useOwner.getState().chatMute(h,e.id)})]},e.id)),(0,u.jsx)(i.Muted,{children:"Muted channels don't count towards the tab badge."})]})]})};var t=r(_d[0]),s=e(r(_d[1])),n=e(r(_d[2])),o=e(r(_d[3])),i=r(_d[4]),l=r(_d[5]),a=r(_d[6]),d=r(_d[7]),c=r(_d[8]),h=r(_d[9]),u=r(_d[10]);const f=[{id:'all',name:'All staff',icon:'\ud83d\udce3'},{id:'kitchen',name:'Kitchen',icon:'\ud83c\udf73'},{id:'foh',name:'Front of house',icon:'\ud83c\udf7d\ufe0f'},{id:'managers',name:'Managers',icon:'\ud83d\udd12'}],m=[],b=e=>(e??'').replace(' (example)',''),x=e=>!!e&&'staff'!==e.role;function y(e,t){return!!t&&(e.startsWith('dm:')?e.split(':').slice(1).includes(t.id):'owner'===t.role||('all'===e||('managers'===e?x(t):'kitchen'===e?x(t)||/kitchen|chef/i.test(t.job):'foh'===e&&(x(t)||/front|bar|server/i.test(t.job)))))}const j=(e,t)=>`dm:${[e,t].sort().join(':')}`;function p(e){const t=l.useOwner.getState();if(t.chat.length)return;const s=['st-gordon','st-2','st-3','st-4','st-5'],n=(n,o,i,l,a={})=>{return{id:`m-seed-${n}-${i}`,ch:n,from:o,text:l,at:(d=i,new Date(e.getTime()-6e4*d).toISOString()),reactions:{},seenBy:s.filter(e=>y(n,t.staff.find(t=>t.id===e))),...a};var d};l.useOwner.setState({chat:[n('all','st-2',1500,'Burns Night menu briefing Fri 4pm in the dining room. Tasting for everyone on shift \ud83e\udd43',{pinned:!0,reactions:{'\ud83d\udc4d':['st-3','st-4','st-5']}}),n('all','system',1440,'Rota for next week published',{seenBy:['st-gordon','st-2','st-3','st-4']}),n('all','system',300,'Shift swap: Bar \u2194 Server approved (Saturday)',{seenBy:['st-gordon','st-2','st-4']}),n('all','st-gordon',240,'Big Friday tonight, 9 bookings and the forecast says busy from 18:00. Thanks all \ud83d\udcaa',{reactions:{'\ud83d\udd25':['st-2','st-4'],'\ud83d\udc4d':['st-3']},seenBy:['st-gordon','st-2','st-3','st-4']}),n('kitchen','st-3',200,'Langoustine delivery in, 4kg. Lobster special is on the board.',{photo:{caption:'Delivery arrived',tone:'#26403A'}}),n('kitchen','system',45,'86: Haddock sold out',{seenBy:['st-3']}),n('kitchen','system',20,'Allergy alert table 6: peanuts',{seenBy:['st-3']}),n('kitchen','st-2',18,'Table 6 confirmed with the guest: peanut allergy, no other allergens. I\u2019ve acknowledged it on the order.',{seenBy:['st-2','st-3']}),n('foh','st-4',90,'Can someone restock the tartare tubs at the pass please?',{seenBy:['st-2','st-4','st-5']}),n('foh','st-5',85,'On it \ud83d\udc4d',{seenBy:['st-4','st-5']}),n('foh','st-2',12,'Reid party of 6 running 15 min late, hold table 7.',{seenBy:['st-2']}),n('managers','st-gordon',600,'Labour is 22% for Saturday. Let\u2019s add a server 18:00\u201321:00.',{seenBy:['st-gordon','st-2']}),n('managers','st-2',590,'Agreed, I\u2019ll ask on All staff.',{seenBy:['st-gordon','st-2']}),n(j('st-gordon','st-2'),'st-2',30,'Gordon, can I leave at 22:30 tonight? Bar will close up.',{seenBy:['st-2']}),n(j('st-4','st-5'),'st-5',60,'Swap still OK for Saturday?',{seenBy:['st-4','st-5']})]})}function w(){const{meId:e}=(0,c.useCtx)(3e4),s=(0,l.useOwner)(e=>e.chat),n=(0,l.useOwner)(e=>e.staff),o=(0,l.useOwner)(t=>t.chatMuted[e]??m),i=n.find(t=>t.id===e);return(0,t.useMemo)(()=>{const t={};return s.forEach(s=>{s.removed||s.from===e||s.seenBy.includes(e)||!y(s.ch,i)||(t[s.ch]=(t[s.ch]??0)+1)}),{by:t,total:Object.entries(t).filter(([e])=>!o.includes(e)).reduce((e,[,t])=>e+t,0)}},[s,e,o,i])}const v={owner:d.colours.gold,manager:d.colours.blue,staff:'#7a6f5c'};function C({s:e,size:t=34}){return e?(0,u.jsx)(h.StaffAvatar,{id:e.id,size:t}):(0,u.jsx)(o.default,{style:{width:t,height:t,borderRadius:t/2,backgroundColor:'#333',alignItems:'center',justifyContent:'center'},children:(0,u.jsx)(i.T,{size:.38*t,weight:"bold",colour:"#111",children:"CC"})})}const S=[{caption:'Specials board',tone:'#4A3A22'},{caption:'Plating: Cullen skink',tone:'#3E2A2A'},{caption:'Delivery arrived',tone:'#26403A'},{caption:'Spillage by the bar',tone:'#2E2E40'}],k=['\ud83d\udc4d','\u2764\ufe0f','\ud83d\ude02','\u2705','\ud83d\udd25'];function R({ch:e,go:h,back:m}){const{now:x,meId:j,role:p}=(0,c.useCtx)(1e4),w=(0,l.useOwner)(e=>e.staff),R=(0,l.useOwner)(e=>e.chat),O=(0,l.useOwner)(e=>e.shifts),T=R.filter(t=>t.ch===e).sort((e,t)=>e.at.localeCompare(t.at)),[B,M]=(w.find(e=>e.id===j),(0,t.useState)('')),[A,L]=(0,t.useState)(null),[P,z]=(0,t.useState)(!1),[D,I]=(0,t.useState)(!1),$=e.startsWith('dm:')?e.split(':').slice(1).length:w.filter(t=>t.active&&y(e,t)).length;(0,t.useEffect)(()=>{l.useOwner.getState().chatSeen(e,j)},[e,j,T.length]);const E=t=>l.useOwner.getState().chatSend({ch:e,from:j,at:x.toISOString(),...t}),W=T.filter(e=>e.pinned&&!e.removed),N=e.startsWith('dm:')?b(w.find(t=>t.id===e.split(':').slice(1).find(e=>e!==j))?.name):f.find(t=>t.id===e)?.name,_=O.filter(e=>e.staffId===j);return(0,u.jsxs)(o.default,{style:{gap:8},children:[(0,u.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Back to chats",onPress:m,hitSlop:10,children:(0,u.jsx)(i.T,{colour:d.colours.gold,children:"\u2039 Chats"})}),(0,u.jsx)(i.T,{weight:"semibold",children:N}),(0,u.jsxs)(i.Muted,{children:[$," members"]})]}),W.map(e=>(0,u.jsxs)(i.Card,{highlight:d.colours.gold,children:[(0,u.jsxs)(i.T,{size:12,colour:d.colours.gold,children:["\ud83d\udccc Pinned by ",b(w.find(t=>t.id===e.from)?.name)]}),(0,u.jsx)(i.T,{size:14,children:e.text})]},e.id)),T.map((t,n)=>{const c=w.find(e=>e.id===t.from),f=t.from===j,m=t.seenBy.filter(e=>e!==t.from).length,x=0===n||t.at.slice(0,10)!==T[n-1].at.slice(0,10);return'system'===t.from?(0,u.jsxs)(o.default,{style:{alignItems:'center',gap:2},children:[x?(0,u.jsx)(i.Muted,{children:(0,a.niceDate)(new Date(t.at))}):null,(0,u.jsx)(o.default,{style:{backgroundColor:'#1c1a14',borderRadius:10,paddingHorizontal:10,paddingVertical:5,borderWidth:1,borderColor:d.colours.border},children:(0,u.jsxs)(i.T,{size:13,colour:/Allergy|86/.test(t.text??'')?d.colours.amber:d.colours.muted,children:["\u2699\ufe0e Cover Charge \xb7 ",t.text," \xb7 ",(0,a.hm)(new Date(t.at))]})})]},t.id):(0,u.jsxs)(o.default,{style:{gap:2},children:[x?(0,u.jsx)(i.Muted,{center:!0,children:(0,a.niceDate)(new Date(t.at))}):null,(0,u.jsxs)(i.Row,{style:{alignItems:'flex-start',flexDirection:f?'row-reverse':'row'},children:[(0,u.jsx)(C,{s:c}),(0,u.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Message from ${c?.name}`,onPress:()=>L(A===t.id?null:t.id),style:{maxWidth:'78%',backgroundColor:f?'#3a2f12':d.colours.surface,borderRadius:14,padding:9,borderWidth:1,borderColor:t.pinned?d.colours.gold:d.colours.border,gap:3},children:[(0,u.jsxs)(i.Row,{gap:6,children:[(0,u.jsx)(i.T,{size:12,weight:"semibold",colour:c?v[c.role]:d.colours.muted,children:b(c?.name)}),(0,u.jsxs)(i.T,{size:11,colour:d.colours.muted,children:[c?l.ROLE_LABEL[c.role]:''," \xb7 ",(0,a.hm)(new Date(t.at))]})]}),t.removed?(0,u.jsx)(i.T,{size:14,colour:d.colours.muted,children:"Message removed by the owner"}):(0,u.jsxs)(u.Fragment,{children:[t.photo?(0,u.jsx)(o.default,{style:{width:200,height:120,borderRadius:10,backgroundColor:t.photo.tone,justifyContent:'flex-end',padding:6},children:(0,u.jsxs)(i.T,{size:12,children:["\ud83d\udcf7 ",t.photo.caption," (example image)"]})}):null,t.text?(0,u.jsx)(i.T,{size:15,children:t.text}):null,'cover'===t.action?(0,u.jsx)(i.Button,{small:!0,kind:"secondary",label:"Open cover requests on the rota",onPress:()=>h('more','rota')}):null]}),Object.entries(t.reactions).filter(([,e])=>e.length).length?(0,u.jsx)(i.Row,{wrap:!0,gap:4,children:Object.entries(t.reactions).filter(([,e])=>e.length).map(([e,t])=>(0,u.jsx)(o.default,{style:{borderRadius:10,paddingHorizontal:6,backgroundColor:t.includes(j)?'#4a3c16':'#222'},children:(0,u.jsxs)(i.T,{size:12,children:[e," ",t.length]})},e))}):null,f?(0,u.jsx)(i.T,{size:11,colour:d.colours.muted,children:m?`Seen by ${m}`:'Sent'}):null]})]}),A!==t.id||t.removed?null:(0,u.jsxs)(i.Row,{wrap:!0,gap:6,style:{justifyContent:f?'flex-end':'flex-start',paddingLeft:f?0:40},children:[k.map(e=>(0,u.jsx)(s.default,{accessibilityLabel:`React ${e}`,onPress:()=>{l.useOwner.getState().chatReact(t.id,e,j),L(null)},style:{padding:4},children:(0,u.jsx)(i.T,{size:20,children:e})},e)),'staff'===p||e.startsWith('dm:')?null:(0,u.jsx)(i.Button,{small:!0,kind:"ghost",label:t.pinned?'Unpin':'Pin',onPress:()=>{l.useOwner.getState().chatPatch(t.id,{pinned:!t.pinned}),L(null)}}),'owner'!==p||f?null:(0,u.jsx)(i.Button,{small:!0,kind:"danger",label:"Remove",onPress:()=>{l.useOwner.getState().chatPatch(t.id,{removed:!0,pinned:!1}),L(null)}})]})]},t.id)}),(0,u.jsxs)(i.Row,{gap:6,children:[(0,u.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Send a photo",onPress:()=>z(!0),style:{padding:8},children:(0,u.jsx)(i.T,{size:20,children:"\ud83d\udcf7"})}),(0,u.jsx)(n.default,{accessibilityLabel:"Message",placeholder:`Message ${N}`,placeholderTextColor:"#7D776C",value:B,onChangeText:M,style:[i.styles.input,{flex:1}]}),(0,u.jsx)(i.Button,{small:!0,label:"Send",disabled:!B.trim(),onPress:()=>{E({text:B.trim()}),M('')}})]}),(0,u.jsx)(i.Row,{wrap:!0,gap:6,children:(0,u.jsx)(i.Button,{small:!0,kind:"secondary",label:"Ask for shift cover",onPress:()=>I(!0)})}),(0,u.jsx)(i.Muted,{center:!0,children:"Local demo: messages stay on this device. Nothing is sent."}),(0,u.jsx)(i.Sheet,{visible:P,onClose:()=>z(!1),title:"Send a photo (example images)",children:(0,u.jsx)(i.Row,{wrap:!0,gap:8,children:S.map(e=>(0,u.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:e.caption,onPress:()=>{E({photo:e}),z(!1)},style:{width:'47%',height:100,borderRadius:10,backgroundColor:e.tone,justifyContent:'flex-end',padding:6},children:(0,u.jsx)(i.T,{size:12,children:e.caption})},e.caption))})}),(0,u.jsxs)(i.Sheet,{visible:D,onClose:()=>I(!1),title:"Ask for shift cover",children:[_.length?null:(0,u.jsx)(i.Muted,{children:"You have no shifts on the rota this week."}),_.map(e=>(0,u.jsx)(i.Button,{kind:"secondary",label:`${c.DAY3[e.day]} ${(0,c.fmtH)(e.start)}\u2013${(0,c.fmtH)(e.end)}`,onPress:()=>{const t=`${c.DAY3[e.day]} ${(0,c.fmtH)(e.start)}\u2013${(0,c.fmtH)(e.end)}`;l.useOwner.getState().addSwap({shiftId:e.id,fromId:j,kind:'cover',note:`Cover asked in chat for ${t}`}),E({text:`Can anyone cover my ${t} shift? I\u2019ve added a cover request on the rota.`,action:'cover'}),I(!1)}},e.id)),(0,u.jsx)(i.Muted,{children:"Creates a cover request in Rota \u203a Swaps & leave for a manager to approve."})]})]})}},858,[12,245,255,109,790,802,795,797,859,863,6]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"StaffAppCtx",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useInStaffApp",{enumerable:!0,get:function(){return u}}),_e.useCtx=function(u=1e4){const i=(0,e.useContext)(o),d=(0,n.useOwner)(e=>e.site),f=(0,n.useOwner)(e=>e.previewRole),c=(0,n.useOwner)(e=>e.staffAs),m=i||'staff'===r.APP_VARIANT?'staff':f,w=(0,n.useOwner)(e=>e.staff),h=(0,t.useRestaurant)(d),D=(0,t.useNow)(u),l=i&&c?c:s[m],p=w.find(e=>e.id===l)?.name??'Gordon Munro';return{rid:d,r:h,now:D,role:m,me:p,meId:l,today:(0,a.ymd)(D)}},Object.defineProperty(_e,"weekday",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"fmtH",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"DAY3",{enumerable:!0,get:function(){return f}}),_e.ensureAttendance=function(e,t){const r=n.useOwner.getState(),s=[],o=(e,t,n)=>{const a=new Date(e);return a.setHours(0,0,0,0),a.setMinutes(Math.round(60*t)+n),a.toISOString()};for(let e=42;e>=1;e--){const n=new Date(t);n.setDate(n.getDate()-e);const u=(0,a.ymd)(n);r.attendance.some(e=>e.date===u)||r.shifts.filter(e=>e.day===i(n)).forEach((e,t)=>{const a=e=>Math.round((7*u.charCodeAt(9)+13*t+e)%17-5),r=e.end-e.start,i='st-5'===e.staffId&&r>6?0:r>8?30:r>6?20:0;s.push({id:`at-${u}-${e.staffId}`,staffId:e.staffId,date:u,in:o(n,e.start,a(1)),out:o(n,e.end,a(2)),inSite:!0,outSite:!0,breakMins:i})})}!r.attendance.some(t=>t.date===e)&&t.getHours()>=11&&(s.push({id:'at-seed-3',staffId:'st-3',date:e,in:o(t,10,41),inSite:!0}),s.push({id:'at-seed-2',staffId:'st-2',date:e,in:o(t,14,57),inSite:!0}),t.getHours()>=16&&s.push({id:'at-seed-4',staffId:'st-4',date:e,in:o(t,16,6),inSite:!0}));s.length&&n.useOwner.setState({attendance:[...n.useOwner.getState().attendance,...s]})},_e.paidMins=function(e,t){if(!e.in)return{worked:0,brk:0,paid:0};const n=Math.max(0,Math.round(((e.out?new Date(e.out):t).getTime()-new Date(e.in).getTime())/6e4)),a=e.breakMins??0;return{worked:n,brk:a,paid:Math.max(0,n-a)}},Object.defineProperty(_e,"hmDur",{enumerable:!0,get:function(){return c}}),_e.payRange=function(e,t,n){const r=new Date(n);if(r.setHours(0,0,0,0),'monthly'===e){const e=new Date(r.getFullYear(),r.getMonth()+t,1),n=new Date(e.getFullYear(),e.getMonth()+1,0);return{s:e,e:n,key:`m-${(0,a.ymd)(e)}`}}const s='weekly'===e?7:14,o=new Date(r);o.setDate(r.getDate()-i(r));let u=new Date(o);if('fortnightly'===e){const e=new Date(2026,0,5);(Math.round((o.getTime()-e.getTime())/6048e5)%2+2)%2==1&&u.setDate(u.getDate()-7)}u.setDate(u.getDate()+t*s);const d=new Date(u);return d.setDate(u.getDate()+s-1),{s:u,e:d,key:`${e[0]}-${(0,a.ymd)(u)}`}};var e=_r(_d[0]),t=_r(_d[1]),n=_r(_d[2]),a=_r(_d[3]),r=_r(_d[4]);const s={owner:'st-gordon',manager:'st-2',staff:'st-4'},o=(0,e.createContext)(!1),u=()=>(0,e.useContext)(o);const i=e=>(e.getDay()+6)%7,d=e=>`${String(Math.floor(e)).padStart(2,'0')}:${String(Math.round(e%1*60)).padStart(2,'0')}`,f=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'];const c=e=>`${Math.floor(e/60)}h ${String(e%60).padStart(2,'0')}m`},859,[12,796,802,795,787]); +__d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SHAPES",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"DEFAULT_SETTINGS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"PLAN_W",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"PLAN_H",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"GRID",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"fid",{enumerable:!0,get:function(){return p}}),_e.anchoragePlan=S,_e.starterPlan=j,Object.defineProperty(_e,"seedPlan",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"useFloor",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"usePlan",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"useDisplaySettings",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"planOf",{enumerable:!0,get:function(){return _}}),Object.defineProperty(_e,"tablesOf",{enumerable:!0,get:function(){return A}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),o=r(d[2]);const i=[{id:'round',label:'Round'},{id:'square',label:'Square'},{id:'rect',label:'Rectangle'},{id:'booth',label:'Booth'},{id:'stool',label:'Bar stool'}],l={privacy:!0,idleMins:2,pinOn:!1,pin:'2580',tonightCards:!0},u=1e3,c=625,b=25;let f=0;const p=e=>`${e}-${Date.now().toString(36)}${(f++).toString(36)}`,P=(e,t,n,s,o,i,l,u,c,b,f=!0,p=0)=>({id:`t-${e}`,name:e,areaId:t,shape:n,minSeats:s,maxSeats:o,x:i,y:l,w:u,h:c,rot:p,online:f,sectionId:b});function S(){return{areas:[{id:'restaurant',name:'Restaurant'},{id:'window',name:'Window'},{id:'bar',name:'Bar'},{id:'terrace',name:'Outside terrace'}],sections:[{id:'s-a',name:'Section A',colour:'#CFA45F',server:'SV'},{id:'s-b',name:'Section B',colour:'#8EC5FF',server:'DM'},{id:'s-c',name:'Bar',colour:'#C79BE8',server:'BR'}],tables:[P('1','restaurant','round',1,2,100,100,100,100,'s-a'),P('2','restaurant','round',1,2,275,100,100,100,'s-a'),P('3','restaurant','square',2,2,450,100,100,100,'s-a'),P('4','restaurant','square',2,4,100,325,125,125,'s-a'),P('5','restaurant','rect',2,4,300,325,175,125,'s-a'),P('6','restaurant','booth',4,6,650,300,225,150,'s-b'),P('7','window','rect',2,4,100,125,200,125,'s-b'),P('8','window','rect',2,4,400,125,200,125,'s-b'),P('9','window','round',2,4,700,125,150,150,'s-b'),P('10','bar','rect',4,6,100,350,250,125,'s-c'),P('11','bar','square',2,4,450,350,125,125,'s-c'),P('12','bar','square',2,4,575,350,125,125,'s-c'),P('B1','bar','stool',1,1,150,100,75,75,'s-c',!1),P('B2','bar','stool',1,1,275,100,75,75,'s-c',!1),P('B3','bar','stool',1,1,400,100,75,75,'s-c',!1),P('20','terrace','round',2,4,125,150,125,125,'s-b',!1),P('21','terrace','round',2,4,375,150,125,125,'s-b',!1),P('22','terrace','rect',4,6,625,150,225,125,'s-b',!1)],joins:[{id:'j-11-12',tables:['11','12']}]}}function j(){return{areas:[{id:'main',name:'Main room'}],sections:[{id:'s-a',name:'Section A',colour:'#CFA45F',server:'SV'}],tables:[1,2,3,4,5,6].map(e=>P(String(e),'main',e%3==0?'rect':'square',2,e%3==0?6:4,100+(e-1)%3*300,e<=3?100:350,e%3==0?200:125,125,'s-a')),joins:[]}}const O=e=>'anchorage'===e?S():j(),v=(0,s.create)()((0,o.persist)((e,t)=>{const n=e=>t().plans[e]??O(e);return{plans:{anchorage:S()},live:{},settings:{},smsLog:[],setPlan:(t,n)=>e(e=>({plans:{...e.plans,[t]:n}})),updateTable:(t,s,o)=>{const i=n(t);e(e=>({plans:{...e.plans,[t]:{...i,tables:i.tables.map(e=>e.id===s?{...e,...o}:e)}}}))},addTable:(t,s)=>{const o=n(t);e(e=>({plans:{...e.plans,[t]:{...o,tables:[...o.tables,s]}}}))},removeTable:(t,s)=>{const o=n(t),i=o.tables.find(e=>e.id===s);e(e=>({plans:{...e.plans,[t]:{...o,tables:o.tables.filter(e=>e.id!==s),joins:o.joins.filter(e=>!i||!e.tables.includes(i.name))}}}))},setLive:(t,n,s)=>e(e=>({live:{...e.live,[t]:{...e.live[t]??{},[n]:{...e.live[t]?.[n]??{},...s}}}})),setSettings:(t,n)=>e(e=>({settings:{...e.settings,[t]:{...l,...e.settings[t]??{},...n}}})),logSms:(t,n,s)=>e(e=>({smsLog:[{id:p('sms'),rid:t,at:n,text:s},...e.smsLog].slice(0,50)})),resetPlan:t=>e(e=>({plans:{...e.plans,[t]:O(t)}}))}},{name:'covercharge-floor-v1',version:1,storage:(0,o.createJSONStorage)(()=>n.default)})),y=e=>v(t=>t.plans[e])??B(e),w={};function B(e){return w[e]??=O(e)}const h=e=>{const t=v(t=>t.settings[e]);return t?{...l,...t}:l},_=e=>v.getState().plans[e]??B(e),A=e=>e?e.split('+').map(e=>e.trim()).filter(Boolean):[]},860,[942,948,951]); +__d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AllergyChain=y,_e.BookingAllergyChain=function({b:e,me:l,readOnly:j}){const k=(0,n.useOrders)(e.restaurantId),p=(0,o.useStore)(e=>e.ackBookingAllergy);if(!e.allergies.length)return null;const A=k.find(l=>l.allergies.length&&!['cancelled','closed'].includes(l.status)&&(l.bookingId===e.id||!l.bookingId&&(0,i.linkedBooking)(l,[e])?.id===e.id));if(A)return(0,f.jsx)(y,{o:A,me:l,readOnly:j,compact:!0});const w={booked:e.allergyAck,ordered:void 0,kitchen:void 0,pass:void 0,table:void 0};return(0,f.jsxs)(s.default,{testID:`allergy-chain-${e.ref}`,style:{gap:6,padding:8,borderRadius:10,borderWidth:1,borderColor:e.allergyAck?c.colours.border:c.colours.red,backgroundColor:'#140f0e'},children:[(0,f.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsxs)(t.T,{size:13,weight:"semibold",colour:"#FFD9D4",children:["Allergen sign-off \xb7 ",e.ref]}),(0,f.jsx)(t.Badge,{kind:e.allergyAck?'amber':'red',label:(e.allergyAck?1:0)+" of 5"})]}),(0,f.jsx)(x,{chain:w,next:e.allergyAck?null:'booked',testID:`allergy-steps-${e.ref}`}),e.allergyAck?(0,f.jsxs)(t.Row,{gap:6,children:[(0,f.jsx)(u.StaffAvatar,{name:e.allergyAck.by,size:20,ring:!1}),(0,f.jsxs)(t.Muted,{style:{flex:1},children:["1. Booked: ",b(e.allergyAck.by)," at ",h(e.allergyAck.at),". Steps 2 to 5 are signed on the table's order."]})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(t.T,{size:13,children:"Next: 1. Booked. Allergy recorded (who took it)."}),j?null:(0,f.jsxs)(t.Row,{wrap:!0,gap:8,children:[(0,f.jsx)(t.Button,{small:!0,kind:"danger",label:"Sign off",testID:`sign-off-${e.ref}`,accessibilityLabel:`Sign off Booked on ${e.ref}`,disabled:!l.trim(),onPress:()=>p(e.id,l)}),(0,f.jsxs)(t.Muted,{children:["as ",b(l)]})]})]})]})},r(d[0]);var e,l=r(d[1]),s=(e=l)&&e.__esModule?e:{default:e},t=r(d[2]),n=r(d[3]),o=r(d[4]),i=r(d[5]),c=r(d[6]),u=r(d[7]),f=r(d[8]);const h=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'}),b=e=>e.replace(' (example)','');function x({chain:e,next:l,testID:n}){return(0,f.jsx)(s.default,{testID:n,accessibilityLabel:`Allergen sign-off ${i.CHAIN_STEPS.filter(l=>e[l.id]).length} of 5`,style:{flexDirection:'row',alignItems:'flex-start'},children:i.CHAIN_STEPS.map((n,o)=>{const i=!!e[n.id],u=l===n.id,x=i?c.colours.green:u?c.colours.gold:c.colours.border;return(0,f.jsxs)(s.default,{style:{flex:1,alignItems:'center'},children:[(0,f.jsxs)(s.default,{style:{flexDirection:'row',alignItems:'center',width:'100%'},children:[(0,f.jsx)(s.default,{style:{flex:1,height:2,backgroundColor:o?i||u?x:c.colours.border:'transparent'}}),(0,f.jsx)(s.default,{style:{width:26,height:26,borderRadius:13,borderWidth:2,borderColor:x,backgroundColor:i?c.colours.green:'transparent',alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(t.T,{size:12,weight:"bold",colour:i?'#0B0B0B':u?c.colours.gold:c.colours.muted,children:i?'\u2713':String(n.n)})}),(0,f.jsx)(s.default,{style:{flex:1,height:2,backgroundColor:o<4?i?c.colours.green:c.colours.border:'transparent'}})]}),(0,f.jsx)(t.T,{size:11,weight:u?'semibold':'regular',colour:i?c.colours.text:u?c.colours.gold:c.colours.muted,center:!0,children:n.label}),e[n.id]?(0,f.jsxs)(t.T,{size:10,colour:c.colours.muted,center:!0,numberOfLines:2,children:[b(e[n.id].by).split(' ')[0]," ",h(e[n.id].at)]}):null]},n.id)})})}function y({o:e,me:l,readOnly:y,compact:j}){const k=(0,n.useBookings)(e.restaurantId),p=(0,o.useStore)(e=>e.signAllergyStep);if(!e.allergies.length)return null;const A=(0,i.linkedBooking)(e,k),w=(0,i.orderChain)(e,A),S=(0,i.nextStep)(e,A),I=i.CHAIN_STEPS.filter(e=>w[e.id]).length,C=S?(0,i.stepInfo)(S):null,B='table'===S&&!['ready','served','collected'].includes(e.status);return(0,f.jsxs)(s.default,{testID:`allergy-chain-${e.ref}`,style:{gap:6,padding:8,borderRadius:10,borderWidth:1,borderColor:S?c.colours.red:c.colours.green,backgroundColor:'#140f0e'},children:[(0,f.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsxs)(t.T,{size:13,weight:"semibold",colour:S?'#FFD9D4':'#CFF3D7',children:["Allergen sign-off \xb7 ",e.ref]}),(0,f.jsx)(t.Badge,{kind:S?'red':'green',label:S?`${I} of 5`:'Complete'})]}),(0,f.jsx)(x,{chain:w,next:S,testID:`allergy-steps-${e.ref}`}),j?null:i.CHAIN_STEPS.filter(e=>w[e.id]).map(e=>(0,f.jsxs)(t.Row,{gap:6,children:[(0,f.jsx)(u.StaffAvatar,{name:w[e.id].by,size:20,ring:!1}),(0,f.jsxs)(t.Muted,{style:{flex:1},children:[e.n,". ",e.label,": ",b(w[e.id].by)," at ",h(w[e.id].at)]})]},e.id)),C?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(t.T,{size:13,children:["Next: ",C.n,". ",C.label,". ",C.what,"."]}),y?null:(0,f.jsxs)(t.Row,{wrap:!0,gap:8,children:[(0,f.jsx)(t.Button,{small:!0,kind:"danger",label:"Sign off",testID:`sign-off-${e.ref}`,accessibilityLabel:`Sign off ${C.label} on ${e.ref}`,disabled:!l.trim()||B,onPress:()=>p(e.id,S,l)}),(0,f.jsxs)(t.Muted,{children:["as ",b(l)]})]}),B?(0,f.jsx)(t.Muted,{children:"Signed off at the pass. The table step is signed when the dish is served."}):(0,f.jsx)(t.Muted,{children:"The ticket can't move on until this step is signed off."})]}):(0,f.jsx)(t.Muted,{children:"All five steps signed off. The full chain is in the allergen audit log."})]})}},861,[12,109,790,884,844,862,797,863,6]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CHAIN_STEPS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"stepInfo",{enumerable:!0,get:function(){return t}}),e.linkedBooking=l,e.orderChain=o,e.nextStep=s,Object.defineProperty(e,"doneCount",{enumerable:!0,get:function(){return c}}),e.canSign=function(n,t,l){return s(n,l)===t},e.statusBlock=function(n,l,s){if(!n.allergies.length||'cancelled'===l)return null;const c=o(n,s),u=n=>c[n]?null:`${t(n).n}. ${t(n).label} needs signing off first`;return'acknowledged'===l||'preparing'===l||'ready'===l?u('booked')??u('ordered')??u('kitchen'):'served'===l?u('booked')??u('ordered')??u('kitchen')??u('pass'):'collected'===l||'closed'===l?u('booked')??u('ordered')??u('kitchen')??u('pass')??u('table'):null},e.chainNeedsAction=function(n,t){const o=s(n,l(n,t));return!(!o||'table'===o&&!['ready','served'].includes(n.status))},e.bookingNeedsAction=function(n,t){return n.allergies.length>0&&!n.allergyAck&&!t.some(t=>t.allergies.length&&l(t,[n])?.id===n.id)};const n=[{id:'booked',n:1,label:'Booked',what:'Allergy recorded (who took it)'},{id:'ordered',n:2,label:'Ordered',what:'Server confirms with the guest'},{id:'kitchen',n:3,label:'Kitchen',what:'Chef signs off before cooking'},{id:'pass',n:4,label:'Pass',what:'Checked before it leaves the pass'},{id:'table',n:5,label:'Table',what:'Server signs off when served'}],t=t=>n.find(n=>n.id===t);function l(n,t){return n.bookingId?t.find(t=>t.id===n.bookingId):'table'===n.type&&n.tableNo?t.find(t=>t.restaurantId===n.restaurantId&&'seated'===t.status&&!!t.table&&t.table.split('+').includes(String(n.tableNo))):void 0}function o(n,t){return{booked:n.allergyChain?.booked??(t?.allergies.length?t.allergyAck:void 0),ordered:n.allergyChain?.ordered,kitchen:n.allergyAck,pass:n.allergyChain?.pass,table:n.handoverCheck}}function s(t,l){if(!t.allergies.length)return null;const s=o(t,l);return n.find(n=>!s[n.id])?.id??null}const c=(t,l)=>{const s=o(t,l);return n.filter(n=>s[n.id]).length}},862,[]); +__d(function(g,_r,_i,a,m,_e,d){"use strict";function i(i){return i&&i.__esModule?i:{default:i}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEFAULT_AVATARS",{enumerable:!0,get:function(){return f}}),_e.specFor=u,_e.AvatarArt=p,_e.useStaffMember=E,_e.StaffAvatar=function({id:i,name:e,size:t=34,ring:s=!0}){const f=E(i,e),o=f?.id??i,h=(0,n.useAvatars)(i=>o?i.photos[o]:void 0),F=`${(f?.name??e??'Team member').replace(' (example)','')}'s avatar`;return(0,x.jsx)(r.default,{testID:o?`avatar-${o}`:'avatar',accessibilityLabel:F,accessibilityRole:"image",style:{width:t,height:t,borderRadius:t/2,overflow:'hidden',borderWidth:s?Math.max(1,t/22):0,borderColor:c.colours.gold,backgroundColor:'#111'},children:h?(0,x.jsx)(l.default,{source:{uri:h.dataUrl},style:{width:'100%',height:'100%'},accessibilityIgnoresInvertColors:!0}):(0,x.jsx)(p,{spec:u(o,f?.name??e),size:t-(s?2*Math.max(1,t/22):0)})})},_r(d[0]);var l=i(_r(d[1])),r=i(_r(d[2])),e=_r(d[3]),t=i(e),s=_r(d[4]),n=_r(d[5]),c=_r(d[6]),x=_r(d[7]);const f={'st-gordon':{bg:'#1F6F78',ring:'#E9B949',skin:'#F1C7A5',hair:'#7A4E2A',hairStyle:'quiff',suit:'#F2EAD8',antenna:'ball'},'st-2':{bg:'#C8553D',ring:'#3FB8AF',skin:'#E8B48F',hair:'#2B1B12',hairStyle:'flip',suit:'#F2EAD8',antenna:'star'},'st-3':{bg:'#D9A441',ring:'#C8553D',skin:'#B97A52',hair:'#1A1A1A',hairStyle:'crop',suit:'#FFFFFF',antenna:'ball',specs:!0},'st-4':{bg:'#3D5A80',ring:'#E9B949',skin:'#F4D2B8',hair:'#C2462E',hairStyle:'beehive',suit:'#F2EAD8',antenna:'none'},'st-5':{bg:'#6A4C93',ring:'#3FB8AF',skin:'#8D5B3E',hair:'#151515',hairStyle:'curls',suit:'#F2EAD8',antenna:'star'}},o=['#1F6F78','#C8553D','#D9A441','#3D5A80','#6A4C93','#2E7D5B'],h=['#F1C7A5','#E8B48F','#C68B5E','#8D5B3E','#F4D2B8','#A86B45'],F=['#2B1B12','#7A4E2A','#151515','#C2462E','#D9B26A'],y=['quiff','flip','crop','beehive','bob','curls'],C=i=>{let l=7;for(const r of i)l=31*l+r.charCodeAt(0)>>>0;return l};function u(i,l){if(i&&f[i])return f[i];const r=C(i||l||'crew');return{bg:o[r%6],ring:r%2?'#E9B949':'#3FB8AF',skin:h[(r>>3)%6],hair:F[(r>>6)%5],hairStyle:y[(r>>9)%6],suit:'#F2EAD8',antenna:['ball','star','none'][(r>>12)%3]}}const j=(i,l,r)=>`M${i} ${l-r} Q${i+.18*r} ${l-.18*r} ${i+r} ${l} Q${i+.18*r} ${l+.18*r} ${i} ${l+r} Q${i-.18*r} ${l+.18*r} ${i-r} ${l} Q${i-.18*r} ${l-.18*r} ${i} ${l-r}Z`;function p({spec:i,size:l=40}){const r=i,s='#1B1B1B',n='flip'===r.hairStyle?(0,x.jsx)(e.Path,{d:"M29 50 C26 30 40 22 50 22 C60 22 74 30 71 50 C75 56 79 60 76 65 C72 60 69 58 66 57 L34 57 C31 58 28 60 24 65 C21 60 25 56 29 50Z",fill:r.hair}):'bob'===r.hairStyle?(0,x.jsx)(e.Path,{d:"M30 58 C27 32 40 24 50 24 C60 24 73 32 70 58 L66 60 L34 60Z",fill:r.hair}):'beehive'===r.hairStyle?(0,x.jsxs)(e.G,{children:[(0,x.jsx)(e.Ellipse,{cx:50,cy:25,rx:15,ry:14,fill:r.hair}),(0,x.jsx)(e.Path,{d:"M31 54 C28 34 40 27 50 27 C60 27 72 34 69 54 Z",fill:r.hair})]}):'curls'===r.hairStyle?(0,x.jsx)(e.G,{children:[[34,34],[40,27],[50,24],[60,27],[66,34],[69,43],[31,43]].map(([i,l],t)=>(0,x.jsx)(e.Circle,{cx:i,cy:l,r:7,fill:r.hair},t))}):null,c='quiff'===r.hairStyle?(0,x.jsxs)(e.G,{children:[(0,x.jsx)(e.Path,{d:"M32 42 C31 27 43 23 51 25 C61 22 70 30 68 42 C63 35 57 33 50 34 C43 34 37 37 32 42Z",fill:r.hair}),(0,x.jsx)(e.Path,{d:"M46 26 C51 14 66 14 66 23 C61 20 54 21 50 28Z",fill:r.hair})]}):'crop'===r.hairStyle?(0,x.jsx)(e.Path,{d:"M32 42 C31 28 42 25 50 25 C58 25 69 28 68 42 C64 36 58 33 50 33 C42 33 36 36 32 42Z",fill:r.hair}):'curls'===r.hairStyle?null:(0,x.jsx)(e.Path,{d:"M32 43 C33 30 42 27 50 27 C58 27 67 30 68 43 C61 38 57 33 51 33 C47 37 39 41 32 43Z",fill:r.hair});return(0,x.jsxs)(t.default,{width:l,height:l,viewBox:"0 0 100 100",children:[(0,x.jsx)(e.Circle,{cx:50,cy:50,r:50,fill:r.bg}),(0,x.jsx)(e.Ellipse,{cx:50,cy:50,rx:46,ry:13,fill:"none",stroke:"#FFF4E0",strokeOpacity:.28,strokeWidth:1.6,transform:"rotate(-28 50 50)"}),(0,x.jsx)(e.Path,{d:j(16,24,6),fill:"#FFF4E0",fillOpacity:.85}),(0,x.jsx)(e.Path,{d:j(84,34,4),fill:"#FFF4E0",fillOpacity:.7}),(0,x.jsx)(e.Circle,{cx:80,cy:16,r:1.6,fill:"#FFF4E0",fillOpacity:.8}),(0,x.jsx)(e.Circle,{cx:22,cy:70,r:1.3,fill:"#FFF4E0",fillOpacity:.6}),(0,x.jsx)(e.Path,{d:"M12 100 C14 82 31 74 50 74 C69 74 86 82 88 100 Z",fill:r.suit}),(0,x.jsx)(e.Path,{d:"M36 100 L40 84 L50 90 L60 84 L64 100Z",fill:r.ring,fillOpacity:.35}),(0,x.jsx)(e.Rect,{x:44,y:60,width:12,height:12,fill:r.skin}),n,(0,x.jsx)(e.Ellipse,{cx:50,cy:46,rx:17,ry:18.5,fill:r.skin}),c,r.specs?(0,x.jsxs)(e.G,{stroke:s,strokeWidth:1.6,fill:"#FFFFFF",fillOpacity:.25,children:[(0,x.jsx)(e.Rect,{x:37,y:42,width:11,height:8,rx:4}),(0,x.jsx)(e.Rect,{x:52,y:42,width:11,height:8,rx:4}),(0,x.jsx)(e.Line,{x1:48,y1:45,x2:52,y2:45})]}):null,(0,x.jsx)(e.Ellipse,{cx:42.5,cy:46.5,rx:2.1,ry:2.7,fill:s}),(0,x.jsx)(e.Ellipse,{cx:57.5,cy:46.5,rx:2.1,ry:2.7,fill:s}),(0,x.jsx)(e.Circle,{cx:43.3,cy:45.5,r:.8,fill:"#FFFFFF"}),(0,x.jsx)(e.Circle,{cx:58.3,cy:45.5,r:.8,fill:"#FFFFFF"}),(0,x.jsx)(e.Circle,{cx:38,cy:53,r:3,fill:"#F08A7E",fillOpacity:.55}),(0,x.jsx)(e.Circle,{cx:62,cy:53,r:3,fill:"#F08A7E",fillOpacity:.55}),(0,x.jsx)(e.Path,{d:"M44.5 55 Q50 60 55.5 55",stroke:s,strokeWidth:1.8,fill:"none",strokeLinecap:"round"}),(0,x.jsx)(e.Ellipse,{cx:50,cy:74,rx:21,ry:5.5,fill:r.ring}),(0,x.jsx)(e.Ellipse,{cx:50,cy:73,rx:16,ry:3,fill:"#000000",fillOpacity:.18}),(0,x.jsx)(e.Circle,{cx:50,cy:88,r:4,fill:r.ring}),(0,x.jsx)(e.Circle,{cx:50,cy:88,r:1.6,fill:r.bg}),(0,x.jsx)(e.Circle,{cx:50,cy:45,r:29,fill:"#DFF3F7",fillOpacity:.1,stroke:"#E8F6FA",strokeOpacity:.85,strokeWidth:2}),(0,x.jsx)(e.Path,{d:"M29 36 A23 23 0 0 1 41 22",stroke:"#FFFFFF",strokeOpacity:.85,strokeWidth:3.2,fill:"none",strokeLinecap:"round"}),(0,x.jsx)(e.Circle,{cx:28.5,cy:42,r:1.5,fill:"#FFFFFF",fillOpacity:.85}),'none'!==r.antenna?(0,x.jsx)(e.Line,{x1:50,y1:16,x2:50,y2:8,stroke:r.ring,strokeWidth:2}):null,'ball'===r.antenna?(0,x.jsx)(e.Circle,{cx:50,cy:6.5,r:3.3,fill:r.ring}):'star'===r.antenna?(0,x.jsx)(e.Path,{d:j(50,6.5,4.5),fill:r.ring}):null]})}const A=i=>(i??'').replace(' (example)','').trim().toLowerCase();function E(i,l){const r=(0,s.useOwner)(i=>i.staff);return i?r.find(l=>l.id===i):l?r.find(i=>A(i.name)===A(l)):void 0}},863,[12,178,109,841,802,885,797,6]); +__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.AccidentBook=function({me:e,meId:s,now:n,app:d,seeAll:h}){const p=(0,l.useSafety)(e=>e.accidents),[y,f]=(0,t.useState)(h?'list':'add'),b=p.filter(e=>e.reportedById===s),w=p.length-b.length;return(0,u.jsxs)(a.default,{style:{gap:12},testID:"accident-book",children:[(0,u.jsx)(c.Tabs,{value:y,onChange:f,options:[{id:'add',label:'Report an accident or near miss'},{id:'list',label:h?`All entries (${p.length})`:`My entries (${b.length})`}]}),'add'===y?(0,u.jsx)(x,{me:e,meId:s,now:n,app:d,onSaved:()=>f('list')}):null,'list'===y?(0,u.jsxs)(c.Box,{testID:"accident-list",children:[(h?p:b).length?(h?p:b).map(e=>(0,u.jsx)(j,{a:e,manager:h},e.id)):(0,u.jsx)(o.Muted,{children:"No entries yet."}),!h&&w>0?(0,u.jsx)(a.default,{testID:"accident-others",children:(0,u.jsxs)(o.Muted,{children:[w," other entr",1===w?'y is':'ies are'," in the book. Only managers can see other people\u2019s entries and personal details."]})}):null]}):null,(0,u.jsx)(o.Muted,{children:"In an emergency call 999 first. The accident book is kept on this device in the prototype; nothing is sent or reported to anyone."})]})};var t=r(_d[0]),s=e(r(_d[1])),n=e(r(_d[2])),a=e(r(_d[3])),o=r(_d[4]),l=r(_d[5]),d=r(_d[6]),c=r(_d[7]),u=r(_d[8]);const h=e=>String(e).padStart(2,'0'),p=e=>`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())}T${h(e.getHours())}:${h(e.getMinutes())}`,y=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?e:`${t.toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short',year:'numeric'})} ${h(t.getHours())}:${h(t.getMinutes())}`};function x({me:e,meId:s,now:h,app:y,onSaved:x}){const[j,f]=(0,t.useState)({date:p(h).slice(0,10),time:p(h).slice(11),location:'',person:'',personType:'Staff',category:'',what:'',injury:'',firstAid:'',witnesses:'',reportedBy:e.replace(' (example)','')}),[b,w]=(0,t.useState)(''),[T,D]=(0,t.useState)(''),S=e=>f({...j,...e}),C='Near miss'===j.category,v=(e,t,s,l=!1)=>(0,u.jsxs)(a.default,{style:{gap:4},children:[(0,u.jsx)(o.T,{size:14,weight:"medium",colour:d.colours.muted,children:e}),(0,u.jsx)(n.default,{accessibilityLabel:e,value:String(j[t]),onChangeText:e=>S({[t]:e}),placeholder:s,placeholderTextColor:"#7D776C",multiline:l,style:[o.styles.input,l&&{minHeight:70,textAlignVertical:'top'}]})]});return(0,u.jsxs)(c.Box,{testID:"accident-form",children:[(0,u.jsx)(o.T,{size:18,weight:"semibold",children:"Report an accident or near miss"}),(0,u.jsxs)(o.Row,{gap:8,children:[(0,u.jsxs)(a.default,{style:{flex:1,gap:4},children:[(0,u.jsx)(o.T,{size:14,weight:"medium",colour:d.colours.muted,children:"Date"}),(0,u.jsx)(n.default,{accessibilityLabel:"Date",value:j.date,onChangeText:e=>S({date:e}),placeholder:"YYYY-MM-DD",placeholderTextColor:"#7D776C",style:[o.styles.input,{minWidth:0,width:40}]})]}),(0,u.jsxs)(a.default,{style:{width:110,gap:4},children:[(0,u.jsx)(o.T,{size:14,weight:"medium",colour:d.colours.muted,children:"Time"}),(0,u.jsx)(n.default,{accessibilityLabel:"Time",value:j.time,onChangeText:e=>S({time:e}),placeholder:"HH:MM",placeholderTextColor:"#7D776C",style:o.styles.input})]})]}),(0,u.jsx)(o.T,{size:14,weight:"medium",colour:d.colours.muted,children:"What kind?"}),(0,u.jsx)(o.Row,{wrap:!0,gap:6,children:l.ACCIDENT_CATEGORIES.map(e=>(0,u.jsx)(o.Chip,{label:e,selected:j.category===e,onPress:()=>S({category:e})},e))}),v('Where it happened','location','e.g. kitchen pass, cellar steps, terrace'),v('Person involved','person','Name'),(0,u.jsx)(o.Row,{wrap:!0,gap:6,children:['Staff','Customer','Contractor','Visitor'].map(e=>(0,u.jsx)(o.Chip,{label:e,selected:j.personType===e,onPress:()=>S({personType:e})},e))}),v('What happened','what','Describe what happened, in order',!0),v('Injury','injury',C?'None (near miss)':'e.g. small cut to left thumb'),v('First aid given','firstAid','e.g. cleaned and plaster applied by \u2026'),v('Witnesses','witnesses','Names, or none'),v('Reported by','reportedBy','Your name'),b?(0,u.jsx)(o.Banner,{kind:"warn",children:b}):null,(0,u.jsx)(o.Button,{label:"Save to the accident book",testID:"accident-save",onPress:()=>/^\d{4}-\d{2}-\d{2}$/.test(j.date)&&/^([01]\d|2[0-3]):[0-5]\d$/.test(j.time)?j.category?j.location.trim()&&j.person.trim()&&j.what.trim()?(l.useSafety.getState().addAccident({when:`${j.date}T${j.time}`,location:j.location.trim(),person:j.person.trim(),personType:j.personType,category:j.category,what:j.what.trim(),injury:j.injury.trim()||(C?'None (near miss)':'Not recorded'),firstAid:j.firstAid.trim()||'None recorded',witnesses:j.witnesses.trim()||'None',reportedBy:j.reportedBy.trim()||e,reportedById:s,app:y}),D(`Saved to the accident book: ${j.category}, ${j.location.trim()}.`),w(''),f({...j,location:'',person:'',category:'',what:'',injury:'',firstAid:'',witnesses:''}),void x()):w('Fill in where it happened, who was involved and what happened.'):w('Pick what kind of accident or near miss it was.'):w('Enter the date as YYYY-MM-DD and the time as HH:MM.')}),T?(0,u.jsx)(a.default,{testID:"accident-saved",children:(0,u.jsx)(o.T,{size:14,colour:d.colours.green,children:T})}):null,(0,u.jsx)(o.Muted,{children:"Personal details are only visible to managers. You can see your own entries."})]})}function j({a:e,manager:c}){const h=l.RIDDOR_CATEGORIES.includes(e.category),[p,x]=(0,t.useState)(e.riddorNote??''),[j,f]=(0,t.useState)(!1);return(0,u.jsxs)(a.default,{testID:"accident-entry",style:{paddingVertical:10,borderTopWidth:1,borderColor:d.colours.border,gap:4},children:[(0,u.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`${e.category} at ${e.location}`,onPress:()=>f(!j),children:[(0,u.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsxs)(o.T,{weight:"semibold",style:{flex:1},children:[e.category," \xb7 ",e.location]}),(0,u.jsx)(o.Badge,{kind:'Near miss'===e.category?'blue':h?'red':'amber',label:'Near miss'===e.category?'Near miss':h?'Serious':'Accident'})]}),(0,u.jsxs)(o.Muted,{children:[y(e.when)," \xb7 ",e.person," (",e.personType,") \xb7 reported by ",e.reportedBy]})]}),j||c?(0,u.jsxs)(a.default,{style:{gap:2},children:[(0,u.jsxs)(o.T,{size:14,children:["What happened: ",e.what]}),(0,u.jsxs)(o.T,{size:14,children:["Injury: ",e.injury]}),(0,u.jsxs)(o.T,{size:14,children:["First aid: ",e.firstAid]}),(0,u.jsxs)(o.T,{size:14,children:["Witnesses: ",e.witnesses]})]}):null,c&&h?(0,u.jsxs)(a.default,{testID:"riddor-prompt",style:{gap:6},children:[(0,u.jsx)(o.Banner,{kind:"danger",title:"Consider RIDDOR",children:"This may need reporting to the HSE under RIDDOR (for example a specified injury, over-7-day incapacitation, or a member of the public taken to hospital). Check the HSE\u2019s RIDDOR guidance and decide. Cover Charge never reports anything for you."}),(0,u.jsx)(n.default,{accessibilityLabel:"RIDDOR decision note",value:p,onChangeText:x,placeholder:"Your decision, e.g. reported on \u2026 ref \u2026, or not reportable because \u2026",placeholderTextColor:"#7D776C",style:o.styles.input}),(0,u.jsx)(o.Button,{small:!0,label:"Save note",disabled:p===(e.riddorNote??''),onPress:()=>l.useSafety.getState().setRiddorNote(e.id,p)}),e.riddorNote?(0,u.jsxs)(o.Muted,{children:["Saved note: ",e.riddorNote]}):null]}):null]})}},881,[12,245,255,109,790,991,797,886,6]); +__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.MissedBanner=f,_e.HaccpLog=function({me:e,meId:n,now:s,mode:o}){const[r,d]=(0,t.useState)('today'),c=(e,t)=>({id:e,label:t}),u='chef'===o?[c('today','Today'),c('units','Fridges & units'),c('record','Quick entry'),c('diary','Diary'),c('weekly','Weekly sign-off'),c('report','EHO report'),c('history','History'),c('limits','Safe limits'),c('probes','Wireless probes')]:'managers'===o?[c('today','Today'),c('units','Fridges & units'),c('diary','Diary'),c('weekly','Weekly sign-off'),c('report','EHO report'),c('history','History'),c('limits','Safe limits'),c('probes','Wireless probes')]:[c('today','Today'),c('record','Quick entry'),c('diary','Diary'),c('history','My entries')],x={me:e,meId:n,now:s,mode:o};return(0,m.jsxs)(i.default,{style:{gap:12},testID:"haccp-log",children:['today'!==r?(0,m.jsx)(f,{now:s,onPress:()=>d('today')}):null,(0,m.jsx)(h.Tabs,{value:r,onChange:d,options:u}),'today'===r?(0,m.jsx)(p.TodayView,{who:x}):null,'units'===r?(0,m.jsx)(p.UnitsView,{who:x}):null,'record'===r?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(w,{who:x}),(0,m.jsx)(v,{who:x})]}):null,'diary'===r?(0,m.jsx)(p.DiaryView,{who:x}):null,'weekly'===r?(0,m.jsx)(p.WeeklyView,{who:x}):null,'report'===r?(0,m.jsx)(p.ReportView,{who:x}):null,'history'===r?(0,m.jsx)(k,{who:x}):null,'limits'===r?(0,m.jsx)(S,{editable:'chef'===o}):null,'probes'===r?(0,m.jsx)(I,{me:e,now:s}):null,(0,m.jsx)(l.Muted,{children:"Every reading here was entered by a person; the app never fills in or estimates a value. Sections follow Safer Food, Better Business (cross-contamination, cleaning, chilling, cooking, management). Your own HACCP plan (e.g. CookSafe) sets the limits that count. Demo: stored on this device only."})]})};var t=_r(_d[0]),n=e(_r(_d[1])),s=e(_r(_d[2])),o=e(_r(_d[3])),i=e(_r(_d[4])),l=_r(_d[5]),r=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),m=_r(_d[12]);const x=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'}),b=e=>new Date(e).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'}),y=e=>{const t=e.trim().replace(',','.').replace(/^\u2212/,'-');return t&&/^-?\d+(\.\d+)?$/.test(t)?Number(t):null};function f({now:e,onPress:t}){const n=(0,r.useSafety)(e=>e.points),o=(0,r.useSafety)(e=>e.entries),c=(0,d.missedChecks)(n,o,e);if(!c.length)return(0,m.jsx)(i.default,{testID:"haccp-uptodate",children:(0,m.jsx)(l.Banner,{kind:"success",title:"Food safety checks up to date",children:"No checks overdue right now."})});const u=(0,m.jsx)(i.default,{testID:"haccp-missed",children:(0,m.jsx)(l.Banner,{kind:"warn",title:`${c.length} food safety check${1===c.length?'':'s'} overdue`,children:c.map(e=>`${e.point.name} (due ${e.due})`).join(' \xb7 ')})});return t?(0,m.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Open the food safety log",onPress:t,children:u}):u}function j(e,t){r.useSafety.getState().addEntries(t.map(t=>{const n=(0,d.isTempKind)(t.point.kind)?(0,d.inRange)(t.point,t.value):!!t.done;return{pointId:t.point.id,name:t.point.name,kind:t.point.kind,at:e.now.toISOString(),by:e.me.replace(' (example)',''),byId:e.meId,app:e.mode,value:t.value,done:t.done,ok:n,corrective:t.corrective?.trim()||void 0,note:t.note?.trim()||void 0,source:t.source,initials:(0,d.initialsOf)(e.me)}}))}function w({who:e}){const n=(0,r.useSafety)(e=>e.points),[u,p]=(0,t.useState)(''),[x,b]=(0,t.useState)(null),[f,w]=(0,t.useState)(''),[v,k]=(0,t.useState)(!1),[C,S]=(0,t.useState)(!1),T=(0,t.useRef)(null),D=(e,t)=>{const s=(0,d.parseQuick)(e,n);S(t),w(''),b(s.map((e,t)=>({key:`${t}-${e.text}`,text:e.text,pointId:e.point?.id,value:null==e.value?'':String(e.value),done:!(!e.point||(0,d.isTempKind)(e.point.kind)||!/\b(done|yes|complete|completed|ok|signed)\b/i.test(e.text))||void 0,corrective:'',problem:e.problem})))},I=(e,t)=>b(n=>n&&n.map(n=>n.key===e?{...n,...t}:n)),P=(x??[]).map(e=>{const t=n.find(t=>t.id===e.pointId),s=y(e.value),o=!!t&&(0,d.isTempKind)(t.kind),i=!!t&&(o?null!=s:void 0!==e.done),l=t?o?null!=s?(0,d.inRange)(t,s):null:void 0===e.done?null:e.done:null;return{d:e,point:t,v:s,temp:o,ready:i,ok:l,needsAction:!1===l&&!e.corrective.trim()}}),R=P.length>0&&P.every(e=>e.ready&&!e.needsAction);return(0,m.jsxs)(h.Box,{testID:"haccp-quick",children:[(0,m.jsx)(l.T,{weight:"semibold",size:17,children:"Quick entry: say or type readings"}),(0,m.jsx)(l.Muted,{children:"For example \u201cwalk-in fridge 3, freezer minus 19\u201d. You check every value before anything is saved."}),(0,m.jsxs)(l.Row,{gap:8,children:[(0,m.jsx)(o.default,{accessibilityLabel:"Readings",value:u,onChangeText:p,placeholder:"walk-in fridge 3, freezer minus 19",placeholderTextColor:"#7D776C",onSubmitEditing:()=>D(u,!1),style:[l.styles.input,{flex:1,minWidth:0,width:40}]}),(0,m.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Speak readings",testID:"haccp-mic",onPress:()=>{const e=(0,h.speechRecognition)();if(!e)return void w("Voice input isn't available in this browser (for example Huawei Browser). Please type the readings instead.");if(v)return void T.current?.stop();const t=new e;T.current=t,t.lang='en-GB',t.interimResults=!1,t.maxAlternatives=1,t.onresult=e=>{const t=e.results?.[0]?.[0]?.transcript??'';p(t),t&&D(t,!0)},t.onerror=()=>w("Didn't catch that. Try again or type the readings."),t.onend=()=>k(!1);try{t.start(),k(!0)}catch{w("Voice input couldn't start. Please type the readings.")}},style:{width:48,height:48,borderRadius:24,borderWidth:1.5,borderColor:c.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:v?c.colours.gold:'transparent'},children:(0,m.jsx)(l.T,{size:20,children:v?'\u25a0':'\ud83c\udfa4'})})]}),(0,m.jsx)(l.Button,{label:"Check readings",disabled:!u.trim(),onPress:()=>D(u,!1)}),f?(0,m.jsx)(i.default,{testID:"haccp-quick-msg",children:(0,m.jsx)(l.Banner,{kind:"info",children:f})}):null,x?(0,m.jsxs)(i.default,{style:{gap:10},testID:"haccp-confirm",children:[(0,m.jsxs)(l.T,{weight:"semibold",children:["Check these ",x.length," reading",1===x.length?'':'s']}),P.map(({d:e,point:t,temp:r,ok:u,needsAction:h})=>(0,m.jsxs)(i.default,{testID:"haccp-draft",style:{gap:6,padding:10,borderRadius:12,borderWidth:1,borderColor:!1===u?c.colours.red:c.colours.border,backgroundColor:c.colours.surface2},children:[(0,m.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(l.Muted,{style:{flex:1},children:["Heard: \u201c",e.text,"\u201d"]}),(0,m.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:`Remove ${t?.name??e.text}`,onPress:()=>b(t=>t.filter(t=>t.key!==e.key)),children:(0,m.jsx)(l.T,{colour:c.colours.muted,children:"\u2715"})})]}),t?(0,m.jsxs)(l.T,{weight:"semibold",children:[t.name," ",(0,m.jsxs)(l.Muted,{children:["\xb7 safe: ",(0,d.limitText)(t)]})]}):(0,m.jsxs)(i.default,{style:{gap:6},children:[(0,m.jsx)(l.T,{colour:c.colours.amber,children:e.problem}),(0,m.jsx)(l.Row,{wrap:!0,gap:6,children:n.map(t=>(0,m.jsx)(l.Chip,{label:t.name,onPress:()=>I(e.key,{pointId:t.id,problem:void 0})},t.id))})]}),t&&r?(0,m.jsxs)(l.Row,{gap:8,children:[(0,m.jsx)(o.default,{accessibilityLabel:`Reading for ${t.name}`,value:e.value,onChangeText:t=>I(e.key,{value:t}),placeholder:"\xb0C",placeholderTextColor:"#7D776C",keyboardType:"numbers-and-punctuation",style:[l.styles.input,{width:96,fontSize:20}]}),(0,m.jsx)(l.T,{size:18,children:"\xb0C"}),null===u?(0,m.jsx)(l.Badge,{kind:"amber",label:"Type the reading"}):(0,m.jsx)(l.Badge,{kind:u?'green':'red',label:u?'OK':'OUT OF RANGE'})]}):null,t&&!r?(0,m.jsxs)(l.Row,{gap:6,children:[(0,m.jsx)(l.Chip,{label:"Done",selected:!0===e.done,onPress:()=>I(e.key,{done:!0})}),(0,m.jsx)(l.Chip,{label:"Not done",selected:!1===e.done,onPress:()=>I(e.key,{done:!1})})]}):null,!1===u?(0,m.jsx)(o.default,{accessibilityLabel:`Corrective action for ${t.name}`,value:e.corrective,onChangeText:t=>I(e.key,{corrective:t}),placeholder:"What did you do? e.g. moved stock, called engineer, re-checked",placeholderTextColor:"#7D776C",style:[l.styles.input,h&&{borderColor:c.colours.red}]}):null,h?(0,m.jsx)(l.T,{size:13,colour:c.colours.red,children:"A corrective action note is needed before saving."}):null]},e.key)),(0,m.jsxs)(l.Row,{gap:8,children:[(0,m.jsx)(l.Button,{label:`Save ${P.length} reading${1===P.length?'':'s'}`,testID:"haccp-save-quick",disabled:!R,onPress:()=>{j(e,P.map(e=>({point:e.point,value:e.temp?e.v:void 0,done:e.temp?void 0:e.d.done,corrective:e.d.corrective,source:C?'voice':'typed'}))),w(`Saved ${P.length} reading${1===P.length?'':'s'}.`),b(null),p('')},style:{flex:1}}),(0,m.jsx)(l.Button,{kind:"secondary",label:"Cancel",onPress:()=>{b(null),w('Nothing saved.')}})]}),(0,m.jsx)(l.Muted,{children:"Nothing is saved until you tap Save."})]}):null]})}function v({who:e}){const n=(0,r.useSafety)(e=>e.points),[s,i]=(0,t.useState)(n[0]?.id),[u,p]=(0,t.useState)(''),[x,b]=(0,t.useState)(),[f,w]=(0,t.useState)(''),[v,k]=(0,t.useState)(''),[C,S]=(0,t.useState)(''),T=n.find(e=>e.id===s),D=!!T&&(0,d.isTempKind)(T.kind),I=y(u),P=T?D?null==I?null:(0,d.inRange)(T,I):void 0===x?null:x:null,R=null!==P&&(P||f.trim());return(0,m.jsxs)(h.Box,{testID:"haccp-manual",children:[(0,m.jsx)(l.T,{weight:"semibold",size:17,children:"Record one check"}),(0,m.jsx)(l.Row,{wrap:!0,gap:6,children:n.map(e=>(0,m.jsx)(l.Chip,{label:e.name,selected:e.id===s,onPress:()=>{i(e.id),p(''),b(void 0),w(''),S('')}},e.id))}),T?(0,m.jsxs)(l.Muted,{children:[d.KIND_LABEL[T.kind]," \xb7 safe: ",(0,d.limitText)(T)]}):null,D?(0,m.jsxs)(l.Row,{gap:8,children:[(0,m.jsx)(o.default,{accessibilityLabel:"Temperature reading",value:u,onChangeText:p,placeholder:"\xb0C",placeholderTextColor:"#7D776C",keyboardType:"numbers-and-punctuation",style:[l.styles.input,{width:110,fontSize:22}]}),(0,m.jsx)(l.T,{size:18,children:"\xb0C"}),null===P?null:(0,m.jsx)(l.Badge,{kind:P?'green':'red',label:P?'OK':'OUT OF RANGE'})]}):(0,m.jsxs)(l.Row,{gap:6,children:[(0,m.jsx)(l.Chip,{label:"Done",selected:!0===x,onPress:()=>b(!0)}),(0,m.jsx)(l.Chip,{label:"Not done",selected:!1===x,onPress:()=>b(!1)})]}),!1===P?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(l.Banner,{kind:"danger",title:D?'Out of range':'Check not done',children:"Write what you did about it before saving (e.g. moved food, discarded, called the engineer, re-checked in 30 minutes)."}),(0,m.jsx)(o.default,{accessibilityLabel:"Corrective action",value:f,onChangeText:w,placeholder:"Corrective action taken",placeholderTextColor:"#7D776C",style:l.styles.input})]}):null,(0,m.jsx)(o.default,{accessibilityLabel:"Note (optional)",value:v,onChangeText:k,placeholder:"Note (optional), e.g. probe used, batch",placeholderTextColor:"#7D776C",style:l.styles.input}),(0,m.jsx)(l.Button,{label:"Save check",testID:"haccp-save-one",disabled:!R,onPress:()=>{j(e,[{point:T,value:D?I:void 0,done:D?void 0:x,corrective:f,note:v,source:'typed'}]),p(''),b(void 0),w(''),k(''),S(`Saved: ${T.name}.`)}}),C?(0,m.jsx)(l.T,{size:14,colour:c.colours.green,children:C}):null]})}function k({who:e}){const n=(0,r.useSafety)(e=>e.entries),s=(0,r.useSafety)(e=>e.points),[o,u]=(0,t.useState)('7'),[p,x]=(0,t.useState)('all'),[b,y]=(0,t.useState)(!1),[f,j]=(0,t.useState)(''),w='staff'===e.mode,v=(0,t.useMemo)(()=>{const t=new Date(e.now);t.setHours(0,0,0,0);const s='today'===o?t.getTime():'all'===o?0:e.now.getTime()-864e5*Number(o);return n.filter(t=>!(w&&t.byId!==e.meId||!(new Date(t.at).getTime()>=s)||'all'!==p&&t.kind!==p||b&&t.ok))},[n,o,p,b,w,e.meId,e.now.getTime()]),k=Array.from(new Set(s.map(e=>e.kind))),S=e.now.toISOString().slice(0,10);return(0,m.jsxs)(h.Box,{testID:"haccp-history",children:[(0,m.jsx)(l.T,{weight:"semibold",size:17,children:w?'My entries':'Food safety log'}),(0,m.jsx)(l.Row,{wrap:!0,gap:6,children:[['today','Today'],['7','7 days'],['30','30 days'],['all','All']].map(([e,t])=>(0,m.jsx)(l.Chip,{label:t,selected:o===e,onPress:()=>u(e)},e))}),(0,m.jsxs)(l.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(l.Chip,{label:"All checks",selected:'all'===p,onPress:()=>x('all')}),k.map(e=>(0,m.jsx)(l.Chip,{label:d.KIND_LABEL[e],selected:p===e,onPress:()=>x(e)},e))]}),(0,m.jsx)(l.Toggle,{label:"Out of range only",value:b,onChange:y}),(0,m.jsx)(i.default,{testID:"haccp-count",children:(0,m.jsxs)(l.Muted,{children:[v.length," entr",1===v.length?'y':'ies',v.filter(e=>!e.ok).length?` \xb7 ${v.filter(e=>!e.ok).length} out of range`:'']})}),v.length?v.slice(0,200).map(e=>(0,m.jsx)(C,{e:e},e.id)):(0,m.jsx)(l.Muted,{children:"No entries for these filters yet."}),w?null:(0,m.jsxs)(l.Row,{wrap:!0,gap:8,children:[(0,m.jsx)(l.Button,{small:!0,label:"Download CSV",testID:"haccp-csv",disabled:!v.length,onPress:()=>j((0,h.downloadText)(`food-safety-log-${S}.csv`,(0,d.toCsv)(v,s))?`CSV downloaded: ${v.length} entries.`:'Downloads work in the web app.')}),(0,m.jsx)(l.Button,{small:!0,kind:"secondary",label:"Print for EHO",testID:"haccp-print",disabled:!v.length,onPress:()=>j((0,h.printTable)('Food safety log (HACCP)',`${v.length} entries \xb7 printed ${e.now.toLocaleString('en-GB')} \xb7 all readings entered by staff`,d.LOG_HEAD,(0,d.logRows)(v,s))?'Print view opened in a new tab.':'Pop-ups are blocked: allow them to print.')})]}),f?(0,m.jsx)(l.T,{size:14,colour:c.colours.green,children:f}):null]})}function C({e:e}){return(0,m.jsxs)(i.default,{testID:"haccp-row",style:{paddingVertical:8,borderTopWidth:1,borderColor:c.colours.border,gap:2},children:[(0,m.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsx)(l.T,{size:15,weight:"medium",style:{flex:1},children:e.name}),(0,m.jsx)(l.T,{size:17,weight:"bold",colour:e.ok?c.colours.green:c.colours.red,children:(0,d.fmtEntryValue)(e)})]}),(0,m.jsxs)(l.Row,{gap:6,children:[(0,m.jsx)(u.StaffAvatar,{id:e.byId,name:e.by,size:20,ring:!1}),(0,m.jsxs)(l.Muted,{style:{flex:1},children:[b(e.at)," ",x(e.at)," \xb7 ",e.initials??(0,d.initialsOf)(e.by)," ",e.by,'voice'===e.source?' \xb7 voice, confirmed':'probe'===e.source?' \xb7 probe':'',e.ok?'':' \xb7 OUT OF RANGE']})]}),e.corrective?(0,m.jsxs)(l.T,{size:13,colour:c.colours.amber,children:["Action: ",e.corrective]}):null,e.note?(0,m.jsxs)(l.Muted,{children:["Note: ",e.note]}):null,e.photo?(0,m.jsx)(n.default,{source:{uri:e.photo},style:{width:72,height:72,borderRadius:8},accessibilityLabel:"Corrective action photo"}):null]})}function S({editable:e}){const n=(0,r.useSafety)(e=>e.points),[s,o]=(0,t.useState)('');return(0,m.jsxs)(h.Box,{testID:"haccp-limits",children:[(0,m.jsx)(l.T,{weight:"semibold",size:17,children:"Check points and safe limits"}),(0,m.jsx)(l.Muted,{children:e?'Set the limits from your own HACCP plan. Leave min or max empty if it doesn\u2019t apply. Due times are daily reminders (24 h, comma separated).':'Set by the Head Chef in Cover Charge for Head Chef.'}),n.map(t=>(0,m.jsx)(T,{p:t,editable:e,onSaved:()=>o(`Saved limits for ${t.name}.`)},t.id)),e?(0,m.jsx)(D,{onAdded:e=>o(`Added ${e}.`)}):null,s?(0,m.jsx)(l.T,{size:14,colour:c.colours.green,children:s}):null]})}function T({p:e,editable:n,onSaved:s}){const[u,h]=(0,t.useState)(null==e.min?'':String(e.min)),[p,x]=(0,t.useState)(null==e.max?'':String(e.max)),[b,f]=(0,t.useState)(e.due.join(', ')),j=(0,d.isTempKind)(e.kind),w=''===b.trim()||b.split(',').every(e=>/^\s*([01]\d|2[0-3]):[0-5]\d\s*$/.test(e)),v=u!==(null==e.min?'':String(e.min))||p!==(null==e.max?'':String(e.max))||b!==e.due.join(', '),k=w&&(''===u||null!=y(u))&&(''===p||null!=y(p));return n?(0,m.jsxs)(i.default,{style:{gap:6,paddingVertical:8,borderTopWidth:1,borderColor:c.colours.border},testID:`limit-${e.id}`,children:[(0,m.jsxs)(l.T,{weight:"medium",children:[e.name," ",(0,m.jsxs)(l.Muted,{children:["\xb7 ",d.KIND_LABEL[e.kind]]})]}),(0,m.jsxs)(l.Row,{wrap:!0,gap:8,children:[j?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(o.default,{accessibilityLabel:`Minimum for ${e.name}`,value:u,onChangeText:h,placeholder:"min \xb0C",placeholderTextColor:"#7D776C",style:[l.styles.input,{width:90}]}),(0,m.jsx)(o.default,{accessibilityLabel:`Maximum for ${e.name}`,value:p,onChangeText:x,placeholder:"max \xb0C",placeholderTextColor:"#7D776C",style:[l.styles.input,{width:90}]})]}):null,(0,m.jsx)(o.default,{accessibilityLabel:`Due times for ${e.name}`,value:b,onChangeText:f,placeholder:"e.g. 09:00, 16:00",placeholderTextColor:"#7D776C",style:[l.styles.input,{flex:1,minWidth:140,width:40}]}),v?(0,m.jsx)(l.Button,{small:!0,label:"Save",disabled:!k,onPress:()=>{r.useSafety.getState().setPoint(e.id,{min:''===u?void 0:y(u),max:''===p?void 0:y(p),due:b.split(',').map(e=>e.trim()).filter(Boolean).sort()}),s()}}):null]}),w?null:(0,m.jsx)(l.T,{size:13,colour:c.colours.red,children:"Use 24-hour times like 09:00, 16:00."})]}):(0,m.jsxs)(l.Row,{style:{justifyContent:'space-between',paddingVertical:4},children:[(0,m.jsx)(l.T,{size:14,style:{flex:1},children:e.name}),(0,m.jsxs)(l.Muted,{children:[(0,d.limitText)(e),e.due.length?` \xb7 due ${e.due.join(', ')}`:'']})]})}function D({onAdded:e}){const[n,s]=(0,t.useState)(''),[u,h]=(0,t.useState)('fridge');return(0,m.jsxs)(i.default,{style:{gap:6,paddingTop:8,borderTopWidth:1,borderColor:c.colours.border},children:[(0,m.jsx)(l.T,{weight:"medium",children:"Add a check point"}),(0,m.jsx)(o.default,{accessibilityLabel:"New check point name",value:n,onChangeText:s,placeholder:"e.g. Dessert fridge",placeholderTextColor:"#7D776C",style:l.styles.input}),(0,m.jsx)(l.Row,{wrap:!0,gap:6,children:Object.keys(d.KIND_LABEL).map(e=>(0,m.jsx)(l.Chip,{label:d.KIND_LABEL[e],selected:e===u,onPress:()=>h(e)},e))}),(0,m.jsx)(l.Button,{small:!0,label:"Add check point",disabled:!n.trim(),onPress:()=>{const t='fridge'===u?{max:5}:'freezer'===u?{max:-18}:'cook'===u?{min:75}:'hothold'===u?{min:63}:'cool'===u||'delivery'===u?{max:8}:{};r.useSafety.getState().addPoint({name:n.trim(),kind:u,due:[],aliases:[n.trim().toLowerCase()],...t}),e(n.trim()),s('')}})]})}function I({me:e,now:n}){const s=(0,r.useSafety)(e=>e.probes??[]),d=(0,r.useSafety)(e=>e.points).filter(e=>'fridge'===e.kind||'freezer'===e.kind),[u,p]=(0,t.useState)(!1),[x,b]=(0,t.useState)(''),[y,f]=(0,t.useState)(''),[j,w]=(0,t.useState)(null),[v,k]=(0,t.useState)(''),C=d.find(e=>e.id===y);return(0,m.jsxs)(h.Box,{testID:"haccp-probes",children:[(0,m.jsx)(l.T,{weight:"semibold",size:17,children:"Wireless probes"}),(0,m.jsx)(l.Muted,{children:"Wireless fridge and freezer probes. Once a probe is connected, its readings go into the food safety log tagged \u201cprobe\u201d with the time they were taken. Out-of-range probe readings still need a corrective action from a person."}),s.length?s.map(e=>(0,m.jsxs)(i.default,{testID:"probe-row",style:{gap:6,paddingVertical:10,borderTopWidth:1,borderColor:c.colours.border},children:[(0,m.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(i.default,{style:{flex:1,gap:2},children:[(0,m.jsx)(l.T,{weight:"semibold",children:e.name}),(0,m.jsx)(l.Muted,{children:e.location})]}),(0,m.jsx)(l.Badge,{kind:'connected'===e.status?'green':'amber',label:'connected'===e.status?'Connected':'Not connected'})]}),(0,m.jsxs)(l.Row,{wrap:!0,gap:6,children:[(0,m.jsx)(l.Button,{small:!0,label:"Connect your probe",accessibilityLabel:`Connect your probe: ${e.name}`,onPress:()=>w(j===e.id?null:e.id)}),(0,m.jsx)(l.Button,{small:!0,kind:"ghost",label:"Remove",accessibilityLabel:`Remove probe ${e.name}`,onPress:()=>r.useSafety.getState().removeProbe(e.id)})]}),j===e.id?(0,m.jsxs)(i.default,{testID:"probe-connect",style:{gap:6,padding:10,borderRadius:12,borderWidth:1,borderColor:c.colours.gold},children:[(0,m.jsx)(l.T,{weight:"semibold",children:"Connect your probe"}),(0,m.jsxs)(l.T,{size:14,children:["1. Put the probe in ",e.location," and switch it on."]}),(0,m.jsx)(l.T,{size:14,children:"2. Keep this device near the probe."}),(0,m.jsx)(l.T,{size:14,children:"3. Tap Search for probe and pick it from the list."}),(0,m.jsx)(l.Button,{small:!0,kind:"secondary",label:"Search for probe",onPress:()=>k(`No probe found for ${e.name}. Probe hardware isn\u2019t available in the prototype yet, so it stays Not connected and nothing is added to the log.`)})]}):null]},e.id)):(0,m.jsx)(i.default,{testID:"probes-empty",children:(0,m.jsx)(l.Muted,{children:"No probes yet."})}),v?(0,m.jsx)(i.default,{testID:"probe-msg",children:(0,m.jsx)(l.Banner,{kind:"info",children:v})}):null,u?(0,m.jsxs)(i.default,{testID:"probe-add",style:{gap:8,padding:10,borderRadius:12,borderWidth:1,borderColor:c.colours.gold},children:[(0,m.jsx)(o.default,{accessibilityLabel:"Probe name",value:x,onChangeText:b,placeholder:"e.g. Walk-in probe 1",placeholderTextColor:"#7D776C",style:[l.styles.input,{minWidth:0}]}),(0,m.jsx)(l.Muted,{children:"Where is it?"}),(0,m.jsx)(l.Row,{wrap:!0,gap:6,children:d.map(e=>(0,m.jsx)(l.Chip,{label:e.name,selected:y===e.id,onPress:()=>f(e.id)},e.id))}),(0,m.jsxs)(l.Row,{gap:8,children:[(0,m.jsx)(l.Button,{label:"Save probe",disabled:!x.trim()||!C,onPress:()=>{x.trim()&&C&&(r.useSafety.getState().addProbe({name:x.trim(),pointId:C.id,location:C.name,addedBy:e.replace(' (example)',''),addedAt:n.toISOString()}),k(`Added \u201c${x.trim()}\u201d for ${C.name}. Next: connect your probe.`),b(''),f(''),p(!1))}}),(0,m.jsx)(l.Button,{kind:"ghost",label:"Cancel",onPress:()=>p(!1)})]})]}):(0,m.jsx)(l.Button,{kind:"secondary",label:"Add probe",onPress:()=>{p(!0),k('')}}),(0,m.jsx)(l.Muted,{children:"Demo: no probe hardware is connected, so no probe readings appear. The app never makes up a temperature."})]})}},882,[12,178,245,255,109,790,991,992,797,863,886,996,6]); +__d(function(g,_r,_i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"hash",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"CHANNELS",{enumerable:!0,get:function(){return n}}),_e.revenueHistory=function(e,n,r=28){const i=[];for(let s=r;s>=1;s--){const r=(0,t.addMins)(n,1440*-s),d=!!e.kitchenHours[r.getDay()],l=[1.05,0,0,.6,.7,1,1.2][r.getDay()]*('anchorage'===e.id?1:.6),u=n=>.85+.3*o((0,t.ymd)(r)+n+e.id),c=d?Math.round(24e4*l*u('d')):0,p=d?Math.round(95e3*l*u('t')):0,h=d?Math.round(52e3*l*u('q')):0;i.push({date:r,label:(0,t.niceDate)(r).slice(0,6),byChannel:{'Dine-in':c,Takeaway:p,'Table QR':h},total:c+p+h,covers:d?Math.round(150*l*u('c')):0})}return i},_e.dishStats=function(e){return e.filter(e=>null!=e.price).map(e=>{const t=Math.round(20+260*o(e.id+'s')),n=.24+.22*o(e.id+'c'),r=e.price??0,i=Math.round(r*(1-n));return{item:e,sold:t,revenue:t*r,costPct:n,margin:i,gp:i*t}})},_e.quadrant=function(e,t,o,n){return e>=o?t>=n?'Star':'Plough horse':t>=n?'Puzzle':'Dog'},Object.defineProperty(_e,"QUADRANT_TIP",{enumerable:!0,get:function(){return r}}),_e.crmCustomers=function(){return i.map((e,t)=>{const r=o(e+t);return{id:0===t?'cust-demo':`cr-${t}`,name:`${e} ${s[t]}${0===t?'':' (example)'}`,phone:`07700 900${String(100+7*t).slice(-3)}`,visits:1+Math.round(18*r),lastVisit:`${1+Math.round(27*r)} days ago`,spend:Math.round(3e3+6e4*r),allergies:0===t?['Crustaceans (anaphylaxis)','Mustard']:r>.8?['Gluten (coeliac)']:r<.1?['Peanuts']:[],stamps:0===t?5:Math.round(7*r),optIn:r>.25,channel:n[Math.floor(3*r)%3],birthday:r>.6?`${1+Math.round(27*r)} Nov`:void 0}})},Object.defineProperty(_e,"STOCK",{enumerable:!0,get:function(){return d}}),_e.insights=function(o,n,r,i,s,l,u){const c=[],p=new Date(l);p.setDate(p.getDate()+((6-p.getDay()+7)%7||7)),p.setHours(0,0,0,0);const h=(0,e.forecastToday)(o,n,r,i,p),m=Math.round(h.restOfDay.covers/Math.max(1,h.multiplier)),b=Math.max(35,Math.round(100*(h.multiplier-1))+35);c.push({id:'sat',icon:'\ud83d\udcc8',tone:'gold',title:`${(0,t.niceDate)(p)} forecast +${b}%: add 1 server 6\u20139pm`,body:`Example: ~${Math.round(m*(1+b/100))} covers expected vs ~${m} on a usual Saturday (bookings pace + Halloween weekend flag).`,action:{label:'Open rota',tab:'more',sub:'rota'}});const f=(0,e.forecastToday)(o,n,r,i,l),y=d[0],v=Math.ceil((f.restOfDay.covers+2*f.restOfDay.takeaway)*y.perCover);c.push({id:'haddock',icon:'\ud83d\udc1f',tone:'red',title:`Haddock low: ${y.onHand} portions left`,body:`Tonight\u2019s forecast needs ~${v}. Call the supplier before 18:00 or 86 the fish supper at ${y.onHand} sold.`,action:{label:'Prep list',tab:'more',sub:'prep'}});const M=i.find(e=>/Burns/.test(e.title));if(M){const e=Math.max(1,Math.round((new Date(M.date).getTime()-l.getTime())/6048e5));c.push({id:'burns',icon:'\ud83e\udd43',tone:'blue',title:`Burns Night in ${e} weeks: open bookings?`,body:'Last year\u2019s equivalent nights sold out ~3 weeks ahead (example). Publish the set menu and push to opted-in regulars.',action:{label:'Plan campaign',tab:'more',sub:'marketing'}})}const w=n.filter(e=>'noshow'===e.status).length;c.push({id:'noshow',icon:'\ud83e\ude91',tone:'amber',title:w?`${w} no-show today: deposits for 6+?`:'No-shows down 40% since card-on-file (example)',body:'Saved card is required from parties of 6. Consider deposits on Fri/Sat after 19:00.',action:{label:'Bookings',tab:'bookings'}});const k=s.filter(e=>e.stars<=2).length;k&&c.push({id:'reviews',icon:'\ud83d\udcac',tone:'red',title:`${k} low rating this week: cold chips at collection`,body:'Readiness alerts now time bagging 5 min before pickup. Reply to say thanks and invite them back.',action:{label:'Reviews',tab:'more',sub:'reviews'}});return c.push({id:'commission',icon:'\ud83d\udcb7',tone:'green',title:'You kept ~\xa31,240 in commission this month',body:'Example: \xa34,140 of direct takeaway orders that would have cost ~30% on delivery apps.',action:{label:'Analytics',tab:'more',sub:'analytics'}}),c.push({id:'covers',icon:'\ud83c\udf7d\ufe0f',tone:'gold',title:`${u} covers so far today`,body:'Lobster special is the top add-on tonight. Suggest it with the scallops (example).'}),c};var e=_r(_d[0]),t=_r(_d[1]);const o=e=>{let t=2166136261;for(let o=0;o>>0)/4294967295},n=['Dine-in','Takeaway','Table QR'];const r={Star:'Keep: high margin and popular. Feature it.','Plough horse':'Popular, low margin: nudge the price or trim the cost.',Puzzle:'High margin, few sales: promote it or rename it.',Dog:'Low margin, few sales: consider removing it.'},i=['Alex','Fiona','Iain','Morag','Callum','Eilidh','Ross','Kirsty','Euan','Shona','Hamish','Isla','Craig','Ailsa','Neil','Catriona'],s=['Morgan','Campbell','Fraser','McLeod','Kerr','Wallace','Boyd','Hamilton','Stewart','Murray','Paterson','Duncan','Gilmour','Reid','Ross','Grant'];const d=[{cat:'Fish & seafood',id:'haddock',name:'Haddock fillets',unit:'portions',onHand:8,perCover:.22,par:40},{cat:'Fruit & veg',id:'chips',name:'Chipping potatoes',unit:'kg',onHand:25,perCover:.18,par:40},{cat:'Fish & seafood',id:'langoustine',name:'Langoustines',unit:'kg',onHand:4,perCover:.03,par:6},{cat:'Fish & seafood',id:'mussels',name:'Mussels',unit:'kg',onHand:10,perCover:.05,par:12},{cat:'Fish & seafood',id:'scallops',name:'Scallops',unit:'portions',onHand:14,perCover:.06,par:20},{cat:'Meat',id:'beef',name:'Burger patties',unit:'each',onHand:30,perCover:.1,par:40},{cat:'Fruit & veg',id:'peas',name:'Garden peas',unit:'kg',onHand:6,perCover:.04,par:8},{cat:'Dairy',id:'tartare',name:'House tartare sauce',unit:'tubs',onHand:5,perCover:.05,par:10}]},883,[842,795]); +__d(function(_g,_r,i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useStore",{enumerable:!0,get:function(){return r.useStore}}),_e.useNow=function(t=1e4){const u=(0,r.useStore)(e=>e.clock),[,n]=(0,e.useState)(0);return(0,e.useEffect)(()=>{const e=setInterval(()=>n(e=>e+1),t);return()=>clearInterval(e)},[t]),(0,r.nowFrom)(u)},Object.defineProperty(_e,"useRestaurant",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"useMenu",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"useAllMenu",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"useCustomer",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useBasket",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"useOrders",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"useOrder",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"useBookings",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"useWaitlist",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"useEvents",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"useStampCard",{enumerable:!0,get:function(){return m}}),Object.defineProperty(_e,"useGiftCards",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"useRatings",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"useAudit",{enumerable:!0,get:function(){return O}});var e=_r(d[0]),t=_r(d[1]),r=_r(d[2]);const u=e=>(0,r.useStore)(t=>t.restaurants.find(t=>t.id===e)),n=e=>(0,r.useStore)((0,t.useShallow)(t=>t.menu.filter(t=>t.restaurantId===e&&!t.hidden))),s=e=>(0,r.useStore)((0,t.useShallow)(t=>t.menu.filter(t=>t.restaurantId===e))),o=()=>(0,r.useStore)(e=>e.customer),a=()=>(0,r.useStore)(e=>e.basket),l=e=>(0,r.useStore)((0,t.useShallow)(t=>e?t.orders.filter(t=>t.restaurantId===e):t.orders)),f=e=>(0,r.useStore)(t=>t.orders.find(t=>t.id===e)),c=e=>(0,r.useStore)((0,t.useShallow)(t=>e?t.bookings.filter(t=>t.restaurantId===e):t.bookings)),b=e=>(0,r.useStore)((0,t.useShallow)(t=>t.waitlist.filter(t=>t.restaurantId===e))),S=e=>(0,r.useStore)((0,t.useShallow)(t=>t.events.filter(t=>null===t.restaurantId||t.restaurantId===e))),m=e=>(0,r.useStore)(t=>t.stampCards.find(r=>r.restaurantId===e&&r.customerId===t.customer.id)),g=e=>(0,r.useStore)((0,t.useShallow)(t=>t.giftCards.filter(r=>(!e||r.restaurantId===e)&&r.ownerId===t.customer.id))),p=e=>(0,r.useStore)((0,t.useShallow)(t=>t.ratings.filter(t=>t.restaurantId===e))),O=e=>(0,r.useStore)((0,t.useShallow)(t=>t.audit.filter(t=>t.restaurantId===e)))},884,[12,845,844]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useAvatars",{enumerable:!0,get:function(){return l}});var t,e=r(d[0]),o=(t=e)&&t.__esModule?t:{default:t},s=r(d[1]),n=r(d[2]);const l=(0,s.create)()((0,n.persist)((t,e)=>({photos:{},log:[],setOwn:(e,o,s,n)=>{if(!e||e!==o||!s.startsWith('data:image/'))return!1;const l=(new Date).toISOString();return t(t=>({photos:{...t.photos,[o]:{dataUrl:s,at:l}},log:[{id:`av-${Date.now().toString(36)}`,staffId:o,what:'made',by:n,at:l},...t.log].slice(0,100)})),!0},reset:(o,s)=>{if(s.id!==o&&'staff'===s.role)return!1;if(!e().photos[o])return!1;const n={...e().photos};return delete n[o],t(t=>({photos:n,log:[{id:`av-${Date.now().toString(36)}`,staffId:o,what:'reset',by:s.name,at:(new Date).toISOString()},...t.log].slice(0,100)})),!0}}),{name:'covercharge-avatars-v1',storage:(0,n.createJSONStorage)(()=>o.default),version:1}))},885,[942,948,951]); +__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.Tabs=function({value:e,options:o,onChange:c}){return(0,i.jsx)(n.Row,{wrap:!0,gap:6,children:o.map(o=>(0,i.jsx)(t.default,{accessibilityRole:"tab",accessibilityState:{selected:e===o.id},accessibilityLabel:o.label,testID:`tab-${o.id}`,onPress:()=>c(o.id),style:{paddingHorizontal:14,paddingVertical:9,borderRadius:999,borderWidth:1,borderColor:e===o.id?r.colours.gold:r.colours.border,backgroundColor:e===o.id?r.colours.goldTint:'transparent'},children:(0,i.jsx)(n.T,{size:14,weight:e===o.id?'semibold':'regular',colour:e===o.id?r.colours.goldLight:r.colours.text,children:o.label})},o.id))})},Object.defineProperty(_e,"Box",{enumerable:!0,get:function(){return c}}),_e.speechRecognition=function(){if('undefined'==typeof window)return null;const e=window;return e.SpeechRecognition||e.webkitSpeechRecognition||null},_e.downloadText=function(e,t,o="text/csv"){if('undefined'==typeof document)return!1;const n=new Blob(['\ufeff'+t],{type:`${o};charset=utf-8`}),r=document.createElement('a');return r.href=URL.createObjectURL(n),r.download=e,document.body.appendChild(r),r.click(),setTimeout(()=>{URL.revokeObjectURL(r.href),r.remove()},1e3),!0},_e.printTable=function(e,t,o,n){if('undefined'==typeof window)return!1;const r=window.open('','_blank');return!!r&&(r.document.write(`${a(e)}

${a(e)}

${a(t)}

${o.map(e=>``).join('')}${n.map(e=>`${e.map(e=>``).join('')}`).join('')}
${a(e)}
${a(e)}
+ + +