PageSourceSearch

https://nuento.com/_next/static/chunks/pages/account/orders-place-supplier-810187c754841560.js

js nuento.com collected 2026-10-09 22:01:31 UTC 27,393 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l=(new e.Error).stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="d3d80945-011a-4b7b-b430-c3f88c0ee43f",e._sentryDebugIdIdentifier="sentry-dbid-d3d80945-011a-4b7b-b430-c3f88c0ee43f")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1162,5249],{21256:(e,l,n)=>{"use strict";n.r(l),n.d(l,{__N_SSP:()=>ed,default:()=>es});var t=n(37876),o=n(14232),a=n(89099),r=n(32653),i=n(27459),c=n(83933),s=n(99071),d=n(40283),u=n(99334),m=n(67994),v=n(67224),f=n(17490),h=n(93136),g=n(68792),p=n(81129),w=n(51444),b=n(79298),k=n(96427),x=n(3219),y=n(32948);function j(){let e=(0,k._)(["\n    query CollectionPlaceBookings($collectionId: ID!, $orderFilter: OrderFilterInput!) {\n  collection(id: $collectionId) {\n    ...CollectionBaseFields\n    supplier {\n      id\n      approved\n    }\n    orders(filter: $orderFilter) {\n      id\n      createdAt\n      cancelledAt\n      place {\n        checkInAt\n        checkOutAt\n        numOfGuests\n      }\n      invoiceUser {\n        name\n        email\n        phone\n      }\n      user {\n        name\n        email\n        phone\n      }\n      reviews {\n        id\n        rating\n        description {\n          body\n        }\n        name\n        source {\n          id\n        }\n        createdAt\n        supplierReply\n        supplierReplyAt\n        supplierReplyAuthor {\n          id\n          name\n        }\n        user {\n          name\n        }\n      }\n    }\n  }\n}\n    ",""]);return j=function(){return e},e}let C=(0,x.J1)(j(),y.T);function M(){let e=(0,k._)(["\n    query CollectionPlaceBlockedDates($collectionId: ID!) {\n  collection(id: $collectionId) {\n    id\n    memos {\n      date\n      blocked\n      notes\n    }\n  }\n}\n    "]);return M=function(){return e},e}let N=(0,x.J1)(M());var D=n(68283),A=n(20146),P=n(32783),I=n(66236),E=n(40022),L=n(8231),S=n(62715),O=n(73084),G=n(251),R=n(12978),_=n(7802);function K(e){if(null==e)return"";let l=/[",\n\r]/.test(e),n=e.replace(/"/g,'""');return l?'"'.concat(n,'"'):n}async function F(e,l,t){let o=await Promise.all([n.e(9509),n.e(8436)]).then(n.bind(n,12770)),a=[l.map(e=>e.label),...e.map(e=>l.map(l=>{var n;return null!=(n=e[l.key])?n:""}))],r=o.utils.aoa_to_sheet(a);r["!cols"]=l.map(e=>({wch:Math.max(e.label.length,18)}));let i=o.utils.book_new();o.utils.book_append_sheet(i,r,"Bookings"),o.writeFile(i,"".concat(t,".xlsx"))}async function $(e,l,t,o){let{default:a}=await Promise.all([n.e(4155),n.e(347),n.e(8693)]).then(n.bind(n,14312)),r=(await n.e(9665).then(n.bind(n,9665))).default,i=new a({orientation:"landscape",unit:"pt",format:"a4"});i.setFontSize(14),i.text(o,40,40),r(i,{startY:60,head:[l.map(e=>e.label)],body:e.map(e=>l.map(l=>{var n;return null!=(n=e[l.key])?n:""})),styles:{fontSize:9,cellPadding:6},headStyles:{fillColor:[33,33,33],textColor:255}}),i.save("".concat(t,".pdf"))}var U=n(5427),T=n(33450),W=n(33181),H=n(8726),V=n(98679),q=n(21818),z=n(38097),B=n(96610),Y=n(72613),J=n(53432),Q=n(949),X=n(6250),Z=n(46975),ee=n(77536),el=n(16843);function en(e){let{value:l,onDateChange:n,mode:a,autoCloseCalendar:r=!0}=e,{t:i}=(0,u.Bd)(["account-bookings-overview","account-finance"]),[c,s]=(0,o.useState)(null),[m,v]=(0,o.useState)({from:void 0,to:void 0}),[h,g]=(0,o.useState)(!1),[p,w]=(0,o.useState)(!1),[b,k]=(0,o.useState)(!1),[x,y]=(0,o.useState)(!1),j=new Date().getFullYear(),C="future"===a?[{label:i("account-bookings-overview:date-filter.presets.next-7-days"),range:{from:new Date,to:(0,T.f)(new Date,6)}},{label:i("account-bookings-overview:date-filter.presets.next-30-days"),range:{from:new Date,to:(0,T.f)(new Date,29)}},{label:i("account-bookings-overview:date-filter.presets.this-week"),range:{from:(0,W.k)(new Date),to:(0,H.$)(new Date)}},{label:i("account-bookings-overview:date-filter.presets.this-month"),range:{from:(0,V.w)(new Date),to:(0,q.p)(new Date)}}]:[{label:i("account-finance:date-filter.presets.last-7-days"),range:{from:(0,z.e)(new Date,6),to:new Date}},{label:i("account-finance:date-filter.presets.last-30-days"),range:{from:(0,z.e)(new Date,29),to:new Date}},{label:i("account-finance:date-filter.presets.this-week"),range:{from:(0,W.k)(new Date),to:(0,H.$)(new Date)}},{label:i("account-finance:date-filter.presets.this-month"),range:{from:(0,V.w)(new Date),to:(0,q.p)(new Date)}}],M=("future"===a?Array.from({length:5},(e,l)=>j+l):Array.from({length:3},(e,l)=>j-l)).map(e=>
1({label:e.toString(),range:{from:(0,B.D)(new Date(e,0,1)),to:(0,Y.Q)(new Date(e,0,1))}})),N=e=>{if(e)try{let l=(0,J.H)(e);return(0,Q.f)(l)?l:void 0}catch(e){return}};return(0,o.useEffect)(()=>{if(l&&(l.from||l.to)&&!x){let e=N(l.from),n=N(l.to),t=((e,l)=>{if(!e||!l)return null;for(let n of C)if(n.range.from&&n.range.to&&(0,X.r)(e,n.range.from)&&(0,X.r)(l,n.range.to))return{...n,type:"preset"};return null})(e,n);if(t){s(t),y(!0);return}let o=((e,l)=>{if(!e||!l)return null;for(let n of M)if(n.range.from&&n.range.to&&(0,X.r)(e,n.range.from)&&(0,X.r)(l,n.range.to))return{...n,type:"year"};return null})(e,n);if(o){s(o),y(!0);return}if(e||n){let l="";e&&n?l=i("account-finance:date-filter.custom.range-label",{fromDate:(0,d.GP)(e,"d. MMM"),toDate:(0,d.GP)(n,"d. MMM, yyyy")}):e?l=i("account-finance:date-filter.custom.from-label",{date:(0,d.GP)(e,"d. MMM, yyyy")}):n&&(l=i("account-finance:date-filter.custom.to-label",{date:(0,d.GP)(n,"d. MMM, yyyy")})),s({type:"custom",label:l,range:{from:e,to:n}}),v({from:e,to:n})}y(!0)}else l&&(l.from||l.to)||(x?(s(null),v({from:void 0,to:void 0})):y(!0))},[l,x]),(0,o.useEffect)(()=>{if(c&&x){let{from:e,to:l}=c.range;e||l?n({from:e,to:l}):n(null)}else x&&!c&&n(null)},[c,x]),(0,t.jsxs)(Z.AM,{open:h,onOpenChange:g,children:[(0,t.jsx)(Z.Wv,{asChild:!0,children:(0,t.jsx)(f.$,{leftIcon:(0,t.jsx)(U.A,{className:"h-4 w-4 fill-white"}),variant:"outline",className:"gap-2 bg-transparent",children:c?c.label:i("account-finance:date-filter.placeholder")})}),(0,t.jsx)(Z.hl,{className:"lg:w-80 w-[calc(100vw-1rem)] max-w-none lg:max-w-sm p-0 bg-white",align:"start",side:"bottom",sideOffset:4,avoidCollisions:!0,collisionPadding:8,children:(0,t.jsxs)("div",{className:"p-4 space-y-4 max-h-[70vh] lg:max-h-[80vh] overflow-y-auto flex flex-col gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-bold mb-2",children:i("account-finance:date-filter.custom-range")}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[(0,t.jsxs)(Z.AM,{open:p,onOpenChange:w,children:[(0,t.jsx)(Z.Wv,{asChild:!0,children:(0,t.jsx)(f.$,{variant:"outline",className:(0,el.cn)("justify-start text-left font-normal",!m.from&&"text-muted-foreground"),fullWidth:!0,leftIcon:(0,t.jsx)(_.Regular20Calendar,{className:"mr-2 h-4 w-4"}),children:m.from?(0,d.GP)(m.from,"d. MMM"):i("account-finance:date-filter.from")})}),(0,t.jsx)(Z.hl,{className:"w-auto p-0 bg-white",align:"center",side:"bottom",sideOffset:4,avoidCollisions:!0,collisionPadding:8,children:(0,t.jsx)(ee.V,{mode:"single",selected:m.from,onSelect:e=>v(l=>({...l,from:e})),disabled:e=>!!m.to&&e>m.to,autoClose:r,onAutoClose:()=>w(!1),className:"!p-1",initialFocus:!0})})]}),(0,t.jsxs)(Z.AM,{open:b,onOpenChange:k,children:[(0,t.jsx)(Z.Wv,{asChild:!0,children:(0,t.jsx)(f.$,{variant:"outline",fullWidth:!0,className:(0,el.cn)("justify-start text-left font-normal",!m.to&&"text-muted-foreground"),leftIcon:(0,t.jsx)(_.Regular20Calendar,{className:"mr-2 h-4 w-4"}),children:m.to?(0,d.GP)(m.to,"d. MMM"):i("account-finance:date-filter.to")})}),(0,t.jsx)(Z.hl,{className:"w-auto p-0 bg-white",align:"center",side:"bottom",sideOffset:4,avoidCollisions:!0,collisionPadding:8,children:(0,t.jsx)(ee.V,{mode:"single",selected:m.to,onSelect:e=>v(l=>({...l,to:e})),disabled:e=>!!m.from&&e<m.from,autoClose:r,onAutoClose:()=>k(!1),className:"!p-1",initialFocus:!0})})]})]}),(0,t.jsx)(f.$,{onClick:()=>{if(m.from||m.to){let e="";m.from&&m.to?e=i("account-finance:date-filter.custom.range-label",{fromDate:(0,d.GP)(m.from,"d. MMM"),toDate:(0,d.GP)(m.to,"d. MMM, yyyy")}):m.from?e=i("account-finance:date-filter.custom.from-label",{date:(0,d.GP)(m.from,"d. MMM, yyyy")}):m.to&&(e=i("account-finance:date-filter.custom.to-label",{date:(0,d.GP)(m.to,"d. MMM, yyyy")})),s({type:"custom",label:e,range:m}),g(!1)}},disabled:!m.from&&!m.to,fullWidth:!0,size:"sm",children:i("account-finance:date-filter.apply-range")}),c&&(0,t.jsx)(f.$,{variant:"ghost",onClick:()=>{s(null),v({from:void 0,to:void 0}),g(!1)},fullWidth:!0,className:"justify-center text-sm text-destructive",children:i("account-finance:date-filter.clear-filter")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-bold mb-2",children:i("account-finance:date-filter.quick-filters")}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-2",children:C.map(e=>(0,t.jsx)(f.$,{variant:"solid",fullWidth:!0,size:"sm",className:"justify-start h-8 text-xs lg:text-sm",onClick:()=>{s({...e,type:"preset"}),g(!1)},children:e.label},e.label))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-bold mb-2",children:i("account-finance:date-filter.by-year")}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-1",children:M.map(e=>(0,t.jsx)(f.$,{variant:"solid",fullWidth:!0,size:"sm",className:"h-8",onClick:()=>{s({...e,type:"year"}),g(!1)},children:e.label},e.label))})]})]})})]})}var et=n(10553);function eo(e){if(!e)return"";let l=(0,et.l)(e,"DK");return l?l.formatNational():e}var ea=n(12717),er=n(93337);n(93858);let ei=e=>{var l;return"blocked"===e.rowKind?new Date(e.blockedDate).getTime():(null==e||null==(l=e.place)?void 0:l.checkInAt)?new Date(e.place.checkInAt).getTime():0},ec={checkIn:"min-w-[14rem]",checkOut:"min-w-[14rem]",name:"min-w-[12rem]",phone:"min-w-[9rem]",email:"min-w-[16rem]",bookingReceived:"min-w-[10rem]",collection:"min-w-[10rem]",status:"min-w-[7rem]"},es=()=>{var e,l,n,k,x,y,j;let M=(0,a.useRouter)(),{isAdmin:U,isHost:T,loadingUser:W}=(0,o.useContext)(O.c),H=(0,m.m)(),{currentSupplierId:V}=(0,I.W)(),[q,z]=(0,o.useState)("INCOMMING"),[B,Y]=(0,o.useState)(null),[J,Q]=(0,o.useState)(void 0);(0,o.useEffect)(()=>{!W&&(U||T||M.replace("/account/home"))},[U,T,W,M]);let{t:X}=(0,u.Bd)(["account-bookings-overview","account-orders","account-finance","common","review"]),Z=(0,P.s)(),{data:ee,loading:el}=(0,D.iG)({variables:{collectionFilter:{type:A.it.PLACE}}}),et=(0,o.useMemo)(()=>{var e,l;return null!=(l=null==ee||null==(e=ee.user)?void 0:e.collections)?l:[]},[ee]),es=null!=(y=null!=V?V:null==(l=et[0])||null==(e=l.supplier)?void 0:e.id)?y:null,ed=(0,o.useMemo)(()=>et.filter(e=>{var l;return(null==(l=e.supplier)?void 0:l.id)===es}).sort((e,l)=>{var n,t;return(null!=(n=e.title)?n:"")>(null!=(t=l.title)?t:"")?1:-1}),[et,es]),eu=ed.length>
11,[em,ev]=(0,o.useState)([]),[ef,eh]=(0,o.useState)(!0);(0,o.useEffect)(()=>{if(el)return;if(!ed.length){ev([]),eh(!1);return}let e=!1;return eh(!0),Promise.all(ed.map(e=>H.query({query:C,variables:{collectionId:e.id,orderFilter:{type:A.it.PLACE}},fetchPolicy:"cache-first"}))).then(l=>{e||(ev(l.flatMap((e,l)=>{var n,t,o;let a=ed[l];return(null!=(o=null==(t=e.data)||null==(n=t.collection)?void 0:n.orders)?o:[]).map(e=>{var l,n;return{...e,collection:{id:null!=(l=a.id)?l:"",title:null!=(n=a.title)?n:""}}})})),eh(!1))}),()=>{e=!0}},[ed,H,el]);let[eg,ep]=(0,o.useState)(""),[ew,eb]=(0,o.useState)("ALL"),[ek,ex]=(0,o.useState)({}),[ey,ej]=(0,o.useState)(!1),[eC,eM]=(0,o.useState)([]),[eN,eD]=(0,o.useState)(!1),[eA,eP]=(0,o.useState)(!1);(0,o.useEffect)(()=>{eM([]),eD(!1)},[ed]),(0,o.useEffect)(()=>{if(!ey||eN)return;if(!ed.length)return void eD(!0);let e=!1;return eP(!0),Promise.all(ed.map(e=>H.query({query:N,variables:{collectionId:e.id},fetchPolicy:"cache-first"}))).then(l=>{e||(eM(l.flatMap((e,l)=>{var n,t,o;let a=ed[l];return(null!=(o=null==(t=e.data)||null==(n=t.collection)?void 0:n.memos)?o:[]).filter(e=>e.blocked).map(e=>{var l,n;return{rowKind:"blocked",id:"blocked-".concat(a.id,"-").concat(e.date),blockedDate:e.date,notes:e.notes,collection:{id:null!=(l=a.id)?l:"",title:null!=(n=a.title)?n:""}}})})),eD(!0),eP(!1))}),()=>{e=!0}},[ey,eN,ed,H]),(0,o.useEffect)(()=>{eb("ALL"),ep(""),ex({}),ej(!1)},[es]),(0,o.useEffect)(()=>{ex({})},[q]);let eI=(0,o.useMemo)(()=>{let e=eg.trim().toLowerCase(),l=eg.replace(/\D/g,""),n=ek.from?new Date(ek.from):null,t=ek.to?new Date("".concat(ek.to,"T23:59:59")):null,o=new Date,a=e=>(0,c.Y)((0,s.W)(e,{days:1}),o);return[...em.map(e=>({...e,rowKind:"booking"})).filter(o=>{var r,i,c,s,d,u,m,v,f,h,g,p,w,b;let k=!!o.cancelledAt,x=(null==(r=o.place)?void 0:r.checkInAt)?new Date(o.place.checkInAt):null,y=!!x&&a(x);if("INCOMMING"===q){if(k||!x||y)return!1}else if("COMPLETED"===q){if(k||!x||!y)return!1}else if("CANCELED"===q&&!k)return!1;if("ALL"!==ew&&(null==(i=o.collection)?void 0:i.id)!==ew)return!1;if(e){let n=(null!=(h=null!=(f=null==(c=o.invoiceUser)?void 0:c.name)?f:null==(s=o.user)?void 0:s.name)?h:"").toLowerCase(),t=(null!=(p=null!=(g=null==(d=o.invoiceUser)?void 0:d.email)?g:null==(u=o.user)?void 0:u.email)?p:"").toLowerCase(),a=(null!=(b=null!=(w=null==(m=o.invoiceUser)?void 0:m.phone)?w:null==(v=o.user)?void 0:v.phone)?b:"").replace(/\D/g,"");if(!(n.includes(e)||t.includes(e)||l.length>0&&a.includes(l)))return!1}return(!n&&!t||!!x&&(!n||!(x<n))&&(!t||!(x>t)))&&!0}),...ey?eC.filter(l=>{if("CANCELED"===q||e)return!1;let o=new Date(l.blockedDate),r=a(o);return("INCOMMING"!==q||!r)&&("COMPLETED"!==q||!!r)&&("ALL"===ew||l.collection.id===ew)&&(!n||!(o<n))&&(!t||!(o>t))}):[]]},[em,eC,ey,eg,ew,ek,q]),eE="ALL"===q,eL="INCOMMING"===q,eS=(0,r.FB)(),eO=(0,o.useMemo)(()=>{let e=[eS.accessor(e=>{var l;return"blocked"===e.rowKind?e.blockedDate:null==e||null==(l=e.place)?void 0:l.checkInAt},{id:"checkIn",cell:e=>{let l=e.row.original,n=e.getValue();return n?"blocked"===l.rowKind?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.v,{variant:"neutral/300",leftIcon:(0,t.jsx)(_.Bold16Lock,{}),children:X("account-bookings-overview:columns.status.cell.blocked")}),(0,t.jsx)("span",{children:(0,d.GP)(new Date(n),"PP",{locale:Z})})]}):"".concat((0,d.GP)(new Date(n),"PP",{locale:Z})," ").concat(X("account-orders:cancel.description.at-time")," ").concat((0,d.GP)(new Date(n),"HH:mm")):"—"},header:()=>(0,t.jsx)("span",{children:X("account-bookings-overview:columns.check-in.header")}),sortingFn:(e,l)=>ei(e.original)>ei(l.original)?1:-1}),eS.accessor(e=>{var l;return"blocked"===e.rowKind?null:null==e||null==(l=e.place)?void 0:l.checkOutAt},{id:"checkOut",cell:e=>{let l=e.getValue();return l?"".concat((0,d.GP)(new Date(l),"PP",{locale:Z})," ").concat(X("account-orders:cancel.description.at-time")," ").concat((0,d.GP)(new Date(l),"HH:mm")):"—"},header:()=>(0,t.jsx)("span",{children:X("account-bookings-overview:columns.check-out.header")}),sortingFn:(e,l)=>{var n,t,o,a;return("blocked"!==e.original.rowKind&&(null==(t=e.original)||null==(n=t.place)?void 0:n.checkOutAt)?new Date(e.original.place.checkOutAt).getTime():0)>("blocked"!==l.original.rowKind&&(null==(a=l.original)||null==(o=a.place)?void 0:o.checkOutAt)?new Date(l.original.place.checkOutAt).getTime():0)?1:-1}}),eS.accessor(e=>{var l,n,t,o;return"blocked"===e.rowKind?null!=(t=e.notes)?t:null:null!=(o=null==e||null==(l=e.invoiceUser)?void 0:l.name)?o:null==e||null==(n=e.user)?void 0:n.name},{id:"name",cell:e=>{var l;return(0,t.jsx)("span",{children:null!=(l=e.getValue())?l:"—"})},header:()=>(0,t.jsx)("span",{children:X("account-bookings-overview:columns.name.header")}),sortingFn:(e,l)=>{var n,t,o,a,r,i,c,s,d,u,m,v,f,h;return("blocked"===e.original.rowKind?null!=(d=e.original.notes)?d:"":null!=(m=null!=(u=null==(t=e.original)||null==(n=t.invoiceUser)?void 0:n.name)?u:null==(a=e.original)||null==(o=a.user)?void 0:o.name)?m:"")>("blocked"===l.original.rowKind?null!=(v=l.original.notes)?v:"":null!=(h=null!=(f=null==(i=l.original)||null==(r=i.invoiceUser)?void 0:r.name)?f:null==(s=l.original)||null==(c=s.user)?void 0:c.name)?h:"")?-1:1}}),eS.accessor(e=>{var l,n,t;return"blocked"===e.rowKind?null:null!=(t=null==e||null==(l=e.invoiceUser)?void 0:l.phone)?t:null==e||null==(n=e.user)?void 0:n.phone},{id:"phone",cell:e=>{let l=e.getValue();return(0,t.jsx)("span",{children:l?eo(l):"—"})},header:()=>(0,t.jsx)("span",{children:X("account-bookings-overview:columns.phone.header")})}),eS.accessor(e=>{var l,n,t;return"blocked"===e.rowKind?null:null!=(t=null==e||null==(l=e.invoiceUser)?void 0:l.email)?t:null==e||null==(n=e.user)?void 0:n.email},{id:"email",cell:e=>{var l;return(0,t.jsx)("span",{children:null!=(l=e.getValue())?l:"—"})},header:()=>(0,t.jsx)("span",{children:X("account-bookings-overview:columns.email.header")})}),eS.accessor(e=>"blocked"===e.rowKind?null:null==e?void 0:e.createdAt,{id:"bookingReceived",cell:e=>{let l=e.getValue();return l?(0,d.GP)(new Date(l),"PP",{locale:Z}):"—"},header:()=>(0,t.jsx)("span",{children:X("account-bookings-overview:columns.booking-received.header")}),sortingFn:(e,l)=>{var n,t;return("blocked"!==e.original.rowKind&&(null==(n=e.original)?void 0:n.createdAt)?new Date(e.original.createdAt).getTime():0)>("blocked"!==l.original.rowKind&&(null==(t=l.original)?void 0:t.createdAt)?new Date(l.original.createdAt).getTime():0)?1:-1}})];return"INCOMMING"!==q&&"CANCELED"!==q&&e.splice(3,0,eS.accessor(e=>{var l,n;return+(null!=e&&null!=(n=e.reviews)&&null!=(l=n[0])&&!!l.supplierReply)},{id:"review",cell:e=>{var l,n,o,a;let r=null==(n=e.row.original)||null==(l=n.reviews)?void 0:l[0];if(!r)return null;let i=null==(a=e.row.original)||null==(o=a.collection)?void 0:o.title;return(0,t.jsx)(ea.Y,{review:r,onClick:()=>{Y(r),Q(i)}})},header:()=>(0,t.jsx)("span",{children:X("review:indicator.has-review")})})),eu&&e.push(eS.accessor(e=>{var l;return null==e||null==(l=e.collection)?void 0:l.title},{id:"collection",cell:e=>{var l;return(0,t.jsx)("span",{children:null!=(l=e.getValue())?l:"—"})},header:()=>(0,t.jsx)("span",{children:X("account-bookings-overview:columns.collection.header")})})),eE&&e.push(eS.accessor(e=>"blocked"===e.rowKind?"blocked":!!(null==e?void 0:e.cancelledAt),{id:"status",header:()=>X("account-bookings-overview:columns.status.header"),cell:e=>{let l=e.row.original;return"blocked"===l.rowKind?(0,t.jsx)("span",{className:"font-bold",children:X("account-bookings-overview:columns.status.cell.blocked")}):(0,t.jsx)("span",{className:"font-bold",children:(null==l?void 0:l.cancelledAt)?X("account-bookings-overview:columns.status.cell.cancelled"):X("account-bookings-overview:columns.status.cell.active")})}})),e},[Z,X,eu,eE,q]),[eG,eR]=(0,o.useState)([{id:"checkIn",desc:!1}]),e_=(0,i.N4)({data:eI,state:{sorting:eG},onSortingChange:eR,columns:eO,getFilteredRowModel:(0,r.hM)(),getCoreRowModel:(0,r.HT)(),getSortedRowModel:(0,r.h5)(),getPaginationRowModel:(0,r.kW)()});(0,o.useEffect)(()=>{eI.length>0&&e_.setPageSize(eI.length)},[eI,e_]),(0,o.useEffect)(()=>{"INCOMMING"===q?eR([{id:"checkIn",desc:!1}]):eR([{id:"checkIn",desc:!0}])},[q]);let eK=e=>{z(e)},eF=null!=(j=null==(n=ed[0])?void 0:n.title)?j:"place",e$=(0,o.useMemo)(()=>{let e=[{key:"checkIn",label:X("account-bookings-overview:columns.check-in.header")},{key:"checkOut",label:X("account-bookings-overview:columns.check-out.header")},{key:"name",label:X("account-bookings-overview:columns.name.header")},{key:"phone",label:X("account-bookings-overview:columns.phone.header")},{key:"email",label:X("account-bookings-overview:columns.email.header")},{key:"bookingReceived",label:X("account-bookings-overview:columns.booking-received.header")}];return eu&&e.push({key:"collection",label:X("account-bookings-overview:columns.collection.header")}),eE&&e.push({key:"status",label:X("account-bookings-overview:columns.status.header")}),e},[X,eu,eE]),eU=async e=>{let l=(()=>{let e=e=>{if(!e)return"";let l=new Date(e);return"".concat((0,d.GP)(l,"PP",{locale:Z})," ").concat(X("account-orders:cancel.description.at-time")," ").concat((0,d.GP)(l,"HH:mm"))},l=e=>e?(0,d.GP)(new Date(e),"PP",{locale:Z}):"",n=X("account-bookings-overview:columns.status.cell.blocked");return e_.getRowModel().rows.map(t=>{var o,a,r,i,c,s,d,u,m,v,f,h,g,p,w,b,k;let x=t.original;if("blocked"===x.rowKind)return{name:x.notes?"".concat(n," – ").concat(x.notes):n,phone:"",email:"",checkIn:l(x.blockedDate),checkOut:"",bookingReceived:"",collection:null!=(v=x.collection.title)?v:"",status:n};let y=!!(null==x?void 0:x.cancelledAt);return{name:null!=(h=null!=(f=null==x||null==(o=x.invoiceUser)?void 0:o.name)?f:null==x||null==(a=x.user)?void 0:a.name)?h:"",phone:eo(null!=(p=null!=(g=null==x||null==(r=x.invoiceUser)?void 0:r.phone)?g
1:null==x||null==(i=x.user)?void 0:i.phone)?p:""),email:null!=(b=null!=(w=null==x||null==(c=x.invoiceUser)?void 0:c.email)?w:null==x||null==(s=x.user)?void 0:s.email)?b:"",checkIn:e(null==x||null==(d=x.place)?void 0:d.checkInAt),checkOut:e(null==x||null==(u=x.place)?void 0:u.checkOutAt),bookingReceived:l(null==x?void 0:x.createdAt),collection:null!=(k=null==x||null==(m=x.collection)?void 0:m.title)?k:"",status:y?X("account-bookings-overview:columns.status.cell.cancelled"):X("account-bookings-overview:columns.status.cell.active")}})})(),n=(()=>{let e=eF.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,"").replace(/[æÆ]/g,"ae").replace(/[øØ]/g,"o").replace(/[åÅ]/g,"a").replace(/[^a-z0-9-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60),l=(0,d.GP)(new Date,"yyyy-MM-dd");return"bookings-".concat(e,"-").concat(l)})(),t="".concat(X("account-bookings-overview:header")," – ").concat(eF);"csv"===e?function(e,l,n){let t=new Blob(["\uFEFF"+[l.map(e=>K(e.label)).join(","),...e.map(e=>l.map(l=>{var n;return K(null!=(n=e[l.key])?n:"")}).join(","))].join("\r\n")],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(t),a=document.createElement("a");a.href=o,a.download="".concat(n,".csv"),document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o)}(l,e$,n):"excel"===e?await F(l,e$,n):await $(l,e$,n,t)};if(W||!U&&!T)return(0,t.jsx)(G.R,{});let eT=el||ef||eA;return(0,t.jsxs)(E.O,{title:X("account-bookings-overview:header"),wideContent:!0,customHeader:(0,t.jsx)(v.Y9,{desktop:{withSubMenuAccountLinks:!1,withSearch:!1,centerNode:(0,t.jsx)(L.vo,{activeItem:"HOME"})},mobile:{withSearch:!1}}),titleRightComponent:(0,t.jsx)("div",{className:"relative flex w-full max-w-[40rem] flex-col items-start max-md:mt-4 md:ml-auto md:w-auto",children:(0,t.jsx)("div",{className:"flex w-full flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between md:w-auto md:justify-end",children:(0,t.jsxs)(w.rI,{modal:!1,children:[(0,t.jsx)(w.ty,{asChild:!0,children:(0,t.jsx)(f.$,{theme:"black",size:"md",rightIcon:(0,t.jsx)(_.Regular12Caret,{className:"w-3 fill-white transition-transform [[aria-expanded=true]_&]:scale-y-[-1]"}),children:X("account-bookings-overview:export.button")})}),(0,t.jsxs)(w.SQ,{align:"end",onCloseAutoFocus:e=>e.preventDefault(),className:"min-w-[12rem]",children:[(0,t.jsx)(w._2,{onSelect:()=>eU("excel"),className:"px-3 py-2",children:X("account-bookings-overview:export.excel")}),(0,t.jsx)(w._2,{onSelect:()=>eU("csv"),className:"px-3 py-2",children:X("account-bookings-overview:export.csv")}),(0,t.jsx)(w._2,{onSelect:()=>eU("pdf"),className:"px-3 py-2",children:X("account-bookings-overview:export.pdf")})]})]})})}),children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-3 flex gap-6 border-b-[0.0625rem] border-solid border-neutral-300",children:[(0,t.jsx)(S.L,{header:X("account-bookings-overview:filters.incomming"),onClick:()=>eK("INCOMMING"),active:"INCOMMING"===q}),(0,t.jsx)(S.L,{header:X("account-bookings-overview:filters.completed"),onClick:()=>eK("COMPLETED"),active:"COMPLETED"===q}),(0,t.jsx)(S.L,{header:X("account-bookings-overview:filters.declined"),onClick:()=>eK("CANCELED"),active:"CANCELED"===q}),(0,t.jsx)(S.L,{header:X("account-bookings-overview:filters.all"),onClick:()=>eK("ALL"),active:"ALL"===q})]}),(0,t.jsxs)("div",{className:"mb-4 flex flex-col gap-3 md:flex-row md:items-center md:flex-wrap",children:[(0,t.jsx)("div",{className:"md:max-w-sm md:flex-1",children:(0,t.jsx)(h.p,{placeholder:X("account-bookings-overview:filters.search-placeholder"),startEnhancer:(0,t.jsx)(_.Regular20Search,{}),value:eg,onChange:e=>ep(e.target.value)})}),eu&&(0,t.jsx)("div",{className:"md:w-56",children:(0,t.jsxs)(b.l6,{value:ew,onValueChange:e=>eb(e),children:[(0,t.jsx)(b.bq,{className:"w-full",children:(0,t.jsx)(b.yv,{})}),(0,t.jsxs)(b.gC,{children:[(0,t.jsx)(b.eb,{value:"ALL",children:X("account-bookings-overview:filters.collection-all")}),ed.map(e=>{var l;return(0,t.jsx)(b.eb,{value:null!=(l=e.id)?l:"",children:e.title},e.id)})]})]})}),(0,t.jsx)("div",{children:(0,t.jsx)(en,{value:ek,onDateChange:e=>{ex({from:(null==e?void 0:e.from)?(0,d.GP)(e.from,"yyyy-MM-dd"):void 0,to:(null==e?void 0:e.to)?(0,d.GP)(e.to,"yyyy-MM-dd"):void 0})},mode:eL?"future":"past"})}),"CANCELED"!==q&&(0,t.jsx)("div",{className:"md:ml-auto",children:(0,t.jsx)(p.Sc,{isSelected:ey,onChange:ej,children:X("account-bookings-overview:filters.show-blocked")})})]}),(0,t.jsxs)("div",{className:"overflow-x-auto rounded-lg",children:[(0,t.jsxs)("table",{className:"min-w-full border-collapse overflow-hidden whitespace-nowrap rounded-lg",children:[(0,t.jsx)("thead",{children:e_.getHeaderGroups().map(e=>(0,t.jsx)("tr",{children:e.headers.map(e=>{var l,n;return(0,t.jsxs)("th",{className:"cursor-not-allowed border-b-[0.0625rem] border-solid border-neutral-300 p-[1rem] text-left font-bold leading-5 ".concat(null!=(l=ec[e.column.id])?l:""),children:[(0,i.Kv)(e.column.columnDef.header,e.getContext()),null!=(n=({asc:(0,t.jsx)(_.Regular16Arrow,{className:"ml-2 inline-block"}),desc:(0,t.jsx)(_.Regular16Arrow,{className:"ml-2 inline-block rotate-[180deg] transform"})})[e.column.getIsSorted()])?n:null]},e.id)})},e.id))}),(0,t.jsx)("tbody",{children:!eT&&(null==e_||null==(x=e_.getRowModel())||null==(k=x.rows)?void 0:k.map(e=>(0,t.jsx)("tr",{onClick:()=>{var l;let n=e.original;if("blocked"===n.rowKind){let e=(0,d.GP)(new Date(n.blockedDate),"yyyy-MM-dd");window.open("/account/supplier/".concat(es,"/calendar/").concat((0,d.GP)(new Date(n.blockedDate),"yyyy-MM"),"?date=").concat(e),"_blank");return}let t=null==(l=n.collection)?void 0:l.id;t&&window.open("/account/places/".concat(t,"/bookings/").concat(n.id),"_blank")},className:"cursor-pointer hover:bg-neutral-100 ".concat("blocked"===e.original.rowKind?"bg-neutral-100":""),children:e.getVisibleCells().map(e=>{var l;return(0,t.jsx)("td",{className:"align-center border-b-[0.0625rem] border-solid border-neutral-300 p-[1rem] ".concat(null!=(l=ec[e.column.id])?l:""),children:(0,i.Kv)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)))})]}),eT&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"m-auto mt-12 flex w-12 items-center justify-center",children:(0,t.jsx)(R.y$,{})}),(0,t.jsx)("div",{className:"min-h-[20vh]"})]})]})]}),(0,t.jsx)(er.q,{open:!!B,onClose:()=>{Y(null),Q(void 0)},review:B,mode:"supplier",supplierName:J,onReplyUpdated:e=>Y(l=>l?{...l,supplierReply:e.supplierReply,supplierReplyAt:e.supplierReplyAt}:l)})]})};var ed=!0},82709:(e,l,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/orders-place-supplier",function(){return n(21256)}])}},e=>{e.O(0,[4287,7050,4248,7459,9914,9381,7264,8231,3337,4064,2715,636,6593,8792],()=>e(e.s=82709)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.