your-ai-workflow-firebase-os 2.0.8 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/{Assets-Dd_96avv.js → Assets-COH4Ji57.js} +5 -5
  2. package/dist/{Assets-CBBNIHrw.cjs → Assets-D7fDckSi.cjs} +1 -1
  3. package/dist/{Attachments-C6QrTcNt.cjs → Attachments-BMuQ0CD4.cjs} +1 -1
  4. package/dist/{Attachments-YyjQmhBx.js → Attachments-Co1UkdWB.js} +2 -2
  5. package/dist/{Billing-B6f49cGH.cjs → Billing-DkuJdls5.cjs} +1 -1
  6. package/dist/{Billing-BZafAizg.js → Billing-kk4ZMd3z.js} +4 -4
  7. package/dist/{BookingCalendar-DYsA71vl.cjs → BookingCalendar-BcvJiyaq.cjs} +1 -1
  8. package/dist/{BookingCalendar-_xoRa2tL.js → BookingCalendar-Bej__mIs.js} +1 -1
  9. package/dist/{Button-DSldWACF.js → Button-BGN6q7lY.js} +1 -1
  10. package/dist/{Button-PyTaaoyu.cjs → Button-Ccy4wFZ1.cjs} +1 -1
  11. package/dist/{ConfirmModal-CQ73WYUg.cjs → ConfirmModal-BUNtss4a.cjs} +1 -1
  12. package/dist/{ConfirmModal-C1dM-bzk.js → ConfirmModal-BW9e6Y7d.js} +3 -3
  13. package/dist/{ContactPopup-D5Hh0bfE.cjs → ContactPopup-D8aSSlmS.cjs} +1 -1
  14. package/dist/{ContactPopup-CL4AMwK9.js → ContactPopup-Fs7wzrOX.js} +7 -7
  15. package/dist/{CopyLink-BnYpVy6H.cjs → CopyLink-C5lKLyOU.cjs} +1 -1
  16. package/dist/{CopyLink-rLr_5eNM.js → CopyLink-CNjDLzOl.js} +2 -2
  17. package/dist/{DashboardNav-B0G943ux.js → DashboardNav-CEd8gGPm.js} +3 -3
  18. package/dist/{DashboardNav-DOl9gJuu.cjs → DashboardNav-GgEUpyTa.cjs} +1 -1
  19. package/dist/{EmailAdmin-CWHMMybh.cjs → EmailAdmin-d_gWd48U.cjs} +1 -1
  20. package/dist/{EmailAdmin-humrSTzI.js → EmailAdmin-pbQ-f9Ge.js} +9 -9
  21. package/dist/{EventCard-CrPswwyG.js → EventCard-BSGLYD64.js} +2 -2
  22. package/dist/{EventCard-6eCfvOA-.cjs → EventCard-DAsGsicK.cjs} +1 -1
  23. package/dist/{FileViewerPopup-DQmhXMSg.cjs → FileViewerPopup-CkLUYCNo.cjs} +1 -1
  24. package/dist/{FileViewerPopup-Dnl3td2o.js → FileViewerPopup-gqhRT22v.js} +2 -2
  25. package/dist/{FormNote-BWGLs9lx.js → FormNote-DJ9HBokL.js} +1 -1
  26. package/dist/{FormNote-CX2rSBDB.cjs → FormNote-DP0GK9ya.cjs} +1 -1
  27. package/dist/{FormsAdmin-Tg20B0iA.cjs → FormsAdmin-5KTTp6zo.cjs} +1 -1
  28. package/dist/{FormsAdmin-CHwmKnYU.js → FormsAdmin-BNI63vEk.js} +9 -9
  29. package/dist/{Inbox-Cgq4MALU.js → Inbox-D9Y5K8Se.js} +9 -9
  30. package/dist/{Inbox-BPwIiThg.cjs → Inbox-DjslBakx.cjs} +1 -1
  31. package/dist/{Loader-DP_dL5qC.js → Loader-CVoz1Zf0.js} +1 -1
  32. package/dist/{Loader-p3eNQDUU.cjs → Loader-QHqQsXLr.cjs} +1 -1
  33. package/dist/{ManagePlanButton-BRW7Sevd.cjs → ManagePlanButton-Buwfs2bU.cjs} +1 -1
  34. package/dist/{ManagePlanButton-CNLCxK-o.js → ManagePlanButton-CE4uyh_7.js} +2 -2
  35. package/dist/{MyBookings-C_pqsSEk.js → MyBookings-B4DndHV6.js} +7 -7
  36. package/dist/{MyBookings-BC5sn_fE.cjs → MyBookings-CkEioQIj.cjs} +1 -1
  37. package/dist/{PageTitle-DFGW71q8.js → PageTitle-DCoUQWw6.js} +2 -2
  38. package/dist/{PageTitle-BWmE74WQ.cjs → PageTitle-DQkvCB11.cjs} +1 -1
  39. package/dist/PagesAdmin-D0qgoZtW.js +3 -0
  40. package/dist/{PagesAdmin-jjnDLYmF.js → PagesAdmin-DzLJWKBJ.js} +21 -21
  41. package/dist/PagesAdmin-KUxCI1Mr.cjs +1 -0
  42. package/dist/{PagesAdmin-BZZ3by92.cjs → PagesAdmin-YdYgmuEB.cjs} +1 -1
  43. package/dist/{PaymentsAdmin-CI0zXraR.cjs → PaymentsAdmin-B5l-f0mp.cjs} +1 -1
  44. package/dist/{PaymentsAdmin-DeBMmFFo.js → PaymentsAdmin-C3cEOeIs.js} +15 -15
  45. package/dist/{Popup-DmPEk98h.js → Popup-Bi63lzoS.js} +1 -1
  46. package/dist/{Popup-nq7YNM4N.cjs → Popup-COnHpbrY.cjs} +1 -1
  47. package/dist/{ProviderMark-DJ5mYjYn.cjs → ProviderMark--adeeajP.cjs} +1 -1
  48. package/dist/{ProviderMark-CAeOnBsB.js → ProviderMark-BvEMlZAm.js} +1 -1
  49. package/dist/{PublishApp-mMMwf_in.js → PublishApp-B9Fo6xN0.js} +7 -7
  50. package/dist/{PublishApp-DI96gX9b.cjs → PublishApp-Bc82Ijkq.cjs} +1 -1
  51. package/dist/{Said-DAD7Ctp_.js → Said-BvSRaEfZ.js} +1 -1
  52. package/dist/{Said-DlJOjNMN.cjs → Said-W3KFi5uX.cjs} +1 -1
  53. package/dist/{ScheduleAdmin-dWj_N_tf.cjs → ScheduleAdmin-Dh_hW6p4.cjs} +1 -1
  54. package/dist/{ScheduleAdmin-C4W8Ls0D.js → ScheduleAdmin-bk3GgxKP.js} +14 -14
  55. package/dist/{SchedulePicker-CwKId9JF.cjs → SchedulePicker-CN0755Ek.cjs} +1 -1
  56. package/dist/{SchedulePicker-BOSJEcfL.js → SchedulePicker-DO4PewPJ.js} +2 -2
  57. package/dist/{Setup-DcZzh6Xd.cjs → Setup-R4r6_tbV.cjs} +1 -1
  58. package/dist/{Setup-NOvtplUS.js → Setup-_G-s5y5Q.js} +3 -3
  59. package/dist/{SetupPayments-DrXK0LQa.js → SetupPayments-CkolcOtv.js} +5 -5
  60. package/dist/{SetupPayments-CZ0KqXdR.cjs → SetupPayments-CuFk9REC.cjs} +1 -1
  61. package/dist/{SignInAdmin-CwIUAJrv.cjs → SignInAdmin-B1yLLaQu.cjs} +1 -1
  62. package/dist/{SignInAdmin-Cb65ChHL.js → SignInAdmin-BLEn0rId.js} +9 -9
  63. package/dist/{SupportBar-528kXe-Z.js → SupportBar-DI_XbEsG.js} +4 -4
  64. package/dist/{SupportBar-CNVXSYwT.cjs → SupportBar-DLWruzQb.cjs} +1 -1
  65. package/dist/{SystemTabContent-EegzTuLd.cjs → SystemTabContent-BWhRHoXx.cjs} +1 -1
  66. package/dist/{SystemTabContent-C4azXKMs.js → SystemTabContent-CMyT7mDN.js} +2 -2
  67. package/dist/{TemplateDrive-XDRPkxIj.cjs → TemplateDrive-BJN-ReA_.cjs} +1 -1
  68. package/dist/{TemplateDrive-CfPXKMKX.js → TemplateDrive-DNBwL0oy.js} +10 -10
  69. package/dist/{ThemeAdmin-XLbC9fX7.js → ThemeAdmin-Cnqefrz6.js} +6 -6
  70. package/dist/ThemeAdmin-CoE_c5-P.cjs +1 -0
  71. package/dist/ThemeAdmin-DI7QaZ-0.js +2 -0
  72. package/dist/{ThemeAdmin-BrEozdpZ.cjs → ThemeAdmin-DkgmjW3g.cjs} +1 -1
  73. package/dist/TimeZoneField-Ckn1pKAL.cjs +11 -0
  74. package/dist/{TimeZoneField-Dv389mAe.js → TimeZoneField-oIMwb5_X.js} +119 -107
  75. package/dist/{TransactionsAdmin-X-NjI4NB.js → TransactionsAdmin-Brs-CEcG.js} +11 -11
  76. package/dist/{TransactionsAdmin-DgsG629u.cjs → TransactionsAdmin-C5wQRR1g.cjs} +1 -1
  77. package/dist/{Trouble-qjWYeKzC.js → Trouble-CtFq7tjk.js} +1 -1
  78. package/dist/{Trouble-DokPNHQZ.cjs → Trouble-KQZyf6aY.cjs} +1 -1
  79. package/dist/{Users-BEjl_Vjc.cjs → Users-B16L9cKI.cjs} +1 -1
  80. package/dist/{Users-BUGb7-Kz.js → Users-CbI4K_Le.js} +15 -15
  81. package/dist/{VideoPlayer-BVOkrJBR.cjs → VideoPlayer-CggwpVXH.cjs} +1 -1
  82. package/dist/{VideoPlayer-DB0oz6lM.js → VideoPlayer-QI1Jc3bS.js} +1 -1
  83. package/dist/appIcons-C90OKlV5.cjs +130 -0
  84. package/dist/{appIcons-CUXAX_gJ.js → appIcons-CCArfCDe.js} +761 -735
  85. package/dist/{arrivalRoads-BZk39p8Z.js → arrivalRoads-CGXm9Ntm.js} +0 -0
  86. package/dist/{arrivalRoads-CD7pt03E.cjs → arrivalRoads-Cc6AZM-d.cjs} +0 -0
  87. package/dist/{bookingPages-BxqkyZ-M.js → bookingPages-BFSY3Riv.js} +1 -1
  88. package/dist/{bookingPages-2fn9xPiA.cjs → bookingPages-Dx1ViiwW.cjs} +1 -1
  89. package/dist/{contentFallback-C6xLwXTs.js → contentFallback-BGGpI1Ts.js} +2 -2
  90. package/dist/{contentFallback-DLm_iHo9.cjs → contentFallback-DVCrIUvK.cjs} +1 -1
  91. package/dist/{email-DxxovRtf.js → email-PBHbXXgR.js} +1 -1
  92. package/dist/{email-DD48BP42.cjs → email-Sya6gl4F.cjs} +1 -1
  93. package/dist/lib/basket.d.ts +29 -9
  94. package/dist/lib/recordPrice.d.ts +1 -1
  95. package/dist/{notices-Cwon5Q0Y.cjs → notices-CKm9-Pqt.cjs} +1 -1
  96. package/dist/{notices-C4yqYzBw.js → notices-CysS7BLF.js} +1 -1
  97. package/dist/{ownerMail-CGmDk7aP.cjs → ownerMail-BS9SjJ2u.cjs} +1 -1
  98. package/dist/{ownerMail-Chzy5Ehy.js → ownerMail-DepG5-Qw.js} +2 -2
  99. package/dist/{pageFiles-BClshvXs.cjs → pageFiles-Cn0YQ4Ur.cjs} +1 -1
  100. package/dist/{pageFiles-D-GYqRgZ.js → pageFiles-ZFPSCDZz.js} +1 -1
  101. package/dist/{paidInFull-KuStok9_.cjs → paidInFull-CZywIs-V.cjs} +1 -1
  102. package/dist/{paidInFull-D14Eh0QV.js → paidInFull-mBOh9iwN.js} +1 -1
  103. package/dist/{paidSessions-Cr_93LGa.js → paidSessions-B8e5RHi4.js} +7 -7
  104. package/dist/{paidSessions-QXv7SHeb.cjs → paidSessions-D-zHC4oG.cjs} +1 -1
  105. package/dist/{people-D8nPPMlM.cjs → people-BwWVVLfy.cjs} +1 -1
  106. package/dist/{people-sk2DcHPi.js → people-Wk2opW4G.js} +1 -1
  107. package/dist/{publishSteps-DB1Hxr6H.js → publishSteps-Cf5pSB_H.js} +1 -1
  108. package/dist/{publishSteps-CaZRpC3C.cjs → publishSteps-DvWlF0p_.cjs} +1 -1
  109. package/dist/{recordLock-Dnz61J-_.js → recordLock-CMOiezNC.js} +1 -1
  110. package/dist/{recordLock-CLUp3QNh.cjs → recordLock-CiulizO1.cjs} +1 -1
  111. package/dist/{recordsKey-R5BjLoGQ.cjs → recordsKey-C4E2vOti.cjs} +1 -1
  112. package/dist/{recordsKey-DHJJWWOo.js → recordsKey-Cd216nq1.js} +2 -2
  113. package/dist/{registrationFields-COv8jW4n.cjs → registrationFields-DHHTptcl.cjs} +1 -1
  114. package/dist/{registrationFields-CeTZSerx.js → registrationFields-DdHoMPAQ.js} +1 -1
  115. package/dist/renderer.cjs.js +1 -1
  116. package/dist/renderer.es.js +1 -1
  117. package/dist/{roles-5juCr5sY.cjs → roles-BBDIJzox.cjs} +1 -1
  118. package/dist/{roles-hzcMnn_M.js → roles-DiwP6-WQ.js} +3 -3
  119. package/dist/{scheduleData-BpkfnBjP.cjs → scheduleData-BXjNXVHY.cjs} +1 -1
  120. package/dist/{scheduleData-BLCUm84s.js → scheduleData-DR6A-Q7Z.js} +1 -1
  121. package/dist/server.cjs.js +1 -1
  122. package/dist/server.es.js +1 -1
  123. package/dist/{serviceStatus-5sk8MPjW.js → serviceStatus-C9izcuQz.js} +2 -2
  124. package/dist/{serviceStatus-1pGLLilF.cjs → serviceStatus-Cde96_OO.cjs} +1 -1
  125. package/dist/{serviceSwitches-BWnZBooS.js → serviceSwitches-CZHwvVfP.js} +1 -1
  126. package/dist/{serviceSwitches-Do_pkFCu.cjs → serviceSwitches-mhJbQBrV.cjs} +1 -1
  127. package/dist/vite.cjs.js +1 -1
  128. package/dist/vite.es.js +1 -1
  129. package/dist/your-ai-workflow-firebase-os.cjs.js +8 -8
  130. package/dist/your-ai-workflow-firebase-os.css +1 -1
  131. package/dist/your-ai-workflow-firebase-os.es.js +358 -316
  132. package/package.json +1 -1
  133. package/src/index.css +41 -6
  134. package/dist/PagesAdmin-B-XopEi9.js +0 -3
  135. package/dist/PagesAdmin-nL5ZltFn.cjs +0 -1
  136. package/dist/ThemeAdmin-CwCiTp2I.js +0 -2
  137. package/dist/ThemeAdmin-Db5edTYj.cjs +0 -1
  138. package/dist/TimeZoneField-zR8N2Fj0.cjs +0 -11
  139. package/dist/appIcons-BNovDw6_.cjs +0 -130
@@ -1,13 +1,13 @@
1
1
  import { b as e, d as t, m as n, p as r, y as i } from "./mediaKind-BtaMpGy8.js";
2
- import "./PageTitle-DFGW71q8.js";
3
- import { Ft as a, U as o, W as s, fi as c, nt as l, o as u, ui as d } from "./TimeZoneField-Dv389mAe.js";
2
+ import "./PageTitle-DCoUQWw6.js";
3
+ import { Ft as a, U as o, W as s, fi as c, nt as l, o as u, ui as d } from "./TimeZoneField-oIMwb5_X.js";
4
4
  import { n as f } from "./chevron-down--LwXEv9w.js";
5
- import { t as p } from "./TemplateDrive-CfPXKMKX.js";
5
+ import { t as p } from "./TemplateDrive-DNBwL0oy.js";
6
6
  import { r as m } from "./x-hax8aKt8.js";
7
7
  import { t as h } from "./trash-6Wj66gJi.js";
8
- import { t as g } from "./ConfirmModal-C1dM-bzk.js";
8
+ import { t as g } from "./ConfirmModal-BW9e6Y7d.js";
9
9
  import { t as _ } from "./fileBytes-CkesftRs.js";
10
- import { n as v } from "./SystemTabContent-C4azXKMs.js";
10
+ import { n as v } from "./SystemTabContent-CMyT7mDN.js";
11
11
  import { useEffect as y, useRef as b, useState as x } from "react";
12
12
  import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
13
13
  import { collection as T, deleteDoc as E, doc as D, getDocs as O } from "firebase/firestore";
