const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/client-D7qhFv0L.js","assets/index-Ef5HIHwv.js","assets/index-DYNK1iNk.css"])))=>i.map(i=>d[i]);
import{V as or,ah as qi,ai as eo,aj as mi,ak as Fi,al as jr,am as Ko,an as $i,ao as Qo,ap as Zo,aq as Wo,ar as Hi,l as Mi,as as ui,c as Ve,at as Ii,r as P,j as e,S as zi,f as ce,i as oe,N as Tr,e as Je,au as Le,a1 as ze,av as Xe,aw as dr,ax as Ie,q as mr,ac as Pr,ae as Cr,af as kr,ag as _r,a3 as nr,ay as ci,Z as Er,C as ae,d as ne,az as Lr,_ as ao,aA as Ki,$ as De,B as G,X as bi,aB as no,aC as lr,aD as Qi,u as di,H as $e,aE as ro,aF as gi,M as gr,aG as oo,U as lo,aH as Zi,aI as Wi,t as Rr,aa as Or,aJ as vr,a2 as mo,aK as Ae,aL as Ji,F as Xi,aM as es,n as rs,aN as os,v as pr,aO as is,aP as ss,aQ as ts,aR as uo,aS as as,a4 as pi,a5 as Si,a6 as yi,a7 as Di,a8 as ur,aT as co,a9 as io,a0 as Vr,aU as ns,aV as ls,aW as ms,aX as us,aY as cs,aZ as bs,a_ as ds,a$ as gs,h as ps,b0 as Ss,b1 as ys,b2 as Ds,a as Ns,b3 as hs,b4 as xs,b5 as vs,b6 as fs,b7 as Es,b8 as Os,g as Jo,E as Wr,b9 as Ps,ba as Cs,bb as ks,bc as _s,bd as As,be as Us}from"./index-Ef5HIHwv.js";import{T as Gr,a as Yr,b as Ce,c as ke}from"./tabs-CqJ-vF-U.js";import{T as Ke}from"./textarea-DI4Rh5ZE.js";import{a as js,b as Ls,D as Vs,c as Gs,d as Ys}from"./useSupportTickets-BaZS6Y9K.js";import{N as Jr,S as Xo}from"./statusConfig-D4gh5ibz.js";import{T as Bs}from"./timer-CmzQdvKV.js";import{F as Xr,H as ei,C as ws,a as Ts,T as Rs,b as qs,P as Fs,c as $s,E as Hs}from"./EmailCustomerDialog-hfDTAiYu.js";import{S as ar,P as ri}from"./square-pen-BWM0P-fi.js";import{K as Ms}from"./key-BIJdIhPD.js";import{A as Br}from"./EmailLivePreview-BVCmMA0B.js";import{P as Is}from"./paperclip-D8gnDdf4.js";import{C as oi}from"./circle-plus-BZE0a09n.js";import{F as fr,a as zs,M as Ks,S as Qs}from"./MySqlEmailInbox-HkxmLYeu.js";import{S as wr}from"./save-CPclD06J.js";import{C as Ni}from"./checkbox-BVivpJ34.js";import{p as Zs,H as so,B as Ws}from"./parseISO-CdvFKCuZ.js";import{S as Js}from"./star-BJeP7_T0.js";import{R as Xs}from"./rotate-ccw-CLaV0eKC.js";import{M as et}from"./message-circle-Bk7FQ7TJ.js";import{S as rt}from"./switch-rB53P3uH.js";import{E as ot}from"./EmailComposePanel-CJQwBVRG.js";import"./index-5CRimzhx.js";import"./eye-eVxIYKEU.js";import"./pencil-DayKovnD.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const it=or("Accessibility",[["circle",{cx:"16",cy:"4",r:"1",key:"1grugj"}],["path",{d:"m18 19 1-7-6 1",key:"r0i19z"}],["path",{d:"m5 8 3-3 5.5 3-2.36 3.5",key:"9ptxx2"}],["path",{d:"M4.24 14.5a5 5 0 0 0 6.88 6",key:"10kmtu"}],["path",{d:"M13.76 17.5a5 5 0 0 0-6.88-6",key:"2qq6rc"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const st=or("Baby",[["path",{d:"M9 12h.01",key:"157uk2"}],["path",{d:"M15 12h.01",key:"1k8ypt"}],["path",{d:"M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5",key:"1u7htd"}],["path",{d:"M19 6.3a9 9 0 0 1 1.8 3.9 2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1",key:"5yv0yz"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tt=or("BedDouble",[["path",{d:"M2 20v-8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8",key:"1k78r4"}],["path",{d:"M4 10V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4",key:"fb3tl2"}],["path",{d:"M12 4v6",key:"1dcgq2"}],["path",{d:"M2 18h20",key:"ajqnye"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const at=or("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nt=or("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lt=or("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mt=or("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ut=or("Utensils",[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]]);function ct(r,o,s){const a=qi(r,o)/eo;return mi(s==null?void 0:s.roundingMethod)(a)}function bt(r,o,s){const a=Hi(),t=(s==null?void 0:s.locale)??a.locale??$i,i=Fi(r,o);if(isNaN(i))throw new RangeError("Invalid time value");const u=Object.assign({},s,{addSuffix:s==null?void 0:s.addSuffix,comparison:i});let c,g;i>0?(c=jr(o),g=jr(r)):(c=jr(r),g=jr(o));const n=mi("round"),y=g.getTime()-c.getTime(),p=y/eo,S=Ko(g)-Ko(c),h=(y-S)/eo,C=s==null?void 0:s.unit;let x;if(p<1?x="second":p<60?x="minute":p<Qo?x="hour":h<Zo?x="day":h<Wo?x="month":x="year",x==="second"){const N=n(y/1e3);return t.formatDistance("xSeconds",N,u)}else if(x==="minute"){const N=n(p);return t.formatDistance("xMinutes",N,u)}else if(x==="hour"){const N=n(p/60);return t.formatDistance("xHours",N,u)}else if(x==="day"){const N=n(h/Qo);return t.formatDistance("xDays",N,u)}else if(x==="month"){const N=n(h/Zo);return N===12&&C!=="month"?t.formatDistance("xYears",1,u):t.formatDistance("xMonths",N,u)}else{const N=n(h/Wo);return t.formatDistance("xYears",N,u)}}function ii(r,o){return bt(r,Mi(r),o)}function hi(){const{canUseSupplierAdmin:r}=ui(),{data:o=[],isLoading:s}=Ve({queryKey:["suppliers-local"],queryFn:()=>Ii(),enabled:r,staleTime:6e4,refetchOnWindowFocus:!1}),a={};for(const n of o){const y=!!n.merged_into_id,p=n.merged_into_name||n.name||n.code||"",S={source_id:n.code||n.id,supplier_name:p,supplier_email:n.resolved_primary_email||n.primary_email||"",supplier_phone:n.resolved_primary_phone||n.primary_phone||"",api_endpoint:null,supplier_id:n.id||n.code||"",api_key:null,is_linked_variant:y};n.code&&(a[n.code]=S),n.id&&(a[n.id]=S)}const t=n=>n&&a[n]||null;return{supplierMappings:a,loading:s,getSupplierBySourceId:t,getProviderName:n=>{const y=t(n);return(y==null?void 0:y.supplier_name)||n||"N/A"},extractSourceIdFromBooking:n=>null,extractBkRefFromBooking:n=>null,extractRoomNameFromBooking:n=>null,refreshMappings:()=>{}}}const dt={open:"bg-yellow-400",assigned:"bg-purple-500",in_progress:"bg-blue-500",pending_supplier:"bg-orange-500",escalated:"bg-red-500",pending_app_review:"bg-amber-500",pending_app_response_review:"bg-indigo-500",resolved:"bg-emerald-500",closed:"bg-gray-400",rejected:"bg-red-400"},gt=[{key:"active",label:"Active"},{key:"all",label:"All"},{key:"resolved",label:"Resolved"}];function pt({type:r,className:o="h-3 w-3"}){return r==="hotel"?e.jsxDEV(Le,{className:o},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:47,columnNumber:35},this):r==="flight"?e.jsxDEV(ze,{className:o},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:48,columnNumber:35},this):r==="transfer"?e.jsxDEV(Xe,{className:o},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:49,columnNumber:35},this):r==="tour"?e.jsxDEV(dr,{className:o},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:50,columnNumber:35},this):e.jsxDEV(Ie,{className:o},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:51,columnNumber:10},this)}function St(r){if(!r)return null;const o=new Date(r);if(Number.isNaN(o.getTime()))return null;const s=ct(o,new Date);let a="normal";s<0?a="expired":s<60?a="critical":s<60*24&&(a="soon");const t={expired:"text-red-700 bg-red-50 border-red-200",critical:"text-red-700 bg-red-50 border-red-200",soon:"text-amber-700 bg-amber-50 border-amber-200",normal:"text-gray-600 bg-gray-50 border-gray-200"}[a],i=s<0?`${ii(o)} ago`:`in ${ii(o)}`;return{tone:a,toneClass:t,label:i,mins:s}}function yt({requests:r,selectedId:o,onSelect:s}){const[a,t]=P.useState("active"),[i,u]=P.useState(""),c=P.useMemo(()=>{const n=r.filter(y=>Jr.includes(y.status)).length;return{active:n,all:r.length,resolved:r.length-n}},[r]),g=P.useMemo(()=>{const n=i.trim().toLowerCase();return r.filter(y=>{var p;return!(a==="active"&&!Jr.includes(y.status)||a==="resolved"&&Jr.includes(y.status)||n&&![y.request_number||"",y.request_title||"",y.request_type||"",y.product_type||"",((p=y.booking_details)==null?void 0:p.hotel_name)||""].join(" ").toLowerCase().includes(n))})},[r,a,i]);return r.length===0?null:e.jsxDEV("div",{className:"flex flex-col gap-2",children:[e.jsxDEV("div",{className:"relative",children:[e.jsxDEV(zi,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:120,columnNumber:9},this),e.jsxDEV(ce,{value:i,onChange:n=>u(n.target.value),placeholder:"Search tickets...",className:"pl-8 h-8 text-xs"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:121,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:119,columnNumber:7},this),e.jsxDEV("div",{className:"flex items-center gap-1 text-xs",children:gt.map(n=>{const y=a===n.key;return e.jsxDEV("button",{onClick:()=>t(n.key),className:`px-2.5 py-1 rounded-md font-medium transition-colors ${y?"bg-orange-100 text-orange-700":"text-gray-600 hover:bg-gray-100"}`,children:[n.label,e.jsxDEV("span",{className:`ml-1.5 text-[10px] ${y?"text-orange-600":"text-gray-400"}`,children:c[n.key]},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:144,columnNumber:15},this)]},n.key,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:134,columnNumber:13},this)})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:130,columnNumber:7},this),e.jsxDEV("div",{className:"flex flex-col gap-1.5 overflow-y-auto max-h-[calc(100vh-220px)] -mr-1 pr-1",children:g.length===0?e.jsxDEV("div",{className:"text-xs text-gray-400 text-center py-8 italic",children:"No tickets match this filter"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:155,columnNumber:11},this):g.map(n=>{var N,f,D;const y=o===n.id,p=dt[n.status]||"bg-gray-400",S=St(n.deadline),C=[n.product_type?n.product_type.charAt(0).toUpperCase()+n.product_type.slice(1):"Booking"],x=(N=n.booking_details)==null?void 0:N.hotel_name;return x&&C.push(x),e.jsxDEV("button",{type:"button",onClick:()=>s(n.id),className:`group relative flex flex-col gap-1 text-left rounded-md border transition-colors ${y?"border-orange-300 bg-orange-50/60 ring-1 ring-orange-200":"border-gray-200 bg-white hover:bg-gray-50"} pl-3 pr-2 py-2`,children:[e.jsxDEV("span",{className:`absolute left-0 top-0 bottom-0 w-1 rounded-l-md ${p}`,"aria-hidden":!0},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:183,columnNumber:17},this),e.jsxDEV("div",{className:"flex items-center justify-between gap-2",children:[e.jsxDEV("span",{className:"font-mono text-[11px] text-gray-500 tracking-wide truncate",children:n.request_number||"—"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:187,columnNumber:19},this),e.jsxDEV(oe,{className:`text-[9px] px-1.5 py-0 leading-4 ${((f=Xo[n.status])==null?void 0:f.color)||"bg-gray-100 text-gray-700"}`,children:((D=Xo[n.status])==null?void 0:D.label)||n.status},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:190,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:186,columnNumber:17},this),e.jsxDEV("div",{className:"text-sm font-semibold text-gray-900 truncate",title:n.request_title||n.request_type,children:n.request_title||n.request_type||"Untitled request"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:196,columnNumber:17},this),e.jsxDEV("div",{className:"flex items-center gap-1.5 text-[11px] text-gray-500 truncate",children:[e.jsxDEV(pt,{type:n.product_type,className:"h-3 w-3 shrink-0"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:202,columnNumber:19},this),e.jsxDEV("span",{className:"truncate",children:C.join(" · ")},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:203,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:201,columnNumber:17},this),e.jsxDEV("div",{className:"flex items-center justify-between gap-2 text-[10px] text-gray-400 mt-0.5",children:[e.jsxDEV("span",{children:n.created_at?Tr(new Date(n.created_at),"dd MMM HH:mm"):""},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:208,columnNumber:19},this),S&&e.jsxDEV("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md border ${S.toneClass}`,children:[S.tone==="expired"?e.jsxDEV(Je,{className:"h-2.5 w-2.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:213,columnNumber:48},this):e.jsxDEV(Bs,{className:"h-2.5 w-2.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:213,columnNumber:90},this),S.label]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:212,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:207,columnNumber:17},this)]},n.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:171,columnNumber:15},this)})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:153,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestsList.tsx",lineNumber:117,columnNumber:5},this)}const si=[{value:"amend",label:"Amend Booking Details",icon:ar,description:"Change dates, room type, cabin class, etc.",color:"bg-blue-50 border-blue-200 text-blue-700"},{value:"passenger_change",label:"Change Passenger Info",icon:nr,description:"Edit name, passport, nationality, etc.",color:"bg-purple-50 border-purple-200 text-purple-700"},{value:"cancellation",label:"Cancel Booking / Product",icon:ci,description:"Request full or partial cancellation",color:"bg-red-50 border-red-200 text-red-700"},{value:"special_request",label:"Special Request",icon:Er,description:"Custom request or inquiry",color:"bg-green-50 border-green-200 text-green-700"}],Dt={amend:"amendment",passenger_change:"name_change",cancellation:"cancellation",special_request:"other"},ti=[{value:"hcn_request",label:"Hotel Confirmation Number (HCN)",icon:Ms,hint:"Request hotel booking reference"},{value:"early_checkin",label:"Early Check-in / Late Check-out",icon:ao,hint:"Adjust check-in or check-out time"},{value:"room_upgrade",label:"Room Upgrade",icon:tt,hint:"Request a room upgrade"},{value:"meal_plan",label:"Meal Plan / Board Basis",icon:ut,hint:"Add or change meal plan"},{value:"extra_bed",label:"Extra Bed / Crib",icon:st,hint:"Add extra bed or baby crib"},{value:"accessibility",label:"Accessibility / Special Needs",icon:it,hint:"Wheelchair access, ground floor, etc."},{value:"transfer",label:"Airport Transfer",icon:Xe,hint:"Arrange pickup/drop-off"},{value:"honeymoon",label:"Honeymoon / Anniversary",icon:lt,hint:"Special occasion arrangements"},{value:"visa_letter",label:"Visa Support Letter",icon:Ki,hint:"Request visa invitation letter"},{value:"other",label:"Other Request",icon:at,hint:"Anything else not listed"}];function xi({isOpen:r,onClose:o,bookingCode:s,bookingData:a,initialActionType:t,initialScope:i}){const{toast:u}=mr(),c=js(),g=Ls(),n=P.useRef(null),[y,p]=P.useState(1),[S,h]=P.useState(""),[C,x]=P.useState([]),[N,f]=P.useState([]),[D,V]=P.useState([]),[z,K]=P.useState(""),[v,_]=P.useState([]),w=C[0]||"",k=N[0]??null,F=b=>x(b?[b]:[]),B=b=>f(b!==null?[b]:[]),be=b=>{x(d=>d.includes(b)?d.filter(me=>me!==b):[...d,b])},te=b=>{f(d=>d.includes(b)?d.filter(me=>me!==b):[...d,b])},le=(a==null?void 0:a.products)||[],W=(a==null?void 0:a.passengers)||[],L=(a==null?void 0:a.contact)||{};P.useEffect(()=>{r&&(V([]),K(""),_([]),t?(h(t),i?(F(i),t==="passenger_change"&&!isNaN(Number(i))&&B(Number(i)),p(3)):(F(""),B(null),p(2))):(p(1),h(""),F(""),B(null)))},[r]);const Ne=b=>{const d=Array.from(b.target.files||[]);_(me=>[...me,...d]),n.current&&(n.current.value="")},U=b=>_(d=>d.filter((me,se)=>se!==b)),he=()=>{if(S==="passenger_change"&&k!==null){const b=W[k]||{};return{title:b.title||"",first_name:b.first_name||"",last_name:b.last_name||"",date_of_birth:b.date_of_birth||"",country_code:b.country_code||"",document_id:b.document_id||"",document_expiry:b.document_expiry||"",document_country:b.document_country||""}}if(S==="amend"&&w){const b=le.find(me=>me.id===w),d=(b==null?void 0:b.details)||{};if((b==null?void 0:b.type)==="hotel"||(b==null?void 0:b.type)==="stopover")return{check_in:d.check_in||"",check_out:d.check_out||"",room_name:d.room_name||"",board_basis:d.board_basis||"",special_requests:d.special_requests||""};if((b==null?void 0:b.type)==="flight")return{departure_date:d.departure_date||"",cabin_class:d.cabin_class||"",baggage:d.baggage||"",seat_preference:d.seat_preference||""};if((b==null?void 0:b.type)==="transfer")return{transfer_date:d.transfer_date||"",transfer_time:d.transfer_time||"",pickup_location:d.pickup_location||"",dropoff_location:d.dropoff_location||"",vehicle_type:d.vehicle_type||"",meeting_point:d.meeting_point||"",special_requests:d.special_requests||""};if((b==null?void 0:b.type)==="tour")return{tour_date:d.tour_date||"",duration:d.duration||"",language:d.language||"",meeting_point:d.meeting_point||"",special_requests:d.special_requests||""};if(w==="contact")return{contact_name:`${L.first_name||""} ${L.last_name||""}`.trim(),contact_email:L.email||"",contact_phone:L.phone||L.phone_number||""}}return{}},T=async()=>{var b;if(S!=="cancellation"&&S!=="special_request"&&D.length===0&&!z.trim()){u({variant:"destructive",title:"Please make at least one change or add a message"});return}try{const d=Dt[S]||"other",me=Vs[d]||48,se=new Date;se.setHours(se.getHours()+me);const Z=w?le.find(ee=>ee.id===w):null,J=S==="special_request"?ti.find(ee=>ee.value===w):null,j=(J==null?void 0:J.label)||((b=si.find(ee=>ee.value===S))==null?void 0:b.label)||S,H={booking_code:s||"",booking_id:s,company_name:(a==null?void 0:a.company_name)||"",supplier_name:(a==null?void 0:a.supplier_name)||"",product_id:(Z==null?void 0:Z.id)||null,product_type:(Z==null?void 0:Z.type)||null,request_type:d,request_title:j,change_type:S,field_changes:D,message:z||`${j} request`,status:"open",deadline:se.toISOString(),currency:(a==null?void 0:a.currency)||"USD",passenger_details:W,booking_details:(Z==null?void 0:Z.details)||(a==null?void 0:a.booking_details)||null,attached_documents:[]},ie=await c.mutateAsync(H);if(ie!=null&&ie.pending_approval){u({title:"Sent for approval",description:"A team leader or admin must approve this ticket before it is created."}),o();return}if(v.length>0&&(ie!=null&&ie.id)){const ee=[];for(const Pe of v)try{const fe=await g.mutateAsync({file:Pe,requestId:ie.id,folder:"creation"});ee.push(fe)}catch(fe){console.warn("Upload failed:",fe)}if(ee.length>0){const{supabase:Pe}=await Qi(async()=>{const{supabase:fe}=await import("./client-D7qhFv0L.js");return{supabase:fe}},__vite__mapDeps([0,1,2]));await Pe.from("support_requests").update({attached_documents:ee}).eq("id",ie.id)}}u({title:"Support request created successfully"}),o()}catch(d){u({variant:"destructive",title:"Error",description:d.message})}},Se=()=>y===1?!!S:y===2?S==="special_request"?!!w&&z.trim().length>0:S==="cancellation"?!!w:S==="passenger_change"?N.length>0:S==="amend"?C.length>0:!!w:!0,Q=S==="cancellation"||S==="special_request"?3:4;return e.jsxDEV(Pr,{open:r,onOpenChange:o,children:e.jsxDEV(Cr,{className:"max-w-2xl max-h-[85vh] overflow-y-auto",children:[e.jsxDEV(kr,{children:e.jsxDEV(_r,{className:"flex items-center justify-between",children:[e.jsxDEV("span",{children:"Create Support Request"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:339,columnNumber:13},this),e.jsxDEV("div",{className:"flex items-center gap-1 text-xs text-gray-400",children:[Array.from({length:Q}).map((b,d)=>e.jsxDEV("div",{className:`w-6 h-1 rounded-full ${d+1<=y?"bg-orange-500":"bg-gray-200"}`},d,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:342,columnNumber:17},this)),e.jsxDEV("span",{className:"ml-2",children:["Step ",y,"/",Q]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:344,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:340,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:338,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:337,columnNumber:9},this),y===1&&e.jsxDEV("div",{className:"space-y-3",children:[e.jsxDEV("p",{className:"text-sm text-gray-500",children:"What would you like to do?"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:352,columnNumber:13},this),e.jsxDEV("div",{className:"grid grid-cols-2 gap-3",children:si.map(b=>e.jsxDEV(ae,{className:`cursor-pointer transition-all ${S===b.value?`${b.color} border-2 shadow-sm`:"border hover:shadow-sm"}`,onClick:()=>h(b.value),children:e.jsxDEV(ne,{className:"p-4 flex items-start gap-3",children:[e.jsxDEV(b.icon,{className:"h-5 w-5 mt-0.5 shrink-0"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:365,columnNumber:21},this),e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"font-medium text-sm",children:b.label},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:367,columnNumber:23},this),e.jsxDEV("div",{className:"text-xs text-gray-500 mt-0.5",children:b.description},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:368,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:366,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:364,columnNumber:19},this)},b.value,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:355,columnNumber:17},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:353,columnNumber:13},this),s&&e.jsxDEV("div",{className:"text-xs text-gray-400",children:["Booking: ",e.jsxDEV("span",{className:"font-mono",children:s},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:375,columnNumber:63},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:375,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:351,columnNumber:11},this),y===2&&e.jsxDEV("div",{className:"space-y-3",children:[S==="passenger_change"&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV("p",{className:"text-sm text-gray-500",children:"Select passengers to edit (you can select multiple):"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:385,columnNumber:17},this),e.jsxDEV("div",{className:"space-y-2",children:[W.map((b,d)=>e.jsxDEV(ae,{className:`cursor-pointer transition-all ${N.includes(d)?"border-purple-400 bg-purple-50 border-2":"border hover:shadow-sm"}`,onClick:()=>te(d),children:e.jsxDEV(ne,{className:"p-3 flex items-center gap-3",children:[e.jsxDEV("input",{type:"checkbox",checked:N.includes(d),readOnly:!0,className:"h-4 w-4 accent-purple-600"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:394,columnNumber:25},this),e.jsxDEV(nr,{className:"h-4 w-4 text-purple-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:395,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"font-medium text-sm",children:[b.title," ",b.first_name," ",b.last_name]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:397,columnNumber:27},this),e.jsxDEV("div",{className:"text-xs text-gray-500",children:[b.type||"adult"," ",b.country_code?`| ${b.country_code}`:""]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:398,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:396,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:393,columnNumber:23},this)},d,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:388,columnNumber:21},this)),W.length===0&&e.jsxDEV("div",{className:"text-sm text-gray-400 py-4 text-center",children:"No passenger data available"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:404,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:386,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:384,columnNumber:15},this),S==="amend"&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV("p",{className:"text-sm text-gray-500",children:"Select items to amend (you can select multiple):"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:412,columnNumber:17},this),e.jsxDEV("div",{className:"space-y-2",children:[le.map(b=>e.jsxDEV(ae,{className:`cursor-pointer transition-all ${C.includes(b.id)?"border-blue-400 bg-blue-50 border-2":"border hover:shadow-sm"}`,onClick:()=>be(b.id),children:e.jsxDEV(ne,{className:"p-3 flex items-center gap-3",children:[e.jsxDEV("input",{type:"checkbox",checked:C.includes(b.id),readOnly:!0,className:"h-4 w-4 accent-blue-600"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:421,columnNumber:25},this),b.type==="hotel"?e.jsxDEV(Le,{className:"h-4 w-4 text-blue-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:422,columnNumber:53},this):b.type==="flight"?e.jsxDEV(ze,{className:"h-4 w-4 text-orange-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:422,columnNumber:127},this):b.type==="transfer"?e.jsxDEV(Xe,{className:"h-4 w-4 text-green-600"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:422,columnNumber:205},this):b.type==="tour"?e.jsxDEV(dr,{className:"h-4 w-4 text-purple-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:422,columnNumber:276},this):b.type==="stopover"?e.jsxDEV(Lr,{className:"h-4 w-4 text-teal-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:422,columnNumber:352},this):e.jsxDEV(Le,{className:"h-4 w-4 text-gray-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:422,columnNumber:405},this),e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"font-medium text-sm",children:b.name},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:424,columnNumber:27},this),e.jsxDEV(oe,{variant:"outline",className:"text-[10px]",children:b.type},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:425,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:423,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:420,columnNumber:23},this)},b.id,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:415,columnNumber:21},this)),e.jsxDEV(ae,{className:`cursor-pointer transition-all ${C.includes("contact")?"border-green-400 bg-green-50 border-2":"border hover:shadow-sm"}`,onClick:()=>be("contact"),children:e.jsxDEV(ne,{className:"p-3 flex items-center gap-3",children:[e.jsxDEV("input",{type:"checkbox",checked:C.includes("contact"),readOnly:!0,className:"h-4 w-4 accent-green-600"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:435,columnNumber:23},this),e.jsxDEV(Er,{className:"h-4 w-4 text-green-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:436,columnNumber:23},this),e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"font-medium text-sm",children:"Contact Information"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:438,columnNumber:25},this),e.jsxDEV("div",{className:"text-xs text-gray-500",children:"Email, phone, name"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:439,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:437,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:434,columnNumber:21},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:430,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:413,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:411,columnNumber:15},this),S==="cancellation"&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV("p",{className:"text-sm text-gray-500",children:"Select what to cancel:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:449,columnNumber:17},this),e.jsxDEV("div",{className:"space-y-2",children:[e.jsxDEV(ae,{className:`cursor-pointer transition-all ${w==="entire"?"border-red-400 bg-red-50 border-2":"border hover:shadow-sm"}`,onClick:()=>F("entire"),children:e.jsxDEV(ne,{className:"p-3 flex items-center gap-3",children:[e.jsxDEV(ci,{className:"h-4 w-4 text-red-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:456,columnNumber:23},this),e.jsxDEV("div",{className:"font-medium text-sm",children:"Cancel Entire Booking"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:457,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:455,columnNumber:21},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:451,columnNumber:19},this),le.map(b=>e.jsxDEV(ae,{className:`cursor-pointer transition-all ${w===b.id?"border-red-400 bg-red-50 border-2":"border hover:shadow-sm"}`,onClick:()=>F(b.id),children:e.jsxDEV(ne,{className:"p-3 flex items-center gap-3",children:[b.type==="hotel"?e.jsxDEV(Le,{className:"h-4 w-4 text-red-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:467,columnNumber:53},this):b.type==="flight"?e.jsxDEV(ze,{className:"h-4 w-4 text-red-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:467,columnNumber:126},this):b.type==="transfer"?e.jsxDEV(Xe,{className:"h-4 w-4 text-red-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:467,columnNumber:201},this):b.type==="tour"?e.jsxDEV(dr,{className:"h-4 w-4 text-red-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:467,columnNumber:270},this):b.type==="stopover"?e.jsxDEV(Lr,{className:"h-4 w-4 text-red-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:467,columnNumber:343},this):e.jsxDEV(Le,{className:"h-4 w-4 text-red-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:467,columnNumber:395},this),e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"font-medium text-sm",children:["Cancel: ",b.name]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:469,columnNumber:27},this),e.jsxDEV(oe,{variant:"outline",className:"text-[10px]",children:b.type},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:470,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:468,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:466,columnNumber:23},this)},b.id,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:461,columnNumber:21},this))]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:450,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:448,columnNumber:15},this),S==="special_request"&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV("p",{className:"text-sm text-gray-500",children:"What kind of special request?"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:481,columnNumber:17},this),e.jsxDEV("div",{className:"grid grid-cols-2 gap-2",children:ti.map(b=>e.jsxDEV(ae,{className:`cursor-pointer transition-all ${w===b.value?"border-green-400 bg-green-50 border-2":"border hover:shadow-sm"}`,onClick:()=>F(b.value),children:e.jsxDEV(ne,{className:"p-3 flex items-center gap-2",children:[e.jsxDEV(b.icon,{className:"h-4 w-4 text-green-600 shrink-0"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:490,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"font-medium text-xs",children:b.label},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:492,columnNumber:27},this),e.jsxDEV("div",{className:"text-[10px] text-gray-500",children:b.hint},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:493,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:491,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:489,columnNumber:23},this)},b.value,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:484,columnNumber:21},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:482,columnNumber:17},this),e.jsxDEV("div",{className:"pt-2",children:[e.jsxDEV(De,{className:"text-sm font-medium",children:"Describe your request"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:500,columnNumber:19},this),e.jsxDEV(Ke,{value:z,onChange:b=>K(b.target.value),placeholder:"Describe what you need in detail...",rows:4,className:"mt-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:501,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:499,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:480,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:382,columnNumber:11},this),y===3&&(S==="amend"||S==="passenger_change")&&e.jsxDEV("div",{className:"space-y-4 max-h-[60vh] overflow-y-auto",children:[e.jsxDEV("p",{className:"text-sm text-gray-500",children:"Edit the fields you want to change. Only modified fields will be submitted."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:517,columnNumber:13},this),e.jsxDEV("div",{className:"text-xs text-gray-400 flex items-center gap-4",children:[e.jsxDEV("span",{children:"Current Value"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:521,columnNumber:15},this),e.jsxDEV(Br,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:522,columnNumber:15},this),e.jsxDEV("span",{children:"New Value"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:523,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:520,columnNumber:13},this),S==="amend"&&C.map(b=>{var J;const d=le.find(j=>j.id===b),me=b==="contact"?"Contact Information":(d==null?void 0:d.name)||b,se=(d==null?void 0:d.type)==="hotel"||(d==null?void 0:d.type)==="stopover",Z=Array.isArray((J=d==null?void 0:d.details)==null?void 0:J.rooms)?d.details.rooms:[];return se&&Z.length>1?e.jsxDEV("div",{className:"border rounded-lg overflow-hidden",children:[e.jsxDEV("div",{className:"bg-gray-50 px-3 py-2 border-b text-sm font-semibold flex items-center gap-2",children:[e.jsxDEV(Le,{className:"h-3.5 w-3.5 text-blue-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:544,columnNumber:23},this),me,e.jsxDEV("span",{className:"text-xs font-normal text-gray-500 ml-1",children:["(",Z.length," rooms — edit each independently)"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:546,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:543,columnNumber:21},this),Z.map(j=>{var ie,ee,Pe,fe,He;const H=`${b}:room_${j.index}`;return e.jsxDEV("div",{className:"border-t",children:[e.jsxDEV("div",{className:"bg-blue-50/40 px-3 py-1.5 text-xs font-medium text-gray-700",children:["Room #",j.index+1,j.label?e.jsxDEV("span",{className:"text-gray-500 font-normal",children:[" — ",j.label]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:554,columnNumber:43},this):null]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:552,columnNumber:27},this),e.jsxDEV("div",{className:"p-3",children:e.jsxDEV(Xr,{fields:ei,currentValues:{check_in:((ie=j.details)==null?void 0:ie.check_in)||"",check_out:((ee=j.details)==null?void 0:ee.check_out)||"",room_name:((Pe=j.details)==null?void 0:Pe.room_name)||"",board_basis:((fe=j.details)==null?void 0:fe.board_basis)||"",special_requests:((He=j.details)==null?void 0:He.special_requests)||""},scopeId:H,onChange:R=>{V(Ge=>[...Ge.filter(de=>de.scope_id!==H),...R])}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:557,columnNumber:29},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:556,columnNumber:27},this)]},j.index,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:551,columnNumber:25},this)})]},b,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:542,columnNumber:19},this):e.jsxDEV("div",{className:"border rounded-lg overflow-hidden",children:[e.jsxDEV("div",{className:"bg-gray-50 px-3 py-2 border-b text-sm font-semibold flex items-center gap-2",children:[(d==null?void 0:d.type)==="hotel"?e.jsxDEV(Le,{className:"h-3.5 w-3.5 text-blue-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:586,columnNumber:50},this):(d==null?void 0:d.type)==="flight"?e.jsxDEV(ze,{className:"h-3.5 w-3.5 text-orange-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:587,columnNumber:51},this):e.jsxDEV(Er,{className:"h-3.5 w-3.5 text-green-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:588,columnNumber:22},this),me]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:585,columnNumber:19},this),e.jsxDEV("div",{className:"p-3",children:e.jsxDEV(Xr,{fields:b==="contact"?ws:(d==null?void 0:d.type)==="hotel"||(d==null?void 0:d.type)==="stopover"?ei:(d==null?void 0:d.type)==="flight"?Ts:(d==null?void 0:d.type)==="transfer"?Rs:(d==null?void 0:d.type)==="tour"?qs:[],currentValues:(()=>{var ie;if(b==="contact")return he();const j=d,H=(j==null?void 0:j.details)||{};if((j==null?void 0:j.type)==="hotel"||(j==null?void 0:j.type)==="stopover"){const ee=((ie=Z[0])==null?void 0:ie.details)||{};return{check_in:ee.check_in||H.check_in||H.checkin_date||"",check_out:ee.check_out||H.check_out||H.checkout_date||"",room_name:ee.room_name||H.room_name||"",board_basis:ee.board_basis||H.board_basis||"",special_requests:ee.special_requests||""}}return(j==null?void 0:j.type)==="flight"?{departure_date:H.departure_date||"",cabin_class:H.cabin_class||"",baggage:H.baggage||"",seat_preference:""}:(j==null?void 0:j.type)==="transfer"?{transfer_date:H.transfer_date||"",transfer_time:H.transfer_time||"",pickup_location:H.pickup_location||"",dropoff_location:H.dropoff_location||"",vehicle_type:H.vehicle_type||"",meeting_point:H.meeting_point||"",special_requests:""}:(j==null?void 0:j.type)==="tour"?{tour_date:H.tour_date||"",duration:H.duration||"",language:H.language||"",meeting_point:H.meeting_point||"",special_requests:""}:{}})(),scopeId:se&&Z.length===1?`${b}:room_0`:b,onChange:j=>{const H=se&&Z.length===1?`${b}:room_0`:b;V(ie=>[...ie.filter(Pe=>Pe.scope_id!==H),...j])}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:592,columnNumber:21},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:591,columnNumber:19},this)]},b,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:584,columnNumber:17},this)}),S==="passenger_change"&&N.map(b=>{const d=W[b]||{};return e.jsxDEV("div",{className:"border rounded-lg overflow-hidden",children:[e.jsxDEV("div",{className:"bg-gray-50 px-3 py-2 border-b text-sm font-semibold flex items-center gap-2",children:[e.jsxDEV(nr,{className:"h-3.5 w-3.5 text-purple-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:673,columnNumber:21},this),d.title," ",d.first_name," ",d.last_name," ",e.jsxDEV(oe,{variant:"outline",className:"text-[10px]",children:d.type||"adult"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:674,columnNumber:60},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:672,columnNumber:19},this),e.jsxDEV("div",{className:"p-3",children:e.jsxDEV(Xr,{fields:Fs,currentValues:{title:d.title||"",first_name:d.first_name||"",last_name:d.last_name||"",date_of_birth:d.date_of_birth||"",country_code:d.country_code||"",document_id:d.document_id||"",document_expiry:d.document_expiry||"",document_country:d.document_country||""},scopeId:String(b),onChange:me=>{V(se=>[...se.filter(J=>J.scope_id!==String(b)),...me])}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:677,columnNumber:21},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:676,columnNumber:19},this)]},b,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:671,columnNumber:17},this)}),D.length>0&&e.jsxDEV("div",{className:"text-xs text-orange-600 font-medium",children:[D.length," field",D.length!==1?"s":""," changed"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:698,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:516,columnNumber:11},this),(y===3&&(S==="cancellation"||S==="special_request")||y===4&&(S==="amend"||S==="passenger_change"))&&e.jsxDEV("div",{className:"space-y-4",children:[D.length>0&&e.jsxDEV("div",{children:[e.jsxDEV(De,{className:"text-sm font-medium",children:"Changes Summary"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:712,columnNumber:17},this),e.jsxDEV("div",{className:"mt-2",children:e.jsxDEV($s,{changes:D,compact:!0},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:714,columnNumber:19},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:713,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:711,columnNumber:15},this),e.jsxDEV("div",{children:[e.jsxDEV(De,{className:"text-sm font-medium",children:[S==="cancellation"?"Cancellation Reason":"Additional Message"," ",S!=="special_request"&&"(optional)"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:720,columnNumber:15},this),e.jsxDEV(Ke,{value:z,onChange:b=>K(b.target.value),placeholder:S==="cancellation"?"Reason for cancellation...":S==="special_request"?"Describe your request in detail...":"Any additional notes...",rows:3,className:"mt-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:723,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:719,columnNumber:13},this),e.jsxDEV("div",{children:[e.jsxDEV(De,{className:"text-sm font-medium",children:"Attachments (optional)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:738,columnNumber:15},this),e.jsxDEV("div",{className:"mt-1",children:[e.jsxDEV("input",{ref:n,type:"file",multiple:!0,onChange:Ne,className:"hidden"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:740,columnNumber:17},this),e.jsxDEV(G,{type:"button",variant:"outline",size:"sm",className:"text-xs",onClick:()=>{var b;return(b=n.current)==null?void 0:b.click()},children:[e.jsxDEV(Is,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:742,columnNumber:19},this)," Attach Files"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:741,columnNumber:17},this),v.length>0&&e.jsxDEV("div",{className:"mt-2 space-y-1",children:v.map((b,d)=>e.jsxDEV("div",{className:"flex items-center justify-between text-xs bg-gray-50 px-2 py-1 rounded",children:[e.jsxDEV("span",{className:"truncate max-w-[300px]",children:b.name},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:748,columnNumber:25},this),e.jsxDEV("button",{onClick:()=>U(d),className:"text-red-400 hover:text-red-600 ml-2",children:e.jsxDEV(bi,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:749,columnNumber:112},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:749,columnNumber:25},this)]},d,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:747,columnNumber:23},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:745,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:739,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:737,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:708,columnNumber:11},this),e.jsxDEV("div",{className:"flex justify-between pt-4 border-t",children:[e.jsxDEV("div",{children:y>1&&e.jsxDEV(G,{variant:"outline",size:"sm",onClick:()=>p(b=>b-1),children:[e.jsxDEV(no,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:764,columnNumber:17},this)," Back"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:763,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:761,columnNumber:11},this),e.jsxDEV("div",{className:"flex gap-2",children:[e.jsxDEV(G,{variant:"outline",onClick:o,children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:769,columnNumber:13},this),y<Q?e.jsxDEV(G,{onClick:()=>p(b=>b+1),disabled:!Se(),className:"bg-orange-500 hover:bg-orange-600 text-white",children:["Next ",e.jsxDEV(Br,{className:"h-4 w-4 ml-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:776,columnNumber:22},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:771,columnNumber:15},this):e.jsxDEV(G,{onClick:T,disabled:c.isPending||g.isPending,className:"bg-orange-500 hover:bg-orange-600 text-white",children:[e.jsxDEV(lr,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:784,columnNumber:17},this),c.isPending?"Creating...":"Submit Request"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:779,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:768,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:760,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:336,columnNumber:7},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/CreateSupportRequestDialog.tsx",lineNumber:335,columnNumber:5},this)}function vi(r,o){var y,p,S,h,C,x,N,f,D,V,z,K,v,_,w,k,F,B,be,te,le,W;if(!r||typeof r!="object")return null;const s=r._product_id||r.id||o||"",a=r._product_ref||r.product_ref||"",t=r._product_type||r.product_type||((y=r.product)==null?void 0:y.code)||(o?o.replace(/_\d+$/,""):""),i=(r==null?void 0:r.data)||r,u=(i==null?void 0:i.selected_rooms)||(i==null?void 0:i.rooms)||[],c=Array.isArray(u)&&u.length>0?u[0]:{},g=(c==null?void 0:c.rate)||{},n=Array.isArray(i==null?void 0:i.segments)?i.segments:Array.isArray(i==null?void 0:i.flight_segments)?i.flight_segments:[];if(t==="hotel"||t==="stopover"){const L=(c==null?void 0:c.name)||(c==null?void 0:c.room_name)||(c==null?void 0:c.supplier_room_name)||(g==null?void 0:g.room_type)||(g==null?void 0:g.name)||"",Ne=(c==null?void 0:c.board_basis)||(c==null?void 0:c.board)||(g==null?void 0:g.board_basis)||((p=g==null?void 0:g.board)==null?void 0:p.basis)||((S=g==null?void 0:g.board)==null?void 0:S.name)||"";return{id:s,type:t,name:(i==null?void 0:i.name)||(i==null?void 0:i.hotel_name)||(i==null?void 0:i.property_name)||(t==="stopover"?"Stopover":"Hotel"),details:{hotel_name:(i==null?void 0:i.name)||(i==null?void 0:i.hotel_name)||(i==null?void 0:i.property_name),check_in:(i==null?void 0:i.checkin_date)||(i==null?void 0:i.check_in_date)||(i==null?void 0:i.check_in)||(c==null?void 0:c.check_in_date)||(c==null?void 0:c.checkin_date)||"",check_out:(i==null?void 0:i.checkout_date)||(i==null?void 0:i.check_out_date)||(i==null?void 0:i.check_out)||(c==null?void 0:c.check_out_date)||(c==null?void 0:c.checkout_date)||"",room_name:L,board_basis:Ne,booking_ref:a||(i==null?void 0:i.booking_ref)||(i==null?void 0:i.easygds_id)||"",star_rating:(i==null?void 0:i.star)||(i==null?void 0:i.star_rating)||0,address:(i==null?void 0:i.street_address)||(i==null?void 0:i.address)||"",program_id:(i==null?void 0:i.program_id)||"",room_count:Array.isArray(u)?u.length:0,rooms:(Array.isArray(u)?u:[]).map((U,he)=>{var Se,Q;const T=(U==null?void 0:U.rate)||{};return{index:he,label:(U==null?void 0:U.name)||(U==null?void 0:U.room_name)||(U==null?void 0:U.supplier_room_name)||(T==null?void 0:T.room_type)||(T==null?void 0:T.name)||`Room ${he+1}`,details:{check_in:(U==null?void 0:U.check_in_date)||(U==null?void 0:U.checkin_date)||(T==null?void 0:T.check_in_date)||(T==null?void 0:T.checkin_date)||(i==null?void 0:i.checkin_date)||(i==null?void 0:i.check_in_date)||"",check_out:(U==null?void 0:U.check_out_date)||(U==null?void 0:U.checkout_date)||(T==null?void 0:T.check_out_date)||(T==null?void 0:T.checkout_date)||(i==null?void 0:i.checkout_date)||(i==null?void 0:i.check_out_date)||"",room_name:(U==null?void 0:U.name)||(U==null?void 0:U.room_name)||(U==null?void 0:U.supplier_room_name)||(T==null?void 0:T.room_type)||(T==null?void 0:T.name)||"",board_basis:(U==null?void 0:U.board_basis)||(U==null?void 0:U.board)||(T==null?void 0:T.board_basis)||((Se=T==null?void 0:T.board)==null?void 0:Se.basis)||((Q=T==null?void 0:T.board)==null?void 0:Q.name)||"",special_requests:(U==null?void 0:U.special_requests)||(T==null?void 0:T.special_requests)||""}}}),special_requests:(i==null?void 0:i.special_requests)||(i==null?void 0:i.remarks)||(c==null?void 0:c.special_requests)||(g==null?void 0:g.special_requests)||""}}}if(t==="flight"){const L=n.length>0?`${((h=n[0])==null?void 0:h.departure_airport_code)||((C=n[0])==null?void 0:C.from)||"?"} → ${((x=n[n.length-1])==null?void 0:x.arrival_airport_code)||((N=n[n.length-1])==null?void 0:N.to)||"?"}`:"Flight";return{id:s,type:"flight",name:L,details:{route:L,pnr:(i==null?void 0:i.pnr)||((f=i==null?void 0:i.pnr_data)==null?void 0:f.pnr)||((D=n[0])==null?void 0:D.pnr)||"",departure_date:((V=n[0])==null?void 0:V.departure_datetime)||((z=n[0])==null?void 0:z.departure_at)||((K=n[0])==null?void 0:K.departure_date)||"",cabin_class:((v=n[0])==null?void 0:v.cabin_class)||((_=n[0])==null?void 0:_.cabin)||"",airline:((w=n[0])==null?void 0:w.airline_code)||((k=n[0])==null?void 0:k.carrier_code)||"",flight_number:((F=n[0])==null?void 0:F.flight_number)||((B=n[0])==null?void 0:B.flight_no)||"",baggage:(be=i==null?void 0:i.fare)!=null&&be.baggage_allowance?"Included":""}}}if(t==="transfer"){const L=(i==null?void 0:i.transfer)||((te=i==null?void 0:i.transfers)==null?void 0:te[0])||{},Ne=(i==null?void 0:i.pickup_from)||(i==null?void 0:i.pickup_place)||(i==null?void 0:i.pickup_location)||(L==null?void 0:L.from)||(L==null?void 0:L.pickup)||"",U=(i==null?void 0:i.dropoff_to)||(i==null?void 0:i.dropoff_place)||(i==null?void 0:i.dropoff_location)||(L==null?void 0:L.to)||(L==null?void 0:L.dropoff)||"";return{id:s,type:"transfer",name:Ne&&U?`${Ne} → ${U}`:"Transfer",details:{pickup_location:Ne,dropoff_location:U,transfer_date:(i==null?void 0:i.transfer_date)||(i==null?void 0:i.pickup_date)||(L==null?void 0:L.pickup_date)||(L==null?void 0:L.date)||"",transfer_time:(i==null?void 0:i.transfer_time)||(i==null?void 0:i.pickup_time)||(L==null?void 0:L.pickup_time)||(L==null?void 0:L.time)||"",vehicle_type:(typeof(i==null?void 0:i.vehicle)=="string"?i.vehicle:(le=i==null?void 0:i.vehicle)==null?void 0:le.name)||(i==null?void 0:i.vehicle_type)||((W=L==null?void 0:L.vehicle)==null?void 0:W.name)||(L==null?void 0:L.vehicle_type)||"",meeting_point:(i==null?void 0:i.meeting_point)||(L==null?void 0:L.meeting_point)||"",booking_reference:(i==null?void 0:i.booking_reference)||(i==null?void 0:i.confirm_reference)||(L==null?void 0:L.booking_reference)||""}}}return t==="tour"?{id:s,type:"tour",name:(i==null?void 0:i.title)||(i==null?void 0:i.tour_name)||(i==null?void 0:i.code)||"Tour",details:{tour_title:(i==null?void 0:i.title)||(i==null?void 0:i.tour_name)||"",tour_date:(i==null?void 0:i.departure_date)||(i==null?void 0:i.tour_date)||(i==null?void 0:i.date)||"",duration:(i==null?void 0:i.duration)||"",language:Array.isArray(i==null?void 0:i.language_guides)?i.language_guides.join(", "):(i==null?void 0:i.language_guides)||"",location:(i==null?void 0:i.location)||"",meeting_point:(i==null?void 0:i.meeting_point)||""}}:null}function Nt({bookingCode:r,bookingData:o,booking:s}){const{getSupplierBySourceId:a,getProviderName:t}=hi(),i=di(),{data:u=[],isLoading:c}=Gs(r),{data:g=0}=Ys(r),n=1,y=g>=n,{data:p}=Ve({queryKey:["ops-can","support_ticket.create",r],queryFn:()=>gi("support_ticket.create",r),enabled:!!r,staleTime:3e4}),S=(p==null?void 0:p.effect)||"allow",h=S==="deny",C=S==="require_approval",x=!y&&!h,[N,f]=P.useState(!1),D=z=>i(`/support/${z}`),V=ht(o);return c?e.jsxDEV("div",{className:"flex items-center justify-center h-48",children:e.jsxDEV("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-orange-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:68,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:67,columnNumber:7},this):e.jsxDEV("div",{className:"space-y-4",children:[e.jsxDEV("div",{className:"flex items-center justify-between",children:[e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV("h3",{className:"text-lg font-semibold",children:"Support Requests"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:78,columnNumber:11},this),e.jsxDEV(oe,{variant:"outline",className:"text-xs",children:[u.length," ticket",u.length!==1?"s":""]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:79,columnNumber:11},this),g>0&&e.jsxDEV(oe,{variant:"outline",className:"text-xs text-amber-600 border-amber-300",children:[g,"/",n," active"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:81,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:77,columnNumber:9},this),e.jsxDEV("div",{className:"flex items-center gap-2",children:[!h&&y&&e.jsxDEV("div",{className:"flex items-center gap-1 text-xs text-amber-600",children:[e.jsxDEV(Je,{className:"h-3.5 w-3.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:92,columnNumber:15},this),"Resolve or close the current request before creating a new one"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:91,columnNumber:13},this),!h&&!y&&C&&e.jsxDEV("div",{className:"flex items-center gap-1 text-xs text-blue-600",children:[e.jsxDEV(Je,{className:"h-3.5 w-3.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:98,columnNumber:15},this),"An admin will need to approve this request before it's created"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:97,columnNumber:13},this),!h&&e.jsxDEV(G,{onClick:()=>f(!0),disabled:!x,className:"bg-orange-500 hover:bg-orange-600 text-white",size:"sm",children:[e.jsxDEV(oi,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:109,columnNumber:15},this),C?"Request Approval":"New Request"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:103,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:84,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:76,columnNumber:7},this),u.length===0?e.jsxDEV(ae,{children:e.jsxDEV(ne,{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsxDEV($e,{className:"h-12 w-12 text-gray-300 mb-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:120,columnNumber:13},this),e.jsxDEV("h4",{className:"text-lg font-medium text-gray-600 mb-2",children:"No Support Requests"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:121,columnNumber:13},this),e.jsxDEV("p",{className:"text-sm text-gray-400 mb-6 max-w-md",children:"Create a support request to amend, cancel, or change details for this booking or any specific product."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:122,columnNumber:13},this),!h&&e.jsxDEV(G,{onClick:()=>f(!0),className:"bg-orange-500 hover:bg-orange-600 text-white",children:[e.jsxDEV(oi,{className:"h-4 w-4 mr-2"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:130,columnNumber:17},this),C?"Request Approval":"Create First Request"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:126,columnNumber:15},this),h&&e.jsxDEV("p",{className:"mt-3 text-xs text-gray-500",children:"Support requests for this booking are managed by another team."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:135,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:119,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:118,columnNumber:9},this):e.jsxDEV(yt,{requests:u,selectedId:null,onSelect:D},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:146,columnNumber:9},this),e.jsxDEV(xi,{isOpen:N,onClose:()=>f(!1),bookingCode:r,bookingData:{company_name:xt(o,s),supplier_name:vt(o,a,t,s),currency:ft(o),passengers:Et(o),products:V,contact:(o==null?void 0:o.contact)||{}}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:153,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/BookingSupportTab.tsx",lineNumber:74,columnNumber:5},this)}function ht(r){if(!r)return[];const o=[],s=(r==null?void 0:r.products)||{};for(const a of Object.keys(s)){const t=vi(s[a],a);t&&o.push(t)}return o}function xt(r,o){var a,t,i,u,c,g,n;if((a=o==null?void 0:o.agent)!=null&&a.name)return o.agent.name;if((t=o==null?void 0:o.app)!=null&&t.name)return o.app.name;if((i=r==null?void 0:r.order)!=null&&i.agency_name)return r.order.agency_name;if((u=r==null?void 0:r.order)!=null&&u.company_name)return r.order.company_name;if((c=r==null?void 0:r.order)!=null&&c.customer_name)return r.order.customer_name;if((g=r==null?void 0:r.contact)!=null&&g.first_name)return`${r.contact.first_name} ${r.contact.last_name||""}`.trim();const s=r==null?void 0:r.travelers;if(s){const y=Array.isArray(s)?s:[s],p=((n=y[0])==null?void 0:n.data)||y[0];if(p!=null&&p.first_name)return`${p.first_name} ${p.last_name||""}`.trim()}return""}function vt(r,o,s,a){var i,u;const t=(r==null?void 0:r.products)||{};for(const c of Object.keys(t)){const g=t[c];if(!g||typeof g!="object")continue;const n=(g==null?void 0:g.data)||g,y=ro(g);if(y){const S=o(y),h=(S==null?void 0:S.supplier_name)||s(y);if(h)return h}const p=((i=n==null?void 0:n.supplier_info)==null?void 0:i.supplier_name)||(n==null?void 0:n.supplier_name)||(n==null?void 0:n.provider_name);if(p)return p;if(y)return y}return((u=r==null?void 0:r.order)==null?void 0:u.supplier_name)||(r==null?void 0:r.source)||(a==null?void 0:a.provider)||(a==null?void 0:a.supplier)||(a==null?void 0:a.booking_source)||""}function ft(r){var o,s,a;return((s=(o=r==null?void 0:r.payment)==null?void 0:o.currency_info)==null?void 0:s.currency)||((a=r==null?void 0:r.payment)==null?void 0:a.currency)||"USD"}function Et(r){const o=r==null?void 0:r.travelers;return o?(Array.isArray(o)?o:[o]).map(a=>{const t=(a==null?void 0:a.data)||a;return{title:(t==null?void 0:t.title)||"",first_name:(t==null?void 0:t.first_name)||"",last_name:(t==null?void 0:t.last_name)||"",type:(t==null?void 0:t.type)||(t==null?void 0:t.contact_type)||"adult",date_of_birth:(t==null?void 0:t.birthday)||(t==null?void 0:t.date_of_birth)||"",country_code:(t==null?void 0:t.country_code)||"",document_id:(t==null?void 0:t.document_id)||"",document_expiry:(t==null?void 0:t.document_expiration)||"",document_country:(t==null?void 0:t.document_issued_country_code)||""}}).filter(a=>a.first_name||a.last_name):[]}function Ot({isOpen:r,onClose:o,bookingId:s,bookingCode:a,contactData:t,travelerList:i,onSaved:u}){const{toast:c}=mr(),[g,n]=P.useState(!1),[y,p]=P.useState({title:(t==null?void 0:t.title)||"",first_name:(t==null?void 0:t.first_name)||"",last_name:(t==null?void 0:t.last_name)||"",email:(t==null?void 0:t.email)||"",phone:(t==null?void 0:t.phone)||""}),[S,h]=P.useState(i.map(f=>{const D=f.data||f;return{id:f.id||"",title:D.title||"",first_name:D.first_name||"",last_name:D.last_name||"",birthday:D.birthday||"",country_code:D.country_code||D.nationality||"",document_id:D.document_id||D.passport_number||"",document_expiry:D.document_expiry||"",type:D.type||"adult"}})),C=async()=>{n(!0);try{await Zi(s,y),c({title:"Contact updated successfully"}),u()}catch(f){c({variant:"destructive",title:"Failed to update contact",description:f.message})}finally{n(!1)}},x=async()=>{n(!0);try{await Wi(s,{travelers:S}),c({title:"Travelers updated successfully"}),u()}catch(f){c({variant:"destructive",title:"Failed to update travelers",description:f.message})}finally{n(!1)}},N=(f,D,V)=>{h(z=>{const K=[...z];return K[f]={...K[f],[D]:V},K})};return r?e.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:o,children:e.jsxDEV("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-3xl max-h-[90vh] overflow-y-auto",onClick:f=>f.stopPropagation(),children:[e.jsxDEV("div",{className:"sticky top-0 bg-white border-b px-6 py-4 flex items-center justify-between z-10",children:[e.jsxDEV("div",{children:[e.jsxDEV("h2",{className:"text-lg font-bold",children:"Edit Booking"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:101,columnNumber:13},this),e.jsxDEV("p",{className:"text-sm text-gray-500",children:a},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:102,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:100,columnNumber:11},this),e.jsxDEV(G,{variant:"ghost",size:"sm",onClick:o,children:e.jsxDEV(bi,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:105,columnNumber:13},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:104,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:99,columnNumber:9},this),e.jsxDEV("div",{className:"p-6",children:e.jsxDEV(Gr,{defaultValue:"contact",children:[e.jsxDEV(Yr,{className:"mb-4",children:[e.jsxDEV(Ce,{value:"contact",className:"flex items-center gap-1",children:[e.jsxDEV(gr,{className:"h-3.5 w-3.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:114,columnNumber:17},this)," Contact"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:113,columnNumber:15},this),e.jsxDEV(Ce,{value:"travelers",className:"flex items-center gap-1",children:[e.jsxDEV(nr,{className:"h-3.5 w-3.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:117,columnNumber:17},this)," Travelers"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:116,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:112,columnNumber:13},this),e.jsxDEV(ke,{value:"contact",children:e.jsxDEV("div",{className:"space-y-4",children:[e.jsxDEV("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium text-gray-700",children:"Title"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:126,columnNumber:21},this),e.jsxDEV("select",{className:"w-full mt-1 rounded-md border border-gray-300 p-2 text-sm",value:y.title,onChange:f=>p(D=>({...D,title:f.target.value})),children:[e.jsxDEV("option",{value:"",children:"Select"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:132,columnNumber:23},this),e.jsxDEV("option",{value:"Mr",children:"Mr"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:133,columnNumber:23},this),e.jsxDEV("option",{value:"Mrs",children:"Mrs"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:134,columnNumber:23},this),e.jsxDEV("option",{value:"Ms",children:"Ms"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:135,columnNumber:23},this),e.jsxDEV("option",{value:"Miss",children:"Miss"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:136,columnNumber:23},this),e.jsxDEV("option",{value:"Dr",children:"Dr"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:137,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:127,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:125,columnNumber:19},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium text-gray-700",children:"First Name"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:141,columnNumber:21},this),e.jsxDEV(ce,{className:"mt-1",value:y.first_name,onChange:f=>p(D=>({...D,first_name:f.target.value}))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:142,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:140,columnNumber:19},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium text-gray-700",children:"Last Name"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:149,columnNumber:21},this),e.jsxDEV(ce,{className:"mt-1",value:y.last_name,onChange:f=>p(D=>({...D,last_name:f.target.value}))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:150,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:148,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:124,columnNumber:17},this),e.jsxDEV("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium text-gray-700",children:"Email"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:159,columnNumber:21},this),e.jsxDEV(ce,{className:"mt-1",type:"email",value:y.email,onChange:f=>p(D=>({...D,email:f.target.value}))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:160,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:158,columnNumber:19},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium text-gray-700",children:"Phone"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:168,columnNumber:21},this),e.jsxDEV(ce,{className:"mt-1",value:y.phone,onChange:f=>p(D=>({...D,phone:f.target.value}))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:169,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:167,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:157,columnNumber:17},this),e.jsxDEV("div",{className:"flex justify-end pt-2",children:e.jsxDEV(G,{onClick:C,disabled:g,children:[g?e.jsxDEV(oo,{className:"h-4 w-4 mr-1 animate-spin"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:178,columnNumber:31},this):e.jsxDEV(wr,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:178,columnNumber:83},this),"Save Contact"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:177,columnNumber:19},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:176,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:123,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:122,columnNumber:13},this),e.jsxDEV(ke,{value:"travelers",children:e.jsxDEV("div",{className:"space-y-4",children:[S.length===0?e.jsxDEV("p",{className:"text-center text-gray-400 py-8",children:"No travelers to edit"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:189,columnNumber:19},this):S.map((f,D)=>e.jsxDEV("div",{className:"border rounded-lg p-4 bg-gray-50",children:[e.jsxDEV("div",{className:"flex items-center gap-2 mb-3",children:[e.jsxDEV(lo,{className:"h-4 w-4 text-gray-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:194,columnNumber:25},this),e.jsxDEV("span",{className:"font-medium text-sm",children:["Traveler #",D+1]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:195,columnNumber:25},this),e.jsxDEV(oe,{variant:"outline",className:"text-xs",children:f.type},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:196,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:193,columnNumber:23},this),e.jsxDEV("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Title"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:200,columnNumber:27},this),e.jsxDEV("select",{className:"w-full mt-0.5 rounded-md border border-gray-300 p-1.5 text-sm",value:f.title,onChange:V=>N(D,"title",V.target.value),children:[e.jsxDEV("option",{value:"",children:"Select"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:206,columnNumber:29},this),e.jsxDEV("option",{value:"Mr",children:"Mr"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:207,columnNumber:29},this),e.jsxDEV("option",{value:"Mrs",children:"Mrs"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:208,columnNumber:29},this),e.jsxDEV("option",{value:"Ms",children:"Ms"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:209,columnNumber:29},this),e.jsxDEV("option",{value:"Miss",children:"Miss"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:210,columnNumber:29},this),e.jsxDEV("option",{value:"Dr",children:"Dr"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:211,columnNumber:29},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:201,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:199,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"First Name"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:215,columnNumber:27},this),e.jsxDEV(ce,{className:"mt-0.5 h-8 text-sm",value:f.first_name,onChange:V=>N(D,"first_name",V.target.value)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:216,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:214,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Last Name"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:223,columnNumber:27},this),e.jsxDEV(ce,{className:"mt-0.5 h-8 text-sm",value:f.last_name,onChange:V=>N(D,"last_name",V.target.value)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:224,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:222,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Date of Birth"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:231,columnNumber:27},this),e.jsxDEV(ce,{className:"mt-0.5 h-8 text-sm",type:"date",value:f.birthday,onChange:V=>N(D,"birthday",V.target.value)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:232,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:230,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Nationality"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:240,columnNumber:27},this),e.jsxDEV(ce,{className:"mt-0.5 h-8 text-sm",value:f.country_code,onChange:V=>N(D,"country_code",V.target.value),placeholder:"e.g. US, GB, VN"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:241,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:239,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Passport / Document ID"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:249,columnNumber:27},this),e.jsxDEV(ce,{className:"mt-0.5 h-8 text-sm",value:f.document_id,onChange:V=>N(D,"document_id",V.target.value)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:250,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:248,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Document Expiry"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:257,columnNumber:27},this),e.jsxDEV(ce,{className:"mt-0.5 h-8 text-sm",type:"date",value:f.document_expiry,onChange:V=>N(D,"document_expiry",V.target.value)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:258,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:256,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:198,columnNumber:23},this)]},D,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:192,columnNumber:21},this)),S.length>0&&e.jsxDEV("div",{className:"flex justify-end pt-2",children:e.jsxDEV(G,{onClick:x,disabled:g,children:[g?e.jsxDEV(oo,{className:"h-4 w-4 mr-1 animate-spin"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:272,columnNumber:33},this):e.jsxDEV(wr,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:272,columnNumber:85},this),"Save Travelers"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:271,columnNumber:21},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:270,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:187,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:186,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:111,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:110,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:97,columnNumber:7},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditBookingDialog.tsx",lineNumber:96,columnNumber:5},this):null}function Pt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function bo(r){if(r==null||r==="")return null;if(r instanceof Date)return Number.isNaN(r.getTime())?null:r;if(typeof r=="string"&&/^\d{4}-\d{2}-\d{2}/.test(r)){const s=Zs(r);if(!Number.isNaN(s.getTime()))return s}const o=new Date(r);return Number.isNaN(o.getTime())?null:o}function fi(r,o="dd/MM/yyyy HH:mm"){const s=bo(r);if(!s)return r==null||r===""?"-":String(r);try{return Tr(s,o)}catch{return String(r)}}function Ct(r){if(r==null||r==="")return"";if(typeof r=="string"){const i=r.match(/^(\d{4}-\d{2}-\d{2})/);if(i)return i[1];const u=r.match(/^(\d{1,2})[/.-](\d{1,2})[/.-](\d{4})$/);if(u){const[,c,g,n]=u;return`${n}-${g.padStart(2,"0")}-${c.padStart(2,"0")}`}}const o=bo(r);if(!o)return"";const s=o.getUTCFullYear(),a=String(o.getUTCMonth()+1).padStart(2,"0"),t=String(o.getUTCDate()).padStart(2,"0");return`${s}-${a}-${t}`}function kt(r){const o=bo(r);if(!o)return"";const s=o.getFullYear(),a=String(o.getMonth()+1).padStart(2,"0"),t=String(o.getDate()).padStart(2,"0"),i=String(o.getHours()).padStart(2,"0"),u=String(o.getMinutes()).padStart(2,"0");return`${s}-${a}-${t}T${i}:${u}`}const _t={hotel:Le,flight:ze,transfer:Xe,tour:dr,stopover:Or},er=Ct,cr=kt;function A(...r){for(const o of r)if(o!=null&&o!=="")return o;return""}function We(r){if(r===""||r==null)return;const o=Number(r);return Number.isNaN(o)?void 0:o}function Ei(r,o){if(!r||!o)return 0;const s=new Date(r+"T00:00:00Z"),a=new Date(o+"T00:00:00Z");if(Number.isNaN(s.getTime())||Number.isNaN(a.getTime()))return 0;const t=Math.round((a.getTime()-s.getTime())/864e5);return t>0?t:0}function At(r,o){if(!r||!Number.isFinite(o)||o<=0)return"";const s=new Date(r+"T00:00:00Z");if(Number.isNaN(s.getTime()))return"";s.setUTCDate(s.getUTCDate()+o);const a=s.getUTCFullYear(),t=String(s.getUTCMonth()+1).padStart(2,"0"),i=String(s.getUTCDate()).padStart(2,"0");return`${a}-${t}-${i}`}function Ut(r){var i;const o=(r==null?void 0:r.data)||{},s=o.hotel||((i=o.hotels)==null?void 0:i[0])||{},a=o.price_info||{},t=o.currency_info||{};return{name:A(o.name,o.hotel_name,s.name,o.property_name),address:A(o.street_address,o.address,s.street_address,s.address),phone:A(o.phone,s.phone),fax:A(o.fax,s.fax),email:A(o.email,s.email),star:A(o.star,o.star_rating,s.star,s.star_rating),night_count:A(o.night_count,s.night_count),supplier_reference:A(r==null?void 0:r.supplier_reference,o.supplier_reference,o.booking_ref,o.easygds_id,r==null?void 0:r.product_ref),confirmation_number:A(r==null?void 0:r.confirmation_number,o.confirmation_number),free_cancellation_deadline:cr(r==null?void 0:r.free_cancellation_deadline),rooms:(o.selected_rooms||[]).map(u=>{const c=u.rate||{};c.price_info||u.price_info;const g=er(A(u.check_in_date,u.checkin_date,c.check_in_date,c.checkin_date,o.checkin_date,o.check_in_date)),n=er(A(u.check_out_date,u.checkout_date,c.check_out_date,c.checkout_date,o.checkout_date,o.check_out_date)),y=A(u.night_count,c.night_count),p=Ei(g,n),S=y!==""?y:p||"";return{name:A(u.name,u.room_name,u.supplier_room_name,c.room_type,c.name)||"Room",board_basis:A(u.board_basis,c.board_basis),free_cancellation:u.free_cancellation===!0,check_in_date:g,check_out_date:n,night_count:S,hcn:A(u.hcn),confirmation_number:A(u.confirmation_number),bk_ref:A(u.bk_ref,u.easygds_id,c.booking_reference,o.booking_ref,o.easygds_id,r==null?void 0:r.product_ref),pvd_bk_ref:A(u.pvd_bk_ref),cancellation_policies:u.cancellation_policies||c.cancellation_policies||[]}}),currency:A(t.origin,o.currency,a.currency)||"USD"}}function jt(r){var i,u,c,g,n,y;const o=(r==null?void 0:r.data)||{},s=o.segments||((u=(i=o.legs)==null?void 0:i[Object.keys(o.legs||{})[0]])==null?void 0:u.segments)||o.flight_segments||[],a=o.fare||o.price_info||{},t=o.price_info||{};return{pnr:A(o.pnr,(c=o.pnr_data)==null?void 0:c.pnr,(g=s[0])==null?void 0:g.pnr),airline_pnr:A(o.airline_pnr,(n=o.pnr_data)==null?void 0:n.airline_pnr,(y=s[0])==null?void 0:y.airline_pnr),supplier_reference:A(r==null?void 0:r.supplier_reference,o.supplier_reference),confirmation_number:A(r==null?void 0:r.confirmation_number,o.confirmation_number),free_cancellation_deadline:cr(r==null?void 0:r.free_cancellation_deadline),segments:s.map(p=>({type:A(p.type,p.direction)||"departure",airline_code:A(p.airline_code,p.carrier_code),flight_no:A(p.flight_no,p.flight_number),cabin_class:A(p.cabin_class,p.cabin),departure_airport_code:A(p.departure_airport_code,p.from,p.origin),departure_datetime:cr(A(p.departure_datetime,p.departure_at)),arrival_airport_code:A(p.arrival_airport_code,p.to,p.destination),arrival_datetime:cr(A(p.arrival_datetime,p.arrival_at))})),currency:A(t.currency,a.currency,o.currency)||"USD"}}function Lt(r){var t,i,u;const o=(r==null?void 0:r.data)||{},s=o.transfer||((t=o.transfers)==null?void 0:t[0])||{},a=o.price_info||{};return{pickup_from:A(o.pickup_from,o.pickup_place,o.pickup_location,s.from,s.pickup),dropoff_to:A(o.dropoff_to,o.dropoff_place,o.dropoff_location,s.to,s.dropoff),pickup_date:er(A(o.transfer_date,o.pickup_date,s.pickup_date,s.date)),pickup_time:A(o.transfer_time,o.pickup_time,s.pickup_time,s.time),vehicle:A(typeof o.vehicle=="string"?o.vehicle:null,(i=o.vehicle)==null?void 0:i.name,o.vehicle_type,(u=s.vehicle)==null?void 0:u.name,s.vehicle_type),meeting_point:A(o.meeting_point,s.meeting_point),instructions:A(o.instructions,s.instructions),booking_reference:A(o.booking_reference,s.booking_reference),confirm_reference:A(o.confirm_reference,s.confirm_reference),supplier_reference:A(r==null?void 0:r.supplier_reference,o.supplier_reference),confirmation_number:A(r==null?void 0:r.confirmation_number,o.confirmation_number),free_cancellation_deadline:cr(r==null?void 0:r.free_cancellation_deadline),currency:A(a.currency,o.currency)||"USD"}}function Vt(r){const o=(r==null?void 0:r.data)||{},s=o.price_info||{},a=o.language_guides;return{title:A(o.title,o.tour_name,o.code),location:A(o.location),tour_date:er(A(o.departure_date,o.tour_date,o.date)),duration:A(o.duration),language_guides:Array.isArray(a)?a.join(", "):a||"",description:A(o.description),supplier_reference:A(r==null?void 0:r.supplier_reference,o.supplier_reference),confirmation_number:A(r==null?void 0:r.confirmation_number,o.confirmation_number),free_cancellation_deadline:cr(r==null?void 0:r.free_cancellation_deadline),currency:A(s.currency,o.currency)||"USD"}}function Gt(r){const o=(r==null?void 0:r.data)||{},s=o.price_info||{};return{name:A(o.name,o.hotel_name),address:A(o.street_address,o.address),star:A(o.star,o.star_rating),checkin_date:er(A(o.checkin_date,o.check_in_date)),checkout_date:er(A(o.checkout_date,o.check_out_date)),night_count:A(o.night_count),program_id:A(o.program_id),supplier_reference:A(r==null?void 0:r.supplier_reference,o.supplier_reference),confirmation_number:A(r==null?void 0:r.confirmation_number,o.confirmation_number),currency:A(s.currency,o.currency)||"USD"}}function ai(r){return{type:Ae(r),hotel:Ut(r),flight:jt(r),transfer:Lt(r),tour:Vt(r),stopover:Gt(r)}}function Yt(r,o){const s=o.rooms.map(c=>c.check_in_date).filter(Boolean).sort(),a=o.rooms.map(c=>c.check_out_date).filter(Boolean).sort(),t=s[0]||r.checkin_date||r.check_in_date||"",i=a[a.length-1]||r.checkout_date||r.check_out_date||"",u={name:o.name,hotel_name:o.name,street_address:o.address,address:o.address,phone:o.phone,fax:o.fax,email:o.email,star:We(o.star),star_rating:We(o.star),checkin_date:t,check_in_date:t,checkout_date:i,check_out_date:i,night_count:We(o.night_count),supplier_reference:o.supplier_reference,confirmation_number:o.confirmation_number};return r.hotel&&(u.hotel={...r.hotel,name:o.name,street_address:o.address,address:o.address,phone:o.phone,fax:o.fax,email:o.email,star:We(o.star),checkin_date:t,checkout_date:i,night_count:We(o.night_count)}),Array.isArray(r.selected_rooms)&&o.rooms.length>0&&(u.selected_rooms=r.selected_rooms.map((c,g)=>{const n=o.rooms[g];if(!n)return c;const y={...c.rate||{}};return y.board_basis=n.board_basis,n.check_in_date&&(y.check_in_date=n.check_in_date,y.checkin_date=n.check_in_date),n.check_out_date&&(y.check_out_date=n.check_out_date,y.checkout_date=n.check_out_date),{...c,name:n.name,room_name:n.name,board_basis:n.board_basis,free_cancellation:!!n.free_cancellation,check_in_date:n.check_in_date,checkin_date:n.check_in_date,check_out_date:n.check_out_date,checkout_date:n.check_out_date,night_count:We(n.night_count),hcn:n.hcn,confirmation_number:n.confirmation_number||n.hcn,bk_ref:n.bk_ref||n.hcn,pvd_bk_ref:n.pvd_bk_ref,rate:y}})),u}function Bt(r,o){var t,i;const s={pnr:o.pnr,airline_pnr:o.airline_pnr,supplier_reference:o.supplier_reference,confirmation_number:o.confirmation_number},a=r.segments||((i=(t=r.legs)==null?void 0:t[Object.keys(r.legs||{})[0]])==null?void 0:i.segments)||r.flight_segments||[];if(a.length>0&&o.segments.length>0){const u=a.map((c,g)=>{const n=o.segments[g];return n?{...c,type:n.type,airline_code:n.airline_code,carrier_code:n.airline_code,flight_no:n.flight_no,flight_number:n.flight_no,cabin_class:n.cabin_class,cabin:n.cabin_class,departure_airport_code:n.departure_airport_code,departure_datetime:n.departure_datetime,departure_at:n.departure_datetime,arrival_airport_code:n.arrival_airport_code,arrival_datetime:n.arrival_datetime,arrival_at:n.arrival_datetime}:c});s.segments=u,r.flight_segments&&(s.flight_segments=u)}return s}function wt(r,o){const s={pickup_from:o.pickup_from,dropoff_to:o.dropoff_to,pickup_place:o.pickup_from,dropoff_place:o.dropoff_to,pickup_location:o.pickup_from,dropoff_location:o.dropoff_to,transfer_date:o.pickup_date,pickup_date:o.pickup_date,transfer_time:o.pickup_time,pickup_time:o.pickup_time,vehicle:o.vehicle,meeting_point:o.meeting_point,instructions:o.instructions,booking_reference:o.booking_reference,confirm_reference:o.confirm_reference,supplier_reference:o.supplier_reference,confirmation_number:o.confirmation_number};return r.transfer&&(s.transfer={...r.transfer,from:o.pickup_from,to:o.dropoff_to,pickup:o.pickup_from,dropoff:o.dropoff_to,pickup_date:o.pickup_date,pickup_time:o.pickup_time,vehicle:o.vehicle,meeting_point:o.meeting_point,instructions:o.instructions}),s}function Tt(r,o){const s=(o.language_guides||"").split(",").map(t=>t.trim()).filter(Boolean);return{title:o.title,tour_name:o.title,location:o.location,departure_date:o.tour_date,tour_date:o.tour_date,duration:o.duration,description:o.description,language_guides:s,supplier_reference:o.supplier_reference,confirmation_number:o.confirmation_number}}function Rt(r,o){return{name:o.name,hotel_name:o.name,street_address:o.address,address:o.address,star:We(o.star),checkin_date:o.checkin_date,check_in_date:o.checkin_date,checkout_date:o.checkout_date,check_out_date:o.checkout_date,night_count:We(o.night_count),program_id:o.program_id,supplier_reference:o.supplier_reference,confirmation_number:o.confirmation_number}}function qt({isOpen:r,onClose:o,bookingId:s,bookingCode:a,product:t,prices:i,isAdmin:u,onRequestPriceChange:c}){var w;const{toast:g}=mr(),n=Rr(),[y,p]=P.useState(!1),[S,h]=P.useState(""),[C,x]=P.useState(()=>ai(t));P.useEffect(()=>{r&&t&&(x(ai(t)),h(""))},[r,t]);const N=C.type,f=(t==null?void 0:t.data)||{},D=_t[N]||Or,V=(k,F)=>x(B=>({...B,[k]:{...B[k],...F}})),z=(k,F)=>x(B=>{const be=B.hotel.rooms[k];if(!be)return B;const te={...be,...F};if(("check_in_date"in F||"check_out_date"in F)&&!("night_count"in F)){const le=Ei(te.check_in_date,te.check_out_date);le>0&&(te.night_count=String(le))}if("night_count"in F&&!("check_out_date"in F)){const le=Number(te.night_count);Number.isFinite(le)&&le>0&&te.check_in_date&&(te.check_out_date=At(te.check_in_date,le))}return{...B,hotel:{...B.hotel,rooms:B.hotel.rooms.map((le,W)=>W===k?te:le)}}}),K=(k,F)=>x(B=>({...B,flight:{...B.flight,segments:B.flight.segments.map((be,te)=>te===k?{...be,...F}:be)}})),v=async()=>{p(!0);try{let k={};N==="hotel"?k=Yt(f,C.hotel):N==="flight"?k=Bt(f,C.flight):N==="transfer"?k=wt(f,C.transfer):N==="tour"?k=Tt(f,C.tour):N==="stopover"&&(k=Rt(f,C.stopover)),await Ji(s,t.id,k,S||void 0),g({title:`${vr(N)} updated`}),n.invalidateQueries({queryKey:["easygds","booking-products",s]}),n.invalidateQueries({queryKey:["easygds","booking",s]}),n.invalidateQueries({queryKey:["easygds","booking-prices",s]}),o()}catch(k){g({variant:"destructive",title:"Failed to update",description:k.message})}finally{p(!1)}},_=N==="flight";return e.jsxDEV(Pr,{open:r,onOpenChange:o,children:e.jsxDEV(Cr,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[e.jsxDEV(kr,{children:e.jsxDEV(_r,{className:"flex items-center gap-2",children:[e.jsxDEV(D,{className:"h-5 w-5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:613,columnNumber:13},this),"Edit ",vr(N),e.jsxDEV(oe,{variant:"outline",className:"font-mono text-xs",children:a},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:615,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:612,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:611,columnNumber:9},this),e.jsxDEV(Gr,{defaultValue:"details",children:[e.jsxDEV(Yr,{className:"mb-4",children:[e.jsxDEV(Ce,{value:"details",className:"flex items-center gap-1",children:[e.jsxDEV(D,{className:"h-3.5 w-3.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:622,columnNumber:15},this)," Details"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:621,columnNumber:13},this),_&&e.jsxDEV(Ce,{value:"segments",className:"flex items-center gap-1",children:[e.jsxDEV(ze,{className:"h-3.5 w-3.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:626,columnNumber:17},this)," Segments"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:625,columnNumber:15},this),e.jsxDEV(Ce,{value:"pricing",className:"flex items-center gap-1",children:[e.jsxDEV(mo,{className:"h-3.5 w-3.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:630,columnNumber:15},this)," Pricing"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:629,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:620,columnNumber:11},this),e.jsxDEV(ke,{value:"details",children:e.jsxDEV("div",{className:"space-y-4",children:[N==="hotel"&&e.jsxDEV(Ft,{f:C.hotel,update:k=>V("hotel",k),updateRoom:z},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:637,columnNumber:36},this),N==="flight"&&e.jsxDEV(Ht,{f:C.flight,update:k=>V("flight",k)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:638,columnNumber:37},this),N==="transfer"&&e.jsxDEV(It,{f:C.transfer,update:k=>V("transfer",k)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:639,columnNumber:39},this),N==="tour"&&e.jsxDEV(zt,{f:C.tour,update:k=>V("tour",k)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:640,columnNumber:35},this),N==="stopover"&&e.jsxDEV(Kt,{f:C.stopover,update:k=>V("stopover",k)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:641,columnNumber:39},this),e.jsxDEV(ni,{reason:S,setReason:h,onClose:o,onSave:v,saving:y},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:642,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:636,columnNumber:13},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:635,columnNumber:11},this),_&&e.jsxDEV(ke,{value:"segments",children:e.jsxDEV("div",{className:"space-y-4",children:[e.jsxDEV(Mt,{segments:C.flight.segments,updateSegment:K},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:650,columnNumber:17},this),e.jsxDEV(ni,{reason:S,setReason:h,onClose:o,onSave:v,saving:y},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:651,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:649,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:648,columnNumber:13},this),e.jsxDEV(ke,{value:"pricing",children:e.jsxDEV($t,{product:t,prices:i||[],currency:String(((w=C[N])==null?void 0:w.currency)||"USD"),isAdmin:!!u,onRequestChange:c?()=>{c(t.id),o()}:void 0},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:663,columnNumber:13},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:662,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:619,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:610,columnNumber:7},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:609,columnNumber:5},this)}function Ft({f:r,update:o,updateRoom:s}){return e.jsxDEV(e.Fragment,{children:[e.jsxDEV(rr,{title:"Hotel",children:[e.jsxDEV("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxDEV(Y,{label:"Hotel Name",value:String(r.name),onChange:a=>o({name:a})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:695,columnNumber:11},this),e.jsxDEV(Y,{label:"Stars",type:"number",value:String(r.star),onChange:a=>o({star:a})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:696,columnNumber:11},this),e.jsxDEV(Y,{label:"Phone",value:String(r.phone),onChange:a=>o({phone:a})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:697,columnNumber:11},this),e.jsxDEV(Y,{label:"Fax",value:String(r.fax),onChange:a=>o({fax:a})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:698,columnNumber:11},this),e.jsxDEV(Y,{label:"Email",value:String(r.email),onChange:a=>o({email:a})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:699,columnNumber:11},this),e.jsxDEV(Y,{label:"Free Cancellation Deadline",type:"datetime-local",value:r.free_cancellation_deadline,onChange:a=>o({free_cancellation_deadline:a})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:700,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:694,columnNumber:9},this),e.jsxDEV("p",{className:"text-[11px] text-gray-500 mt-2",children:"Check-in / check-out dates are per-room — edit them on each room below. The hotel-level summary date range is recomputed from the rooms on save."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:702,columnNumber:9},this),e.jsxDEV("div",{className:"mt-3",children:[e.jsxDEV("label",{className:"text-xs text-gray-500 font-medium",children:"Address"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:706,columnNumber:11},this),e.jsxDEV(ce,{className:"mt-0.5 h-8 text-sm",value:String(r.address),onChange:a=>o({address:a.target.value})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:707,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:705,columnNumber:9},this),e.jsxDEV("div",{className:"grid grid-cols-1 gap-3 mt-3",children:e.jsxDEV(Y,{label:"Supplier Reference",value:String(r.supplier_reference),onChange:a=>o({supplier_reference:a})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:713,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:712,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:693,columnNumber:7},this),r.rooms.length>0&&e.jsxDEV(rr,{title:`Rooms (${r.rooms.length})`,children:e.jsxDEV("div",{className:"space-y-3",children:r.rooms.map((a,t)=>e.jsxDEV("div",{className:"border rounded-lg p-3 bg-gray-50 space-y-3",children:[e.jsxDEV("div",{className:"text-xs font-semibold text-gray-700",children:["Room #",t+1,a.name?e.jsxDEV("span",{className:"text-gray-500 font-normal",children:[" — ",a.name]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:723,columnNumber:45},this):null]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:722,columnNumber:17},this),e.jsxDEV("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxDEV(Y,{label:"Room Name",value:String(a.name),onChange:i=>s(t,{name:i})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:726,columnNumber:19},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500 font-medium",children:"Board Basis"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:728,columnNumber:21},this),e.jsxDEV(ce,{list:"board-basis-options",className:"mt-0.5 h-8 text-sm",placeholder:"Room Only",value:String(a.board_basis),onChange:i=>s(t,{board_basis:i.target.value})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:729,columnNumber:21},this),e.jsxDEV("datalist",{id:"board-basis-options",children:[e.jsxDEV("option",{value:"Room Only"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:737,columnNumber:23},this),e.jsxDEV("option",{value:"Bed & Breakfast"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:738,columnNumber:23},this),e.jsxDEV("option",{value:"Half Board"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:739,columnNumber:23},this),e.jsxDEV("option",{value:"Full Board"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:740,columnNumber:23},this),e.jsxDEV("option",{value:"All Inclusive"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:741,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:736,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:727,columnNumber:19},this),e.jsxDEV(Y,{label:"Check-in",type:"date",value:a.check_in_date,onChange:i=>s(t,{check_in_date:i})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:744,columnNumber:19},this),e.jsxDEV(Y,{label:"Check-out",type:"date",value:a.check_out_date,onChange:i=>s(t,{check_out_date:i})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:745,columnNumber:19},this),e.jsxDEV(Y,{label:"Nights",type:"number",value:String(a.night_count),onChange:i=>s(t,{night_count:i})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:746,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:725,columnNumber:17},this),e.jsxDEV("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsxDEV(Ni,{checked:!!a.free_cancellation,onCheckedChange:i=>s(t,{free_cancellation:!!i})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:749,columnNumber:19},this),e.jsxDEV("span",{className:"text-sm",children:"Refundable / Free cancellation"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:753,columnNumber:19},this),e.jsxDEV(oe,{className:`text-[10px] ml-1 ${a.free_cancellation?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:a.free_cancellation?"Yes":"No"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:754,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:748,columnNumber:17},this),e.jsxDEV("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxDEV(Y,{label:"HCN",value:String(a.hcn),onChange:i=>s(t,{hcn:i})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:759,columnNumber:19},this),e.jsxDEV(Y,{label:"Confirmation #",value:String(a.confirmation_number),onChange:i=>s(t,{confirmation_number:i})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:760,columnNumber:19},this),e.jsxDEV(Y,{label:"Booking Ref",value:String(a.bk_ref),onChange:i=>s(t,{bk_ref:i})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:761,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:758,columnNumber:17},this),e.jsxDEV(Y,{label:"Provider Booking Ref (pvd_bk_ref)",value:String(a.pvd_bk_ref),onChange:i=>s(t,{pvd_bk_ref:i})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:763,columnNumber:17},this),Array.isArray(a.cancellation_policies)&&a.cancellation_policies.length>0&&e.jsxDEV(Qt,{policies:a.cancellation_policies},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:765,columnNumber:19},this)]},t,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:721,columnNumber:15},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:719,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:718,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:692,columnNumber:5},this)}function $t({product:r,prices:o,currency:s,isAdmin:a,onRequestChange:t}){var _,w,k,F,B,be,te,le,W,L,Ne,U,he,T,Se,Q,b,d,me,se,Z;const i=o.find(J=>J.object_type==="BookingProduct"&&J.object_id===(r==null?void 0:r.id)),u=String((i==null?void 0:i.currency)||s||"USD").toUpperCase(),c=((_=r==null?void 0:r.data)==null?void 0:_.currency_info)||((B=(F=(k=(w=r==null?void 0:r.data)==null?void 0:w.selected_rooms)==null?void 0:k[0])==null?void 0:F.rate)==null?void 0:B.currency_info)||((le=(te=(be=r==null?void 0:r.data)==null?void 0:be.selected_rooms)==null?void 0:te[0])==null?void 0:le.currency_info)||((L=(W=r==null?void 0:r.data)==null?void 0:W.fare)==null?void 0:L.currency_info)||{},g=Number(c.rate),n=Number.isFinite(g)&&g>0?g:null,y=String(c.origin||"").toUpperCase(),p=String(c.target||"").toUpperCase(),S=String((p&&p!==u?p:"")||(y&&y!==u?y:"")||((Ne=r==null?void 0:r.data)==null?void 0:Ne.currency)||((he=(U=r==null?void 0:r.data)==null?void 0:U.fare)==null?void 0:he.currency)||((b=(Q=(Se=(T=r==null?void 0:r.data)==null?void 0:T.selected_rooms)==null?void 0:Se[0])==null?void 0:Q.rate)==null?void 0:b.currency)||((se=(me=(d=r==null?void 0:r.data)==null?void 0:d.selected_rooms)==null?void 0:me[0])==null?void 0:se.currency)||u).toUpperCase(),h=S!==u;let C=null;n!=null&&h&&(y===S&&p===u?C=n:y===u&&p===S&&(C=1/n));const x=(J,j)=>{if(J==null||J==="")return"-";const H=Number(J);return Number.isFinite(H)?`${j} ${H.toFixed(2)}`:"-"},N=J=>x(J,u),f=J=>x(J,S),D=J=>{if(C==null)return null;const j=Number(J);return Number.isFinite(j)?j*C:null},V=J=>{if(C==null)return null;const j=Number(J);return Number.isFinite(j)?j/C:null};let z=null,K=null;if((i==null?void 0:i.total_amount)!=null&&(i==null?void 0:i.supplier_total_amount)!=null){const J=h?D(i.supplier_total_amount):Number(i.supplier_total_amount);if(J!=null&&Number.isFinite(J)){z=Number(i.total_amount)-J;const j=V(z);K=h&&j!=null?j:null}}const v=i?Number(i.markup_amount||0)-Number(i.tax_amount||0)-Number(i.vat_amount||0)-Number(i.discount_amount||0):null;return e.jsxDEV("div",{className:"space-y-4",children:[e.jsxDEV("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-3 text-xs text-amber-800 flex items-start gap-2",children:[e.jsxDEV("span",{"aria-hidden":!0,children:"ℹ️"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:915,columnNumber:9},this),e.jsxDEV("div",{children:[e.jsxDEV("strong",{children:"Pricing is read-only here."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:917,columnNumber:11},this)," Changes to price on a confirmed booking can affect customer invoices and supplier settlements, so they go through the ",e.jsxDEV("em",{children:"support-request"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:917,columnNumber:173},this)," flow — which records a charge or refund and keeps a full audit trail. Use the button below to start one."]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:916,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:914,columnNumber:7},this),i?e.jsxDEV(rr,{title:"Pricing breakdown",children:[e.jsxDEV("div",{className:"border rounded divide-y text-sm",children:[e.jsxDEV(tr,{label:"Base Amount",value:N(i.base_amount),subValue:h&&V(i.base_amount)!=null?`≈ ${f(V(i.base_amount))} (supplier)`:null},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:928,columnNumber:13},this),e.jsxDEV(tr,{label:"Markup",value:N(i.markup_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:940,columnNumber:13},this),Number(i.tax_amount)>0&&e.jsxDEV(tr,{label:"Tax",value:N(i.tax_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:941,columnNumber:51},this),Number(i.vat_amount)>0&&e.jsxDEV(tr,{label:"VAT",value:N(i.vat_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:942,columnNumber:51},this),Number(i.discount_amount)>0&&e.jsxDEV(tr,{label:"Discount",value:`-${N(i.discount_amount)}`},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:943,columnNumber:56},this),Number(i.reward_points)>0&&e.jsxDEV(tr,{label:"Reward Points",value:`${i.reward_points} pts`},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:945,columnNumber:15},this),e.jsxDEV("div",{className:"flex justify-between items-center px-3 py-2 bg-gray-50",children:[e.jsxDEV("span",{className:"font-bold",children:"Total (sale)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:948,columnNumber:15},this),e.jsxDEV("span",{className:"font-bold text-green-700",children:N(i.total_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:949,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:947,columnNumber:13},this),i.supplier_total_amount!=null&&e.jsxDEV(tr,{label:"Supplier Total (net)",value:h&&D(i.supplier_total_amount)!=null?N(D(i.supplier_total_amount)):f(i.supplier_total_amount),subValue:h?`${f(i.supplier_total_amount)} (supplier)`:null},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:953,columnNumber:15},this),z!=null&&e.jsxDEV("div",{className:"flex justify-between items-center px-3 py-2 bg-blue-50 text-xs",children:[e.jsxDEV("span",{className:"text-blue-700 font-medium",children:["Profit (Total − Supplier Total",h?", FX-adjusted":"",")"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:980,columnNumber:17},this),e.jsxDEV("div",{className:"text-right",children:[e.jsxDEV("div",{className:`font-semibold ${z<0?"text-red-600":"text-blue-700"}`,children:N(z)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:984,columnNumber:19},this),K!=null&&e.jsxDEV("div",{className:"text-[10px] text-gray-500",children:["≈ ",f(K)," (supplier)"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:988,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:983,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:979,columnNumber:15},this),a&&v!=null&&e.jsxDEV("div",{className:"flex justify-between items-center px-3 py-2 bg-gray-50 text-xs",children:[e.jsxDEV("span",{className:"text-gray-700 font-medium",children:"Sale-side margin (Markup − Tax − VAT − Discount)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1001,columnNumber:17},this),e.jsxDEV("span",{className:`font-semibold ${v<0?"text-red-600":"text-gray-700"}`,children:N(v)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1004,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1e3,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:927,columnNumber:11},this),h&&n!=null&&C!=null&&e.jsxDEV("div",{className:"text-[11px] text-gray-500 mt-2 px-1 flex justify-between",children:[e.jsxDEV("span",{children:"Exchange rate"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1015,columnNumber:15},this),e.jsxDEV("span",{className:"font-mono",children:[y||S," → ",p||u," @ ",n]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1016,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1014,columnNumber:13},this),h&&n==null&&e.jsxDEV("div",{className:"text-[11px] text-amber-700 mt-2 px-1 italic",children:"Exchange rate not available on this booking — supplier and customer values shown in their own currencies (no conversion)."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1022,columnNumber:13},this),a&&i&&e.jsxDEV("details",{className:"text-[10px] text-gray-400 mt-2 px-1",children:[e.jsxDEV("summary",{className:"cursor-pointer hover:text-gray-600",children:"Currency detection (debug)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1036,columnNumber:15},this),e.jsxDEV("div",{className:"font-mono mt-1 space-y-0.5",children:[e.jsxDEV("div",{children:["customer = ",e.jsxDEV("strong",{children:u},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1038,columnNumber:33},this)," (priceEntry.currency)"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1038,columnNumber:17},this),e.jsxDEV("div",{children:["supplier = ",e.jsxDEV("strong",{children:S},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1039,columnNumber:33},this)," ",h?"(differs)":"(same as customer — no FX applied)"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1039,columnNumber:17},this),e.jsxDEV("div",{children:["fx.origin = ",y||"∅"," | fx.target = ",p||"∅"," | fx.rate = ",n??"∅"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1040,columnNumber:17},this),e.jsxDEV("div",{children:["supplier→customer factor = ",C??"∅"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1041,columnNumber:17},this),e.jsxDEV("div",{children:["price.supplier_total_amount = ",i.supplier_total_amount??"∅"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1042,columnNumber:17},this),e.jsxDEV("div",{children:["product.data.currency = ",((Z=r==null?void 0:r.data)==null?void 0:Z.currency)||"∅"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1043,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1037,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1035,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:926,columnNumber:9},this):e.jsxDEV("div",{className:"text-sm text-gray-500 text-center p-6 border rounded-lg bg-gray-50",children:"No pricing data found for this service in the prices feed."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:922,columnNumber:9},this),t&&e.jsxDEV("div",{className:"flex justify-end gap-2 pt-2 border-t",children:e.jsxDEV(G,{variant:"outline",onClick:t,className:"border-orange-300 text-orange-700 hover:bg-orange-50",children:[e.jsxDEV(mo,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1053,columnNumber:13},this),"Request price change"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1052,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1051,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:913,columnNumber:5},this)}function tr({label:r,value:o,subValue:s}){return e.jsxDEV("div",{className:"flex justify-between items-center px-3 py-2",children:[e.jsxDEV("span",{className:"text-gray-700",children:r},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1067,columnNumber:7},this),e.jsxDEV("div",{className:"text-right",children:[e.jsxDEV("div",{className:"font-mono",children:o},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1069,columnNumber:9},this),s&&e.jsxDEV("div",{className:"text-[10px] text-gray-500 font-mono mt-0.5",children:s},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1070,columnNumber:22},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1068,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1066,columnNumber:5},this)}function Ht({f:r,update:o}){return e.jsxDEV(rr,{title:"Flight",children:[e.jsxDEV("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxDEV(Y,{label:"PNR",value:String(r.pnr),onChange:s=>o({pnr:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1080,columnNumber:9},this),e.jsxDEV(Y,{label:"Airline PNR",value:String(r.airline_pnr),onChange:s=>o({airline_pnr:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1081,columnNumber:9},this),e.jsxDEV(Y,{label:"Supplier Reference",value:String(r.supplier_reference),onChange:s=>o({supplier_reference:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1082,columnNumber:9},this),e.jsxDEV(Y,{label:"Confirmation Number",value:String(r.confirmation_number),onChange:s=>o({confirmation_number:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1083,columnNumber:9},this),e.jsxDEV(Y,{label:"Free Cancellation Deadline",type:"datetime-local",value:r.free_cancellation_deadline,onChange:s=>o({free_cancellation_deadline:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1084,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1079,columnNumber:7},this),e.jsxDEV("p",{className:"text-[11px] text-gray-500 mt-2",children:"Edit per-segment details (route, dates, airline, cabin) on the Segments tab."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1086,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1078,columnNumber:5},this)}function Mt({segments:r,updateSegment:o}){return r.length===0?e.jsxDEV("div",{className:"text-sm text-gray-500 text-center p-4 border rounded-lg bg-gray-50",children:"No segments on this flight."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1096,columnNumber:7},this):e.jsxDEV(rr,{title:`Segments (${r.length})`,children:[e.jsxDEV("p",{className:"text-[11px] text-gray-500 mb-3",children:"Changing route, dates, or airline can break the booking with the supplier — only edit if you've already coordinated the change upstream."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1103,columnNumber:7},this),e.jsxDEV("div",{className:"space-y-3",children:r.map((s,a)=>e.jsxDEV("div",{className:"border rounded-lg p-3 bg-gray-50 space-y-3",children:[e.jsxDEV("div",{className:"text-xs font-semibold text-gray-700",children:["Segment #",a+1," — ",s.type||"departure"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1109,columnNumber:13},this),e.jsxDEV("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500 font-medium",children:"Type"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1114,columnNumber:17},this),e.jsxDEV("select",{className:"mt-0.5 h-8 text-sm w-full border border-gray-300 rounded px-2",value:s.type,onChange:t=>o(a,{type:t.target.value}),children:[e.jsxDEV("option",{value:"departure",children:"departure"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1120,columnNumber:19},this),e.jsxDEV("option",{value:"return",children:"return"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1121,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1115,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1113,columnNumber:15},this),e.jsxDEV(Y,{label:"Cabin Class",value:String(s.cabin_class),onChange:t=>o(a,{cabin_class:t})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1124,columnNumber:15},this),e.jsxDEV(Y,{label:"Airline Code",value:String(s.airline_code),onChange:t=>o(a,{airline_code:t.toUpperCase()})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1125,columnNumber:15},this),e.jsxDEV(Y,{label:"Flight Number",value:String(s.flight_no),onChange:t=>o(a,{flight_no:t})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1126,columnNumber:15},this),e.jsxDEV(Y,{label:"Departure Airport (IATA)",value:String(s.departure_airport_code),onChange:t=>o(a,{departure_airport_code:t.toUpperCase()})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1127,columnNumber:15},this),e.jsxDEV(Y,{label:"Departure Date/Time",type:"datetime-local",value:s.departure_datetime,onChange:t=>o(a,{departure_datetime:t})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1128,columnNumber:15},this),e.jsxDEV(Y,{label:"Arrival Airport (IATA)",value:String(s.arrival_airport_code),onChange:t=>o(a,{arrival_airport_code:t.toUpperCase()})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1129,columnNumber:15},this),e.jsxDEV(Y,{label:"Arrival Date/Time",type:"datetime-local",value:s.arrival_datetime,onChange:t=>o(a,{arrival_datetime:t})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1130,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1112,columnNumber:13},this)]},a,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1108,columnNumber:11},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1106,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1102,columnNumber:5},this)}function It({f:r,update:o}){return e.jsxDEV(rr,{title:"Transfer",children:[e.jsxDEV("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxDEV(Y,{label:"Pickup From",value:String(r.pickup_from),onChange:s=>o({pickup_from:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1143,columnNumber:9},this),e.jsxDEV(Y,{label:"Dropoff To",value:String(r.dropoff_to),onChange:s=>o({dropoff_to:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1144,columnNumber:9},this),e.jsxDEV(Y,{label:"Pickup Date",type:"date",value:r.pickup_date,onChange:s=>o({pickup_date:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1145,columnNumber:9},this),e.jsxDEV(Y,{label:"Pickup Time",type:"time",value:String(r.pickup_time),onChange:s=>o({pickup_time:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1146,columnNumber:9},this),e.jsxDEV(Y,{label:"Vehicle",value:String(r.vehicle),onChange:s=>o({vehicle:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1147,columnNumber:9},this),e.jsxDEV(Y,{label:"Meeting Point",value:String(r.meeting_point),onChange:s=>o({meeting_point:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1148,columnNumber:9},this),e.jsxDEV(Y,{label:"Booking Reference",value:String(r.booking_reference),onChange:s=>o({booking_reference:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1149,columnNumber:9},this),e.jsxDEV(Y,{label:"Confirm Reference",value:String(r.confirm_reference),onChange:s=>o({confirm_reference:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1150,columnNumber:9},this),e.jsxDEV(Y,{label:"Supplier Reference",value:String(r.supplier_reference),onChange:s=>o({supplier_reference:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1151,columnNumber:9},this),e.jsxDEV(Y,{label:"Confirmation Number",value:String(r.confirmation_number),onChange:s=>o({confirmation_number:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1152,columnNumber:9},this),e.jsxDEV(Y,{label:"Free Cancellation Deadline",type:"datetime-local",value:r.free_cancellation_deadline,onChange:s=>o({free_cancellation_deadline:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1153,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1142,columnNumber:7},this),e.jsxDEV("div",{className:"mt-3",children:[e.jsxDEV("label",{className:"text-xs text-gray-500 font-medium",children:"Instructions"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1156,columnNumber:9},this),e.jsxDEV(Ke,{className:"text-sm mt-1",rows:3,value:String(r.instructions),onChange:s=>o({instructions:s.target.value})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1157,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1155,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1141,columnNumber:5},this)}function zt({f:r,update:o}){return e.jsxDEV(rr,{title:"Tour",children:[e.jsxDEV("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxDEV(Y,{label:"Tour Title",value:String(r.title),onChange:s=>o({title:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1172,columnNumber:9},this),e.jsxDEV(Y,{label:"Location",value:String(r.location),onChange:s=>o({location:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1173,columnNumber:9},this),e.jsxDEV(Y,{label:"Tour Date",type:"date",value:r.tour_date,onChange:s=>o({tour_date:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1174,columnNumber:9},this),e.jsxDEV(Y,{label:"Duration",value:String(r.duration),onChange:s=>o({duration:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1175,columnNumber:9},this),e.jsxDEV(Y,{label:"Languages (comma-separated)",value:String(r.language_guides),onChange:s=>o({language_guides:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1176,columnNumber:9},this),e.jsxDEV(Y,{label:"Free Cancellation Deadline",type:"datetime-local",value:r.free_cancellation_deadline,onChange:s=>o({free_cancellation_deadline:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1177,columnNumber:9},this),e.jsxDEV(Y,{label:"Supplier Reference",value:String(r.supplier_reference),onChange:s=>o({supplier_reference:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1178,columnNumber:9},this),e.jsxDEV(Y,{label:"Confirmation Number",value:String(r.confirmation_number),onChange:s=>o({confirmation_number:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1179,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1171,columnNumber:7},this),e.jsxDEV("div",{className:"mt-3",children:[e.jsxDEV("label",{className:"text-xs text-gray-500 font-medium",children:"Description"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1182,columnNumber:9},this),e.jsxDEV(Ke,{className:"text-sm mt-1",rows:4,value:String(r.description),onChange:s=>o({description:s.target.value})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1183,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1181,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1170,columnNumber:5},this)}function Kt({f:r,update:o}){return e.jsxDEV(rr,{title:"Stopover",children:[e.jsxDEV("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxDEV(Y,{label:"Hotel Name",value:String(r.name),onChange:s=>o({name:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1198,columnNumber:9},this),e.jsxDEV(Y,{label:"Stars",type:"number",value:String(r.star),onChange:s=>o({star:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1199,columnNumber:9},this),e.jsxDEV(Y,{label:"Check-in",type:"date",value:r.checkin_date,onChange:s=>o({checkin_date:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1200,columnNumber:9},this),e.jsxDEV(Y,{label:"Check-out",type:"date",value:r.checkout_date,onChange:s=>o({checkout_date:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1201,columnNumber:9},this),e.jsxDEV(Y,{label:"Night Count",type:"number",value:String(r.night_count),onChange:s=>o({night_count:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1202,columnNumber:9},this),e.jsxDEV(Y,{label:"Program ID",value:String(r.program_id),onChange:s=>o({program_id:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1203,columnNumber:9},this),e.jsxDEV(Y,{label:"Supplier Reference",value:String(r.supplier_reference),onChange:s=>o({supplier_reference:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1204,columnNumber:9},this),e.jsxDEV(Y,{label:"Confirmation Number",value:String(r.confirmation_number),onChange:s=>o({confirmation_number:s})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1205,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1197,columnNumber:7},this),e.jsxDEV("div",{className:"mt-3",children:[e.jsxDEV("label",{className:"text-xs text-gray-500 font-medium",children:"Address"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1208,columnNumber:9},this),e.jsxDEV(ce,{className:"mt-0.5 h-8 text-sm",value:String(r.address),onChange:s=>o({address:s.target.value})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1209,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1207,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1196,columnNumber:5},this)}function Qt({policies:r}){return e.jsxDEV("div",{className:"text-xs",children:[e.jsxDEV("div",{className:"text-gray-500 font-medium mb-1",children:"Cancellation Policies (read-only)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1218,columnNumber:7},this),e.jsxDEV("table",{className:"w-full",children:[e.jsxDEV("thead",{children:e.jsxDEV("tr",{className:"bg-gray-100 text-gray-600",children:[e.jsxDEV("th",{className:"p-1 text-left font-medium",children:"From"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1222,columnNumber:13},this),e.jsxDEV("th",{className:"p-1 text-left font-medium",children:"To"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1223,columnNumber:13},this),e.jsxDEV("th",{className:"p-1 text-right font-medium",children:"Amount"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1224,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1221,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1220,columnNumber:9},this),e.jsxDEV("tbody",{children:r.map((o,s)=>e.jsxDEV("tr",{className:"border-b border-gray-200",children:[e.jsxDEV("td",{className:"p-1",children:er(o.from||o.start_date)||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1230,columnNumber:15},this),e.jsxDEV("td",{className:"p-1",children:er(o.to||o.end_date)||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1231,columnNumber:15},this),e.jsxDEV("td",{className:"p-1 text-right font-mono",children:o.amount??o.total_amount??"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1232,columnNumber:15},this)]},s,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1229,columnNumber:13},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1227,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1219,columnNumber:7},this),e.jsxDEV("div",{className:"text-[10px] text-gray-400 mt-1",children:"These are enforced upstream — use a support request to change them."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1237,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1217,columnNumber:5},this)}function ni({reason:r,setReason:o,onClose:s,onSave:a,saving:t}){return e.jsxDEV(e.Fragment,{children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500 font-medium",children:"Reason (optional)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1248,columnNumber:9},this),e.jsxDEV(Ke,{placeholder:"Why are you making this change? (logged for audit)",value:r,onChange:i=>o(i.target.value),className:"text-sm mt-1",rows:2},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1249,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1247,columnNumber:7},this),e.jsxDEV("div",{className:"flex justify-end gap-2 pt-2 border-t",children:[e.jsxDEV(G,{variant:"outline",onClick:s,disabled:t,children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1258,columnNumber:9},this),e.jsxDEV(G,{onClick:a,disabled:t,children:[t?e.jsxDEV(oo,{className:"h-4 w-4 mr-1 animate-spin"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1260,columnNumber:21},this):e.jsxDEV(wr,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1260,columnNumber:73},this),"Save Changes"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1259,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1257,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1246,columnNumber:5},this)}function rr({title:r,children:o}){return e.jsxDEV("div",{className:"space-y-2",children:[e.jsxDEV("h4",{className:"text-xs font-semibold text-gray-600 uppercase tracking-wide",children:r},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1271,columnNumber:7},this),o]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1270,columnNumber:5},this)}function Y({label:r,value:o,onChange:s,type:a="text"}){return e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500 font-medium",children:r},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1280,columnNumber:7},this),e.jsxDEV(ce,{type:a,className:"mt-0.5 h-8 text-sm",value:o,onChange:t=>s(t.target.value)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1281,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EditServiceDialog.tsx",lineNumber:1279,columnNumber:5},this)}const Zt={booking_created:{icon:nt,color:"bg-emerald-100 text-emerald-700",label:"Booking"},audit:{icon:ar,color:"bg-blue-100 text-blue-700",label:"Edit"},support_request_created:{icon:$e,color:"bg-orange-100 text-orange-700",label:"Support"},support_activity:{icon:$e,color:"bg-orange-50 text-orange-600",label:"Support"},support_message:{icon:et,color:"bg-violet-100 text-violet-700",label:"Message"},charge:{icon:mo,color:"bg-amber-100 text-amber-800",label:"Charge"},refund:{icon:Xs,color:"bg-green-100 text-green-700",label:"Refund"},approval_request:{icon:lr,color:"bg-indigo-100 text-indigo-700",label:"Approval"},approval_response:{icon:lr,color:"bg-indigo-50 text-indigo-600",label:"Approval"},email_sent:{icon:gr,color:"bg-sky-100 text-sky-700",label:"Email out"},email_received:{icon:gr,color:"bg-sky-50 text-sky-600",label:"Email in"},review:{icon:Js,color:"bg-purple-100 text-purple-700",label:"Review"}},li=[{id:"all",label:"All",kinds:null},{id:"edits",label:"Edits",kinds:["audit","booking_created","review"]},{id:"support",label:"Support",kinds:["support_request_created","support_activity","support_message","approval_request","approval_response"]},{id:"money",label:"Money",kinds:["charge","refund"]},{id:"emails",label:"Emails",kinds:["email_sent","email_received"]}];function Wt({bookingCode:r}){const[o,s]=P.useState("all"),{data:a,isLoading:t,error:i}=Ve({queryKey:["booking-timeline",r],queryFn:()=>os(r),staleTime:1e4}),u=(a==null?void 0:a.events)||[],c=P.useMemo(()=>{const p=li.find(h=>h.id===o);if(!p||!p.kinds)return u;const S=new Set(p.kinds);return u.filter(h=>S.has(h.kind))},[u,o]),g=P.useMemo(()=>oa(c),[c]);if(t)return e.jsxDEV(ae,{children:e.jsxDEV(ne,{className:"p-6 text-center text-sm text-gray-500",children:"Loading booking history…"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:71,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:70,columnNumber:7},this);if(i)return e.jsxDEV(ae,{children:e.jsxDEV(ne,{className:"p-6 text-center text-sm text-red-600 flex items-center justify-center gap-2",children:[e.jsxDEV(Je,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:82,columnNumber:11},this)," Couldn't load history: ",i.message]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:81,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:80,columnNumber:7},this);if(u.length===0)return e.jsxDEV(ae,{children:e.jsxDEV(ne,{className:"p-8 text-center text-sm text-gray-500",children:[e.jsxDEV(so,{className:"h-8 w-8 mx-auto text-gray-300 mb-2"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:92,columnNumber:11},this),"No history recorded for this booking yet."]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:91,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:90,columnNumber:7},this);const n=u.reduce((p,S)=>(p[S.kind]=(p[S.kind]||0)+1,p),{}),y=li.map(p=>({...p,count:p.kinds?p.kinds.reduce((S,h)=>S+(n[h]||0),0):u.length}));return e.jsxDEV("div",{className:"space-y-3",children:[e.jsxDEV("div",{className:"flex items-center justify-between text-xs text-gray-500 flex-wrap gap-2",children:[e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV(so,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:114,columnNumber:11},this),e.jsxDEV("span",{className:"font-medium",children:[u.length," event",u.length===1?"":"s"," on this booking"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:115,columnNumber:11},this),c.length!==u.length&&e.jsxDEV("span",{className:"text-gray-400",children:["(",c.length," after filter)"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:119,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:113,columnNumber:9},this),e.jsxDEV("span",{title:"Timestamps shown in your browser's local timezone",children:["Times in ",e.jsxDEV("span",{className:"font-mono",children:Pt()},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:123,columnNumber:20},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:122,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:112,columnNumber:7},this),e.jsxDEV("div",{className:"flex flex-wrap gap-2 pb-1 border-b",children:[e.jsxDEV(Xi,{className:"h-3.5 w-3.5 text-gray-400 mt-1.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:129,columnNumber:9},this),y.map(p=>e.jsxDEV(G,{variant:o===p.id?"default":"outline",size:"sm",className:"h-7 text-xs",onClick:()=>s(p.id),children:[p.label,e.jsxDEV("span",{className:"ml-1.5 text-[10px] opacity-70",children:p.count},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:139,columnNumber:13},this)]},p.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:131,columnNumber:11},this))]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:128,columnNumber:7},this),e.jsxDEV("div",{className:"space-y-4",children:g.map(({date:p,items:S})=>e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2 sticky top-0 bg-white py-1",children:p},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:148,columnNumber:13},this),e.jsxDEV("div",{className:"space-y-2",children:S.map(h=>e.jsxDEV(Jt,{event:h},h.id,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:152,columnNumber:32},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:151,columnNumber:13},this)]},p,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:147,columnNumber:11},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:145,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:111,columnNumber:5},this)}function Jt({event:r}){const[o,s]=P.useState(!1),a=Zt[r.kind]||{icon:Je,color:"bg-gray-100 text-gray-700",label:r.kind},t=a.icon,i=r.actor_name||r.actor_email||(r.kind==="booking_created"?"System":null),u=r.metadata&&(r.metadata.before||r.metadata.after||Object.keys(r.metadata).length>0);return e.jsxDEV(ae,{className:"overflow-hidden",children:e.jsxDEV(ne,{className:"p-3",children:[e.jsxDEV("button",{type:"button",onClick:()=>s(c=>!c),className:"w-full flex items-start gap-3 text-left",children:[e.jsxDEV("span",{className:`shrink-0 w-7 h-7 rounded-full flex items-center justify-center ${a.color}`,children:e.jsxDEV(t,{className:"h-3.5 w-3.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:177,columnNumber:13},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:176,columnNumber:11},this),e.jsxDEV("div",{className:"flex-1 min-w-0",children:[e.jsxDEV("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxDEV(oe,{className:`text-[10px] ${a.color}`,children:a.label},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:181,columnNumber:15},this),e.jsxDEV("span",{className:"text-sm font-medium text-gray-800",children:r.title},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:182,columnNumber:15},this),e.jsxDEV("span",{className:"text-xs text-gray-400 flex items-center gap-1 ml-auto whitespace-nowrap",children:[e.jsxDEV(ao,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:184,columnNumber:17},this)," ",fi(r.timestamp,"HH:mm:ss")]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:183,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:180,columnNumber:13},this),(i||r.description)&&e.jsxDEV("div",{className:"text-xs text-gray-500 mt-0.5 flex items-center gap-2 flex-wrap",children:[i&&e.jsxDEV("span",{className:"flex items-center gap-1",children:[e.jsxDEV(lo,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:191,columnNumber:21},this)," ",i]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:190,columnNumber:19},this),r.description&&e.jsxDEV("span",{className:"text-gray-600 italic",children:r.description},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:195,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:188,columnNumber:15},this),u&&e.jsxDEV("div",{className:"text-[11px] text-gray-400 mt-1",children:[o?"Click to collapse":"Click to view details",e.jsxDEV("span",{className:"ml-1",children:o?e.jsxDEV(es,{className:"inline h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:202,columnNumber:48},this):e.jsxDEV(rs,{className:"inline h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:202,columnNumber:93},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:202,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:200,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:179,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:171,columnNumber:9},this),o&&e.jsxDEV("div",{className:"mt-3 pl-10 space-y-2",children:[r.kind==="audit"&&(r.metadata.before||r.metadata.after)?e.jsxDEV(ea,{before:r.metadata.before,after:r.metadata.after},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:213,columnNumber:15},this):e.jsxDEV(ra,{metadata:r.metadata},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:215,columnNumber:15},this),e.jsxDEV("div",{className:"text-[10px] text-gray-400 flex items-center gap-3 pt-1 border-t",children:[e.jsxDEV("span",{children:["Kind: ",e.jsxDEV("span",{className:"font-mono",children:r.kind},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:218,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:218,columnNumber:15},this),r.action&&e.jsxDEV("span",{children:["Action: ",e.jsxDEV("span",{className:"font-mono",children:r.action},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:219,columnNumber:46},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:219,columnNumber:32},this),r.actor_email&&e.jsxDEV("span",{children:["Email: ",r.actor_email]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:220,columnNumber:37},this),e.jsxDEV("span",{className:"ml-auto",children:["ID: ",e.jsxDEV("span",{className:"font-mono",children:[r.id.slice(0,16),"…"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:221,columnNumber:45},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:221,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:217,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:209,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:170,columnNumber:7},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:169,columnNumber:5},this)}function Xt(r,o){if(!r&&!o)return[];(typeof r!="object"||r==null)&&(r={}),(typeof o!="object"||o==null)&&(o={});const s=new Set([...Object.keys(r),...Object.keys(o)]),a=[];for(const t of s){if(t==="product_id"||t==="kind"||t==="app_id")continue;const i=r[t],u=o[t];JSON.stringify(i)!==JSON.stringify(u)&&a.push({key:t,before:i,after:u})}return a}function ea({before:r,after:o}){const s=Xt(r,o);return s.length===0?e.jsxDEV("div",{className:"text-xs text-gray-500 italic",children:"No structured diff recorded."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:250,columnNumber:12},this):e.jsxDEV("div",{className:"border rounded text-xs overflow-hidden",children:[e.jsxDEV("div",{className:"grid grid-cols-3 bg-gray-50 px-2 py-1.5 font-medium text-gray-600 border-b",children:[e.jsxDEV("div",{children:"Field"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:255,columnNumber:9},this),e.jsxDEV("div",{children:"Before"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:256,columnNumber:9},this),e.jsxDEV("div",{children:"After"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:257,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:254,columnNumber:7},this),s.map(a=>e.jsxDEV("div",{className:"grid grid-cols-3 px-2 py-1.5 border-b last:border-b-0 text-xs",children:[e.jsxDEV("div",{className:"font-medium text-gray-700 truncate",title:a.key,children:Oi(a.key)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:261,columnNumber:11},this),e.jsxDEV("div",{className:"text-red-600 line-through font-mono break-words",children:to(a.before)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:262,columnNumber:11},this),e.jsxDEV("div",{className:"text-green-700 font-mono break-words",children:to(a.after)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:263,columnNumber:11},this)]},a.key,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:260,columnNumber:9},this))]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:253,columnNumber:5},this)}function ra({metadata:r}){const o=Object.entries(r||{}).filter(([,s])=>s!=null&&s!=="");return o.length===0?null:e.jsxDEV("div",{className:"border rounded text-xs overflow-hidden",children:o.map(([s,a])=>e.jsxDEV("div",{className:"grid grid-cols-3 px-2 py-1 border-b last:border-b-0 gap-2",children:[e.jsxDEV("div",{className:"font-medium text-gray-600 truncate",title:s,children:Oi(s)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:280,columnNumber:11},this),e.jsxDEV("div",{className:"col-span-2 font-mono text-gray-700 break-words",children:to(a)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:281,columnNumber:11},this)]},s,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:279,columnNumber:9},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingHistoryTab.tsx",lineNumber:277,columnNumber:5},this)}function oa(r){const o={};for(const s of r){const a=fi(s.timestamp,"EEEE, dd MMMM yyyy");o[a]||(o[a]=[]),o[a].push(s)}return Object.entries(o).map(([s,a])=>({date:s,items:a}))}function Oi(r){return r.replace(/_/g," ").replace(/\b\w/g,o=>o.toUpperCase())}function to(r){if(r==null||r==="")return"(empty)";if(typeof r=="object")try{return JSON.stringify(r)}catch{return String(r)}return String(r)}function ia(r){const o=String(r||"").toLowerCase();return/\bhcn\b|hotel.*confirmation|confirmation.*number/.test(o)?"hcn":/cancel/.test(o)?"cancellation":/refund/.test(o)?"refund":/change|modify|amend|reschedul/.test(o)?"change_request":"other"}function sa({open:r,onOpenChange:o,bookingId:s,bookingCode:a,defaultCustomerEmail:t,onSent:i}){var He;const{toast:u}=mr(),[c,g]=P.useState(1),[n,y]=P.useState(null),[p,S]=P.useState([]),[h,C]=P.useState(null),[x,N]=P.useState(""),[f,D]=P.useState(""),[V,z]=P.useState(""),[K,v]=P.useState(""),[_,w]=P.useState(""),[k,F]=P.useState(""),[B,be]=P.useState([]),[te,le]=P.useState(null),[W,L]=P.useState(null),[Ne,U]=P.useState(!0),[he,T]=P.useState("other"),[Se,Q]=P.useState(""),[b,d]=P.useState("");P.useEffect(()=>{r&&(g(1),y(null),S([]),C(null),N(""),D(""),z(""),v(""),w(""),F(""),be([]),L(null),U(!0),T("other"),Q(""),d(""))},[r,s]);const me=Ve({queryKey:["booking-suppliers",a],queryFn:()=>ns(a),enabled:r&&!!a,staleTime:6e4}),se=((He=me.data)==null?void 0:He.result)||[],Z=P.useMemo(()=>se.find(R=>R.supplier_id===n)||null,[se,n]);P.useEffect(()=>{r&&c===1&&se.length===1&&!n&&(y(se[0].supplier_id),S(se[0].product_indexes),g(se[0].products.length===1?3:2))},[r,c,se,n]);const J=Ve({queryKey:["email-templates","supplier"],queryFn:()=>ls({template_type:"supplier"}),enabled:r,staleTime:6e4}),j=(J.data||[]).filter(R=>R.is_active),H=P.useMemo(()=>j.find(R=>R.id===h)||null,[j,h]);P.useEffect(()=>{H&&(H.reminder_request_type?T(H.reminder_request_type):T(ia(H.name)))},[H==null?void 0:H.id]);const ie=pr({mutationFn:async()=>{if(!h||!n)throw new Error("Pick a template and supplier first");return is(h,{booking_code:a,supplier_id:n,product_indexes:p,notes:x||void 0})},onSuccess:R=>{v(R.subject),w(R.body_html),F(R.body_text),be(R.missing_placeholders||[]),L(R.shell_meta||null),D(R.to_suggestions.join(", ")),z(R.cc_suggestions.join(", ")),g(4)},onError:R=>{u({title:"Failed to render template",description:R.message,variant:"destructive"})}}),ee=pr({mutationFn:async()=>{const R=f.split(/[,;\s]+/).map(xe=>xe.trim()).filter(Boolean);if(R.length===0)throw new Error("Add at least one recipient");const Ge=V.split(/[,;\s]+/).map(xe=>xe.trim()).filter(Boolean),ge=await ss({to:R,cc:Ge,subject:K,body_html:_,body_text:k,booking_id:s,booking_code:a,supplier_id:n||void 0,template_id:h||void 0,category:"supplier",supplier_ref:(W==null?void 0:W.supplier_ref)||void 0,ref_display:(W==null?void 0:W.ref_display)||void 0,app_name_override:(W==null?void 0:W.app_name)||void 0,smtp_account_id:te||void 0});let de={ok:!0};if(Ne)try{const xe=Number(Se),O=Number(b);await ts({request_type:he,supplier_id:n||void 0,supplier_name:(Z==null?void 0:Z.supplier_name)||void 0,supplier_email:R[0],booking_id:s,booking_code:a,subject:K||void 0,message:k?k.slice(0,500):H!=null&&H.name?`Sent template: ${H.name}`:void 0,sla_hours:Number.isFinite(xe)&&xe>0?xe:void 0,reminder_every_hours:Number.isFinite(O)&&O>0?O:void 0})}catch(xe){de={ok:!1,error:xe.message}}return{sendResult:ge,reminderResult:de}},onSuccess:R=>{Ne?R.reminderResult.ok?u({title:"Email sent",description:"Message logged · reminder set so you'll get pinged if no reply."}):u({variant:"destructive",title:"Email sent — reminder not set",description:`${R.reminderResult.error||"unknown error"} (set one manually from Supplier Reminders).`}):u({title:"Email sent",description:"Message logged on the booking thread."}),i==null||i(),o(!1)},onError:R=>{u({title:"Send failed",description:R.message,variant:"destructive"})}}),Pe={1:"Step 1 of 4 — Pick supplier",2:"Step 2 of 4 — Pick service(s)",3:"Step 3 of 4 — Pick template",4:"Step 4 of 4 — Review & send"},fe=c===1?!!n:c===2?p.length>0:c===3?!!h:!1;return e.jsxDEV(Pr,{open:r,onOpenChange:R=>{ee.isPending||o(R)},children:e.jsxDEV(Cr,{className:"max-w-2xl",children:[e.jsxDEV(kr,{children:e.jsxDEV("div",{className:"flex items-start gap-3",children:[e.jsxDEV(gr,{className:"h-5 w-5 mt-0.5 text-orange-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:300,columnNumber:13},this),e.jsxDEV("div",{children:[e.jsxDEV(_r,{children:["Email Supplier — ",a]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:302,columnNumber:15},this),e.jsxDEV(uo,{className:"mt-1",children:Pe[c]},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:303,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:301,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:299,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:298,columnNumber:9},this),e.jsxDEV("div",{className:"min-h-[280px]",children:[c===1&&e.jsxDEV(ta,{loading:me.isLoading,suppliers:se,value:n,onChange:R=>{y(R);const Ge=se.find(ge=>ge.supplier_id===R);Ge&&S(Ge.product_indexes)}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:310,columnNumber:13},this),c===2&&Z&&e.jsxDEV(aa,{supplier:Z,selected:p,onChange:S},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:323,columnNumber:13},this),c===3&&e.jsxDEV(na,{loading:J.isLoading,templates:j,value:h,onChange:C,notes:x,onNotesChange:N,rendering:ie.isPending},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:331,columnNumber:13},this),c===4&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV(ot,{contextHeader:H&&Z?e.jsxDEV("div",{className:"text-xs text-muted-foreground",children:["Sending ",e.jsxDEV("strong",{children:H.name},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:348,columnNumber:31},this)," to ",e.jsxDEV("strong",{children:Z.supplier_name},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:348,columnNumber:75},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:347,columnNumber:21},this):null,toStr:f,setToStr:D,ccStr:V,setCcStr:z,subject:K,setSubject:v,bodyHtml:_,setBodyHtml:w,smtpAccountId:te,setSmtpAccountId:le,missingPlaceholders:B,toHint:f.trim()?null:"No saved contact for this supplier yet. Type one in — and consider adding it under Settings → Suppliers so next time it auto-fills.",ccPlaceholder:t?`${t}, accounting@example.com`:"accounting@example.com",bookingCode:a,supplierRef:(W==null?void 0:W.supplier_ref)||void 0,refDisplay:(W==null?void 0:W.ref_display)||void 0,appNameOverride:(W==null?void 0:W.app_name)||void 0},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:344,columnNumber:15},this),e.jsxDEV("div",{className:"mt-4 rounded-md border p-3 bg-slate-50/60 space-y-3",children:[e.jsxDEV("div",{className:"flex items-start gap-3",children:[e.jsxDEV("div",{className:"flex-1",children:[e.jsxDEV(De,{htmlFor:"email-set-reminder",className:"flex items-center gap-2 cursor-pointer",children:[e.jsxDEV(as,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:376,columnNumber:23},this),"Track this request — remind me if no reply"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:375,columnNumber:21},this),e.jsxDEV("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Creates a reminder so Ops gets pinged in-app and by email if ",(Z==null?void 0:Z.supplier_name)||"the supplier"," doesn't reply in time. Manage all reminders under ",e.jsxDEV("strong",{children:"Supplier Reminders"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:381,columnNumber:50},this),"."]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:379,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:374,columnNumber:19},this),e.jsxDEV(rt,{id:"email-set-reminder",checked:Ne,onCheckedChange:U},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:384,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:373,columnNumber:17},this),Ne&&e.jsxDEV("div",{className:"grid grid-cols-3 gap-2 pt-2 border-t",children:[e.jsxDEV("div",{children:[e.jsxDEV(De,{htmlFor:"rem-type",className:"text-xs",children:"Request type"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:393,columnNumber:23},this),e.jsxDEV(pi,{value:he,onValueChange:R=>T(R),children:[e.jsxDEV(Si,{id:"rem-type",className:"h-9",children:e.jsxDEV(yi,{},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:395,columnNumber:70},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:395,columnNumber:25},this),e.jsxDEV(Di,{children:[e.jsxDEV(ur,{value:"hcn",children:"HCN"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:397,columnNumber:27},this),e.jsxDEV(ur,{value:"cancellation",children:"Cancellation"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:398,columnNumber:27},this),e.jsxDEV(ur,{value:"change_request",children:"Change request"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:399,columnNumber:27},this),e.jsxDEV(ur,{value:"refund",children:"Refund"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:400,columnNumber:27},this),e.jsxDEV(ur,{value:"other",children:"Other"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:401,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:396,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:394,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:392,columnNumber:21},this),e.jsxDEV("div",{children:[e.jsxDEV(De,{htmlFor:"rem-sla",className:"text-xs",children:["SLA hours ",e.jsxDEV("span",{className:"text-muted-foreground",children:"(blank = default)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:407,columnNumber:35},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:406,columnNumber:23},this),e.jsxDEV(ce,{id:"rem-sla",type:"number",min:1,step:"1",className:"h-9",value:Se,onChange:R=>Q(R.target.value),placeholder:"e.g. 48"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:409,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:405,columnNumber:21},this),e.jsxDEV("div",{children:[e.jsxDEV(De,{htmlFor:"rem-every",className:"text-xs",children:["Re-ping every ",e.jsxDEV("span",{className:"text-muted-foreground",children:"(hours)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:419,columnNumber:39},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:418,columnNumber:23},this),e.jsxDEV(ce,{id:"rem-every",type:"number",min:1,step:"1",className:"h-9",value:b,onChange:R=>d(R.target.value),placeholder:"e.g. 12"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:421,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:417,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:391,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:372,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:343,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:308,columnNumber:9},this),e.jsxDEV(co,{className:"flex flex-row justify-between sm:justify-between",children:[e.jsxDEV("div",{children:c>1&&e.jsxDEV(G,{variant:"ghost",onClick:()=>g(R=>Math.max(1,R-1)),disabled:ie.isPending||ee.isPending,children:[e.jsxDEV(no,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:444,columnNumber:17},this)," Back"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:439,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:437,columnNumber:11},this),e.jsxDEV("div",{className:"flex gap-2",children:[e.jsxDEV(G,{variant:"outline",onClick:()=>o(!1),disabled:ee.isPending,children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:449,columnNumber:13},this),c<3&&e.jsxDEV(G,{onClick:()=>g(R=>Math.min(4,R+1)),disabled:!fe,children:["Next ",e.jsxDEV(Br,{className:"h-4 w-4 ml-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:454,columnNumber:22},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:453,columnNumber:15},this),c===3&&e.jsxDEV(G,{onClick:()=>ie.mutate(),disabled:!fe||ie.isPending,children:[ie.isPending?"Rendering…":"Compose"," ",e.jsxDEV(Br,{className:"h-4 w-4 ml-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:459,columnNumber:66},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:458,columnNumber:15},this),c===4&&e.jsxDEV(G,{onClick:()=>ee.mutate(),disabled:ee.isPending||!f.trim()||!K.trim(),children:[e.jsxDEV(io,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:464,columnNumber:17},this)," ",ee.isPending?"Sending…":"Send"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:463,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:448,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:436,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:297,columnNumber:7},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:296,columnNumber:5},this)}function ta({loading:r,suppliers:o,value:s,onChange:a}){return r?e.jsxDEV("div",{className:"space-y-2",children:Array.from({length:3}).map((t,i)=>e.jsxDEV(Vr,{className:"h-14 w-full"},i,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:481,columnNumber:91},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:481,columnNumber:23},this):o.length===0?e.jsxDEV("div",{className:"rounded border border-dashed p-6 text-sm text-muted-foreground text-center",children:"No suppliers detected on this booking. Make sure the booking is in cache and has a product allocation."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:484,columnNumber:7},this):e.jsxDEV("div",{className:"space-y-2",children:[e.jsxDEV("p",{className:"text-xs text-muted-foreground",children:"Select which supplier you want to email. One booking can have multiple — each goes in its own message."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:491,columnNumber:7},this),e.jsxDEV("div",{className:"space-y-1.5",children:o.map(t=>e.jsxDEV("button",{type:"button",onClick:()=>a(t.supplier_id),className:`w-full text-left p-3 rounded-md border transition-colors ${s===t.supplier_id?"border-orange-500 bg-orange-50":"border-border hover:border-orange-200 hover:bg-accent/30"}`,children:[e.jsxDEV("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxDEV(Ws,{className:"h-4 w-4 text-orange-500 shrink-0"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:507,columnNumber:15},this),e.jsxDEV("span",{className:"font-medium",children:t.supplier_name},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:508,columnNumber:15},this),t.supplier_code&&t.supplier_code!==t.supplier_name&&e.jsxDEV("span",{className:"text-xs text-muted-foreground font-mono",children:t.supplier_code},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:510,columnNumber:17},this),t.auto_discovered&&e.jsxDEV("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-amber-100 text-amber-800",title:"This supplier isn't fully configured yet. Once you've sent the email, consider adding it under Settings → Suppliers so contacts auto-fill next time.",children:"not configured"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:518,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:506,columnNumber:13},this),e.jsxDEV("div",{className:"text-xs text-muted-foreground mt-1 ml-6",children:[t.products.length," service",t.products.length===1?"":"s"," · ",t.products.map(i=>i.type).join(", ")]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:526,columnNumber:13},this)]},t.supplier_id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:496,columnNumber:11},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:494,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:490,columnNumber:5},this)}function aa({supplier:r,selected:o,onChange:s}){const a=(t,i)=>{const u=new Set(o);i?u.add(t):u.delete(t),s(Array.from(u).sort((c,g)=>c-g))};return e.jsxDEV("div",{className:"space-y-3",children:[e.jsxDEV("p",{className:"text-xs text-muted-foreground",children:["Pick which service(s) to mention in the email. By default all of ",r.supplier_name,"'s services are selected."]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:549,columnNumber:7},this),e.jsxDEV("div",{className:"space-y-1.5",children:r.products.map(t=>e.jsxDEV("label",{className:"flex items-start gap-3 p-3 rounded-md border hover:bg-accent/30 cursor-pointer",children:[e.jsxDEV(Ni,{checked:o.includes(t.index),onCheckedChange:i=>a(t.index,!!i),className:"mt-0.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:558,columnNumber:13},this),e.jsxDEV("div",{className:"flex-1 min-w-0",children:[e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted font-mono uppercase",children:t.type},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:565,columnNumber:17},this),e.jsxDEV("span",{className:"font-medium",children:t.label},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:566,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:564,columnNumber:15},this),t.ref&&e.jsxDEV("div",{className:"text-xs text-muted-foreground mt-0.5 font-mono",children:["Ref: ",t.ref]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:569,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:563,columnNumber:13},this)]},t.index,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:554,columnNumber:11},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:552,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:548,columnNumber:5},this)}function na({loading:r,templates:o,value:s,onChange:a,notes:t,onNotesChange:i,rendering:u}){const c=o.find(g=>g.id===s)||null;return e.jsxDEV("div",{className:"space-y-4",children:[e.jsxDEV("div",{className:"space-y-2",children:[e.jsxDEV(De,{children:"Template"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:595,columnNumber:9},this),r?e.jsxDEV(Vr,{className:"h-9 w-full"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:597,columnNumber:11},this):o.length===0?e.jsxDEV("div",{className:"rounded border border-dashed p-4 text-sm text-muted-foreground",children:"No supplier templates configured. Add some in Settings → Templates."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:599,columnNumber:11},this):e.jsxDEV(pi,{value:s||"",onValueChange:a,children:[e.jsxDEV(Si,{children:e.jsxDEV(yi,{placeholder:"Pick a template…"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:604,columnNumber:28},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:604,columnNumber:13},this),e.jsxDEV(Di,{children:o.map(g=>e.jsxDEV(ur,{value:g.id,children:g.name},g.id,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:607,columnNumber:17},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:605,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:603,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:594,columnNumber:7},this),c&&e.jsxDEV("div",{className:"space-y-1",children:[e.jsxDEV(De,{className:"text-xs text-muted-foreground",children:"Subject preview"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:616,columnNumber:11},this),e.jsxDEV("div",{className:"text-sm font-medium",children:c.subject},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:617,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:615,columnNumber:9},this),e.jsxDEV("div",{className:"space-y-2",children:[e.jsxDEV(De,{htmlFor:"notes",children:["Additional notes ",e.jsxDEV("span",{className:"text-muted-foreground text-xs",children:"(optional)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:622,columnNumber:49},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:622,columnNumber:9},this),e.jsxDEV(Ke,{id:"notes",value:t,onChange:g=>i(g.target.value),rows:3,placeholder:"Anything specific to add to this email — new dates, special requests, customer-side context…",disabled:u},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:623,columnNumber:9},this),e.jsxDEV("p",{className:"text-xs text-muted-foreground",children:"Notes are appended to the rendered template. You can still edit the body on the next step."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:631,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:621,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/EmailSupplierDialog.tsx",lineNumber:593,columnNumber:5},this)}const la={hotel:Le,flight:ze,transfer:Xe,tour:zs,visa:fr,insurance:fr,service:fr},ma={hotel:"Hotel",flight:"Flight ticket",transfer:"Transfer",tour:"Tour",visa:"Visa",insurance:"Insurance",service:"Service"};function ua({open:r,onOpenChange:o,bookingCode:s,bookingId:a,onSaved:t}){var K;const{toast:i}=mr(),u=Rr(),[c,g]=P.useState([]),[n,y]=P.useState(""),[p,S]=P.useState(null),h=Ve({queryKey:["booking-confirmation-numbers",s],queryFn:()=>cs(s),enabled:r&&!!s,refetchOnWindowFocus:!1});P.useEffect(()=>{var v;if(!((v=h.data)!=null&&v.result)){g([]);return}g(h.data.result.map(_=>({index:_.index,product_id:_.product_id,kind:_.kind,title:_.title,rooms:_.rooms.map(w=>({index:w.index,label:w.label,hcn:w.hcn,original:w.hcn})),pnr:_.pnr,pnrOriginal:_.pnr,confirmation_number:_.confirmation_number,confirmationOriginal:_.confirmation_number,supplier_reference:_.supplier_reference,supplierRefOriginal:_.supplier_reference}))),S(null)},[h.data]),P.useEffect(()=>{r&&(y(""),S(null))},[r]);const C=P.useMemo(()=>{const v=[];for(const _ of c)if(_.kind==="hotel"){const w=_.rooms.filter(k=>k.hcn.trim()!==k.original.trim()).map(k=>({index:k.index,hcn:k.hcn.trim()}));w.length>0&&v.push({product_id:_.product_id,kind:"hotel",rooms:w})}else if(_.kind==="flight")_.pnr.trim()!==_.pnrOriginal.trim()&&v.push({product_id:_.product_id,kind:"flight",pnr:_.pnr.trim()});else{const w=_.confirmation_number.trim(),k=_.supplier_reference.trim(),F=w!==_.confirmationOriginal.trim(),B=k!==_.supplierRefOriginal.trim();(F||B)&&v.push({product_id:_.product_id,kind:_.kind,...F?{confirmation_number:w}:{},...B?{supplier_reference:k}:{}})}return v},[c]),x=()=>{u.invalidateQueries({queryKey:["booking-confirmation-numbers",s]}),a&&(u.invalidateQueries({queryKey:["easygds","booking",a]}),u.invalidateQueries({queryKey:["easygds","booking-products",a]}),u.invalidateQueries({queryKey:["easygds","booking-pnrs",a]})),u.invalidateQueries({queryKey:["easygds","bookings"]}),u.invalidateQueries({queryKey:["easygds","bookings-live"]}),u.invalidateQueries({queryKey:["bookings"]})},N=pr({mutationFn:()=>ms(s,C,n||void 0),onSuccess:v=>{var k;const _=v.succeeded.map(F=>F.product_id),w=v.failed.map(F=>({id:F.product_id,error:F.error}));S({ok:_,failed:w}),x(),w.length===0?(i({title:"Confirmation numbers updated",description:`${_.length} product${_.length===1?"":"s"} updated successfully.`}),t==null||t()):_.length===0?i({variant:"destructive",title:"Update failed",description:((k=w[0])==null?void 0:k.error)||"EasyGDS rejected every change."}):(i({variant:"destructive",title:"Partial success",description:`${_.length} succeeded, ${w.length} failed. See per-row icons.`}),t==null||t())},onError:v=>{i({variant:"destructive",title:"Update failed",description:v.message})}}),f=(v,_,w)=>{g(k=>k.map(F=>F.product_id===v?{...F,rooms:F.rooms.map(B=>B.index===_?{...B,hcn:w}:B)}:F))},D=(v,_,w)=>{g(k=>k.map(F=>F.product_id===v?{...F,[_]:w}:F))},V=C.length,z=V>0&&!N.isPending&&!h.isLoading;return e.jsxDEV(Pr,{open:r,onOpenChange:o,children:e.jsxDEV(Cr,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[e.jsxDEV(kr,{children:[e.jsxDEV(_r,{className:"flex items-center gap-2",children:[e.jsxDEV(fr,{className:"h-5 w-5 text-orange-600"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:227,columnNumber:13},this),"Update Confirmation Numbers — ",s]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:226,columnNumber:11},this),e.jsxDEV(uo,{children:"Set the HCN, PNR, or confirmation number for each service. Changes are pushed to EasyGDS. Empty values are accepted (clears the field)."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:230,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:225,columnNumber:9},this),e.jsxDEV("div",{className:"space-y-3",children:[h.isLoading&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV(Vr,{className:"h-24 w-full"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:239,columnNumber:15},this),e.jsxDEV(Vr,{className:"h-24 w-full"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:240,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:238,columnNumber:13},this),h.isError&&e.jsxDEV("div",{className:"rounded border border-red-200 bg-red-50 p-4 text-sm text-red-900 flex items-start gap-2",children:[e.jsxDEV(Je,{className:"h-4 w-4 mt-0.5 shrink-0"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:247,columnNumber:15},this),e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"font-semibold",children:"Failed to load services"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:249,columnNumber:17},this),e.jsxDEV("div",{className:"mt-0.5",children:((K=h.error)==null?void 0:K.message)||"Unknown error"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:250,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:248,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:246,columnNumber:13},this),h.data&&c.length===0&&e.jsxDEV("div",{className:"text-center text-sm text-muted-foreground py-8",children:"No services on this booking."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:257,columnNumber:13},this),c.map(v=>{const _=la[v.kind]||fr,w=p==null?void 0:p.ok.includes(v.product_id),k=p==null?void 0:p.failed.find(B=>B.id===v.product_id),F=v.kind==="hotel"&&v.rooms.some(B=>B.hcn.trim()!==B.original.trim())||v.kind==="flight"&&v.pnr.trim()!==v.pnrOriginal.trim()||v.kind!=="hotel"&&v.kind!=="flight"&&(v.confirmation_number.trim()!==v.confirmationOriginal.trim()||v.supplier_reference.trim()!==v.supplierRefOriginal.trim());return e.jsxDEV("div",{className:`rounded-lg border p-3 space-y-2 ${w?"border-green-300 bg-green-50/40":k?"border-red-300 bg-red-50/40":F?"border-orange-300 bg-orange-50/30":"border-border"}`,children:[e.jsxDEV("div",{className:"flex items-start justify-between gap-2",children:[e.jsxDEV("div",{className:"flex items-start gap-2 flex-1 min-w-0",children:[e.jsxDEV("div",{className:"mt-0.5 shrink-0",children:e.jsxDEV(_,{className:"h-4 w-4 text-orange-600"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:285,columnNumber:23},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:284,columnNumber:21},this),e.jsxDEV("div",{className:"flex-1 min-w-0",children:[e.jsxDEV("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:ma[v.kind]},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:288,columnNumber:23},this),e.jsxDEV("div",{className:"text-sm font-medium truncate",children:v.title},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:291,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:287,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:283,columnNumber:19},this),w&&e.jsxDEV(oe,{variant:"outline",className:"bg-green-50 text-green-700 border-green-200 gap-1",children:[e.jsxDEV(us,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:296,columnNumber:23},this),"Updated"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:295,columnNumber:21},this),k&&e.jsxDEV(oe,{variant:"outline",className:"bg-red-50 text-red-700 border-red-200 gap-1",children:[e.jsxDEV(Je,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:301,columnNumber:23},this),"Failed"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:300,columnNumber:21},this),F&&!w&&!k&&e.jsxDEV(oe,{variant:"outline",className:"bg-orange-50 text-orange-700 border-orange-200",children:"Modified"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:305,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:282,columnNumber:17},this),v.kind==="hotel"&&v.rooms.length>0&&e.jsxDEV("div",{className:"space-y-2 pl-6",children:v.rooms.map(B=>e.jsxDEV("div",{className:"grid grid-cols-[1fr_2fr] gap-2 items-center",children:[e.jsxDEV(De,{className:"text-xs text-muted-foreground truncate",title:B.label,children:B.label},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:320,columnNumber:25},this),e.jsxDEV(ce,{value:B.hcn,onChange:be=>f(v.product_id,B.index,be.target.value),placeholder:"HCN — Hotel Confirmation Number",className:"font-mono text-xs h-8"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:323,columnNumber:25},this)]},B.index,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:319,columnNumber:23},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:317,columnNumber:19},this),v.kind==="flight"&&e.jsxDEV("div",{className:"grid grid-cols-[1fr_2fr] gap-2 items-center pl-6",children:[e.jsxDEV(De,{className:"text-xs text-muted-foreground",children:"PNR"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:336,columnNumber:21},this),e.jsxDEV(ce,{value:v.pnr,onChange:B=>D(v.product_id,"pnr",B.target.value),placeholder:"PNR — Passenger Name Record",className:"font-mono text-xs h-8 uppercase"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:337,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:335,columnNumber:19},this),v.kind!=="hotel"&&v.kind!=="flight"&&e.jsxDEV("div",{className:"space-y-2 pl-6",children:[e.jsxDEV("div",{className:"grid grid-cols-[1fr_2fr] gap-2 items-center",children:[e.jsxDEV(De,{className:"text-xs text-muted-foreground",children:"Confirmation #"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:349,columnNumber:23},this),e.jsxDEV(ce,{value:v.confirmation_number,onChange:B=>D(v.product_id,"confirmation_number",B.target.value),placeholder:"Confirmation number from supplier",className:"font-mono text-xs h-8"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:350,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:348,columnNumber:21},this),e.jsxDEV("div",{className:"grid grid-cols-[1fr_2fr] gap-2 items-center",children:[e.jsxDEV(De,{className:"text-xs text-muted-foreground",children:"Supplier ref"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:358,columnNumber:23},this),e.jsxDEV(ce,{value:v.supplier_reference,onChange:B=>D(v.product_id,"supplier_reference",B.target.value),placeholder:"Optional — supplier's own reference",className:"font-mono text-xs h-8"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:359,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:357,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:347,columnNumber:19},this),k&&e.jsxDEV("div",{className:"text-xs text-red-700 pl-6",children:["EasyGDS rejected: ",k.error]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:370,columnNumber:19},this)]},v.product_id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:276,columnNumber:15},this)}),c.length>0&&e.jsxDEV("div",{className:"space-y-1.5 pt-2",children:[e.jsxDEV(De,{htmlFor:"reason",className:"text-xs",children:["Reason for change ",e.jsxDEV("span",{className:"text-muted-foreground",children:"(optional, recorded in audit log)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:380,columnNumber:35},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:379,columnNumber:15},this),e.jsxDEV(Ke,{id:"reason",value:n,onChange:v=>y(v.target.value),rows:2,placeholder:"e.g. Supplier sent updated HCN by email",className:"text-xs"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:382,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:378,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:235,columnNumber:9},this),e.jsxDEV(co,{className:"flex flex-row items-center justify-between sm:justify-between",children:[e.jsxDEV("div",{className:"text-xs text-muted-foreground",children:V===0?"No changes to save":`${V} change${V===1?"":"s"} ready to push`},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:395,columnNumber:11},this),e.jsxDEV("div",{className:"flex gap-2",children:[e.jsxDEV(G,{variant:"outline",onClick:()=>o(!1),disabled:N.isPending,children:"Close"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:401,columnNumber:13},this),e.jsxDEV(G,{onClick:()=>N.mutate(),disabled:!z,className:"gap-1.5",children:[e.jsxDEV(wr,{className:`h-4 w-4 ${N.isPending?"animate-pulse":""}`},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:409,columnNumber:15},this),N.isPending?"Saving…":"Save"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:404,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:400,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:394,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:224,columnNumber:7},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/UpdateConfirmationNumbersDialog.tsx",lineNumber:223,columnNumber:5},this)}const br={new:{label:"New",icon:ds,badge:"bg-blue-100 text-blue-800 border-blue-200",ring:"data-[state=on]:border-blue-500 data-[state=on]:bg-blue-50",description:"Untouched — keep this booking in the new bucket."},reviewed:{label:"Reviewed",icon:lr,badge:"bg-emerald-100 text-emerald-800 border-emerald-200",ring:"data-[state=on]:border-emerald-500 data-[state=on]:bg-emerald-50",description:"Booking has been checked and approved by Ops."},flagged:{label:"Flag",icon:bs,badge:"bg-red-100 text-red-800 border-red-200",ring:"data-[state=on]:border-red-500 data-[state=on]:bg-red-50",description:"Issue found — flag for follow-up by another operator."},in_progress:{label:"In Progress",icon:ao,badge:"bg-amber-100 text-amber-800 border-amber-200",ring:"data-[state=on]:border-amber-500 data-[state=on]:bg-amber-50",description:"Currently being handled — reviewer in the middle of triage."}},ca=["new","reviewed","flagged","in_progress"];function ba({booking:r,isOpen:o,onClose:s,onReviewComplete:a}){const t=Rr(),{toast:i}=mr(),u=(r==null?void 0:r.code)||(r==null?void 0:r.booking_code)||(r==null?void 0:r.id)||"",c=(r==null?void 0:r.code)||(r==null?void 0:r.booking_code)||u,[g,n]=P.useState("new"),[y,p]=P.useState(""),{data:S,isLoading:h,refetch:C}=Ve({queryKey:["booking-reviews",u],queryFn:()=>Ss(u),enabled:o&&!!u,staleTime:1e4});P.useEffect(()=>{if(!o)return;const D=(S==null?void 0:S.current_status)||"new";n(D)},[o,S==null?void 0:S.current_status]);const x=pr({mutationFn:()=>gs(u,{status:g,notes:y.trim()||void 0}),onSuccess:()=>{const D=br[g];i({title:`Booking ${D.label.toLowerCase()}`,description:y.trim()?"Saved with note.":"Status recorded."}),p(""),t.invalidateQueries({queryKey:["booking-reviews",u]}),C(),a==null||a()},onError:D=>{i({variant:"destructive",title:"Failed to save review",description:D.message})}}),N=(S==null?void 0:S.result)||[],f=(S==null?void 0:S.current_status)||null;return e.jsxDEV(Pr,{open:o,onOpenChange:D=>{!D&&!x.isPending&&s()},children:e.jsxDEV(Cr,{className:"max-w-2xl",children:[e.jsxDEV(kr,{children:[e.jsxDEV(_r,{className:"flex items-center gap-2",children:[e.jsxDEV(lr,{className:"h-5 w-5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:129,columnNumber:13},this)," Review booking ",c]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:128,columnNumber:11},this),e.jsxDEV(uo,{children:"Pick a status and add a note. Every change is appended to the timeline below so the team can see who flagged or unflagged this booking and why."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:131,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:127,columnNumber:9},this),f&&e.jsxDEV("div",{className:"flex items-center gap-2 -mt-2",children:[e.jsxDEV("span",{className:"text-xs text-muted-foreground",children:"Current status:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:140,columnNumber:13},this),e.jsxDEV(da,{status:f},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:141,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:139,columnNumber:11},this),e.jsxDEV("div",{className:"space-y-4",children:[e.jsxDEV("div",{children:[e.jsxDEV(De,{className:"text-sm",children:"New status"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:152,columnNumber:13},this),e.jsxDEV("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 mt-1.5",children:ca.map(D=>{const V=br[D],z=V.icon,K=g===D;return e.jsxDEV("button",{type:"button",onClick:()=>n(D),className:"rounded-md border p-3 text-left transition-colors "+(K?D==="new"?"border-blue-500 bg-blue-50":D==="reviewed"?"border-emerald-500 bg-emerald-50":D==="flagged"?"border-red-500 bg-red-50":"border-amber-500 bg-amber-50":"border-border hover:bg-accent/40"),children:[e.jsxDEV("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsxDEV(z,{className:"h-4 w-4 "+(D==="new"?"text-blue-600":D==="reviewed"?"text-emerald-600":D==="flagged"?"text-red-600":"text-amber-600")},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:174,columnNumber:23},this),e.jsxDEV("span",{className:"font-medium text-sm",children:V.label},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:181,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:173,columnNumber:21},this),e.jsxDEV("p",{className:"text-[11px] text-muted-foreground leading-snug",children:V.description},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:183,columnNumber:21},this)]},D,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:159,columnNumber:19},this)})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:153,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:151,columnNumber:11},this),e.jsxDEV("div",{children:[e.jsxDEV(De,{htmlFor:"review-notes",className:"text-sm",children:"Notes (optional)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:192,columnNumber:13},this),e.jsxDEV(Ke,{id:"review-notes",value:y,onChange:D=>p(D.target.value),placeholder:"What did you find? Anything the next operator should know?",rows:3},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:193,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:191,columnNumber:11},this),e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxDEV(so,{className:"h-4 w-4 text-muted-foreground"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:206,columnNumber:15},this),e.jsxDEV(De,{className:"text-sm",children:"Review history"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:207,columnNumber:15},this),N.length>0&&e.jsxDEV(oe,{variant:"outline",className:"text-[10px]",children:N.length},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:209,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:205,columnNumber:13},this),h?e.jsxDEV("div",{className:"text-xs text-muted-foreground py-3 text-center",children:"Loading…"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:213,columnNumber:15},this):N.length===0?e.jsxDEV("div",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground text-center",children:"No review actions on this booking yet. Save your first one below."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:215,columnNumber:15},this):e.jsxDEV("ul",{className:"space-y-2 max-h-64 overflow-y-auto pr-1",children:N.map(D=>e.jsxDEV(ga,{row:D},D.id,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:220,columnNumber:39},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:219,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:204,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:145,columnNumber:9},this),e.jsxDEV(co,{children:[e.jsxDEV(G,{variant:"outline",onClick:s,disabled:x.isPending,children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:227,columnNumber:11},this),e.jsxDEV(G,{onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?"Saving…":`Save as ${br[g].label}`},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:228,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:226,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:126,columnNumber:7},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:125,columnNumber:5},this)}function da({status:r}){const o=br[r],s=o.icon;return e.jsxDEV(oe,{className:`text-[10px] border inline-flex items-center gap-1 ${o.badge}`,children:[e.jsxDEV(s,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:242,columnNumber:7},this)," ",o.label]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:241,columnNumber:5},this)}function ga({row:r}){const o=br[r.status]||br.in_progress,s=o.icon;let a="",t="";try{const i=new Date(r.created_at);a=ps(i,{addSuffix:!0}),t=Tr(i,"PPp")}catch{}return e.jsxDEV("li",{className:"rounded-md border bg-white p-2.5",children:[e.jsxDEV("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxDEV(oe,{className:`text-[10px] border inline-flex items-center gap-1 ${o.badge}`,children:[e.jsxDEV(s,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:261,columnNumber:11},this)," ",o.label]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:260,columnNumber:9},this),e.jsxDEV("span",{className:"text-[11px] text-muted-foreground inline-flex items-center gap-1",children:[e.jsxDEV(lo,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:264,columnNumber:11},this),r.created_by_name||r.created_by_email||"Unknown user"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:263,columnNumber:9},this),e.jsxDEV("span",{className:"text-[11px] text-muted-foreground",title:t,children:["· ",a]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:267,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:259,columnNumber:7},this),r.notes&&e.jsxDEV("p",{className:"text-xs text-gray-700 mt-1.5 whitespace-pre-wrap",children:r.notes},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:270,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/bookings/BookingReviewDialog.tsx",lineNumber:258,columnNumber:5},this)}function qa(){var No,ho,xo,vo,fo,Eo,Oo,Po,Co,ko,_o,Ao,Uo;const{code:r}=ys(),[o,s]=Ds(),a=o.get("tab")||"general",t=di(),{toast:i}=mr(),{canUseSupplierAdmin:u,isOps:c,canDoOpsActions:g}=ui(),n=Rr(),{agents:y,loginContext:p}=Ns(),{getSupplierBySourceId:S}=hi(),[h,C]=P.useState(""),[x,N]=P.useState(a),f=o.get("participant")||"all",D=m=>{const l=new URLSearchParams(o);m==="all"?l.delete("participant"):l.set("participant",m),s(l,{replace:!0})},V=m=>{N("emails");const l=new URLSearchParams(o);l.set("tab","emails"),l.set("participant",m),s(l,{replace:!0})};P.useEffect(()=>{const m=o.get("action");if(!m)return;switch(m){case"email-supplier":_(!0);break;case"email-customer":k(!0);break;case"send-voucher":B(!0);break;case"update-confirmations":W(!0);break;case"review":g&&te(!0);break;case"supplier-thread":V("supplier");break;case"customer-thread":V("customer");break;case"support":N("support");break}const l=new URLSearchParams(o);l.delete("action"),s(l,{replace:!0})},[]);const[z,K]=P.useState({open:!1,type:"supplier",to:"",subject:"",body:""}),[v,_]=P.useState(!1),[w,k]=P.useState(!1),[F,B]=P.useState(!1),[be,te]=P.useState(!1),[le,W]=P.useState(!1),[L,Ne]=P.useState(!1),[U,he]=P.useState(null),[T,Se]=P.useState({open:!1}),{data:Q,isLoading:b}=hs(r),d=Q==null?void 0:Q.id,me=(Q==null?void 0:Q._degraded)===!0,se=Q==null?void 0:Q._last_fetched_at,{data:Z}=xs(d),{data:J}=vs(d),{data:j}=fs(d),{data:H}=Es(d),{data:ie}=Os(d),{data:ee}=Ve({queryKey:["easygds","comments",d],queryFn:()=>_s(d),enabled:!!d}),Pe=(Q==null?void 0:Q.payment_id)||((No=Q==null?void 0:Q.payment)==null?void 0:No.id),{data:fe}=Ve({queryKey:["easygds","payment",Pe],queryFn:()=>As(Pe),enabled:!!Pe}),{data:He}=Ve({queryKey:["ops-can","support_ticket.create",r],queryFn:()=>gi("support_ticket.create",r),enabled:!!r,staleTime:3e4}),R=(He==null?void 0:He.effect)!=="deny";pr({mutationFn:m=>Cs({booking_id:d,content:m}),onSuccess:()=>{n.invalidateQueries({queryKey:["easygds","comments",d]}),C(""),i({title:"Comment added"})},onError:m=>{i({variant:"destructive",title:"Error",description:m.message})}});const Ge=pr({mutationFn:m=>ks(d,m),onSuccess:()=>{i({title:"Email sent successfully"}),K({open:!1,type:"supplier",to:"",subject:"",body:""})},onError:m=>{i({variant:"destructive",title:"Failed to send email",description:m.message})}}),ge=(m,l="dd/MM/yyyy")=>{if(!m)return"-";try{return Tr(new Date(m),l)}catch{return String(m)}},de=(m,l)=>`${(Q==null?void 0:Q.currency_code)||"USD"} ${(Number(m)||0).toFixed(2)}`,xe=m=>{const l=(m==null?void 0:m.toLowerCase())||"";return l==="booked"||l==="confirmed"||l==="ticketed"||l==="success"?"bg-green-100 text-green-800 border-green-300":l==="cancelled"||l==="canceled"||l==="failed"?"bg-red-500 text-white":l==="pending"||l==="processing"?"bg-yellow-100 text-yellow-800 border-yellow-300":l==="refunded"?"bg-gray-100 text-gray-800 border-gray-300":"bg-gray-100 text-gray-600"};if(b)return e.jsxDEV("div",{className:"flex items-center justify-center h-64",children:e.jsxDEV("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:231,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:230,columnNumber:7},this);if(!Q)return e.jsxDEV("div",{className:"text-center py-16",children:[e.jsxDEV("p",{className:"text-gray-500",children:["Booking not found: ",r]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:239,columnNumber:9},this),e.jsxDEV(G,{variant:"outline",className:"mt-4",onClick:()=>t("/bookings"),children:"Back to Bookings"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:240,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:238,columnNumber:7},this);const O=Q,ve=Array.isArray(Z)?Z:(Z==null?void 0:Z.result)||[],go=Array.isArray(J)?J:(J==null?void 0:J.result)||[],po=Array.isArray(j)?j:(j==null?void 0:j.result)||[],q=H||O.contact||{};Array.isArray(ee)||ee!=null&&ee.result;const Pi=Array.isArray(ie)?ie:(ie==null?void 0:ie.result)||[],Ci=ve.filter(m=>Ae(m)==="flight"),ki=ve.filter(m=>Ae(m)==="hotel"),_i=ve.filter(m=>Ae(m)==="transfer"),Ai=ve.filter(m=>Ae(m)==="tour"),Ui=ve.filter(m=>Ae(m)==="stopover"),Qe=m=>{switch(m){case"flight":return e.jsxDEV(ze,{className:"h-4 w-4 text-orange-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:266,columnNumber:29},this);case"hotel":return e.jsxDEV(Le,{className:"h-4 w-4 text-blue-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:267,columnNumber:28},this);case"transfer":return e.jsxDEV(Xe,{className:"h-4 w-4 text-green-600"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:268,columnNumber:31},this);case"tour":return e.jsxDEV(dr,{className:"h-4 w-4 text-purple-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:269,columnNumber:27},this);case"stopover":return e.jsxDEV(Lr,{className:"h-4 w-4 text-teal-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:270,columnNumber:31},this);default:return e.jsxDEV(Or,{className:"h-4 w-4 text-gray-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:271,columnNumber:23},this)}},ji=ve.map(m=>m.id),So=ve.flatMap(m=>{const l=m.data||{},I=(l.selected_rooms||l.rooms||[]).flatMap(E=>(E.paxes||E.passengers||E.guests||E.travelers||[]).map(ue=>({...ue,_source:`${l.name||l.hotel_name||"Hotel"} - ${E.room_name||E.name||"Room"}`}))),$=(l.travelers||l.passengers||l.guests||[]).map(E=>({...E,_source:l.name||m.type||"Booking"})),pe=(l.paxes||[]).map(E=>({...E,_source:l.name||m.type||"Booking"}));return[...I,...$,...pe]}),yo=[];if(go.length===0&&So.length===0&&q){const m=q;(m.first_name||m.last_name)&&yo.push({first_name:m.first_name,last_name:m.last_name,title:m.title,type:"adult",country_code:m.country_code||m.nationality,document_id:m.document_id||m.passport_number,birthday:m.birthday||m.birthdate,_source:"Booking contact"})}const Ze=[...go,...So,...yo].filter(m=>{const l=m.data||m;return(l.first_name||"").toString().trim()||(l.last_name||"").toString().trim()}).filter((m,l,I)=>{const $=pe=>{const E=pe.data||pe;return`${(E.first_name||"").trim().toLowerCase()}|${(E.last_name||"").trim().toLowerCase()}`};return I.findIndex(pe=>$(pe)===$(m))===l}),Do=po.filter(m=>m.object_id===d||ji.includes(m.object_id)),Li=Do.filter(m=>m.object_type==="Booking"),qr=Do.filter(m=>m.object_type==="BookingProduct"),Sr=Li[0]||{};Number(Sr.total_amount||O.total_amount),Number(Sr.supplier_total_amount||0),Number(Sr.tax_amount||0),Number(Sr.markup_amount||0),O.json_url;const Vi=`https://dashboard.stg-services.easygds.com/app/${O.app_id}/booking/${O.code}`;return e.jsxDEV("div",{className:"space-y-6",children:[me&&e.jsxDEV("div",{className:"rounded-md border bg-amber-50 border-amber-200 px-4 py-3 text-sm text-amber-900 flex items-start gap-2",children:[e.jsxDEV(Je,{className:"h-4 w-4 mt-0.5 shrink-0"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:378,columnNumber:11},this),e.jsxDEV("div",{children:[e.jsxDEV("strong",{children:"Showing cached snapshot."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:380,columnNumber:13},this)," ","EasyGDS is currently unreachable, so live booking data isn't available right now. Edits and emails sent from this page will be rejected until the connection is restored.",se&&e.jsxDEV(e.Fragment,{children:[" Last fresh data: ",e.jsxDEV("span",{className:"font-medium",children:new Date(se).toLocaleString()},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:384,columnNumber:35},this),"."]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:384,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:379,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:377,columnNumber:9},this),e.jsxDEV("div",{className:"flex items-center justify-between",children:[e.jsxDEV("div",{className:"flex items-center gap-3",children:[e.jsxDEV(G,{variant:"outline",size:"sm",onClick:()=>t("/bookings"),children:[e.jsxDEV(no,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:393,columnNumber:13},this)," Back"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:392,columnNumber:11},this),e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV("h1",{className:"text-2xl font-bold",children:"Booking details"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:397,columnNumber:15},this),e.jsxDEV("span",{className:"text-lg font-mono text-blue-600 font-semibold",children:O.code},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:398,columnNumber:15},this),e.jsxDEV(oe,{className:`${xe(O.status)} text-xs`,children:O.status},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:399,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:396,columnNumber:13},this),(()=>{var I;const m=O.agent_id?y.find($=>$.id===O.agent_id):null,l=(m==null?void 0:m.name)||(q==null?void 0:q.company_name)||(q==null?void 0:q.agency_name)||(O==null?void 0:O.agent_name)||((I=O==null?void 0:O.agent)==null?void 0:I.name)||"";return l?e.jsxDEV("p",{className:"text-sm text-gray-500 mt-0.5",children:l},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:409,columnNumber:17},this):null})()]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:395,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:391,columnNumber:9},this),e.jsxDEV("div",{className:"flex items-center gap-2"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:414,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:390,columnNumber:7},this),e.jsxDEV(Gr,{value:x,onValueChange:N,className:"space-y-4",children:[e.jsxDEV(Yr,{className:"bg-transparent border-b border-gray-200 rounded-none p-0 h-auto w-full justify-end",children:[e.jsxDEV(Ce,{value:"general",className:"data-[state=active]:border-b-2 data-[state=active]:border-blue-600 data-[state=active]:text-blue-600 data-[state=active]:shadow-none rounded-none px-4 py-2",children:"General"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:421,columnNumber:11},this),e.jsxDEV(Ce,{value:"contact",className:"data-[state=active]:border-b-2 data-[state=active]:border-blue-600 data-[state=active]:text-blue-600 data-[state=active]:shadow-none rounded-none px-4 py-2",children:"Contact"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:422,columnNumber:11},this),e.jsxDEV(Ce,{value:"pricing",className:"data-[state=active]:border-b-2 data-[state=active]:border-blue-600 data-[state=active]:text-blue-600 data-[state=active]:shadow-none rounded-none px-4 py-2",children:"Pricing"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:423,columnNumber:11},this),e.jsxDEV(Ce,{value:"invoices",className:"data-[state=active]:border-b-2 data-[state=active]:border-blue-600 data-[state=active]:text-blue-600 data-[state=active]:shadow-none rounded-none px-4 py-2",children:"Invoices"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:424,columnNumber:11},this),g&&e.jsxDEV(Ce,{value:"emails",className:"data-[state=active]:border-b-2 data-[state=active]:border-blue-600 data-[state=active]:text-blue-600 data-[state=active]:shadow-none rounded-none px-4 py-2",children:"Emails"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:432,columnNumber:13},this),g&&e.jsxDEV(Ce,{value:"history",className:"data-[state=active]:border-b-2 data-[state=active]:border-blue-600 data-[state=active]:text-blue-600 data-[state=active]:shadow-none rounded-none px-4 py-2",children:"History"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:438,columnNumber:13},this),e.jsxDEV(Ce,{value:"support",className:"data-[state=active]:border-b-2 data-[state=active]:border-orange-500 data-[state=active]:text-orange-500 data-[state=active]:shadow-none rounded-none px-4 py-2 flex items-center gap-1",children:[e.jsxDEV($e,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:441,columnNumber:13},this)," Support"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:440,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:420,columnNumber:9},this),e.jsxDEV(ke,{value:"general",className:"space-y-6",children:[e.jsxDEV("div",{className:"flex items-center justify-between text-sm text-gray-500",children:[e.jsxDEV("div",{className:"flex items-center gap-4",children:[e.jsxDEV("span",{className:"flex items-center gap-1",children:[e.jsxDEV(Jo,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:450,columnNumber:57},this)," ",ge(O.created_at,"dd. MMM. yyyy. hh:mm a")]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:450,columnNumber:15},this),e.jsxDEV(oe,{className:`${xe(((ho=O.payment)==null?void 0:ho.status)||"")} text-xs`,children:["Payment: ",((xo=O.payment)==null?void 0:xo.status)||"-"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:451,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:449,columnNumber:13},this),e.jsxDEV("span",{className:"text-xs",children:[ve.length," service(s)"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:453,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:448,columnNumber:11},this),p==="system"&&e.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[e.jsxDEV(G,{size:"sm",className:"bg-blue-600 hover:bg-blue-700",onClick:()=>window.open(Vi,"_blank"),children:[e.jsxDEV(Wr,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:461,columnNumber:15},this)," Open EasyGDS"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:459,columnNumber:13},this),e.jsxDEV(G,{variant:"outline",size:"sm",onClick:()=>_(!0),children:[e.jsxDEV(gr,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:464,columnNumber:15},this)," Email Supplier"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:463,columnNumber:13},this),e.jsxDEV(G,{variant:"outline",size:"sm",onClick:()=>k(!0),children:[e.jsxDEV(gr,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:467,columnNumber:15},this)," Email Customer"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:466,columnNumber:13},this),e.jsxDEV(G,{variant:"outline",size:"sm",onClick:()=>V("supplier"),children:[e.jsxDEV(Er,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:470,columnNumber:15},this)," Supplier Thread"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:469,columnNumber:13},this),e.jsxDEV(G,{variant:"outline",size:"sm",onClick:()=>V("customer"),children:[e.jsxDEV(Er,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:473,columnNumber:15},this)," Customer Thread"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:472,columnNumber:13},this),e.jsxDEV(G,{variant:"outline",size:"sm",onClick:()=>B(!0),children:[e.jsxDEV(io,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:476,columnNumber:15},this)," Send Voucher"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:475,columnNumber:13},this),e.jsxDEV(G,{variant:"outline",size:"sm",onClick:()=>W(!0),children:[e.jsxDEV(lr,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:479,columnNumber:15},this)," Update Confirmations"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:478,columnNumber:13},this),e.jsxDEV(G,{variant:"outline",size:"sm",onClick:()=>te(!0),children:[e.jsxDEV(lr,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:482,columnNumber:15},this)," Review"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:481,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:458,columnNumber:11},this),e.jsxDEV(ae,{children:e.jsxDEV(ne,{className:"p-4",children:[e.jsxDEV("h3",{className:"font-semibold flex items-center gap-2 mb-4",children:[e.jsxDEV(nr,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:490,columnNumber:74},this)," Passengers data"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:490,columnNumber:15},this),e.jsxDEV("table",{className:"w-full text-sm text-left",children:[e.jsxDEV("thead",{children:e.jsxDEV("tr",{className:"border-b border-gray-200 bg-gray-50",children:[e.jsxDEV("th",{className:"p-2",children:"#"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:494,columnNumber:21},this),e.jsxDEV("th",{className:"p-2",children:"Type"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:495,columnNumber:21},this),e.jsxDEV("th",{className:"p-2",children:"Name"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:496,columnNumber:21},this),e.jsxDEV("th",{className:"p-2",children:"Birthdate"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:497,columnNumber:21},this),e.jsxDEV("th",{className:"p-2",children:"Nationality"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:498,columnNumber:21},this),e.jsxDEV("th",{className:"p-2",children:"Passport number"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:499,columnNumber:21},this),e.jsxDEV("th",{className:"p-2",children:"Actions"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:500,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:493,columnNumber:19},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:492,columnNumber:17},this),e.jsxDEV("tbody",{children:[Ze.map((m,l)=>{const I=m.data||m;return e.jsxDEV("tr",{className:"border-b border-gray-100",children:[e.jsxDEV("td",{className:"p-2",children:[l+1,"."]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:508,columnNumber:25},this),e.jsxDEV("td",{className:"p-2",children:I.type||"adult"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:509,columnNumber:25},this),e.jsxDEV("td",{className:"p-2",children:[I.title||""," ",I.first_name||""," ",I.last_name||""]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:510,columnNumber:25},this),e.jsxDEV("td",{className:"p-2",children:I.birthday?ge(I.birthday):"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:511,columnNumber:25},this),e.jsxDEV("td",{className:"p-2",children:I.country_code||I.nationality||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:512,columnNumber:25},this),e.jsxDEV("td",{className:"p-2",children:I.document_id||I.passport_number||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:513,columnNumber:25},this),e.jsxDEV("td",{className:"p-2",children:R&&e.jsxDEV(G,{variant:"outline",size:"sm",className:"text-xs text-orange-600 border-orange-200 hover:bg-orange-50 h-7",onClick:()=>Se({open:!0,actionType:"passenger_change",scope:String(l)}),children:[e.jsxDEV($e,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:522,columnNumber:31},this)," Request Change"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:516,columnNumber:29},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:514,columnNumber:25},this)]},l,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:507,columnNumber:23},this)}),Ze.length===0&&e.jsxDEV("tr",{children:e.jsxDEV("td",{colSpan:7,className:"p-4 text-center text-gray-400",children:"No traveler data"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:530,columnNumber:25},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:530,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:503,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:491,columnNumber:15},this),Ze.length>0&&e.jsxDEV("div",{className:"text-right text-sm text-gray-500 mt-2",children:["Showing 1 to ",Ze.length," of ",Ze.length," entries"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:535,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:489,columnNumber:13},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:488,columnNumber:11},this),ki.map(m=>{var qe,je,Fe;const l=m.data||{},I=l.name||l.hotel_name||l.property_name||"",$=Number(l.star)||Number(l.star_rating)||0,pe=l.street_address||l.address||"",E=l.phone||"",ue=l.fax||"";l.email;const Ue=l.selected_rooms||[],Ee=l.rooms||[],Me=l.checkin_date,Ye=l.checkout_date,Be=l.night_count||"",we=l.supplier_code||l.supplier_source||"",Te=l.booking_ref||l.easygds_id||m.product_ref||"";l.avatar;const ye=l.price_info||{},Re=l.prices||[],Oe=l.currency_info||{},re=Oe.origin||l.currency||O.currency_code||"USD";return(Fe=(je=(qe=Ee[0])==null?void 0:qe.images)==null?void 0:je[0])!=null&&Fe.url,I?e.jsxDEV(ae,{className:"overflow-hidden",children:[e.jsxDEV("div",{className:"px-4 py-2 bg-gray-50 border-b flex items-center justify-between flex-wrap gap-2",children:[e.jsxDEV("div",{className:"flex items-center gap-2",children:[Qe("hotel"),e.jsxDEV(oe,{className:`${xe(m.status||O.status)} text-xs`,children:(m.status||O.status).toUpperCase()},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:575,columnNumber:21},this),e.jsxDEV("span",{className:"text-xs text-gray-500 font-mono",children:Te},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:576,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:573,columnNumber:19},this),e.jsxDEV("div",{className:"flex items-center gap-2",children:[m.free_cancellation_deadline&&e.jsxDEV("span",{className:"text-xs text-gray-500",children:["FOC: ",ge(m.free_cancellation_deadline,"dd/MM/yyyy HH:mm")]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:580,columnNumber:23},this),m.pdf_url?e.jsxDEV("a",{href:m.pdf_url,target:"_blank",rel:"noreferrer",children:e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",children:[e.jsxDEV(Ie,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:585,columnNumber:27},this)," Voucher"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:584,columnNumber:25},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:583,columnNumber:23},this):null,g&&e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2 text-blue-600 border-blue-200 hover:bg-blue-50",onClick:()=>he(m),children:[e.jsxDEV(ar,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:595,columnNumber:25},this)," Edit"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:590,columnNumber:23},this),R&&e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2 text-orange-600 border-orange-200 hover:bg-orange-50",onClick:()=>Se({open:!0,actionType:"amend",scope:m.id}),children:[e.jsxDEV($e,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:604,columnNumber:25},this)," Request Change"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:599,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:578,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:572,columnNumber:17},this),e.jsxDEV(ne,{className:"p-4",children:[e.jsxDEV("h3",{className:"font-semibold text-lg mb-1",children:I},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:610,columnNumber:19},this),$>0&&e.jsxDEV("div",{className:"text-yellow-500 text-sm mb-3",children:"★".repeat(Math.min($,5))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:611,columnNumber:38},this),e.jsxDEV("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-4 text-sm",children:[e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV(Jo,{className:"h-4 w-4 text-gray-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:615,columnNumber:23},this),e.jsxDEV("div",{children:[e.jsxDEV("span",{className:"text-gray-500",children:"Checkin / Checkout"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:617,columnNumber:25},this),e.jsxDEV("div",{className:"font-medium",children:[ge(Me)," / ",ge(Ye)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:618,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:616,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:614,columnNumber:21},this),e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV(Le,{className:"h-4 w-4 text-gray-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:622,columnNumber:23},this),e.jsxDEV("div",{children:[e.jsxDEV("span",{className:"text-gray-500",children:"Stay"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:624,columnNumber:25},this),e.jsxDEV("div",{className:"font-medium",children:[Be," Night(s)"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:625,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:623,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:621,columnNumber:21},this),E&&e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV(ri,{className:"h-4 w-4 text-gray-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:630,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("span",{className:"text-gray-500",children:"Phone"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:632,columnNumber:27},this),e.jsxDEV("div",{className:"font-medium",children:E},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:633,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:631,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:629,columnNumber:23},this),ue&&e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV(ri,{className:"h-4 w-4 text-gray-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:639,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("span",{className:"text-gray-500",children:"Fax"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:641,columnNumber:27},this),e.jsxDEV("div",{className:"font-medium",children:ue},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:642,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:640,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:638,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:613,columnNumber:19},this),pe&&e.jsxDEV("div",{className:"text-sm text-gray-600 mb-4",children:[e.jsxDEV(mt,{className:"h-3 w-3 inline mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:650,columnNumber:23},this)," ",pe]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:649,columnNumber:21},this),(Ue.length>0?Ue:Ee).length>0&&e.jsxDEV("div",{className:"space-y-4 mt-4",children:(Ue.length>0?Ue:Ee).map((M,yr)=>{var Bo,wo,To,Ro,qo,Fo,$o;const Ar=M.name||M.room_name||M.supplier_room_name||"Room",Fr=M.board_basis||((Bo=M.rate)==null?void 0:Bo.board_basis)||"",$r=M.free_cancellation===!0||((wo=M.rate)==null?void 0:wo.free_cancellation)===!0||((To=M.rate)==null?void 0:To.non_refundable)===!1,jo=M.free_cancellation_deadline||((Ro=M.rate)==null?void 0:Ro.free_cancellation_deadline)||M.cancellation_deadline||M.supplier_cancellation_deadline||null,Gi=X=>X.length>8&&!/[A-Z]/.test(X),Hr=[(qo=M.rate)==null?void 0:qo.source_id,(Fo=M.rate)==null?void 0:Fo.supplier_code,we,M.supplier_code,M.supplier_source,M.provider_code].filter(X=>typeof X=="string"&&X.trim().length>0).map(X=>X.trim()),ir=Hr.find(X=>X!=="MGJarvis"&&!Gi(X))||Hr.find(X=>X!=="MGJarvis")||Hr[0]||"",sr=ir?S(ir):null,Yi=(sr==null?void 0:sr.supplier_name)||ir||M.source_id||"-",Lo=M.supplier_code&&M.supplier_code!==ir?M.supplier_code:"",_e=M.rate||{};_e.prices||M.prices;const Vo=_e.price_info||M.price_info||{},Go=M.confirmation_number||M.hcn||M.bk_ref||_e.booking_reference||"",Mr=M.hcn||"",Ir=M.pvd_bk_ref||"",Yo=M.bk_ref||M.easygds_id||Te,Dr=Vo.total_amount||_e.total_amount||0,zr=Vo.supplier_total_amount||_e.supplier_total_amount||0,Kr=M.cancellation_policies||_e.cancellation_policies||_e.cancellations||_e.original_cancellations||[],Bi=_e.currency||_e.currency_code||re;return e.jsxDEV("div",{className:"border rounded-lg p-4 bg-gray-50",children:[e.jsxDEV("h4",{className:"font-semibold text-sm mb-3",children:["Room #",yr+1,": ",Ar," ",Fr?`(${Fr})`:""]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:766,columnNumber:29},this),e.jsxDEV("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm mb-3",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Board Basis"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:772,columnNumber:33},this),e.jsxDEV("div",{className:"font-medium mt-0.5",children:Fr||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:773,columnNumber:33},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:771,columnNumber:31},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Refundable"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:776,columnNumber:33},this),e.jsxDEV("div",{className:"mt-0.5",children:$r?e.jsxDEV(oe,{className:"bg-green-100 text-green-800 text-xs",children:"Yes"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:779,columnNumber:37},this):e.jsxDEV(oe,{className:"bg-red-100 text-red-800 text-xs",children:"No"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:781,columnNumber:37},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:777,columnNumber:33},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:775,columnNumber:31},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Free Cancellation"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:786,columnNumber:33},this),e.jsxDEV("div",{className:"mt-0.5",children:$r?e.jsxDEV(oe,{className:"bg-green-100 text-green-800 text-xs",children:"Yes"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:789,columnNumber:37},this):e.jsxDEV(oe,{className:"bg-red-100 text-red-800 text-xs",children:"No"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:791,columnNumber:37},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:787,columnNumber:33},this),$r&&jo&&e.jsxDEV("div",{className:"text-[10px] text-gray-500 mt-0.5",children:["until ",ge(jo,"dd MMM yyyy HH:mm")]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:795,columnNumber:35},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:785,columnNumber:31},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Provider"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:801,columnNumber:33},this),e.jsxDEV("div",{className:"font-medium mt-0.5",children:Yi},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:802,columnNumber:33},this),(sr==null?void 0:sr.supplier_name)&&ir&&sr.supplier_name!==ir&&e.jsxDEV("div",{className:"text-[10px] text-gray-400 font-mono mt-0.5",children:ir},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:808,columnNumber:35},this),Lo&&e.jsxDEV("div",{className:"text-[10px] text-gray-400 italic mt-0.5",title:"Inventory provider behind the supplier",children:["inventory: ",Lo]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:815,columnNumber:35},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:800,columnNumber:31},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:770,columnNumber:29},this),e.jsxDEV("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 text-sm mb-3",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Price"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:824,columnNumber:33},this),e.jsxDEV("div",{className:"font-medium mt-0.5",children:Dr?`${re} ${Number(Dr).toFixed(1)}`:"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:825,columnNumber:33},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:823,columnNumber:31},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Booking Reference"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:828,columnNumber:33},this),e.jsxDEV("div",{className:"font-mono text-xs mt-0.5",children:Yo||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:829,columnNumber:33},this),Ir&&Ir!==Yo&&e.jsxDEV("div",{className:"text-[10px] text-gray-400 font-mono mt-0.5",title:"Provider booking reference (upstream)",children:["pvd: ",Ir]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:834,columnNumber:35},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:827,columnNumber:31},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Confirmation Number"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:840,columnNumber:33},this),e.jsxDEV("div",{className:"font-mono text-xs mt-0.5",children:Go||"-/-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:841,columnNumber:33},this),Mr&&Mr!==Go&&e.jsxDEV("div",{className:"text-[10px] text-gray-400 font-mono mt-0.5",title:"Hotel Confirmation Number",children:["HCN: ",Mr]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:846,columnNumber:35},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:839,columnNumber:31},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:822,columnNumber:29},this),Kr.length>0&&e.jsxDEV("div",{className:"mt-3",children:[e.jsxDEV("h5",{className:"text-xs font-semibold text-gray-600 mb-1",children:"Cancellation Policies"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:856,columnNumber:33},this),e.jsxDEV("table",{className:"w-full text-xs",children:[e.jsxDEV("thead",{children:e.jsxDEV("tr",{className:"bg-gray-100",children:[e.jsxDEV("th",{className:"p-1.5 text-left",children:"From"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:860,columnNumber:39},this),e.jsxDEV("th",{className:"p-1.5 text-left",children:"To"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:861,columnNumber:39},this),e.jsxDEV("th",{className:"p-1.5 text-right",children:"Penalty"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:862,columnNumber:39},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:859,columnNumber:37},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:858,columnNumber:35},this),e.jsxDEV("tbody",{children:Kr.map((X,Ur)=>{var Mo,Io,zo;const Nr=typeof((Mo=X.price_info)==null?void 0:Mo.total_amount)=="number"?X.price_info.total_amount:null,hr=typeof X.amount=="number"?X.amount:Number(X.amount),Qr=Number.isFinite(hr),Ho=((Io=X.currency_info)==null?void 0:Io.conversion)||Bi,xr=((zo=X.currency_info)==null?void 0:zo.original)||X.currency||X.currency_code||"",Zr=Nr===0||Qr&&hr===0,wi=Ur===Kr.length-1?"onwards":ge(X.to||X.end_date||X.utc_to,"dd-MM-yyyy HH:mm"),Ti=Nr!==null?`${Ho+" "}${Nr.toFixed(2)}`:Qr?`${xr?xr+" ":""}${hr.toFixed(2)}`:"-",Ri=Nr!==null&&Qr&&hr!==Nr&&xr&&xr!==Ho;return e.jsxDEV("tr",{className:"border-b border-gray-200",children:[e.jsxDEV("td",{className:"p-1.5",children:ge(X.from||X.start_date||X.utc_from,"dd-MM-yyyy HH:mm")},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:899,columnNumber:43},this),e.jsxDEV("td",{className:"p-1.5",children:wi},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:900,columnNumber:43},this),e.jsxDEV("td",{className:`p-1.5 text-right ${Zr?"text-green-700":"text-red-700"}`,children:[Zr?"Free":Ti,!Zr&&Ri&&e.jsxDEV("div",{className:"text-[10px] text-gray-400 font-normal",children:["(",xr," ",hr.toFixed(2),")"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:904,columnNumber:47},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:901,columnNumber:43},this)]},Ur,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:898,columnNumber:41},this)})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:865,columnNumber:35},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:857,columnNumber:33},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:855,columnNumber:31},this),(zr||Dr)&&e.jsxDEV("div",{className:"mt-3",children:[e.jsxDEV("h5",{className:"text-xs font-semibold text-gray-600 mb-1",children:"Prices"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:920,columnNumber:33},this),e.jsxDEV("div",{className:"grid grid-cols-3 gap-4 text-xs",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-gray-500",children:"Supplier Total Amount"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:923,columnNumber:37},this),e.jsxDEV("div",{className:"font-medium",children:zr?`${(($o=_e.currency_info)==null?void 0:$o.original)||_e.currency||_e.currency_code||re} ${Number(zr).toFixed(2)}`:"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:924,columnNumber:37},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:922,columnNumber:35},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-gray-500",children:"Total Amount"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:929,columnNumber:37},this),e.jsxDEV("div",{className:"font-medium",children:Dr?`${re} ${Number(Dr).toFixed(1)}`:"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:930,columnNumber:37},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:928,columnNumber:35},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-gray-500",children:"Currency"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:933,columnNumber:37},this),e.jsxDEV("div",{className:"font-medium",children:Oe.origin&&Oe.target?`${Oe.origin} → ${Oe.target} : ${Oe.rate||""}`:re},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:934,columnNumber:37},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:932,columnNumber:35},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:921,columnNumber:33},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:919,columnNumber:31},this),M.paxes&&(Array.isArray(M.paxes)?M.paxes:[M.paxes]).length>0&&e.jsxDEV("div",{className:"mt-2 flex items-center gap-2 text-xs",children:[e.jsxDEV(nr,{className:"h-3 w-3 text-gray-400"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:947,columnNumber:33},this),(Array.isArray(M.paxes)?M.paxes:[M.paxes]).map((X,Ur)=>e.jsxDEV("span",{className:"bg-blue-50 text-blue-700 px-2 py-0.5 rounded border border-blue-200",children:[X.title||""," ",X.first_name," ",X.last_name," ",e.jsxDEV("span",{className:"text-blue-400",children:["(",X.type||"adult",")"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:950,columnNumber:88},this)]},Ur,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:949,columnNumber:35},this))]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:946,columnNumber:31},this)]},yr,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:765,columnNumber:27},this)})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:661,columnNumber:21},this),Re.length>0&&e.jsxDEV("div",{className:"mt-4 pt-3 border-t",children:[e.jsxDEV("h4",{className:"font-semibold text-sm mb-2",children:"Prices"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:964,columnNumber:23},this),e.jsxDEV("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4 text-sm",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Base Amount"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:967,columnNumber:27},this),e.jsxDEV("div",{className:"font-medium",children:ye.base_amount?`${re} ${Number(ye.base_amount).toFixed(1)}`:"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:968,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:966,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Markup"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:971,columnNumber:27},this),e.jsxDEV("div",{className:"font-medium",children:ye.markup_amount?`${re} ${Number(ye.markup_amount).toFixed(1)}`:"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:972,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:970,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Tax"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:975,columnNumber:27},this),e.jsxDEV("div",{className:"font-medium",children:ye.tax_amount?`${re} ${Number(ye.tax_amount).toFixed(1)}`:"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:976,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:974,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Reward Points"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:979,columnNumber:27},this),e.jsxDEV("div",{className:"font-medium",children:ye.reward_amount?`${re} ${Number(ye.reward_amount).toFixed(1)}`:"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:980,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:978,columnNumber:25},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Total Amount"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:983,columnNumber:27},this),e.jsxDEV("div",{className:"font-bold",children:ye.total_amount?`${re} ${Number(ye.total_amount).toFixed(1)}`:"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:984,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:982,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:965,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:963,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:609,columnNumber:17},this)]},m.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:570,columnNumber:15},this):null}),Ci.map(m=>{var Ye,Be,we,Te,ye,Re,Oe;const l=m.data||{},I=l.segments||((Be=(Ye=l.legs)==null?void 0:Ye[Object.keys(l.legs||{})[0]])==null?void 0:Be.segments)||[],$=Array.isArray(I)?I:[],pe=l.pnr||((we=l.pnr_data)==null?void 0:we.pnr)||((Te=Pi.find(re=>re.product_id===m.id))==null?void 0:Te.pnr)||"",E=ro(m),ue=E?S(E):null,Ue=(ue==null?void 0:ue.supplier_name)||E||"-",Ee=l.fare||l.price_info||{};if($.length===0)return null;const Me=$.some(re=>re.type==="return"||re.direction==="return");return e.jsxDEV(ae,{className:"overflow-hidden",children:[e.jsxDEV("div",{className:"px-4 py-2 bg-gray-50 border-b flex items-center justify-between flex-wrap gap-2",children:[e.jsxDEV("div",{className:"flex items-center gap-2",children:[Qe("flight"),e.jsxDEV(oe,{className:`${xe(m.status||O.status)} text-xs`,children:(m.status||O.status).toUpperCase()},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1018,columnNumber:21},this),e.jsxDEV("span",{className:"text-xs text-gray-500 font-mono",children:pe||m.product_ref||""},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1019,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1016,columnNumber:19},this),e.jsxDEV("div",{className:"flex items-center gap-2",children:[m.pdf_url?e.jsxDEV("a",{href:m.pdf_url,target:"_blank",rel:"noreferrer",children:e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",children:[e.jsxDEV(Ie,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1025,columnNumber:27},this)," Voucher"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1024,columnNumber:25},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1023,columnNumber:23},this):null,g&&e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2 text-blue-600 border-blue-200 hover:bg-blue-50",onClick:()=>he(m),children:[e.jsxDEV(ar,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1035,columnNumber:25},this)," Edit"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1030,columnNumber:23},this),R&&e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2 text-orange-600 border-orange-200 hover:bg-orange-50",onClick:()=>Se({open:!0,actionType:"amend",scope:m.id}),children:[e.jsxDEV($e,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1044,columnNumber:25},this)," Request Change"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1039,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1021,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1015,columnNumber:17},this),e.jsxDEV(ne,{className:"p-4",children:[e.jsxDEV("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[e.jsxDEV(ze,{className:"h-4 w-4 text-orange-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1050,columnNumber:78},this)," Flight"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1050,columnNumber:19},this),e.jsxDEV("div",{className:"text-lg font-bold mb-1",children:[(ye=$[0])==null?void 0:ye.departure_airport_code," to ",(Re=$[$.length-1])==null?void 0:Re.arrival_airport_code,Me&&e.jsxDEV("span",{className:"text-sm text-gray-500 font-normal ml-2",children:"(Round trip)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1053,columnNumber:37},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1051,columnNumber:19},this),e.jsxDEV("div",{className:"grid grid-cols-3 gap-4 mb-3 text-sm",children:[e.jsxDEV("div",{children:[e.jsxDEV("span",{className:"text-gray-500",children:"Provider:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1057,columnNumber:23},this)," ",Ue,(ue==null?void 0:ue.supplier_name)&&E&&ue.supplier_name!==E&&e.jsxDEV("span",{className:"text-[10px] text-gray-400 font-mono ml-1.5",children:["(",E,")"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1059,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1056,columnNumber:21},this),e.jsxDEV("div",{children:[e.jsxDEV("span",{className:"text-gray-500",children:"PNR:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1062,columnNumber:26},this)," ",e.jsxDEV("span",{className:"font-bold text-blue-700",children:pe||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1062,columnNumber:70},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1062,columnNumber:21},this),e.jsxDEV("div",{children:[e.jsxDEV("span",{className:"text-gray-500",children:"Departure:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1063,columnNumber:26},this)," ",ge((Oe=$[0])==null?void 0:Oe.departure_datetime,"dd-MM-yyyy HH:mm")]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1063,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1055,columnNumber:19},this),e.jsxDEV("table",{className:"w-full text-sm text-left",children:[e.jsxDEV("thead",{children:e.jsxDEV("tr",{className:"bg-gray-50 border-b",children:[e.jsxDEV("th",{className:"p-2",children:"Route"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1068,columnNumber:25},this),e.jsxDEV("th",{className:"p-2",children:"Airline"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1069,columnNumber:25},this),e.jsxDEV("th",{className:"p-2",children:"Flight"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1070,columnNumber:25},this),e.jsxDEV("th",{className:"p-2",children:"Cabin"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1071,columnNumber:25},this),e.jsxDEV("th",{className:"p-2",children:"Departure"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1072,columnNumber:25},this),e.jsxDEV("th",{className:"p-2",children:"Arrival"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1073,columnNumber:25},this),e.jsxDEV("th",{className:"p-2",children:"Baggage"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1074,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1067,columnNumber:23},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1066,columnNumber:21},this),e.jsxDEV("tbody",{children:$.map((re,qe)=>{var M,yr,Ar;const je=re.flight_no||re.airline_code||"",Fe=((Ar=(yr=(M=Ee==null?void 0:Ee.baggage_allowance)==null?void 0:M[je])==null?void 0:yr.adult)==null?void 0:Ar.text)||(Ee==null?void 0:Ee.baggage_info)||"-";return e.jsxDEV("tr",{className:"border-b border-gray-100",children:[e.jsxDEV("td",{className:"p-2",children:re.type||"departure"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1083,columnNumber:29},this),e.jsxDEV("td",{className:"p-2",children:re.airline_code},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1084,columnNumber:29},this),e.jsxDEV("td",{className:"p-2",children:je},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1085,columnNumber:29},this),e.jsxDEV("td",{className:"p-2",children:re.cabin_class||re.cabin},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1086,columnNumber:29},this),e.jsxDEV("td",{className:"p-2",children:[re.departure_airport_code," ",ge(re.departure_datetime,"dd-MM-yyyy HH:mm")]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1087,columnNumber:29},this),e.jsxDEV("td",{className:"p-2",children:[re.arrival_airport_code," ",ge(re.arrival_datetime,"dd-MM-yyyy HH:mm")]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1088,columnNumber:29},this),e.jsxDEV("td",{className:"p-2",children:["Adult: ",typeof Fe=="string"?Fe:"-"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1089,columnNumber:29},this)]},qe,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1082,columnNumber:27},this)})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1077,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1065,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1049,columnNumber:17},this)]},m.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1013,columnNumber:15},this)}),_i.map(m=>{var I;const l=m.data||{};return e.jsxDEV(ae,{className:"overflow-hidden",children:[e.jsxDEV("div",{className:"px-4 py-2 bg-gray-50 border-b flex items-center justify-between flex-wrap gap-2",children:[e.jsxDEV("div",{className:"flex items-center gap-2",children:[Qe("transfer"),e.jsxDEV(oe,{className:`${xe(m.status||O.status)} text-xs`,children:(m.status||O.status).toUpperCase()},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1105,columnNumber:85},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1105,columnNumber:19},this),e.jsxDEV("div",{className:"flex items-center gap-2",children:[m.pdf_url&&e.jsxDEV("a",{href:m.pdf_url,target:"_blank",rel:"noreferrer",children:e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",children:[e.jsxDEV(Ie,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1107,columnNumber:163},this)," Voucher"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1107,columnNumber:94},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1107,columnNumber:38},this),g&&e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2 text-blue-600 border-blue-200 hover:bg-blue-50",onClick:()=>he(m),children:[e.jsxDEV(ar,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1108,columnNumber:197},this)," Edit"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1108,columnNumber:41},this),R&&e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2 text-orange-600 border-orange-200 hover:bg-orange-50",onClick:()=>Se({open:!0,actionType:"amend",scope:m.id}),children:[e.jsxDEV($e,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1109,columnNumber:249},this)," Request Change"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1109,columnNumber:41},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1106,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1104,columnNumber:17},this),e.jsxDEV(ne,{className:"p-4",children:[e.jsxDEV("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[e.jsxDEV(Xe,{className:"h-4 w-4 text-green-600"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1113,columnNumber:78},this)," Transfer"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1113,columnNumber:19},this),e.jsxDEV("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Pickup"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1116,columnNumber:23},this),e.jsxDEV("div",{className:"font-medium",children:l.pickup_from||l.pickup_place||l.pickup_location||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1117,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1115,columnNumber:21},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Dropoff"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1120,columnNumber:23},this),e.jsxDEV("div",{className:"font-medium",children:l.dropoff_to||l.dropoff_place||l.dropoff_location||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1121,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1119,columnNumber:21},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Date & Time"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1124,columnNumber:23},this),e.jsxDEV("div",{className:"font-medium",children:[ge(l.transfer_date)," ",l.transfer_time||""]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1125,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1123,columnNumber:21},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Vehicle"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1128,columnNumber:23},this),e.jsxDEV("div",{className:"font-medium",children:((I=l.vehicle)==null?void 0:I.name)||l.vehicle_type||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1129,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1127,columnNumber:21},this),l.meeting_point&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Meeting Point"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1133,columnNumber:25},this),e.jsxDEV("div",{className:"font-medium",children:l.meeting_point},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1134,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1132,columnNumber:23},this),l.booking_reference&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Booking Reference"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1139,columnNumber:25},this),e.jsxDEV("div",{className:"font-mono text-xs",children:l.booking_reference},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1140,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1138,columnNumber:23},this),l.confirm_reference&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Confirmation Reference"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1145,columnNumber:25},this),e.jsxDEV("div",{className:"font-mono text-xs",children:l.confirm_reference},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1146,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1144,columnNumber:23},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Provider"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1150,columnNumber:23},this),e.jsxDEV("div",{className:"font-medium",children:l.provider_code||l.supplier_code||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1151,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1149,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1114,columnNumber:19},this),l.instructions&&e.jsxDEV("div",{className:"mt-3 p-2 bg-yellow-50 rounded text-xs text-yellow-800",children:[e.jsxDEV("strong",{children:"Instructions:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1156,columnNumber:23},this)," ",l.instructions]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1155,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1112,columnNumber:17},this)]},m.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1103,columnNumber:15},this)}),Ai.map(m=>{const l=m.data||{};return e.jsxDEV(ae,{className:"overflow-hidden",children:[e.jsxDEV("div",{className:"px-4 py-2 bg-gray-50 border-b flex items-center justify-between flex-wrap gap-2",children:[e.jsxDEV("div",{className:"flex items-center gap-2",children:[Qe("tour"),e.jsxDEV(oe,{className:`${xe(m.status||O.status)} text-xs`,children:(m.status||O.status).toUpperCase()},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1170,columnNumber:81},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1170,columnNumber:19},this),e.jsxDEV("div",{className:"flex items-center gap-2",children:[m.pdf_url&&e.jsxDEV("a",{href:m.pdf_url,target:"_blank",rel:"noreferrer",children:e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",children:[e.jsxDEV(Ie,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1172,columnNumber:163},this)," Voucher"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1172,columnNumber:94},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1172,columnNumber:38},this),g&&e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2 text-blue-600 border-blue-200 hover:bg-blue-50",onClick:()=>he(m),children:[e.jsxDEV(ar,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1173,columnNumber:197},this)," Edit"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1173,columnNumber:41},this),R&&e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2 text-orange-600 border-orange-200 hover:bg-orange-50",onClick:()=>Se({open:!0,actionType:"amend",scope:m.id}),children:[e.jsxDEV($e,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1174,columnNumber:249},this)," Request Change"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1174,columnNumber:41},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1171,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1169,columnNumber:17},this),e.jsxDEV(ne,{className:"p-4",children:[e.jsxDEV("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[e.jsxDEV(dr,{className:"h-4 w-4 text-purple-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1178,columnNumber:78},this)," Tour"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1178,columnNumber:19},this),e.jsxDEV("h4",{className:"text-lg font-bold mb-2",children:l.title||l.code||"Tour"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1179,columnNumber:19},this),e.jsxDEV("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm",children:[l.location&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Location"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1183,columnNumber:25},this),e.jsxDEV("div",{className:"font-medium",children:typeof l.location=="object"&&l.location!==null?l.location.name||l.location.city||l.location.address||[l.location.city_code,l.location.country_code].filter(Boolean).join(", ")||"—":l.location},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1191,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1182,columnNumber:23},this),l.departure_date&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Date"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1204,columnNumber:25},this),e.jsxDEV("div",{className:"font-medium",children:ge(l.departure_date)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1205,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1203,columnNumber:23},this),l.duration&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Duration"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1210,columnNumber:25},this),e.jsxDEV("div",{className:"font-medium",children:typeof l.duration=="object"&&l.duration!==null?l.duration.text||[l.duration.min,l.duration.max].filter(Boolean).join("–")||"—":l.duration},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1219,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1209,columnNumber:23},this),l.language_guides&&(Array.isArray(l.language_guides)?l.language_guides.length>0:!0)&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Language"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1230,columnNumber:25},this),e.jsxDEV("div",{className:"font-medium",children:Array.isArray(l.language_guides)?l.language_guides.join(", "):l.language_guides},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1231,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1229,columnNumber:23},this),l.booking_reference&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Booking Reference"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1236,columnNumber:25},this),e.jsxDEV("div",{className:"font-mono text-xs mt-0.5",children:l.booking_reference},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1237,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1235,columnNumber:23},this),(l.provider_reference||l.confirm_reference)&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Provider Reference"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1242,columnNumber:25},this),e.jsxDEV("div",{className:"font-mono text-xs mt-0.5",children:l.provider_reference||l.confirm_reference},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1243,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1241,columnNumber:23},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Provider"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1247,columnNumber:23},this),e.jsxDEV("div",{className:"font-medium",children:l.supplier_code||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1248,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1246,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1180,columnNumber:19},this),l.description&&e.jsxDEV("div",{className:"mt-3 text-sm text-gray-600",children:typeof l.description=="string"?l.description.substring(0,300):""},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1252,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1177,columnNumber:17},this)]},m.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1168,columnNumber:15},this)}),Ui.map(m=>{const l=m.data||{},I=l.name||l.hotel_name||"Stopover Hotel",$=Number(l.star)||0;return e.jsxDEV(ae,{className:"overflow-hidden",children:[e.jsxDEV("div",{className:"px-4 py-2 bg-gray-50 border-b flex items-center justify-between flex-wrap gap-2",children:[e.jsxDEV("div",{className:"flex items-center gap-2",children:[Qe("stopover"),e.jsxDEV(oe,{className:`${xe(m.status||O.status)} text-xs`,children:(m.status||O.status).toUpperCase()},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1267,columnNumber:85},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1267,columnNumber:19},this),e.jsxDEV("div",{className:"flex items-center gap-2",children:[m.pdf_url&&e.jsxDEV("a",{href:m.pdf_url,target:"_blank",rel:"noreferrer",children:e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",children:[e.jsxDEV(Ie,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1269,columnNumber:163},this)," Voucher"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1269,columnNumber:94},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1269,columnNumber:38},this),g&&e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2 text-blue-600 border-blue-200 hover:bg-blue-50",onClick:()=>he(m),children:[e.jsxDEV(ar,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1270,columnNumber:197},this)," Edit"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1270,columnNumber:41},this),R&&e.jsxDEV(G,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2 text-orange-600 border-orange-200 hover:bg-orange-50",onClick:()=>Se({open:!0,actionType:"amend",scope:m.id}),children:[e.jsxDEV($e,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1271,columnNumber:249},this)," Request Change"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1271,columnNumber:41},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1268,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1266,columnNumber:17},this),e.jsxDEV(ne,{className:"p-4",children:[e.jsxDEV("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[e.jsxDEV(Lr,{className:"h-4 w-4 text-teal-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1275,columnNumber:78},this)," Stopover"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1275,columnNumber:19},this),e.jsxDEV("h4",{className:"text-lg font-bold mb-1",children:I},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1276,columnNumber:19},this),$>0&&e.jsxDEV("div",{className:"text-yellow-500 text-sm mb-2",children:"★".repeat(Math.min($,5))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1277,columnNumber:38},this),e.jsxDEV("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm",children:[l.checkin_date&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Check-in / Check-out"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1281,columnNumber:25},this),e.jsxDEV("div",{className:"font-medium",children:[ge(l.checkin_date)," / ",ge(l.checkout_date)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1282,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1280,columnNumber:23},this),l.night_count&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Nights"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1287,columnNumber:25},this),e.jsxDEV("div",{className:"font-medium",children:l.night_count},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1288,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1286,columnNumber:23},this),l.program_id&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Program"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1293,columnNumber:25},this),e.jsxDEV("div",{className:"font-medium",children:l.program_id},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1294,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1292,columnNumber:23},this),l.street_address&&e.jsxDEV("div",{className:"md:col-span-3",children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Address"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1299,columnNumber:25},this),e.jsxDEV("div",{className:"font-medium",children:l.street_address},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1300,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1298,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1278,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1274,columnNumber:17},this)]},m.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1265,columnNumber:15},this)})]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:446,columnNumber:9},this),e.jsxDEV(ke,{value:"contact",children:e.jsxDEV(Gr,{defaultValue:c?"direct-partner":"booking-agent",children:[e.jsxDEV(Yr,{className:"bg-transparent border-b border-gray-200 rounded-none p-0 h-auto mb-4",children:[c&&e.jsxDEV(Ce,{value:"direct-partner",className:"data-[state=active]:border-b-2 data-[state=active]:border-blue-600 rounded-none px-4 py-2",children:"Direct partner"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1318,columnNumber:17},this),e.jsxDEV(Ce,{value:"booking-agent",className:"data-[state=active]:border-b-2 data-[state=active]:border-blue-600 rounded-none px-4 py-2",children:"Booking agent"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1320,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1315,columnNumber:13},this),c&&e.jsxDEV(ke,{value:"direct-partner",children:e.jsxDEV(pa,{productList:ve,bookingAppId:O.app_id||null,bookingAppName:((vo=O.app)==null?void 0:vo.name)||null,getProductSupplier:ro,getSupplierBySourceId:S},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1333,columnNumber:17},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1332,columnNumber:15},this),e.jsxDEV(ke,{value:"booking-agent",children:e.jsxDEV("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxDEV(ae,{children:e.jsxDEV(ne,{className:"p-4",children:[e.jsxDEV("h3",{className:"font-semibold bg-gray-100 p-2 rounded mb-4",children:[e.jsxDEV(Or,{className:"h-4 w-4 inline mr-2"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1347,columnNumber:78},this),"Agency data"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1347,columnNumber:19},this),e.jsxDEV("table",{className:"text-sm",children:e.jsxDEV("tbody",{children:[e.jsxDEV("tr",{children:[e.jsxDEV("td",{className:"py-2 pr-8 text-gray-500",children:"Name:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1349,columnNumber:25},this),e.jsxDEV("td",{className:"py-2",children:((fo=O.app)==null?void 0:fo.name)||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1349,columnNumber:75},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1349,columnNumber:21},this),e.jsxDEV("tr",{children:[e.jsxDEV("td",{className:"py-2 pr-8 text-gray-500",children:"Channel:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1350,columnNumber:25},this),e.jsxDEV("td",{className:"py-2",children:O.agent_id?"B2B":"B2C"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1350,columnNumber:78},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1350,columnNumber:21},this),e.jsxDEV("tr",{children:[e.jsxDEV("td",{className:"py-2 pr-8 text-gray-500",children:"Offline Payment:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1351,columnNumber:25},this),e.jsxDEV("td",{className:"py-2",children:O.is_offline_payment?"Yes":"No"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1351,columnNumber:86},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1351,columnNumber:21},this),e.jsxDEV("tr",{children:[e.jsxDEV("td",{className:"py-2 pr-8 text-gray-500",children:"Language:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1352,columnNumber:25},this),e.jsxDEV("td",{className:"py-2",children:O.language_code||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1352,columnNumber:79},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1352,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1348,columnNumber:46},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1348,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1346,columnNumber:23},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1346,columnNumber:17},this),e.jsxDEV(ae,{children:e.jsxDEV(ne,{className:"p-4",children:[e.jsxDEV("h3",{className:"font-semibold bg-gray-100 p-2 rounded mb-4",children:[e.jsxDEV(nr,{className:"h-4 w-4 inline mr-2"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1356,columnNumber:78},this),"User data"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1356,columnNumber:19},this),e.jsxDEV("table",{className:"text-sm",children:e.jsxDEV("tbody",{children:[e.jsxDEV("tr",{children:[e.jsxDEV("td",{className:"py-2 pr-8 text-gray-500",children:"Name:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1358,columnNumber:25},this),e.jsxDEV("td",{className:"py-2",children:[q.title||""," ",q.first_name||""," ",q.last_name||""]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1358,columnNumber:75},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1358,columnNumber:21},this),e.jsxDEV("tr",{children:[e.jsxDEV("td",{className:"py-2 pr-8 text-gray-500",children:"E-mail:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1359,columnNumber:25},this),e.jsxDEV("td",{className:"py-2 text-blue-600",children:q.email||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1359,columnNumber:77},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1359,columnNumber:21},this),e.jsxDEV("tr",{children:[e.jsxDEV("td",{className:"py-2 pr-8 text-gray-500",children:"Phone:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1360,columnNumber:25},this),e.jsxDEV("td",{className:"py-2",children:q.phone||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1360,columnNumber:76},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1360,columnNumber:21},this),e.jsxDEV("tr",{children:[e.jsxDEV("td",{className:"py-2 pr-8 text-gray-500",children:"Country:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1361,columnNumber:25},this),e.jsxDEV("td",{className:"py-2",children:q.country||q.country_code||q.city||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1361,columnNumber:78},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1361,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1357,columnNumber:46},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1357,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1355,columnNumber:23},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1355,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1345,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1344,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1314,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1311,columnNumber:9},this),e.jsxDEV(ke,{value:"pricing",children:(()=>{const m=O.price_info||{},l=Sr.reward_points||0,I=({label:$,value:pe,bold:E,green:ue,sub:Ue})=>e.jsxDEV("div",{className:`flex justify-between items-center px-5 py-3 ${Ue?"pl-10 text-gray-500":""}`,children:[e.jsxDEV("span",{className:E?"font-bold":"font-medium text-sm",children:$},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1377,columnNumber:17},this),e.jsxDEV("span",{className:`${E?"font-bold text-base":"text-sm"} ${ue?"text-green-700":""}`,children:pe},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1378,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1376,columnNumber:15},this);return e.jsxDEV("div",{className:"space-y-4",children:[qr.length>0&&qr.map(($,pe)=>{var ye,Re,Oe,re,qe,je,Fe;const E=ve.find(M=>M.id===$.object_id),ue=E?Ae(E):"product",Ue=((ye=E==null?void 0:E.data)==null?void 0:ye.name)||`Product ${pe+1}`,Ee=(Re=E==null?void 0:E.data)!=null&&Re.star?Number(E.data.star):0,Me=((Oe=E==null?void 0:E.data)==null?void 0:Oe.room_count)||((qe=(re=E==null?void 0:E.data)==null?void 0:re.rooms)==null?void 0:qe.length)||0,Ye=((je=E==null?void 0:E.data)==null?void 0:je.night_count)||0,Be=((Fe=E==null?void 0:E.data)==null?void 0:Fe.pax_count)||0,we=[Me?`${Me} room(s)`:"",Be?`${Be} traveler(s)`:"",Ye?`${Ye} night(s)`:"",Ee?`${Ee} stars`:""].filter(Boolean).join(" | "),Te=($.markup_amount||0)-($.tax_amount||0)-($.vat_amount||0)-($.discount_amount||0);return e.jsxDEV(ae,{className:"overflow-hidden",children:[e.jsxDEV("div",{className:`px-5 py-2.5 flex items-center gap-2 border-b ${ue==="hotel"?"bg-blue-50":ue==="flight"?"bg-orange-50":ue==="transfer"?"bg-green-50":ue==="tour"?"bg-purple-50":"bg-gray-50"}`,children:[Qe(ue),e.jsxDEV("div",{children:[e.jsxDEV("span",{className:"font-semibold text-sm",children:Ue},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1401,columnNumber:27},this),we&&e.jsxDEV("span",{className:"text-xs text-gray-400 ml-2",children:we},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1402,columnNumber:39},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1400,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1398,columnNumber:23},this),e.jsxDEV(ne,{className:"p-0 divide-y",children:[e.jsxDEV(I,{label:"Base Amount",value:de($.base_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1406,columnNumber:25},this),e.jsxDEV(I,{label:"Markup",value:de($.markup_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1407,columnNumber:25},this),Number($.tax_amount)>0&&e.jsxDEV(I,{label:"Tax",value:de($.tax_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1408,columnNumber:58},this),Number($.vat_amount)>0&&e.jsxDEV(I,{label:"VAT",value:de($.vat_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1409,columnNumber:58},this),Number($.discount_amount)>0&&e.jsxDEV(I,{label:"Discount",value:`-${de($.discount_amount)}`},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1410,columnNumber:63},this),Number($.reward_points)>0&&e.jsxDEV("div",{className:"flex justify-between items-center px-5 py-3",children:[e.jsxDEV("span",{className:"font-medium text-sm",children:"Reward Points"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1413,columnNumber:29},this),e.jsxDEV("span",{className:"text-sm font-medium",children:[$.reward_points," ",e.jsxDEV("span",{className:"text-xs text-gray-400",children:"pts"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1414,columnNumber:89},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1414,columnNumber:29},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1412,columnNumber:27},this),e.jsxDEV("div",{className:"flex justify-between items-center px-5 py-3 bg-gray-50",children:[e.jsxDEV("span",{className:"font-bold text-sm",children:[vr(ue)," Total"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1418,columnNumber:27},this),e.jsxDEV("span",{className:"font-bold text-green-700",children:de($.total_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1419,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1417,columnNumber:25},this),u&&e.jsxDEV("div",{className:"flex justify-between items-center px-5 py-2 bg-blue-50 text-xs",children:[e.jsxDEV("span",{className:"text-blue-600",children:"Profit (Markup - Tax - VAT - Discount)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1423,columnNumber:29},this),e.jsxDEV("span",{className:"font-semibold text-blue-700",children:de(Te)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1424,columnNumber:29},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1422,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1405,columnNumber:23},this)]},pe,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1397,columnNumber:21},this)}),e.jsxDEV(ae,{className:"overflow-hidden border-2",children:[e.jsxDEV("div",{className:"px-5 py-2.5 bg-gray-100 border-b",children:e.jsxDEV("span",{className:"font-bold",children:"Booking Summary"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1435,columnNumber:21},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1434,columnNumber:19},this),e.jsxDEV(ne,{className:"p-0 divide-y",children:[e.jsxDEV(I,{label:"Base Amount",value:de(m.base_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1438,columnNumber:21},this),e.jsxDEV(I,{label:"Markup",value:de(m.markup_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1439,columnNumber:21},this),e.jsxDEV(I,{label:"Tax",value:de(m.tax_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1440,columnNumber:21},this),e.jsxDEV(I,{label:"VAT",value:de(m.vat_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1441,columnNumber:21},this),e.jsxDEV(I,{label:"Discount",value:de(m.discount_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1442,columnNumber:21},this),l>0&&e.jsxDEV("div",{className:"flex justify-between items-center px-5 py-3",children:[e.jsxDEV("span",{className:"font-medium text-sm",children:"Reward Points"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1445,columnNumber:25},this),e.jsxDEV("span",{className:"text-sm font-medium",children:[l.toLocaleString()," ",e.jsxDEV("span",{className:"text-xs text-gray-400",children:"pts"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1446,columnNumber:102},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1446,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1444,columnNumber:23},this),qr.filter($=>$.reward_points>0).map(($,pe)=>{var Te,ye,Re,Oe,re,qe,je;const E=ve.find(Fe=>Fe.id===$.object_id),ue=E?Ae(E):"product",Ue=((Te=E==null?void 0:E.data)==null?void 0:Te.name)||`Product ${pe+1}`,Ee=(ye=E==null?void 0:E.data)!=null&&ye.star?Number(E.data.star):0,Me=((Re=E==null?void 0:E.data)==null?void 0:Re.room_count)||((re=(Oe=E==null?void 0:E.data)==null?void 0:Oe.rooms)==null?void 0:re.length)||0,Ye=((qe=E==null?void 0:E.data)==null?void 0:qe.night_count)||0,Be=((je=E==null?void 0:E.data)==null?void 0:je.pax_count)||0,we=[Me?`${Me} room(s)`:"",Be?`${Be} traveler(s)`:"",Ye?`${Ye} night(s)`:"",Ee?`${Ee} stars`:""].filter(Boolean).join(" | ");return e.jsxDEV("div",{className:"flex justify-between items-center px-5 py-3 bg-gray-50",children:[e.jsxDEV("div",{className:"flex items-center gap-2.5",children:[e.jsxDEV("div",{className:"h-7 w-7 bg-white rounded border flex items-center justify-center",children:Qe(ue)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1462,columnNumber:29},this),e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"text-xs font-medium",children:Ue},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1464,columnNumber:31},this),we&&e.jsxDEV("div",{className:"text-[10px] text-gray-400",children:we},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1465,columnNumber:43},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1463,columnNumber:29},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1461,columnNumber:27},this),e.jsxDEV("span",{className:"text-sm font-medium",children:[$.reward_points," ",e.jsxDEV("span",{className:"text-xs text-gray-400",children:"pts"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1468,columnNumber:87},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1468,columnNumber:27},this)]},pe,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1460,columnNumber:25},this)}),Number(m.wowpay_fee_amount)>0&&e.jsxDEV(I,{label:"Payment Processing Fees",value:de(m.wowpay_fee_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1473,columnNumber:23},this),e.jsxDEV("div",{className:"flex justify-between items-center px-5 py-4 bg-gray-100",children:[e.jsxDEV("span",{className:"text-base font-bold",children:"Total Amount"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1476,columnNumber:23},this),e.jsxDEV("span",{className:"text-lg font-bold text-green-700",children:de(m.total_amount||O.total_amount)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1477,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1475,columnNumber:21},this),u&&e.jsxDEV("div",{className:"flex justify-between items-center px-5 py-3 bg-blue-50",children:[e.jsxDEV("span",{className:"text-sm text-blue-700 font-medium",children:"Total Profit"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1481,columnNumber:25},this),e.jsxDEV("span",{className:"text-sm font-bold text-blue-700",children:de((m.markup_amount||0)-(m.tax_amount||0)-(m.vat_amount||0)-(m.discount_amount||0))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1482,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1480,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1437,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1433,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1383,columnNumber:15},this)})()},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1370,columnNumber:9},this),e.jsxDEV(ke,{value:"invoices",children:e.jsxDEV(ae,{children:e.jsxDEV(ne,{className:"p-4",children:[e.jsxDEV("h3",{className:"font-semibold mb-4",children:[e.jsxDEV(Ie,{className:"h-4 w-4 inline mr-2"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1497,columnNumber:48},this),"Invoices & Documents"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1497,columnNumber:13},this),fe!=null&&fe.pdf_url?e.jsxDEV("div",{className:"space-y-4",children:[e.jsxDEV("div",{className:"border rounded-lg p-4 flex items-center justify-between bg-gray-50",children:[e.jsxDEV("div",{className:"flex items-center gap-3",children:[e.jsxDEV("div",{className:"h-10 w-10 bg-blue-100 rounded-lg flex items-center justify-center",children:e.jsxDEV(Ie,{className:"h-5 w-5 text-blue-600"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1505,columnNumber:23},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1504,columnNumber:21},this),e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"font-medium text-sm",children:"Payment Invoice / Receipt"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1508,columnNumber:23},this),e.jsxDEV("div",{className:"text-xs text-gray-500",children:[O.code," · ",de(O.total_amount)," · ",((Eo=O.payment)==null?void 0:Eo.method)||"-"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1509,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1507,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1503,columnNumber:19},this),e.jsxDEV("a",{href:fe.pdf_url,target:"_blank",rel:"noreferrer",children:e.jsxDEV(G,{size:"sm",variant:"outline",className:"text-xs",children:[e.jsxDEV(Wr,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1516,columnNumber:23},this)," Download PDF"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1515,columnNumber:21},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1514,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1502,columnNumber:17},this),(Q==null?void 0:Q.tax_invoice_number)&&e.jsxDEV("div",{className:"text-sm",children:[e.jsxDEV("span",{className:"text-gray-500",children:"Tax Invoice #:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1524,columnNumber:21},this)," ",e.jsxDEV("span",{className:"font-mono font-medium",children:Q.tax_invoice_number},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1525,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1523,columnNumber:19},this),e.jsxDEV("h4",{className:"font-medium text-sm mt-4 pt-3 border-t",children:"Product Vouchers"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1530,columnNumber:17},this),ve.filter(m=>m.pdf_url).map(m=>e.jsxDEV("div",{className:"border rounded-lg p-3 flex items-center justify-between",children:[e.jsxDEV("div",{className:"flex items-center gap-3",children:[e.jsxDEV("div",{className:"h-8 w-8 bg-orange-100 rounded-lg flex items-center justify-center",children:Qe(Ae(m))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1534,columnNumber:23},this),e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"text-sm font-medium",children:[vr(Ae(m))," Voucher"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1538,columnNumber:25},this),e.jsxDEV("div",{className:"text-xs text-gray-500",children:Ps(m)||m.product_ref},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1539,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1537,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1533,columnNumber:21},this),e.jsxDEV("a",{href:m.pdf_url,target:"_blank",rel:"noreferrer",children:e.jsxDEV(G,{size:"sm",variant:"outline",className:"text-xs",children:[e.jsxDEV(Wr,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1544,columnNumber:25},this)," Download PDF"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1543,columnNumber:23},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1542,columnNumber:21},this)]},m.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1532,columnNumber:19},this))]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1501,columnNumber:15},this):e.jsxDEV("div",{className:"text-center py-8 text-gray-400",children:[e.jsxDEV(Ie,{className:"h-12 w-12 mx-auto mb-3 text-gray-300"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1552,columnNumber:17},this),e.jsxDEV("p",{children:"No invoices available for this booking."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1553,columnNumber:17},this),ve.some(m=>m.pdf_url)&&e.jsxDEV("div",{className:"mt-4 space-y-2",children:[e.jsxDEV("p",{className:"text-sm font-medium text-gray-600",children:"Product Vouchers Available:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1556,columnNumber:21},this),ve.filter(m=>m.pdf_url).map(m=>e.jsxDEV("a",{href:m.pdf_url,target:"_blank",rel:"noreferrer",children:e.jsxDEV(G,{size:"sm",variant:"outline",className:"text-xs mx-1",children:[vr(Ae(m))," Voucher PDF"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1559,columnNumber:25},this)},m.id,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1558,columnNumber:23},this))]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1555,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1551,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1496,columnNumber:17},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1496,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1495,columnNumber:9},this),g&&e.jsxDEV(ke,{value:"emails",children:r&&e.jsxDEV(Ks,{bookingCodeFilter:r,hideStats:!0,participant:f,onParticipantChange:D},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1583,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1578,columnNumber:11},this),g&&e.jsxDEV(ke,{value:"history",children:r&&e.jsxDEV(Wt,{bookingCode:r,bookingId:d},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1596,columnNumber:22},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1595,columnNumber:11},this),e.jsxDEV(ke,{value:"support",children:e.jsxDEV(Nt,{bookingCode:r||"",bookingData:{products:ve.reduce((m,l,I)=>{const $=Ae(l);return m[`${$}_${I}`]={...l.data||{},_product_type:$,_product_id:l.id,_product_ref:l.product_ref},m},{}),contact:q,payment:O.payment||{},travelers:Ze},booking:{id:d,booking_code:r,status:O.status,created_at:O.created_at,booking_contacts:[{first_name:q.first_name,last_name:q.last_name,email:q.email,phone:q.phone,contact_type:"primary"}],booking_products:ve.map(m=>({product_type:Ae(m)})),raw_data:null}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1602,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1601,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:419,columnNumber:7},this),z.open&&e.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:e.jsxDEV("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-lg p-6",children:[e.jsxDEV("h3",{className:"text-lg font-semibold mb-4",children:z.type==="supplier"?"Email Supplier":"Email Customer"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1632,columnNumber:13},this),e.jsxDEV("div",{className:"space-y-3",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium text-gray-700",children:"To:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1637,columnNumber:17},this),e.jsxDEV(ce,{value:z.to,onChange:m=>K(l=>({...l,to:m.target.value})),placeholder:"recipient@email.com"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1638,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1636,columnNumber:15},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium text-gray-700",children:"Subject:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1645,columnNumber:17},this),e.jsxDEV(ce,{value:z.subject,onChange:m=>K(l=>({...l,subject:m.target.value}))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1646,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1644,columnNumber:15},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium text-gray-700",children:"Message:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1652,columnNumber:17},this),e.jsxDEV(Ke,{rows:6,value:z.body,onChange:m=>K(l=>({...l,body:m.target.value})),placeholder:"Type your message..."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1653,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1651,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1635,columnNumber:13},this),e.jsxDEV("div",{className:"flex justify-end gap-2 mt-4",children:[e.jsxDEV(G,{variant:"outline",onClick:()=>K({open:!1,type:"supplier",to:"",subject:"",body:""}),children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1662,columnNumber:15},this),e.jsxDEV(G,{onClick:()=>Ge.mutate({to:z.to,subject:z.subject,body:z.body}),disabled:!z.to||!z.subject||Ge.isPending,children:[e.jsxDEV(io,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1669,columnNumber:17},this)," ",Ge.isPending?"Sending...":"Send"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1665,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1661,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1631,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1630,columnNumber:9},this),d&&O.code&&e.jsxDEV(sa,{open:v,onOpenChange:_,bookingId:d,bookingCode:O.code,defaultCustomerEmail:(q==null?void 0:q.email)||((Oo=O.contact)==null?void 0:Oo.email)||null,onSent:()=>{n.invalidateQueries({queryKey:["emails"]})}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1678,columnNumber:9},this),d&&O.code&&e.jsxDEV(Hs,{open:w,onOpenChange:k,bookingId:d,bookingCode:O.code,customerEmail:(q==null?void 0:q.email)||((Po=O.contact)==null?void 0:Po.email)||null,customerName:[q==null?void 0:q.first_name,q==null?void 0:q.last_name].filter(Boolean).join(" ").trim()||[(Co=O.contact)==null?void 0:Co.first_name,(ko=O.contact)==null?void 0:ko.last_name].filter(Boolean).join(" ").trim()||null,onSent:()=>{n.invalidateQueries({queryKey:["emails"]})}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1692,columnNumber:9},this),d&&O.code&&e.jsxDEV(Qs,{open:F,onOpenChange:B,bookingId:d,bookingCode:O.code,customerEmail:(q==null?void 0:q.email)||((_o=O.contact)==null?void 0:_o.email)||null,customerName:[q==null?void 0:q.first_name,q==null?void 0:q.last_name].filter(Boolean).join(" ").trim()||[(Ao=O.contact)==null?void 0:Ao.first_name,(Uo=O.contact)==null?void 0:Uo.last_name].filter(Boolean).join(" ").trim()||null,onSent:()=>{n.invalidateQueries({queryKey:["emails"]})}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1714,columnNumber:9},this),O.code&&g&&e.jsxDEV(ba,{booking:O,isOpen:be,onClose:()=>te(!1),onReviewComplete:()=>{n.invalidateQueries({queryKey:["booking-reviews",O.code]})}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1736,columnNumber:9},this),O.code&&e.jsxDEV(ua,{open:le,onOpenChange:W,bookingCode:O.code,bookingId:d,onSaved:()=>{n.invalidateQueries({queryKey:["easygds","booking",d]}),n.invalidateQueries({queryKey:["easygds","booking-products",d]}),n.invalidateQueries({queryKey:["easygds","booking-pnrs",d]}),n.invalidateQueries({queryKey:["easygds","bookings"]})}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1755,columnNumber:9},this),e.jsxDEV(Ot,{isOpen:L,onClose:()=>Ne(!1),bookingId:d||"",bookingCode:O.code,contactData:q,travelerList:Ze,onSaved:()=>{n.invalidateQueries({queryKey:["easygds","booking",r]}),n.invalidateQueries({queryKey:["easygds","booking-contact",d]}),n.invalidateQueries({queryKey:["easygds","booking-travelers",d]}),Ne(!1)}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1770,columnNumber:7},this),U&&e.jsxDEV(qt,{isOpen:!!U,onClose:()=>he(null),bookingId:d||"",bookingCode:O.code,product:U,prices:po,isAdmin:u,onRequestPriceChange:R?m=>{Se({open:!0,actionType:"amend",scope:m})}:void 0},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1791,columnNumber:9},this),e.jsxDEV(xi,{isOpen:T.open,onClose:()=>Se({open:!1}),bookingCode:r,initialActionType:T.actionType,initialScope:T.scope,bookingData:{company_name:q!=null&&q.first_name?`${q.first_name} ${q.last_name||""}`:"",supplier_name:"",currency:O.currency_code,passengers:Ze.map(m=>{const l=m.data||m;return{title:l.title||"",first_name:l.first_name||"",last_name:l.last_name||"",type:l.type||"adult",date_of_birth:l.birthday||"",country_code:l.country_code||l.nationality||"",document_id:l.document_id||l.passport_number||"",document_expiry:l.document_expiry||""}}),products:ve.map(m=>vi(m)).filter(m=>m!=null),contact:q}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1810,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:371,columnNumber:5},this)}function pa({productList:r,bookingAppId:o,bookingAppName:s,getProductSupplier:a,getSupplierBySourceId:t}){var S;const i={},u=[];for(const h of r){const C=a(h);if(!C)continue;const x=h.data||h,N=String((x==null?void 0:x.supplier_phone)||((S=x==null?void 0:x.supplier_info)==null?void 0:S.phone)||(x==null?void 0:x.hotel_phone)||(x==null?void 0:x.phone)||"").trim();i[C]?N&&!i[C].productPhones.includes(N)&&i[C].productPhones.push(N):(i[C]={code:C,productPhones:N?[N]:[]},u.push(C))}const c=u.map(h=>i[h]),g=c.map(h=>{var C;return(C=t(h.code))==null?void 0:C.supplier_id}).filter(h=>!!h),n=Array.from(new Set(g)),p=Ve({queryKey:["contract-lookup",o,n.slice().sort().join(",")],queryFn:()=>Us(o,n),enabled:!!o&&n.length>0,staleTime:5*60*1e3}).data||{};return c.length===0?e.jsxDEV(ae,{children:e.jsxDEV(ne,{className:"p-6 text-center text-sm text-muted-foreground",children:"No supplier identifiers on the products in this booking."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1919,columnNumber:13},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1919,columnNumber:7},this):e.jsxDEV("div",{className:"space-y-3",children:c.map((h,C)=>{const x=t(h.code),N=(x==null?void 0:x.supplier_name)||h.code,f=(x==null?void 0:x.supplier_email)||"",D=(x==null?void 0:x.supplier_phone)||"",V=x==null?void 0:x.is_linked_variant,z=x==null?void 0:x.supplier_id,K=z?p[z]:void 0,v=!!K;return e.jsxDEV(ae,{children:e.jsxDEV(ne,{className:"p-4",children:[e.jsxDEV("h3",{className:"font-semibold bg-gray-100 p-2 rounded mb-4 flex items-center gap-2 flex-wrap",children:[e.jsxDEV(Or,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1940,columnNumber:17},this),e.jsxDEV("span",{children:["Supplier #",C+1,": ",N]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1941,columnNumber:17},this),v?e.jsxDEV(oe,{variant:"outline",className:"text-[10px] bg-blue-50 text-blue-700 border-blue-200",children:["Client contract",s?` — App: ${s}`:"",K!=null&&K.contract_label?` · ${K.contract_label}`:""]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1947,columnNumber:19},this):e.jsxDEV(oe,{variant:"outline",className:"text-[10px] bg-emerald-50 text-emerald-700 border-emerald-200",children:"Our contract"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1952,columnNumber:19},this),V&&e.jsxDEV(oe,{variant:"outline",className:"text-[10px] bg-blue-50 text-blue-700 border-blue-200",children:"linked variant"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1957,columnNumber:19},this),!x&&e.jsxDEV(oe,{variant:"outline",className:"text-[10px] bg-amber-50 text-amber-700 border-amber-200",children:"not in supplier setup"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1962,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1939,columnNumber:15},this),e.jsxDEV("table",{className:"text-sm w-full",children:e.jsxDEV("tbody",{children:[e.jsxDEV("tr",{children:[e.jsxDEV("td",{className:"py-2 pr-8 text-gray-500 font-medium align-top w-32",children:"Code:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1970,columnNumber:21},this),e.jsxDEV("td",{className:"py-2 font-mono",children:h.code},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1971,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1969,columnNumber:19},this),e.jsxDEV("tr",{children:[e.jsxDEV("td",{className:"py-2 pr-8 text-gray-500 font-medium align-top",children:"Name:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1974,columnNumber:21},this),e.jsxDEV("td",{className:"py-2 text-blue-600",children:N},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1975,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1973,columnNumber:19},this),e.jsxDEV("tr",{children:[e.jsxDEV("td",{className:"py-2 pr-8 text-gray-500 font-medium align-top",children:"E-mail:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1978,columnNumber:21},this),e.jsxDEV("td",{className:"py-2",children:f?e.jsxDEV("a",{href:`mailto:${f}`,className:"text-blue-600 hover:underline",children:f},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1981,columnNumber:25},this):e.jsxDEV("span",{className:"text-gray-400",children:"— (set in Settings → Suppliers)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1983,columnNumber:25},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1979,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1977,columnNumber:19},this),e.jsxDEV("tr",{children:[e.jsxDEV("td",{className:"py-2 pr-8 text-gray-500 font-medium align-top",children:"Phone:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1988,columnNumber:21},this),e.jsxDEV("td",{className:"py-2",children:[D?e.jsxDEV("span",{children:D},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1991,columnNumber:25},this):e.jsxDEV("span",{className:"text-gray-400",children:"— (set in Settings → Suppliers)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1993,columnNumber:25},this),h.productPhones.filter(_=>_&&_!==D).map(_=>e.jsxDEV("div",{className:"text-xs text-gray-500 mt-1",children:["Booking-specific: ",_]},_,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1998,columnNumber:27},this))]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1989,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1987,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1968,columnNumber:17},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1967,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1938,columnNumber:13},this)},h.code,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1937,columnNumber:11},this)})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/BookingDetailsPage.tsx",lineNumber:1926,columnNumber:5},this)}export{qa as default};