@@ -1 +1 @@
1
- require(`./chunk-CiTBaPhY.cjs`),require(`./PageTitle-BWmE74WQ.cjs`);const e=require(`./TimeZoneField-zR8N2Fj0.cjs`),t=require(`./chevron-down-lyDK1rfL.cjs`),n=require(`./TemplateDrive-XDRPkxIj.cjs`),r=require(`./x-Ci8c5p6T.cjs`),i=require(`./trash-D-CpYHCs.cjs`),a=require(`./mediaKind-ButDya5f.cjs`),o=require(`./ConfirmModal-CQ73WYUg.cjs`),s=require(`./fileBytes-BLDZ-2kj.cjs`),c=require(`./SystemTabContent-EegzTuLd.cjs`);let l=require(`react`),u=require(`react/jsx-runtime`),d=require(`firebase/firestore`),f=require(`firebase/storage`);var p={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};p.node;var m=t.n(p),h=[`pub_files`,`pub_files/pages`,`pub_form_uploads/pages`],g=/^image\/(jpe?g|png|webp|avif)$/i;async function _(t){try{let n=await(0,f.listAll)((0,f.ref)(e.fi,t)),r=n.items.map(e=>e.fullPath).filter(e=>!a.d(e)),i=await Promise.all(n.prefixes.map(e=>_(e.fullPath)));return[...r,...i.flat()]}catch{return[]}}var v=t=>RegExp(`max-age=${e.U}`).test(String(t||``));async function y(t){try{return await(0,f.getMetadata)((0,f.ref)(e.fi,t)),!0}catch{return!1}}async function b(t,n){let r=``;try{let i=await(0,f.getMetadata)((0,f.ref)(e.fi,t));r=String(i.contentType||``),v(i.cacheControl)||(await(0,f.updateMetadata)((0,f.ref)(e.fi,t),{cacheControl:e.W(t).cacheControl,...i.customMetadata?{customMetadata:i.customMetadata}:{}}),n.headersFixed++)}catch{n.skipped++;return}if(!g.test(r))return;let i=[{path:a.p(t),make:a.m},{path:a.y(t),make:a.b}].filter(e=>e.path),o=[];for(let e of i)await y(e.path)||o.push(e);if(!o.length)return;let c;try{c=await s.t(await(0,f.getDownloadURL)((0,f.ref)(e.fi,t)))}catch{n.skipped++;return}let l=t.slice(t.lastIndexOf(`/`)+1),u=new File([c],l,{type:r||c.type});for(let t of o)try{let r=await t.make(u,l);if(!r)continue;await(0,f.uploadBytes)((0,f.ref)(e.fi,t.path),r,e.W(t.path)),n.companionsMade++}catch{}}async function x(e={}){let{onProgress:t,signal:n}=e,r={done:0,total:0,headersFixed:0,companionsMade:0,skipped:0},i=await Promise.all(h.map(_)),a=[...new Set(i.flat())];r.total=a.length,t?.({...r});let o=0;return await Promise.all(Array.from({length:Math.min(4,a.length)},async()=>{for(;o<a.length;){if(n?.aborted)return;let e=a[o++];await b(e,r),r.done++,t?.({...r})}})),{...r}}var S=[`mem_files`,`user_files`,`admin_files`],C=e=>!e.sourceTab;function w(){let[t,n]=(0,l.useState)(null),[a,s]=(0,l.useState)(!1),[c,p]=(0,l.useState)(!1),[m,h]=(0,l.useState)(``),[g,_]=(0,l.useState)(0);(0,l.useEffect)(()=>{let t=!1;return Promise.all(S.map(async t=>{try{return(await(0,d.getDocs)((0,d.collection)(e.ui,t))).docs.map(e=>({collectionName:t,id:e.id,...e.data()}))}catch{return[]}})).then(e=>{t||n(e.flat())}),()=>{t=!0}},[]);let v=async()=>{if(!t)return;p(!0),h(``);let r=0;for(let n of t)try{let t=n.storagePath||n.downloadURL;t&&C(n)&&await(0,f.deleteObject)((0,f.ref)(e.fi,t)).catch(()=>{}),await(0,d.deleteDoc)((0,d.doc)(e.ui,n.collectionName,n.id)),_(e=>e+1)}catch(e){r+=1,console.error(`Could not delete ${n.collectionName}/${n.id}:`,e)}r>0?(h(`${r} file${r===1?``:`s`} could not be deleted. Reload and try again.`),n((await Promise.all(S.map(async t=>{try{return(await(0,d.getDocs)((0,d.collection)(e.ui,t))).docs.map(e=>({collectionName:t,id:e.id,...e.data()}))}catch{return[]}}))).flat())):n([]),p(!1),s(!1)};if(!t||t.length===0)return null;let y=t.filter(C).length,b=S.map(e=>({name:e,n:t.filter(t=>t.collectionName===e).length})).filter(e=>e.n>0);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(e.nt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`mt-6 glass-panel border border-amber-500/25 bg-amber-500/[0.03] rounded-2xl md:rounded-3xl p-4 md:p-8`,children:[(0,u.jsxs)(`h3`,{className:`text-[17px] font-bold text-foreground tracking-tight mb-2`,children:[t.length,` leftover record`,t.length===1?``:`s`,` from the old Drive`]}),(0,u.jsx)(`p`,{className:`text-[14px] text-foreground/60 leading-relaxed mb-3 max-w-2xl`,children:`Drive used to have Internal, User and Admin folders. They are gone — this page is the only built-in folder now, and each page you have built keeps its own files. Nothing reads these records any more.`}),(0,u.jsxs)(`p`,{className:`text-[14px] text-foreground/60 leading-relaxed mb-3 max-w-2xl`,children:[y>0?`${y} ${y===1?`was`:`were`} uploaded through the old Drive screen, so ${y===1?`its file is`:`their files are`} deleted too. `:``,t.length-y>0?`${t.length-y} belong to files a page still shows, so only the leftover record goes — the ${t.length-y===1?`file stays`:`files stay`} where ${t.length-y===1?`it is`:`they are`}.`:``]}),(0,u.jsx)(`p`,{className:`text-[13px] text-foreground/50 font-medium mb-5`,children:b.map(e=>`${e.n} in ${e.name}`).join(` · `)}),m&&(0,u.jsx)(`p`,{className:`text-[13px] font-medium text-red-400 bg-red-500/10 border border-red-500/20 rounded-xl p-3 mb-4`,children:m}),(0,u.jsxs)(`button`,{onClick:()=>s(!0),disabled:c,className:`inline-flex items-center gap-2 px-5 py-2.5 rounded-xl text-[13px] font-bold bg-red-500/10 hover:bg-red-500/20 text-red-500 border border-red-500/20 transition-colors disabled:opacity-50`,children:[c?(0,u.jsx)(r.r,{className:`w-4 h-4 animate-spin`}):(0,u.jsx)(i.t,{className:`w-4 h-4`}),c?`Deleting ${g} of ${t.length}…`:`Clean up all ${t.length} permanently`]})]}),(0,u.jsx)(o.t,{isOpen:a,title:`Delete the old Drive files`,message:(0,u.jsxs)(u.Fragment,{children:[`This permanently deletes `,(0,u.jsxs)(`strong`,{className:`text-foreground`,children:[t.length,` leftover record`,t.length===1?``:`s`]}),` `,`from `,b.map(e=>e.name).join(`, `),y>0&&(0,u.jsxs)(u.Fragment,{children:[`, along with the `,(0,u.jsxs)(`strong`,{className:`text-foreground`,children:[y,` file`,y===1?``:`s`]}),` uploaded through the old Drive screen`]}),`. It cannot be undone, and it covers every user's uploads, not only your own. Files that a page still shows are left alone.`]}),onConfirm:v,onCancel:()=>s(!1),isProcessing:c,confirmText:`Yes, delete them`})]})}function T(){let[t,n]=(0,l.useState)(null),[i,a]=(0,l.useState)(!1),[o,s]=(0,l.useState)(``),c=(0,l.useRef)(null);return(0,l.useEffect)(()=>()=>c.current?.abort(),[]),(0,u.jsxs)(e.nt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`mt-6 glass-panel border border-[var(--panel-border)] rounded-2xl md:rounded-3xl p-4 md:p-6`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,u.jsxs)(`div`,{className:`min-w-0`,children:[(0,u.jsx)(`h3`,{className:`text-[15px] font-bold text-foreground tracking-tight`,children:`Make pictures load faster`}),(0,u.jsx)(`p`,{className:`max-sm:hidden text-[13px] text-foreground/55 leading-relaxed mt-1 max-w-2xl`,children:`Pictures you added a while ago are still sent at full size every time somebody looks at them. This gives them the same light versions and the same settings everything you add now gets. Your pictures are not changed and nothing is deleted.`})]}),i?(0,u.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,u.jsx)(`span`,{className:`text-[12.5px] font-semibold text-foreground/60 whitespace-nowrap`,children:t?`${t.done} of ${t.total}`:`Looking…`}),(0,u.jsx)(e.o,{icon:r.r,onClick:()=>c.current?.abort(),compact:!0,children:`Stop`})]}):(0,u.jsx)(e.o,{icon:m,onClick:async()=>{let e=new AbortController;c.current=e,a(!0),s(``),n(null);try{let t=await x({signal:e.signal,onProgress:n}),r=[t.companionsMade>0?`${t.companionsMade} light version${t.companionsMade===1?``:`s`} made`:``,t.headersFixed>0?`${t.headersFixed} picture${t.headersFixed===1?``:`s`} set to stay in the browser`:``].filter(Boolean);s(e.signal.aborted?`Stopped. Nothing was lost — start again whenever you like.`:r.length?`Done — ${r.join(`, `)}.`:`Everything is already fast.`)}catch{s(`That did not finish. Nothing was changed by the part that stopped — try again.`)}a(!1),n(null),c.current=null},compact:!0,children:`Make them fast`})]}),o&&!i&&(0,u.jsx)(`p`,{className:`text-[13px] font-medium text-foreground/70 mt-3`,children:o})]})}function E(){let{isAdmin:t}=e.Ft();return(0,u.jsx)(n.t,{title:`Assets`,subtitle:`/assets`,filesCollection:`pub_files`,config:{isAdmin:!0,pageId:`assets`},footer:t?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(T,{}),(0,u.jsx)(w,{})]}):null,addition:(0,u.jsx)(c.n,{tab:`assets`})})}exports.Assets=E;
1
+ require(`./chunk-CiTBaPhY.cjs`),require(`./PageTitle-DQkvCB11.cjs`);const e=require(`./TimeZoneField-Ckn1pKAL.cjs`),t=require(`./chevron-down-lyDK1rfL.cjs`),n=require(`./TemplateDrive-BJN-ReA_.cjs`),r=require(`./x-Ci8c5p6T.cjs`),i=require(`./trash-D-CpYHCs.cjs`),a=require(`./mediaKind-ButDya5f.cjs`),o=require(`./ConfirmModal-BUNtss4a.cjs`),s=require(`./fileBytes-BLDZ-2kj.cjs`),c=require(`./SystemTabContent-BWhRHoXx.cjs`);let l=require(`react`),u=require(`react/jsx-runtime`),d=require(`firebase/firestore`),f=require(`firebase/storage`);var p={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};p.node;var m=t.n(p),h=[`pub_files`,`pub_files/pages`,`pub_form_uploads/pages`],g=/^image\/(jpe?g|png|webp|avif)$/i;async function _(t){try{let n=await(0,f.listAll)((0,f.ref)(e.fi,t)),r=n.items.map(e=>e.fullPath).filter(e=>!a.d(e)),i=await Promise.all(n.prefixes.map(e=>_(e.fullPath)));return[...r,...i.flat()]}catch{return[]}}var v=t=>RegExp(`max-age=${e.U}`).test(String(t||``));async function y(t){try{return await(0,f.getMetadata)((0,f.ref)(e.fi,t)),!0}catch{return!1}}async function b(t,n){let r=``;try{let i=await(0,f.getMetadata)((0,f.ref)(e.fi,t));r=String(i.contentType||``),v(i.cacheControl)||(await(0,f.updateMetadata)((0,f.ref)(e.fi,t),{cacheControl:e.W(t).cacheControl,...i.customMetadata?{customMetadata:i.customMetadata}:{}}),n.headersFixed++)}catch{n.skipped++;return}if(!g.test(r))return;let i=[{path:a.p(t),make:a.m},{path:a.y(t),make:a.b}].filter(e=>e.path),o=[];for(let e of i)await y(e.path)||o.push(e);if(!o.length)return;let c;try{c=await s.t(await(0,f.getDownloadURL)((0,f.ref)(e.fi,t)))}catch{n.skipped++;return}let l=t.slice(t.lastIndexOf(`/`)+1),u=new File([c],l,{type:r||c.type});for(let t of o)try{let r=await t.make(u,l);if(!r)continue;await(0,f.uploadBytes)((0,f.ref)(e.fi,t.path),r,e.W(t.path)),n.companionsMade++}catch{}}async function x(e={}){let{onProgress:t,signal:n}=e,r={done:0,total:0,headersFixed:0,companionsMade:0,skipped:0},i=await Promise.all(h.map(_)),a=[...new Set(i.flat())];r.total=a.length,t?.({...r});let o=0;return await Promise.all(Array.from({length:Math.min(4,a.length)},async()=>{for(;o<a.length;){if(n?.aborted)return;let e=a[o++];await b(e,r),r.done++,t?.({...r})}})),{...r}}var S=[`mem_files`,`user_files`,`admin_files`],C=e=>!e.sourceTab;function w(){let[t,n]=(0,l.useState)(null),[a,s]=(0,l.useState)(!1),[c,p]=(0,l.useState)(!1),[m,h]=(0,l.useState)(``),[g,_]=(0,l.useState)(0);(0,l.useEffect)(()=>{let t=!1;return Promise.all(S.map(async t=>{try{return(await(0,d.getDocs)((0,d.collection)(e.ui,t))).docs.map(e=>({collectionName:t,id:e.id,...e.data()}))}catch{return[]}})).then(e=>{t||n(e.flat())}),()=>{t=!0}},[]);let v=async()=>{if(!t)return;p(!0),h(``);let r=0;for(let n of t)try{let t=n.storagePath||n.downloadURL;t&&C(n)&&await(0,f.deleteObject)((0,f.ref)(e.fi,t)).catch(()=>{}),await(0,d.deleteDoc)((0,d.doc)(e.ui,n.collectionName,n.id)),_(e=>e+1)}catch(e){r+=1,console.error(`Could not delete ${n.collectionName}/${n.id}:`,e)}r>0?(h(`${r} file${r===1?``:`s`} could not be deleted. Reload and try again.`),n((await Promise.all(S.map(async t=>{try{return(await(0,d.getDocs)((0,d.collection)(e.ui,t))).docs.map(e=>({collectionName:t,id:e.id,...e.data()}))}catch{return[]}}))).flat())):n([]),p(!1),s(!1)};if(!t||t.length===0)return null;let y=t.filter(C).length,b=S.map(e=>({name:e,n:t.filter(t=>t.collectionName===e).length})).filter(e=>e.n>0);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(e.nt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`mt-6 glass-panel border border-amber-500/25 bg-amber-500/[0.03] rounded-2xl md:rounded-3xl p-4 md:p-8`,children:[(0,u.jsxs)(`h3`,{className:`text-[17px] font-bold text-foreground tracking-tight mb-2`,children:[t.length,` leftover record`,t.length===1?``:`s`,` from the old Drive`]}),(0,u.jsx)(`p`,{className:`text-[14px] text-foreground/60 leading-relaxed mb-3 max-w-2xl`,children:`Drive used to have Internal, User and Admin folders. They are gone — this page is the only built-in folder now, and each page you have built keeps its own files. Nothing reads these records any more.`}),(0,u.jsxs)(`p`,{className:`text-[14px] text-foreground/60 leading-relaxed mb-3 max-w-2xl`,children:[y>0?`${y} ${y===1?`was`:`were`} uploaded through the old Drive screen, so ${y===1?`its file is`:`their files are`} deleted too. `:``,t.length-y>0?`${t.length-y} belong to files a page still shows, so only the leftover record goes — the ${t.length-y===1?`file stays`:`files stay`} where ${t.length-y===1?`it is`:`they are`}.`:``]}),(0,u.jsx)(`p`,{className:`text-[13px] text-foreground/50 font-medium mb-5`,children:b.map(e=>`${e.n} in ${e.name}`).join(` · `)}),m&&(0,u.jsx)(`p`,{className:`text-[13px] font-medium text-red-400 bg-red-500/10 border border-red-500/20 rounded-xl p-3 mb-4`,children:m}),(0,u.jsxs)(`button`,{onClick:()=>s(!0),disabled:c,className:`inline-flex items-center gap-2 px-5 py-2.5 rounded-xl text-[13px] font-bold bg-red-500/10 hover:bg-red-500/20 text-red-500 border border-red-500/20 transition-colors disabled:opacity-50`,children:[c?(0,u.jsx)(r.r,{className:`w-4 h-4 animate-spin`}):(0,u.jsx)(i.t,{className:`w-4 h-4`}),c?`Deleting ${g} of ${t.length}…`:`Clean up all ${t.length} permanently`]})]}),(0,u.jsx)(o.t,{isOpen:a,title:`Delete the old Drive files`,message:(0,u.jsxs)(u.Fragment,{children:[`This permanently deletes `,(0,u.jsxs)(`strong`,{className:`text-foreground`,children:[t.length,` leftover record`,t.length===1?``:`s`]}),` `,`from `,b.map(e=>e.name).join(`, `),y>0&&(0,u.jsxs)(u.Fragment,{children:[`, along with the `,(0,u.jsxs)(`strong`,{className:`text-foreground`,children:[y,` file`,y===1?``:`s`]}),` uploaded through the old Drive screen`]}),`. It cannot be undone, and it covers every user's uploads, not only your own. Files that a page still shows are left alone.`]}),onConfirm:v,onCancel:()=>s(!1),isProcessing:c,confirmText:`Yes, delete them`})]})}function T(){let[t,n]=(0,l.useState)(null),[i,a]=(0,l.useState)(!1),[o,s]=(0,l.useState)(``),c=(0,l.useRef)(null);return(0,l.useEffect)(()=>()=>c.current?.abort(),[]),(0,u.jsxs)(e.nt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`mt-6 glass-panel border border-[var(--panel-border)] rounded-2xl md:rounded-3xl p-4 md:p-6`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,u.jsxs)(`div`,{className:`min-w-0`,children:[(0,u.jsx)(`h3`,{className:`text-[15px] font-bold text-foreground tracking-tight`,children:`Make pictures load faster`}),(0,u.jsx)(`p`,{className:`max-sm:hidden text-[13px] text-foreground/55 leading-relaxed mt-1 max-w-2xl`,children:`Pictures you added a while ago are still sent at full size every time somebody looks at them. This gives them the same light versions and the same settings everything you add now gets. Your pictures are not changed and nothing is deleted.`})]}),i?(0,u.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,u.jsx)(`span`,{className:`text-[12.5px] font-semibold text-foreground/60 whitespace-nowrap`,children:t?`${t.done} of ${t.total}`:`Looking…`}),(0,u.jsx)(e.o,{icon:r.r,onClick:()=>c.current?.abort(),compact:!0,children:`Stop`})]}):(0,u.jsx)(e.o,{icon:m,onClick:async()=>{let e=new AbortController;c.current=e,a(!0),s(``),n(null);try{let t=await x({signal:e.signal,onProgress:n}),r=[t.companionsMade>0?`${t.companionsMade} light version${t.companionsMade===1?``:`s`} made`:``,t.headersFixed>0?`${t.headersFixed} picture${t.headersFixed===1?``:`s`} set to stay in the browser`:``].filter(Boolean);s(e.signal.aborted?`Stopped. Nothing was lost — start again whenever you like.`:r.length?`Done — ${r.join(`, `)}.`:`Everything is already fast.`)}catch{s(`That did not finish. Nothing was changed by the part that stopped — try again.`)}a(!1),n(null),c.current=null},compact:!0,children:`Make them fast`})]}),o&&!i&&(0,u.jsx)(`p`,{className:`text-[13px] font-medium text-foreground/70 mt-3`,children:o})]})}function E(){let{isAdmin:t}=e.Ft();return(0,u.jsx)(n.t,{title:`Assets`,subtitle:`/assets`,filesCollection:`pub_files`,config:{isAdmin:!0,pageId:`assets`},footer:t?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(T,{}),(0,u.jsx)(w,{})]}):null,addition:(0,u.jsx)(c.n,{tab:`assets`})})}exports.Assets=E;
@@ -1 +1 @@
1
- require(`./chunk-CiTBaPhY.cjs`);const e=require(`./TimeZoneField-zR8N2Fj0.cjs`),t=require(`./FileViewerPopup-DQmhXMSg.cjs`),n=require(`./mediaKind-ButDya5f.cjs`);let r=require(`react/jsx-runtime`);function i({value:i,onOpen:a,className:o=`w-28 h-20`}){return(0,r.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.P(i).map(i=>{let s=e.N(i),c=n.u(i);return(0,r.jsx)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,"aria-label":s,title:s,onClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.button!==0||(e.preventDefault(),a({src:i,name:s}))},className:`block rounded-xl outline-none focus-visible:ring-2 focus-visible:ring-accent/50 hover:opacity-90 active:scale-[0.99] transition`,children:c===`image`?(0,r.jsx)(e.O,{src:i,alt:s,fit:`cover`,className:`${o} rounded-xl border border-[var(--panel-border)]`}):(0,r.jsxs)(`span`,{className:`${o} rounded-xl border border-[var(--panel-border)] bg-foreground/[0.02] flex flex-col items-center justify-center gap-1.5 px-2`,children:[(0,r.jsx)(t.i,{kind:c,name:s,className:`w-5 h-5 text-foreground/50`}),(0,r.jsx)(`span`,{className:`max-w-full truncate text-[11.5px] text-foreground/60`,children:s})]})},i)})})}i.displayName=`Attachments`,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
1
+ require(`./chunk-CiTBaPhY.cjs`);const e=require(`./TimeZoneField-Ckn1pKAL.cjs`),t=require(`./FileViewerPopup-CkLUYCNo.cjs`),n=require(`./mediaKind-ButDya5f.cjs`);let r=require(`react/jsx-runtime`);function i({value:i,onOpen:a,className:o=`w-28 h-20`}){return(0,r.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.P(i).map(i=>{let s=e.N(i),c=n.u(i);return(0,r.jsx)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,"aria-label":s,title:s,onClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.button!==0||(e.preventDefault(),a({src:i,name:s}))},className:`block rounded-xl outline-none focus-visible:ring-2 focus-visible:ring-accent/50 hover:opacity-90 active:scale-[0.99] transition`,children:c===`image`?(0,r.jsx)(e.O,{src:i,alt:s,fit:`cover`,className:`${o} rounded-xl border border-[var(--panel-border)]`}):(0,r.jsxs)(`span`,{className:`${o} rounded-xl border border-[var(--panel-border)] bg-foreground/[0.02] flex flex-col items-center justify-center gap-1.5 px-2`,children:[(0,r.jsx)(t.i,{kind:c,name:s,className:`w-5 h-5 text-foreground/50`}),(0,r.jsx)(`span`,{className:`max-w-full truncate text-[11.5px] text-foreground/60`,children:s})]})},i)})})}i.displayName=`Attachments`,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
@@ -1,6 +1,6 @@
1
1
  import { u as e } from "./mediaKind-BtaMpGy8.js";
2
- import { N as t, O as n, P as r } from "./TimeZoneField-Dv389mAe.js";
3
- import { i } from "./FileViewerPopup-Dnl3td2o.js";
2
+ import { N as t, O as n, P as r } from "./TimeZoneField-oIMwb5_X.js";
3
+ import { i } from "./FileViewerPopup-gqhRT22v.js";
4
4
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
5
  //#region src/components/media/Attachments.tsx
6
6
  function s({ value: s, onOpen: c, className: l = "w-28 h-20" }) {
@@ -1 +1 @@
1
- require(`./chunk-CiTBaPhY.cjs`);const e=require(`./PageTitle-BWmE74WQ.cjs`),t=require(`./TimeZoneField-zR8N2Fj0.cjs`),n=require(`./DashboardNav-DOl9gJuu.cjs`),r=require(`./chevron-down-lyDK1rfL.cjs`),i=require(`./x-Ci8c5p6T.cjs`),a=require(`./transactions-CIU2NcKh.cjs`),o=require(`./ManagePlanButton-BRW7Sevd.cjs`),s=require(`./openOnArrival-FiXqw4WM.cjs`);let c=require(`react`),l=require(`react/jsx-runtime`),u=require(`react-router-dom`);function d(e){return e.status===`past_due`?{label:`Past due`,tone:`bad`}:e.active?{label:`Active`,tone:`good`}:{label:`Cancelled`,tone:`quiet`}}function f(e){return e.fullyRefunded?{label:`Refunded`,tone:`quiet`}:(e.amountRefunded||0)>0?{label:`Partly refunded`,tone:`good`}:e.paid?{label:`Paid`,tone:`good`}:{label:`Not paid`,tone:`quiet`}}function p(e){return!e.currentPeriodEnd||!e.active?``:e.cancelAtPeriodEnd?`Ends on ${y(e.currentPeriodEnd)}`:`Renews on ${y(e.currentPeriodEnd)}`}var m=e=>e.productName||e.description||`One-off payment`,h=e=>{if(/^and \d+ more$/i.test(e))return{words:e,price:``,quantity:0,more:!0};let t=e.lastIndexOf(` · `),n=t>0?e.slice(t+3).trim():``,r=/\d/.test(n),i=r?e.slice(0,t).trim():e,a=i.match(/^(\d+)\s*[×x]\s/);return{words:i,price:r?n:``,quantity:a?Number(a[1]):0,more:!1}};function g(e,t){let n=typeof e==`string`?e.trim():``;if(!n)return[];let r=a.c(n);return r&&typeof r==`object`?(Array.isArray(r)?r:[r]).filter(e=>!!e&&typeof e==`object`&&!Array.isArray(e)).map(e=>{let{words:n,price:r}=a.o(e,t),i=Number(e.quantity??e.qty);return{words:n,price:r,quantity:Number.isFinite(i)&&i>0?i:0,more:!1}}).filter(e=>e.words||e.price):n.split(`; `).map(e=>e.trim()).filter(Boolean).map(h)}function _(e){return!e.length||e.some(e=>e.more||!e.quantity)?null:e.reduce((e,t)=>e+t.quantity,0)}function v(e,t=g(e.items,e.currency)){let n=_(t),r=m(e),i=n&&n>1&&!/\bitems?\b/i.test(r)?`${n} items`:``;return[y(e.created),i].filter(Boolean).join(` · `)}var y=e=>e?new Date(e*1e3).toLocaleDateString(void 0,{day:`numeric`,month:`short`,year:`numeric`}):``,b=e=>e?new Date(e*1e3).toLocaleString(void 0,{day:`numeric`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`}):``;function x(e){let t=[];return e.created&&t.push([e.paid?`Paid on`:`Date`,b(e.created)]),e.paidWith&&t.push([`Paid with`,e.paidWith]),(e.amountRefunded||0)>0&&t.push([`Refunded`,a.r(e.amountRefunded,e.currency)]),t}function S(e){let t=[];return e.amount!=null&&e.currency&&t.push([`Billing`,`${a.r(e.amount,e.currency)}${e.interval?` every ${e.interval}`:``}`]),p(e)&&t.push([e.cancelAtPeriodEnd?`Ends on`:`Renews on`,y(e.currentPeriodEnd)]),e.quantity>1&&t.push([`Seats`,String(e.quantity)]),e.status===`past_due`&&t.push([`Card`,`Stripe is retrying your card — update it under Manage plan.`]),t}var C=`grid grid-cols-[minmax(0,1fr)_auto_1rem] md:grid-cols-[minmax(0,1.5fr)_6.5rem_7rem_8.5rem_1rem] gap-x-3 md:gap-x-6 px-4 md:px-5`,w=`${C} items-center`;function T({chip:e,className:t=``}){let n=e.tone===`good`?`bg-emerald-500`:e.tone===`bad`?`bg-red-500`:`bg-foreground/25`;return(0,l.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-[12.5px] font-medium text-foreground/60 leading-tight whitespace-nowrap ${t}`,children:[(0,l.jsx)(`span`,{"aria-hidden":`true`,className:`w-1.5 h-1.5 rounded-full shrink-0 ${n}`}),e.label]})}var E=`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-3`;function D({label:e,value:n}){return(0,l.jsxs)(`div`,{className:`min-w-0`,children:[(0,l.jsx)(`span`,{className:`${t.u} block leading-tight mb-0.5`,children:e}),(0,l.jsx)(`span`,{className:`block text-[13.5px] text-foreground/85 leading-snug break-words [overflow-wrap:anywhere]`,children:n})]})}function O({title:e,line:t,children:n}){return(0,l.jsxs)(`div`,{className:`flex items-center justify-between gap-3 flex-wrap px-1`,children:[(0,l.jsxs)(`div`,{className:`min-w-0`,children:[(0,l.jsx)(`p`,{className:`text-[14px] font-bold text-foreground leading-tight`,children:e}),(0,l.jsx)(`p`,{className:`text-[12px] font-medium text-foreground/45 leading-snug mt-0.5`,children:t})]}),n]})}function k({first:e,second:t}){return(0,l.jsxs)(`div`,{className:`max-md:hidden ${w} py-2.5 text-[11.5px] font-medium text-foreground/40`,children:[(0,l.jsx)(`span`,{children:e}),(0,l.jsx)(`span`,{children:t}),(0,l.jsx)(`span`,{children:`Status`}),(0,l.jsx)(`span`,{className:`text-right`,children:`Amount`}),(0,l.jsx)(`span`,{})]})}function A({lines:e}){return(0,l.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,l.jsx)(`h3`,{className:`px-4 md:px-5 ${t.u} block leading-tight mb-0.5`,children:`What you bought`}),e.map((e,t)=>(0,l.jsxs)(`div`,{className:`${C} items-baseline`,children:[(0,l.jsx)(`span`,{className:`md:col-span-3 min-w-0 leading-snug break-words [overflow-wrap:anywhere] ${e.more?`text-[13px] text-foreground/45`:`text-[13.5px] text-foreground/85`}`,children:e.words}),(0,l.jsx)(`span`,{className:`text-right text-[13.5px] text-foreground/85 tabular-nums whitespace-nowrap leading-snug`,children:e.price})]},t))]})}function j({rowKey:e,what:n,sub:i,when:a,amount:o,per:s,chip:c,bought:u=[],facts:d,receiptUrl:f,open:p,onToggle:m}){return(0,l.jsxs)(`div`,{"data-ledger-row":e,className:`scroll-mt-6 ${p?`bg-foreground/[0.02]`:``}`,children:[(0,l.jsxs)(`button`,{type:`button`,onClick:m,"aria-expanded":p,className:`w-full ${w} py-3 text-left cursor-pointer transition-colors hover:bg-foreground/[0.03]`,children:[(0,l.jsxs)(`span`,{className:`flex flex-col min-w-0 gap-0.5`,children:[(0,l.jsx)(`span`,{className:`text-[13.5px] font-bold text-foreground leading-tight truncate`,children:n}),(0,l.jsx)(`span`,{className:`md:hidden text-[12px] font-medium text-foreground/45 leading-tight truncate`,children:i})]}),(0,l.jsx)(`span`,{className:`max-md:hidden text-[12.5px] font-medium text-foreground/45 tabular-nums whitespace-nowrap truncate leading-tight`,children:a}),(0,l.jsx)(T,{chip:c,className:`max-md:hidden`}),(0,l.jsxs)(`span`,{className:`flex flex-col items-end gap-1 min-w-0`,children:[(0,l.jsxs)(`span`,{className:`text-[13.5px] font-semibold text-foreground tabular-nums whitespace-nowrap leading-tight`,children:[o||(0,l.jsx)(`span`,{className:`text-foreground/25 font-medium`,children:`—`}),o&&s&&(0,l.jsxs)(`span`,{className:`text-[12.5px] text-foreground/40 font-medium`,children:[` `,s]})]}),(0,l.jsx)(T,{chip:c,className:`md:hidden !text-[11.5px] !gap-1.5`})]}),(0,l.jsx)(r.t,{className:`w-4 h-4 text-foreground/35 shrink-0 justify-self-end transition-transform ${p?`rotate-180`:``}`})]}),(0,l.jsx)(t.rt,{initial:!1,children:p&&(0,l.jsx)(t.nt.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:t.w,className:`overflow-hidden`,children:(0,l.jsxs)(`div`,{className:`pb-4 md:pb-5 flex flex-col gap-4`,children:[(0,l.jsx)(`div`,{className:`mx-4 md:mx-5 border-t border-[var(--panel-border)]/50`}),u.length>0&&(0,l.jsx)(A,{lines:u}),d.length>0&&(0,l.jsx)(`div`,{className:`px-4 md:px-5 ${E}`,children:d.map(([e,t])=>(0,l.jsx)(D,{label:e,value:t},e))}),f&&(0,l.jsx)(`div`,{className:`mx-4 md:mx-5 border-t border-[var(--panel-border)]/50 pt-3`,children:(0,l.jsxs)(`a`,{href:f,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 text-[12.5px] font-bold text-accent hover:underline`,children:[`Stripe receipt`,(0,l.jsx)(t.Ot,{className:`w-3.5 h-3.5`})]})})]})})})]})}function M({email:r,loading:u,subscriptions:h,payments:_,error:b,initialOpen:C=null,focus:w=null,onFocused:T}){let[E,D]=(0,c.useState)(C),A=e=>D(t=>t===e?null:e),M=!u&&!b&&h.length===0&&_.length===0;return s.t(w,!u&&!!w&&(_.some(e=>e.id===w)||h.some(e=>e.id===w)),D,T),(0,l.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 pt-2 md:p-8 md:pt-4 z-10 flex flex-col min-h-screen`,children:[(0,l.jsxs)(t.nt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-6`,children:[(0,l.jsx)(e.t,{children:`Billing`}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]`,children:[(0,l.jsx)(`span`,{className:`w-8 h-[1px] bg-foreground/10`}),`/billing`]})]}),(0,l.jsxs)(`div`,{className:`flex flex-col gap-6 flex-1 pb-16`,children:[(0,l.jsx)(n.t,{}),(0,l.jsx)(`div`,{className:`glass-panel border border-[var(--panel-border)] rounded-3xl p-4 sm:p-5 md:p-8 shadow-2xl relative bg-background flex flex-col fbos-tab-fill min-h-[400px] gap-6`,children:u?(0,l.jsx)(`div`,{className:`flex items-center justify-center flex-1 text-foreground/40 py-16`,children:(0,l.jsx)(i.r,{className:`w-6 h-6 animate-spin text-accent`})}):b?(0,l.jsx)(t.h,{tone:`error`,children:b}):M?(0,l.jsxs)(`div`,{className:`flex flex-col items-center justify-center flex-1 gap-3 py-16 text-center`,children:[(0,l.jsx)(n.D,{className:`w-8 h-8 text-foreground/20`}),(0,l.jsxs)(`p`,{className:`text-[13px] font-medium text-foreground/50 max-w-md leading-relaxed`,children:[`Nothing has been bought on this account`,r?(0,l.jsxs)(l.Fragment,{children:[` — `,(0,l.jsx)(`span`,{className:`text-foreground/70`,children:r})]}):null,`. A payment made with a different email address at checkout lives with that email: sign in with the address you paid with to see it here.`]})]}):(0,l.jsxs)(l.Fragment,{children:[h.length>0&&(0,l.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,l.jsx)(O,{title:h.length===1?`Your plan`:`Your plans`,line:`Change card, switch or cancel on Stripe's own page.`,children:(0,l.jsx)(o.t,{variant:`secondary`,className:`h-9 px-3.5 text-[12.5px] font-semibold`})}),(0,l.jsxs)(`div`,{className:`rounded-2xl border border-[var(--panel-border)]/60 divide-y divide-[var(--panel-border)]/60 overflow-hidden`,children:[(0,l.jsx)(k,{first:`Plan`,second:`Renews`}),h.map(e=>{let t=d(e),n=p(e),r=e.amount!=null&&e.currency?a.r(e.amount,e.currency):``;return(0,l.jsx)(j,{rowKey:e.id,what:e.productName||`Subscription`,sub:n||t.label,when:n?y(e.currentPeriodEnd):`—`,amount:r,per:e.interval?`/ ${e.interval}`:``,chip:t,facts:S(e),open:E===e.id,onToggle:()=>A(e.id)},e.id)})]})]}),_.length>0&&(0,l.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,l.jsx)(O,{title:`Your payments`,line:`Every payment on this account, straight from Stripe.`}),(0,l.jsxs)(`div`,{className:`rounded-2xl border border-[var(--panel-border)]/60 divide-y divide-[var(--panel-border)]/60 overflow-hidden`,children:[(0,l.jsx)(k,{first:`What`,second:`When`}),_.map(e=>{let t=g(e.items,e.currency);return(0,l.jsx)(j,{rowKey:e.id,what:m(e),sub:v(e,t),when:y(e.created),amount:a.r(e.amount,e.currency),chip:f(e),bought:t,facts:x(e),receiptUrl:e.receiptUrl,open:E===e.id,onToggle:()=>A(e.id)},e.id)})]})]})]})})]})]})}function N(){let{user:e}=t.Ft(),{loading:n,subscriptions:r,payments:i,error:a}=t.Rn(),[o,s]=(0,u.useSearchParams)();return(0,l.jsx)(M,{email:e?.email||null,loading:n,subscriptions:r,payments:i,error:a,focus:o.get(`open`),onFocused:()=>s(e=>{let t=new URLSearchParams(e);return t.delete(`open`),t},{replace:!0})})}exports.Billing=N;
1
+ require(`./chunk-CiTBaPhY.cjs`);const e=require(`./PageTitle-DQkvCB11.cjs`),t=require(`./TimeZoneField-Ckn1pKAL.cjs`),n=require(`./DashboardNav-GgEUpyTa.cjs`),r=require(`./chevron-down-lyDK1rfL.cjs`),i=require(`./x-Ci8c5p6T.cjs`),a=require(`./transactions-CIU2NcKh.cjs`),o=require(`./ManagePlanButton-Buwfs2bU.cjs`),s=require(`./openOnArrival-FiXqw4WM.cjs`);let c=require(`react`),l=require(`react/jsx-runtime`),u=require(`react-router-dom`);function d(e){return e.status===`past_due`?{label:`Past due`,tone:`bad`}:e.active?{label:`Active`,tone:`good`}:{label:`Cancelled`,tone:`quiet`}}function f(e){return e.fullyRefunded?{label:`Refunded`,tone:`quiet`}:(e.amountRefunded||0)>0?{label:`Partly refunded`,tone:`good`}:e.paid?{label:`Paid`,tone:`good`}:{label:`Not paid`,tone:`quiet`}}function p(e){return!e.currentPeriodEnd||!e.active?``:e.cancelAtPeriodEnd?`Ends on ${y(e.currentPeriodEnd)}`:`Renews on ${y(e.currentPeriodEnd)}`}var m=e=>e.productName||e.description||`One-off payment`,h=e=>{if(/^and \d+ more$/i.test(e))return{words:e,price:``,quantity:0,more:!0};let t=e.lastIndexOf(` · `),n=t>0?e.slice(t+3).trim():``,r=/\d/.test(n),i=r?e.slice(0,t).trim():e,a=i.match(/^(\d+)\s*[×x]\s/);return{words:i,price:r?n:``,quantity:a?Number(a[1]):0,more:!1}};function g(e,t){let n=typeof e==`string`?e.trim():``;if(!n)return[];let r=a.c(n);return r&&typeof r==`object`?(Array.isArray(r)?r:[r]).filter(e=>!!e&&typeof e==`object`&&!Array.isArray(e)).map(e=>{let{words:n,price:r}=a.o(e,t),i=Number(e.quantity??e.qty);return{words:n,price:r,quantity:Number.isFinite(i)&&i>0?i:0,more:!1}}).filter(e=>e.words||e.price):n.split(`; `).map(e=>e.trim()).filter(Boolean).map(h)}function _(e){return!e.length||e.some(e=>e.more||!e.quantity)?null:e.reduce((e,t)=>e+t.quantity,0)}function v(e,t=g(e.items,e.currency)){let n=_(t),r=m(e),i=n&&n>1&&!/\bitems?\b/i.test(r)?`${n} items`:``;return[y(e.created),i].filter(Boolean).join(` · `)}var y=e=>e?new Date(e*1e3).toLocaleDateString(void 0,{day:`numeric`,month:`short`,year:`numeric`}):``,b=e=>e?new Date(e*1e3).toLocaleString(void 0,{day:`numeric`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`}):``;function x(e){let t=[];return e.created&&t.push([e.paid?`Paid on`:`Date`,b(e.created)]),e.paidWith&&t.push([`Paid with`,e.paidWith]),(e.amountRefunded||0)>0&&t.push([`Refunded`,a.r(e.amountRefunded,e.currency)]),t}function S(e){let t=[];return e.amount!=null&&e.currency&&t.push([`Billing`,`${a.r(e.amount,e.currency)}${e.interval?` every ${e.interval}`:``}`]),p(e)&&t.push([e.cancelAtPeriodEnd?`Ends on`:`Renews on`,y(e.currentPeriodEnd)]),e.quantity>1&&t.push([`Seats`,String(e.quantity)]),e.status===`past_due`&&t.push([`Card`,`Stripe is retrying your card — update it under Manage plan.`]),t}var C=`grid grid-cols-[minmax(0,1fr)_auto_1rem] md:grid-cols-[minmax(0,1.5fr)_6.5rem_7rem_8.5rem_1rem] gap-x-3 md:gap-x-6 px-4 md:px-5`,w=`${C} items-center`;function T({chip:e,className:t=``}){let n=e.tone===`good`?`bg-emerald-500`:e.tone===`bad`?`bg-red-500`:`bg-foreground/25`;return(0,l.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-[12.5px] font-medium text-foreground/60 leading-tight whitespace-nowrap ${t}`,children:[(0,l.jsx)(`span`,{"aria-hidden":`true`,className:`w-1.5 h-1.5 rounded-full shrink-0 ${n}`}),e.label]})}var E=`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-3`;function D({label:e,value:n}){return(0,l.jsxs)(`div`,{className:`min-w-0`,children:[(0,l.jsx)(`span`,{className:`${t.u} block leading-tight mb-0.5`,children:e}),(0,l.jsx)(`span`,{className:`block text-[13.5px] text-foreground/85 leading-snug break-words [overflow-wrap:anywhere]`,children:n})]})}function O({title:e,line:t,children:n}){return(0,l.jsxs)(`div`,{className:`flex items-center justify-between gap-3 flex-wrap px-1`,children:[(0,l.jsxs)(`div`,{className:`min-w-0`,children:[(0,l.jsx)(`p`,{className:`text-[14px] font-bold text-foreground leading-tight`,children:e}),(0,l.jsx)(`p`,{className:`text-[12px] font-medium text-foreground/45 leading-snug mt-0.5`,children:t})]}),n]})}function k({first:e,second:t}){return(0,l.jsxs)(`div`,{className:`max-md:hidden ${w} py-2.5 text-[11.5px] font-medium text-foreground/40`,children:[(0,l.jsx)(`span`,{children:e}),(0,l.jsx)(`span`,{children:t}),(0,l.jsx)(`span`,{children:`Status`}),(0,l.jsx)(`span`,{className:`text-right`,children:`Amount`}),(0,l.jsx)(`span`,{})]})}function A({lines:e}){return(0,l.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,l.jsx)(`h3`,{className:`px-4 md:px-5 ${t.u} block leading-tight mb-0.5`,children:`What you bought`}),e.map((e,t)=>(0,l.jsxs)(`div`,{className:`${C} items-baseline`,children:[(0,l.jsx)(`span`,{className:`md:col-span-3 min-w-0 leading-snug break-words [overflow-wrap:anywhere] ${e.more?`text-[13px] text-foreground/45`:`text-[13.5px] text-foreground/85`}`,children:e.words}),(0,l.jsx)(`span`,{className:`text-right text-[13.5px] text-foreground/85 tabular-nums whitespace-nowrap leading-snug`,children:e.price})]},t))]})}function j({rowKey:e,what:n,sub:i,when:a,amount:o,per:s,chip:c,bought:u=[],facts:d,receiptUrl:f,open:p,onToggle:m}){return(0,l.jsxs)(`div`,{"data-ledger-row":e,className:`scroll-mt-6 ${p?`bg-foreground/[0.02]`:``}`,children:[(0,l.jsxs)(`button`,{type:`button`,onClick:m,"aria-expanded":p,className:`w-full ${w} py-3 text-left cursor-pointer transition-colors hover:bg-foreground/[0.03]`,children:[(0,l.jsxs)(`span`,{className:`flex flex-col min-w-0 gap-0.5`,children:[(0,l.jsx)(`span`,{className:`text-[13.5px] font-bold text-foreground leading-tight truncate`,children:n}),(0,l.jsx)(`span`,{className:`md:hidden text-[12px] font-medium text-foreground/45 leading-tight truncate`,children:i})]}),(0,l.jsx)(`span`,{className:`max-md:hidden text-[12.5px] font-medium text-foreground/45 tabular-nums whitespace-nowrap truncate leading-tight`,children:a}),(0,l.jsx)(T,{chip:c,className:`max-md:hidden`}),(0,l.jsxs)(`span`,{className:`flex flex-col items-end gap-1 min-w-0`,children:[(0,l.jsxs)(`span`,{className:`text-[13.5px] font-semibold text-foreground tabular-nums whitespace-nowrap leading-tight`,children:[o||(0,l.jsx)(`span`,{className:`text-foreground/25 font-medium`,children:`—`}),o&&s&&(0,l.jsxs)(`span`,{className:`text-[12.5px] text-foreground/40 font-medium`,children:[` `,s]})]}),(0,l.jsx)(T,{chip:c,className:`md:hidden !text-[11.5px] !gap-1.5`})]}),(0,l.jsx)(r.t,{className:`w-4 h-4 text-foreground/35 shrink-0 justify-self-end transition-transform ${p?`rotate-180`:``}`})]}),(0,l.jsx)(t.rt,{initial:!1,children:p&&(0,l.jsx)(t.nt.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:t.w,className:`overflow-hidden`,children:(0,l.jsxs)(`div`,{className:`pb-4 md:pb-5 flex flex-col gap-4`,children:[(0,l.jsx)(`div`,{className:`mx-4 md:mx-5 border-t border-[var(--panel-border)]/50`}),u.length>0&&(0,l.jsx)(A,{lines:u}),d.length>0&&(0,l.jsx)(`div`,{className:`px-4 md:px-5 ${E}`,children:d.map(([e,t])=>(0,l.jsx)(D,{label:e,value:t},e))}),f&&(0,l.jsx)(`div`,{className:`mx-4 md:mx-5 border-t border-[var(--panel-border)]/50 pt-3`,children:(0,l.jsxs)(`a`,{href:f,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 text-[12.5px] font-bold text-accent hover:underline`,children:[`Stripe receipt`,(0,l.jsx)(t.Ot,{className:`w-3.5 h-3.5`})]})})]})})})]})}function M({email:r,loading:u,subscriptions:h,payments:_,error:b,initialOpen:C=null,focus:w=null,onFocused:T}){let[E,D]=(0,c.useState)(C),A=e=>D(t=>t===e?null:e),M=!u&&!b&&h.length===0&&_.length===0;return s.t(w,!u&&!!w&&(_.some(e=>e.id===w)||h.some(e=>e.id===w)),D,T),(0,l.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 pt-2 md:p-8 md:pt-4 z-10 flex flex-col min-h-screen`,children:[(0,l.jsxs)(t.nt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-6`,children:[(0,l.jsx)(e.t,{children:`Billing`}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]`,children:[(0,l.jsx)(`span`,{className:`w-8 h-[1px] bg-foreground/10`}),`/billing`]})]}),(0,l.jsxs)(`div`,{className:`flex flex-col gap-6 flex-1 pb-16`,children:[(0,l.jsx)(n.t,{}),(0,l.jsx)(`div`,{className:`glass-panel border border-[var(--panel-border)] rounded-3xl p-4 sm:p-5 md:p-8 shadow-2xl relative bg-background flex flex-col fbos-tab-fill min-h-[400px] gap-6`,children:u?(0,l.jsx)(`div`,{className:`flex items-center justify-center flex-1 text-foreground/40 py-16`,children:(0,l.jsx)(i.r,{className:`w-6 h-6 animate-spin text-accent`})}):b?(0,l.jsx)(t.h,{tone:`error`,children:b}):M?(0,l.jsxs)(`div`,{className:`flex flex-col items-center justify-center flex-1 gap-3 py-16 text-center`,children:[(0,l.jsx)(n.D,{className:`w-8 h-8 text-foreground/20`}),(0,l.jsxs)(`p`,{className:`text-[13px] font-medium text-foreground/50 max-w-md leading-relaxed`,children:[`Nothing has been bought on this account`,r?(0,l.jsxs)(l.Fragment,{children:[` — `,(0,l.jsx)(`span`,{className:`text-foreground/70`,children:r})]}):null,`. A payment made with a different email address at checkout lives with that email: sign in with the address you paid with to see it here.`]})]}):(0,l.jsxs)(l.Fragment,{children:[h.length>0&&(0,l.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,l.jsx)(O,{title:h.length===1?`Your plan`:`Your plans`,line:`Change card, switch or cancel on Stripe's own page.`,children:(0,l.jsx)(o.t,{variant:`secondary`,className:`h-9 px-3.5 text-[12.5px] font-semibold`})}),(0,l.jsxs)(`div`,{className:`rounded-2xl border border-[var(--panel-border)]/60 divide-y divide-[var(--panel-border)]/60 overflow-hidden`,children:[(0,l.jsx)(k,{first:`Plan`,second:`Renews`}),h.map(e=>{let t=d(e),n=p(e),r=e.amount!=null&&e.currency?a.r(e.amount,e.currency):``;return(0,l.jsx)(j,{rowKey:e.id,what:e.productName||`Subscription`,sub:n||t.label,when:n?y(e.currentPeriodEnd):`—`,amount:r,per:e.interval?`/ ${e.interval}`:``,chip:t,facts:S(e),open:E===e.id,onToggle:()=>A(e.id)},e.id)})]})]}),_.length>0&&(0,l.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,l.jsx)(O,{title:`Your payments`,line:`Every payment on this account, straight from Stripe.`}),(0,l.jsxs)(`div`,{className:`rounded-2xl border border-[var(--panel-border)]/60 divide-y divide-[var(--panel-border)]/60 overflow-hidden`,children:[(0,l.jsx)(k,{first:`What`,second:`When`}),_.map(e=>{let t=g(e.items,e.currency);return(0,l.jsx)(j,{rowKey:e.id,what:m(e),sub:v(e,t),when:y(e.created),amount:a.r(e.amount,e.currency),chip:f(e),bought:t,facts:x(e),receiptUrl:e.receiptUrl,open:E===e.id,onToggle:()=>A(e.id)},e.id)})]})]})]})})]})]})}function N(){let{user:e}=t.Ft(),{loading:n,subscriptions:r,payments:i,error:a}=t.Rn(),[o,s]=(0,u.useSearchParams)();return(0,l.jsx)(M,{email:e?.email||null,loading:n,subscriptions:r,payments:i,error:a,focus:o.get(`open`),onFocused:()=>s(e=>{let t=new URLSearchParams(e);return t.delete(`open`),t},{replace:!0})})}exports.Billing=N;
@@ -1,10 +1,10 @@
1
- import { t as e } from "./PageTitle-DFGW71q8.js";
2
- import { Ft as t, Ot as n, Rn as r, h as i, nt as a, rt as o, u as s, w as c } from "./TimeZoneField-Dv389mAe.js";
3
- import { D as l, t as u } from "./DashboardNav-B0G943ux.js";
1
+ import { t as e } from "./PageTitle-DCoUQWw6.js";
2
+ import { Ft as t, Ot as n, Rn as r, h as i, nt as a, rt as o, u as s, w as c } from "./TimeZoneField-oIMwb5_X.js";
3
+ import { D as l, t as u } from "./DashboardNav-CEd8gGPm.js";
4
4
  import { t as d } from "./chevron-down--LwXEv9w.js";
5
5
  import { r as f } from "./x-hax8aKt8.js";
6
6
  import { c as p, o as m, r as h } from "./transactions-ycKW6zHa.js";
7
- import { t as g } from "./ManagePlanButton-CNLCxK-o.js";
7
+ import { t as g } from "./ManagePlanButton-CE4uyh_7.js";
8
8
  import { t as _ } from "./openOnArrival-CtSqdQ8L.js";
9
9
  import { useState as v } from "react";
10
10
  import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
@@ -1 +1 @@
1
- require(`./chunk-CiTBaPhY.cjs`);const e=require(`./TimeZoneField-zR8N2Fj0.cjs`),t=require(`./schedule-BAea6q8_.cjs`),n=require(`./chevron-down-lyDK1rfL.cjs`),r=require(`./chevron-left-DHTPst5Z.cjs`);let i=require(`react`),a=require(`react/jsx-runtime`);var o={name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]};o.node;var s=n.n(o);function c({timeZone:n,onTimeZone:r,action:o}){let[s,c]=(0,i.useState)(!1);return(0,a.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,a.jsxs)(`div`,{className:`flex gap-3 ${o?`max-sm:flex-col max-sm:items-stretch sm:items-center sm:justify-between`:``}`,children:[(0,a.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[12px] font-medium text-foreground/50`,children:[(0,a.jsx)(e.Dt,{className:`w-3.5 h-3.5 text-foreground/35 shrink-0`,"aria-hidden":!0}),(0,a.jsxs)(`span`,{children:[`Times in `,t.nn(n),` · `,(0,a.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`text-accent font-semibold hover:underline cursor-pointer`,children:s?`Done`:`Change`})]})]}),o]}),s&&(0,a.jsx)(e.t,{compact:!0,value:n,onChange:e=>{r(e),c(!1)}})]})}var l=(e,t)=>!!e&&e.memberId===t.memberId&&e.start===t.start&&e.scheduleId===t.scheduleId,u=`relative flex flex-col items-center justify-center w-full min-h-11 px-3 py-2 rounded-[var(--input-radius,0.75rem)] border text-[14px] font-semibold transition-all duration-200 cursor-pointer`;function d({slots:n,value:r,onChange:i,timeZone:o,members:s,together:c}){let d=!c&&new Set(s.map(e=>e.memberId)).size>1,f=e=>(s.find(t=>t.id===e.scheduleId)||s.find(t=>t.memberId===e.memberId))?.memberName.trim()||``;return n.length?(0,a.jsx)(`div`,{className:`grid gap-2 [grid-template-columns:repeat(auto-fill,minmax(96px,1fr))]`,role:`listbox`,"aria-label":`Free times`,children:n.map(n=>{let s=l(r,n),c=t.st(new Date(n.start),o),p=d?f(n):``;return(0,a.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":s,"aria-label":p?`${c} with ${p}`:c,onClick:()=>i(s?null:n),className:`${u} ${s?`bg-accent border-accent text-[var(--button-fg,#fff)] shadow-md shadow-accent/25`:`border-[var(--panel-border)] bg-transparent text-foreground/75 hover:border-accent/50 hover:text-foreground hover:bg-foreground/[0.04] active:scale-[0.98]`}`,children:[s&&(0,a.jsx)(e.At,{className:`absolute left-2.5 w-3.5 h-3.5`,"aria-hidden":!0}),(0,a.jsx)(`span`,{className:`tabular-nums`,children:c}),p&&(0,a.jsx)(`span`,{className:`text-[11px] font-medium leading-tight ${s?`opacity-90`:`text-foreground/50`}`,children:p})]},`${t.qt(n.memberId,n.start)}__${n.scheduleId}`)})}):null}function f(e,n,r,a,o){let s=(0,i.useMemo)(()=>t.ct(t.Qt(e,{now:a?a():new Date,taken:n},!!o),r),[e,n,r,a,o]),c=o&&e.length?t.Et(e).reduce((e,t)=>Math.min(e,t.horizonDays),1/0):e.reduce((e,t)=>Math.max(e,t.horizonDays),0);return{days:s,horizon:Number.isFinite(c)?c:0}}var p=(e,n)=>e?t.cn(new Date(e.start),n).dateKey:``;function m({horizon:e}){return(0,a.jsx)(`p`,{className:`text-[13px] font-medium text-foreground/50 py-2`,children:e?`No free times in the next ${e} days.`:`No free times at the moment.`})}function h({members:e,value:t,onChange:n,taken:r,timeZone:o,onTimeZone:s,now:l,together:u}){let{days:h,horizon:g}=f(e,r,o,l,u),[_,v]=(0,i.useState)({tz:o,day:``}),y=_.tz===o?_.day:``,b=(h.some(e=>e.dateKey===y)?y:``)||p(t,o)||h[0]?.dateKey||``,x=h.find(e=>e.dateKey===b)||h[0];return(0,a.jsxs)(`div`,{className:`flex flex-col gap-3 w-full`,children:[h.length===0?(0,a.jsx)(m,{horizon:g}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{className:`flex gap-2 overflow-x-auto no-scrollbar pb-1 -mx-1 px-1`,role:`tablist`,"aria-label":`Days with free times`,children:h.map(e=>{let t=e.dateKey===x?.dateKey;return(0,a.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t,onClick:()=>v({tz:o,day:e.dateKey}),className:`shrink-0 px-3.5 py-2 rounded-xl text-[13px] font-semibold whitespace-nowrap transition-all cursor-pointer glass-panel ${t?`bg-accent text-[var(--button-fg,#fff)] border-accent shadow-lg shadow-accent/20`:`text-foreground/70 hover:text-foreground hover:border-accent`}`,style:{borderRadius:`var(--input-radius, 0.75rem)`},children:e.label},e.dateKey)})}),x&&(0,a.jsx)(d,{slots:x.slots,value:t,onChange:n,timeZone:o,members:e,together:u})]}),(0,a.jsx)(c,{timeZone:o,onTimeZone:s})]})}var g=[`M`,`T`,`W`,`T`,`F`,`S`,`S`],_=`rounded-2xl border border-[var(--panel-border)]/60 bg-foreground/[0.015] overflow-hidden`,v=`flex items-center justify-between gap-2 px-3.5 py-2.5 border-b border-[var(--panel-border)]/40`,y=`w-8 h-8 rounded-xl border border-[var(--panel-border)]/60 flex items-center justify-center shrink-0 text-foreground/50 hover:text-foreground hover:border-accent/40 hover:bg-foreground/5 active:scale-[0.98] transition-all cursor-pointer`;function b(...e){let t=(0,i.useRef)(null),[n,r]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=t.current;if(!e)return;let n=()=>r(e.scrollTop+e.clientHeight<e.scrollHeight-2);n(),e.addEventListener(`scroll`,n,{passive:!0});let i=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return i?.observe(e),()=>{e.removeEventListener(`scroll`,n),i?.disconnect()}},e),{ref:t,moreBelow:n}}var x=()=>(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-px bottom-px h-10 rounded-b-2xl bg-gradient-to-t from-[var(--bg-color)] to-transparent`}),S=e=>e.slice(0,7);function C(e){let n=`${e}-01`,r=t.l.indexOf(t.sn(n)),i=Array.from({length:r},()=>null);for(let r=0;;r++){let a=t.w(n,r);if(S(a)!==e)break;i.push(a)}return i}function w({members:n,value:o,onChange:l,taken:u,timeZone:h,onTimeZone:w,now:T,together:E}){let{days:D,horizon:O}=f(n,u,h,T,E),k=t.cn(T?T():new Date,h).dateKey,A=new Map(D.map(e=>[e.dateKey,e])),j=p(o,h),[M,N]=(0,i.useState)(()=>({tz:h,day:j,month:S(j||D[0]?.dateKey||k)})),P=M.tz===h,F=P?M.day:j,I=P?M.month:S(j||D[0]?.dateKey||k),L=e=>N({tz:h,day:F,month:e(I)}),R=e=>N({tz:h,day:e,month:I}),z=F?A.get(F):void 0,B=C(I),V=z?.slots.length||0,{ref:H,moreBelow:U}=b(V,F);return(0,a.jsxs)(`div`,{className:`flex flex-col gap-4 w-full`,children:[D.length===0&&(0,a.jsx)(m,{horizon:O}),(0,a.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-[minmax(0,1.15fr)_minmax(0,1fr)] gap-3 md:gap-4 w-full md:items-stretch`,children:[(0,a.jsxs)(`div`,{className:`${_} w-full min-w-0`,children:[(0,a.jsxs)(`div`,{className:v,children:[(0,a.jsx)(`h4`,{className:`text-[14px] font-bold text-foreground tracking-tight truncate`,children:t.wt(I)}),(0,a.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,a.jsx)(`button`,{type:`button`,onClick:()=>L(()=>S(k)),className:`h-8 px-3 rounded-xl border border-[var(--panel-border)]/60 text-[12.5px] font-semibold text-foreground/60 hover:text-foreground hover:border-accent/40 hover:bg-foreground/5 active:scale-[0.98] transition-all cursor-pointer`,children:`Today`}),(0,a.jsx)(`button`,{type:`button`,"aria-label":`Previous month`,onClick:()=>L(e=>t.Kt(e,-1)),className:y,children:(0,a.jsx)(r.t,{className:`w-4 h-4`})}),(0,a.jsx)(`button`,{type:`button`,"aria-label":`Next month`,onClick:()=>L(e=>t.Kt(e,1)),className:y,children:(0,a.jsx)(e.kt,{className:`w-4 h-4`})})]})]}),(0,a.jsx)(`div`,{className:`p-3`,children:(0,a.jsxs)(`div`,{className:`grid grid-cols-7 gap-1 w-full max-w-[26rem] mx-auto`,role:`grid`,"aria-label":t.wt(I),children:[g.map((e,t)=>(0,a.jsx)(`div`,{className:`text-center text-[10.5px] font-bold uppercase tracking-wider text-foreground/35 pb-1`,children:e},t)),B.map((e,t)=>{if(!e)return(0,a.jsx)(`div`,{"aria-hidden":!0},`blank-${t}`);let n=A.has(e),r=e===F,i=e===k,o=Number(e.slice(8,10));return(0,a.jsxs)(`button`,{type:`button`,role:`gridcell`,"aria-label":A.get(e)?.label||e,"aria-selected":r,"aria-disabled":!n,disabled:!n,onClick:()=>R(e),className:`relative flex items-center justify-center h-10 md:h-11 rounded-xl text-[13.5px] md:text-[14px] font-semibold tabular-nums transition-all ${r?`bg-accent text-[var(--button-fg,#fff)] shadow-md shadow-accent/25 cursor-pointer`:n?`text-foreground hover:bg-foreground/[0.06] cursor-pointer`:`text-foreground/25 cursor-default`} ${i&&!r?`ring-1 ring-inset ring-accent/45`:``}`,children:[o,n&&(0,a.jsx)(`span`,{"aria-hidden":!0,className:`absolute bottom-1 w-1 h-1 rounded-full ${r?`bg-[var(--button-fg,#fff)]`:`bg-accent`}`})]},e)})]})})]}),(0,a.jsx)(`div`,{className:`w-full min-w-0 md:relative md:min-h-[320px]`,children:(0,a.jsxs)(`div`,{className:`${_} flex flex-col md:absolute md:inset-0`,children:[(0,a.jsxs)(`div`,{className:v,children:[(0,a.jsx)(`p`,{className:`text-[13px] font-bold text-foreground tracking-tight truncate`,children:z?z.label:`Pick a day`}),V>0&&(0,a.jsxs)(`span`,{className:`text-[11.5px] font-semibold text-foreground/40 shrink-0 tabular-nums`,children:[V,` `,V===1?`time`:`times`]})]}),(0,a.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[(0,a.jsx)(`div`,{ref:H,className:`p-3 h-full overflow-y-auto styled-scrollbars-mini`,children:z?(0,a.jsx)(d,{slots:z.slots,value:o,onChange:l,timeZone:h,members:n,together:E}):(0,a.jsxs)(`div`,{className:`flex flex-col items-center justify-center text-center gap-2 py-8 px-2`,children:[(0,a.jsx)(s,{className:`w-5 h-5 text-foreground/25`,"aria-hidden":!0}),(0,a.jsx)(`p`,{className:`text-[12.5px] font-medium text-foreground/45 leading-relaxed`,children:D.length>0?`Pick a day with a dot to see its times.`:`No times to show.`})]})}),U&&(0,a.jsx)(x,{})]})]})})]}),(0,a.jsx)(c,{timeZone:h,onTimeZone:w})]})}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return c}});
1
+ require(`./chunk-CiTBaPhY.cjs`);const e=require(`./TimeZoneField-Ckn1pKAL.cjs`),t=require(`./schedule-BAea6q8_.cjs`),n=require(`./chevron-down-lyDK1rfL.cjs`),r=require(`./chevron-left-DHTPst5Z.cjs`);let i=require(`react`),a=require(`react/jsx-runtime`);var o={name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]};o.node;var s=n.n(o);function c({timeZone:n,onTimeZone:r,action:o}){let[s,c]=(0,i.useState)(!1);return(0,a.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,a.jsxs)(`div`,{className:`flex gap-3 ${o?`max-sm:flex-col max-sm:items-stretch sm:items-center sm:justify-between`:``}`,children:[(0,a.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[12px] font-medium text-foreground/50`,children:[(0,a.jsx)(e.Dt,{className:`w-3.5 h-3.5 text-foreground/35 shrink-0`,"aria-hidden":!0}),(0,a.jsxs)(`span`,{children:[`Times in `,t.nn(n),` · `,(0,a.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`text-accent font-semibold hover:underline cursor-pointer`,children:s?`Done`:`Change`})]})]}),o]}),s&&(0,a.jsx)(e.t,{compact:!0,value:n,onChange:e=>{r(e),c(!1)}})]})}var l=(e,t)=>!!e&&e.memberId===t.memberId&&e.start===t.start&&e.scheduleId===t.scheduleId,u=`relative flex flex-col items-center justify-center w-full min-h-11 px-3 py-2 rounded-[var(--input-radius,0.75rem)] border text-[14px] font-semibold transition-all duration-200 cursor-pointer`;function d({slots:n,value:r,onChange:i,timeZone:o,members:s,together:c}){let d=!c&&new Set(s.map(e=>e.memberId)).size>1,f=e=>(s.find(t=>t.id===e.scheduleId)||s.find(t=>t.memberId===e.memberId))?.memberName.trim()||``;return n.length?(0,a.jsx)(`div`,{className:`grid gap-2 [grid-template-columns:repeat(auto-fill,minmax(96px,1fr))]`,role:`listbox`,"aria-label":`Free times`,children:n.map(n=>{let s=l(r,n),c=t.st(new Date(n.start),o),p=d?f(n):``;return(0,a.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":s,"aria-label":p?`${c} with ${p}`:c,onClick:()=>i(s?null:n),className:`${u} ${s?`bg-accent border-accent text-[var(--button-fg,#fff)] shadow-md shadow-accent/25`:`border-[var(--panel-border)] bg-transparent text-foreground/75 hover:border-accent/50 hover:text-foreground hover:bg-foreground/[0.04] active:scale-[0.98]`}`,children:[s&&(0,a.jsx)(e.At,{className:`absolute left-2.5 w-3.5 h-3.5`,"aria-hidden":!0}),(0,a.jsx)(`span`,{className:`tabular-nums`,children:c}),p&&(0,a.jsx)(`span`,{className:`text-[11px] font-medium leading-tight ${s?`opacity-90`:`text-foreground/50`}`,children:p})]},`${t.qt(n.memberId,n.start)}__${n.scheduleId}`)})}):null}function f(e,n,r,a,o){let s=(0,i.useMemo)(()=>t.ct(t.Qt(e,{now:a?a():new Date,taken:n},!!o),r),[e,n,r,a,o]),c=o&&e.length?t.Et(e).reduce((e,t)=>Math.min(e,t.horizonDays),1/0):e.reduce((e,t)=>Math.max(e,t.horizonDays),0);return{days:s,horizon:Number.isFinite(c)?c:0}}var p=(e,n)=>e?t.cn(new Date(e.start),n).dateKey:``;function m({horizon:e}){return(0,a.jsx)(`p`,{className:`text-[13px] font-medium text-foreground/50 py-2`,children:e?`No free times in the next ${e} days.`:`No free times at the moment.`})}function h({members:e,value:t,onChange:n,taken:r,timeZone:o,onTimeZone:s,now:l,together:u}){let{days:h,horizon:g}=f(e,r,o,l,u),[_,v]=(0,i.useState)({tz:o,day:``}),y=_.tz===o?_.day:``,b=(h.some(e=>e.dateKey===y)?y:``)||p(t,o)||h[0]?.dateKey||``,x=h.find(e=>e.dateKey===b)||h[0];return(0,a.jsxs)(`div`,{className:`flex flex-col gap-3 w-full`,children:[h.length===0?(0,a.jsx)(m,{horizon:g}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{className:`flex gap-2 overflow-x-auto no-scrollbar pb-1 -mx-1 px-1`,role:`tablist`,"aria-label":`Days with free times`,children:h.map(e=>{let t=e.dateKey===x?.dateKey;return(0,a.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t,onClick:()=>v({tz:o,day:e.dateKey}),className:`shrink-0 px-3.5 py-2 rounded-xl text-[13px] font-semibold whitespace-nowrap transition-all cursor-pointer glass-panel ${t?`bg-accent text-[var(--button-fg,#fff)] border-accent shadow-lg shadow-accent/20`:`text-foreground/70 hover:text-foreground hover:border-accent`}`,style:{borderRadius:`var(--input-radius, 0.75rem)`},children:e.label},e.dateKey)})}),x&&(0,a.jsx)(d,{slots:x.slots,value:t,onChange:n,timeZone:o,members:e,together:u})]}),(0,a.jsx)(c,{timeZone:o,onTimeZone:s})]})}var g=[`M`,`T`,`W`,`T`,`F`,`S`,`S`],_=`rounded-2xl border border-[var(--panel-border)]/60 bg-foreground/[0.015] overflow-hidden`,v=`flex items-center justify-between gap-2 px-3.5 py-2.5 border-b border-[var(--panel-border)]/40`,y=`w-8 h-8 rounded-xl border border-[var(--panel-border)]/60 flex items-center justify-center shrink-0 text-foreground/50 hover:text-foreground hover:border-accent/40 hover:bg-foreground/5 active:scale-[0.98] transition-all cursor-pointer`;function b(...e){let t=(0,i.useRef)(null),[n,r]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=t.current;if(!e)return;let n=()=>r(e.scrollTop+e.clientHeight<e.scrollHeight-2);n(),e.addEventListener(`scroll`,n,{passive:!0});let i=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return i?.observe(e),()=>{e.removeEventListener(`scroll`,n),i?.disconnect()}},e),{ref:t,moreBelow:n}}var x=()=>(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-px bottom-px h-10 rounded-b-2xl bg-gradient-to-t from-[var(--bg-color)] to-transparent`}),S=e=>e.slice(0,7);function C(e){let n=`${e}-01`,r=t.l.indexOf(t.sn(n)),i=Array.from({length:r},()=>null);for(let r=0;;r++){let a=t.w(n,r);if(S(a)!==e)break;i.push(a)}return i}function w({members:n,value:o,onChange:l,taken:u,timeZone:h,onTimeZone:w,now:T,together:E}){let{days:D,horizon:O}=f(n,u,h,T,E),k=t.cn(T?T():new Date,h).dateKey,A=new Map(D.map(e=>[e.dateKey,e])),j=p(o,h),[M,N]=(0,i.useState)(()=>({tz:h,day:j,month:S(j||D[0]?.dateKey||k)})),P=M.tz===h,F=P?M.day:j,I=P?M.month:S(j||D[0]?.dateKey||k),L=e=>N({tz:h,day:F,month:e(I)}),R=e=>N({tz:h,day:e,month:I}),z=F?A.get(F):void 0,B=C(I),V=z?.slots.length||0,{ref:H,moreBelow:U}=b(V,F);return(0,a.jsxs)(`div`,{className:`flex flex-col gap-4 w-full`,children:[D.length===0&&(0,a.jsx)(m,{horizon:O}),(0,a.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-[minmax(0,1.15fr)_minmax(0,1fr)] gap-3 md:gap-4 w-full md:items-stretch`,children:[(0,a.jsxs)(`div`,{className:`${_} w-full min-w-0`,children:[(0,a.jsxs)(`div`,{className:v,children:[(0,a.jsx)(`h4`,{className:`text-[14px] font-bold text-foreground tracking-tight truncate`,children:t.wt(I)}),(0,a.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,a.jsx)(`button`,{type:`button`,onClick:()=>L(()=>S(k)),className:`h-8 px-3 rounded-xl border border-[var(--panel-border)]/60 text-[12.5px] font-semibold text-foreground/60 hover:text-foreground hover:border-accent/40 hover:bg-foreground/5 active:scale-[0.98] transition-all cursor-pointer`,children:`Today`}),(0,a.jsx)(`button`,{type:`button`,"aria-label":`Previous month`,onClick:()=>L(e=>t.Kt(e,-1)),className:y,children:(0,a.jsx)(r.t,{className:`w-4 h-4`})}),(0,a.jsx)(`button`,{type:`button`,"aria-label":`Next month`,onClick:()=>L(e=>t.Kt(e,1)),className:y,children:(0,a.jsx)(e.kt,{className:`w-4 h-4`})})]})]}),(0,a.jsx)(`div`,{className:`p-3`,children:(0,a.jsxs)(`div`,{className:`grid grid-cols-7 gap-1 w-full max-w-[26rem] mx-auto`,role:`grid`,"aria-label":t.wt(I),children:[g.map((e,t)=>(0,a.jsx)(`div`,{className:`text-center text-[10.5px] font-bold uppercase tracking-wider text-foreground/35 pb-1`,children:e},t)),B.map((e,t)=>{if(!e)return(0,a.jsx)(`div`,{"aria-hidden":!0},`blank-${t}`);let n=A.has(e),r=e===F,i=e===k,o=Number(e.slice(8,10));return(0,a.jsxs)(`button`,{type:`button`,role:`gridcell`,"aria-label":A.get(e)?.label||e,"aria-selected":r,"aria-disabled":!n,disabled:!n,onClick:()=>R(e),className:`relative flex items-center justify-center h-10 md:h-11 rounded-xl text-[13.5px] md:text-[14px] font-semibold tabular-nums transition-all ${r?`bg-accent text-[var(--button-fg,#fff)] shadow-md shadow-accent/25 cursor-pointer`:n?`text-foreground hover:bg-foreground/[0.06] cursor-pointer`:`text-foreground/25 cursor-default`} ${i&&!r?`ring-1 ring-inset ring-accent/45`:``}`,children:[o,n&&(0,a.jsx)(`span`,{"aria-hidden":!0,className:`absolute bottom-1 w-1 h-1 rounded-full ${r?`bg-[var(--button-fg,#fff)]`:`bg-accent`}`})]},e)})]})})]}),(0,a.jsx)(`div`,{className:`w-full min-w-0 md:relative md:min-h-[320px]`,children:(0,a.jsxs)(`div`,{className:`${_} flex flex-col md:absolute md:inset-0`,children:[(0,a.jsxs)(`div`,{className:v,children:[(0,a.jsx)(`p`,{className:`text-[13px] font-bold text-foreground tracking-tight truncate`,children:z?z.label:`Pick a day`}),V>0&&(0,a.jsxs)(`span`,{className:`text-[11.5px] font-semibold text-foreground/40 shrink-0 tabular-nums`,children:[V,` `,V===1?`time`:`times`]})]}),(0,a.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[(0,a.jsx)(`div`,{ref:H,className:`p-3 h-full overflow-y-auto styled-scrollbars-mini`,children:z?(0,a.jsx)(d,{slots:z.slots,value:o,onChange:l,timeZone:h,members:n,together:E}):(0,a.jsxs)(`div`,{className:`flex flex-col items-center justify-center text-center gap-2 py-8 px-2`,children:[(0,a.jsx)(s,{className:`w-5 h-5 text-foreground/25`,"aria-hidden":!0}),(0,a.jsx)(`p`,{className:`text-[12.5px] font-medium text-foreground/45 leading-relaxed`,children:D.length>0?`Pick a day with a dot to see its times.`:`No times to show.`})]})}),U&&(0,a.jsx)(x,{})]})]})})]}),(0,a.jsx)(c,{timeZone:h,onTimeZone:w})]})}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return c}});
@@ -1,4 +1,4 @@
1
- import { At as e, Dt as t, kt as n, t as r } from "./TimeZoneField-Dv389mAe.js";
1
+ import { At as e, Dt as t, kt as n, t as r } from "./TimeZoneField-oIMwb5_X.js";
2
2
  import { Et as i, Kt as a, Qt as o, cn as s, ct as c, l, nn as u, qt as d, sn as f, st as p, w as m, wt as h } from "./schedule-C13m_kiO.js";
3
3
  import { n as g } from "./chevron-down--LwXEv9w.js";
4
4
  import { t as _ } from "./chevron-left-By8iIdje.js";
@@ -1,4 +1,4 @@
1
- import { $ as e, nt as t } from "./TimeZoneField-Dv389mAe.js";
1
+ import { $ as e, nt as t } from "./TimeZoneField-oIMwb5_X.js";
2
2
  import n from "react";
3
3
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
4
  //#region src/components/Button.tsx
@@ -1 +1 @@
1
- const e=require(`./chunk-CiTBaPhY.cjs`),t=require(`./TimeZoneField-zR8N2Fj0.cjs`);let n=require(`react`);n=e.a(n,1);let r=require(`react/jsx-runtime`);var i=n.default.forwardRef(({className:e,variant:n=`primary`,isLoading:i,children:a,...o},s)=>(0,r.jsxs)(t.nt.button,{ref:s,whileHover:{scale:1.02,y:-2},whileTap:{scale:.98},className:t.$(`fbos-motion relative inline-flex items-center justify-center px-5 py-2 text-sm font-medium duration-300 overflow-hidden group`,{primary:`btn-primary !border-none`,secondary:`btn-secondary !border-none`,ghost:`bg-transparent hover:bg-black/5 dark:hover:bg-white/5 text-foreground/60 hover:text-foreground transition-colors duration-300 !border-none`}[n],e),style:{borderRadius:`var(--btn-radius, 0.75rem)`},...o,disabled:i||o.disabled,"aria-busy":i||void 0,children:[i?(0,r.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,r.jsxs)(`svg`,{className:`w-5 h-5 animate-spin text-current`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,r.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,r.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}):null,(0,r.jsx)(`span`,{className:t.$(`inline-flex items-center justify-center gap-2`,i&&`opacity-0`),children:a})]}));i.displayName=`Button`,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
1
+ const e=require(`./chunk-CiTBaPhY.cjs`),t=require(`./TimeZoneField-Ckn1pKAL.cjs`);let n=require(`react`);n=e.a(n,1);let r=require(`react/jsx-runtime`);var i=n.default.forwardRef(({className:e,variant:n=`primary`,isLoading:i,children:a,...o},s)=>(0,r.jsxs)(t.nt.button,{ref:s,whileHover:{scale:1.02,y:-2},whileTap:{scale:.98},className:t.$(`fbos-motion relative inline-flex items-center justify-center px-5 py-2 text-sm font-medium duration-300 overflow-hidden group`,{primary:`btn-primary !border-none`,secondary:`btn-secondary !border-none`,ghost:`bg-transparent hover:bg-black/5 dark:hover:bg-white/5 text-foreground/60 hover:text-foreground transition-colors duration-300 !border-none`}[n],e),style:{borderRadius:`var(--btn-radius, 0.75rem)`},...o,disabled:i||o.disabled,"aria-busy":i||void 0,children:[i?(0,r.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,r.jsxs)(`svg`,{className:`w-5 h-5 animate-spin text-current`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,r.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,r.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}):null,(0,r.jsx)(`span`,{className:t.$(`inline-flex items-center justify-center gap-2`,i&&`opacity-0`),children:a})]}));i.displayName=`Button`,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
@@ -1 +1 @@
1
- require(`./chunk-CiTBaPhY.cjs`);const e=require(`./TimeZoneField-zR8N2Fj0.cjs`),t=require(`./x-Ci8c5p6T.cjs`),n=require(`./Popup-nq7YNM4N.cjs`),r=require(`./Button-PyTaaoyu.cjs`);let i=require(`react`),a=require(`react/jsx-runtime`),o=require(`react-dom`);var s=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`;function c({isOpen:c,title:l,message:u,confirmText:d=`Delete`,cancelText:f=`Cancel`,onConfirm:p,onCancel:m,isProcessing:h=!1,disableConfirm:g=!1}){let _=(0,i.useRef)(null),v=(0,i.useRef)(m),y=(0,i.useRef)(h);if((0,i.useEffect)(()=>{v.current=m,y.current=h}),(0,i.useEffect)(()=>{if(!c)return;let e=document.body.style.overflow;document.body.style.overflow=`hidden`;let t=document.activeElement,n=window.setTimeout(()=>{_.current&&!_.current.contains(document.activeElement)&&_.current.focus()},0),r=e=>{if(e.defaultPrevented)return;if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),y.current||v.current();return}if(e.key!==`Tab`||!_.current)return;e.stopPropagation();let t=Array.from(_.current.querySelectorAll(s)).filter(e=>e.offsetParent!==null||e===document.activeElement);if(!t.length){e.preventDefault();return}let n=t[0],r=t[t.length-1],i=document.activeElement;e.shiftKey&&(i===n||i===_.current)?(e.preventDefault(),r.focus()):!e.shiftKey&&i===r&&(e.preventDefault(),n.focus())};return window.addEventListener(`keydown`,r,!0),()=>{window.clearTimeout(n),window.removeEventListener(`keydown`,r,!0),document.body.style.overflow=e,t&&document.contains(t)&&t.focus({preventScroll:!0})}},[c]),typeof document>`u`)return null;let b=n.n()>0;return(0,o.createPortal)((0,a.jsx)(e.rt,{children:c&&(0,a.jsxs)(`div`,{className:`fixed inset-0 z-[9999] flex items-center justify-center p-4`,children:[(0,a.jsx)(e.nt.div,{onClick:()=>!h&&m(),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`absolute inset-0 cursor-pointer ${b?`bg-background/60`:`bg-background/80 backdrop-blur-xl`}`}),(0,a.jsx)(e.nt.div,{ref:_,role:`dialog`,"aria-modal":`true`,"aria-label":l,tabIndex:-1,initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.18,ease:[.16,1,.3,1]},className:`w-full max-w-[400px] p-6 rounded-3xl glass-popover border border-[var(--panel-border)] shadow-2xl relative z-10 text-center outline-none`,children:(0,a.jsxs)(`div`,{className:`w-full flex flex-col items-center`,children:[(0,a.jsx)(`h3`,{className:`text-xl font-bold mb-2 text-foreground tracking-tight`,children:l}),(0,a.jsx)(`p`,{className:`w-full text-[14px] font-medium text-foreground/60 leading-relaxed mb-6 break-words`,children:u}),(0,a.jsxs)(`div`,{className:`flex items-center gap-3 w-full`,children:[(0,a.jsx)(r.t,{variant:`secondary`,onClick:m,disabled:h,className:`flex-1 py-2.5 text-[13px] font-bold rounded-xl`,children:f}),(0,a.jsx)(r.t,{onClick:p,disabled:h||g,className:`flex-1 py-2.5 text-[13px] font-bold rounded-xl bg-red-500 hover:bg-red-600 border-none text-white shadow-xl hover:shadow-red-500/20 glow-hover`,children:h?(0,a.jsx)(t.r,{className:`w-5 h-5 animate-spin mx-auto`}):d})]})]})})]})}),document.body)}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
1
+ require(`./chunk-CiTBaPhY.cjs`);const e=require(`./TimeZoneField-Ckn1pKAL.cjs`),t=require(`./x-Ci8c5p6T.cjs`),n=require(`./Popup-COnHpbrY.cjs`),r=require(`./Button-Ccy4wFZ1.cjs`);let i=require(`react`),a=require(`react/jsx-runtime`),o=require(`react-dom`);var s=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`;function c({isOpen:c,title:l,message:u,confirmText:d=`Delete`,cancelText:f=`Cancel`,onConfirm:p,onCancel:m,isProcessing:h=!1,disableConfirm:g=!1}){let _=(0,i.useRef)(null),v=(0,i.useRef)(m),y=(0,i.useRef)(h);if((0,i.useEffect)(()=>{v.current=m,y.current=h}),(0,i.useEffect)(()=>{if(!c)return;let e=document.body.style.overflow;document.body.style.overflow=`hidden`;let t=document.activeElement,n=window.setTimeout(()=>{_.current&&!_.current.contains(document.activeElement)&&_.current.focus()},0),r=e=>{if(e.defaultPrevented)return;if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),y.current||v.current();return}if(e.key!==`Tab`||!_.current)return;e.stopPropagation();let t=Array.from(_.current.querySelectorAll(s)).filter(e=>e.offsetParent!==null||e===document.activeElement);if(!t.length){e.preventDefault();return}let n=t[0],r=t[t.length-1],i=document.activeElement;e.shiftKey&&(i===n||i===_.current)?(e.preventDefault(),r.focus()):!e.shiftKey&&i===r&&(e.preventDefault(),n.focus())};return window.addEventListener(`keydown`,r,!0),()=>{window.clearTimeout(n),window.removeEventListener(`keydown`,r,!0),document.body.style.overflow=e,t&&document.contains(t)&&t.focus({preventScroll:!0})}},[c]),typeof document>`u`)return null;let b=n.n()>0;return(0,o.createPortal)((0,a.jsx)(e.rt,{children:c&&(0,a.jsxs)(`div`,{className:`fixed inset-0 z-[9999] flex items-center justify-center p-4`,children:[(0,a.jsx)(e.nt.div,{onClick:()=>!h&&m(),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`absolute inset-0 cursor-pointer ${b?`bg-background/60`:`bg-background/80 backdrop-blur-xl`}`}),(0,a.jsx)(e.nt.div,{ref:_,role:`dialog`,"aria-modal":`true`,"aria-label":l,tabIndex:-1,initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.18,ease:[.16,1,.3,1]},className:`w-full max-w-[400px] p-6 rounded-3xl glass-popover border border-[var(--panel-border)] shadow-2xl relative z-10 text-center outline-none`,children:(0,a.jsxs)(`div`,{className:`w-full flex flex-col items-center`,children:[(0,a.jsx)(`h3`,{className:`text-xl font-bold mb-2 text-foreground tracking-tight`,children:l}),(0,a.jsx)(`p`,{className:`w-full text-[14px] font-medium text-foreground/60 leading-relaxed mb-6 break-words`,children:u}),(0,a.jsxs)(`div`,{className:`flex items-center gap-3 w-full`,children:[(0,a.jsx)(r.t,{variant:`secondary`,onClick:m,disabled:h,className:`flex-1 py-2.5 text-[13px] font-bold rounded-xl`,children:f}),(0,a.jsx)(r.t,{onClick:p,disabled:h||g,className:`flex-1 py-2.5 text-[13px] font-bold rounded-xl bg-red-500 hover:bg-red-600 border-none text-white shadow-xl hover:shadow-red-500/20 glow-hover`,children:h?(0,a.jsx)(t.r,{className:`w-5 h-5 animate-spin mx-auto`}):d})]})]})})]})}),document.body)}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
@@ -1,7 +1,7 @@
1
- import { nt as e, rt as t } from "./TimeZoneField-Dv389mAe.js";
1
+ import { nt as e, rt as t } from "./TimeZoneField-oIMwb5_X.js";
2
2
  import { r as n } from "./x-hax8aKt8.js";
3
- import { n as r } from "./Popup-DmPEk98h.js";
4
- import { t as i } from "./Button-DSldWACF.js";
3
+ import { n as r } from "./Popup-Bi63lzoS.js";
4
+ import { t as i } from "./Button-BGN6q7lY.js";
5
5
  import { useEffect as a, useRef as o } from "react";
6
6
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
7
  import { createPortal as l } from "react-dom";
@@ -1,2 +1,2 @@
1
- const e=require(`./chunk-CiTBaPhY.cjs`),t=require(`./forms-CmNeTETW.cjs`),n=require(`./TimeZoneField-zR8N2Fj0.cjs`),r=require(`./schedule-BAea6q8_.cjs`),i=require(`./chevron-down-lyDK1rfL.cjs`),a=require(`./scheduleData-BpkfnBjP.cjs`),o=require(`./BookingCalendar-DYsA71vl.cjs`),s=require(`./x-Ci8c5p6T.cjs`),c=require(`./pencil-Ca8JSmp0.cjs`),l=require(`./Popup-nq7YNM4N.cjs`),u=require(`./Button-PyTaaoyu.cjs`),d=require(`./Loader-p3eNQDUU.cjs`),f=require(`./bookingHold-DhS-tuuC.cjs`),p=require(`./address-D88ICQCR.cjs`),m=require(`./formPage-DoDEEg1-.cjs`),h=require(`./email-DD48BP42.cjs`);let g=require(`react`);g=e.a(g,1);let _=require(`react/jsx-runtime`),v=require(`firebase/firestore`),y=require(`react-router-dom`),b=require(`react-dom`);var x={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};x.node;var S=i.n(x),C=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function w(e,t){return n.St(e)?e[C(0,e.length,t)]:e}var T=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return E(this.animations,`duration`)}get iterationDuration(){return E(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function E(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var D=class extends T{then(e,t){return this.finished.finally(e).then(()=>{})}};function O(e,t){return e in t}var k=class extends n.st{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(O(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return n.lt()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}};function A(e){return typeof e==`object`&&!Array.isArray(e)}function j(e,t,r,i){return e==null?[]:typeof e==`string`&&A(t)?n.ft(e,r,i):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function M(e,t,n){return e*(t+1)}function N(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function P(e,t,r){for(let i=0;i<e.length;i++){let a=e[i];a.at>t&&a.at<r&&(n.Et(e,a),i--)}}function F(e,t,r,i,a,o){P(e,a,o);for(let s=0;s<t.length;s++)e.push({value:t[s],at:n.xt(a,o,i[s]),easing:w(r,s)})}function ee(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function I(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var L=`easeInOut`,R=20;function te(e,{defaultTransition:t={},...r}={},i,a){let o=t.duration||.3,s=new Map,c=new Map,l={},u=new Map,d=0,f=0,p=0;for(let r=0;r<e.length;r++){let s=e[r];if(typeof s==`string`){u.set(s,f);continue}else if(!Array.isArray(s)){u.set(s.name,N(f,s.at,d,u));continue}let[m,h,g={}]=s;g.at!==void 0&&(f=N(f,g.at,d,u));let _=0,v=(e,r,i,s=0,c=0)=>{let l=ie(e),{delay:u=0,times:d=n._t(l),type:m=t.type||`keyframes`,repeat:h,repeatType:g,repeatDelay:v=0,...y}=r,{ease:b=t.ease||`easeOut`,duration:x}=r,S=typeof u==`function`?u(s,c):u,C=l.length,T=n.gt(m)?m:a?.[m||`keyframes`];if(C<=2&&T){let e=100;if(C===2&&B(l)){let t=l[1]-l[0];e=Math.abs(t)}let r={...t,...y};x!==void 0&&(r.duration=n.Ct(x));let i=n.bt(r,e,T);b=i.ease,x=i.duration}x??=o;let E=f+S;d.length===1&&d[0]===0&&(d[1]=1);let D=d.length-l.length;if(D>0&&n.vt(d,D),l.length===1&&l.unshift(null),h){n.Tt(h<R,`Repeat count too high, must be less than 20`,`repeat-count-high`),x=M(x,h);let e=[...l],t=[...d];b=Array.isArray(b)?[...b]:[b];let r=[...b];for(let n=0;n<h;n++){l.push(...e);for(let i=0;i<e.length;i++)d.push(t[i]+(n+1)),b.push(i===0?`linear`:w(r,i-1))}ee(d,h)}let O=E+x;F(i,l,b,d,E,O),_=Math.max(S+x,_),p=Math.max(O,p)};if(n.mt(m)){let e=ne(m,c);v(h,g,re(`default`,e))}else{let e=j(m,h,i,l),t=e.length;for(let n=0;n<t;n++){h=h,g=g;let r=e[n],i=ne(r,c);for(let e in h)v(h[e],ae(g,e),re(e,i),n,t)}}d=f,f+=_}return c.forEach((e,i)=>{for(let a in e){let o=e[a];o.sort(I);let c=[],l=[],u=[];for(let e=0;e<o.length;e++){let{at:t,value:r,easing:i}=o[e];c.push(r),l.push(n.wt(0,p,t)),u.push(i||`easeOut`)}l[0]!==0&&(l.unshift(0),c.unshift(c[0]),u.unshift(L)),l[l.length-1]!==1&&(l.push(1),c.push(null)),s.has(i)||s.set(i,{keyframes:{},transition:{}});let d=s.get(i);d.keyframes[a]=c;let{type:f,...m}=t;d.transition[a]={...m,duration:p,ease:u,times:l,...r}}}),s}function ne(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function re(e,t){return t[e]||(t[e]=[]),t[e]}function ie(e){return Array.isArray(e)?e:[e]}function ae(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var z=e=>typeof e==`number`,B=e=>e.every(z);function oe(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},r=n.dt(e)&&!n.ut(e)?new n.at(t):new n.ot(t);r.mount(e),n.ct.set(e,r)}function V(e){let t=new k({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),n.ct.set(e,t)}function se(e,t){return n.mt(e)||typeof e==`number`||typeof e==`string`&&!A(t)}function ce(e,t,r,i){let a=[];if(se(e,t))a.push(n.it(e,A(t)&&t.default||t,r&&(r.default||r)));else{if(e==null)return a;let o=j(e,t,i),s=o.length;n.Tt(!!s,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<s;e++){let i=o[e],c=i instanceof Element?oe:V;n.ct.has(i)||c(i);let l=n.ct.get(i),u={...r};`delay`in u&&typeof u.delay==`function`&&(u.delay=u.delay(e,s)),a.push(...n.pt(l,{...t,transition:u},{}))}}return a}function le(e,t,r){let i=[];return te(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],r=n.ht(0);return r.on(`change`,t),e.length===1?[r,[0,1]]:e.length===2?[r,[0,1],e[1]]:[r,e[1],e[2]]}return e}),t,r,{spring:n.yt}).forEach(({keyframes:e,transition:t},n)=>{i.push(...ce(n,e,t))}),i}function ue(e){return Array.isArray(e)&&e.some(Array.isArray)}function de(e={}){let{scope:t,reduceMotion:r}=e;function i(e,i,a){let o=[],s;if(ue(e)){let{onComplete:n,...a}=i||{};typeof n==`function`&&(s=n),o=le(e,r===void 0?a:{reduceMotion:r,...a},t)}else{let{onComplete:n,...c}=a||{};typeof n==`function`&&(s=n),o=ce(e,i,r===void 0?c:{reduceMotion:r,...c},t)}let c=new D(o);return s&&c.finished.then(s),t&&(t.animations.push(c),c.finished.then(()=>{n.Et(t.animations,c)})),c}return i}var fe=de(),pe=g.default.forwardRef(({className:e,label:t,error:r,currencySymbol:i,type:a,...o},s)=>{let c=a===`currency`;return(0,_.jsxs)(`div`,{className:`flex flex-col w-full relative`,children:[t&&(0,_.jsx)(`label`,{className:`text-[13px] font-medium text-foreground/70 select-none mb-2`,children:t}),(0,_.jsxs)(`div`,{className:`relative flex items-center lift-focus`,children:[c&&i&&(0,_.jsx)(`span`,{className:`absolute left-4 font-bold text-foreground/70 z-10 pointer-events-none text-[15px]`,children:i}),(0,_.jsx)(`input`,{ref:s,type:c?`number`:a,className:n.$(`block h-12 w-full text-[15px] text-foreground py-2`,c&&i?`pl-8 pr-4`:`px-4`,`transition-all duration-300 placeholder:text-foreground/40`,`focus:outline-none focus:border-accent glow-focus`,`disabled:cursor-not-allowed disabled:opacity-50 glass-panel`,r&&`border-red-500/50 focus:border-red-500/50`,e),style:{borderRadius:`var(--input-radius, 0.75rem)`},...o})]}),r&&(0,_.jsx)(n.nt.p,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},className:`text-[13px] text-red-500 font-medium mt-1.5`,children:r})]})});pe.displayName=`Input`;var me=g.default.forwardRef(({className:e,label:t,error:r,id:i,rows:a=2,...o},s)=>{let c=(0,g.useId)(),l=i??`textarea-${c}`;return(0,_.jsxs)(`div`,{className:`flex flex-col w-full relative`,children:[t&&(0,_.jsx)(`label`,{htmlFor:l,className:`text-[13px] font-medium text-foreground/70 select-none mb-2`,children:t}),(0,_.jsx)(n.Q,{ref:s,id:l,rows:a,className:n.$(`block w-full text-[15px] leading-6 text-foreground px-4 py-3`,`transition-[border-color,box-shadow,background-color] duration-300 placeholder:text-foreground/40`,`focus:outline-none focus:border-accent glow-focus`,`disabled:cursor-not-allowed disabled:opacity-50 glass-panel`,r&&`border-red-500/50 focus:border-red-500/50`,e),style:{borderRadius:`var(--input-radius, 0.75rem)`},...o}),r&&(0,_.jsx)(n.nt.p,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},className:`text-[13px] text-red-500 font-medium mt-1.5`,children:r})]})});me.displayName=`TextArea`;var H=e=>`fbos.visitor.${e}`,he=`buyer`,U=`fbos:visitor-forgotten`,W=`fbos:visitor-changed`;function G(e){try{window.localStorage.removeItem(H(e))}catch{}try{window.dispatchEvent(new CustomEvent(U,{detail:e}))}catch{}}var ge=(e,t)=>{try{let n=window.localStorage.getItem(H(e));if(n===null)return t;let r=JSON.parse(n);return r===null?t:r}catch{return t}};function _e(e,t,n,r){return Object.assign([e,t,n],{value:e,setValue:t,clear:n,ready:r})}function ve(e,t){let[n,r]=(0,g.useState)(t),[i,a]=(0,g.useState)(!1),o=(0,g.useRef)(t),s=(0,g.useRef)(t),c=(0,g.useRef)(Symbol(`visitor-state`));(0,g.useEffect)(()=>{let t=ge(e,o.current);s.current=t,r(t),a(!0);let n=t=>{t.detail===e&&(s.current=o.current,r(o.current))},i=t=>{let n=t.detail;!n||n.key!==e||n.from===c.current||(s.current=n.value,r(n.value))},l=t=>{if(t.key!==H(e))return;let n=ge(e,o.current);s.current=n,r(n)};return window.addEventListener(U,n),window.addEventListener(W,i),window.addEventListener(`storage`,l),()=>{window.removeEventListener(U,n),window.removeEventListener(W,i),window.removeEventListener(`storage`,l)}},[e]);let l=(0,g.useRef)(null),u=(0,g.useCallback)(t=>{let n=typeof t==`function`?t(s.current):t;s.current=n,l.current||={json:JSON.stringify(o.current)};let i=JSON.stringify(n);try{i===l.current.json?window.localStorage.removeItem(H(e)):window.localStorage.setItem(H(e),i)}catch{}r(n);try{window.dispatchEvent(new CustomEvent(W,{detail:{key:e,value:n,from:c.current}}))}catch{}},[e]),d=(0,g.useCallback)(()=>{s.current=o.current;try{window.localStorage.removeItem(H(e))}catch{}r(o.current);try{window.dispatchEvent(new CustomEvent(U,{detail:e}))}catch{}},[e]);return(0,g.useMemo)(()=>_e(n,u,d,i),[n,u,d,i])}var ye=[.16,1,.3,1],K=16;function be({top:e,height:t,thanks:n,head:r,view:i}){if(e>=r)return e;let a=e+t;return Math.max(r,Math.min(a-n,i-n-K))}function xe(e){if(typeof document>`u`)return null;for(let t=e.parentElement;t&&t!==document.body&&t!==document.documentElement;t=t.parentElement){let e=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(e.overflowY)&&t.scrollHeight>t.clientHeight+1)return t;if(e.position===`fixed`)return null}return document.scrollingElement||document.documentElement}var q=e=>e===document.scrollingElement||e===document.documentElement;function J(e){if(!q(e)||typeof document.elementFromPoint!=`function`)return K;for(let e=document.elementFromPoint(window.innerWidth/2,1);e;e=e.parentElement){let t=getComputedStyle(e).position;if(t!==`fixed`&&t!==`sticky`)continue;let n=e.getBoundingClientRect().bottom;return n>0&&n<window.innerHeight/3?n+K:K}return K}var Y=e=>q(e)?window.scrollY:e.scrollTop,X=(e,t)=>{try{q(e)?window.scrollTo({top:t,behavior:`instant`}):e.scrollTo({top:t,behavior:`instant`})}catch{}};function Se(e,t,n,r){let i=()=>{};if(typeof window>`u`)return i;let a=n;e.style.height=`${a}px`;let o=t.getBoundingClientRect().height;if(!(a>o+1))return e.style.height=``,i;let s=xe(e),c=!!s&&q(s),l=s?c?document.documentElement:s:null,u=l?l.style.overflowAnchor:``;l&&(l.style.overflowAnchor=`none`);let d=()=>{l&&(l.style.overflowAnchor=u)},f=s&&!c?s.getBoundingClientRect().top:0,p=s&&!c?s.clientHeight:window.innerHeight,m=s?Y(s):0,h=e.getBoundingClientRect().top-f,g=s?be({top:h,height:a,thanks:o,head:J(s),view:p}):h;e.style.height=``;let _=s?Y(s):0,v=t.getBoundingClientRect().top-f+_,y=s?s.scrollHeight-p:0,b=s?Math.max(0,Math.min(y,m,v-g)):0,x=v-b;if(e.style.height=`${a}px`,s&&X(s,m),r)return e.style.height=``,s&&X(s,b),d(),i;let S=!!s,C=0,w=0,T=0,E=[`wheel`,`touchstart`,`keydown`],D=()=>{S=!1};E.forEach(e=>window.addEventListener(e,D,{passive:!0}));let O=n=>{e.style.height=`${a-(a-o)*n}px`;let r;S?(s&&X(s,m+(b-m)*n),r=x-(t.getBoundingClientRect().top-f-C),w=r,T=n):r=T<1?w*(1-n)/(1-T):0,C=Math.abs(r)<.5?0:r,t.style.transform=C?`translateY(${C}px)`:``};O(0);let k=!1,A=()=>{k||(k=!0,e.style.height=``,t.style.transform=``,S&&s&&X(s,b),E.forEach(e=>window.removeEventListener(e,D)),d())},j=fe(0,1,{duration:Math.min(.6,.35+(a-o)/3e3),ease:ye,onUpdate:O,onComplete:A});return()=>{j.stop(),A()}}var Ce={borderRadius:`var(--input-radius, 0.75rem)`},we=e=>/\.(png|jpe?g|gif|webp|avif|svg|heic|heif|bmp)$/i.test(e),Te=e=>{let t=(e.split(`.`).pop()||``).toLowerCase();return t&&t.length<=4&&t!==e.toLowerCase()?t:`file`};function Ee({field:e,value:t,error:r,onChange:i}){let[a,o]=(0,g.useState)(0),[c,l]=(0,g.useState)(``),u=(0,g.useRef)(null),f=a>0,p=n.P(t),m=async e=>{let t=Array.from(e||[]);u.current&&(u.current.value=``),t.length&&(l(``),o(e=>e+t.length),await Promise.all(t.map(async e=>{try{let t=await n.B(e,n.li.currentUser);i(e=>n.L([...n.P(e),t]))}catch(e){l(e?.code===`storage/unauthorized`?`That kind of file is not accepted. Try a PDF, a document or a picture.`:n.z(e))}finally{o(e=>e-1)}})))},h=e=>{l(``),i(t=>n.L(n.P(t).filter(t=>t!==e)))},{over:v,dropProps:y}=n.A({accept:e.accept,multiple:!0,disabled:f,onFiles:m,onReject:()=>l(`That kind of file is not accepted here.`)}),b=r||c,x=v?`Drop to attach`:p.length?`Add another file`:e.placeholder||`Drop a file or choose one`;return(0,_.jsxs)(`div`,{className:`flex flex-col w-full relative`,children:[(0,_.jsx)(`label`,{className:`text-[13px] font-medium text-foreground/70 select-none mb-2`,children:e.label}),p.length>0&&(0,_.jsx)(`ul`,{className:`flex flex-col gap-2 mb-2`,children:p.map(e=>{let t=n.N(e);return(0,_.jsxs)(`li`,{className:`flex items-center gap-3 w-full pl-2 pr-2 py-2 border border-[var(--panel-border)]`,style:Ce,children:[we(t)?(0,_.jsx)(n.O,{src:e,alt:t,fit:`cover`,className:`w-11 h-11 shrink-0 rounded-lg overflow-hidden`}):(0,_.jsx)(`span`,{"aria-hidden":`true`,className:`w-11 h-11 shrink-0 rounded-lg bg-foreground/[0.05] flex items-center justify-center text-[11px] font-semibold uppercase tracking-wide text-foreground/60`,children:Te(t)}),(0,_.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-[14px] text-foreground`,children:t}),(0,_.jsx)(`button`,{type:`button`,onClick:()=>h(e),"aria-label":`Remove ${t}`,title:`Remove`,className:`w-8 h-8 shrink-0 inline-flex items-center justify-center rounded-lg text-foreground/45 hover:text-foreground hover:bg-foreground/[0.06] active:scale-[0.97] transition-colors cursor-pointer`,children:(0,_.jsx)(s.t,{className:`w-4 h-4`})})]},e)})}),(0,_.jsxs)(`label`,{...y,className:`flex flex-col items-center justify-center gap-1 w-full px-5 text-center border border-dashed transition-[border-color,background-color] duration-200 cursor-pointer ${p.length?`py-4`:`py-7`} ${v?`border-accent bg-accent/[0.05]`:`border-foreground/15 bg-foreground/[0.015] hover:border-accent/50 hover:bg-foreground/[0.03]`} ${f?`pointer-events-none`:``}`,style:Ce,children:[f?(0,_.jsx)(d.t,{size:`sm`,label:a>1?`Uploading ${a} files...`:`Uploading...`}):(0,_.jsx)(`span`,{className:`text-[14px] font-medium ${v?`text-accent`:`text-foreground/70`}`,children:x}),(0,_.jsx)(`input`,{ref:u,type:`file`,multiple:!0,accept:e.accept,"aria-label":e.label,disabled:f,onChange:e=>m(e.target.files),className:`hidden`})]}),b&&(0,_.jsx)(`span`,{className:`text-[13px] text-red-500 font-medium mt-1.5`,children:b})]})}var Z=`rounded-2xl flex items-center justify-center shrink-0 border border-[var(--panel-border)]/50 bg-accent/10 text-accent`;function De({slot:e,timeZone:t,who:n,onChange:i}){let o=r.Zt(e,t),s=(n||``).trim();return(0,_.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-[var(--panel-border)]/60 bg-foreground/[0.015] px-3.5 py-3`,children:[(0,_.jsx)(`div`,{className:`w-10 h-10 ${Z}`,children:(0,_.jsx)(a.W,{className:`w-4 h-4`})}),(0,_.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1 gap-0.5`,children:[(0,_.jsx)(`span`,{className:`text-[14px] sm:text-[15px] font-bold text-foreground leading-tight truncate`,children:o.day}),(0,_.jsxs)(`span`,{className:`text-[12.5px] sm:text-[13px] font-semibold text-foreground/55 leading-tight tabular-nums truncate`,children:[o.time,s?` · with ${s}`:``]})]}),(0,_.jsxs)(`button`,{type:`button`,onClick:i,"aria-label":`Change the time`,className:`shrink-0 cursor-pointer flex items-center justify-center transition-all max-sm:w-9 max-sm:h-9 max-sm:rounded-xl max-sm:border max-sm:border-[var(--panel-border)] max-sm:text-foreground/50 max-sm:hover:text-accent max-sm:hover:border-accent/40 max-sm:active:scale-[0.98] sm:text-[12.5px] sm:font-bold sm:text-accent sm:hover:underline`,children:[(0,_.jsx)(c.t,{className:`w-3.5 h-3.5 sm:hidden`,"aria-hidden":!0}),(0,_.jsx)(`span`,{className:`max-sm:hidden`,children:`Change`})]})]})}var Oe=`booking_back`,ke=`fbos.bookingCheckout`,Ae=7200*1e3;function je(e){try{window.sessionStorage.setItem(ke,JSON.stringify({...e,at:Date.now()}))}catch{}}function Me(){try{let e=JSON.parse(window.sessionStorage.getItem(ke)||`null`);return!e||typeof e.sessionId!=`string`||!Array.isArray(e.bookingIds)||!(Date.now()-Number(e.at)<Ae)?null:{sessionId:e.sessionId,bookingIds:e.bookingIds.map(String),when:String(e.when||``),formId:String(e.formId||``),...typeof e.holdUntil==`number`?{holdUntil:e.holdUntil}:{},at:Number(e.at)}}catch{return null}}function Ne(){try{window.sessionStorage.removeItem(ke)}catch{}}var Pe=new Map;function Fe(e,t){let n=Pe.get(e);if(n)return n;let r=(async()=>{let n=t.holdPasses||{},r=Object.keys(n).length?(await a.s(n,`paid`)).refused.length===0:!0,i=Me();return!i||i.sessionId!==e||t.status!==`complete`&&!t.paid?{booked:null,held:r}:(Ne(),i.formId&&G(`form.${i.formId}`),{booked:i,held:r})})();return Pe.set(e,r),r}var Ie=`Paid. Your time will be confirmed shortly — the team has your booking.`,Le={letGo:`Nothing was charged, and the time was let go.`,lapses:`Nothing was charged. The time is free again within the hour.`,kept:`Nothing was charged. The time is still held for now — pick another, or ask the team to free it.`,paid:`That time is already paid for, and it is held for you.`,unknown:`Nothing was charged. The time could not be checked just now.`},Re=[`unknown`,`paid`,`kept`,`lapses`,`letGo`],ze=null;function Be(){let e=Me();return e?(Ne(),ze=(async()=>{let t=[],r={},i={};for(let a of e.bookingIds){let o=await n.kn(a,e.sessionId);typeof o==`string`?t.push(`unknown`):o.state===`free`?r[a]=o.pass:o.state===`paid`?(i[a]=o.pass,t.push(`paid`)):o.state===`gone`?t.push(`letGo`):o.state===`open`?t.push(`lapses`):t.push(e.holdUntil?`paid`:`kept`)}let[o]=await Promise.all([a.s(r,`letGo`),a.s(i,`paid`)]);return t.push(...o.written.map(()=>`letGo`),...o.refused.map(()=>`lapses`)),{pending:e,outcome:Re.find(e=>t.includes(e))||`letGo`}})(),ze):ze??Promise.resolve(null)}var Ve=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function He(e,t){let n=new URLSearchParams(t);n.delete(`session_id`),n.delete(Oe);let r=n.toString();return`${e}${r?`?${r}`:``}`}var Ue=(e,t=n.Lr())=>{try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t.toUpperCase()}).format(e)}catch{return`${e} ${t.toUpperCase()}`}},We=new Map,Ge=e=>{let t=We.get(e);return t||(t=(0,v.getDoc)((0,v.doc)(n.ui,`sys_payments`,e)).then(e=>e.exists()?f.g(e.data()):0),t.catch(()=>We.delete(e)),We.set(e,t)),t},Ke=3e3;function qe(e){let t=n.Rr()||`usd`,r=f._(e.map(e=>({paymentId:e}))).join(`,`),[i,a]=(0,g.useState)({key:``,amount:0,error:!1}),[o,s]=(0,g.useState)(0);return(0,g.useEffect)(()=>{if(!r)return;let e=!1,t;return Promise.all(r.split(`,`).map(Ge)).then(t=>{e||a({key:r,amount:Math.round(t.reduce((e,t)=>e+t,0)*100)/100,error:!1})}).catch(()=>{e||(a({key:r,amount:0,error:!0}),t=setTimeout(()=>s(e=>e+1),Ke))}),()=>{e=!0,clearTimeout(t)}},[r,o]),r?i.key===r?{loading:!1,amount:i.amount,error:i.error,currency:t}:{loading:!0,amount:0,error:!1,currency:t}:{loading:!1,amount:0,error:!1,currency:t}}var Je=new Set([`uid`,`formId`,`submittedAt`,`submitterName`,`submitterEmail`,`submitterAvatar`]),Ye=(e,t)=>{if(!e||typeof e!=`object`)return{};let n;try{n=JSON.parse(JSON.stringify(e))}catch{return{}}let r={};for(let[e,i]of Object.entries(n||{}))Je.has(e)||e in t||(r[e]=i);return r},Xe=n.si(()=>Promise.resolve().then(()=>require(`./PhoneInputField-WYdkNEym.cjs`))),Ze=n.si(()=>Promise.resolve().then(()=>require(`./AddressField-CI8PP5ow.cjs`))),Qe=/^[^\s@,;]+@[^\s@,;.]+(\.[^\s@,;.]+)*\.[a-z]{2,}$/i,$e=`The price of this time could not be read. Try again in a moment.`,et=`text-[13px] font-medium text-foreground/70 select-none mb-2`,tt=`text-[13px] text-red-500 font-medium mt-1.5`,nt=`block h-12 w-full text-[15px] text-foreground py-2 transition-all duration-300 placeholder:text-foreground/40 focus:outline-none focus:border-accent glow-focus disabled:cursor-not-allowed disabled:opacity-50 glass-panel`,Q={borderRadius:`var(--input-radius, 0.75rem)`},$=[.16,1,.3,1],rt=e=>{let t=new Set;return(Array.isArray(e)?e:[]).flatMap(e=>{let n=null;if(e&&typeof e==`object`){let t=String(e.value??``).trim()||String(e.label??``).trim();t&&(n={value:t,label:String(e.label??``).trim()||t})}else{let t=String(e??``);t.trim()&&(n={value:t,label:t})}return!n||t.has(n.value)?[]:(t.add(n.value),[n])})},it=e=>{let t=e.toUpperCase();if(t===`USD`)return`$`;try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t}).formatToParts(0).find(e=>e.type===`currency`)?.value||t}catch{return t}};function at({field:e,value:t,onChange:r}){n.Rr();let i=String(e.currencySymbol??``).trim()||it(n.Lr());return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`label`,{className:et,children:e.label}),(0,_.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,_.jsx)(`span`,{className:`absolute left-4 text-foreground/60 font-medium flex items-center h-full z-10 pointer-events-none text-[15px]`,children:i}),(0,_.jsx)(`input`,{required:e.required,type:`number`,placeholder:e.placeholder,value:t,onChange:e=>r(e.target.value),className:`${nt} pl-8 pr-4`,style:i.length>1?{...Q,paddingLeft:`calc(1.75rem + ${i.length}ch)`}:Q})]})]})}function ot({field:e,value:t,error:n,timeZone:i,onTimeZone:s,onChange:c}){let{schedules:l}=a._(),u=r.en(e),d=l.filter(e=>u.includes(e.id)&&r.P(e)),f=new Set(d.map(e=>e.memberId)).size>1,p=r.$t(e),m=p===`choose`&&f,[h,v]=(0,g.useState)(!1),y=f&&(p===`all`||m&&h),b=y?r.Et(d):[],[x]=(0,g.useState)(()=>new Date),S=a.C(d.map(e=>e.memberId),x),C=r.Z(t),w=e.look===`calendar`?o.n:o.c;return(0,_.jsxs)(`div`,{className:`flex flex-col w-full`,children:[(0,_.jsx)(`label`,{className:et,children:e.label}),m&&(0,_.jsx)(`div`,{className:`flex gap-1.5 mb-2.5 p-1 rounded-[var(--input-radius,0.75rem)] border border-[var(--panel-border)] bg-[var(--panel-bg)] w-fit`,children:[{on:!h,label:`One of them`,v:!1},{on:h,label:`All of them`,v:!0}].map(e=>(0,_.jsx)(`button`,{type:`button`,"aria-pressed":e.on,onClick:()=>{e.v!==h&&(v(e.v),c(``))},className:`px-3 h-8 rounded-[calc(var(--input-radius,0.75rem)-0.25rem)] text-[12.5px] font-semibold transition-all cursor-pointer ${e.on?`bg-accent text-[var(--button-fg,#fff)] shadow-sm`:`text-foreground/55 hover:text-foreground`}`,children:e.label},e.label))}),y&&(0,_.jsxs)(`p`,{className:`text-[12.5px] font-medium text-foreground/50 mb-2 ml-1`,children:[`Times `,r.St(b),` are all free.`]}),(0,_.jsx)(w,{members:d,value:C,onChange:e=>c(e?r.tt(e,y):``),taken:S,timeZone:i,onTimeZone:s,together:y}),n&&(0,_.jsx)(`span`,{className:tt,children:n})]})}var st=(e,t)=>{let r=e.find(e=>e.type===`text`&&/name/i.test(String(e.name||``)))||e.find(e=>e.type===`text`);return String(r&&t[r.name]||n.li.currentUser?.displayName||``).trim()},ct=(e,t)=>{let r=e.find(e=>e.type===`email`);return String(r&&t[r.name]||n.li.currentUser?.email||``).trim()},lt=(e,t,n,r)=>{let i={},a=(Array.isArray(n?.items)?n.items:[]).map(e=>{let t=String(e?.name||``).trim();return t?`${Number(e?.quantity)||1} × ${t}${e?.options?` — ${String(e.options)}`:``}`:``}).filter(Boolean).join(`
1
+ const e=require(`./chunk-CiTBaPhY.cjs`),t=require(`./forms-CmNeTETW.cjs`),n=require(`./TimeZoneField-Ckn1pKAL.cjs`),r=require(`./schedule-BAea6q8_.cjs`),i=require(`./chevron-down-lyDK1rfL.cjs`),a=require(`./scheduleData-BXjNXVHY.cjs`),o=require(`./BookingCalendar-BcvJiyaq.cjs`),s=require(`./x-Ci8c5p6T.cjs`),c=require(`./pencil-Ca8JSmp0.cjs`),l=require(`./Popup-COnHpbrY.cjs`),u=require(`./Button-Ccy4wFZ1.cjs`),d=require(`./Loader-QHqQsXLr.cjs`),f=require(`./bookingHold-DhS-tuuC.cjs`),p=require(`./address-D88ICQCR.cjs`),m=require(`./formPage-DoDEEg1-.cjs`),h=require(`./email-Sya6gl4F.cjs`);let g=require(`react`);g=e.a(g,1);let _=require(`react/jsx-runtime`),v=require(`firebase/firestore`),y=require(`react-router-dom`),b=require(`react-dom`);var x={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};x.node;var S=i.n(x),C=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function w(e,t){return n.St(e)?e[C(0,e.length,t)]:e}var T=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return E(this.animations,`duration`)}get iterationDuration(){return E(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function E(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var D=class extends T{then(e,t){return this.finished.finally(e).then(()=>{})}};function O(e,t){return e in t}var k=class extends n.st{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(O(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return n.lt()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}};function A(e){return typeof e==`object`&&!Array.isArray(e)}function j(e,t,r,i){return e==null?[]:typeof e==`string`&&A(t)?n.ft(e,r,i):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function M(e,t,n){return e*(t+1)}function N(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function P(e,t,r){for(let i=0;i<e.length;i++){let a=e[i];a.at>t&&a.at<r&&(n.Et(e,a),i--)}}function F(e,t,r,i,a,o){P(e,a,o);for(let s=0;s<t.length;s++)e.push({value:t[s],at:n.xt(a,o,i[s]),easing:w(r,s)})}function ee(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function I(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var L=`easeInOut`,R=20;function te(e,{defaultTransition:t={},...r}={},i,a){let o=t.duration||.3,s=new Map,c=new Map,l={},u=new Map,d=0,f=0,p=0;for(let r=0;r<e.length;r++){let s=e[r];if(typeof s==`string`){u.set(s,f);continue}else if(!Array.isArray(s)){u.set(s.name,N(f,s.at,d,u));continue}let[m,h,g={}]=s;g.at!==void 0&&(f=N(f,g.at,d,u));let _=0,v=(e,r,i,s=0,c=0)=>{let l=ie(e),{delay:u=0,times:d=n._t(l),type:m=t.type||`keyframes`,repeat:h,repeatType:g,repeatDelay:v=0,...y}=r,{ease:b=t.ease||`easeOut`,duration:x}=r,S=typeof u==`function`?u(s,c):u,C=l.length,T=n.gt(m)?m:a?.[m||`keyframes`];if(C<=2&&T){let e=100;if(C===2&&B(l)){let t=l[1]-l[0];e=Math.abs(t)}let r={...t,...y};x!==void 0&&(r.duration=n.Ct(x));let i=n.bt(r,e,T);b=i.ease,x=i.duration}x??=o;let E=f+S;d.length===1&&d[0]===0&&(d[1]=1);let D=d.length-l.length;if(D>0&&n.vt(d,D),l.length===1&&l.unshift(null),h){n.Tt(h<R,`Repeat count too high, must be less than 20`,`repeat-count-high`),x=M(x,h);let e=[...l],t=[...d];b=Array.isArray(b)?[...b]:[b];let r=[...b];for(let n=0;n<h;n++){l.push(...e);for(let i=0;i<e.length;i++)d.push(t[i]+(n+1)),b.push(i===0?`linear`:w(r,i-1))}ee(d,h)}let O=E+x;F(i,l,b,d,E,O),_=Math.max(S+x,_),p=Math.max(O,p)};if(n.mt(m)){let e=ne(m,c);v(h,g,re(`default`,e))}else{let e=j(m,h,i,l),t=e.length;for(let n=0;n<t;n++){h=h,g=g;let r=e[n],i=ne(r,c);for(let e in h)v(h[e],ae(g,e),re(e,i),n,t)}}d=f,f+=_}return c.forEach((e,i)=>{for(let a in e){let o=e[a];o.sort(I);let c=[],l=[],u=[];for(let e=0;e<o.length;e++){let{at:t,value:r,easing:i}=o[e];c.push(r),l.push(n.wt(0,p,t)),u.push(i||`easeOut`)}l[0]!==0&&(l.unshift(0),c.unshift(c[0]),u.unshift(L)),l[l.length-1]!==1&&(l.push(1),c.push(null)),s.has(i)||s.set(i,{keyframes:{},transition:{}});let d=s.get(i);d.keyframes[a]=c;let{type:f,...m}=t;d.transition[a]={...m,duration:p,ease:u,times:l,...r}}}),s}function ne(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function re(e,t){return t[e]||(t[e]=[]),t[e]}function ie(e){return Array.isArray(e)?e:[e]}function ae(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var z=e=>typeof e==`number`,B=e=>e.every(z);function oe(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},r=n.dt(e)&&!n.ut(e)?new n.at(t):new n.ot(t);r.mount(e),n.ct.set(e,r)}function V(e){let t=new k({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),n.ct.set(e,t)}function se(e,t){return n.mt(e)||typeof e==`number`||typeof e==`string`&&!A(t)}function ce(e,t,r,i){let a=[];if(se(e,t))a.push(n.it(e,A(t)&&t.default||t,r&&(r.default||r)));else{if(e==null)return a;let o=j(e,t,i),s=o.length;n.Tt(!!s,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<s;e++){let i=o[e],c=i instanceof Element?oe:V;n.ct.has(i)||c(i);let l=n.ct.get(i),u={...r};`delay`in u&&typeof u.delay==`function`&&(u.delay=u.delay(e,s)),a.push(...n.pt(l,{...t,transition:u},{}))}}return a}function le(e,t,r){let i=[];return te(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],r=n.ht(0);return r.on(`change`,t),e.length===1?[r,[0,1]]:e.length===2?[r,[0,1],e[1]]:[r,e[1],e[2]]}return e}),t,r,{spring:n.yt}).forEach(({keyframes:e,transition:t},n)=>{i.push(...ce(n,e,t))}),i}function ue(e){return Array.isArray(e)&&e.some(Array.isArray)}function de(e={}){let{scope:t,reduceMotion:r}=e;function i(e,i,a){let o=[],s;if(ue(e)){let{onComplete:n,...a}=i||{};typeof n==`function`&&(s=n),o=le(e,r===void 0?a:{reduceMotion:r,...a},t)}else{let{onComplete:n,...c}=a||{};typeof n==`function`&&(s=n),o=ce(e,i,r===void 0?c:{reduceMotion:r,...c},t)}let c=new D(o);return s&&c.finished.then(s),t&&(t.animations.push(c),c.finished.then(()=>{n.Et(t.animations,c)})),c}return i}var fe=de(),pe=g.default.forwardRef(({className:e,label:t,error:r,currencySymbol:i,type:a,...o},s)=>{let c=a===`currency`;return(0,_.jsxs)(`div`,{className:`flex flex-col w-full relative`,children:[t&&(0,_.jsx)(`label`,{className:`text-[13px] font-medium text-foreground/70 select-none mb-2`,children:t}),(0,_.jsxs)(`div`,{className:`relative flex items-center lift-focus`,children:[c&&i&&(0,_.jsx)(`span`,{className:`absolute left-4 font-bold text-foreground/70 z-10 pointer-events-none text-[15px]`,children:i}),(0,_.jsx)(`input`,{ref:s,type:c?`number`:a,className:n.$(`block h-12 w-full text-[15px] text-foreground py-2`,c&&i?`pl-8 pr-4`:`px-4`,`transition-all duration-300 placeholder:text-foreground/40`,`focus:outline-none focus:border-accent glow-focus`,`disabled:cursor-not-allowed disabled:opacity-50 glass-panel`,r&&`border-red-500/50 focus:border-red-500/50`,e),style:{borderRadius:`var(--input-radius, 0.75rem)`},...o})]}),r&&(0,_.jsx)(n.nt.p,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},className:`text-[13px] text-red-500 font-medium mt-1.5`,children:r})]})});pe.displayName=`Input`;var me=g.default.forwardRef(({className:e,label:t,error:r,id:i,rows:a=2,...o},s)=>{let c=(0,g.useId)(),l=i??`textarea-${c}`;return(0,_.jsxs)(`div`,{className:`flex flex-col w-full relative`,children:[t&&(0,_.jsx)(`label`,{htmlFor:l,className:`text-[13px] font-medium text-foreground/70 select-none mb-2`,children:t}),(0,_.jsx)(n.Q,{ref:s,id:l,rows:a,className:n.$(`block w-full text-[15px] leading-6 text-foreground px-4 py-3`,`transition-[border-color,box-shadow,background-color] duration-300 placeholder:text-foreground/40`,`focus:outline-none focus:border-accent glow-focus`,`disabled:cursor-not-allowed disabled:opacity-50 glass-panel`,r&&`border-red-500/50 focus:border-red-500/50`,e),style:{borderRadius:`var(--input-radius, 0.75rem)`},...o}),r&&(0,_.jsx)(n.nt.p,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},className:`text-[13px] text-red-500 font-medium mt-1.5`,children:r})]})});me.displayName=`TextArea`;var H=e=>`fbos.visitor.${e}`,he=`buyer`,U=`fbos:visitor-forgotten`,W=`fbos:visitor-changed`;function G(e){try{window.localStorage.removeItem(H(e))}catch{}try{window.dispatchEvent(new CustomEvent(U,{detail:e}))}catch{}}var ge=(e,t)=>{try{let n=window.localStorage.getItem(H(e));if(n===null)return t;let r=JSON.parse(n);return r===null?t:r}catch{return t}};function _e(e,t,n,r){return Object.assign([e,t,n],{value:e,setValue:t,clear:n,ready:r})}function ve(e,t){let[n,r]=(0,g.useState)(t),[i,a]=(0,g.useState)(!1),o=(0,g.useRef)(t),s=(0,g.useRef)(t),c=(0,g.useRef)(Symbol(`visitor-state`));(0,g.useEffect)(()=>{let t=ge(e,o.current);s.current=t,r(t),a(!0);let n=t=>{t.detail===e&&(s.current=o.current,r(o.current))},i=t=>{let n=t.detail;!n||n.key!==e||n.from===c.current||(s.current=n.value,r(n.value))},l=t=>{if(t.key!==H(e))return;let n=ge(e,o.current);s.current=n,r(n)};return window.addEventListener(U,n),window.addEventListener(W,i),window.addEventListener(`storage`,l),()=>{window.removeEventListener(U,n),window.removeEventListener(W,i),window.removeEventListener(`storage`,l)}},[e]);let l=(0,g.useRef)(null),u=(0,g.useCallback)(t=>{let n=typeof t==`function`?t(s.current):t;s.current=n,l.current||={json:JSON.stringify(o.current)};let i=JSON.stringify(n);try{i===l.current.json?window.localStorage.removeItem(H(e)):window.localStorage.setItem(H(e),i)}catch{}r(n);try{window.dispatchEvent(new CustomEvent(W,{detail:{key:e,value:n,from:c.current}}))}catch{}},[e]),d=(0,g.useCallback)(()=>{s.current=o.current;try{window.localStorage.removeItem(H(e))}catch{}r(o.current);try{window.dispatchEvent(new CustomEvent(U,{detail:e}))}catch{}},[e]);return(0,g.useMemo)(()=>_e(n,u,d,i),[n,u,d,i])}var ye=[.16,1,.3,1],K=16;function be({top:e,height:t,thanks:n,head:r,view:i}){if(e>=r)return e;let a=e+t;return Math.max(r,Math.min(a-n,i-n-K))}function xe(e){if(typeof document>`u`)return null;for(let t=e.parentElement;t&&t!==document.body&&t!==document.documentElement;t=t.parentElement){let e=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(e.overflowY)&&t.scrollHeight>t.clientHeight+1)return t;if(e.position===`fixed`)return null}return document.scrollingElement||document.documentElement}var q=e=>e===document.scrollingElement||e===document.documentElement;function J(e){if(!q(e)||typeof document.elementFromPoint!=`function`)return K;for(let e=document.elementFromPoint(window.innerWidth/2,1);e;e=e.parentElement){let t=getComputedStyle(e).position;if(t!==`fixed`&&t!==`sticky`)continue;let n=e.getBoundingClientRect().bottom;return n>0&&n<window.innerHeight/3?n+K:K}return K}var Y=e=>q(e)?window.scrollY:e.scrollTop,X=(e,t)=>{try{q(e)?window.scrollTo({top:t,behavior:`instant`}):e.scrollTo({top:t,behavior:`instant`})}catch{}};function Se(e,t,n,r){let i=()=>{};if(typeof window>`u`)return i;let a=n;e.style.height=`${a}px`;let o=t.getBoundingClientRect().height;if(!(a>o+1))return e.style.height=``,i;let s=xe(e),c=!!s&&q(s),l=s?c?document.documentElement:s:null,u=l?l.style.overflowAnchor:``;l&&(l.style.overflowAnchor=`none`);let d=()=>{l&&(l.style.overflowAnchor=u)},f=s&&!c?s.getBoundingClientRect().top:0,p=s&&!c?s.clientHeight:window.innerHeight,m=s?Y(s):0,h=e.getBoundingClientRect().top-f,g=s?be({top:h,height:a,thanks:o,head:J(s),view:p}):h;e.style.height=``;let _=s?Y(s):0,v=t.getBoundingClientRect().top-f+_,y=s?s.scrollHeight-p:0,b=s?Math.max(0,Math.min(y,m,v-g)):0,x=v-b;if(e.style.height=`${a}px`,s&&X(s,m),r)return e.style.height=``,s&&X(s,b),d(),i;let S=!!s,C=0,w=0,T=0,E=[`wheel`,`touchstart`,`keydown`],D=()=>{S=!1};E.forEach(e=>window.addEventListener(e,D,{passive:!0}));let O=n=>{e.style.height=`${a-(a-o)*n}px`;let r;S?(s&&X(s,m+(b-m)*n),r=x-(t.getBoundingClientRect().top-f-C),w=r,T=n):r=T<1?w*(1-n)/(1-T):0,C=Math.abs(r)<.5?0:r,t.style.transform=C?`translateY(${C}px)`:``};O(0);let k=!1,A=()=>{k||(k=!0,e.style.height=``,t.style.transform=``,S&&s&&X(s,b),E.forEach(e=>window.removeEventListener(e,D)),d())},j=fe(0,1,{duration:Math.min(.6,.35+(a-o)/3e3),ease:ye,onUpdate:O,onComplete:A});return()=>{j.stop(),A()}}var Ce={borderRadius:`var(--input-radius, 0.75rem)`},we=e=>/\.(png|jpe?g|gif|webp|avif|svg|heic|heif|bmp)$/i.test(e),Te=e=>{let t=(e.split(`.`).pop()||``).toLowerCase();return t&&t.length<=4&&t!==e.toLowerCase()?t:`file`};function Ee({field:e,value:t,error:r,onChange:i}){let[a,o]=(0,g.useState)(0),[c,l]=(0,g.useState)(``),u=(0,g.useRef)(null),f=a>0,p=n.P(t),m=async e=>{let t=Array.from(e||[]);u.current&&(u.current.value=``),t.length&&(l(``),o(e=>e+t.length),await Promise.all(t.map(async e=>{try{let t=await n.B(e,n.li.currentUser);i(e=>n.L([...n.P(e),t]))}catch(e){l(e?.code===`storage/unauthorized`?`That kind of file is not accepted. Try a PDF, a document or a picture.`:n.z(e))}finally{o(e=>e-1)}})))},h=e=>{l(``),i(t=>n.L(n.P(t).filter(t=>t!==e)))},{over:v,dropProps:y}=n.A({accept:e.accept,multiple:!0,disabled:f,onFiles:m,onReject:()=>l(`That kind of file is not accepted here.`)}),b=r||c,x=v?`Drop to attach`:p.length?`Add another file`:e.placeholder||`Drop a file or choose one`;return(0,_.jsxs)(`div`,{className:`flex flex-col w-full relative`,children:[(0,_.jsx)(`label`,{className:`text-[13px] font-medium text-foreground/70 select-none mb-2`,children:e.label}),p.length>0&&(0,_.jsx)(`ul`,{className:`flex flex-col gap-2 mb-2`,children:p.map(e=>{let t=n.N(e);return(0,_.jsxs)(`li`,{className:`flex items-center gap-3 w-full pl-2 pr-2 py-2 border border-[var(--panel-border)]`,style:Ce,children:[we(t)?(0,_.jsx)(n.O,{src:e,alt:t,fit:`cover`,className:`w-11 h-11 shrink-0 rounded-lg overflow-hidden`}):(0,_.jsx)(`span`,{"aria-hidden":`true`,className:`w-11 h-11 shrink-0 rounded-lg bg-foreground/[0.05] flex items-center justify-center text-[11px] font-semibold uppercase tracking-wide text-foreground/60`,children:Te(t)}),(0,_.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-[14px] text-foreground`,children:t}),(0,_.jsx)(`button`,{type:`button`,onClick:()=>h(e),"aria-label":`Remove ${t}`,title:`Remove`,className:`w-8 h-8 shrink-0 inline-flex items-center justify-center rounded-lg text-foreground/45 hover:text-foreground hover:bg-foreground/[0.06] active:scale-[0.97] transition-colors cursor-pointer`,children:(0,_.jsx)(s.t,{className:`w-4 h-4`})})]},e)})}),(0,_.jsxs)(`label`,{...y,className:`flex flex-col items-center justify-center gap-1 w-full px-5 text-center border border-dashed transition-[border-color,background-color] duration-200 cursor-pointer ${p.length?`py-4`:`py-7`} ${v?`border-accent bg-accent/[0.05]`:`border-foreground/15 bg-foreground/[0.015] hover:border-accent/50 hover:bg-foreground/[0.03]`} ${f?`pointer-events-none`:``}`,style:Ce,children:[f?(0,_.jsx)(d.t,{size:`sm`,label:a>1?`Uploading ${a} files...`:`Uploading...`}):(0,_.jsx)(`span`,{className:`text-[14px] font-medium ${v?`text-accent`:`text-foreground/70`}`,children:x}),(0,_.jsx)(`input`,{ref:u,type:`file`,multiple:!0,accept:e.accept,"aria-label":e.label,disabled:f,onChange:e=>m(e.target.files),className:`hidden`})]}),b&&(0,_.jsx)(`span`,{className:`text-[13px] text-red-500 font-medium mt-1.5`,children:b})]})}var Z=`rounded-2xl flex items-center justify-center shrink-0 border border-[var(--panel-border)]/50 bg-accent/10 text-accent`;function De({slot:e,timeZone:t,who:n,onChange:i}){let o=r.Zt(e,t),s=(n||``).trim();return(0,_.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-[var(--panel-border)]/60 bg-foreground/[0.015] px-3.5 py-3`,children:[(0,_.jsx)(`div`,{className:`w-10 h-10 ${Z}`,children:(0,_.jsx)(a.W,{className:`w-4 h-4`})}),(0,_.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1 gap-0.5`,children:[(0,_.jsx)(`span`,{className:`text-[14px] sm:text-[15px] font-bold text-foreground leading-tight truncate`,children:o.day}),(0,_.jsxs)(`span`,{className:`text-[12.5px] sm:text-[13px] font-semibold text-foreground/55 leading-tight tabular-nums truncate`,children:[o.time,s?` · with ${s}`:``]})]}),(0,_.jsxs)(`button`,{type:`button`,onClick:i,"aria-label":`Change the time`,className:`shrink-0 cursor-pointer flex items-center justify-center transition-all max-sm:w-9 max-sm:h-9 max-sm:rounded-xl max-sm:border max-sm:border-[var(--panel-border)] max-sm:text-foreground/50 max-sm:hover:text-accent max-sm:hover:border-accent/40 max-sm:active:scale-[0.98] sm:text-[12.5px] sm:font-bold sm:text-accent sm:hover:underline`,children:[(0,_.jsx)(c.t,{className:`w-3.5 h-3.5 sm:hidden`,"aria-hidden":!0}),(0,_.jsx)(`span`,{className:`max-sm:hidden`,children:`Change`})]})]})}var Oe=`booking_back`,ke=`fbos.bookingCheckout`,Ae=7200*1e3;function je(e){try{window.sessionStorage.setItem(ke,JSON.stringify({...e,at:Date.now()}))}catch{}}function Me(){try{let e=JSON.parse(window.sessionStorage.getItem(ke)||`null`);return!e||typeof e.sessionId!=`string`||!Array.isArray(e.bookingIds)||!(Date.now()-Number(e.at)<Ae)?null:{sessionId:e.sessionId,bookingIds:e.bookingIds.map(String),when:String(e.when||``),formId:String(e.formId||``),...typeof e.holdUntil==`number`?{holdUntil:e.holdUntil}:{},at:Number(e.at)}}catch{return null}}function Ne(){try{window.sessionStorage.removeItem(ke)}catch{}}var Pe=new Map;function Fe(e,t){let n=Pe.get(e);if(n)return n;let r=(async()=>{let n=t.holdPasses||{},r=Object.keys(n).length?(await a.s(n,`paid`)).refused.length===0:!0,i=Me();return!i||i.sessionId!==e||t.status!==`complete`&&!t.paid?{booked:null,held:r}:(Ne(),i.formId&&G(`form.${i.formId}`),{booked:i,held:r})})();return Pe.set(e,r),r}var Ie=`Paid. Your time will be confirmed shortly — the team has your booking.`,Le={letGo:`Nothing was charged, and the time was let go.`,lapses:`Nothing was charged. The time is free again within the hour.`,kept:`Nothing was charged. The time is still held for now — pick another, or ask the team to free it.`,paid:`That time is already paid for, and it is held for you.`,unknown:`Nothing was charged. The time could not be checked just now.`},Re=[`unknown`,`paid`,`kept`,`lapses`,`letGo`],ze=null;function Be(){let e=Me();return e?(Ne(),ze=(async()=>{let t=[],r={},i={};for(let a of e.bookingIds){let o=await n.kn(a,e.sessionId);typeof o==`string`?t.push(`unknown`):o.state===`free`?r[a]=o.pass:o.state===`paid`?(i[a]=o.pass,t.push(`paid`)):o.state===`gone`?t.push(`letGo`):o.state===`open`?t.push(`lapses`):t.push(e.holdUntil?`paid`:`kept`)}let[o]=await Promise.all([a.s(r,`letGo`),a.s(i,`paid`)]);return t.push(...o.written.map(()=>`letGo`),...o.refused.map(()=>`lapses`)),{pending:e,outcome:Re.find(e=>t.includes(e))||`letGo`}})(),ze):ze??Promise.resolve(null)}var Ve=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function He(e,t){let n=new URLSearchParams(t);n.delete(`session_id`),n.delete(Oe);let r=n.toString();return`${e}${r?`?${r}`:``}`}var Ue=(e,t=n.Lr())=>{try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t.toUpperCase()}).format(e)}catch{return`${e} ${t.toUpperCase()}`}},We=new Map,Ge=e=>{let t=We.get(e);return t||(t=(0,v.getDoc)((0,v.doc)(n.ui,`sys_payments`,e)).then(e=>e.exists()?f.g(e.data()):0),t.catch(()=>We.delete(e)),We.set(e,t)),t},Ke=3e3;function qe(e){let t=n.Rr()||`usd`,r=f._(e.map(e=>({paymentId:e}))).join(`,`),[i,a]=(0,g.useState)({key:``,amount:0,error:!1}),[o,s]=(0,g.useState)(0);return(0,g.useEffect)(()=>{if(!r)return;let e=!1,t;return Promise.all(r.split(`,`).map(Ge)).then(t=>{e||a({key:r,amount:Math.round(t.reduce((e,t)=>e+t,0)*100)/100,error:!1})}).catch(()=>{e||(a({key:r,amount:0,error:!0}),t=setTimeout(()=>s(e=>e+1),Ke))}),()=>{e=!0,clearTimeout(t)}},[r,o]),r?i.key===r?{loading:!1,amount:i.amount,error:i.error,currency:t}:{loading:!0,amount:0,error:!1,currency:t}:{loading:!1,amount:0,error:!1,currency:t}}var Je=new Set([`uid`,`formId`,`submittedAt`,`submitterName`,`submitterEmail`,`submitterAvatar`]),Ye=(e,t)=>{if(!e||typeof e!=`object`)return{};let n;try{n=JSON.parse(JSON.stringify(e))}catch{return{}}let r={};for(let[e,i]of Object.entries(n||{}))Je.has(e)||e in t||(r[e]=i);return r},Xe=n.si(()=>Promise.resolve().then(()=>require(`./PhoneInputField-WYdkNEym.cjs`))),Ze=n.si(()=>Promise.resolve().then(()=>require(`./AddressField-CI8PP5ow.cjs`))),Qe=/^[^\s@,;]+@[^\s@,;.]+(\.[^\s@,;.]+)*\.[a-z]{2,}$/i,$e=`The price of this time could not be read. Try again in a moment.`,et=`text-[13px] font-medium text-foreground/70 select-none mb-2`,tt=`text-[13px] text-red-500 font-medium mt-1.5`,nt=`block h-12 w-full text-[15px] text-foreground py-2 transition-all duration-300 placeholder:text-foreground/40 focus:outline-none focus:border-accent glow-focus disabled:cursor-not-allowed disabled:opacity-50 glass-panel`,Q={borderRadius:`var(--input-radius, 0.75rem)`},$=[.16,1,.3,1],rt=e=>{let t=new Set;return(Array.isArray(e)?e:[]).flatMap(e=>{let n=null;if(e&&typeof e==`object`){let t=String(e.value??``).trim()||String(e.label??``).trim();t&&(n={value:t,label:String(e.label??``).trim()||t})}else{let t=String(e??``);t.trim()&&(n={value:t,label:t})}return!n||t.has(n.value)?[]:(t.add(n.value),[n])})},it=e=>{let t=e.toUpperCase();if(t===`USD`)return`$`;try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t}).formatToParts(0).find(e=>e.type===`currency`)?.value||t}catch{return t}};function at({field:e,value:t,onChange:r}){n.Rr();let i=String(e.currencySymbol??``).trim()||it(n.Lr());return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`label`,{className:et,children:e.label}),(0,_.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,_.jsx)(`span`,{className:`absolute left-4 text-foreground/60 font-medium flex items-center h-full z-10 pointer-events-none text-[15px]`,children:i}),(0,_.jsx)(`input`,{required:e.required,type:`number`,placeholder:e.placeholder,value:t,onChange:e=>r(e.target.value),className:`${nt} pl-8 pr-4`,style:i.length>1?{...Q,paddingLeft:`calc(1.75rem + ${i.length}ch)`}:Q})]})]})}function ot({field:e,value:t,error:n,timeZone:i,onTimeZone:s,onChange:c}){let{schedules:l}=a._(),u=r.en(e),d=l.filter(e=>u.includes(e.id)&&r.P(e)),f=new Set(d.map(e=>e.memberId)).size>1,p=r.$t(e),m=p===`choose`&&f,[h,v]=(0,g.useState)(!1),y=f&&(p===`all`||m&&h),b=y?r.Et(d):[],[x]=(0,g.useState)(()=>new Date),S=a.C(d.map(e=>e.memberId),x),C=r.Z(t),w=e.look===`calendar`?o.n:o.c;return(0,_.jsxs)(`div`,{className:`flex flex-col w-full`,children:[(0,_.jsx)(`label`,{className:et,children:e.label}),m&&(0,_.jsx)(`div`,{className:`flex gap-1.5 mb-2.5 p-1 rounded-[var(--input-radius,0.75rem)] border border-[var(--panel-border)] bg-[var(--panel-bg)] w-fit`,children:[{on:!h,label:`One of them`,v:!1},{on:h,label:`All of them`,v:!0}].map(e=>(0,_.jsx)(`button`,{type:`button`,"aria-pressed":e.on,onClick:()=>{e.v!==h&&(v(e.v),c(``))},className:`px-3 h-8 rounded-[calc(var(--input-radius,0.75rem)-0.25rem)] text-[12.5px] font-semibold transition-all cursor-pointer ${e.on?`bg-accent text-[var(--button-fg,#fff)] shadow-sm`:`text-foreground/55 hover:text-foreground`}`,children:e.label},e.label))}),y&&(0,_.jsxs)(`p`,{className:`text-[12.5px] font-medium text-foreground/50 mb-2 ml-1`,children:[`Times `,r.St(b),` are all free.`]}),(0,_.jsx)(w,{members:d,value:C,onChange:e=>c(e?r.tt(e,y):``),taken:S,timeZone:i,onTimeZone:s,together:y}),n&&(0,_.jsx)(`span`,{className:tt,children:n})]})}var st=(e,t)=>{let r=e.find(e=>e.type===`text`&&/name/i.test(String(e.name||``)))||e.find(e=>e.type===`text`);return String(r&&t[r.name]||n.li.currentUser?.displayName||``).trim()},ct=(e,t)=>{let r=e.find(e=>e.type===`email`);return String(r&&t[r.name]||n.li.currentUser?.email||``).trim()},lt=(e,t,n,r)=>{let i={},a=(Array.isArray(n?.items)?n.items:[]).map(e=>{let t=String(e?.name||``).trim();return t?`${Number(e?.quantity)||1} × ${t}${e?.options?` — ${String(e.options)}`:``}`:``}).filter(Boolean).join(`
2
2
  `);a&&(i.Items=a);for(let n of e){if(!n?.name||n.type===`email`)continue;let e=t[n.name],a=(Array.isArray(e)?e.join(`, `):String(e??``)).trim();a&&a!==r&&(i[String(n.label||n.name).trim()||n.name]=a)}return i},ut=(e,t)=>{let n=r.$t(e);if(!(n===`all`||n===`choose`&&r.Q(t)))return[];let i=r.en(e),a=r.Et(r._t().filter(e=>i.includes(e.id)&&r.P(e)));return a.length>1?a:[]},dt=(e,t)=>{let n=r._t(),i=[];for(let a of e){let e=r.Z(t?.[a.name]);if(!e)continue;let o=ut(a,t[a.name]);for(let t of o.length?r.At(e,o):[e])i.push(r.Lt(t,n)?.paymentId||``)}return f._(i.map(e=>({paymentId:e})))};function ft(e,t){if(!t||!e.some(e=>e?.type===`schedule`))return{};let n={},r=String(t.email||``).trim(),i=e.find(e=>e?.type===`email`&&e.name);i&&r&&(n[i.name]=r);let a=String(t.displayName||``).trim(),o=e.find(e=>e?.type===`text`&&e.name&&/name/i.test(`${e.name} ${e.label||``}`));return o&&a&&(n[o.name]=a),n}function pt(e,t){let n={};for(let[r,i]of Object.entries(t||{})){if(i===``||i==null||i===!1)continue;let t=(e||[]).find(e=>e?.name&&(r===e.name||e.type===`address`&&r.startsWith(e.name)));!t||t.type===`schedule`||(n[r]=i)}return n}var mt=(e,t)=>Object.fromEntries(e.filter(e=>e.type!==`schedule`&&e.name&&t[e.name]!==void 0&&t[e.name]!==``).map(e=>[e.name,String(t[e.name])])),ht=(e,t)=>Object.fromEntries(Object.entries(Ye(e,t)).filter(([,e])=>e!=null&&e!==``).map(([e,t])=>[e,typeof t==`object`?JSON.stringify(t):String(t)])),gt=e=>!Array.isArray(e?.fields)||!e.fields.some(e=>e?.type===`schedule`)?e:{...e,fields:e.fields.filter(e=>e?.type!==`schedule`)};function _t({onClose:e,formId:i,formConfig:s,isInline:c,bare:x,onSubmitted:C,extra:w}){let[T,E]=(0,g.useState)({}),[D,O]=(0,g.useState)(`idle`),[k,A]=(0,g.useState)(``),[j,M]=(0,g.useState)({}),[N,P]=(0,g.useState)(()=>r.et()),[F,ee]=(0,g.useState)(``),[I,L]=(0,g.useState)(!1),R=(0,g.useRef)(null),te=(0,g.useRef)(null),ne=(0,g.useRef)(0),re=(0,g.useRef)(null),ie=(0,g.useContext)(n.et),[ae,z]=(0,g.useState)(s||null),B=(0,g.useMemo)(()=>gt(ae),[ae]),[oe,V]=(0,g.useState)(!s),se=(0,y.useNavigate)(),ce=n.mi(),{user:le}=n.Ft(),ue=m.i(),de=m.r(i)||ue,fe=ft(B?.fields||[],le),H=String(le?.displayName||``).trim(),he=String(le?.email||``).trim(),U=qe(dt((B?.fields||[]).filter(e=>e?.type===`schedule`),T)),W=e=>{let n=(typeof window<`u`?window.__FBOS_FORMS__:null)||{};return ce?.defaultConfigs?.[e]||ce?.defaultConfigs?.[`${e}Form`]||n[e]||(e===`contact`?t.a:e===`support`?t.r:null)};(0,g.useEffect)(()=>{if(s){z(s),V(!1);return}if(!i){z(W(`contact`)),V(!1);return}if(!localStorage.getItem(`fbos_custom_form_${i}`)){let e=W(i);if(e){z(e),V(!1);return}}try{let e=localStorage.getItem(`fbos_form_${i}`);e&&(z(JSON.parse(e)),V(!1))}catch{}(async()=>{try{let e=await(0,v.getDoc)((0,v.doc)(n.ui,`sys_forms`,i));if(e.exists()){let t={...e.data(),id:e.id};z(t),localStorage.setItem(`fbos_form_${i}`,JSON.stringify(t))}else{let e=W(i);e&&(z(e),localStorage.removeItem(`fbos_custom_form_${i}`))}}catch(e){console.error(`Failed to load form config:`,e);let t=W(i);t&&z(t)}finally{V(!1)}})()},[i,s]),(0,g.useEffect)(()=>{B&&B.fields&&E(e=>{let t={...e},r=!1;return B.fields.forEach(e=>{(e.name===`contactEmail`||e.type===`email`)&&!t[e.name]&&n.li.currentUser?.email&&(t[e.name]=n.li.currentUser.email,r=!0)}),r?t:e})},[B]);let G=ve(`form.${i||``}`,{}),ge=(0,g.useRef)(!1),_e=G.setValue,ye=G.clear;(0,g.useEffect)(()=>{!i||!ge.current||D===`success`||_e(pt(B?.fields||[],T))},[i,T,B,D,_e]),(0,g.useEffect)(()=>{if(!i||ge.current||!G.ready||!B?.fields)return;ge.current=!0;let e=Me();if(e&&e.formId===i&&new URLSearchParams(window.location.search).get(`session_id`)===e.sessionId){ye();return}let t=pt(B.fields,G.value);Object.keys(t).length&&E(e=>({...t,...e}))},[i,G.ready,G.value,B,ye]),(0,g.useEffect)(()=>{function t(t){re.current&&!re.current.contains(t.target)&&e?.()}return document.addEventListener(`mousedown`,t),()=>document.removeEventListener(`mousedown`,t)},[e]),(0,g.useEffect)(()=>{if(c)return;let t=t=>{t.key===`Escape`&&!t.defaultPrevented&&(t.preventDefault(),e?.())};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e,c]),(0,g.useEffect)(()=>{if(!c&&!ie){let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=l.n()>0?`hidden`:e}}},[c,ie]);let K=async o=>{o.preventDefault();let l=(B?.fields||[]).filter(e=>e.type===`email`),u={},d={};l.forEach(e=>{let t=String(T[e.name]??``).trim();t&&(d[e.name]=t,Qe.test(t)||(u[e.name]=`That does not look like an email address — check for a typo, e.g. jane@example.com`))}),(B?.fields||[]).filter(e=>e.type===`address`).forEach(e=>{Object.assign(d,p.r(e.name,p.u(p.i(e.name,T))))}),(B?.fields||[]).filter(e=>e.type===`file`&&e.required&&!T[e.name]).forEach(e=>{u[e.name]=`Please attach a file before sending.`});let m=(B?.fields||[]).filter(e=>e.type===`schedule`);if(m.filter(e=>e.required&&!r.Z(T[e.name])).forEach(e=>{u[e.name]=`Pick a time before sending.`}),(B?.fields||[]).filter(e=>e.type===`select`&&e.required&&rt(e.options).length>0).filter(e=>!String(T[e.name]??``).trim()).forEach(e=>{u[e.name]=`Pick one before sending.`}),Object.keys(u).length>0){M(u);return}M({});let g=dt(m,T).length>0;if(!(g&&U.loading)){if(g&&(U.error||U.amount<=0)){O(`error`),A($e);return}O(`loading`),A(``);try{let o=t.n(B),l=i||B?.systemName||B?.title||`unknown`,u=[],p=[],_=async()=>{for(let e of p)await a.l(e)},y=r._t(),b=g?Date.now()+f.a:0;for(let e of m){let t=r.Z(T[e.name]);if(!t)continue;let n=ut(e,T[e.name]),i=n.length?r.At(t,n):[t],o=[],s=null;for(let e of i){if(g){let t=await a.o(e,b);`error`in t?s=t.error:b=t.holdUntil}else s=await a.i(e);if(s)break;p.push(e);let t=r.Lt(e,y);o.push({slot:e,memberName:t?.memberName||``,scheduleId:t?.id||e.scheduleId,paymentId:t?.paymentId||``,scheduleName:r.xt(t,String(B?.title||``))})}if(s){await _(),M({[e.name]:s}),O(`idle`);return}u.push({field:e,slot:t,whoName:n.length?r.St(n):o[0]?.memberName||``,each:o})}let x={...T,...d,...fe};for(let e of u)delete x[e.field.name],Object.assign(x,r.z(e.field.name,e.slot,e.whoName,N));let S=n.li.currentUser?{uid:n.li.currentUser.uid,submitterName:n.li.currentUser.displayName||``,submitterEmail:n.li.currentUser.email||``,submitterAvatar:n.li.currentUser.photoURL||``}:{uid:`guest`},D=u.length>0,k;if(D)k=(0,v.doc)((0,v.collection)(n.ui,o));else try{k=await(0,v.addDoc)((0,v.collection)(n.ui,o),{...Ye(w,x),...x,...S,formId:l,submittedAt:(0,v.serverTimestamp)(),...B?.transaction===!0?{transaction:!0}:{}})}catch(e){throw await _(),e}let j=B?.fields||[],P=u.flatMap(e=>e.each.map(e=>({bookingId:r.qt(e.slot.memberId,e.slot.start),scheduleId:e.scheduleId}))),F=u.map(e=>r.q(e.slot,e.whoName,N)).join(`; `),I=null;if(g){let e=He(window.location.pathname,window.location.search),t=await n.jn({legs:P,when:F,name:st(j,x),email:ct(j,x),successPath:e,cancelPath:Ve(e,Oe,`1`)});if(typeof t==`string`){await _(),O(`error`),A(t);return}I=t}let L=``;for(let e of u)for(let t of e.each){let e=await a.A(t.slot,{memberName:t.memberName,scheduleId:t.scheduleId,scheduleName:t.scheduleName,timeZone:N,name:st(j,x),email:ct(j,x),answers:{...ht(w,x),...mt(j,x)},formId:l,entryId:k.id,paymentId:I?t.paymentId:``,paymentSession:I?.sessionId||``,holdUntil:I?b:0});if(e){await _(),O(`error`),A(e);return}L||=r.qt(t.slot.memberId,t.slot.start)}if(I){je({sessionId:I.sessionId,bookingIds:P.map(e=>e.bookingId),when:F,formId:i||``,holdUntil:b});try{C?.(Object.fromEntries(Object.entries(x).map(([e,t])=>[e,String(t??``)])),{collection:r.t,id:L})}catch{}n.On.goTo(I.url);return}if(u.length&&ee(F),O(`success`),i&&G.clear(),de?.asks&&!D&&B?.transaction!==!0){let e=st(j,x);h.o(de.page,{formName:String(B?.title||``),name:e,email:ct(j,x),details:lt(j,x,w,e)})}try{C?.(Object.fromEntries(Object.entries(x).map(([e,t])=>[e,String(t??``)])),D?{collection:r.t,id:L}:{collection:o,id:k.id})}catch{}let R=!!B?.redirectTo&&!s;if(c&&!e&&!R)return;setTimeout(()=>{R&&(B.redirectTo.startsWith(`/`)?se(B.redirectTo):window.location.href=B.redirectTo),e?.(),O(`idle`),E({}),ee(``)},3e3)}catch(e){console.error(`Submission error:`,e),O(`error`),A(`We could not send your message right now. Please try again.`)}}},[be,xe]=(0,g.useState)(!1),q=n.tt();if((0,g.useEffect)(()=>{let e;return oe||!B&&!s?e=setTimeout(()=>xe(!0),150):xe(!1),()=>clearTimeout(e)},[oe,B,s]),(0,g.useLayoutEffect)(()=>{if(D!==`success`){I&&L(!1);return}if(I)return;let e=()=>{ne.current=R.current?.getBoundingClientRect().height||0,L(!0)};if(q){e();return}let t=setTimeout(e,180);return()=>clearTimeout(t)},[D,I,q]),(0,g.useLayoutEffect)(()=>{if(!(!I||!R.current||!te.current))return Se(R.current,te.current,ne.current,!!q)},[I]),oe||!B)return be?c?(0,_.jsx)(`div`,{className:`w-full flex items-center justify-center py-[10vh]`,children:(0,_.jsx)(d.t,{size:`sm`,label:`Loading the form`})}):(0,b.createPortal)((0,_.jsx)(`div`,{className:`fixed inset-0 z-[9995] flex items-center justify-center bg-background/10 backdrop-blur-sm`,children:(0,_.jsx)(`div`,{className:`px-5 py-4 glass-popover border border-[var(--panel-border)]`,style:{borderRadius:`var(--card-radius, 1.5rem)`},children:(0,_.jsx)(d.t,{size:`sm`,label:`Loading the form`})})}),document.body):null;let J=(B.fields||[]).find(e=>e.type===`schedule`&&e.look===`calendar`),Y=J?r.Z(T[J.name]):null,X=!!J&&!Y,Ce=X?`max-w-[880px]`:`max-w-[500px]`,we=Y?ut(J,T[J.name]):[],Te=Y?we.length?r.St(we):r.Lt(Y,r._t())?.memberName||``:``,Z=e=>q?{initial:!1}:{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.35,ease:$,delay:Math.min(e,12)*.04}},ke=!X&&Object.keys(fe).length>0,Ae=+!!J+ +!!ke,Ne=D===`success`&&!I,Pe=D===`loading`||Ne,Fe=U.loading?`Checking the price…`:U.amount>0?`Book and pay ${Ue(U.amount)}`:U.error?`Book and pay`:B.submitText||B.buttonName||`Submit`,Ie=!!c&&!e&&!(B.redirectTo&&!s),Le=(0,_.jsx)(`div`,{ref:R,className:`relative z-10 w-full`,children:I?(0,_.jsx)(`div`,{ref:te,children:(0,_.jsxs)(n.nt.div,{role:`status`,"aria-live":`polite`,initial:q?!1:{opacity:0},animate:{opacity:1},transition:{duration:.35,ease:$},className:`flex flex-col items-center text-center gap-2 py-2`,children:[(0,_.jsxs)(`div`,{className:`flex items-center justify-center gap-2.5`,children:[(0,_.jsx)(`svg`,{viewBox:`0 0 20 20`,className:`w-5 h-5 text-accent shrink-0`,fill:`none`,"aria-hidden":`true`,children:(0,_.jsx)(n.nt.path,{d:`M4 10.5l4 4 8-9`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,initial:q?!1:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:1},transition:{duration:.45,ease:$,delay:.15}})}),(0,_.jsx)(`h4`,{className:`text-lg font-semibold text-foreground tracking-tight`,children:`Sent. Thank you.`})]}),F?(0,_.jsxs)(`p`,{className:`text-[14px] font-medium text-foreground leading-relaxed`,children:[`Booked: `,F]}):(0,_.jsx)(`p`,{className:`text-[14px] text-foreground/60 leading-relaxed`,children:`We'll be in touch soon.`}),Ie&&(0,_.jsx)(`button`,{type:`button`,onClick:()=>{O(`idle`),E({}),ee(``)},className:`mt-1 text-[13px] font-medium text-foreground/50 hover:text-foreground underline-offset-4 hover:underline transition-colors`,children:F?`Book another time`:`Send another`})]},`sent`)}):(0,_.jsxs)(n.nt.div,{initial:!1,animate:{opacity:+!Ne},transition:{duration:.18,ease:$},children:[(0,_.jsxs)(`div`,{className:c&&x?`sr-only`:`mb-7`,children:[(0,_.jsx)(`h3`,{className:`text-[22px] sm:text-2xl font-semibold text-foreground tracking-tight leading-snug break-words`,children:B.title}),B.description&&(0,_.jsx)(`p`,{className:`mt-1.5 text-[14px] text-foreground/60 leading-relaxed`,children:B.description})]}),(0,_.jsx)(n.rt,{initial:!1,children:D===`error`&&k&&(0,_.jsx)(n.nt.p,{role:`alert`,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:.2,ease:$},className:`mb-5 text-[13px] font-medium text-red-500 leading-relaxed`,children:k},`error`)}),(0,_.jsxs)(`form`,{onSubmit:K,"aria-busy":Pe||void 0,className:`flex flex-col gap-5 w-full`,children:[J&&(0,_.jsx)(n.nt.div,{...Z(0),className:`w-full`,children:Y?(0,_.jsx)(De,{slot:Y,timeZone:N,who:Te,onChange:()=>E(e=>({...e,[J.name]:``}))}):(0,_.jsx)(ot,{field:J,value:T[J.name]||``,error:j[J.name],timeZone:N,onTimeZone:P,onChange:e=>E(t=>({...t,[J.name]:e}))})},Y?`picked`:`calendar`),ke&&(0,_.jsxs)(n.nt.div,{...Z(+!!J),className:`flex items-center gap-2 px-4 py-3 border border-[var(--panel-border)]`,style:Q,children:[(0,_.jsx)(`span`,{className:`text-[13px] font-medium text-foreground/60 shrink-0`,children:`Booking as`}),(0,_.jsx)(`span`,{className:`text-[14px] font-medium text-foreground truncate`,children:[H,he].filter(Boolean).join(` · `)})]}),!X&&[...B.fields||[]].filter(e=>e!==J&&!(e.name in fe)).sort((e,t)=>{let n=e.type===`checkbox`,r=t.type===`checkbox`;return n&&!r?1:!n&&r?-1:0}).map((e,t)=>{let r=Z(Ae+t),i=()=>{j[e.name]&&M(t=>{let n={...t};return delete n[e.name],n})};if(e.type===`schedule`)return(0,_.jsx)(n.nt.div,{...r,className:`w-full`,children:(0,_.jsx)(ot,{field:e,value:T[e.name]||``,error:j[e.name],timeZone:N,onTimeZone:P,onChange:t=>{E(n=>({...n,[e.name]:t})),i()}})},t);if(e.type===`tel`)return(0,_.jsx)(n.nt.div,{...r,className:`w-full`,children:(0,_.jsx)(g.Suspense,{fallback:(0,_.jsx)(`div`,{className:`h-12 w-full glass-panel animate-pulse`,style:Q}),children:(0,_.jsx)(Xe,{field:e,value:T[e.name]||``,onChange:t=>E(n=>({...n,[e.name]:t}))})})},t);if(e.type===`address`)return(0,_.jsx)(n.nt.div,{...r,className:`w-full`,children:(0,_.jsx)(g.Suspense,{fallback:(0,_.jsx)(`div`,{className:`h-12 w-full glass-panel animate-pulse`,style:Q}),children:(0,_.jsx)(Ze,{id:`form-${e.name}`,label:e.label,required:e.required,placeholder:e.placeholder,error:j[e.name],value:p.i(e.name,T),onChange:t=>{E(n=>({...n,...p.r(e.name,t)})),i()}})})},t);if(e.type===`file`)return(0,_.jsx)(n.nt.div,{...r,className:`w-full`,children:(0,_.jsx)(Ee,{field:e,value:T[e.name]||``,error:j[e.name],onChange:t=>{E(n=>({...n,[e.name]:t(n[e.name]||``)})),i()}})},t);if(e.type===`textarea`)return(0,_.jsx)(n.nt.div,{...r,className:`w-full`,children:(0,_.jsx)(me,{label:e.label,required:e.required,placeholder:e.placeholder,value:T[e.name]||``,onChange:t=>E(n=>({...n,[e.name]:t.target.value}))})},t);if(e.type===`select`)return(0,_.jsxs)(n.nt.div,{...r,className:`flex flex-col w-full`,children:[(0,_.jsx)(n.Z,{label:e.label,direction:`auto`,value:T[e.name]||``,options:[{value:``,label:(0,_.jsx)(`span`,{className:`text-foreground/40`,children:`Select an option...`})},...rt(e.options)],onChange:t=>{E(n=>({...n,[e.name]:t})),i()}}),j[e.name]&&(0,_.jsx)(`span`,{className:tt,children:j[e.name]})]},t);if(e.type===`checkbox`){let i=!!T[e.name];return(0,_.jsxs)(n.nt.label,{...r,className:`flex items-start gap-3 w-full cursor-pointer group py-1`,children:[(0,_.jsxs)(`span`,{className:`relative mt-0.5 flex items-center justify-center w-5 h-5 shrink-0 rounded-md border border-foreground/25 group-hover:border-accent/60 group-focus-within:border-accent group-focus-within:ring-[3px] group-focus-within:ring-accent/20 transition-colors`,children:[(0,_.jsx)(`input`,{type:`checkbox`,required:e.required,checked:i,onChange:t=>E(n=>({...n,[e.name]:t.target.checked})),className:`absolute inset-0 opacity-0 w-full h-full cursor-pointer`}),i&&(0,_.jsx)(`span`,{className:`w-2.5 h-2.5 bg-accent rounded-[3px] shrink-0`})]}),(0,_.jsx)(`span`,{className:`text-[14px] text-foreground/80 leading-snug group-hover:text-foreground transition-colors`,children:e.label})]},t)}if(e.type===`date`){let i=T[e.name]||``;return(0,_.jsxs)(n.nt.div,{...r,className:`flex flex-col w-full relative`,children:[(0,_.jsx)(`label`,{className:et,children:e.label}),(0,_.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,_.jsx)(`input`,{type:`date`,required:e.required,value:i,onChange:t=>E(n=>({...n,[e.name]:t.target.value})),className:`date-field ${nt} pl-4 pr-11 ${i?`text-foreground`:`text-foreground/40`}`,style:Q}),(0,_.jsx)(S,{className:`w-4 h-4 text-foreground/40 absolute right-4 pointer-events-none`})]})]},t)}return e.type===`age`?(0,_.jsx)(n.nt.div,{...r,className:`w-full`,children:(0,_.jsx)(pe,{label:e.label,required:e.required,type:`number`,min:0,max:120,placeholder:e.placeholder||`Age (Max 120)`,value:T[e.name]||``,onChange:t=>{let n=t.target.value;if(n===``)E(t=>({...t,[e.name]:``}));else{let t=Math.max(0,Math.min(120,parseInt(n,10)));E(n=>({...n,[e.name]:isNaN(t)?``:String(t)}))}}})},t):e.type===`currency`||e.type===`number`&&e.name===`budget`?(0,_.jsx)(n.nt.div,{...r,className:`flex flex-col w-full relative`,children:(0,_.jsx)(at,{field:e,value:T[e.name]||``,onChange:t=>E(n=>({...n,[e.name]:t}))})},t):(0,_.jsx)(n.nt.div,{...r,className:`w-full`,children:(0,_.jsx)(pe,{label:e.label,required:e.required,type:e.type,placeholder:e.placeholder,currencySymbol:e.currencySymbol,error:j[e.name],value:T[e.name]||``,onChange:t=>{E(n=>({...n,[e.name]:t.target.value})),i()}})},t)}),Y?(0,_.jsxs)(`div`,{className:`flex flex-col gap-4 pt-1`,children:[(0,_.jsx)(`div`,{className:`h-px bg-[var(--panel-border)]/60`}),(0,_.jsx)(o.u,{timeZone:N,onTimeZone:P,action:(0,_.jsx)(u.t,{type:`submit`,className:`max-sm:w-full h-11 px-6 text-[13.5px] font-semibold shrink-0`,isLoading:Pe,disabled:U.loading,children:Fe})})]}):!X&&(0,_.jsx)(n.nt.div,{...Z(Ae+(B.fields||[]).length),className:`pt-2`,children:(0,_.jsx)(u.t,{type:`submit`,className:`w-full h-12 text-[15px] font-semibold`,isLoading:Pe,disabled:U.loading,children:Fe})})]})]})});return c&&x?(0,_.jsx)(`div`,{className:`form-calm w-full ${Ce} mx-auto relative transition-[max-width] duration-500 ease-out`,children:Le}):c?(0,_.jsx)(`div`,{className:`form-calm w-full flex justify-center flex-col items-center`,children:(0,_.jsx)(n.nt.div,{initial:q?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,ease:$},className:`w-full ${Ce} p-6 sm:p-8 glass-form relative shadow-[0_8px_32px_rgba(0,0,0,0.06)] z-10 mx-auto transition-[max-width] duration-500 ease-out`,style:{borderRadius:`var(--card-radius, 1.5rem)`},children:Le})}):(0,b.createPortal)((0,_.jsxs)(`div`,{className:`form-calm fixed inset-0 z-[9995] flex items-start justify-center p-4 py-20 md:py-10 h-[-webkit-fill-available] md:h-screen w-screen overflow-y-auto no-scrollbar`,children:[(0,_.jsx)(n.nt.div,{onClick:e,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},className:`fixed inset-0 bg-background/60 backdrop-blur-xl cursor-pointer`}),(0,_.jsx)(n.nt.div,{initial:q?!1:{opacity:0,scale:.98,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:10},transition:{duration:.35,ease:$},ref:re,className:`w-full ${Ce} p-6 sm:p-8 glass-popover relative z-10 mx-auto my-auto border border-[var(--panel-border)] shrink-0 transition-[max-width] duration-500 ease-out`,style:{borderRadius:`var(--card-radius, 1.5rem)`},children:Le})]}),document.body)}Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return pe}});
@@ -1,18 +1,18 @@
1
1
  import { a as e, n as t, r as n } from "./forms-C2IxnO9p.js";
2
- import { $ as r, A as i, B as a, Ct as o, Et as s, Ft as c, L as l, Lr as u, N as d, O as f, On as p, P as m, Q as h, Rr as g, St as _, Tt as v, Z as y, _t as b, at as x, bt as S, ct as C, dt as w, et as T, ft as E, gt as D, ht as O, it as k, jn as ee, kn as A, li as j, lt as M, mi as N, mt as P, nt as F, ot as te, pt as I, rt as ne, si as L, st as re, tt as ie, ui as ae, ut as R, vt as oe, wt as se, xt as ce, yt as le, z as ue } from "./TimeZoneField-Dv389mAe.js";
2
+ import { $ as r, A as i, B as a, Ct as o, Et as s, Ft as c, L as l, Lr as u, N as d, O as f, On as p, P as m, Q as h, Rr as g, St as _, Tt as v, Z as y, _t as b, at as x, bt as S, ct as C, dt as w, et as T, ft as E, gt as D, ht as O, it as k, jn as ee, kn as A, li as j, lt as M, mi as N, mt as P, nt as F, ot as te, pt as I, rt as ne, si as L, st as re, tt as ie, ui as ae, ut as R, vt as oe, wt as se, xt as ce, yt as le, z as ue } from "./TimeZoneField-oIMwb5_X.js";
3
3
  import { $t as de, At as fe, Et as pe, Lt as me, P as he, Q as z, St as ge, Z as _e, Zt as ve, _t as ye, en as B, et as be, q as xe, qt as Se, t as Ce, tt as we, xt as Te, z as Ee } from "./schedule-C13m_kiO.js";
4
4
  import { n as De } from "./chevron-down--LwXEv9w.js";
5
- import { A as Oe, C as ke, W as Ae, _ as je, i as Me, l as Ne, o as Pe, s as V } from "./scheduleData-BLCUm84s.js";
6
- import { c as H, n as U, u as Fe } from "./BookingCalendar-_xoRa2tL.js";
5
+ import { A as Oe, C as ke, W as Ae, _ as je, i as Me, l as Ne, o as Pe, s as V } from "./scheduleData-DR6A-Q7Z.js";
6
+ import { c as H, n as U, u as Fe } from "./BookingCalendar-Bej__mIs.js";
7
7
  import { t as W } from "./x-hax8aKt8.js";
8
8
  import { t as Ie } from "./pencil-CLQlJdep.js";
9
- import { n as Le } from "./Popup-DmPEk98h.js";
10
- import { t as Re } from "./Button-DSldWACF.js";
11
- import { t as ze } from "./Loader-DP_dL5qC.js";
9
+ import { n as Le } from "./Popup-Bi63lzoS.js";
10
+ import { t as Re } from "./Button-BGN6q7lY.js";
11
+ import { t as ze } from "./Loader-CVoz1Zf0.js";
12
12
  import { _ as Be, a as Ve, g as He } from "./bookingHold-DX9zPdMr.js";
13
13
  import { i as Ue, r as We, u as Ge } from "./address-4GXKgkSk.js";
14
14
  import { i as Ke, r as qe } from "./formPage-BcnATn6R.js";
15
- import { o as Je } from "./email-DxxovRtf.js";
15
+ import { o as Je } from "./email-PBHbXXgR.js";
16
16
  import Ye, { Suspense as Xe, useCallback as G, useContext as Ze, useEffect as K, useId as Qe, useLayoutEffect as $e, useMemo as et, useRef as q, useState as J } from "react";
17
17
  import { Fragment as tt, jsx as Y, jsxs as X } from "react/jsx-runtime";
18
18
  import { addDoc as nt, collection as rt, doc as it, getDoc as at, serverTimestamp as ot } from "firebase/firestore";
@@ -1 +1 @@
1
- require(`./chunk-CiTBaPhY.cjs`);const e=require(`./PageTitle-BWmE74WQ.cjs`),t=require(`./TimeZoneField-zR8N2Fj0.cjs`),n=require(`./schedule-BAea6q8_.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`);function a({title:a,path:o,hint:s}){let[c,l]=(0,r.useState)(!1),u=n.C(o);return(0,i.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2.5 rounded-2xl border border-[var(--panel-border)] bg-[var(--panel-bg)]`,children:[(0,i.jsxs)(`div`,{className:`flex-1 min-w-0 flex flex-col`,children:[(0,i.jsx)(`span`,{className:`text-[13px] font-semibold text-foreground/80 truncate`,children:a}),(0,i.jsx)(`span`,{className:`text-[12px] font-medium text-foreground/45 truncate`,children:s||u})]}),(0,i.jsx)(t.C,{to:o,title:`View ${a}`,children:`View page`}),(0,i.jsx)(t.o,{icon:c?t.At:e._,compact:!0,title:`Copy the link to ${a}`,onClick:()=>{try{navigator.clipboard?.writeText(u)?.catch(()=>{})}catch{}l(!0),setTimeout(()=>l(!1),1500)},children:c?`Copied`:`Copy link`})]})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
1
+ require(`./chunk-CiTBaPhY.cjs`);const e=require(`./PageTitle-DQkvCB11.cjs`),t=require(`./TimeZoneField-Ckn1pKAL.cjs`),n=require(`./schedule-BAea6q8_.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`);function a({title:a,path:o,hint:s}){let[c,l]=(0,r.useState)(!1),u=n.C(o);return(0,i.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2.5 rounded-2xl border border-[var(--panel-border)] bg-[var(--panel-bg)]`,children:[(0,i.jsxs)(`div`,{className:`flex-1 min-w-0 flex flex-col`,children:[(0,i.jsx)(`span`,{className:`text-[13px] font-semibold text-foreground/80 truncate`,children:a}),(0,i.jsx)(`span`,{className:`text-[12px] font-medium text-foreground/45 truncate`,children:s||u})]}),(0,i.jsx)(t.C,{to:o,title:`View ${a}`,children:`View page`}),(0,i.jsx)(t.o,{icon:c?t.At:e._,compact:!0,title:`Copy the link to ${a}`,onClick:()=>{try{navigator.clipboard?.writeText(u)?.catch(()=>{})}catch{}l(!0),setTimeout(()=>l(!1),1500)},children:c?`Copied`:`Copy link`})]})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
@@ -1,5 +1,5 @@
1
- import { _ as e } from "./PageTitle-DFGW71q8.js";
2
- import { At as t, C as n, o as r } from "./TimeZoneField-Dv389mAe.js";
1
+ import { _ as e } from "./PageTitle-DCoUQWw6.js";
2
+ import { At as t, C as n, o as r } from "./TimeZoneField-oIMwb5_X.js";
3
3
  import { C as i } from "./schedule-C13m_kiO.js";
4
4
  import { useState as a } from "react";
5
5
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
@@ -1,8 +1,8 @@
1
- import { b as e, f as t, g as n, h as r, m as i, p as a, y as o } from "./PageTitle-DFGW71q8.js";
2
- import { Ft as s, Ln as c, mi as l, nt as u, rt as d, ui as f, zn as p } from "./TimeZoneField-Dv389mAe.js";
1
+ import { b as e, f as t, g as n, h as r, m as i, p as a, y as o } from "./PageTitle-DCoUQWw6.js";
2
+ import { Ft as s, Ln as c, mi as l, nt as u, rt as d, ui as f, zn as p } from "./TimeZoneField-oIMwb5_X.js";
3
3
  import { Bn as m, Fn as ee, Gn as h, Kn as g, Ln as _, Nn as te, On as v, Un as ne, _n as y } from "./schedule-C13m_kiO.js";
4
4
  import { n as b } from "./chevron-down--LwXEv9w.js";
5
- import { W as x, b as re } from "./scheduleData-BLCUm84s.js";
5
+ import { W as x, b as re } from "./scheduleData-DR6A-Q7Z.js";
6
6
  import { c as S, n as ie, o as ae, r as oe, t as C } from "./tabAudience-DJ6H5Uth.js";
7
7
  import { createContext as w, useContext as T, useEffect as E, useLayoutEffect as D, useMemo as se, useRef as ce, useState as O } from "react";
8
8
  import { Fragment as le, jsx as k, jsxs as A } from "react/jsx-runtime";