@remit/web-client-dist 0.0.496 → 0.0.498
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.
- package/assets/{BriefPane-BooVjgYq.js → BriefPane-DNjYoZ5W.js} +1 -1
- package/assets/{CalendarComposePane-CnOBd5yn.js → CalendarComposePane-DSTGkUg1.js} +1 -1
- package/assets/{CalendarComposeSeed-D2QLz4LO.js → CalendarComposeSeed-D2-h5yfx.js} +1 -1
- package/assets/{CalendarShell-DWbGqBof.js → CalendarShell-hxAj3RCw.js} +1 -1
- package/assets/{EmptyState-mmhe0UXh.js → EmptyState-BNZ4rODe.js} +1 -1
- package/assets/{ErrorState-CyJvvOAI.js → ErrorState-BtilFfMz.js} +1 -1
- package/assets/{FlaggedPane-BywgS8ID.js → FlaggedPane-vVIomL6t.js} +1 -1
- package/assets/{FullCompose-DT6le_GZ.js → FullCompose-BYAe64Df.js} +1 -1
- package/assets/{MailListHeader-D3IWdHLy.js → MailListHeader-D3XzKKg6.js} +1 -1
- package/assets/{MailNav-9WR4j1MV.js → MailNav-CddPjjRg.js} +1 -1
- package/assets/{MailShell-B5VeTGmN.js → MailShell-PzyuiJnk.js} +1 -1
- package/assets/{MailViewChrome-RELCgtqj.js → MailViewChrome-BCGNFEJ0.js} +1 -1
- package/assets/{MailboxPane-DyxwjtWJ.js → MailboxPane-Cei3VENC.js} +1 -1
- package/assets/{NavMenuButton-Beqz-c1F.js → NavMenuButton-Dbn2UxrU.js} +1 -1
- package/assets/{OnboardingWizard-C4O5bTJK.js → OnboardingWizard-j_6mMm1N.js} +1 -1
- package/assets/{OpenCalendarEvent-BJrF-Iaf.js → OpenCalendarEvent-B3jr425h.js} +1 -1
- package/assets/{OutboxPane-BTkrxHzW.js → OutboxPane-C5btZSEO.js} +1 -1
- package/assets/_calendarObjectId-Flm4StBb.js +1 -0
- package/assets/_mailboxId-u-CcdMke.js +1 -0
- package/assets/_messageId-BCaXGBWT.js +1 -0
- package/assets/_messageId-BOvqtCYe.js +1 -0
- package/assets/_messageId-fMj5eWC0.js +1 -0
- package/assets/_outboxMessageId-CoX2Gzjj.js +1 -0
- package/assets/_recurrenceId-BRpcgOng.js +1 -0
- package/assets/_threadId-7T2GLnpU.js +1 -0
- package/assets/_threadId-CBYj8trN.js +1 -0
- package/assets/_threadId-CEF_Qhob.js +1 -0
- package/assets/{_view._date-BSGr6G_g.js → _view._date-Cf-AYmIb.js} +1 -1
- package/assets/{accounts-BXyx3B4M.js → accounts-DngJbEU8.js} +1 -1
- package/assets/{advanced-DuyKnOVy.js → advanced-B0OaWYz_.js} +1 -1
- package/assets/{appearance-Ov7OYqTp.js → appearance-DGCy4Ols.js} +1 -1
- package/assets/{attachment-file-CswBNiC7.js → attachment-file-BJFaXvRO.js} +1 -1
- package/assets/{avatar-CPvj3paJ.js → avatar-C10lunoa.js} +1 -1
- package/assets/{bottom-sheet-B95LMIfy.js → bottom-sheet-8IzLQias.js} +1 -1
- package/assets/brief-BesAXTmU.js +1 -0
- package/assets/{brief-CQ5ZKbKe.js → brief-DaHBrlcF.js} +1 -1
- package/assets/{browser-ponyfill-BpfljEOn.js → browser-ponyfill-BM7kTsvb.js} +1 -1
- package/assets/{bug-CVsSJbrT.js → bug-CixXpMeP.js} +1 -1
- package/assets/{calendar-CDxFoogD.js → calendar-S6kyPLhs.js} +1 -1
- package/assets/{calendar-days-BnXJFMiG.js → calendar-days-DUJNDPSw.js} +1 -1
- package/assets/{card-DlzwETQ6.js → card-BXw0pcK1.js} +1 -1
- package/assets/chevron-left-D_5sOBUq.js +1 -0
- package/assets/{circle-check-b3PBNZX-.js → circle-check-CozsCqWq.js} +1 -1
- package/assets/{circle-check-big-CgNCXQJK.js → circle-check-big-BSzMiP3i.js} +1 -1
- package/assets/{circle-help-CYxORhIV.js → circle-help-MoXjqXC8.js} +1 -1
- package/assets/{clock-C57mSKvQ.js → clock-Bvb6Om5r.js} +1 -1
- package/assets/compose._-_outboxMessageId_-BX_0wEq1.js +1 -0
- package/assets/compose._-_outboxMessageId_-Baq34Jvz.js +1 -0
- package/assets/compose._-_outboxMessageId_-CEw8Zb9K.js +1 -0
- package/assets/compose._-_outboxMessageId_-CxDpFeHx.js +1 -0
- package/assets/{config-import-Dql5Sx2N.js → config-import-DfOMslTV.js} +1 -1
- package/assets/{confirm-dialog-B9Mx40Qi.js → confirm-dialog-DzL02Vjs.js} +1 -1
- package/assets/{credential-steps-BSZ2cvrf.js → credential-steps-Rb1Gb-Ws.js} +1 -1
- package/assets/{download-CAubAv0f.js → download-CKBt5eu3.js} +1 -1
- package/assets/{filters-C1UPixAb.js → filters-D1iPdv1S.js} +1 -1
- package/assets/flagged-epo_-OxW.js +1 -0
- package/assets/{flagged-CWbLSHUP.js → flagged-l4VdJzPS.js} +1 -1
- package/assets/{folders-Bh-WpZfd.js → folders-B9-YqZNQ.js} +1 -1
- package/assets/{format-JNVrAxqy.js → format-DFEg2Asu.js} +1 -1
- package/assets/{help-copy-IOl0hd1X.js → help-copy-BsWUoxcn.js} +1 -1
- package/assets/{import-BuXxs-h1.js → import-Cc_e1rgM.js} +1 -1
- package/assets/index-B9n_MbKU.js +1 -0
- package/assets/index-BOvqtCYe.js +1 -0
- package/assets/{index-C-UGtshF.js → index-BWh7aDGG.js} +4 -4
- package/assets/index-BgAbxvA6.js +1 -0
- package/assets/index-CFwCdjRG.js +1 -0
- package/assets/index-Ch288Whh.js +1 -0
- package/assets/index-CyBiXjjG.js +1 -0
- package/assets/{index-D8Og-rFU.js → index-DDoWXOJ7.js} +1 -1
- package/assets/{index-Bt2LbgEz.js → index-DFvn5y4c.js} +61 -61
- package/assets/index-DHqDBfkh.js +1 -0
- package/assets/{index-BvZRCv6K.css → index-DpaL-MoP.css} +1 -1
- package/assets/index-OD5aeYXB.js +1 -0
- package/assets/index-fMj5eWC0.js +1 -0
- package/assets/{kbd-CSKqmgM2.js → kbd-Mu7aD0zn.js} +1 -1
- package/assets/{labels-0PHoxO9y.js → labels-L3wr6N4n.js} +1 -1
- package/assets/{mail-Dc8Q2rJR.js → mail-CDXuVNl4.js} +1 -1
- package/assets/{mail-BTWtb9cH.js → mail-Ct-zdzf2.js} +1 -1
- package/assets/{menu-B9NuNR92.js → menu-DFNsLG9c.js} +1 -1
- package/assets/minus-Cs6nlfdI.js +1 -0
- package/assets/{new-uSLLH1Mv.js → new-D7QYk2TX.js} +1 -1
- package/assets/{onboarding-completion-ChnAwnfo.js → onboarding-completion-CzzOWbYc.js} +1 -1
- package/assets/onboarding-xSAXm8e1.js +1 -0
- package/assets/outbox-Ce2laBsJ.js +1 -0
- package/assets/{pencil-C5iesQSX.js → pencil-YivqEktR.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-B19egRyT.js → rich-text-spellcheck-worker-provider-CsFzO-Ew.js} +1 -1
- package/assets/{rich-text-C9z7o4B1.js → rich-text-vk4lTQ_B.js} +1 -1
- package/assets/{rotate-ccw-C9pTSU1L.js → rotate-ccw-fMBtK9xi.js} +1 -1
- package/assets/{row-actions-CVLSA3-L.js → row-actions-BPRaCwIJ.js} +1 -1
- package/assets/{search-mirror-dZegCw1c.js → search-mirror-Bz6Il7CV.js} +1 -1
- package/assets/{search-token-index-dci21-vJ.js → search-token-index-BRDoS9VF.js} +1 -1
- package/assets/{sections-9nE6aJyC.js → sections-DrfTHCE6.js} +1 -1
- package/assets/{senders-qOQx506Y.js → senders-FYL7OE3R.js} +1 -1
- package/assets/settings-DERpxXeE.js +1 -0
- package/assets/{settings-screen-CIBJ8Ktz.js → settings-screen-BymHQPcS.js} +1 -1
- package/assets/{shield-check-B780Y8Tr.js → shield-check-Dbo34YEZ.js} +1 -1
- package/assets/{suggested-vips-je_2wqGp.js → suggested-vips-DX_mBgNr.js} +1 -1
- package/assets/{useCalendarData-eO_t_ImL.js → useCalendarData-CfICbH_6.js} +1 -1
- package/assets/{useCalendars-Dvp0FarM.js → useCalendars-DaisNzpy.js} +1 -1
- package/assets/{useDebouncedValue-BqnSPiS4.js → useDebouncedValue-BABSGNK2.js} +1 -1
- package/assets/{useFilters-B3PvSYva.js → useFilters-rv_7K9Kl.js} +1 -1
- package/assets/{useLabels-CM4aOfc8.js → useLabels-kCEP9iG0.js} +1 -1
- package/assets/{useLayoutTier-fwri6vE_.js → useLayoutTier-BJPTvUFH.js} +1 -1
- package/assets/{useMessageBodyContent-BC19oBRw.js → useMessageBodyContent-DlWOVC8_.js} +1 -1
- package/assets/{useQueries-DeLiIsQP.js → useQueries-C-FWQch-.js} +1 -1
- package/assets/{useRefreshControl-FTbaOSlX.js → useRefreshControl-oC54L2Ym.js} +1 -1
- package/assets/{useSearchTokenContext-B8VJWRZ5.js → useSearchTokenContext-UVHviDZf.js} +1 -1
- package/assets/{useSemanticSearch-C7gVX2KZ.js → useSemanticSearch-BDhxqv3J.js} +1 -1
- package/assets/{useSignature-CTLslImt.js → useSignature-DNDSJmLZ.js} +1 -1
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/_calendarObjectId-ANalDG_X.js +0 -1
- package/assets/_mailboxId-Bs7Xoftz.js +0 -1
- package/assets/_messageId-BbJ7a6cz.js +0 -1
- package/assets/_messageId-DQOCWaZG.js +0 -1
- package/assets/_messageId-DeIKTU2h.js +0 -1
- package/assets/_outboxMessageId-Dy1coh-6.js +0 -1
- package/assets/_recurrenceId-Bco_iJqJ.js +0 -1
- package/assets/_threadId-Bpw0jv91.js +0 -1
- package/assets/_threadId-DbehDEnK.js +0 -1
- package/assets/_threadId-spR3G1_0.js +0 -1
- package/assets/brief-C4_ppn7W.js +0 -1
- package/assets/chevron-left-Dhp8k33f.js +0 -1
- package/assets/compose._-_outboxMessageId_-BGxEs8Xz.js +0 -1
- package/assets/compose._-_outboxMessageId_-BX3EvVnU.js +0 -1
- package/assets/compose._-_outboxMessageId_-Ci3WcUiU.js +0 -1
- package/assets/compose._-_outboxMessageId_-DomCL8s5.js +0 -1
- package/assets/flagged-DHJmLp-Q.js +0 -1
- package/assets/index-4RPr9TUh.js +0 -1
- package/assets/index-BJMUaXhY.js +0 -1
- package/assets/index-C0PnrE-q.js +0 -1
- package/assets/index-CA6ju2Yn.js +0 -1
- package/assets/index-DEftS123.js +0 -1
- package/assets/index-DQOCWaZG.js +0 -1
- package/assets/index-DeIKTU2h.js +0 -1
- package/assets/index-ZwRiu-6s.js +0 -1
- package/assets/index-cvFluWEZ.js +0 -1
- package/assets/minus-BbiZCtxx.js +0 -1
- package/assets/onboarding-Br-K6iSY.js +0 -1
- package/assets/outbox-CMc7vmKg.js +0 -1
- package/assets/settings-KnI7O0Nv.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as Pt,t as O,j as d,r as w,Z as Si,bG as Il,bH as Rt,ar,bI as Nl,bJ as qt,bK as Hl,s as kl,bL as Ei,L as Pl,bM as jl,O as Ll}from"./index-Bt2LbgEz.js";import{c as ms,R as Al,a as be,b as bi,u as Di,d as wi,e as Ci,r as Ol,f as Ri,g as Wl,h as Bl}from"./useCalendars-Dvp0FarM.js";import{M as _l}from"./mail-BTWtb9cH.js";import{G as Ul,M as Fl,C as Vl,u as zl,a as Gl,b as Yl,c as ql}from"./useCalendarData-eO_t_ImL.js";import{C as $l}from"./clock-C57mSKvQ.js";import{E as xi}from"./ErrorState-CyJvvOAI.js";import{u as Zl}from"./useQueries-DeLiIsQP.js";import{u as Xl}from"./useDebouncedValue-BqnSPiS4.js";import{C as Kl}from"./CalendarComposeSeed-D2QLz4LO.js";import{a as Jl}from"./CalendarShell-DWbGqBof.js";import{C as Ql}from"./chevron-left-Dhp8k33f.js";import{N as ec}from"./NavMenuButton-Beqz-c1F.js";import"./menu-B9NuNR92.js";const tc=Pt("CalendarOff",[["path",{d:"M4.2 4.2A2 2 0 0 0 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 1.82-1.18",key:"16swn3"}],["path",{d:"M21 15.5V6a2 2 0 0 0-2-2H9.5",key:"yhw86o"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h7",key:"1wap6i"}],["path",{d:"M21 10h-5.5",key:"quycpq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const nc=Pt("CalendarRange",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]]);const sc=Pt("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);const rc=Pt("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);const ic=Pt("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),Ze=globalThis.Temporal,ac=(t,e)=>`Non-positive ${t}: ${e}`,oc=(t,e)=>`Non-finite ${t}: ${e}`,lc=t=>`Cannot convert bigint to ${t}`,cc="Invalid object",dc=(t,e,n,s)=>mn(t,e)+`; must be between ${n}-${s}`,mn=(t,e)=>`Invalid ${t}: ${e}`,uc=1e3,hc=1e6,fc=1e9,gc=6e10,mc=36e11;function pc(t){return t===void 0?Object.create(null):Sc(t)}function Ti(t,e="number"){if(typeof t=="bigint")throw new TypeError(lc(e));if(t=Number(t),!Number.isFinite(t))throw new RangeError(oc(e,t));return t}function ps(t,e){return Math.trunc(Ti(t,e))||0}function or(t,e){return vc(ps(t,e),e)}function vc(t,e="number"){if(t<=0)throw new RangeError(ac(e,t));return t}function yc(t,e,n){return Math.min(Math.max(t,e),n)}function Mi(t){return t!==null&&(typeof t=="object"||typeof t=="function")}function Sc(t){if(!Mi(t))throw new TypeError(cc);return t}const Ec=mn,bc=t=>`Missing ${t}`,Dc=(t,e,n)=>mn(t,e)+"; must be "+Object.keys(n).join(),wc="Cannot use valueOf",Cc="Invalid calling context",Rc=(t,e)=>`Unknown calendar ${t}; might need ${e}`,xc=t=>mn("TimeZone",t),pn="Out-of-bounds date",Tc=t=>`Invalid substring: ${t}`,Ii=yc;function ce(t){throw new RangeError(t)}function ut(t){throw new TypeError(t)}function lr(t,e,n,s,r){return Ni(e,((i,a)=>{const o=i[a];return o===void 0&&ut(bc(a)),o})(t,e),n,s)}function Ni(t,e,n,s,r,i){const a=Ii(e,n,s);return e!==a&&ce(((o,l,c,u,h)=>dc(o,l,c,u))(t,e,n,s)),a}function it(t,e=Map){const n=new e;return(s,...r)=>{if(n.has(s))return n.get(s);const i=t(s,...r);return n.set(s,i),i}}const Mc=t=>Ic({name:t}),Ic=(t,e)=>vs(n=>({value:n,configurable:1,writable:!1}),t),Nc=t=>({[Symbol.toStringTag]:{value:t,configurable:1}});function vs(t,e){const n={};for(const s in e)n[s]=t(e[s],s);return n}function Hc(t,e){const n={};for(const s of t)n[s]=e;return n}function Hi(t){const e={};for(const n of t)e[n]=s=>s[n];return e}function ki(t,e,n=Object.create(null)){for(const s of t)n[s]=e[s];return n}function ys(t,...e){return(...n)=>t(...e,...n)}function cr(){}function dr(t){return t[0].toUpperCase()+t.substring(1)}function kc(t){return new RegExp(`^${t}$`,"i")}function Pc(t){return parseInt(t.padEnd(9,"0"))}function jc(t){return t&&t!=="+"?-1:1}function An(t){return t===void 0?0:parseInt(t)}function en(t,e){return String(e).padStart(t,"0")}const De=ys(en,2);function Lc(t,e){return Math.sign(t-e)}function Pi(t,e){const n=t/e;return t%e<0n?n-1n:n}function ji(t,e){const n=Pi(t,e);return[n,t-n*e]}function Pe(t,e){return[Math.floor(t/e),vn(t,e)]}function vn(t,e){return(t%e+e)%e}function Ac(t,e){return Math.trunc(t/e)||0}function Ut(t){return Math.abs(t%1)===.5}function Oc(t){const e=t.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,"");return e==="bc"||e==="b"?"bce":e==="ad"||e==="a"?"ce":e}const ht=void 0;function yn(t){return t===ht?"iso8601":t===0?"gregory":t.id}function Wc(t,e){return"M"+De(t)+(e?"L":"")}const Bc={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},_c=Object.keys(Bc),Ss=uc,Sn=hc,jt=fc,Es=gc,Li=mc,bs=864e11,Ai=BigInt(Sn),Xn=BigInt(jt),Ve=BigInt(bs),En=_c.slice(0,6),Ds=Hi(En),Uc=["day","month","year"];function Fc(t){return zc(t),t}const Vc={hour:23,minute:59,second:59};function zc(t,e){const n={};for(const s of En)n[s]=Ni(s,t[s],0,Vc[s]||999);return n}function ws(t){return Oi(t)*jt+Wi(t)}function Oi(t){return 3600*t.hour+60*t.minute+t.second}function Wi(t){return t.millisecond*Sn+t.microsecond*Ss+t.nanosecond}function Gc(t){const[e,n]=Pe(t,Sn),[s,r]=Pe(n,Ss);return Yc(e,s,r)}function Yc(t,e=0,n=0){const[s,r]=Pe(t,36e5),[i,a]=Pe(r,6e4),[o,l]=Pe(a,1e3);return{hour:s,minute:i,second:o,millisecond:l,microsecond:e,nanosecond:n}}function ur(t){const[e,n]=ji(t,Xn);return[Number(e),Number(n)]}function qc(t){return Cs(t)+BigInt(ws(t))}function Cs(t){return BigInt(tn(t))*Ve}function tn(t){return xt(t.year,t.month,t.day)}function xt(t,e=1,n=1){const s=e-1;return t+=Math.floor(s/12),e=vn(s,12),Date.UTC(t%400-400,e,0)/864e5+146097*(Ac(t,400)+1)+n}function bn(t){const[e,n]=ji(t,Ve);return{...$c(Number(e)),...Gc(Number(n))}}function $c(t){const e=new Date(864e5*vn(t,146097));return{year:e.getUTCFullYear()+400*Math.floor(t/146097),month:e.getUTCMonth()+1,day:e.getUTCDate()}}function Zc(t){return[t,0]}function Xc(t,e,n){return{year:t,month:e,day:n}}function Bi(t,e){switch(e){case 2:return Dn(t)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function Kc(t){return Dn(t)?366:365}function Dn(t){return t%4==0&&(t%100!=0||t%400==0)}function Rs(t){return vn(xt(t.year,t.month,t.day)+4,7)||7}function _i(t){return xt(t.year,t.month,t.day)-xt(t.year)+1}function Ui(t){let e=t.year,n=Math.floor((_i(t)-Rs(t)+10)/7),s=On(e);return n<1?n=s=On(--e):n>s&&(n=1,s=On(++e)),{weekOfYear:n,yearOfWeek:e,Be:s}}function On(t){const e=Rs({year:t,month:1,day:1});return e===4||e===3&&Dn(t)?53:52}function Jc({year:t}){return t<1?{era:"bce",eraYear:1-t}:{era:"ce",eraYear:t}}function Qc(t){return ed(t),Fc(t)}function ed(t){return td(t),t}function td(t,e){const{year:n}=t,s=lr(t,"month",1,12);return{year:n,month:s,day:lr(t,"day",1,Bi(n,s))}}function we(t,e){return t?t.ae(e):e}function nd(t,e,n){return t?t.L(e,n):Zc(n)}function hr(t,e){return t===0?Jc(e):t&&t.h?.(e)||{}}function sd(t,e,n,s){return t?t.de(e,n,s):Xc(e,n,s)}function rd(t,e){return t?t.j(e):12}function id(t,e,n){return t?t.o(e,n):Bi(e,n)}function ad(t,e){const{year:n,month:s}=we(t,e),[r,i]=nd(t,n,s);return Wc(r,i)}function Fi(t,e){const{year:n}=we(t,e);return t?t.q(n):Dn(n)}function Vi(t,e){const{year:n}=we(t,e);return rd(t,n)}function zi(t,e){const{year:n,month:s}=we(t,e);return id(t,n,s)}function Gi(t,e){const{year:n}=we(t,e);return t?t.i(n):Kc(n)}function od(t,e){if(!t)return _i(e);const{year:n}=we(t,e),s=sd(t,n,1,1);return tn(e)-tn(s)+1}function ld(t,e){return t===ht?Ui(e).weekOfYear:void 0}function cd(t,e){return t===ht?Ui(e).yearOfWeek:void 0}const nn=ys(dd,"string");function dd(t,e,n=t){return typeof e!==t&&ut(Ec(n,e)),e}function ud(t,e="number"){return Number.isInteger(t)||ce(((n,s)=>`Non-integer ${n}: ${s}`)(e,t)),t||0}function hd(t){return typeof t=="symbol"&&ut("Cannot convert Symbol to string"),String(t)}function fd(t,e){return Mi(t)?String(t):nn(t,e)}function gd(t,e){return ud(Ti(t,e),e)}const md={compatible:0,reject:1,earlier:2,later:3},pd=[Math.floor,t=>Ut(t)?Math.floor(t):Math.round(t),Math.ceil,t=>Ut(t)?Math.ceil(t):Math.round(t),Math.trunc,t=>Ut(t)?Math.trunc(t)||0:Math.round(t),t=>t<0?Math.floor(t):Math.ceil(t),t=>Math.sign(t)*Math.round(Math.abs(t))||0,t=>Ut(t)?(t=Math.trunc(t)||0)+t%2:Math.round(t)];function vd(t,e,n,s=0){const r=n[t];if(r===void 0)return s;const i=hd(r),a=e[i];return a===void 0&&ce(Dc(t,i,e)),a}const yd=ys(vd,"disambiguation",md),Yi=BigInt(1e8)*Ve,xs=BigInt(-1e8)*Ve,qi=xs-Ve;function Sd(t){const e=Cs(t);return Ed(e),e!==qi||ws(t)||ce(pn),t}function Ed(t,e=1){(t<(e?qi:xs)||t>Yi)&&ce(pn)}function wn(t){return(t<xs||t>Yi)&&ce(pn),t}function bd(t,e){return wn(Cs(t)+BigInt(ws(t)-e))}function Dd(t){return{epochNanoseconds:t}}function $i(t,e,n){return{calendar:n,timeZone:e,epochNanoseconds:t}}function wd(t,e){return ki(En,t,Cd(t,e))}function Cd(t,e){return ki(Uc,t,{calendar:e})}function Zi(t){return e=t.epochNanoseconds,Number(Pi(e,Ai));var e}function Xi(t){return t.epochNanoseconds}function Rd(t){return xd(t,Es,7)}function xd(t,e,n){return Td(t/e,n)*e}function Td(t,e){return pd[e](t)}const Ki=it(Md,WeakMap);function Md(t){const{epochNanoseconds:e,timeZone:n}=t,s=n.B(e);return{...bn(e+BigInt(s)),offsetNanoseconds:s}}function Id(t,e,n=0,s=t.N(e)){if(s.length===1)return s[0];if(n===1&&ce("Ambiguous offset"),s.length)return s[n===3?1:0];const r=qc(e),i=((o,l)=>{const c=o.B(l-Ve);return(u=>(u>bs&&ce("Out-of-bounds TimeZone gap"),u))(o.B(l+Ve)-c)})(t,r),a=bn(r+BigInt(i*(n===2?-1:1)));return(s=t.N(a))[n===2?0:s.length-1]}const Nd=kc("([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?");function Hd(t,e){const n=Nd.exec(t);if(n&&(s=>(r=>{r[0]!=="T"&&r[0]!=="t"||(r=r.slice(1));const i=r.search(/[.,]/),a=i<0?r:r.slice(0,i),o=a.split(":");return o.length===1?/^(?:\d{2}|\d{4}|\d{6})$/i.test(a):(o.length===2||o.length===3)&&o.every(l=>l.length===2&&/^\d{2}$/i.test(l))})(s.slice(1)))(n[0]))return((s,r)=>{const i=s[4]||s[5];return i&&ce(Tc(i)),o=(An(s[2])*Li+An(s[3])*Es+An(s[4])*jt+Pc(s[5]||""))*jc(s[1]),Math.abs(o)>=bs&&ce("Out-of-bounds offset"),o;var o})(n)}const kd={era:fd,month:or,monthCode(t,e){if(typeof t=="string")return t;if(t&&typeof t=="object"){const n=t.toString;if(typeof n=="function")return nn(n.call(t),e)}return nn(t,e)},day:or},Pd=Hc(En,ps),jd=Object.assign({},kd,Pd);({...jd});const Ld=Intl.DateTimeFormat;function Ad(t,e){e<-864e13&&ce(pn);const n=t.formatToParts(e),s={};for(const r of n)s[r.type]=r.value;return s}const Od={El_Aaiun:17,Tucuman:12,Tirane:11,Riga:10,Simferopol:9,Vienna:9,Tunis:8,Boa_Vista:6,Fortaleza:6,Maceio:6,Noronha:6,Recife:6,Gaza:6,Hebron:6,DeNoronha:6},Wn=-388152e4;function Wd(t){return Ts(bn(t.epochNanoseconds))+"Z"}function Bd(t){const e=t.calendar,n=t.timeZone,s=n.B(t.epochNanoseconds);return Ts(bn(t.epochNanoseconds+BigInt(s)))+Ji(Rd(s))+zd(n.id)+(e===ht?"":Qi(yn(e)))}function _d(t){const e=t.calendar;return Ts(t)+(e===ht?"":Qi(yn(e)))}function Ts(t,e){return Ud(t)+"T"+Vd(t)}function Ud(t){return Fd(t)+"-"+De(t.day)}function Fd(t){const{year:e}=t;return(e<0||e>9999?ta(e)+en(6,Math.abs(e)):en(4,e))+"-"+De(t.month)}function Vd(t,e){const n=[De(t.hour),De(t.minute)];return n.push(De(t.second)+((s,r,i,a)=>ea(s*Sn+r*Ss+i))(t.millisecond,t.microsecond,t.nanosecond)),n.join(":")}function Ji(t,e=0){if(e===1)return"";const[n,s]=Pe(Math.abs(t),Li),[r,i]=Pe(s,Es),[a,o]=Pe(i,jt);return ta(t)+De(n)+":"+De(r)+(a||o?":"+De(a)+ea(o):"")}function zd(t,e){return"["+t+"]"}function Qi(t,e){return"[u-ca="+t+"]"}const Gd=/0+$/;function ea(t,e){let n=en(9,t);return n=n.replace(Gd,""),n?"."+n:""}function ta(t){return t<0?"-":"+"}const Yd=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,qd=/[^\w\/:+-]+/;function na(t){return $d(nn(t))}function $d(t){return sa(t).id}function sa(t){const e=t.toUpperCase(),n=(r=>{const i=Hd(r);if(i!==void 0)return{id:Ji(i),X:i,m:i}})(e);if(n)return{kind:"fixed",...n};const s=e==="UTC"?"UTC":(r=>(qd.test(r)&&ce(xc(r)),Yd.test(r)&&ce("Forbidden ICU TimeZone"),r.toLowerCase().split("/").map((i,a)=>(i.length<=3||/\d/.test(i))&&!/etc|yap/.test(i)?i.toUpperCase():i.replace(/baja|dumont|[a-z]+/g,(o,l)=>o.length<=2&&!a||o==="in"||o==="chat"?o.toUpperCase():o.length>2||!l?dr(o).replace(/island|noronha|murdo|rivadavia|urville/,dr):o)).join("/")))(t);return Zd(s)}const Zd=it(t=>{if(t==="UTC")return{kind:"utc",id:t,m:t};const e=t.toUpperCase(),n=Xd(e);return{kind:"named",id:t,format:n,m:n.resolvedOptions().timeZone}}),Xd=it(t=>new Ld("en-u-hc-h23",{calendar:"iso8601",timeZone:t,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}));function ra(t){const e=sa(t);return Kd(e.id,e)}const Kd=it((t,e)=>e.kind==="named"?new Qd(t,e.m,e.format):new Jd(t,e.m,e.kind==="fixed"?e.X:0));class Jd{constructor(e,n,s){this.id=e,this.m=n,this.X=s}B(){return this.X}N(e){return[bd(e,this.X)]}O(){}}class Qd{constructor(e,n,s){this.id=e,this.m=n,this.ke=((r,i)=>{const a=it(r),o=it(eu),l=86400*i;function c(h){const[g,m]=gr(h,l),v=Ft(g),p=Ft(m),y=a(v),D=a(p);return y===D?y:u(o(v,p),y,D,h)}function u(h,g,m,v){let p,y;for(;(v===void 0||(p=v<h[0]?g:v>=h[1]?m:void 0)===void 0)&&(y=h[1]-h[0]);){const D=h[0]+Math.floor(y/2);r(D)===m?h[1]=D:h[0]=D+1}return p}return{xe(h){const g=c(h-86400),m=c(h+86400),v=h-g,p=h-m;if(g===m)return[v];const y=c(v);return y===c(p)?[h-y]:g>m?[v,p]:[]},we:c,O:function h(g,m){if(m>0&&g>=864e10)return;if(m<0){if(g<=Wn)return;const E=fr()+94867200;if(g>E)return h(E,-1)}const v=m>0?Math.max(g,Wn):g;let[p,y]=gr(v,l);const D=l*m,x=m>0?Math.max(g,fr())+94867200:Wn,C=()=>m<0?y>x:p<x;for(;C();){const E=Ft(p),T=Ft(y),N=a(E),I=a(T);if(N!==I){const P=o(E,T);u(P,N,I);const H=P[0];if((Lc(H,g)||1)===m)return H}p+=D,y+=D}}}})((r=>i=>{const a=Ad(r,1e3*i);return 86400*xt((o=>{const l=o.relatedYear;if(l!==void 0)return parseInt(l);const c=parseInt(o.year);return o.era!==void 0&&Oc(o.era)==="bce"?1-c:c})(a),parseInt(a.month),parseInt(a.day))+3600*parseInt(a.hour)+60*parseInt(a.minute)+parseInt(a.second)-i})(s),(r=>{const i=r.split("/").pop();return Od[i]||60})(e))}B(e){return this.ke.we((n=>ur(n)[0])(e))*jt}N(e){const n=86400*tn(e)+Oi(e),s=Wi(e);return this.ke.xe(n).map(r=>wn(BigInt(r)*Xn+BigInt(s)))}O(e,n){const[s,r]=ur(e),i=this.ke.O(s+(n>0||r?1:0),n);if(i!==void 0)return BigInt(i)*Xn}}function fr(){return Math.floor(Date.now()/1e3)}function eu(t,e){return[t,e]}function gr(t,e){const n=Math.floor(t/e)*e;return[n,n+e]}function Ft(t){return Ii(t,-1e10,864e10)}function tu(t,e,n){return $i(t.epochNanoseconds,e,n)}function nu(t,e,n){const s=Id(e,t,(r=>yd(pc(r)))(n));return $i(wn(s),e,t.calendar)}function su(t){return Dd(wn(BigInt(gd(t))*Ai))}function ru(t,e,n,s,r){const i=new Set(t),a=new Set(e),o=new Set(n);return(l,c)=>{let u,h;const g={},m={},v={};let p=0,y=0;for(const H of Object.keys(l)){const j=l[H];j===void 0||o.has(H)||(i.has(H)?H==="dateStyle"?u=j:H==="timeStyle"?h=j:g[H]=j:H==="era"?m[H]=j:a.has(H)?H==="dateStyle"||H==="timeStyle"?y=1:p=1:v[H]=j)}const D=u!==void 0,x=h!==void 0,C=D||x,E=Object.keys(g).length>0,T=p||y,N=E||D||x,I=Object.keys(m).length>0;(!c&&T||c&&T&&!N||C&&(E||I||p))&&ut("Invalid formatting options");const P={};return C||N||Object.assign(P,s),Object.assign(P,g,m,v),D&&(r?Object.assign(P,r[u]):P.dateStyle=u),x&&(P.timeStyle=h),P}}const iu={year:"numeric",month:"numeric",day:"numeric"},au={hour:"numeric",minute:"numeric",second:"numeric"},ou=Object.assign({},iu,au),lu=["weekday","year","month","day","dateStyle"],cu=["dayPeriod","hour","minute","second","fractionalSecondDigits","timeStyle"],du=lu.concat(cu);({...ou});const uu="PlainDateTime",hu="ZonedDateTime",fu="Instant";function ft(t,e,n,...s){return Object.defineProperties(e,Mc(t)),Object.defineProperties(e.prototype,Nc("Temporal."+t)),Object.defineProperties(e.prototype,vs(r=>({get(){return r(n(this))},configurable:1}),Object.assign({},...s))),e}const gt=cr.name==="noop"?t=>{Object.defineProperty(t,"_str_",{value:t.toJSON()})}:cr;function Cn(){ut(Cc)}function Ms(){ut(wc)}const Is={era(t){return hr(t.calendar,t).era},eraYear(t){return hr(t.calendar,t).eraYear},year(t){return we(t.calendar,t).year},month(t){return we(t.calendar,t).month},monthCode(t){return ad(t.calendar,t)},day(t){return we(t.calendar,t).day}},gu={daysInMonth(t){return zi(t.calendar,t)},daysInYear(t){return Gi(t.calendar,t)},monthsInYear(t){return Vi(t.calendar,t)},inLeapYear(t){return Fi(t.calendar,t)}},mu={dayOfWeek(t){return Rs(t)},dayOfYear(t){return od(t.calendar,t)},weekOfYear(t){return ld(t.calendar,t)},yearOfWeek(t){return cd(t.calendar,t)},daysInWeek(){return 7},daysInMonth(t){return zi(t.calendar,t)},daysInYear(t){return Gi(t.calendar,t)},monthsInYear(t){return Vi(t.calendar,t)},inLeapYear(t){return Fi(t.calendar,t)}};function sn(t){return Hi(Object.keys(t))}const ia=sn(Ds),aa=sn(Is);sn(gu),sn(mu);const Ue=480,He=1320,Ns=90;function je(t){return Number(t.slice(11,13))*60+Number(t.slice(14,16))}function Le(t){const e=Math.max(0,Math.min(1440,Math.round(t)));return`${String(Math.floor(e/60)).padStart(2,"0")}:${String(e%60).padStart(2,"0")}`}function ze(t){const e=Math.round(t);if(e<60)return`${e}m`;const n=Math.floor(e/60),s=e%60;return s===0?`${n}h`:`${n}h ${s}m`}function oa(t,e){const n=new Date(`${t}T00:00:00Z`);return n.setUTCDate(n.getUTCDate()+e),n.toISOString().slice(0,10)}function pu(t,e){const n=[];for(let s=t;s<=e;s=oa(s,1))n.push(s);return n}function vu(t){const[e,n,s]=t.split("-").map(Number);return new Date(e,n-1,s).toLocaleDateString("en-GB",{month:"long",year:"numeric"})}function yu(t){const[e,n,s]=t.split("-").map(Number);return new Date(e,n-1,s).toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"})}function Su(t){const[e,n,s]=t.split("-").map(Number);return new Date(e,n-1,s).toLocaleDateString("en-GB",{weekday:"long"})}function Eu(t,e){const[n,s,r]=t.split("-").map(Number),[i,a,o]=e.split("-").map(Number),l=new Date(n,s-1,r),c=new Date(i,a-1,o),u=l.toLocaleDateString("en-GB",{weekday:"short",day:"numeric",...s===a?{}:{month:"short"}}),h=c.toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"});return`${u} – ${h}`}function bu(t){const[e,n,s]=t.split("-").map(Number);return new Date(e,n-1,s).toLocaleDateString("en-GB",{weekday:"short"})}function ke(t){return new Date(t).getTime()}function Du(t,e){return t.allDay?e>=t.start.slice(0,10)&&e<t.end.slice(0,10):t.start.slice(0,10)===e}function wu(t,e){return ke(t.start)<ke(e.end)&&ke(e.start)<ke(t.end)}function Cu(t){const e=t.map(i=>[ke(i.start),ke(i.end)]).sort((i,a)=>i[0]-a[0]);let n=0,s=0,r=0;for(const[i,a]of e){if(i>r){n+=r-s,s=i,r=a;continue}r=Math.max(r,a)}return n+=r-s,Math.round(n/6e4)}function Ru(t){const e=[];for(const n of t){const s=t.filter(i=>i.id===n.id||wu(n,i)).map(i=>i.id).sort();if(s.length<2)continue;const r=s.join("|");e.some(i=>i.join("|")===r)||e.push(s)}return e.filter(n=>!e.some(s=>s!==n&&n.every(r=>s.includes(r))))}function xu(t,e,n){const s=e.filter(i=>Du(i,t)),r=s.filter(i=>!i.allDay).sort((i,a)=>ke(i.start)-ke(a.start));return{date:t,weekdayLabel:bu(t),dayNumber:Number(t.slice(8)),isToday:t===n,timed:r,allDay:s.filter(i=>i.allDay),busyMinutes:Cu(r),conflicts:Ru(r)}}function Tu(t){return t.timed.length===0&&t.allDay.length===0}function la(t){return ca(t.timed.map(e=>({from:je(e.start),to:je(e.end)})))}function ca(t){const e=[...t].sort((s,r)=>s.from-r.from),n=[];for(const s of e){const r=n[n.length-1];if(r&&s.from<=r.to){r.to=Math.max(r.to,s.to);continue}n.push({...s})}return n}function mr(t){return Math.min(Math.max(t,Ue),He)}function da(t,e,n=Ns){const s=ca(e);if(s.length===0)return[{date:t,startMinute:Ue,endMinute:He,minutes:He-Ue,wholeDay:!0}];const r=[];let i=Ue;for(const a of s){const o=mr(a.from),l=mr(a.to);o-i>=n&&r.push({date:t,startMinute:i,endMinute:o,minutes:o-i,wholeDay:!1}),i=Math.max(i,o,l)}return He-i>=n&&r.push({date:t,startMinute:i,endMinute:He,minutes:He-i,wholeDay:!1}),r}function rn(t,e=Ns){return da(t.date,la(t),e)}function Mu(t,e){const n=[];let s=[];const r=()=>{s.length!==0&&(s.length===1?n.push({kind:"day",key:s[0].date,day:s[0]}):n.push({kind:"run",key:`run_${s[0].date}`,from:s[0].date,to:s[s.length-1].date,days:s.length}),s=[])};for(const i of t){if(Tu(i)&&!e.includes(i.date)){s.push(i);continue}r(),n.push({kind:"day",key:i.date,day:i})}return r(),n}function Iu(t){const e=[];for(const n of t){const s=e[e.length-1],r=s?Math.max(...s.map(i=>Date.parse(i.end))):0;if(s&&Date.parse(n.start)<r){s.push(n);continue}e.push([n])}return e}function Nu(t,e){const n=Date.parse(e),s=e.slice(0,10),r=t.flatMap(c=>c.timed).sort((c,u)=>Date.parse(c.start)-Date.parse(u.start)),i=r.filter(c=>Date.parse(c.start)<=n&&Date.parse(c.end)>n),a=r.filter(c=>Date.parse(c.start)>n),o=a[0],l=i.filter(c=>c.start.slice(0,10)===s).length+a.filter(c=>c.start.slice(0,10)===s).length;return{running:i,next:o,minutesUntilNext:o?Math.round((Date.parse(o.start)-n)/6e4):0,after:a[1],restOfDay:l,free:Hu(t,e,1)[0]}}function Hu(t,e,n){const s=e.slice(0,10),r=je(e),i=[];for(const a of t)if(!(a.date<s))for(const o of rn(a)){if(a.date>s)i.push(o);else{const l=Math.max(o.startMinute,r);if(o.endMinute-l<Ns)continue;i.push({...o,startMinute:l,minutes:o.endMinute-l,wholeDay:o.wholeDay&&l===o.startMinute})}if(i.length===n)return i}return i}function ua(t){const e=ms(t.color),n=t.rsvp==="tentative"||t.status==="tentative";return O("flex min-w-0 overflow-hidden rounded-sm border-l-2 px-1.5 py-0.5",e.soft,e.text,e.rail,t.layout==="column"||t.stacked?"flex-col":"items-center gap-1.5",n&&"border-y border-r border-dashed",n&&e.border,t.rsvp==="declined"&&"opacity-60",t.selected&&"ring-2 ring-ring",t.density==="compact"?"text-2xs":"text-xs")}function ha({title:t,timeText:e,layout:n,rsvp:s,hasThread:r,isRecurring:i,zoneCertainty:a,trailing:o,detail:l}){const c=n==="column",u=a==="ambiguous",h=!c&&l!==void 0,g=d.jsxs("span",{className:O("flex min-w-0 items-center gap-1",c&&"w-full",s==="declined"&&"line-through"),children:[e!==""&&d.jsx("span",{className:"shrink-0 tabular-nums opacity-80",children:e}),d.jsx("span",{className:"truncate font-medium",children:t})]}),m=(i||r||u)&&d.jsxs("span",{className:O("flex shrink-0 items-center gap-1",c&&"mt-0.5",!c&&o===void 0&&"ml-auto"),children:[i&&d.jsx(Al,{className:"size-2.5","aria-label":"Repeats"}),r&&d.jsx(_l,{className:"size-2.5","aria-label":"From mail"}),u&&d.jsx(Ul,{className:"size-2.5 text-warning","aria-label":"Unclear zone"})]}),v=o!==void 0&&d.jsx("span",{className:O("shrink-0 opacity-80",!c&&"ml-auto"),children:o});return d.jsxs(d.Fragment,{children:[h?d.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[g,m,v]}):d.jsxs(d.Fragment,{children:[g,m,v]}),l]})}function fa({title:t,timeText:e,color:n,layout:s,density:r,rsvp:i,status:a,hasThread:o,isRecurring:l,zoneCertainty:c,selected:u,onClick:h,leading:g,trailing:m,detail:v}){const p=s==="column";return d.jsxs("button",{type:"button",onClick:h,"aria-pressed":u,className:O("group flex w-full min-w-0 text-left outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface",p?"h-full":"items-start",g!==void 0&&"gap-2"),children:[g,d.jsx("span",{className:O(ua({color:n,layout:s,density:r,rsvp:i,status:a,selected:u,stacked:v!==void 0}),"flex-1",p&&"h-full"),children:d.jsx(ha,{title:t,timeText:e,layout:s,rsvp:i,hasThread:o,isRecurring:l,zoneCertainty:c,trailing:m,detail:v})})]})}const Bn=32,ga=150,ku="cal-1",Pu=600,ju=900,Lu=1500,Au=new Set;function Ou(t){const e=new Map(t.map(n=>[n.id,n]));return{color:n=>e.get(n)?.color??ku,name:n=>e.get(n)?.name??""}}function Wu({days:t,calendars:e,density:n,today:s,focusDate:r,selectedEventId:i,onSelectEvent:a,onPickSlot:o,onZoomDay:l,onReachStart:c,onReachEnd:u,onVisibleDayChange:h,atStartCap:g=!1,atEndCap:m=!1,onLoadEarlier:v,onLoadLater:p,loadingDates:y=Au,freeOn:D=rn,scrollTarget:x,todayLead:C,touch:E,className:T}){const N=w.useRef(null),I=w.useRef(new Map),P=w.useRef(t[0]?.date??""),H=w.useRef(0),j=w.useRef(""),G=w.useRef(""),U=w.useRef(!1),F=w.useRef(0),Z=w.useRef(0),[Q,X]=w.useState(r),ae=w.useMemo(()=>Ou(e),[e]),ne=Mu(t,[s,r,...y]),K=t[0]?.date??"",Se=t[t.length-1]?.date??"";w.useLayoutEffect(()=>{const A=N.current;A&&(K!==""&&K<P.current&&(A.scrollTop+=A.scrollHeight-H.current),P.current=K,H.current=A.scrollHeight,F.current=A.scrollTop)}),w.useEffect(()=>{if(U.current)return;const A=N.current;if(!A)return;U.current=!0;let J=!1;const oe=()=>{const W=I.current.get(r);J||!W||(A.scrollTop=W.offsetTop-Bn,F.current=A.scrollTop)};oe(),X(r);const me=requestAnimationFrame(oe);return document.fonts?.ready.then(oe),()=>{J=!0,cancelAnimationFrame(me)}},[r]),w.useEffect(()=>{if(!x)return;const A=N.current,J=I.current.get(x.date);!A||!J||(A.scrollTop=J.offsetTop-Bn,F.current=A.scrollTop,X(x.date),h(x.date))},[x,h]),w.useEffect(()=>{const A=N.current;if(!A)return;const J=()=>{Z.current=Date.now()},oe=["wheel","pointerdown","touchstart","touchmove","keydown"],me=W=>{W.buttons!==0&&J()};for(const W of oe)A.addEventListener(W,J,{passive:!0});return A.addEventListener("pointermove",me,{passive:!0}),()=>{for(const W of oe)A.removeEventListener(W,J);A.removeEventListener("pointermove",me)}},[]);const ge=()=>{const A=N.current;if(!A)return;const J=A.scrollTop,oe=J-F.current;if(F.current=J,oe===0||Date.now()-Z.current>Lu)return;const me=[...I.current.entries()].filter(([,Y])=>Y.isConnected).sort((Y,ee)=>Y[1].offsetTop-ee[1].offsetTop);let W="";for(const[Y,ee]of me){if(ee.offsetTop-Bn-8>J)break;W=Y}W!==""&&W!==Q&&(X(W),h(W)),oe<0&&J<Pu&&j.current!==K&&(j.current=K,c()),oe>0&&J+A.clientHeight>A.scrollHeight-ju&&G.current!==Se&&(G.current=Se,u())},Ie=A=>J=>{J?I.current.set(A,J):I.current.delete(A)};return d.jsxs("div",{ref:N,onScroll:ge,"data-testid":"agenda-strip",className:O("relative min-h-0 flex-1 overflow-y-auto bg-surface",T),children:[d.jsxs("div",{className:"sticky top-0 z-20 flex h-8 items-center gap-2 border-b border-line bg-surface/95 px-row-inset backdrop-blur",children:[d.jsx("span",{className:"text-xs font-semibold text-fg",children:Su(Q)}),d.jsx("span",{className:"text-xs text-fg-subtle",children:vu(Q)}),Q===s&&d.jsx("span",{className:"rounded-full bg-accent-soft px-1.5 text-2xs font-medium text-accent",children:"Today"})]}),g&&v&&d.jsx(pr,{label:"Show earlier days",testId:"agenda-load-earlier",onLoad:v,touch:E}),ne.map(A=>d.jsx(Bu,{row:A,lookup:ae,density:n,today:s,pending:A.kind==="day"&&y.has(A.day.date),freeOn:D,selectedEventId:i,onSelectEvent:a,onPickSlot:o,onZoomDay:l,anchorRef:Ie(A.kind==="day"?A.day.date:A.from),lead:A.kind==="day"&&A.day.date===s?C:null,touch:E},A.key)),m&&p&&d.jsx(pr,{label:"Show later days",testId:"agenda-load-later",onLoad:p,touch:E})]})}function pr({label:t,testId:e,onLoad:n,touch:s}){return d.jsx("button",{type:"button",onClick:n,"data-testid":e,className:O("flex w-full items-center justify-center gap-2 border-y border-dashed border-line bg-surface-sunken px-row-inset text-xs font-medium text-fg-muted outline-none transition-colors hover:border-accent hover:text-accent focus-visible:ring-2 focus-visible:ring-ring",s?"min-h-14 py-3":"py-2"),children:t})}function Bu({row:t,lookup:e,density:n,today:s,pending:r,freeOn:i,selectedEventId:a,onSelectEvent:o,onPickSlot:l,onZoomDay:c,anchorRef:u,lead:h,touch:g}){return t.kind==="run"?d.jsx("div",{ref:u,children:d.jsx(_u,{from:t.from,to:t.to,days:t.days,onPickSlot:l,touch:g})}):r?d.jsx("div",{ref:u,children:d.jsx(Uu,{day:t.day,today:s})}):n==="dots"?d.jsxs("div",{ref:u,children:[h,d.jsx(Fu,{day:t.day,lookup:e,today:s,freeOn:i,onSelectEvent:o,onZoomDay:c,selectedEventId:a})]}):d.jsxs("div",{ref:u,children:[h,d.jsx(zu,{day:t.day,lookup:e,density:n,today:s,freeOn:i,selectedEventId:a,onSelectEvent:o,onPickSlot:l,onZoomDay:c,touch:g})]})}function _u({from:t,to:e,days:n,onPickSlot:s,touch:r}){return d.jsxs("button",{type:"button",onClick:()=>s({date:t,startTime:"10:00",endTime:"11:00",allDay:!1}),className:O("flex w-full items-center gap-3 border-y border-dashed border-line bg-surface-sunken px-row-inset text-left outline-none transition-colors hover:border-accent focus-visible:ring-2 focus-visible:ring-ring",r?"min-h-14 py-3":"py-2"),children:[d.jsx(tc,{className:"size-4 shrink-0 text-accent"}),d.jsx("span",{className:"text-sm font-medium text-fg",children:Eu(t,e)}),d.jsxs("span",{className:"text-xs text-fg-muted",children:[n," days with nothing booked"]}),d.jsx("span",{className:"ml-auto shrink-0 text-2xs text-fg-subtle",children:"Add"})]})}function Uu({day:t,today:e}){const n=t.date===e;return d.jsxs("section",{"aria-busy":"true","data-testid":`agenda-day-pending-${t.date}`,className:O("border-b border-line",n&&"border-l-2 border-l-accent bg-accent-soft/20"),children:[d.jsxs("header",{className:"flex h-section-row items-center gap-3 px-row-inset",children:[d.jsxs("div",{className:"flex w-16 shrink-0 items-baseline gap-1.5",children:[d.jsx("span",{className:O("text-lg font-semibold tabular-nums",n?"text-accent":"text-fg"),children:t.dayNumber}),d.jsx("span",{className:"text-2xs uppercase tracking-wider text-fg-subtle",children:t.weekdayLabel})]}),d.jsxs("span",{className:"sr-only",children:["Loading ",t.date]}),d.jsx("span",{className:"h-3 min-w-0 flex-1 animate-pulse rounded-full bg-surface-sunken"})]}),d.jsx("div",{className:"flex flex-col gap-1 pb-2",children:d.jsx("span",{className:"mx-row-inset h-7 animate-pulse rounded-md bg-surface-sunken"})})]})}function Fu({day:t,lookup:e,today:n,freeOn:s,selectedEventId:r,onSelectEvent:i,onZoomDay:a}){const o=t.date===n,l=[...t.allDay,...t.timed];return d.jsxs("div",{className:O("flex h-8 items-center gap-2 border-b border-line px-row-inset",o&&"bg-accent-soft/30"),children:[d.jsxs("button",{type:"button",onClick:()=>a(t.date),className:O("w-16 shrink-0 rounded-sm text-left text-xs tabular-nums outline-none focus-visible:ring-2 focus-visible:ring-ring",o?"font-semibold text-accent":"text-fg-muted"),children:[t.weekdayLabel," ",t.dayNumber]}),d.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden",children:l.map(c=>d.jsx("button",{type:"button",title:c.title,"aria-label":c.title,"aria-pressed":c.id===r,onClick:()=>i(c.id),className:O("size-2 shrink-0 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring",ms(e.color(c.calendarId)).solid,c.id===r&&"ring-2 ring-ring",c.myRsvp==="declined"&&"opacity-40")},c.id))}),d.jsx(pa,{day:t,className:"w-24 shrink-0"}),d.jsx("span",{className:"w-24 shrink-0 text-right text-2xs text-fg-subtle",children:Vu(t,s)})]})}function Vu(t,e){const n=e(t);if(t.timed.length===0&&ma(n))return"clear";const s=n.reduce((r,i)=>Math.max(r,i.minutes),0);return s>=ga?`${ze(s)} free`:`${ze(t.busyMinutes)} booked`}function ma(t){return t.length===1&&t[0].wholeDay}function zu({day:t,lookup:e,density:n,today:s,freeOn:r,selectedEventId:i,onSelectEvent:a,onPickSlot:o,onZoomDay:l,touch:c}){const u=t.date===s,h=Iu(t.timed),g=r(t),m=g.filter(y=>!y.wholeDay),v=t.timed.length===0&&ma(g),p=[...h.map(y=>({key:y[0].id,at:je(y[0].start),node:y.length===1?d.jsx(ya,{event:y[0],lookup:e,density:n,selected:y[0].id===i,onSelect:()=>a(y[0].id),touch:c}):d.jsx(Zu,{events:y,lookup:e,density:n,selectedEventId:i,onSelectEvent:a,onZoomDay:()=>l(t.date),touch:c})})),...m.map(y=>({key:`free_${y.startMinute}`,at:y.startMinute,node:d.jsx(qu,{stretch:y,onPick:()=>o({date:y.date,startTime:Le(y.startMinute),endTime:Le(Math.min(y.startMinute+60,y.endMinute)),allDay:!1}),touch:c})}))].sort((y,D)=>y.at-D.at);return d.jsxs("section",{className:O("border-b border-line",u&&"border-l-2 border-l-accent bg-accent-soft/20"),children:[d.jsxs("header",{className:"flex h-section-row items-center gap-3 px-row-inset",children:[d.jsxs("div",{className:"flex w-16 shrink-0 items-baseline gap-1.5",children:[d.jsx("span",{className:O("text-lg font-semibold tabular-nums",u?"text-accent":"text-fg"),children:t.dayNumber}),d.jsx("span",{className:"text-2xs uppercase tracking-wider text-fg-subtle",children:t.weekdayLabel})]}),d.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-muted",children:Gu(t)}),d.jsx(pa,{day:t,className:"hidden w-32 shrink-0 sm:block"}),d.jsxs("button",{type:"button",onClick:()=>l(t.date),className:O("flex shrink-0 items-center gap-0.5 rounded-md border px-2 text-2xs outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",c?"min-h-9":"h-6",t.conflicts.length>0?"border-warning text-warning hover:bg-warning-soft":"border-line text-fg-subtle hover:border-line-strong hover:text-fg"),children:["Grid",d.jsx(Si,{className:"size-3"})]})]}),d.jsxs("div",{className:"flex flex-col gap-1 pb-2",children:[t.allDay.map(y=>d.jsx($u,{event:y,lookup:e,density:n,selected:y.id===i,onSelect:()=>a(y.id),touch:c},y.id)),v?d.jsx(Yu,{day:t,onPickSlot:o,touch:c}):p.map(y=>d.jsx("div",{children:y.node},y.key))]})]})}function Gu(t){if(t.timed.length===0)return"Nothing booked";const e=[`${t.timed.length} ${t.timed.length===1?"event":"events"}`,`${ze(t.busyMinutes)} booked`];return t.conflicts.length>0&&e.push(`${t.conflicts.length} ${t.conflicts.length===1?"clash":"clashes"}`),e.join(" · ")}function pa({day:t,className:e}){const n=He-Ue;return d.jsx("div",{"aria-hidden":!0,className:O("relative h-1.5 overflow-hidden rounded-full bg-surface-sunken",e),children:la(t).map(s=>{const r=Math.max(s.from,Ue),i=Math.min(s.to,He);return i<=r?null:d.jsx("span",{className:"absolute inset-y-0 rounded-full bg-fg-subtle",style:{left:`${(r-Ue)/n*100}%`,width:`${(i-r)/n*100}%`}},`${s.from}-${s.to}`)})})}function Yu({day:t,onPickSlot:e,touch:n}){return d.jsx("button",{type:"button",onClick:()=>e({date:t.date,startTime:"10:00",endTime:"11:00",allDay:!1}),className:O("mx-row-inset flex items-center gap-2 rounded-md border border-dashed border-line px-2 text-left text-xs text-fg-muted outline-none transition-colors hover:border-accent hover:text-accent focus-visible:ring-2 focus-visible:ring-ring",n?"min-h-11":"h-8"),children:"Free all day"})}function qu({stretch:t,onPick:e,touch:n}){const s=t.minutes>=ga;return d.jsxs("button",{type:"button",onClick:e,className:O("ml-16 mr-row-inset flex items-center gap-2 rounded-md border border-dashed text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",n?"min-h-11 px-3":"h-7 px-2",s?"border-accent-2 bg-accent-2-soft/40 text-accent-2 hover:bg-accent-2-soft":"border-line text-fg-subtle hover:border-line-strong hover:text-fg-muted"),children:[d.jsxs("span",{className:O("text-xs",s&&"font-medium"),children:[ze(t.minutes)," free"]}),d.jsxs("span",{className:"text-2xs tabular-nums opacity-80",children:[Le(t.startMinute)," – ",Le(t.endMinute)]})]})}function va(t){return t==="detail"?"comfortable":"compact"}function $u({event:t,lookup:e,density:n,selected:s,onSelect:r,touch:i}){return d.jsx("div",{className:O("mx-row-inset",i&&"min-h-11"),children:d.jsx(fa,{title:t.title,timeText:"",color:e.color(t.calendarId),layout:"row",density:va(n),rsvp:t.myRsvp,status:t.status,hasThread:t.threadId!=="",isRecurring:t.recurrenceRule!=="",zoneCertainty:t.zoneCertainty,selected:s,onClick:r,trailing:d.jsx("span",{className:"text-2xs",children:"All day"})})})}function Zu({events:t,lookup:e,density:n,selectedEventId:s,onSelectEvent:r,onZoomDay:i,touch:a}){const o=Math.min(...t.map(c=>je(c.start))),l=Math.max(...t.map(c=>je(c.end)));return d.jsxs("div",{className:"mx-row-inset rounded-md border border-warning/50 bg-warning-soft/30",children:[d.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[d.jsx(sc,{className:"size-3 shrink-0 text-warning"}),d.jsxs("span",{className:"text-2xs font-medium text-warning",children:[t.length," at once · ",Le(o)," – ",Le(l)]}),d.jsx("button",{type:"button",onClick:i,className:O("ml-auto rounded-sm px-1.5 text-2xs font-medium text-warning underline underline-offset-2 outline-none hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",a&&"min-h-9"),children:"Open the grid"})]}),d.jsx("div",{className:"flex flex-col gap-0.5 pb-1",children:t.map(c=>d.jsx(ya,{event:c,lookup:e,density:n,selected:c.id===s,onSelect:()=>r(c.id),inset:!1,touch:a},c.id))})]})}function ya({event:t,lookup:e,density:n,selected:s,onSelect:r,inset:i=!0,touch:a}){const o=n==="detail",l=je(t.end)-je(t.start),c=[e.name(t.calendarId),t.location].filter(u=>u!=="").join(" · ");return d.jsx("div",{className:O(i?"px-row-inset":"px-2",a&&"min-h-12"),children:d.jsx(fa,{title:t.title,timeText:"",color:e.color(t.calendarId),layout:"row",density:va(n),rsvp:t.myRsvp,status:t.status,hasThread:t.threadId!=="",isRecurring:t.recurrenceRule!=="",zoneCertainty:t.zoneCertainty,selected:s,onClick:r,leading:d.jsxs("span",{className:O("shrink-0 pt-1 text-2xs tabular-nums text-fg-subtle",i?"w-14":"w-11"),children:[t.start.slice(11,16),o&&d.jsx("span",{className:"block opacity-70",children:t.end.slice(11,16)})]}),trailing:d.jsx("span",{className:"text-2xs tabular-nums",children:ze(l)}),detail:o&&c!==""?d.jsxs("span",{className:"flex min-w-0 items-center gap-2 text-2xs opacity-80",children:[t.location!==""&&d.jsx(Fl,{className:"size-3 shrink-0"}),d.jsx("span",{className:"truncate",children:c}),t.attendees.length>0&&d.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[d.jsx(Il,{className:"size-3"}),t.attendees.length]})]}):void 0})})}function Sa(t){return O("flex cursor-pointer items-center justify-center rounded-md px-2 font-medium transition-colors","has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring",t?"bg-accent-2-soft text-accent-2":"text-fg-muted hover:bg-surface-sunken hover:text-fg")}function Xu({options:t,value:e,onChange:n,touch:s,ariaLabel:r,className:i}){const a=w.useId();return d.jsxs("fieldset",{className:O("inline-flex items-center gap-0.5",i),children:[d.jsx("legend",{className:"sr-only",children:r}),t.map(o=>d.jsxs("label",{className:O(Sa(e===o.value),s?"min-h-11 flex-1 text-sm":"h-7 text-xs"),children:[d.jsx("input",{type:"radio",name:a,value:o.value,checked:e===o.value,onChange:()=>n(o.value),className:"sr-only"}),s?o.shortLabel:o.label]},o.value))]})}const vr=[{value:"year",label:"Year",shortLabel:"Y"},{value:"month",label:"Month",shortLabel:"M"},{value:"week",label:"Week",shortLabel:"W"},{value:"day",label:"Day",shortLabel:"D"},{value:"agenda",label:"Agenda",shortLabel:"List"}];function Ku({value:t,onChange:e,views:n,touch:s,className:r}){const i=n?vr.filter(a=>n.includes(a.value)):vr;return d.jsx(Xu,{ariaLabel:"Calendar view",options:i,value:t,onChange:e,touch:s,className:r})}function Ju({title:t,onPrev:e,onNext:n,onToday:s,children:r,touch:i}){const a=O("flex items-center justify-center rounded-md text-fg-muted outline-none transition-colors hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",i?"size-11":"size-7");return d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx("button",{type:"button",onClick:e,"aria-label":"Previous",className:a,children:d.jsx(Ql,{className:"size-4"})}),d.jsx("button",{type:"button",onClick:n,"aria-label":"Next",className:a,children:d.jsx(Si,{className:"size-4"})}),d.jsx("button",{type:"button",onClick:s,className:O("rounded-md border border-line px-2.5 font-medium text-fg outline-none transition-colors hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",i?"min-h-11 text-sm":"h-7 text-xs"),children:"Today"}),d.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:t}),r]})}function Qu({nextUp:t,calendars:e,today:n,onSelectEvent:s,onGoTo:r,touch:i,className:a}){const{running:o,next:l,minutesUntilNext:c,after:u,free:h}=t,g=w.useMemo(()=>{const m=new Map(e.map(v=>[v.id,v.color]));return v=>m.get(v)??"cal-1"},[e]);return d.jsxs("section",{className:O("flex flex-col gap-2 rounded-lg border border-line bg-surface-raised p-3",a),children:[o.length>0&&d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx(yr,{icon:d.jsx(rc,{className:"size-3 text-danger"}),children:"Now"}),o.map(m=>d.jsx(Sr,{eventId:m.id,title:m.title,color:g(m.calendarId),meta:`until ${m.end.slice(11,16)}`,onSelect:s,touch:i},m.id))]}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx(yr,{icon:d.jsx($l,{className:"size-3"}),children:l?`Next · in ${ze(c)}`:"Next"}),l?d.jsx(Sr,{eventId:l.id,title:l.title,color:g(l.calendarId),meta:`${_n(l.start.slice(0,10),n)}${l.start.slice(11,16)}${l.location===""?"":` · ${l.location}`}`,onSelect:s,touch:i}):d.jsx("p",{className:"text-sm text-fg-muted",children:"Nothing else booked."}),u&&d.jsxs("p",{className:"truncate pl-1 text-2xs text-fg-subtle",children:["then ",u.title," · ",_n(u.start.slice(0,10),n),u.start.slice(11,16)]})]}),h&&d.jsxs("button",{type:"button",onClick:()=>r(h.date),className:O("flex items-center gap-2 rounded-md border border-dashed border-accent-2 bg-accent-2-soft/40 px-2 text-left text-accent-2 outline-none transition-colors hover:bg-accent-2-soft focus-visible:ring-2 focus-visible:ring-ring",i?"min-h-11":"min-h-8"),children:[d.jsx(ic,{className:"size-3.5 shrink-0"}),d.jsxs("span",{className:"text-xs font-medium",children:[ze(h.minutes)," free"]}),d.jsxs("span",{className:"text-2xs tabular-nums opacity-80",children:[_n(h.date,n),Le(h.startMinute)," – ",Le(h.endMinute)]})]})]})}function yr({icon:t,children:e}){return d.jsxs("h3",{className:"flex items-center gap-1.5 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:[t,e]})}function Sr({eventId:t,title:e,color:n,meta:s,onSelect:r,touch:i}){const a=ms(n);return d.jsx("button",{type:"button",onClick:()=>r(t),className:O("flex w-full items-center gap-2 rounded-md border-l-2 px-2 py-1 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",a.soft,a.text,a.rail,i&&"min-h-12"),children:d.jsxs("span",{className:"min-w-0 flex-1",children:[d.jsx("span",{className:"block truncate text-sm font-medium",children:e}),d.jsx("span",{className:"block truncate text-2xs opacity-80",children:s})]})})}function _n(t,e){return t===e?"":t===oa(e,1)?"tomorrow · ":`${yu(t)} · `}const Ea=`${uu}Record`,ba=`${hu}Record`,Da=`${fu}Record`,eh=new WeakMap,wa=new WeakMap,Ca=new WeakMap,Ra=new WeakMap;function xa(t){return th(t)||Cn()}function th(t){return eh.get(t)}function Ta(t){return nh(t)||Cn()}function nh(t){return wa.get(t)}function Ma(t,e){wa.set(t,e)}function Ia(t){return sh(t)||Cn()}function sh(t){return Ca.get(t)}function Na(t,e){Ca.set(t,e)}function Ha(t){return rh(t)||Cn()}function rh(t){return Ra.get(t)}function ka(t,e){Ra.set(t,e)}function Pa(t){return xa(t).id}function ja(t){const e=xa(t).ue;return e||ce(Rc(Pa(t),"getExotic or getAny")),e}function ih(t){if(t!==void 0)return ah(t)}function ah(t){return ja(t),Pa(t)}const Dt=Ha,oh=ft(Ea,class{get calendarId(){return Dt(this).calendarId}toJSON(){return Dt(this).toJSON()}valueOf(){return Dt(this).valueOf()}},Dt,aa,ia);function lh(t){const e=Object.create(oh.prototype);return ka(e,t),gt(e),e}function ch(t,e,n,s,r,i,a,o,l,c){return lh(new Ze.PlainDateTime(t,e,n,s,r,i,a,o,l,ih(c)))}function dh(t,e,n){return La(Dt(t).toZonedDateTime(e,n))}const Ne=Ia,uh=ft(ba,class{get calendarId(){return Ne(this).calendarId}get timeZoneId(){return Ne(this).timeZoneId}get epochMilliseconds(){return Ne(this).epochMilliseconds}get epochNanoseconds(){return Ne(this).epochNanoseconds}toJSON(){return Ne(this).toJSON()}valueOf(){return Ne(this).valueOf()}},Ne,aa,ia);function La(t){const e=Object.create(uh.prototype);return Na(e,t),gt(e),e}function hh(t){return Ne(t).offsetNanoseconds}const wt=Ta,fh=ft(Da,class{get epochMilliseconds(){return wt(this).epochMilliseconds}get epochNanoseconds(){return wt(this).epochNanoseconds}toJSON(){return wt(this).toJSON()}valueOf(){return wt(this).valueOf()}});function gh(t){const e=Object.create(fh.prototype);return Ma(e,t),gt(e),e}function mh(t){return gh(Ze.Instant.fromEpochMilliseconds(t))}function ph(t,e){return La(wt(t).toZonedDateTimeISO(e))}function vh(t){return t===void 0?ht:yh(t)}function yh(t){return ja(t)()}const $t=Ha,Sh=ft(Ea,class{get calendarId(){return yn($t(this).calendar)}toJSON(){return _d($t(this))}valueOf(){return Ms()}},$t,Is,Ds);function Eh(t){const e=Object.create(Sh.prototype);return ka(e,t),gt(e),e}function bh(t,e,n,s=0,r=0,i=0,a=0,o=0,l=0,c){const u=Sd(Qc(vs(ps,{year:t,month:e,day:n,hour:s,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:l}))),h=vh(c);return Eh(wd(u,h))}function Dh(t,e,n){return Aa(nu($t(t),ra(na(e)),n))}const Be=Ia,wh=ft(ba,class{get calendarId(){return yn(Be(this).calendar)}get timeZoneId(){return Be(this).timeZone.id}get epochMilliseconds(){return Zi(Be(this))}get epochNanoseconds(){return Xi(Be(this))}toJSON(){return Bd(Be(this))}valueOf(){return Ms()}},Ch,Is,Ds);function Aa(t){const e=Object.create(wh.prototype);return Na(e,t),gt(e),e}function Ch(t){const e=Be(t);return{...Ki(e),calendar:e.calendar}}function Rh(t){return Ki(Be(t)).offsetNanoseconds}const Zt=Ta,xh=ft(Da,class{get epochMilliseconds(){return Zi(Zt(this))}get epochNanoseconds(){return Xi(Zt(this))}toJSON(){return Wd(Zt(this))}valueOf(){return Ms()}});function Th(t){const e=Object.create(xh.prototype);return Ma(e,t),gt(e),e}function Mh(t){return Th(su(t))}function Ih(t,e){return Aa(tu(Zt(t),ra(na(e))))}const Nh=Ze?hh:Rh,Er=Ze?ch:bh,br=Ze?dh:Dh,Hh=Ze?mh:Mh,kh=Ze?ph:Ih;function Dr(t,e){let n=at(t);return n[2]+=e*7,he(n)}function te(t,e){let n=at(t);return n[2]+=e,he(n)}function Ge(t,e){let n=at(t);return n[6]+=e,he(n)}function Ph(t,e){return Xe(t,e)/7}function Xe(t,e){return(e.valueOf()-t.valueOf())/(1e3*60*60*24)}function jh(t,e){return(e.valueOf()-t.valueOf())/(1e3*60*60)}function Lh(t,e){return(e.valueOf()-t.valueOf())/(1e3*60)}function Ah(t,e){return(e.valueOf()-t.valueOf())/1e3}function Oh(t,e){let n=z(t),s=z(e);return{years:0,months:0,days:Math.round(Xe(n,s)),milliseconds:e.valueOf()-s.valueOf()-(t.valueOf()-n.valueOf())}}function Oa(t,e){let n=Tt(t,e);return n!==null&&n%7===0?n/7:null}function Tt(t,e){return tt(t)===tt(e)?Math.round(Xe(t,e)):null}function z(t){return he([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()])}function Wh(t){return he([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours()])}function Bh(t){return he([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes()])}function _h(t){return he([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds()])}function Uh(t,e,n){let s=t.getUTCFullYear(),r=Un(t,s,e,n);if(r<1)return Un(t,s-1,e,n);let i=Un(t,s+1,e,n);return i>=1?Math.min(r,i):r}function Un(t,e,n,s){let r=he([e,0,1+Fh(e,n,s)]),i=z(t),a=Math.round(Xe(r,i));return Math.floor(a/7)+1}function Fh(t,e,n){let s=7+e-n;return-((7+he([t,0,s]).getUTCDay()-e)%7)+s-1}function Vh(t){return[t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()]}function wr(t){return new Date(t[0],t[1]||0,t[2]==null?1:t[2],t[3]||0,t[4]||0,t[5]||0)}function at(t){return[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()]}function he(t){return t.length===1&&(t=t.concat([0])),new Date(Date.UTC(...t))}function Wa(t){return!isNaN(t.valueOf())}function tt(t){return t.getUTCHours()*1e3*60*60+t.getUTCMinutes()*1e3*60+t.getUTCSeconds()*1e3+t.getUTCMilliseconds()}let Ba={};function zh(t,e){Ba[t]=e}function Gh(t){return new Ba[t]}class Yh{getMarkerYear(e){return e.getUTCFullYear()}getMarkerMonth(e){return e.getUTCMonth()}getMarkerDay(e){return e.getUTCDate()}arrayToMarker(e){return he(e)}markerToArray(e){return at(e)}}zh("gregory",Yh);function qh(t,e){let n=null,s=null;return t.start&&(n=e.createMarker(t.start)),t.end&&(s=e.createMarker(t.end)),!n&&!s||n&&s&&s<n?null:{start:n,end:s}}function Cr(t,e){let n=[],{start:s}=e,r,i;for(t.sort($h),r=0;r<t.length;r+=1)i=t[r],i.start>s&&n.push({start:s,end:i.start}),i.end>s&&(s=i.end);return s<e.end&&n.push({start:s,end:e.end}),n}function $h(t,e){return t.start.valueOf()-e.start.valueOf()}function Ae(t,e){let{start:n,end:s}=t,r=null;return e.start!==null&&(n===null?n=e.start:n=new Date(Math.max(n.valueOf(),e.start.valueOf()))),e.end!=null&&(s===null?s=e.end:s=new Date(Math.min(s.valueOf(),e.end.valueOf()))),(n===null||s===null||n<s)&&(r={start:n,end:s}),r}function Zh(t,e){return(t.start===null?null:t.start.valueOf())===(e.start===null?null:e.start.valueOf())&&(t.end===null?null:t.end.valueOf())===(e.end===null?null:e.end.valueOf())}function Hs(t,e){return(t.end===null||e.start===null||t.end>e.start)&&(t.start===null||e.end===null||t.start<e.end)}function Rn(t,e){return(t.start===null||e.start!==null&&e.start>=t.start)&&(t.end===null||e.end!==null&&e.end<=t.end)}function Ce(t,e){return(t.start===null||e>=t.start)&&(t.end===null||e<t.end)}function Xh(t,e){return e.start!=null&&t<e.start?e.start:e.end!=null&&t>=e.end?new Date(e.end.valueOf()-1):t}function Rr(t,e){let n=e.markerToArray(t.marker);return{marker:t.marker,timeZoneOffset:t.timeZoneOffset,array:n,year:n[0],month:n[1],day:n[2],hour:n[3],minute:n[4],second:n[5],millisecond:n[6]}}function an(t,e,n){let s=Rr(t,n.calendarSystem),r=e?Rr(e,n.calendarSystem):null;return{date:s,start:s,end:r,timeZone:n.timeZone,localeCodes:n.locale.codes}}function Xt(t){return t%1===0}function st(t,e){let n=String(t);return"000".substr(0,e-n.length)+n}const xr=["years","months","days","milliseconds"],Kh=/^(-?)(?:(\d+)\.)?(\d+):(\d\d)(?::(\d\d)(?:\.(\d\d\d))?)?/;function _(t,e){return typeof t=="string"?Jh(t):typeof t=="object"&&t?Tr(t):typeof t=="number"?Tr({[e||"milliseconds"]:t}):null}function Jh(t){let e=Kh.exec(t);if(e){let n=e[1]?-1:1;return{years:0,months:0,days:n*(e[2]?parseInt(e[2],10):0),milliseconds:n*((e[3]?parseInt(e[3],10):0)*60*60*1e3+(e[4]?parseInt(e[4],10):0)*60*1e3+(e[5]?parseInt(e[5],10):0)*1e3+(e[6]?parseInt(e[6],10):0))}}return null}function Tr(t){let e={years:t.years||t.year||0,months:t.months||t.month||0,days:t.days||t.day||0,milliseconds:(t.hours||t.hour||0)*60*60*1e3+(t.minutes||t.minute||0)*60*1e3+(t.seconds||t.second||0)*1e3+(t.milliseconds||t.millisecond||t.ms||0)},n=t.weeks||t.week;return n&&(e.days+=n*7,e.specifiedWeeks=!0),e}function Qh(t,e){return t.years===e.years&&t.months===e.months&&t.days===e.days&&t.milliseconds===e.milliseconds}function Kn(t,e){return{years:t.years+e.years,months:t.months+e.months,days:t.days+e.days,milliseconds:t.milliseconds+e.milliseconds}}function ef(t,e){return{years:t.years-e.years,months:t.months-e.months,days:t.days-e.days,milliseconds:t.milliseconds-e.milliseconds}}function tf(t,e){return{years:t.years*e,months:t.months*e,days:t.days*e,milliseconds:t.milliseconds*e}}function nf(t){return rt(t)/365}function sf(t){return rt(t)/30}function rt(t){return Re(t)/864e5}function Re(t){return t.years*(365*864e5)+t.months*(30*864e5)+t.days*864e5+t.milliseconds}function ks(t,e){let n=null;for(let s=0;s<xr.length;s+=1){let r=xr[s];if(e[r]){let i=t[r]/e[r];if(!Xt(i)||n!==null&&n!==i)return null;n=i}else if(t[r])return null}return n}function Jn(t){let e=t.milliseconds;if(e){if(e%1e3!==0)return{unit:"millisecond",value:e};if(e%(1e3*60)!==0)return{unit:"second",value:e/1e3};if(e%(1e3*60*60)!==0)return{unit:"minute",value:e/(1e3*60)};if(e)return{unit:"hour",value:e/(1e3*60*60)}}return t.days?t.specifiedWeeks&&t.days%7===0?{unit:"week",value:t.days/7}:{unit:"day",value:t.days}:t.months?{unit:"month",value:t.months}:t.years?{unit:"year",value:t.years}:{unit:"millisecond",value:0}}function _a(t,e,n=!1){let s=t.toISOString();return s=s.replace(".000",""),n&&(s=s.replace("T00:00:00Z","")),s.length>10&&(e==null?s=s.replace("Z",""):e!==0&&(s=s.replace("Z",xn(e,!0)))),s}function mt(t){return t.toISOString().replace(/T.*$/,"")}function Mr(t){return t.toISOString().match(/^\d{4}-\d{2}/)[0]}function rf(t){return st(t.getUTCHours(),2)+":"+st(t.getUTCMinutes(),2)+":"+st(t.getUTCSeconds(),2)}function xn(t,e=!1){let n=t<0?"-":"+",s=Math.abs(t),r=Math.floor(s/60),i=Math.round(s%60);return e?`${n+st(r,2)}:${st(i,2)}`:`GMT${n}${r}${i?`:${st(i,2)}`:""}`}function ie(t){let e="";for(const n of t)e+=n.value;return e}const af=/^\s*(\d{4})(-?(\d{2})(-?(\d{2})([T ](\d{2}):?(\d{2})(:?(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/;function of(t){let e=af.exec(t);if(e){let n=new Date(Date.UTC(Number(e[1]),e[3]?Number(e[3])-1:0,Number(e[5]||1),Number(e[7]||0),Number(e[8]||0),Number(e[10]||0),e[12]?+`0.${e[12]}`*1e3:0));if(Wa(n)){let s=null;return e[13]&&(s=(e[15]==="-"?-1:1)*(Number(e[16]||0)*60+Number(e[18]||0))),{marker:n,isTimeUnspecified:!e[6],timeZoneOffset:s}}}return null}class lf{constructor(e){this.timeZone=e.timeZone,this.calendarSystem=Gh(e.calendarSystem),this.locale=e.locale,this.weekDow=e.locale.week.dow,this.weekDoy=e.locale.week.doy,e.weekNumberCalculation==="ISO"&&(this.weekDow=1,this.weekDoy=4),typeof e.firstDay=="number"&&(this.weekDow=e.firstDay),typeof e.weekNumberCalculation=="function"&&(this.weekNumberFunc=e.weekNumberCalculation),this.weekTextLong=e.weekTextLong,this.weekTextShort=e.weekTextShort??e.weekTextLong,this.cmdFormatter=e.cmdFormatter}createMarker(e){let n=this.createMarkerMeta(e);return n===null?null:n.marker}createNowMarker(){return this.timestampToMarker(new Date().valueOf())}createMarkerMeta(e){if(typeof e=="string")return this.parse(e);let n=null;return typeof e=="number"?n=this.timestampToMarker(e):e instanceof Date?(e=e.valueOf(),isNaN(e)||(n=this.timestampToMarker(e))):Array.isArray(e)&&(n=he(e)),n===null||!Wa(n)?null:{marker:n,isTimeUnspecified:!1}}parse(e){let n=of(e);if(n===null)return null;let{marker:s}=n;return n.timeZoneOffset!==null&&(s=this.timestampToMarker(s.valueOf()-n.timeZoneOffset*60*1e3)),{marker:s,isTimeUnspecified:n.isTimeUnspecified}}getYear(e){return this.calendarSystem.getMarkerYear(e)}getMonth(e){return this.calendarSystem.getMarkerMonth(e)}getDay(e){return this.calendarSystem.getMarkerDay(e)}add(e,n){let s=this.calendarSystem.markerToArray(e);return s[0]+=n.years,s[1]+=n.months,s[2]+=n.days,s[6]+=n.milliseconds,this.calendarSystem.arrayToMarker(s)}subtract(e,n){let s=this.calendarSystem.markerToArray(e);return s[0]-=n.years,s[1]-=n.months,s[2]-=n.days,s[6]-=n.milliseconds,this.calendarSystem.arrayToMarker(s)}addYears(e,n){let s=this.calendarSystem.markerToArray(e);return s[0]+=n,this.calendarSystem.arrayToMarker(s)}addMonths(e,n){let s=this.calendarSystem.markerToArray(e);return s[1]+=n,this.calendarSystem.arrayToMarker(s)}diffWholeYears(e,n){let{calendarSystem:s}=this;return tt(e)===tt(n)&&s.getMarkerDay(e)===s.getMarkerDay(n)&&s.getMarkerMonth(e)===s.getMarkerMonth(n)?s.getMarkerYear(n)-s.getMarkerYear(e):null}diffWholeMonths(e,n){let{calendarSystem:s}=this;return tt(e)===tt(n)&&s.getMarkerDay(e)===s.getMarkerDay(n)?s.getMarkerMonth(n)-s.getMarkerMonth(e)+(s.getMarkerYear(n)-s.getMarkerYear(e))*12:null}greatestWholeUnit(e,n){let s=this.diffWholeYears(e,n);return s!==null?{unit:"year",value:s}:(s=this.diffWholeMonths(e,n),s!==null?{unit:"month",value:s}:(s=Oa(e,n),s!==null?{unit:"week",value:s}:(s=Tt(e,n),s!==null?{unit:"day",value:s}:(s=jh(e,n),Xt(s)?{unit:"hour",value:s}:(s=Lh(e,n),Xt(s)?{unit:"minute",value:s}:(s=Ah(e,n),Xt(s)?{unit:"second",value:s}:{unit:"millisecond",value:n.valueOf()-e.valueOf()}))))))}countDurationsBetween(e,n,s){let r;return s.years&&(r=this.diffWholeYears(e,n),r!==null)?r/nf(s):s.months&&(r=this.diffWholeMonths(e,n),r!==null)?r/sf(s):s.days&&(r=Tt(e,n),r!==null)?r/rt(s):(n.valueOf()-e.valueOf())/Re(s)}startOf(e,n){return n==="year"?this.startOfYear(e):n==="month"?this.startOfMonth(e):n==="week"?this.startOfWeek(e):n==="day"?z(e):n==="hour"?Wh(e):n==="minute"?Bh(e):n==="second"?_h(e):null}startOfYear(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e)])}startOfMonth(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e)])}startOfWeek(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e),e.getUTCDate()-(e.getUTCDay()-this.weekDow+7)%7])}computeWeekNumber(e){return this.weekNumberFunc?this.weekNumberFunc(this.toDate(e)):Uh(e,this.weekDow,this.weekDoy)}formatToParts(e,n){return n.formatToParts({marker:e,timeZoneOffset:this.offsetForMarker(e)},this)}formatRangeToParts(e,n,s,r={}){return r.isEndExclusive&&(n=Ge(n,-1)),s.formatRangeToParts({marker:e,timeZoneOffset:this.offsetForMarker(e)},{marker:n,timeZoneOffset:this.offsetForMarker(n)},this)}formatIso(e,n={}){let s=null;return n.omitTimeZoneOffset||(s=this.offsetForMarker(e)),_a(e,s,n.omitTime)}timestampToMarker(e){if(this.timeZone==="local")return he(Vh(new Date(e)));if(this.timeZone==="UTC")return new Date(e);const n=kh(Hh(e),this.timeZone);return new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond))}offsetForMarker(e){return this.timeZone==="local"?-wr(at(e)).getTimezoneOffset():this.timeZone==="UTC"?0:Nh(br(Er(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),this.timeZone))/(1e9*60)}toDate(e){return this.timeZone==="local"?wr(at(e)):this.timeZone==="UTC"?new Date(e.valueOf()):new Date(br(Er(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),this.timeZone).epochMilliseconds)}}const cf=new Set(["week","meridiem","omitZeroMinute","omitCommas","forceCommas","omitTrailing","weekdayJustify"]),Vt=/([ap])\.?m\.?/i,df=/,/g,uf=/\u200e/g,hf=/[\s.,]+$/,Qn=/^\s+$/;class ff{constructor(e){const n={},s={};for(const r in e)cf.has(r)?s[r]=e[r]:n[r]=e[r];n.timeZoneName==="long"&&(n.timeZoneName="short"),this.timeZoneOnly=Object.keys(n).length===1&&n.timeZoneName==="short",this.weekOnly=!!(!Object.keys(n).length&&s.week),this.timeZoneOnly||(n.timeZoneName&&(n.hour||(n.hour="2-digit"),n.minute||(n.minute="2-digit")),s.omitZeroMinute&&(n.second||n.fractionalSecondDigits)&&delete s.omitZeroMinute,n.timeZone="UTC"),this.standardOptions=n,this.extendedOptions=s}formatToParts(e,n){const{standardOptions:s,extendedOptions:r}=this;if(this.timeZoneOnly)return[{type:"timeZoneName",value:xn(e.timeZoneOffset)}];if(this.weekOnly)return pf(n.computeWeekNumber(e.marker),n.weekTextLong,n.weekTextShort,n.locale,r.week);const{normalFormat:i,zeroFormat:a}=this.getFormats(n),l=(a&&!e.marker.getUTCMinutes()?a:i).formatToParts(e.marker);return gf(l,e,s,r)}formatRangeToParts(e,n,s){const{standardOptions:r,extendedOptions:i}=this;if(this.timeZoneOnly||this.weekOnly)return this.formatToParts(e,s).map(u=>({source:u.type==="literal"?"shared":"startRange",...u}));const{normalFormat:a,zeroFormat:o}=this.getFormats(s),c=(o&&!e.marker.getUTCMinutes()&&!n.marker.getUTCMinutes()?o:a).formatRangeToParts(e.marker,n.marker);return mf(c,e,n,r,i)}getFormats(e){if(this.cachedContext!==e){const{standardOptions:n,extendedOptions:s}=this,{codes:r}=e.locale,i=new Intl.DateTimeFormat(r,n);let a;if(s.omitZeroMinute){const o={...n};delete o.minute,a=new Intl.DateTimeFormat(r,o)}this.cachedContext=e,this.cachedFormats={normalFormat:i,zeroFormat:a}}return this.cachedFormats}}function Ua(t,e,n){let s=!1,r;for(const i of t){const a=i.type==="literal";if(a||i.type==="dayPeriod"){let o=i.value;if(o=o.replace(uf,""),e.omitCommas&&(o=o.replace(df,"")),!a){const{meridiem:l}=e;l===!1?o=o.replace(Vt,""):l==="narrow"?o=o.replace(Vt,(c,u)=>u.toLocaleLowerCase()):l==="short"?o=o.replace(Vt,(c,u)=>`${u.toLocaleLowerCase()}m`):l==="lowercase"&&(o=o.replace(Vt,c=>c.toLocaleLowerCase())),r&&(r.value=r.value.trimEnd())}i.value=o}else if(i.type==="timeZoneName"){const o=n(i);o!=null&&(i.value=o,s=!0)}r=a?i:void 0}return{lastLiteral:r,anyTzInjected:s}}function gf(t,e,n,s){const r=n.timeZoneName==="short"?e.timeZoneOffset==null?"UTC":xn(e.timeZoneOffset):void 0,{lastLiteral:i,anyTzInjected:a}=Ua(t,s,()=>r);if(r&&!a&&(i?i.value+=" ":t.push({type:"literal",value:" "}),t.push({type:"timeZoneName",value:r})),s.weekdayJustify&&t.length===3&&Qn.test(t[1].value)&&t[s.weekdayJustify==="start"?2:0].type==="weekday"&&t.reverse(),s.forceCommas)for(const o of t)o.type==="literal"&&Qn.test(o.value)&&(o.value=`,${o.value}`);return s.omitTrailing&&Fa(t),t.filter(o=>o.value)}function mf(t,e,n,s,r){const i=s.timeZoneName==="short";if(Ua(t,r,a=>{if(!i)return;const o=a.source==="endRange"?n.timeZoneOffset:e.timeZoneOffset;return o==null?"UTC":xn(o)}),r.forceCommas)for(const a of t)a.type==="literal"&&Qn.test(a.value)&&(a.value=`,${a.value}`);return r.omitTrailing&&Fa(t),t.filter(a=>a.value)}function Fa(t){const e=t[t.length-1];e?.type==="literal"&&(e.value=e.value.replace(hf,""),e.value||t.pop())}function pf(t,e,n,s,r){const i=[];return r==="long"?i.push({type:"literal",value:e}):(r==="short"||r==="narrow")&&i.push({type:"literal",value:n}),(r==="long"||r==="short")&&i.push({type:"literal",value:" "}),i.push({type:"week",value:s.simpleNumberFormat.format(t)}),s.options.direction==="rtl"&&i.reverse(),i}class vf{constructor(e){this.cmdStr=e}formatToParts(e,n){const s=n.cmdFormatter(this.cmdStr,an(e,null,n));return Array.isArray(s)?s:[{type:"literal",value:s}]}formatRangeToParts(e,n,s){const r=s.cmdFormatter(this.cmdStr,an(e,n,s));return Array.isArray(r)?r.map(i=>({source:"shared",...i})):[{source:"shared",type:"literal",value:r}]}}class yf{constructor(e){this.func=e}formatToParts(e,n){return[{type:"literal",value:this.func(an(e,null,n))}]}formatRangeToParts(e,n,s){return[{source:"shared",type:"literal",value:this.func(an(e,n,s))}]}}var f={popoverZ:"fc-nH",isolate:"fc-7s",borderBoxRoot:"fc-wa",notAllowed:"fc-4m",noScrollbars:"fc-eM",noShrink:"fc-Qo",calendarScreenRoot:"fc-fi",safeTiles:"fc-fl",calendarPrintRoot:"fc-Jf",cursorPointer:"fc-DP",cursorResizeT:"fc-An",cursorResizeB:"fc-lZ",cursorResizeS:"fc-9V",cursorResizeE:"fc-70",hit:"fc-mN",hitX:"fc-2d",hitY:"fc-B0",borderNone:"fc-Tu",borderOnlyT:"fc-hU",borderOnlyB:"fc-3e",borderOnlyS:"fc-PB",borderlessX:"fc-MQ",fakeBorderS:"fc-2l",flexRow:"fc-Ao",flexCol:"fc-HH",grow:"fc-GV",liquid:"fc-g2",minHeight0:"fc-Ot",liquidX:"fc-hp",printRoot:"fc-uD",printHeader:"fc-jM",noPadding:"fc-OJ",noMargin:"fc-oE",noMarginX:"fc-SS",whiteSpaceNoWrap:"fc-y2",whiteSpacePre:"fc-CN",overflowAnchorNone:"fc-gZ",crop:"fc-FA",rel:"fc-cc",abs:"fc-H0",start0:"fc-6t",fill:"fc-ct",fillTop:"fc-iv",fillX:"fc-Uu",fillY:"fc-7k",fillStart:"fc-Yw",sticky:"fc-Ip",stickyT:"fc-CS",stickyS:"fc-tT",tableHeaderSticky:"fc-hy",contentBox:"fc-Np",alignCenter:"fc-6H",alignStart:"fc-K8",alignEnd:"fc-E3",footerScrollbarSticky:"fc-Px",footerScrollbar:"fc-J4",breakInsideAvoid:"fc-Yi",printSiblingRow:"fc-fx",z0:"fc-BS",z1:"fc-iu",focusZ2:"fc-Bk",internalEvent:"fc-Ft",internalEventMirror:"fc-lc",internalEventDraggable:"fc-uL",internalEventSelected:"fc-Bv",internalEventResizable:"fc-Qk",internalEventResizer:"fc-9X",internalEventResizerStart:"fc-Sj",internalEventResizerEnd:"fc-DL",internalBgEvent:"fc-oP",internalMoreLink:"fc-R2",internalNavLink:"fc-SW",internalPopover:"fc-Cs",internalView:"fc-LQ",internalScroller:"fc-dT"};function b(...t){return t.filter(Boolean).join(" ")}function Mt(t){return t*100+"%"}function V(t){return typeof t=="object"&&t?new ff(t):typeof t=="string"?new vf(t):typeof t=="function"?new yf(t):null}function Oe(...t){console.warn("FullCalendar:",...t)}const Ir={};function se(t,e){return!t||typeof t=="string"?t:(Sf(e),"")}function M(t,e){return typeof t=="function"?n=>se(t(n),e):se(t,e)}function Sf(t){Ir[t]||(Oe(`Invalid option \`${t}\`: expected a className string or a falsy value.`),Ir[t]=!0)}function Tn(t){t.preventDefault()}function Ef(t,e){return n=>{let s=n.target.closest(t);s&&e.call(s,n,s)}}function Va(t,e,n,s){let r=Ef(n,s);return t.addEventListener(e,r),()=>{t.removeEventListener(e,r)}}function bf(t,e,n,s){let r;return Va(t,"mouseover",e,(i,a)=>{if(a!==r){r=a,n(i,a);let o=l=>{r=null,s(l,a),a.removeEventListener("mouseleave",o)};a.addEventListener("mouseleave",o)}})}const Nr=["webkitTransitionEnd","otransitionend","oTransitionEnd","msTransitionEnd","transitionend"];function Df(t,e){let n=s=>{e(s),Nr.forEach(r=>{t.removeEventListener(r,n)})};Nr.forEach(s=>{t.addEventListener(s,n)})}function Ps(t){return{onClick:t,...za(t)}}function za(t){return{tabIndex:0,onKeyDown(e){(e.key==="Enter"||e.key===" ")&&(t(e),e.preventDefault())}}}let Hr=0;function Te(){return Hr+=1,String(Hr)}function js(){document.body.classList.add(f.notAllowed)}function Ls(){document.body.classList.remove(f.notAllowed)}function wf(t){t.style.userSelect="none",t.style.webkitUserSelect="none",t.addEventListener("selectstart",Tn)}function Cf(t){t.style.userSelect="",t.style.webkitUserSelect="",t.removeEventListener("selectstart",Tn)}function Rf(t){t.addEventListener("contextmenu",Tn)}function xf(t){t.removeEventListener("contextmenu",Tn)}function Tf(t){let e=[],n=[],s,r;for(typeof t=="string"?n=t.split(/\s*,\s*/):typeof t=="function"?n=[t]:Array.isArray(t)&&(n=t),s=0;s<n.length;s+=1)r=n[s],typeof r=="string"?e.push(r.charAt(0)==="-"?{field:r.substring(1),order:-1}:{field:r,order:1}):typeof r=="function"&&e.push({func:r});return e}function Mf(t,e,n){let s,r;for(s=0;s<n.length;s+=1)if(r=If(t,e,n[s]),r)return r;return 0}function If(t,e,n){return n.func?n.func(t,e):Nf(t[n.field],e[n.field])*(n.order||1)}function Nf(t,e){return!t&&!e?0:e==null?-1:t==null?1:typeof t=="string"||typeof e=="string"?String(t).localeCompare(String(e)):t-e}function ue(t,e,n){return typeof t=="function"?t(...e):typeof t=="string"?e.reduce((s,r,i)=>s.replace("$"+i,r||""),t):n}function Hf(t,e){return t-e}function Ga(t,e){return t===e}function ve(t){const e=t.borderless;return{borderlessX:!!(t.borderlessX??e),borderlessTop:!!(t.borderlessTop??e),borderlessBottom:!!(t.borderlessBottom??e)}}const{hasOwnProperty:ot}=Object.prototype;function Ye(t,e){let n={};for(let s in t)e(t[s],s)&&(n[s]=t[s]);return n}function xe(t,e){let n={};for(let s in t)n[s]=e(t[s],s);return n}function Ya(t){let e=[];for(let n in t)e.push(t[n]);return e}function qa(t){let e={};for(let n of t)e[n]=!0;return e}function kf(t,e){return typeof t=="object"&&t&&typeof e=="object"&&e?As(t,e,We):t===e}function As(t,e,n){if(t===e)return!0;for(let s in t)if(ot.call(t,s)&&!(s in e))return!1;for(let s in e)if(ot.call(e,s)&&(!(s in t)||!n(t[s],e[s],s)))return!1;return!0}function Fn(t,e){return typeof t=="object"&&typeof e=="object"&&t&&e?We(t,e):t===e}function We(t,e){return As(t,e,Ga)}function kr(t,e,n){return As(t,e,(s,r,i)=>{const a=n[i];return a?a(s,r):s===r})}function Pf(t,e){let n=[];for(let s in t)ot.call(t,s)&&(s in e||n.push(s));for(let s in e)ot.call(e,s)&&t[s]!==e[s]&&n.push(s);return n}function jf(t,e){return t?Lf(t,e,Af):e}function Lf(t,e,n){const s={};for(let r in t)ot.call(t,r)&&(r in e||(s[r]=t[r]));for(let r in e)ot.call(e,r)&&(r in t?s[r]=n(t[r],e[r]):s[r]=e[r]);return s}function Af(t,e){return Object.assign({},t,e)}function zt(t,e){return Array.isArray(t)&&Array.isArray(e)?lt(t,e):t===e}function lt(t,e,n=Ga){if(t===e)return!0;let s=t.length,r;if(s!==e.length)return!1;for(r=0;r<s;r+=1)if(!n(t[r],e[r]))return!1;return!0}const Pr={navLinkDayClick:S,navLinkWeekClick:S,duration:_,buttons:S,toolbarElements:S,prevText:String,nextText:String,prevYearText:String,nextYearText:String,todayText:String,yearText:String,monthText:String,weekTextLong:String,weekTextShort:String,dayText:String,listText:S,todayHint:S,prevHint:S,nextHint:S,buttonDisplay:S,buttonGroupClass:M,buttonClass:M,defaultAllDayEventDuration:_,defaultTimedEventDuration:_,nextDayThreshold:_,scrollTime:_,scrollTimeReset:Boolean,slotMinTime:_,slotMaxTime:_,popoverFormat:V,slotDuration:_,snapDuration:_,headerToolbar:S,footerToolbar:S,forceEventDuration:Boolean,dayLaneClass:M,dayLaneInnerClass:M,dayLaneDidMount:S,dayLaneWillUnmount:S,initialView:String,aspectRatio:Number,weekends:Boolean,weekNumberCalculation:S,weekNumbers:Boolean,weekNumberHeaderClass:M,weekNumberHeaderInnerClass:M,weekNumberHeaderContent:S,weekNumberHeaderDidMount:S,weekNumberHeaderWillUnmount:S,inlineWeekNumberClass:M,inlineWeekNumberContent:S,inlineWeekNumberDidMount:S,inlineWeekNumberWillUnmount:S,editable:Boolean,controller:S,nowIndicator:Boolean,nowIndicatorSnap:S,nowIndicatorHeaderClass:M,nowIndicatorHeaderContent:S,nowIndicatorHeaderDidMount:S,nowIndicatorHeaderWillUnmount:S,nowIndicatorDotClass:se,nowIndicatorLineClass:M,nowIndicatorLineContent:S,nowIndicatorLineDidMount:S,nowIndicatorLineWillUnmount:S,showNonCurrentDates:Boolean,lazyFetching:Boolean,startParam:String,endParam:String,timeZoneParam:String,timeZone:String,locales:S,locale:S,dragRevertDuration:Number,dragScroll:Boolean,allDayMaintainDuration:Boolean,unselectAuto:Boolean,dropAccept:S,eventOrder:Tf,eventOrderStrict:Boolean,eventSlicing:Boolean,eventPrintLayout:String,longPressDelay:Number,eventDragMinDistance:Number,expandRows:Boolean,height:S,contentHeight:S,direction:String,colorScheme:String,weekNumberFormat:V,eventResizableFromStart:Boolean,displayEventTime:Boolean,displayEventEnd:Boolean,progressiveEventRendering:Boolean,businessHours:S,initialDate:S,now:S,eventDataTransform:S,tableHeaderSticky:S,footerScrollbarSticky:S,defaultAllDay:Boolean,eventSourceFailure:S,eventSourceSuccess:S,eventDisplay:String,eventStartEditable:Boolean,eventDurationEditable:Boolean,eventOverlap:S,eventConstraint:S,eventAllow:S,eventColor:String,eventContrastColor:String,eventDidMount:S,eventWillUnmount:S,eventContent:S,eventClass:M,eventInnerClass:M,eventTimeClass:M,eventTitleClass:M,eventBeforeClass:M,eventAfterClass:M,listItemEventClass:M,listItemEventInnerClass:M,listItemEventTimeClass:M,listItemEventTitleClass:M,listItemEventBeforeClass:M,listItemEventAfterClass:M,blockEventClass:M,blockEventInnerClass:M,blockEventTimeClass:M,blockEventTitleClass:M,blockEventBeforeClass:M,blockEventAfterClass:M,rowEventClass:M,rowEventInnerClass:M,rowEventTimeClass:M,rowEventTitleClass:M,rowEventTitleSticky:Boolean,rowEventBeforeClass:M,rowEventBeforeContent:S,rowEventAfterClass:M,rowEventAfterContent:S,columnEventClass:M,columnEventInnerClass:M,columnEventTimeClass:M,columnEventTitleClass:M,columnEventTitleSticky:Boolean,columnEventBeforeClass:M,columnEventAfterClass:M,backgroundEventClass:M,backgroundEventDidMount:S,backgroundEventWillUnmount:S,backgroundEventContent:S,backgroundEventInnerClass:M,backgroundEventTitleClass:M,backgroundEventColor:String,selectConstraint:S,selectOverlap:S,selectAllow:S,droppable:Boolean,unselectCancel:String,slotHeaderFormat:S,slotLaneClass:M,slotLaneDidMount:S,slotLaneWillUnmount:S,slotHeaderClass:M,slotHeaderInnerClass:M,slotHeaderContent:S,slotHeaderDidMount:S,slotHeaderWillUnmount:S,slotHeaderAlign:S,slotHeaderSticky:S,slotHeaderRowClass:se,slotHeaderDividerClass:M,dayMaxEvents:S,dayMaxEventRows:S,dayMinWidth:Number,slotHeaderInterval:_,dayHeaderClass:M,dayHeaderInnerClass:M,dayHeaderContent:S,dayHeaderDidMount:S,dayHeaderWillUnmount:S,dayHeaderAlign:S,_dayHeaderSticky:S,dayHeaderRowClass:se,dayHeaderDividerClass:M,dayRowClass:se,dayCellDidMount:S,dayCellWillUnmount:S,dayCellClass:M,dayCellInnerClass:M,dayCellTopContent:S,dayCellTopClass:M,dayCellTopInnerClass:M,dayCellBottomClass:M,allDaySlot:Boolean,allDayText:String,allDayHeaderClass:M,allDayHeaderInnerClass:M,allDayHeaderContent:S,allDayHeaderDidMount:S,allDayHeaderWillUnmount:S,timedText:String,slotMinWidth:Number,slotMinHeight:Number,navLinks:Boolean,eventTimeFormat:V,rerenderDelay:Number,moreLinkText:S,moreLinkHint:S,selectMinDistance:Number,selectable:Boolean,selectLongPressDelay:Number,eventLongPressDelay:Number,selectMirror:Boolean,eventMaxStack:Number,eventMinHeight:Number,eventMinWidth:Number,eventShortHeight:Number,slotEventOverlap:Boolean,firstDay:Number,dayCount:Number,dateAlignment:String,dateIncrement:_,hiddenDays:S,fixedWeekCount:Boolean,validRange:S,visibleRange:S,titleFormat:S,eventInteractive:Boolean,noEventsText:String,viewHint:S,viewChangeHint:String,navLinkHint:S,closeHint:String,eventsHint:String,headingLevel:Number,moreLinkClick:S,moreLinkContent:S,moreLinkDidMount:S,moreLinkWillUnmount:S,moreLinkClass:M,moreLinkInnerClass:M,rowMoreLinkClass:M,rowMoreLinkInnerClass:M,columnMoreLinkClass:M,columnMoreLinkInnerClass:M,navLinkClass:se,monthStartFormat:V,dayCellFormat:V,handleCustomRendering:S,customRenderingMetaMap:S,popoverClass:se,popoverCloseClass:se,popoverCloseContent:S,dayNarrowWidth:Number,borderless:Boolean,borderlessX:Boolean,borderlessTop:Boolean,borderlessBottom:Boolean,fillerClass:M,headerToolbarClass:M,footerToolbarClass:M,toolbarClass:M,toolbarSectionClass:M,toolbarTitleClass:se,tableClass:M,tableHeaderClass:M,tableBodyClass:M,nonBusinessHoursClass:se,highlightClass:se,dayHeaders:Boolean,dayHeaderFormat:V,allDayDividerClass:se,listDaysClass:se,listDayClass:M,listDayFormat:Ar,listDayAltFormat:Ar,listDayHeaderDidMount:S,listDayHeaderWillUnmount:S,listDayHeaderClass:M,listDayHeaderInnerClass:M,listDayHeaderContent:S,listDayBodyClass:M,noEventsClass:M,noEventsInnerClass:M,noEventsContent:S,noEventsDidMount:S,noEventsWillUnmount:S,multiMonthMaxColumns:Number,singleMonthMinWidth:Number,singleMonthTitleFormat:V,singleMonthDidMount:S,singleMonthWillUnmount:S,singleMonthClass:M,singleMonthHeaderClass:M,singleMonthHeaderInnerClass:M},Vn={buttonDisplay:"auto",eventDisplay:"auto",defaultTimedEventDuration:"01:00:00",defaultAllDayEventDuration:{day:1},forceEventDuration:!1,nextDayThreshold:"00:00:00",initialView:"",aspectRatio:1.35,weekends:!0,weekNumbers:!1,weekNumberCalculation:"local",editable:!1,nowIndicator:!1,scrollTime:"06:00:00",scrollTimeReset:!0,slotMinTime:"00:00:00",slotMaxTime:"24:00:00",showNonCurrentDates:!0,lazyFetching:!0,startParam:"start",endParam:"end",timeZoneParam:"timeZone",timeZone:"local",locales:[],locale:"",dragRevertDuration:500,dragScroll:!0,allDayMaintainDuration:!1,unselectAuto:!0,dropAccept:"*",eventOrder:"start,-duration,allDay,title",eventPrintLayout:"auto",popoverFormat:{month:"long",day:"numeric",year:"numeric"},longPressDelay:1e3,eventDragMinDistance:5,expandRows:!1,navLinks:!1,selectable:!1,eventMinHeight:15,eventMinWidth:30,eventShortHeight:30,monthStartFormat:{month:"long",day:"numeric"},dayCellFormat:{day:"numeric",omitTrailing:!0},headingLevel:2,outerBorder:!0,dayNarrowWidth:80,eventOverlap:!0,slotHeaderAlign:"start",slotHeaderSticky:!0,dayHeaderAlign:"start",_dayHeaderSticky:!0,rowEventTitleSticky:!0,columnEventTitleSticky:!0,nowIndicatorSnap:"auto",dayHeaders:!0},jr={datesSet:S,eventsSet:S,eventAdd:S,eventChange:S,eventRemove:S,eventClick:S,eventMouseEnter:S,eventMouseLeave:S,select:S,unselect:S,loading:S,_unmount:S,_beforeprint:S,_afterprint:S,_noDateSelect:S,_noEventDrop:S,_noEventResize:S,_timeScrollRequest:S,dateClick:S,eventDragStart:S,eventDragStop:S,eventDrop:S,eventResizeStart:S,eventResizeStop:S,eventResize:S,drop:S,eventReceive:S,eventLeave:S},Lr={class:M,className:M,viewClass:M,viewDidMount:S,viewWillUnmount:S,views:S,plugins:S,initialEvents:S,events:S,eventSources:S},Of={type:String,component:S,class:M,className:M,content:S,didMount:S,willUnmount:S,buttonTextKey:String,dateProfileGeneratorClass:S,usesMinMaxTime:Boolean,disallowAmbigTitle:Boolean},Qe={dateIncrement:Fn,headerToolbar:Fn,footerToolbar:Fn,buttons:kf,plugins:zt,events:zt,eventSources:zt,resources:zt};function Os(t,e){let n={},s={};for(let r in e)r in t&&(n[r]=e[r](t[r],r));for(let r in t)r in e||(s[r]=t[r]);return{refined:n,extra:s}}function S(t){return t}function Ar(t){return t===!1?null:V(t)}function $a(t){let e=Math.floor(Xe(t.start,t.end))||1,n=z(t.start),s=te(n,e);return{start:n,end:s}}function Za(t,e=_(0)){let n=null,s=null;if(t.end){s=z(t.end);let r=t.end.valueOf()-s.valueOf();r&&r>=Re(e)&&(s=te(s,1))}return t.start&&(n=z(t.start),s&&s<=n&&(s=te(n,1))),{start:n,end:s}}function nt(t,e,n,s){return s==="year"?_(n.diffWholeYears(t,e),"year"):s==="month"?_(n.diffWholeMonths(t,e),"month"):Oh(t,e)}function Ws(t,e){return{instanceId:Te(),defId:t,range:e}}function Wf(t,e,n,s){for(let r=0;r<s.length;r+=1){let i=s[r].parse(t,n);if(i){let{allDay:a}=t;return a==null&&(a=e,a==null&&(a=i.allDayGuess,a==null&&(a=!1))),{allDay:a,duration:i.duration,typeData:i.typeData,typeId:r}}}return null}function qe(t,e,n){let{dateEnv:s,pluginHooks:r,options:i}=n,{defs:a,instances:o}=t;o=Ye(o,l=>!a[l.defId].recurringDef);for(let l in a){let c=a[l];if(c.recurringDef){let{duration:u}=c.recurringDef;u||(u=c.allDay?i.defaultAllDayEventDuration:i.defaultTimedEventDuration);let h=Bf(c,u,e,s,r.recurringTypes);for(let g of h){let m=Ws(l,{start:g,end:s.add(g,u)});o[m.instanceId]=m}}}return{defs:a,instances:o}}function Bf(t,e,n,s,r){let a=r[t.recurringDef.typeId].expand(t.recurringDef.typeData,{start:s.subtract(n.start,e),end:n.end},s);return t.allDay&&(a=a.map(z)),a}function It(t,e,n,s,r,i){let a=de(),o=Us(n);for(let l of t){let c=Ja(l,e,n,s,o,r,i);c&&es(c,a)}return a}function es(t,e=de()){return e.defs[t.def.defId]=t.def,t.instance&&(e.instances[t.instance.instanceId]=t.instance),e}function Bs(t,e){let n=t.instances[e];if(n){let s=t.defs[n.defId],r=Mn(t,i=>_f(s,i));return r.defs[s.defId]=s,r.instances[n.instanceId]=n,r}return de()}function _f(t,e){return!!(t.groupId&&t.groupId===e.groupId)}function de(){return{defs:{},instances:{}}}function _s(t,e){return{defs:{...t.defs,...e.defs},instances:{...t.instances,...e.instances}}}function Mn(t,e){let n=Ye(t.defs,e),s=Ye(t.instances,r=>n[r.defId]);return{defs:n,instances:s}}function Uf(t,e){let{defs:n,instances:s}=t,r={},i={};for(let a in n)e.defs[a]||(r[a]=n[a]);for(let a in s)!e.instances[a]&&r[s[a].defId]&&(i[a]=s[a]);return{defs:r,instances:i}}function Ff(t,e){return Array.isArray(t)?It(t,null,e,!0):typeof t=="object"&&t?It([t],null,e,!0):t!=null?String(t):null}const on={display:String,editable:Boolean,startEditable:Boolean,durationEditable:Boolean,constraint:S,overlap:S,allow:S,class:se,className:se,color:String,contrastColor:String},Vf={display:null,startEditable:null,durationEditable:null,constraints:[],overlap:null,allows:[],color:"",contrastColor:"",className:""};function ln(t,e){let n=Ff(t.constraint,e);return{display:t.display||null,startEditable:t.startEditable!=null?t.startEditable:t.editable,durationEditable:t.durationEditable!=null?t.durationEditable:t.editable,constraints:n!=null?[n]:[],overlap:t.overlap!=null?t.overlap:null,allows:t.allow!=null?[t.allow]:[],color:t.color||"",contrastColor:t.contrastColor||"",className:(t.class??t.className)||""}}function Xa(t){return t.reduce(zf,Vf)}function zf(t,e){return{display:e.display!=null?e.display:t.display,startEditable:e.startEditable!=null?e.startEditable:t.startEditable,durationEditable:e.durationEditable!=null?e.durationEditable:t.durationEditable,constraints:t.constraints.concat(e.constraints),overlap:typeof e.overlap=="boolean"?e.overlap:t.overlap,allows:t.allows.concat(e.allows),color:e.color||t.color,contrastColor:e.contrastColor||t.contrastColor,className:b(t.className,e.className)}}const Kt={id:String,groupId:String,title:String,url:String,interactive:Boolean},Ka={start:S,end:S,date:S,allDay:Boolean},Gf={...Kt,...Ka,extendedProps:S};function Ja(t,e,n,s,r=Us(n),i,a){let{refined:o,extra:l}=Qa(t,n,r),c=qf(e,n),u=Wf(o,c,n.dateEnv,n.pluginHooks.recurringTypes);if(u){let g=ts(o,l,e?e.sourceId:"",u.allDay,!!u.duration,n,i);return g.recurringDef={typeId:u.typeId,typeData:u.typeData,duration:u.duration},{def:g,instance:null}}let h=Yf(o,c,n,s);if(h){let g=ts(o,l,e?e.sourceId:"",h.allDay,h.hasEnd,n,i),m=Ws(g.defId,h.range);return a&&g.publicId&&a[g.publicId]&&(m.instanceId=a[g.publicId]),{def:g,instance:m}}return null}function Qa(t,e,n=Us(e)){return Os(t,n)}function Us(t){return{...on,...Gf,...t.pluginHooks.eventRefiners}}function ts(t,e,n,s,r,i,a){let o={title:t.title||"",groupId:t.groupId||"",publicId:t.id||"",url:t.url||"",recurringDef:null,defId:(a&&t.id?a[t.id]:"")||Te(),sourceId:n,allDay:s,hasEnd:r,interactive:t.interactive,ui:ln(t,i),extendedProps:{...t.extendedProps||{},...e}};for(let l of i.pluginHooks.eventDefMemberAdders)Object.assign(o,l(t));return Object.freeze(o.ui.className),Object.freeze(o.extendedProps),o}function Yf(t,e,n,s){let{allDay:r}=t,i,a=null,o=!1,l,c=null,u=t.start!=null?t.start:t.date;if(i=n.dateEnv.createMarkerMeta(u),i)a=i.marker;else if(!s)return null;return t.end!=null&&(l=n.dateEnv.createMarkerMeta(t.end)),r==null&&(e!=null?r=e:r=(!i||i.isTimeUnspecified)&&(!l||l.isTimeUnspecified)),r&&a&&(a=z(a)),l&&(c=l.marker,r&&(c=z(c)),a&&c<=a&&(c=null)),c?o=!0:s||(o=n.options.forceEventDuration||!1,c=n.dateEnv.add(a,r?n.options.defaultAllDayEventDuration:n.options.defaultTimedEventDuration)),{allDay:r,hasEnd:o,range:{start:a,end:c}}}function qf(t,e){let n=null;return t&&(n=t.defaultAllDay),n==null&&(n=e.options.defaultAllDay),n}const $f={start:S,end:S,allDay:Boolean};function Zf(t,e,n){let s=Xf(t,e),{range:r}=s;if(!r.start)return null;if(!r.end){if(n==null)return null;r.end=e.add(r.start,n)}return s}function Xf(t,e){let{refined:n,extra:s}=Os(t,$f),r=n.start?e.createMarkerMeta(n.start):null,i=n.end?e.createMarkerMeta(n.end):null,{allDay:a}=n;return a==null&&(a=r&&r.isTimeUnspecified&&(!i||i.isTimeUnspecified)),{range:{start:r?r.marker:null,end:i?i.marker:null},allDay:a,...s}}function Kf(t,e){return Zh(t.range,e.range)&&t.allDay===e.allDay&&Jf(t,e)}function Jf(t,e){for(let n in e)if(n!=="range"&&n!=="allDay"&&t[n]!==e[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}function Qf(t,e){return{...to(t.range,e,t.allDay),allDay:t.allDay}}function eo(t,e,n){return{...to(t,e,n),timeZone:e.timeZone}}function to(t,e,n){return{start:e.toDate(t.start),end:e.toDate(t.end),startStr:e.formatIso(t.start,{omitTime:n}),endStr:e.formatIso(t.end,{omitTime:n})}}function eg(t,e,n){let s=Qa({editable:!1},n),r=ts(s.refined,s.extra,"",t.allDay,!0,n);return{def:r,ui:ro(r,e),instance:Ws(r.defId,t.range),range:t.range,isStart:!0,isEnd:!0}}function no(t,e,n){n.emitter.trigger("select",{...Fs(t,n),jsEvent:e?e.origEvent:null,view:n.viewApi||n.calendarApi.view})}function tg(t,e){e.emitter.trigger("unselect",{jsEvent:t?t.origEvent:null,view:e.viewApi||e.calendarApi.view})}function Fs(t,e){let n={};for(let s of e.pluginHooks.dateSpanTransforms)Object.assign(n,s(t,e));return Object.assign(n,Qf(t,e.dateEnv)),n}function Or(t,e,n){let{dateEnv:s,options:r}=n,i=e;return t?(i=z(i),i=s.add(i,r.defaultAllDayEventDuration)):i=s.add(i,r.defaultTimedEventDuration),i}function Vs(t,e,n,s){let r=dn(t.defs,e),i=de();for(let a in t.defs){let o=t.defs[a];i.defs[a]=ng(o,r[a],n,s)}for(let a in t.instances){let o=t.instances[a],l=i.defs[o.defId];i.instances[a]=sg(o,l,r[o.defId],n,s)}return i}function ng(t,e,n,s){let r=n.standardProps||{};r.hasEnd==null&&e.durationEditable&&(n.startDelta||n.endDelta)&&(r.hasEnd=!0);let i={...t,...r,ui:{...t.ui,...r.ui}};n.extendedProps&&(i.extendedProps={...i.extendedProps,...n.extendedProps});for(let a of s.pluginHooks.eventDefMutationAppliers)a(i,n,s);return!i.hasEnd&&s.options.forceEventDuration&&(i.hasEnd=!0),i}function sg(t,e,n,s,r){let{dateEnv:i}=r,a=s.standardProps&&s.standardProps.allDay===!0,o=s.standardProps&&s.standardProps.hasEnd===!1,l={...t};return a&&(l.range=$a(l.range)),s.datesDelta&&n.startEditable&&(l.range={start:i.add(l.range.start,s.datesDelta),end:i.add(l.range.end,s.datesDelta)}),s.startDelta&&n.durationEditable&&(l.range={start:i.add(l.range.start,s.startDelta),end:l.range.end}),s.endDelta&&n.durationEditable&&(l.range={start:l.range.start,end:i.add(l.range.end,s.endDelta)}),o&&(l.range={start:l.range.start,end:Or(e.allDay,l.range.start,r)}),e.allDay&&(l.range={start:z(l.range.start),end:z(l.range.end)}),l.range.end<l.range.start&&(l.range.end=Or(e.allDay,l.range.start,r)),l}class et{constructor(e,n){this.context=e,this.internalEventSource=n}remove(){this.context.dispatch({type:"REMOVE_EVENT_SOURCE",sourceId:this.internalEventSource.sourceId})}refetch(){this.context.dispatch({type:"FETCH_EVENT_SOURCES",sourceIds:[this.internalEventSource.sourceId],isRefetch:!0})}get id(){return this.internalEventSource.publicId}get url(){return this.internalEventSource.meta.url}get format(){return this.internalEventSource.meta.format}}class ${constructor(e,n,s){this._context=e,this._def=n,this._instance=s||null}setProp(e,n){if(e in Ka)Oe(`Cannot set date-related event property \`${e}\`. Use a method instead.`);else if(e==="id")n=Kt[e](n),this.mutate({standardProps:{publicId:n}});else if(e in Kt)n=Kt[e](n),this.mutate({standardProps:{[e]:n}});else if(e in on){let s=on[e](n);e==="editable"?s={startEditable:n,durationEditable:n}:s={[e]:n},this.mutate({standardProps:{ui:s}})}else Oe(`Cannot set event property \`${e}\`. Use setExtendedProp instead.`)}setExtendedProp(e,n){this.mutate({extendedProps:{[e]:n}})}setStart(e,n={}){let{dateEnv:s}=this._context,r=s.createMarker(e);if(r&&this._instance){let i=this._instance.range,a=nt(i.start,r,s,n.granularity);n.maintainDuration?this.mutate({datesDelta:a}):this.mutate({startDelta:a})}}setEnd(e,n={}){let{dateEnv:s}=this._context,r;if(!(e!=null&&(r=s.createMarker(e),!r))&&this._instance)if(r){let i=nt(this._instance.range.end,r,s,n.granularity);this.mutate({endDelta:i})}else this.mutate({standardProps:{hasEnd:!1}})}setDates(e,n,s={}){let{dateEnv:r}=this._context,i={allDay:s.allDay},a=r.createMarker(e),o;if(a&&!(n!=null&&(o=r.createMarker(n),!o))&&this._instance){let l=this._instance.range;s.allDay===!0&&(l=$a(l));let c=nt(l.start,a,r,s.granularity);if(o){let u=nt(l.end,o,r,s.granularity);Qh(c,u)?this.mutate({datesDelta:c,standardProps:i}):this.mutate({startDelta:c,endDelta:u,standardProps:i})}else i.hasEnd=!1,this.mutate({datesDelta:c,standardProps:i})}}moveStart(e){let n=_(e);n&&this.mutate({startDelta:n})}moveEnd(e){let n=_(e);n&&this.mutate({endDelta:n})}moveDates(e){let n=_(e);n&&this.mutate({datesDelta:n})}setAllDay(e,n={}){let s={allDay:e},{maintainDuration:r}=n;r==null&&(r=this._context.options.allDayMaintainDuration),this._def.allDay!==e&&(s.hasEnd=r),this.mutate({standardProps:s})}formatRange(e){let{dateEnv:n}=this._context,s=this._instance,r=V(e);return this._def.hasEnd?ie(n.formatRangeToParts(s.range.start,s.range.end,r)):ie(n.formatToParts(s.range.start,r))}mutate(e){let n=this._instance;if(n){let s=this._def,r=this._context,{eventStore:i}=r.getCurrentData(),a=Bs(i,n.instanceId);a=Vs(a,{"":{display:"",startEditable:!0,durationEditable:!0,constraints:[],overlap:null,allows:[],color:"",contrastColor:"",className:""}},e,r);let l=new $(r,s,n);this._def=a.defs[s.defId],this._instance=a.instances[n.instanceId],r.dispatch({type:"MERGE_EVENTS",eventStore:a}),r.emitter.trigger("eventChange",{oldEvent:l,event:this,relatedEvents:Fe(a,r,n),revert(){r.dispatch({type:"RESET_EVENTS",eventStore:i})}})}}remove(){let e=this._context,n=so(this);e.dispatch({type:"REMOVE_EVENTS",eventStore:n}),e.emitter.trigger("eventRemove",{event:this,relatedEvents:[],revert(){e.dispatch({type:"MERGE_EVENTS",eventStore:n})}})}get source(){let{sourceId:e}=this._def;return e?new et(this._context,this._context.getCurrentData().eventSources[e]):null}get start(){return this._instance?this._context.dateEnv.toDate(this._instance.range.start):null}get end(){return this._instance&&this._def.hasEnd?this._context.dateEnv.toDate(this._instance.range.end):null}get startStr(){let e=this._instance;return e?this._context.dateEnv.formatIso(e.range.start,{omitTime:this._def.allDay}):""}get endStr(){let e=this._instance;return e&&this._def.hasEnd?this._context.dateEnv.formatIso(e.range.end,{omitTime:this._def.allDay}):""}get id(){return this._def.publicId}get groupId(){return this._def.groupId}get allDay(){return this._def.allDay}get title(){return this._def.title}get url(){return this._def.url}get display(){return this._def.ui.display||"auto"}get startEditable(){return this._def.ui.startEditable}get durationEditable(){return this._def.ui.durationEditable}get constraint(){return this._def.ui.constraints[0]||null}get overlap(){return this._def.ui.overlap}get allow(){return this._def.ui.allows[0]||null}get color(){return this._def.ui.color}get contrastColor(){return this._def.ui.contrastColor}get className(){return this._def.ui.className}get extendedProps(){return this._def.extendedProps}toPlainObject(e={}){let n=this._def,{ui:s}=n,{startStr:r,endStr:i}=this,a={allDay:n.allDay};return n.title&&(a.title=n.title),r&&(a.start=r),i&&(a.end=i),n.publicId&&(a.id=n.publicId),n.groupId&&(a.groupId=n.groupId),n.url&&(a.url=n.url),s.display&&s.display!=="auto"&&(a.display=s.display),s.color&&(a.color=s.color),s.contrastColor&&(a.contrastColor=s.contrastColor),s.className&&(a.className=s.className),Object.keys(n.extendedProps).length&&(e.collapseExtendedProps?Object.assign(a,n.extendedProps):a.extendedProps=n.extendedProps),a}toJSON(){return this.toPlainObject()}}function so(t){let e=t._def,n=t._instance;return{defs:{[e.defId]:e},instances:n?{[n.instanceId]:n}:{}}}function Fe(t,e,n){let{defs:s,instances:r}=t,i=[],a=n?n.instanceId:"";for(let o in r){let l=r[o],c=s[l.defId];l.instanceId!==a&&i.push(new $(e,c,l))}return i}function In(t){return t.eventRange.instance.instanceId}function ns(t,e,n,s){let r={},i={},a={},o=[],l=[],c=dn(t.defs,e);for(let u in t.defs){let h=t.defs[u];c[h.defId].display==="inverse-background"&&(h.groupId?(r[h.groupId]=[],a[h.groupId]||(a[h.groupId]=h)):i[u]=[])}for(let u in t.instances){let h=t.instances[u],g=t.defs[h.defId],m=c[g.defId],v=h.range,p=!g.allDay&&s?Za(v,s):v,y=Ae(p,n);y&&(m.display==="inverse-background"?g.groupId?r[g.groupId].push(y):i[h.defId].push(y):m.display!=="none"&&(m.display==="background"?o:l).push({def:g,ui:m,instance:h,range:y,isStart:p.start&&p.start.valueOf()===y.start.valueOf(),isEnd:p.end&&p.end.valueOf()===y.end.valueOf()}))}for(let u in r){let h=r[u],g=Cr(h,n);for(let m of g){let v=a[u],p=c[v.defId];o.push({def:v,ui:p,instance:null,range:m,isStart:!1,isEnd:!1})}}for(let u in i){let h=i[u],g=Cr(h,n);for(let m of g)o.push({def:t.defs[u],ui:c[u],instance:null,range:m,isStart:!1,isEnd:!1})}return{bg:o,fg:l}}function rg(t){return t.ui.display==="background"||t.ui.display==="inverse-background"}function cn(t,e){t.fcEventRange=e}function ct(t){return t.fcEventRange||t.parentNode.fcEventRange||null}function dn(t,e){return xe(t,n=>ro(n,e))}function ro(t,e){const n=[],s=e[""],r=e[t.defId];return s&&n.push(s),r&&n.push(r),n.push(t.ui),Xa(n)}function zs(t,e){let n=t.map(ig);return n.sort((s,r)=>Mf(s,r,e)),n.map(s=>s._seg)}function ig(t){let{eventRange:e}=t,n=e.def,s=e.instance?e.instance.range:e.range,r=s.start?s.start.valueOf():0,i=s.end?s.end.valueOf():0;return{...n.extendedProps,...n,id:n.publicId,start:r,end:i,duration:i-r,allDay:Number(n.allDay),_seg:t}}function ag(t,e){let{pluginHooks:n}=e,s=n.isDraggableTransformers,{def:r,ui:i}=t,a=i.startEditable;for(let o of s)a=o(a,r,i,e);return a}function og(t,e,n,s,r,i,a,o=!0,l=!0){const{dateEnv:c,options:u}=a,{def:h}=e;let{displayEventTime:g,displayEventEnd:m}=u;g==null&&(g=o!==!1),m==null&&(m=l!==!1);const v=!r&&n&&z(n).valueOf()!==z(e.instance.range.start).valueOf()?n:e.instance.range.start,p=!i&&s&&z(Ge(s,-1)).valueOf()!==z(Ge(e.instance.range.end,-1)).valueOf()?s:e.instance.range.end;if(g&&!h.allDay){if(m&&(r||i)&&h.hasEnd){const y=c.formatRangeToParts(v,p,t),D=cg(y);return D!=null?ie(c.formatToParts(v,t))+D+ie(c.formatToParts(p,t)):ie(y)}if(r)return ie(c.formatToParts(v,t))}return""}const lg=new Set(["year","month","day"]);function cg(t){let e,n=!1;for(const s of t)s.source==="shared"&&(e=s),lg.has(s.type)&&(n=!0);return n?e.value:void 0}function $e(t,e,n){let s=t.range;return{isPast:s.end<=(n||e.start),isFuture:s.start>=(n||e.end),isToday:e&&Ce(e,s.start)}}function dg(t){return t.instance?t.instance.instanceId:`${t.def.defId}:${t.range.start.toISOString()}`}function ug(t,e){let{def:n,instance:s}=t,{url:r}=n;if(r)return["a",{href:r},!0];let{emitter:i,options:a}=e,{eventInteractive:o}=a;o==null&&(o=n.interactive,o==null&&(o=!!i.hasHandlers("eventClick")));let l;return o&&(l=za(c=>{i.trigger("eventClick",{el:c.target,event:new $(e,n,s),jsEvent:c,view:e.viewApi})}),l={role:"button",...l}),["div",l,o]}const hg=/(^c|C)lass(Name)?$/,fg=/Content$/,gg=/(DidMount|WillUnmount)$/,mg=/^on[A-Z]/,pg={buttons:jf};function vg(...t){const e={};for(const n of t)for(const s in n){const r=n[s];e[s]?e[s]=Ee(e[s],r):e[s]=r}return e}function Ee(...t){let e={};for(const n of t)for(let s in n)if(s in e){const r=pg[s]||(hg.test(s)?yg:fg.test(s)?Sg:gg.test(s)?Eg:void 0);e[s]=r?r(e[s],n[s],s):n[s]}else e[s]=n[s];return e}function yg(t,e,n){const s=typeof t=="function",r=typeof e=="function";if(s||r){const i=a=>b(se(s?t(a):t,n),se(r?e(a):e,n));return i.parts=[t,e],i}return b(se(t,n),se(e,n))}function Sg(t,e){if(typeof e=="function"){const n=s=>{const r=e(s);return r===!0?typeof t=="function"?t(s):t:r};return n.parts=[t,e],n}return e??t}function Eg(t,e){if(t&&e){const n=(...s)=>{t(...s),e(...s)};return n.parts=[t,e],n}return t||e}function bg(t,e){const n=Pf(t,e);for(let s of n)if(!mg.test(s))return!1;return!0}function ss(t,e){const n=t&&t.parts,s=e&&e.parts;if(n&&s){const r=n.length,i=s.length;if(r!==i)return!1;for(let a=0;a<r;a++)if(!(n[a]===s[a]||ss(n[a],s[a])))return!1;return!0}return!1}const Dg=[],io={code:"en",week:{dow:0,doy:4},direction:"ltr",todayText:"Today",prevText:"Prev",nextText:"Next",prevYearText:"Prev year",nextYearText:"Next year",yearText:"Year",monthText:"Month",weekTextLong:"Week",dayText:"Day",listText:"List",closeHint:"Close",eventsHint:"Events",allDayText:"All-day",timedText:"Timed",moreLinkText:"more",noEventsText:"No events to display"},ao={...io,weekTextShort:"W",todayHint:(t,e)=>e==="day"?"Today":`This ${t}`,prevHint:"Previous $0",nextHint:"Next $0",viewHint:"$0 view",viewChangeHint:"Change view",navLinkHint:"Go to $0",moreLinkHint(t){return`Show ${t} more event${t===1?"":"s"}`}};function wg(t){let e=t.length>0?t[0].code:"en",n=Dg.concat(t),s={en:ao};for(let r of n)s[r.code]=r;return{map:s,defaultCode:e}}function oo(t,e){return typeof t=="object"&&!Array.isArray(t)?lo(t.code,[t.code],t):Cg(t,e)}function Cg(t,e){let n=[].concat(t||[]),s=Rg(n,e)||ao;return lo(t,n,s)}function Rg(t,e){for(let n=0;n<t.length;n+=1){let s=t[n].toLocaleLowerCase().split("-");for(let r=s.length;r>0;r-=1){let i=s.slice(0,r).join("-");if(e[i])return e[i]}}return null}function lo(t,e,n){let s=Ee(io,n);delete s.code;let{week:r}=s;return delete s.week,{codeArg:t,codes:e,week:r,simpleNumberFormat:new Intl.NumberFormat(t),options:s}}class Wr extends Error{constructor(e,n){super(e),this.response=n}}function xg(t,e,n){t=t.toUpperCase();const s={method:t};return t==="GET"?e+=(e.indexOf("?")===-1?"?":"&")+new URLSearchParams(n):(s.body=new URLSearchParams(n),s.headers={"Content-Type":"application/x-www-form-urlencoded"}),fetch(e,s).then(r=>{if(r.ok)return r.json().then(i=>[i,r],()=>{throw new Wr("Failure parsing JSON",r)});throw new Wr("Request failed",r)})}function Tg(t,e){e.emitter.trigger("datesSet",{...eo(t.activeRange,e.dateEnv),view:e.viewApi})}function Mg(t,e){let{emitter:n}=e;n.hasHandlers("eventsSet")&&n.trigger("eventsSet",Fe(t,e))}let Ig={ignoreRange:!0,parseMeta(t){return Array.isArray(t.events)?t.events:null},fetch(t,e){e({rawEvents:t.eventSource.meta})}};const Ng={name:"array-event-source",eventSourceDefs:[Ig]};function Hg(t,e,n){let s=!1,r=function(o){s||(s=!0,e(o))},i=function(o){s||(s=!0,n(o))},a=t(r,i);a&&typeof a.then=="function"&&a.then(r,i)}let kg={parseMeta(t){return typeof t.events=="function"?t.events:null},fetch(t,e,n){const{dateEnv:s}=t.context,r=t.eventSource.meta;Hg(r.bind(null,eo(t.range,s)),i=>e({rawEvents:i}),n)}};const Pg={name:"func-event-source",eventSourceDefs:[kg]},jg={method:String,extraParams:S,startParam:String,endParam:String,timeZoneParam:String};let Lg={parseMeta(t){return t.url&&(t.format==="json"||!t.format)?{url:t.url,format:"json",method:(t.method||"GET").toUpperCase(),extraParams:t.extraParams,startParam:t.startParam,endParam:t.endParam,timeZoneParam:t.timeZoneParam}:null},fetch(t,e,n){const{meta:s}=t.eventSource,r=Og(s,t.range,t.context);xg(s.method,s.url,r).then(([i,a])=>{e({rawEvents:i,response:a})},n)}};const Ag={name:"json-event-source",eventSourceRefiners:jg,eventSourceDefs:[Lg]};function Og(t,e,n){let{dateEnv:s,options:r}=n,i,a,o,l,c={};return i=t.startParam,i==null&&(i=r.startParam),a=t.endParam,a==null&&(a=r.endParam),o=t.timeZoneParam,o==null&&(o=r.timeZoneParam),typeof t.extraParams=="function"?l=t.extraParams():l=t.extraParams||{},Object.assign(c,l),c[i]=s.formatIso(e.start),c[a]=s.formatIso(e.end),s.timeZone!=="local"&&(c[o]=s.timeZone),c}const Wg={name:"change-handler",optionChangeHandlers:{controller(t,e){t._setApi(e.calendarApi)},events(t,e){Br([t],e)},eventSources:Br}};function Br(t,e){let n=Ya(e.getCurrentData().eventSources);if(n.length===1&&t.length===1&&Array.isArray(n[0]._raw)&&Array.isArray(t[0])){e.dispatch({type:"RESET_RAW_EVENTS",sourceId:n[0].sourceId,rawEvents:t[0]});return}let s=[];for(let r of t){let i=!1;for(let a=0;a<n.length;a+=1)if(n[a]._raw===r){n.splice(a,1),i=!0;break}i||s.push(r)}for(let r of n)e.dispatch({type:"REMOVE_EVENT_SOURCE",sourceId:r.sourceId});for(let r of s)e.calendarApi.addEventSource(r)}const Bg={id:String,defaultAllDay:Boolean,url:String,format:String,events:S,eventDataTransform:S,success:S,failure:S};function co(t,e,n=uo(e)){let s;if(typeof t=="string"?s={url:t}:typeof t=="function"||Array.isArray(t)?s={events:t}:typeof t=="object"&&t&&(s=t),s){let{refined:r,extra:i}=Os(s,n),a=_g(r,e);if(a)return{_raw:t,isFetching:!1,latestFetchId:"",fetchRange:null,defaultAllDay:r.defaultAllDay,eventDataTransform:r.eventDataTransform,success:r.success,failure:r.failure,publicId:r.id||"",sourceId:Te(),sourceDefId:a.sourceDefId,meta:a.meta,ui:ln(r,e),extendedProps:i}}return null}function uo(t){return{...on,...Bg,...t.pluginHooks.eventSourceRefiners}}function _g(t,e){let n=e.pluginHooks.eventSourceDefs;for(let s=n.length-1;s>=0;s-=1){let i=n[s].parseMeta(t);if(i)return{sourceDefId:s,meta:i}}return null}function Ug(t,e,n){let s=e?e.activeRange:null;return fo({},$g(t,n),s,n)}function Fg(t,e,n,s){let r=n?n.activeRange:null;switch(e.type){case"ADD_EVENT_SOURCES":return fo(t,e.sources,r,s);case"REMOVE_EVENT_SOURCE":return zg(t,e.sourceId);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return n?go(t,r,s):t;case"FETCH_EVENT_SOURCES":return Gs(t,e.sourceIds?qa(e.sourceIds):mo(t,s),r,e.isRefetch||!1,s);case"RECEIVE_EVENTS":case"RECEIVE_EVENT_ERROR":return qg(t,e.sourceId,e.fetchId,e.fetchRange);case"REMOVE_ALL_EVENT_SOURCES":return{};default:return t}}function Vg(t,e,n){let s=e?e.activeRange:null;return Gs(t,mo(t,n),s,!0,n)}function ho(t){for(let e in t)if(t[e].isFetching)return!0;return!1}function fo(t,e,n,s){let r={};for(let i of e)r[i.sourceId]=i;return n&&(r=go(r,n,s)),{...t,...r}}function zg(t,e){return Ye(t,n=>n.sourceId!==e)}function go(t,e,n){return Gs(t,Ye(t,s=>Gg(s,e,n)),e,!1,n)}function Gg(t,e,n){return po(t,n)?!n.options.lazyFetching||!t.fetchRange||t.isFetching||e.start<t.fetchRange.start||e.end>t.fetchRange.end:!t.latestFetchId}function Gs(t,e,n,s,r){let i={};for(let a in t){let o=t[a];e[a]?i[a]=Yg(o,n,s,r):i[a]=o}return i}function Yg(t,e,n,s){let{options:r,calendarApi:i}=s,a=s.pluginHooks.eventSourceDefs[t.sourceDefId],o=Te();return a.fetch({eventSource:t,range:e,isRefetch:n,context:s},l=>{let{rawEvents:c}=l;r.eventSourceSuccess&&(c=r.eventSourceSuccess.call(i,c,l.response)||c),t.success&&(c=t.success.call(i,c,l.response)||c),s.dispatch({type:"RECEIVE_EVENTS",sourceId:t.sourceId,fetchId:o,fetchRange:e,rawEvents:c})},l=>{let c=!1;r.eventSourceFailure&&(r.eventSourceFailure.call(i,l),c=!0),t.failure&&(t.failure(l),c=!0),c||Oe(`Unhandled event source error: ${l.message}`,l),s.dispatch({type:"RECEIVE_EVENT_ERROR",sourceId:t.sourceId,fetchId:o,fetchRange:e,error:l})}),{...t,isFetching:!0,latestFetchId:o}}function qg(t,e,n,s){let r=t[e];return r&&n===r.latestFetchId?{...t,[e]:{...r,isFetching:!1,fetchRange:s}}:t}function mo(t,e){return Ye(t,n=>po(n,e))}function $g(t,e){let n=uo(e),s=[].concat(t.eventSources||[]),r=[];t.initialEvents&&s.unshift(t.initialEvents),t.events&&s.unshift(t.events);for(let i of s){let a=co(i,e,n);a&&r.push(a)}return r}function po(t,e){return!e.pluginHooks.eventSourceDefs[t.sourceDefId].ignoreRange}const Zg={daysOfWeek:S,startTime:_,endTime:_,duration:_,startRecur:S,endRecur:S};let Xg={parse(t,e){if(t.daysOfWeek||t.startTime||t.endTime||t.startRecur||t.endRecur){let n={daysOfWeek:t.daysOfWeek||null,startTime:t.startTime||null,endTime:t.endTime||null,startRecur:t.startRecur?e.createMarker(t.startRecur):null,endRecur:t.endRecur?e.createMarker(t.endRecur):null,dateEnv:e},s;return t.duration&&(s=t.duration),!s&&t.startTime&&t.endTime&&(s=ef(t.endTime,t.startTime)),{allDayGuess:!t.startTime&&!t.endTime,duration:s,typeData:n}}return null},expand(t,e,n){let s=Ae(e,{start:t.startRecur,end:t.endRecur});return s?Jg(t.daysOfWeek,t.startTime,t.dateEnv,n,s):[]}};const Kg={name:"simple-recurring-event",recurringTypes:[Xg],eventRefiners:Zg};function Jg(t,e,n,s,r){let i=t?qa(t):null,a=z(r.start),o=r.end,l=[];for(e&&(e.milliseconds<0?o=te(o,1):e.milliseconds>=1e3*60*60*24&&(a=te(a,-1)));a<o;){let c;(!i||i[a.getUTCDay()])&&(e?c=s.add(a,e):c=a,l.push(s.createMarker(n.toDate(c)))),a=te(a,1)}return l}const Qg=[Ng,Pg,Ag,Kg,Wg,{name:"misc",isLoadingFuncs:[t=>ho(t.eventSources)],propSetHandlers:{dateProfile:Tg,eventStore:Mg}}];function k(t,e,n){let s,r;return function(...i){if(!s)r=t.apply(this,i);else if(!lt(s,i)){let a=t.apply(this,i);(!e||!e(a,r))&&(r=a)}return s=i,r}}function Ct(t,e,n){let s,r;return i=>(s?We(s,i)||(r=t.call(this,i)):r=t.call(this,i),s=i,r)}const Me=w.createContext({});function em(t,e,n,s,r,i,a,o,l,c,u,h,g,m){return{dateEnv:r,nowManager:i,options:n,pluginHooks:a,emitter:c,dispatch:o,getCurrentData:l,calendarApi:u,viewSpec:t,viewApi:e,dateProfileGenerator:s,baseId:h,registerInteractiveComponent:g,unregisterInteractiveComponent:m}}class Ke extends w.Component{shouldComponentUpdate(e,n){return!kr(this.props,e,this.propEquality)||!kr(this.state,n,this.stateEquality)}}Ke.addPropsEquality=tm;Ke.addStateEquality=nm;Ke.contextType=Me;Ke.prototype.propEquality={};Ke.prototype.stateEquality={};class B extends Ke{}B.contextType=Me;function tm(t){let e=Object.create(this.prototype.propEquality);Object.assign(e,t),this.prototype.propEquality=e}function nm(t){let e=Object.create(this.prototype.stateEquality);Object.assign(e,t),this.prototype.stateEquality=e}function L(t,e){typeof t=="function"?t(e):t&&(t.current=e)}class Ys extends B{constructor(){super(...arguments),this.id=Te(),this.queuedDomNodes=[],this.currentDomNodes=[],this.handleEl=e=>{this.el=e,this.props.elRef&&L(this.props.elRef,e)}}render(){const{props:e,context:n}=this,{options:s}=n,{customGenerator:r,defaultGenerator:i,renderProps:a}=e,o=vo(e,"",this.handleEl);let l=!1,c,u=[],h;if(r!=null){const g=typeof r=="function"?r(a):r;if(g===!0)l=!0;else{const m=g&&typeof g=="object";m&&"html"in g?o.dangerouslySetInnerHTML={__html:g.html}:m&&"domNodes"in g?u=Array.prototype.slice.call(g.domNodes):(m?w.isValidElement(g):typeof g!="function")?c=g:h=g}}else l=!sm(e.generatorName,s);return l&&i&&(c=i(a)),this.queuedDomNodes=u,this.currentGeneratorMeta=h,w.createElement(e.tag,o,c)}componentDidMount(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentDidUpdate(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentWillUnmount(){this.triggerCustomRendering(!1)}triggerCustomRendering(e){const{props:n,context:s}=this,{handleCustomRendering:r,customRenderingMetaMap:i}=s.options;if(r){const a=this.currentGeneratorMeta??i?.[n.generatorName];a&&r({id:this.id,isActive:e,containerEl:this.el,generatorMeta:a,renderProps:n.renderProps})}}applyQueueudDomNodes(){const{queuedDomNodes:e,currentDomNodes:n}=this,{el:s}=this;if(!lt(e,n)){for(const r of n)r.remove();for(let r of e)s.appendChild(r);this.currentDomNodes=e}}}Ys.addPropsEquality({renderProps:We,attrs:bg,style:We});function sm(t,e){return!!(e.handleCustomRendering&&t&&e.customRenderingMetaMap?.[t])}function vo(t,e,n){const s={...t.attrs,ref:n};return(t.className||e)&&(s.className=b(e,t.className,s.className)),t.style&&(s.style=t.style),s}const rm=w.createContext(0);class q extends w.Component{constructor(){super(...arguments),this.InnerContent=im.bind(void 0,this),this.handleEl=e=>{this.el=e,this.props.elRef&&(L(this.props.elRef,e),e&&this.didMountMisfire&&this.componentDidMount())}}render(){const{props:e}=this,n=R(e.classNameGenerator,e.renderProps);if(e.children){const s=vo(e,n,this.handleEl),r=e.children(this.InnerContent,e.renderProps,s);return e.tag?w.createElement(e.tag,s,r):r}else return w.createElement(Ys,{...e,elRef:this.handleEl,tag:e.tag||"div",className:b(e.className,n),renderId:this.context})}componentDidMount(){this.el?this.props.didMount?.({...this.props.renderProps,el:this.el}):this.didMountMisfire=!0}componentWillUnmount(){this.props.willUnmount?.({...this.props.renderProps,el:this.el})}}q.contextType=rm;function im(t,e){const n=t.props;return w.createElement(Ys,{renderProps:n.renderProps,generatorName:n.generatorName,customGenerator:n.customGenerator,defaultGenerator:n.defaultGenerator,renderId:t.context,...e})}function R(t,e){return(typeof t=="function"?t(e):t)||""}function Nn(t){return t.text}function fe(t){return t.height==="auto"||t.contentHeight==="auto"}function Hn(t){let{tableHeaderSticky:e}=t;return(e==null||e==="auto")&&(e=fe(t)),e}function yo(t){const e=fe(t);let{footerScrollbarSticky:n}=t;return(n==null||n==="auto")&&(n=e),!!n&&e}function So(t){const e=t.scrollerSyncerClass;if(!e)throw new RangeError("Must import @fullcalendar/scrollgrid");return e}class Eo{constructor(e){this.handleChange=e,this.isMounted=!1,this.handleRefresh=()=>{let n=this.computeTiming();n.nowDate.valueOf()!==this.nowDate.valueOf()&&(this.nowDate=n.nowDate,this.todayRange=n.todayRange,this.handleChange()),this.clearTimeout(),this.setTimeout(n.waitMs)},this.handleVisibilityChange=()=>{document.hidden||this.handleRefresh()}}update(e){if(this.isMounted)(e.unit!==this.unit||e.unitValue!==this.unitValue||e.nowIndicatorSnap!==this.nowIndicatorSnap||e.nowManager!==this.nowManager||e.dateEnv!==this.dateEnv)&&(this.unit=e.unit,this.unitValue=e.unitValue,this.nowIndicatorSnap=e.nowIndicatorSnap,this.nowManager=e.nowManager,this.dateEnv=e.dateEnv,this.clearTimeout(),this.setTimeout());else{this.isMounted=!0,this.unit=e.unit,this.unitValue=e.unitValue,this.nowIndicatorSnap=e.nowIndicatorSnap,this.nowManager=e.nowManager,this.dateEnv=e.dateEnv;const n=this.computeTiming();this.nowDate=n.nowDate,this.todayRange=n.todayRange,this.setTimeout(),this.nowManager.addResetListener(this.handleRefresh),typeof document<"u"&&document.addEventListener("visibilitychange",this.handleVisibilityChange)}return{nowDate:this.nowDate,todayRange:this.todayRange}}destroy(){this.isMounted&&(this.isMounted=!1,this.clearTimeout(),this.nowManager.removeResetListener(this.handleRefresh),typeof document<"u"&&document.removeEventListener("visibilitychange",this.handleVisibilityChange))}computeTiming(){let e=this.nowManager.getDateMarker(),{unit:n,unitValue:s,nowIndicatorSnap:r,dateEnv:i}=this;r==="auto"&&(r=/year|month|week|day/.test(n)||(s||1)===1);let a,o;return r?(a=i.startOf(e,n),o=i.add(a,_(1,n)).valueOf()-e.valueOf()):(a=e,o=1e3*60),o=Math.min(1e3*60*60*24,o),{nowDate:a,todayRange:am(a),waitMs:o}}setTimeout(e=this.computeTiming().waitMs){this.timeoutId=setTimeout(()=>{const n=this.computeTiming();this.nowDate=n.nowDate,this.todayRange=n.todayRange,this.handleChange(),this.setTimeout(n.waitMs)},e)}clearTimeout(){this.timeoutId&&clearTimeout(this.timeoutId)}}function am(t){let e=z(t),n=te(e,1);return{start:e,end:n}}class bo{constructor(e){this.props=e,this.initHiddenDays()}buildPrev(e,n,s,r){let{dateEnv:i}=this.props,a=i.subtract(i.startOf(n,e.currentRangeUnit),e.dateIncrement);return this.build(a,s,-1,r)}buildNext(e,n,s,r){let{dateEnv:i}=this.props,a=i.add(i.startOf(n,e.currentRangeUnit),e.dateIncrement);return this.build(a,s,1,r)}build(e,n,s,r=!0){let{props:i}=this,a,o,l,c,u,h;return a=this.buildValidRange(n),a=this.trimHiddenDays(a),r&&(e=Xh(e,a)),o=this.buildCurrentRangeInfo(e,s),l=/^(year|month|week|day)$/.test(o.unit),c=this.buildRenderRange(this.trimHiddenDays(o.range),o.unit,l),c=this.trimHiddenDays(c),u=c,i.showNonCurrentDates||(u=Ae(u,o.range)),u=this.adjustActiveRange(u),u=Ae(u,a),h=Hs(o.range,a),Ce(c,e)||(e=c.start),{currentDate:e,validRange:a,currentRange:o.range,currentRangeUnit:o.unit,isRangeAllDay:l,activeRange:u,renderRange:c,slotMinTime:i.slotMinTime,slotMaxTime:i.slotMaxTime,isValid:h,dateIncrement:this.buildDateIncrement(o.duration)}}buildValidRange(e){let n=this.props.validRangeInput,s=typeof n=="function"?n.call(this.props.calendarApi,this.props.dateEnv.toDate(e)):n;return this.refineRange(s)||{start:null,end:null}}buildCurrentRangeInfo(e,n){let{props:s}=this,r=null,i=null,a=null,o;return s.duration?(r=s.duration,i=s.durationUnit,a=this.buildRangeFromDuration(e,n,r,i)):(o=this.props.dayCount)?(i="day",a=this.buildRangeFromDayCount(e,n,o)):(a=this.buildCustomVisibleRange(e))?i=s.dateEnv.greatestWholeUnit(a.start,a.end).unit:(r=this.getFallbackDuration(),i=Jn(r).unit,a=this.buildRangeFromDuration(e,n,r,i)),{duration:r,unit:i,range:a}}getFallbackDuration(){return _({day:1})}adjustActiveRange(e){let{dateEnv:n,usesMinMaxTime:s,slotMinTime:r,slotMaxTime:i}=this.props,{start:a,end:o}=e;return s&&(rt(r)<0&&(a=z(a),a=n.add(a,r)),rt(i)>1&&(o=z(o),o=te(o,-1),o=n.add(o,i))),{start:a,end:o}}buildRangeFromDuration(e,n,s,r){let{dateEnv:i,dateAlignment:a}=this.props,o,l,c;if(!a){let{dateIncrement:h}=this.props;h&&Re(h)<Re(s)?a=Jn(h).unit:a=r}rt(s)<=1&&this.isHiddenDay(o)&&(o=this.skipHiddenDays(o,n),o=z(o));function u(){o=i.startOf(e,a),l=i.add(o,s),c={start:o,end:l}}return u(),this.trimHiddenDays(c)||(e=this.skipHiddenDays(e,n),u()),c}buildRangeFromDayCount(e,n,s){let{dateEnv:r,dateAlignment:i}=this.props,a=0,o=e,l;i&&(o=r.startOf(o,i)),o=z(o),o=this.skipHiddenDays(o,n),l=o;do l=te(l,1),this.isHiddenDay(l)||(a+=1);while(a<s);return{start:o,end:l}}buildCustomVisibleRange(e){let{props:n}=this,s=n.visibleRangeInput,r=typeof s=="function"?s.call(n.calendarApi,n.dateEnv.toDate(e)):s,i=this.refineRange(r);return i&&(i.start==null||i.end==null)?null:i}buildRenderRange(e,n,s){return e}buildDateIncrement(e){let{dateIncrement:n}=this.props,s;return n||((s=this.props.dateAlignment)?_(1,s):e||_({days:1}))}refineRange(e){if(e){let n=qh(e,this.props.dateEnv);return n&&(n=Za(n)),n}return null}initHiddenDays(){let e=this.props.hiddenDays||[],n=[],s=0,r;for(this.props.weekends===!1&&e.push(0,6),r=0;r<7;r+=1)(n[r]=e.indexOf(r)!==-1)||(s+=1);if(!s)throw new Error("invalid hiddenDays");this.isHiddenDayHash=n}trimHiddenDays(e){let{start:n,end:s}=e;return n&&(n=this.skipHiddenDays(n)),s&&(s=this.skipHiddenDays(s,-1,!0)),n==null||s==null||n<s?{start:n,end:s}:null}isHiddenDay(e){return e instanceof Date&&(e=e.getUTCDay()),this.isHiddenDayHash[e]}skipHiddenDays(e,n=1,s=!1){for(;this.isHiddenDayHash[(e.getUTCDay()+(s?n:0)+7)%7];)e=te(e,n);return e}}function Do(t,e){const{currentRange:n}=t;if(t.currentRangeUnit==="year")return e.diffWholeYears(n.start,n.end)>1?"year":"month";if(t.currentRangeUnit==="month"){if(e.diffWholeMonths(n.start,n.end)>1)return"month"}else if(t.currentRangeUnit==="week"){if(Oa(n.start,n.end)>1)return"week"}else if(t.currentRangeUnit==="day"&&Tt(n.start,n.end)>1)return"day"}function wo(t,e,n){if(t.valueOf()===z(t).valueOf()){if(e==="year")return!n.getMonth(t)&&n.getDay(t)===1;if(e==="month")return n.getDay(t)===1;if(e==="week")return t.getUTCDay()===n.weekDow;if(e==="day")return!0}return!1}function om(t,e,n,s,r){switch(e.type){case"RECEIVE_EVENTS":return lm(t,n[e.sourceId],e.fetchId,e.fetchRange,e.rawEvents,r);case"RESET_RAW_EVENTS":return cm(t,n[e.sourceId],e.rawEvents,s.activeRange,r);case"ADD_EVENTS":return dm(t,e.eventStore,s?s.activeRange:null,r);case"RESET_EVENTS":return e.eventStore;case"MERGE_EVENTS":return _s(t,e.eventStore);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return s?qe(t,s.activeRange,r):t;case"REMOVE_EVENTS":return Uf(t,e.eventStore);case"REMOVE_EVENT_SOURCE":return Ro(t,e.sourceId);case"REMOVE_ALL_EVENT_SOURCES":return Mn(t,i=>!i.sourceId);case"REMOVE_ALL_EVENTS":return de();default:return t}}function lm(t,e,n,s,r,i){if(e&&n===e.latestFetchId){let a=It(Co(r,e,i),e,i);return s&&(a=qe(a,s,i)),_s(Ro(t,e.sourceId),a)}return t}function cm(t,e,n,s,r){const{defIdMap:i,instanceIdMap:a}=hm(t);let o=It(Co(n,e,r),e,r,!1,i,a);return qe(o,s,r)}function Co(t,e,n){let s=n.options.eventDataTransform,r=e?e.eventDataTransform:null;return r&&(t=_r(t,r)),s&&(t=_r(t,s)),t}function _r(t,e){let n;if(!e)n=t;else{n=[];for(let s of t){let r=e(s);r?n.push(r):r==null&&n.push(s)}}return n}function dm(t,e,n,s){return n&&(e=qe(e,n,s)),_s(t,e)}function Ur(t,e,n){let{defs:s}=t,r=xe(t.instances,i=>s[i.defId].allDay?i:{...i,range:{start:n.createMarker(e.toDate(i.range.start)),end:n.createMarker(e.toDate(i.range.end))}});return{defs:s,instances:r}}function Ro(t,e){return Mn(t,n=>n.sourceId!==e)}function um(t,e){return{defs:t.defs,instances:Ye(t.instances,n=>!e[n.instanceId])}}function hm(t){const{defs:e,instances:n}=t,s={},r={};for(let i in e){const a=e[i],{publicId:o}=a;o&&(s[o]=i)}for(let i in n){const a=n[i],o=e[a.defId],{publicId:l}=o;l&&(r[l]=i)}return{defIdMap:s,instanceIdMap:r}}class pt{constructor(e){this.component=e.component,this.isHitComboAllowed=e.isHitComboAllowed||null}destroy(){}}function fm(t,e){return{component:t,el:e.el,useEventCenter:e.useEventCenter!=null?e.useEventCenter:!0,isHitComboAllowed:e.isHitComboAllowed||null}}function qs(t){return{[t.component.uid]:t}}const rs={};class Lt{constructor(){this.handlers={},this.thisContext=null}setThisContext(e){this.thisContext=e}setOptions(e){this.options=e}on(e,n){gm(this.handlers,e,n)}off(e,n){mm(this.handlers,e,n)}trigger(e,...n){let s=this.handlers[e]||[],r=this.options&&this.options[e],i=[].concat(r||[],s);for(let a of i)a.apply(this.thisContext,n)}hasHandlers(e){return!!(this.handlers[e]&&this.handlers[e].length||this.options&&this.options[e])}}function gm(t,e,n){(t[e]||(t[e]=[])).push(n)}function mm(t,e,n){n?t[e]&&(t[e]=t[e].filter(s=>s!==n)):delete t[e]}function pm(t){return{name:t.name,premiumReleaseDate:t.premiumReleaseDate?new Date(t.premiumReleaseDate):void 0,reducers:t.reducers||[],isLoadingFuncs:t.isLoadingFuncs||[],contextInit:[].concat(t.contextInit||[]),eventRefiners:t.eventRefiners||{},eventDefMemberAdders:t.eventDefMemberAdders||[],eventSourceRefiners:t.eventSourceRefiners||{},isDraggableTransformers:t.isDraggableTransformers||[],eventDragMutationMassagers:t.eventDragMutationMassagers||[],eventDefMutationAppliers:t.eventDefMutationAppliers||[],dateSelectionTransformers:t.dateSelectionTransformers||[],datePointTransforms:t.datePointTransforms||[],dateSpanTransforms:t.dateSpanTransforms||[],views:t.views||{},viewPropsTransformers:t.viewPropsTransformers||[],isPropsValid:t.isPropsValid||null,externalDefTransforms:t.externalDefTransforms||[],viewContainerAppends:t.viewContainerAppends||[],eventDropTransformers:t.eventDropTransformers||[],componentInteractions:t.componentInteractions||[],calendarInteractions:t.calendarInteractions||[],eventSourceDefs:t.eventSourceDefs||[],cmdFormatter:t.cmdFormatter,recurringTypes:t.recurringTypes||[],initialView:t.initialView||"",elementDraggingImpl:t.elementDraggingImpl,optionChangeHandlers:t.optionChangeHandlers||{},scrollerSyncerClass:t.scrollerSyncerClass||null,listenerRefiners:t.listenerRefiners||{},optionRefiners:t.optionRefiners||{},optionDefaults:t.optionDefaults?[t.optionDefaults]:[],propSetHandlers:t.propSetHandlers||{}}}function vm(t,e){let n={},s={premiumReleaseDate:void 0,reducers:[],isLoadingFuncs:[],contextInit:[],eventRefiners:{},eventDefMemberAdders:[],eventSourceRefiners:{},isDraggableTransformers:[],eventDragMutationMassagers:[],eventDefMutationAppliers:[],dateSelectionTransformers:[],datePointTransforms:[],dateSpanTransforms:[],views:{},viewPropsTransformers:[],isPropsValid:null,externalDefTransforms:[],viewContainerAppends:[],eventDropTransformers:[],componentInteractions:[],calendarInteractions:[],eventSourceDefs:[],cmdFormatter:null,recurringTypes:[],initialView:"",elementDraggingImpl:null,optionChangeHandlers:{},scrollerSyncerClass:null,listenerRefiners:{},optionRefiners:{},optionDefaults:[],propSetHandlers:{}};function r(i){for(let a of i){const{name:o}=a;if(!o)throw new Error("Plugin must specify a name");if(!n[o]){const l=n[o]=pm(a);s=Sm(s,l),r(a.deps||[])}}}return t&&r(t),r(e),s}function ym(){let t=[],e=[],n;return(s,r)=>((!n||!lt(s,t)||!lt(r,e))&&(n=vm(s,r)),t=s,e=r,n)}function Sm(t,e){return{premiumReleaseDate:Em(t.premiumReleaseDate,e.premiumReleaseDate),reducers:t.reducers.concat(e.reducers),isLoadingFuncs:t.isLoadingFuncs.concat(e.isLoadingFuncs),contextInit:t.contextInit.concat(e.contextInit),eventRefiners:{...t.eventRefiners,...e.eventRefiners},eventDefMemberAdders:t.eventDefMemberAdders.concat(e.eventDefMemberAdders),eventSourceRefiners:{...t.eventSourceRefiners,...e.eventSourceRefiners},isDraggableTransformers:t.isDraggableTransformers.concat(e.isDraggableTransformers),eventDragMutationMassagers:t.eventDragMutationMassagers.concat(e.eventDragMutationMassagers),eventDefMutationAppliers:t.eventDefMutationAppliers.concat(e.eventDefMutationAppliers),dateSelectionTransformers:t.dateSelectionTransformers.concat(e.dateSelectionTransformers),datePointTransforms:t.datePointTransforms.concat(e.datePointTransforms),dateSpanTransforms:t.dateSpanTransforms.concat(e.dateSpanTransforms),views:vg(t.views,e.views),viewPropsTransformers:t.viewPropsTransformers.concat(e.viewPropsTransformers),isPropsValid:e.isPropsValid||t.isPropsValid,externalDefTransforms:t.externalDefTransforms.concat(e.externalDefTransforms),viewContainerAppends:t.viewContainerAppends.concat(e.viewContainerAppends),eventDropTransformers:t.eventDropTransformers.concat(e.eventDropTransformers),calendarInteractions:t.calendarInteractions.concat(e.calendarInteractions),componentInteractions:t.componentInteractions.concat(e.componentInteractions),eventSourceDefs:t.eventSourceDefs.concat(e.eventSourceDefs),cmdFormatter:e.cmdFormatter||t.cmdFormatter,recurringTypes:t.recurringTypes.concat(e.recurringTypes),initialView:t.initialView||e.initialView,elementDraggingImpl:t.elementDraggingImpl||e.elementDraggingImpl,optionChangeHandlers:{...t.optionChangeHandlers,...e.optionChangeHandlers},scrollerSyncerClass:t.scrollerSyncerClass||e.scrollerSyncerClass,listenerRefiners:{...t.listenerRefiners,...e.listenerRefiners},optionRefiners:{...t.optionRefiners,...e.optionRefiners},optionDefaults:t.optionDefaults.concat(e.optionDefaults),propSetHandlers:{...t.propSetHandlers,...e.propSetHandlers}}}function Em(t,e){return t===void 0?e:e===void 0?t:new Date(Math.max(t.valueOf(),e.valueOf()))}function bm(t,e){let n={},s;for(s in t)is(s,n,t,e);for(s in e)is(s,n,t,e);return n}function is(t,e,n,s){if(e[t])return e[t];let r=Dm(t,e,n,s);return r&&(e[t]=r),r}function Dm(t,e,n,s){let r=n[t],i=s[t],a=u=>r&&r[u]!==null?r[u]:i&&i[u]!==null?i[u]:null,o=a("component"),l=a("superType"),c=null;if(l){if(l===t)throw new Error("Can't have a custom view type that references itself");c=is(l,e,n,s)}return!o&&c&&(o=c.component),o?{type:t,component:o,defaults:Ee(c?c.defaults:{},r?r.rawOptions:{}),overrides:Ee(c?c.overrides:{},i?i.rawOptions:{})}:null}function Fr(t){return xe(t,wm)}function wm(t){let e=typeof t=="function"?{component:t}:t,{component:n}=e;return e.content?n=Vr(e.content):n&&!(n.prototype instanceof B)&&(n=Vr(n)),{superType:e.type,component:n,rawOptions:e}}function Vr(t){return e=>d.jsx(Me.Consumer,{children:n=>{const{options:s,viewSpec:r}=n,i={...e,nextDayThreshold:s.nextDayThreshold,...ve(s),options:{headerToolbar:s.headerToolbar,footerToolbar:s.footerToolbar},isHeightAuto:fe(s),view:n.viewApi};return d.jsx(q,{tag:"div",className:b(R(s.viewClass,i),R(r.optionDefaults.class,i),R(r.optionDefaults.className,i),R(r.optionOverrides.class,i),R(r.optionOverrides.className,i)),renderProps:i,generatorName:void 0,customGenerator:t,didMount:s.didMount||s.viewDidMount,willUnmount:s.willUnmount||s.viewWillUnmount})}})}function Cm(t,e,n){let s=Fr(t),r=Fr(e.views),i=bm(s,r);return xe(i,a=>Rm(a,r,e,n))}function Rm(t,e,n,s){let r=t.overrides.duration||t.defaults.duration||s.duration||n.duration,i=null,a="",o="",l={};if(r&&(i=xm(r),i)){let c=Jn(i);a=c.unit,c.value===1&&(o=a,l=e[a]?e[a].rawOptions:{})}return{type:t.type,component:t.component,duration:i,durationUnit:a,singleUnit:o,optionDefaults:t.defaults,optionOverrides:{...l,...t.overrides}}}let zr={};function xm(t){let e=JSON.stringify(t),n=zr[e];return n===void 0&&(n=_(t),zr[e]=n),n}function Tm(t,e){return e.type==="CHANGE_VIEW_TYPE"&&(t=e.viewType),t}function Mm(t,e){return e.type==="CHANGE_DATE"?e.dateMarker:t}function Im(t,e,n){let s=t.initialDate;return s!=null?e.createMarker(s):n.getDateMarker()}function Nm(t,e){return e.type==="SET_OPTION"?{...t,[e.optionName]:e.rawOptionValue}:t}function Hm(t,e,n,s,r){let i;switch(e.type){case"CHANGE_VIEW_TYPE":return r.build(e.dateMarker||n,s);case"CHANGE_DATE":return r.build(e.dateMarker,s);case"PREV":if(i=r.buildPrev(t,n,s),i.isValid)return i;break;case"NEXT":if(i=r.buildNext(t,n,s),i.isValid)return i;break}return t}function km(t,e){switch(e.type){case"UNSELECT_DATES":return null;case"SELECT_DATES":return e.selection;default:return t}}function Pm(t,e){switch(e.type){case"UNSELECT_EVENT":return"";case"SELECT_EVENT":return e.eventInstanceId;default:return t}}function jm(t,e){let n;switch(e.type){case"UNSET_EVENT_DRAG":return null;case"SET_EVENT_DRAG":return n=e.state,{affectedEvents:n.affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return t}}function Lm(t,e){let n;switch(e.type){case"UNSET_EVENT_RESIZE":return null;case"SET_EVENT_RESIZE":return n=e.state,{affectedEvents:n.affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return t}}function Am(t,e,n){let s=t.headerToolbar?Gr(t.headerToolbar,t,e,n):null,r=t.footerToolbar?Gr(t.footerToolbar,t,e,n):null;return{header:s,footer:r}}function Gr(t,e,n,s){let r=e.direction==="rtl",i=[],a=!1;function o(c){let u=Om(c,e,n,s);return i.push(...u.viewsWithButtons),a=a||u.hasTitle,u.widgets}return{sectionWidgets:{start:o(t[r?"right":"left"]||t.start||""),center:o(t.center||""),end:o(t[r?"left":"right"]||t.end||"")},viewsWithButtons:i,hasTitle:a}}function Om(t,e,n,s){let r=e.buttons||{},i=e.toolbarElements||{},a=t?t.split(" "):[],o=[],l=!1;return{widgets:a.map(u=>u.split(",").map(h=>{if(h==="title")return l=!0,{name:h};if(i[h])return{name:h,customElement:i[h]};let g,m=r[h]||{},v,p,y;if(g=n[h]){o.push(h);const D=g.optionDefaults.buttonTextKey;v=m.text||(D?e[D]:"")||(g.singleUnit?e[g.singleUnit+"TextLong"]||e[g.singleUnit+"Text"]:"")||h,p=ue(m.hint||e.viewHint,[v,h],v),y=x=>{m?.click?.(x),x.defaultPrevented||s.changeView(h)}}else v=m.text||e[h+"TextLong"]||e[h+"Text"]||h,h==="prevYear"?p=ue(m.hint||e.prevHint,[e.yearText,"year"],v):h==="nextYear"?p=ue(m.hint||e.nextHint,[e.yearText,"year"],v):p=D=>ue(m.hint||e[h+"Hint"],[e[D+"TextLong"]||e[D+"Text"],D],v),y=D=>{m?.click?.(D),D.defaultPrevented||s[h]?.()};return{name:h,isView:!!g,buttonText:v,buttonHint:p,buttonDisplay:m.display,buttonIconClass:m.iconClass,buttonIconContent:m.iconContent,buttonClick:y,buttonIsPrimary:m.isPrimary||!1,buttonClass:m.class??m.className,buttonDidMount:m.didMount,buttonWillUnmount:m.willUnmount}})),viewsWithButtons:o,hasTitle:l}}class Wm{constructor(e,n,s){this.type=e,this.getCurrentData=n,this.dateEnv=s}get calendar(){return this.getCurrentData().calendarApi}get title(){return this.getCurrentData().viewTitle}get activeStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start)}get activeEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end)}get currentStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start)}get currentEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end)}getOption(e){return this.getCurrentData().options[e]}}const Bm={startTime:"09:00",endTime:"17:00",daysOfWeek:[1,2,3,4,5],display:"inverse-background",className:"",groupId:"_businessHours"};function _m(t,e){return It(Um(t),null,e)}function Um(t){let e;return t===!0?e=[{}]:Array.isArray(t)?e=t.filter(n=>n.daysOfWeek):typeof t=="object"&&t?e=[t]:e=[],e=e.map(n=>({...Bm,...n})),e}function Fm(t,e,n){let s;/^(year|month)$/.test(t.currentRangeUnit)?s=t.currentRange:s=t.activeRange;let r;const i={isEndExclusive:t.isRangeAllDay};return e.titleFormat?r=n.formatRangeToParts(s.start,s.end,V(e.titleFormat),i):(r=n.formatRangeToParts(s.start,s.end,V(Yr(t,e.disallowAmbigTitle,"long")),i),Vm(r)&&(r=n.formatRangeToParts(s.start,s.end,V(Yr(t,e.disallowAmbigTitle,"short")),i))),ie(r)}function Yr(t,e,n){const{currentRangeUnit:s}=t;if(s==="year")return{year:"numeric"};if(s==="month")return{year:"numeric",month:n};if(!e){const r=Tt(t.currentRange.start,t.currentRange.end);if(r!==null&&r>1)return{year:"numeric",month:n}}return{year:"numeric",month:"long",day:"numeric"}}function Vm(t){let e=!1,n=!1;for(const s of t)s.type==="month"&&(s.source==="startRange"&&(e=!0),s.source==="endRange"&&(n=!0));return e&&n}class qr{constructor(){this.resetListeners=new Set}handleInput(e,n){const s=this.dateEnv;if(e!==s&&(typeof n=="function"?this.nowFn=n:s||(this.nowAnchorDate=e.toDate(n?e.createMarker(n):e.createNowMarker()),this.nowAnchorQueried=Date.now()),this.dateEnv=e,s))for(const r of this.resetListeners.values())r()}getDateMarker(){return this.nowAnchorDate?this.dateEnv.timestampToMarker(this.nowAnchorDate.valueOf()+(Date.now()-this.nowAnchorQueried)):this.dateEnv.createMarker(this.nowFn())}addResetListener(e){this.resetListeners.add(e)}removeResetListener(e){this.resetListeners.delete(e)}}class zm{constructor(e){this.computeCurrentViewData=k(this._computeCurrentViewData),this.organizeRawLocales=k(wg),this.buildLocale=k(oo),this.buildPluginHooks=ym(),this.buildDateEnv=k(Gm),this.parseToolbars=k(Am),this.buildViewSpecs=k(Cm),this.buildDateProfileGenerator=Ct(Ym),this.buildViewApi=k(qm),this.buildViewUiProps=Ct(Xm),this.buildEventUiBySource=k($m,We),this.buildEventUiBases=k(Zm),this.parseContextBusinessHours=Ct(Km),this.buildToolbarProps=k(Jm),this.buildTitle=k(Fm),this.nowManager=new qr,this.isDrainingActionQueue=!1,this.actionQueue=[],this.optionOverrides={},this.emitter=new Lt,this.currentCalendarOptionsRefiners={},this.currentCalendarOptionsInput={},this.currentCalendarOptionsRefined={},this.currentViewOptionsInput={},this.currentViewOptionsRefined={},this.optionsForRefining=[],this.optionsForHandling=[],this.getCurrentData=()=>this.data,this.handleNowChange=()=>{this.dispatch({type:"UPDATE_NOW"})},this.dispatch=n=>{this.actionQueue.push(n),this.isDrainingActionQueue||this.drainActionQueue()},this.config=e,this.nowManager=new qr,this.nowTimer=new Eo(this.handleNowChange)}destroy(){this.nowTimer.destroy()}update(e){return this.optionOverrides=e,this.actionQueue.push({type:"IDLE"}),this.drainActionQueue(),this.data}resetOptions(e,n){n===void 0?this.optionOverrides=e:(this.optionOverrides={...this.optionOverrides,...e},this.optionsForRefining.push(...n)),this.dispatch({type:"RESET_OPTIONS"})}drainActionQueue(){let e,{state:n,data:s}=this;const r=!n,{actionQueue:i}=this,a=[];for(this.isDrainingActionQueue=!0;i.length;){const o=i.shift();({state:n,data:s,calendarContext:e}=this.reduce(n,s,o)),this.state=n,this.data=s,o.type!=="IDLE"&&a.push(o)}if(this.isDrainingActionQueue=!1,r){const o=e.options.controller;o&&o._setApi(this.config.calendarApi)}if(!r&&a.length){const{onDataChange:o}=this.config;o&&o(this.data,a)}}reduce(e,n,s){let{config:r}=this,i=!e,a=i?{}:Nm(e.dynamicOptionOverrides,s),o=this.computeOptionsData(this.optionOverrides,a,r.calendarApi),l=i?o.calendarOptions.initialView||o.pluginHooks.initialView:Tm(e.currentViewType,s),c=this.computeCurrentViewData(l,o,this.optionOverrides,a);r.calendarApi.currentDataManager=this,this.emitter.setThisContext(r.calendarApi),this.emitter.setOptions(c.options);let u={nowManager:this.nowManager,dateEnv:o.dateEnv,options:o.calendarOptions,pluginHooks:o.pluginHooks,calendarApi:r.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},{nowDate:h}=this.nowTimer.update({unit:"day",unitValue:1,nowIndicatorSnap:"auto",nowManager:this.nowManager,dateEnv:o.dateEnv}),g=i?Im(o.calendarOptions,o.dateEnv,this.nowManager):Mm(e.currentDate,s),m;i?m=c.dateProfileGenerator.build(g,h):(m=e.dateProfile,n&&n.dateProfileGenerator!==c.dateProfileGenerator&&(m=c.dateProfileGenerator.build(g,h)),m=Hm(m,s,g,h,c.dateProfileGenerator)),(s&&(s.type==="PREV"||s.type==="NEXT")||!Ce(m.activeRange,g))&&(g=m.currentRange.start);let v=i?Ug(o.calendarOptions,m,u):Fg(e.eventSources,s,m,u),p=i?de():om(e.eventStore,s,v,m,u),y=ho(v),D=i?de():y&&!c.options.progressiveEventRendering&&e.renderableEventStore||p,{eventUiSingleBase:x,selectionConfig:C}=this.buildViewUiProps(u),E=this.buildEventUiBySource(v),T=i?{}:this.buildEventUiBases(D.defs,x,E),N={dynamicOptionOverrides:a,currentViewType:l,currentDate:g,dateProfile:m,eventSources:v,eventStore:p,renderableEventStore:D,selectionConfig:C,eventUiBases:T,businessHours:this.parseContextBusinessHours(u),dateSelection:i?null:km(e.dateSelection,s),eventSelection:i?"":Pm(e.eventSelection,s),eventDrag:i?null:jm(e.eventDrag,s),eventResize:i?null:Lm(e.eventResize,s),nowDate:h},I={...u,...N};for(let X of o.pluginHooks.reducers)Object.assign(N,X(e,s,I));let P=e?$r(e,u):!1,H=$r(N,u);!P&&H?this.emitter.trigger("loading",!0):P&&!H&&this.emitter.trigger("loading",!1);let j=this.buildTitle(m,c.options,o.dateEnv),G=this.buildToolbarProps(c.viewSpec,m,c.dateProfileGenerator,g,h,j),U={viewTitle:j,nowManager:this.nowManager,calendarApi:r.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData,toolbarProps:G,...o,...c,...N},F=o.pluginHooks.optionChangeHandlers,Z=n&&n.calendarOptions,Q=o.calendarOptions;if(Z&&Z!==Q){Z.timeZone!==Q.timeZone&&(N.eventSources=U.eventSources=Vg(U.eventSources,m,U),N.eventStore=U.eventStore=Ur(U.eventStore,n.dateEnv,U.dateEnv),N.renderableEventStore=U.renderableEventStore=Ur(U.renderableEventStore,n.dateEnv,U.dateEnv));for(let X in F)(this.optionsForHandling.indexOf(X)!==-1||Z[X]!==Q[X])&&F[X](Q[X],U)}return this.optionsForHandling=[],{state:N,data:U,calendarContext:u}}computeOptionsData(e,n,s){if(!this.optionsForRefining.length&&e===this.stableOptionOverrides&&n===this.stableDynamicOptionOverrides)return this.stableCalendarOptionsData;let{refinedOptions:r,pluginHooks:i,localeDefaults:a,availableLocaleData:o}=this.processRawCalendarOptions(e,n),l=this.buildDateEnv(r.timeZone,r.locale,r.weekNumberCalculation,r.firstDay,r.weekTextLong,r.weekTextShort,i,o),c=this.buildViewSpecs(i.views,this.stableOptionOverrides,this.stableDynamicOptionOverrides),u=this.parseToolbars(r,c,s);return this.stableCalendarOptionsData={calendarOptions:r,pluginHooks:i,dateEnv:l,viewSpecs:c,toolbarConfig:u,localeDefaults:a,availableRawLocales:o.map}}processRawCalendarOptions(e,n){let{locales:s,locale:r}=Ee(Vn,e,n),i=this.organizeRawLocales(s),a=i.map,o=this.buildLocale(r||i.defaultCode,a).options,l=this.buildPluginHooks(e.plugins||[],Qg),c=this.currentCalendarOptionsRefiners={...Pr,...jr,...Lr,...l.listenerRefiners,...l.optionRefiners},u=Ee(Vn,...l.optionDefaults,o,Xr(Ee(e,n),c)),h={},g=this.currentCalendarOptionsInput,m=this.currentCalendarOptionsRefined,v=!1;for(let p in u)this.optionsForRefining.indexOf(p)===-1&&(u[p]===g[p]||Qe[p]&&p in g&&Qe[p](g[p],u[p])||ss(g[p],u[p]))?h[p]=m[p]:c[p]&&(h[p]=c[p](u[p],p),v=!0);return v&&(this.currentCalendarOptionsInput=u,this.currentCalendarOptionsRefined=h,this.stableOptionOverrides=e,this.stableDynamicOptionOverrides=n),this.optionsForHandling.push(...this.optionsForRefining),this.optionsForRefining=[],{rawOptions:this.currentCalendarOptionsInput,refinedOptions:this.currentCalendarOptionsRefined,pluginHooks:l,availableLocaleData:i,localeDefaults:o}}_computeCurrentViewData(e,n,s,r){let i=n.viewSpecs[e];if(!i)throw new Error(`viewType "${e}" is not available. Please make sure you've loaded all neccessary plugins`);let{refinedOptions:a}=this.processRawViewOptions(i,n.pluginHooks,n.localeDefaults,s,r);this.nowManager.handleInput(n.dateEnv,a.now);let o=this.buildDateProfileGenerator({dateProfileGeneratorClass:i.optionDefaults.dateProfileGeneratorClass,duration:i.duration,durationUnit:i.durationUnit,usesMinMaxTime:i.optionDefaults.usesMinMaxTime,dateEnv:n.dateEnv,calendarApi:this.config.calendarApi,slotMinTime:a.slotMinTime,slotMaxTime:a.slotMaxTime,showNonCurrentDates:a.showNonCurrentDates,dayCount:a.dayCount,dateAlignment:a.dateAlignment,dateIncrement:a.dateIncrement,hiddenDays:a.hiddenDays,weekends:a.weekends,validRangeInput:a.validRange,visibleRangeInput:a.visibleRange,fixedWeekCount:a.fixedWeekCount}),l=this.buildViewApi(e,this.getCurrentData,n.dateEnv);return{viewSpec:i,options:a,dateProfileGenerator:o,viewApi:l}}processRawViewOptions(e,n,s,r,i){let a={...Pr,...jr,...Lr,...Of,...n.listenerRefiners,...n.optionRefiners},o=Ee(Vn,...n.optionDefaults,e.optionDefaults,s,Xr(Ee(r,e.optionOverrides,i),a)),l={},c=this.currentViewOptionsInput,u=this.currentViewOptionsRefined,h=!1;for(let g in o)o[g]===c[g]||Qe[g]&&Qe[g](o[g],c[g])||ss(c[g],o[g])?l[g]=u[g]:(o[g]===this.currentCalendarOptionsInput[g]||Qe[g]&&Qe[g](o[g],this.currentCalendarOptionsInput[g])?g in this.currentCalendarOptionsRefined&&(l[g]=this.currentCalendarOptionsRefined[g]):a[g]&&(l[g]=a[g](o[g],g)),h=!0);return h&&(this.currentViewOptionsInput=o,this.currentViewOptionsRefined=l),{rawOptions:this.currentViewOptionsInput,refinedOptions:this.currentViewOptionsRefined}}}function Gm(t,e,n,s,r,i,a,o){let l=oo(e||o.defaultCode,o.map);return new lf({calendarSystem:"gregory",timeZone:t,locale:l,weekNumberCalculation:n,firstDay:s,weekTextLong:r,weekTextShort:i,cmdFormatter:a.cmdFormatter})}function Ym(t){let e=t.dateProfileGeneratorClass||bo;return new e(t)}function qm(t,e,n){return new Wm(t,e,n)}function $m(t){return xe(t,e=>e.ui)}function Zm(t,e,n){let s={"":e};for(let r in t){let i=t[r];i.sourceId&&n[i.sourceId]&&(s[r]=n[i.sourceId])}return s}function Xm(t){const{options:e}=t;return{eventUiSingleBase:ln({display:e.eventDisplay,editable:e.editable,startEditable:e.eventStartEditable,durationEditable:e.eventDurationEditable,constraint:e.eventConstraint,overlap:typeof e.eventOverlap=="boolean"?e.eventOverlap:void 0,allow:e.eventAllow},t),selectionConfig:ln({constraint:e.selectConstraint,overlap:typeof e.selectOverlap=="boolean"?e.selectOverlap:void 0,allow:e.selectAllow},t)}}function $r(t,e){for(let n of e.pluginHooks.isLoadingFuncs)if(n(t))return!0;return!1}function Km(t){return _m(t.options.businessHours,t)}const Zr={};function Xr(t,e){const n={};for(const s in t)e[s]?n[s]=t[s]:Zr[s]||(Oe(`Unknown option \`${s}\`.`),Zr[s]=!0);return n}function Jm(t,e,n,s,r,i){let a=n.build(r,r,void 0,!1),o=n.buildPrev(e,s,r,!1),l=n.buildNext(e,s,r,!1);return{title:i,selectedButton:t.type,navUnit:t.singleUnit,isTodayEnabled:a.isValid&&!Ce(e.currentRange,r),isPrevEnabled:o.isValid,isNextEnabled:l.isValid}}class Qm{getCurrentData(){return this.currentDataManager.getCurrentData()}dispatch(e){this.currentDataManager.dispatch(e)}get view(){return this.getCurrentData().viewApi}batchRendering(e){e()}setOption(e,n){this.dispatch({type:"SET_OPTION",optionName:e,rawOptionValue:n})}getOption(e){return this.currentDataManager.currentCalendarOptionsInput[e]}getAvailableLocaleCodes(){return Object.keys(this.getCurrentData().availableRawLocales)}on(e,n){let{currentDataManager:s}=this;s.currentCalendarOptionsRefiners[e]?s.emitter.on(e,n):Oe(`Unknown listener \`${e}\`.`)}off(e,n){this.currentDataManager.emitter.off(e,n)}trigger(e,...n){this.currentDataManager.emitter.trigger(e,...n)}changeView(e,n){this.batchRendering(()=>{if(this.unselect(),n)if(n.start&&n.end)this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e}),this.dispatch({type:"SET_OPTION",optionName:"visibleRange",rawOptionValue:n});else{let{dateEnv:s}=this.getCurrentData();this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e,dateMarker:s.createMarker(n)})}else this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e})})}zoomTo(e,n){let s=this.getCurrentData(),r;n=n||"day",r=s.viewSpecs[n]||this.getUnitViewSpec(n),this.unselect(),r?this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:r.type,dateMarker:e}):this.dispatch({type:"CHANGE_DATE",dateMarker:e})}getUnitViewSpec(e){let{viewSpecs:n,toolbarConfig:s}=this.getCurrentData(),r=[].concat(s.header?s.header.viewsWithButtons:[],s.footer?s.footer.viewsWithButtons:[]),i,a;for(let o in n)r.push(o);for(i=0;i<r.length;i+=1)if(a=n[r[i]],a&&a.singleUnit===e)return a;return null}prev(){this.unselect(),this.dispatch({type:"PREV"})}next(){this.unselect(),this.dispatch({type:"NEXT"})}prevYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.dateEnv.addYears(e.currentDate,-1)})}nextYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.dateEnv.addYears(e.currentDate,1)})}today(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.nowManager.getDateMarker()})}gotoDate(e){let n=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:n.dateEnv.createMarker(e)})}incrementDate(e){let n=this.getCurrentData(),s=_(e);s&&(this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:n.dateEnv.add(n.currentDate,s)}))}getDate(){let e=this.getCurrentData();return e.dateEnv.toDate(e.currentDate)}formatDate(e,n){let{dateEnv:s}=this.getCurrentData();return ie(s.formatToParts(s.createMarker(e),V(n)))}formatRange(e,n,s){let{dateEnv:r}=this.getCurrentData();return ie(r.formatRangeToParts(r.createMarker(e),r.createMarker(n),V(s),s))}formatIso(e,n){let{dateEnv:s}=this.getCurrentData();return s.formatIso(s.createMarker(e),{omitTime:n})}select(e,n){let s;n==null?e.start!=null?s=e:s={start:e,end:null}:s={start:e,end:n};let r=this.getCurrentData(),i=Zf(s,r.dateEnv,_({days:1}));i&&(this.dispatch({type:"SELECT_DATES",selection:i}),no(i,null,r))}unselect(e){let n=this.getCurrentData();n.dateSelection&&(this.dispatch({type:"UNSELECT_DATES"}),tg(e,n))}addEvent(e,n){if(e instanceof $){let a=e._def,o=e._instance;return this.getCurrentData().eventStore.defs[a.defId]||(this.dispatch({type:"ADD_EVENTS",eventStore:es({def:a,instance:o})}),this.triggerEventAdd(e)),e}let s=this.getCurrentData(),r;if(n instanceof et)r=n.internalEventSource;else if(typeof n=="boolean")n&&([r]=Ya(s.eventSources));else if(n!=null){let a=this.getEventSourceById(n);if(!a)return Oe(`Unknown event source ID \`${n}\`.`),null;r=a.internalEventSource}let i=Ja(e,r,s,!1);if(i){let a=new $(s,i.def,i.def.recurringDef?null:i.instance);return this.dispatch({type:"ADD_EVENTS",eventStore:es(i)}),this.triggerEventAdd(a),a}return null}triggerEventAdd(e){let{emitter:n}=this.getCurrentData();n.trigger("eventAdd",{event:e,relatedEvents:[],revert:()=>{this.dispatch({type:"REMOVE_EVENTS",eventStore:so(e)})}})}getEventById(e){let n=this.getCurrentData(),{defs:s,instances:r}=n.eventStore;e=String(e);for(let i in s){let a=s[i];if(a.publicId===e){if(a.recurringDef)return new $(n,a,null);for(let o in r){let l=r[o];if(l.defId===a.defId)return new $(n,a,l)}}}return null}getEvents(){let e=this.getCurrentData();return Fe(e.eventStore,e)}removeAllEvents(){this.dispatch({type:"REMOVE_ALL_EVENTS"})}getEventSources(){let e=this.getCurrentData(),n=e.eventSources,s=[];for(let r in n)s.push(new et(e,n[r]));return s}getEventSourceById(e){let n=this.getCurrentData(),s=n.eventSources;e=String(e);for(let r in s)if(s[r].publicId===e)return new et(n,s[r]);return null}addEventSource(e){let n=this.getCurrentData();if(e instanceof et)return n.eventSources[e.internalEventSource.sourceId]||this.dispatch({type:"ADD_EVENT_SOURCES",sources:[e.internalEventSource]}),e;let s=co(e,n);return s?(this.dispatch({type:"ADD_EVENT_SOURCES",sources:[s]}),new et(n,s)):null}removeAllEventSources(){this.dispatch({type:"REMOVE_ALL_EVENT_SOURCES"})}refetchEvents(){this.dispatch({type:"FETCH_EVENT_SOURCES",isRefetch:!0})}scrollToTime(e){let n=_(e);n&&this.trigger("_timeScrollRequest",n)}getButtonState(){const e=this.getCurrentData(),{toolbarProps:n}=e,s=e.calendarOptions,r=s.buttons||{},i=e.viewSpecs,a=e.viewSpec.singleUnit,o=[a?Kr(a,s):"",a],l={today:{text:s.todayText,hint:ue(s.todayHint,o,s.todayText),isDisabled:!n.isTodayEnabled},prev:{text:s.prevText,hint:ue(s.prevHint,o,s.prevText),isDisabled:!n.isPrevEnabled},next:{text:s.nextText,hint:ue(s.nextHint,o,s.nextText),isDisabled:!n.isNextEnabled},prevYear:{text:s.prevYearText,hint:ue(s.prevHint,[s.yearText,"year"],s.prevYearText),isDisabled:!1},nextYear:{text:s.prevYearText,hint:ue(s.nextHint,[s.yearText,"year"],s.nextYearText),isDisabled:!1}};for(const c in i){const u=i[c],{singleUnit:h}=u,g=u.optionDefaults.buttonTextKey,m=r[c]?.text||(g?s[g]:"")||(h?Kr(h,s):"")||c,v=ue(s.viewHint,[m,c],m);l[c]={text:m,hint:v}}return l}}function Kr(t,e){return e[t+"TextLong"]||e[t+"Text"]}class ep extends w.Component{constructor(){super(...arguments),this.state={forPrint:!1},this.handleBeforePrint=()=>{Rt.flushSync(()=>{this.setState({forPrint:!0})})},this.handleAfterPrint=()=>{Rt.flushSync(()=>{this.setState({forPrint:!1})})}}render(){return this.props?.children(this.state.forPrint)}componentDidMount(){const{props:e}=this,{emitter:n}=e;n.on("_beforeprint",this.handleBeforePrint),n.on("_afterprint",this.handleAfterPrint)}componentWillUnmount(){const{props:e}=this,{emitter:n}=e;n.off("_beforeprint",this.handleBeforePrint),n.off("_afterprint",this.handleAfterPrint)}}function tp(t,e){let n=t.borderlessX??t.borderless,s=t.borderlessTop??t.borderless,r=t.borderlessBottom??t.borderless;const i={borderlessX:!!n,borderlessTop:!!s,borderlessBottom:!!r};return b(R(t.class,i),R(t.className,i),f.borderBoxRoot,f.isolate,f.flexCol,e?f.calendarPrintRoot:f.calendarScreenRoot)}class np extends B{render(){const{contentGenerator:e,className:n}=this.props;if(e)return d.jsx(q,{tag:"span",style:{display:"contents"},attrs:{"aria-hidden":!0},renderProps:{},generatorName:void 0,customGenerator:e});if(n!==void 0)return d.jsx("span",{"aria-hidden":!0,className:n})}}class sp extends B{render(){let{props:e}=this,{options:n}=this.context,s=e.widgetGroups.map(r=>this.renderWidgetGroup(r));return w.createElement("div",{className:R(n.toolbarSectionClass,{name:e.name})},...s)}renderWidgetGroup(e){let{props:n,context:s}=this,{options:r}=s,i=[],a=!0,o=!0;for(const l of e){const{name:c,isView:u}=l;c==="title"?a=!1:u||(o=!1)}for(let l of e){let{name:c,customElement:u,buttonHint:h}=l;if(c==="title")i.push(d.jsx("div",{role:"heading","aria-level":r.headingLevel,id:n.titleId,className:b(r.toolbarTitleClass),children:n.title}));else if(u)i.push(d.jsx(q,{tag:"span",style:{display:"contents"},renderProps:{},generatorName:void 0,customGenerator:u}));else{let g=c===n.selectedButton,m=!n.isTodayEnabled&&c==="today"||!n.isPrevEnabled&&c==="prev"||!n.isNextEnabled&&c==="next",v=l.buttonDisplay??r.buttonDisplay;v==="auto"&&(v=l.buttonIconContent||l.buttonIconClass?"icon":"text");let p;v!=="text"&&(p=d.jsx(np,{className:l.buttonIconClass,contentGenerator:l.buttonIconContent}));let y=e.length>1&&a,D=y?{hasSelection:o}:null,x={name:c,text:l.buttonText,isPrimary:l.buttonIsPrimary,isSelected:g,isDisabled:m,isIconOnly:v==="icon",buttonGroup:D};i.push(d.jsx(q,{tag:"button",attrs:{type:"button",disabled:m,...a&&o?{role:"tab","aria-selected":g}:{"aria-pressed":g},"aria-label":typeof h=="function"?h(n.navUnit):h,onClick:l.buttonClick},className:b(R(r.buttonClass,x),!m&&f.cursorPointer,y&&b(g?f.z1:f.z0,f.focusZ2)),renderProps:x,generatorName:void 0,classNameGenerator:l.buttonClass,didMount:l.buttonDidMount,willUnmount:l.buttonWillUnmount,children:()=>v==="text"?l.buttonText:v==="icon"?p:v==="icon-text"?d.jsxs(d.Fragment,{children:[p,l.buttonText]}):d.jsxs(d.Fragment,{children:[l.buttonText,p]})}))}}return i.length>1?w.createElement("div",{role:a&&o?"tablist":void 0,"aria-label":a&&o?r.viewChangeHint:void 0,className:b(R(r.buttonGroupClass,{hasSelection:o}),f.isolate)},...i):i[0]}}class Jr extends B{render(){let{props:e}=this,n=this.context.options,{sectionWidgets:s}=e.model;const{borderlessX:r,borderlessTop:i,borderlessBottom:a}=ve(n),o=e.isHeader?n.headerToolbarClass:n.footerToolbarClass;return d.jsxs("div",{className:b(R(o,{borderlessX:r,borderlessTop:i,borderlessBottom:a}),R(n.toolbarClass,{borderlessX:r,borderlessTop:i,borderlessBottom:a})),children:[this.renderSection("start",s.start),this.renderSection("center",s.center),this.renderSection("end",s.end)]})}renderSection(e,n){let{props:s}=this;return d.jsx(sp,{name:e,widgetGroups:n,title:s.title,titleId:s.titleId,navUnit:s.navUnit,selectedButton:s.selectedButton,isTodayEnabled:s.isTodayEnabled,isPrevEnabled:s.isPrevEnabled,isNextEnabled:s.isNextEnabled},e)}}class rp extends pt{constructor(e){super(e),this.handleSegClick=(n,s)=>{let{component:r}=this,{context:i}=r,a=ct(s);a&&r.isValidSegDownEl(n.target)&&i.emitter.trigger("eventClick",{el:s,event:new $(r.context,a.def,a.instance),jsEvent:n,view:i.viewApi})},this.destroy=Va(e.el,"click",`.${f.internalEvent}`,this.handleSegClick)}}class ip extends pt{constructor(e){super(e),this.handleEventElRemove=n=>{n===this.currentSegEl&&this.handleSegLeave(null,this.currentSegEl)},this.handleSegEnter=(n,s)=>{ct(s)&&(this.currentSegEl=s,this.triggerEvent("eventMouseEnter",n,s))},this.handleSegLeave=(n,s)=>{this.currentSegEl&&(this.currentSegEl=null,this.triggerEvent("eventMouseLeave",n,s))},this.removeHoverListeners=bf(e.el,`.${f.internalEvent}`,this.handleSegEnter,this.handleSegLeave)}destroy(){this.removeHoverListeners()}triggerEvent(e,n,s){let{component:r}=this,{context:i}=r,a=ct(s);(!n||r.isValidSegDownEl(n.target))&&i.emitter.trigger(e,{el:s,event:new $(i,a.def,a.instance),jsEvent:n,view:i.viewApi})}}class ap extends Ke{constructor(){super(...arguments),this.buildViewContext=k(em),this.buildViewPropTransformers=k(op),this.interactionsStore={},this.calendarInteractions=[],this.registerInteractiveComponent=(e,n)=>{let s=fm(e,n),i=[rp,ip];n.disableHits||(i=i.concat(this.props.pluginHooks.componentInteractions));let a=i.map(o=>new o(s));this.interactionsStore[e.uid]=a,rs[e.uid]=s},this.unregisterInteractiveComponent=e=>{let n=this.interactionsStore[e.uid];if(n){for(let s of n)s.destroy();delete this.interactionsStore[e.uid]}delete rs[e.uid]}}get viewTitleId(){return this.props.baseId+"title"}render(){const{props:e}=this;let{toolbarConfig:n,options:s}=e,r,i=!1,a;e.forPrint||fe(s)||(s.height!=null?i=!0:s.contentHeight!=null?r=s.contentHeight:a=Math.max(s.aspectRatio,.5));let o=this.buildViewContext(e.viewSpec,e.viewApi,e.options,e.dateProfileGenerator,e.dateEnv,e.nowManager,e.pluginHooks,e.dispatch,e.getCurrentData,e.emitter,e.calendarApi,e.baseId,this.registerInteractiveComponent,this.unregisterInteractiveComponent);return d.jsxs(Me.Provider,{value:o,children:[n.header&&d.jsx(Jr,{model:n.header,isHeader:!0,titleId:this.viewTitleId,...e.toolbarProps}),d.jsxs("div",{className:b(f.flexCol,f.rel,f.overflowAnchorNone,f.minHeight0,i&&f.liquid),style:{height:r,aspectRatio:a!=null?String(a):void 0},children:[this.renderView(b((i||r)&&f.liquid,a!=null&&f.fill,f.internalView)),this.buildAppendContent()]}),n.footer&&d.jsx(Jr,{model:n.footer,isHeader:!1,...e.toolbarProps})]})}renderView(e){const{props:n}=this,{pluginHooks:s,viewSpec:r,toolbarConfig:i,toolbarProps:a}=n;let o={className:e,dateProfile:n.dateProfile,businessHours:n.businessHours,eventStore:n.renderableEventStore,eventUiBases:n.eventUiBases,dateSelection:n.dateSelection,eventSelection:n.eventSelection,eventDrag:n.eventDrag,eventResize:n.eventResize,forPrint:n.forPrint,labelId:i.header&&i.header.hasTitle?this.viewTitleId:void 0,labelStr:i.header&&i.header.hasTitle?void 0:a.title},l=this.buildViewPropTransformers(s.viewPropsTransformers),c={...n,toolbarProps:a,forPrint:n.forPrint};for(let h of l)Object.assign(o,h.transform(o,c));let u=r.component;return d.jsx(u,{...o})}buildAppendContent(){const{props:e}=this;return d.jsx(d.Fragment,{children:e.pluginHooks.viewContainerAppends.map((n,s)=>d.jsx(w.Fragment,{children:n(e)},s))})}componentDidMount(){const{props:e}=this;this.calendarInteractions=e.pluginHooks.calendarInteractions.map(s=>new s(e));let{propSetHandlers:n}=e.pluginHooks;for(let s in n)n[s](e[s],e);for(let s of e.pluginHooks.contextInit)s(e)}componentDidUpdate(e){const{props:n}=this;let{propSetHandlers:s}=n.pluginHooks;for(let r in s)n[r]!==e[r]&&s[r](n[r],n)}componentWillUnmount(){const{props:e}=this;for(let n of this.calendarInteractions)n.destroy();this.calendarInteractions=[],e.emitter.trigger("_unmount")}}function op(t){return t.map(e=>new e)}const lp=w.forwardRef((t,e)=>{const n=up(t.id),[s,r]=w.useState("");function i(c,u){(cp(u)?Rt.flushSync:dp)(()=>{r(Te())})}const[a]=w.useState(()=>new Qm),[o]=w.useState(()=>new zm({calendarApi:a,onDataChange:i}));w.useEffect(()=>()=>{o.destroy()},[]),w.useImperativeHandle(e,()=>({getApi:()=>a}),[]);const l=o.update(t);return d.jsx(ep,{emitter:l.emitter,children:c=>{const u=l.calendarOptions,h=u.direction==="rtl",g=tp(u,c);return d.jsx("div",{dir:h?"rtl":void 0,className:g,style:{height:u.height},"data-color-scheme":u.colorScheme||void 0,children:d.jsx(ap,{...l,baseId:n,forPrint:c})})}})});function cp(t){for(const e of t)if(e.type==="SET_EVENT_DRAG"||e.type==="UNSET_EVENT_DRAG"||e.type==="SET_EVENT_RESIZE"||e.type==="UNSET_EVENT_RESIZE"||e.type==="MERGE_EVENTS")return!0;return!1}function dp(t){t()}let Qr=!1;function up(t){if(ar.useId)return ar.useId();const[e]=w.useState(()=>Te());return t?t+":":(Qr||(Qr=!0,Oe("Missing `id` prop. Provide one for better SSR support in React 17.")),`fc:${e}:`)}function xo(t){const e=t.getRootNode();return e instanceof Document?e.body||e.documentElement:e}function Nt(t){return getComputedStyle(t).direction==="rtl"}const hp=/(top|left|right|bottom|width|height)$/i;function Jt(t,e){for(let n in e)fp(t,n,e[n])}function fp(t,e,n){n==null?t.style[e]="":typeof n=="number"&&hp.test(e)?t.style[e]=`${n}px`:t.style[e]=n}function To(t){return t.composedPath?.()[0]??t.target}class At extends w.Component{constructor(e,n){super(e,n),this.handleChange=()=>{this.forceUpdate()},this.runner=new Eo(this.handleChange)}render(){const{props:e,context:n}=this,{nowDate:s,todayRange:r}=this.runner.update({nowManager:n.nowManager,unit:e.unit,unitValue:e.unitValue,nowIndicatorSnap:n.options.nowIndicatorSnap,dateEnv:n.dateEnv});return e.children(s,r)}componentWillUnmount(){this.runner.destroy()}}At.contextType=Me;const $s=V({year:"numeric",month:"long",day:"numeric"}),gp=V({week:"long"}),un=V({weekday:"long"});function Ht(t){for(const e of t)if(e.type==="weekday")return e.value;return""}function kt(t){for(const e of t)if(e.type==="day")return e.value;return""}function Mo(t){for(const e of t)if(e.type==="month")return e.value;return""}function vt(t,e,n="day"){return ie(t.dateEnv.formatToParts(e,n==="week"?gp:$s))}function yt(t,e,n="day",s=vt(t,e,n),r=!0){const{dateEnv:i,options:a,calendarApi:o}=t,l=i.toDate(e),c=u=>{let h=n==="day"?a.navLinkDayClick:n==="week"?a.navLinkWeekClick:null;typeof h=="function"?h.call(o,i.toDate(e),u):(typeof h=="string"&&(n=h),o.zoomTo(e,n))};return{role:"link","aria-label":ue(a.navLinkHint,[s,l],s),className:b(a.navLinkClass,f.cursorPointer,f.internalNavLink),...r?Ps(c):{onClick:c}}}function Je(t,e,n,s,r){const i=!!(n&&(!n.activeRange||!Ce(n.activeRange,t)));return{date:e.toDate(t),dow:t.getUTCDay(),isDisabled:i,isOther:!i&&!!(n&&!Ce(n.currentRange,t)),isToday:!i&&!!(s&&Ce(s,t)),isPast:!i&&!!(r?t<r:s&&t<s.start),isFuture:!i&&!!(r?t>r:s&&t>=s.end)}}function as(t,e){return t!=null&&(t===e||Math.abs(t-e)<.01)}const mp=!0,os=new Map,ls=new Set;let cs=!1,zn=!1;function re(t){ls.add(t),!cs&&!zn&&(zn=!0,requestAnimationFrame(()=>{zn=!1,Io()}))}function Io(){for(const t of ls.values())t(),ls.delete(t)}const Gt=typeof ResizeObserver<"u"&&new ResizeObserver(t=>{cs=!0;for(let e of t){const n=e.target,s=os.get(n);let r,i;if(e.borderBoxSize&&mp){const o=e.borderBoxSize[0]||e.borderBoxSize;r=o.inlineSize,i=o.blockSize}else({width:r,height:i}=n.getBoundingClientRect());let a=!1;as(s.width,r)||(s.width=r,a=s.watchWidth),as(s.height,i)||(s.height=i,a||(a=s.watchHeight)),a&&s.callback(r,i)}Rt.flushSync(()=>{Io(),cs=!1})});function St(t,e,n=!0,s=!0){return os.set(t,{callback:e,watchWidth:n,watchHeight:s}),Gt&&Gt.observe(t,{box:"border-box"}),()=>{os.delete(t),Gt&&Gt.unobserve(t)}}function Zs(t,e){return St(t,e,!0)}function dt(t,e){return St(t,(n,s)=>e(s),!1,!0)}class kn extends B{constructor(){super(...arguments),this.refineRenderProps=Ct(pp)}render(){const{props:e,context:n}=this,{options:s,viewSpec:r}=n,i=this.refineRenderProps({...ve(s),options:{headerToolbar:s.headerToolbar,footerToolbar:s.footerToolbar},isHeightAuto:fe(s),viewApi:n.viewApi});return d.jsx(q,{elRef:e.elRef,tag:e.tag||"div",attrs:e.attrs,style:e.style,className:b(e.className,R(s.viewClass,i),R(r.optionDefaults.class,i),R(r.optionDefaults.className,i),R(r.optionOverrides.class,i),R(r.optionOverrides.className,i)),renderProps:i,generatorName:void 0,didMount:s.didMount||s.viewDidMount,willUnmount:s.willUnmount||s.viewWillUnmount,children:()=>e.children})}}function pp(t){return{view:t.viewApi,borderlessX:t.borderlessX,borderlessTop:t.borderlessTop,borderlessBottom:t.borderlessBottom,options:t.options,isHeightAuto:t.isHeightAuto}}class ye extends B{constructor(){super(...arguments),this.uid=Te()}prepareHits(){}queryHit(e,n,s,r,i){return null}isValidSegDownEl(e){return!this.props.eventDrag&&!this.props.eventResize&&!e.closest(`.${f.internalEventMirror}`)}isValidDateDownEl(e){return!e.closest(`.${f.internalEvent}:not(.${f.internalBgEvent})`)&&!e.closest(`.${f.internalMoreLink}`)&&!e.closest(`.${f.internalNavLink}`)&&!e.closest(`.${f.internalPopover}`)}}class ei{constructor(e){this.drainedOption=e,this.isRunning=!1,this.isDirty=!1,this.pauseDepths={},this.timeoutId=0}request(e){this.isDirty=!0,this.isPaused()||(this.clearTimeout(),e==null?this.tryDrain():this.timeoutId=setTimeout(this.tryDrain.bind(this),e))}pause(e=""){let{pauseDepths:n}=this;n[e]=(n[e]||0)+1,this.clearTimeout()}resume(e="",n){let{pauseDepths:s}=this;e in s&&(n?delete s[e]:(s[e]-=1,s[e]<=0&&delete s[e]),this.tryDrain())}isPaused(){return Object.keys(this.pauseDepths).length}tryDrain(){if(!this.isRunning&&!this.isPaused()){for(this.isRunning=!0;this.isDirty;)this.isDirty=!1,this.drained();this.isRunning=!1}}clear(){this.clearTimeout(),this.isDirty=!1,this.pauseDepths={}}clearTimeout(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=0)}drained(){this.drainedOption&&this.drainedOption()}}class vp{constructor(e){this.el=e,this.emitter=new Lt,this.isScroll=!1,this.isScrollRecent=!1,this.isWheelRecent=!1,this.isMouseDown=!1,this.isTouchDown=!1,this.isMouse=!1,this.isTouch=!1,this.isWheel=!1,this.handleScroll=()=>{this.isScrollRecent=!0,this.isMouseDown&&(this.isMouse=!0),this.isTouchDown&&(this.isTouch=!0),this.isWheelRecent&&(this.isWheel=!0),this.startScroll(),this.emitter.trigger("scroll",this.getIsDevice()),this.scrollWaiter.request(500)},this.handleScrollWait=()=>{this.isScrollRecent=!1,this.isTouchDown||this.endScroll()},this.handleWheel=()=>{this.isWheelRecent=!0,this.wheelWaiter.request(500)},this.handleWheelWait=()=>{this.isWheelRecent=!1},this.handleMouseDown=()=>{this.isMouseDown=!0},this.handleMouseUp=()=>{this.isMouseDown=!1},this.handleTouchStart=()=>{this.isTouchDown=!0},this.handleTouchEnd=()=>{this.isTouchDown=!1,this.isScrollRecent||this.endScroll()},this.wheelWaiter=new ei(this.handleWheelWait),this.scrollWaiter=new ei(this.handleScrollWait),e.addEventListener("scroll",this.handleScroll,{passive:!0}),e.addEventListener("wheel",this.handleWheel,{passive:!0}),e.addEventListener("mousedown",this.handleMouseDown),e.addEventListener("mouseup",this.handleMouseUp),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),e.addEventListener("touchend",this.handleTouchEnd)}destroy(){let{el:e}=this;e.removeEventListener("scroll",this.handleScroll,{passive:!0}),e.removeEventListener("wheel",this.handleWheel,{passive:!0}),e.removeEventListener("mousedown",this.handleMouseDown),e.removeEventListener("mouseup",this.handleMouseUp),e.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),e.removeEventListener("touchend",this.handleTouchEnd)}startScroll(){this.isScroll||(this.isScroll=!0,this.emitter.trigger("scrollStart",this.getIsDevice()))}endScroll(){this.isScroll&&(this.scrollWaiter.clear(),this.wheelWaiter.clear(),this.isScroll=!1,this.isWheelRecent=!1,this.emitter.trigger("scrollEnd",this.getIsDevice()),this.isMouse=!1,this.isTouch=!1,this.isWheel=!1)}getIsDevice(){return this.isWheel||this.isMouse||this.isTouch}}class pe extends ye{constructor(){super(...arguments),this.handleEl=e=>{this.el&&(this.el=null,this._isUnmounting=!0,this.listener.destroy()),e&&(this.el=e,this._isUnmounting=!1,this.listener=new vp(e))},this.handleHRuler=e=>{this.disconnectHRuler&&(this.disconnectHRuler(),this.disconnectHRuler=void 0,this.clientWidth!==void 0&&(this.clientWidth=void 0,L(this.props.clientWidthRef,null))),e&&(this.disconnectHRuler=Zs(e,n=>{this._isUnmounting||n!==this.clientWidth&&(this.clientWidth=n,L(this.props.clientWidthRef,n))}))},this.handleVRuler=e=>{this.disconnectVRuler&&(this.disconnectVRuler(),this.disconnectVRuler=void 0,this.clientHeight!==void 0&&(this.clientHeight=void 0,L(this.props.clientHeightRef,null))),e&&(this.disconnectVRuler=dt(e,n=>{if(this._isUnmounting)return;n!==this.clientHeight&&(this.clientHeight=n,L(this.props.clientHeightRef,n));const s=Math.round(this.el.getBoundingClientRect().height-n);s!==this.bottomScrollbarWidth&&(this.bottomScrollbarWidth=s,L(this.props.bottomScrollbarWidthRef,s))}))}}render(){const{props:e}=this,n=e.horizontal||e.vertical?"hidden":"";return d.jsxs("div",{ref:this.handleEl,className:b(e.className,f.noPadding,f.rel,e.hideScrollbars&&f.noScrollbars,f.internalScroller),style:{...e.style,overflowX:e.horizontal?"auto":n,overflowY:e.vertical?"auto":n},children:[e.children,!!e.clientWidthRef&&d.jsx("div",{ref:this.handleHRuler,className:f.fillTop}),!!(e.clientHeightRef||e.bottomScrollbarWidthRef)&&d.jsx("div",{ref:this.handleVRuler,className:f.fillStart})]})}endScroll(){this.listener.endScroll()}get x(){const{el:e}=this;return e?yp(e):0}get y(){const{el:e}=this;return e?e.scrollTop:0}scrollTo({x:e,y:n}){const{el:s}=this;s&&(n!=null&&(s.scrollTop=n),e!=null&&Sp(s,e))}addScrollStartListener(e){this.listener.emitter.on("scrollStart",e)}removeScrollStartListener(e){this.listener.emitter.off("scrollStart",e)}addScrollEndListener(e){this.listener.emitter.on("scrollEnd",e)}removeScrollEndListener(e){this.listener.emitter.off("scrollEnd",e)}}function yp(t){const{scrollLeft:e}=t;return Nt(t)?Ep(e,t):e}function Sp(t,e){const n=Nt(t);t.scrollLeft=n?bp(e,t):e}function Ep(t,e){switch(No()){case"positive":return e.scrollWidth-e.clientWidth-t;case"negative":return-t}return t}function bp(t,e){switch(No()){case"positive":return e.scrollWidth-e.clientWidth-t;case"negative":return-t}return t}let ti;function No(){return ti||(ti=Dp())}function Dp(){let t=document.createElement("div");t.style.position="absolute",t.style.top="-1000px",t.style.width="100px",t.style.height="100px",t.style.overflow="scroll",t.style.direction="rtl";let e=document.createElement("div");e.style.width="200px",e.style.height="200px",t.appendChild(e),document.body.appendChild(t);let n;return t.scrollLeft>0?n="positive":(t.scrollLeft=50,t.scrollLeft>0?n="reverse":n="negative"),t.remove(),n}class Ot extends B{constructor(){super(...arguments),this.buildPublicEvent=k((e,n,s)=>new $(e,n,s)),this.handleEl=e=>{this.el=e,L(this.props.elRef,e),e&&cn(e,this.props.eventRange)}}render(){const{props:e,context:n}=this,{options:s}=n,{eventRange:r}=e,i=r.ui,a=s.eventTimeFormat||e.defaultTimeFormat,o=e.forcedTimeText??og(a,r,e.slicedStart,e.slicedEnd,e.isStart,e.isEnd,n,e.defaultDisplayEventTime,e.defaultDisplayEventEnd),[l,c,u]=ug(r,n),h=this.buildPublicEvent(n,r.def,r.instance),g=!e.disableDragging&&ag(r,n),m=/row|column/.test(e.display),v={event:h,isNarrow:e.isNarrow||!1,isShort:e.isShort||!1,timeText:o},p={event:h,view:n.viewApi,timeText:o,color:i.color||s.eventColor,contrastColor:i.contrastColor||s.eventContrastColor,isDraggable:g,isStartResizable:!e.disableResizing&&e.isStart&&i.durationEditable&&s.eventResizableFromStart,isEndResizable:!e.disableResizing&&e.isEnd&&i.durationEditable,isMirror:e.isMirror,isStart:!!e.isStart,isEnd:!!e.isEnd,isFirst:!!e.isFirst,isLast:!!e.isLast,isPast:!!e.isPast,isFuture:!!e.isFuture,isToday:!!e.isToday,isSelected:!!e.isSelected,isDragging:!!e.isDragging,isResizing:!!e.isResizing,isInteractive:u,isNarrow:e.isNarrow||!1,isShort:e.isShort||!1,level:e.level||0,timeClass:b(R(s.eventTimeClass,v),m&&R(s.blockEventTimeClass,v),e.display==="row"&&R(s.rowEventTimeClass,v),e.display==="column"&&R(s.columnEventTimeClass,v),e.display==="list-item"&&R(s.listItemEventTimeClass,v)),titleClass:b(R(s.eventTitleClass,v),m&&R(s.blockEventTitleClass,v),e.display==="row"&&R(s.rowEventTitleClass,v),e.display==="column"&&R(s.columnEventTitleClass,v),e.display==="list-item"&&R(s.listItemEventTitleClass,v),e.display==="row"&&s.rowEventTitleSticky&&f.stickyS,e.display==="column"&&s.columnEventTitleSticky&&f.stickyT),options:{eventOverlap:!!s.eventOverlap}},y=b(m&&R(s.blockEventClass,p),e.display==="row"&&R(s.rowEventClass,p),e.display==="column"&&R(s.columnEventClass,p),e.display==="list-item"&&R(s.listItemEventClass,p),i.className,e.className,e.display==="column"?f.flexCol:f.flexRow,(r.def.url||g)&&f.cursorPointer,f.internalEvent,e.isMirror&&f.internalEventMirror,g&&f.internalEventDraggable,p.isSelected&&f.internalEventSelected,(p.isStartResizable||p.isEndResizable)&&f.internalEventResizable),D=b(R(s.eventBeforeClass,p),m&&R(s.blockEventBeforeClass,p),e.display==="row"&&R(s.rowEventBeforeClass,p),e.display==="column"&&R(s.columnEventBeforeClass,p),e.display==="list-item"&&R(s.listItemEventBeforeClass,p)),x=b(R(s.eventAfterClass,p),m&&R(s.blockEventAfterClass,p),e.display==="row"&&R(s.rowEventAfterClass,p),e.display==="column"&&R(s.columnEventAfterClass,p),e.display==="list-item"&&R(s.listItemEventAfterClass,p)),C=b(R(s.eventInnerClass,p),m&&R(s.blockEventInnerClass,p),e.display==="row"&&R(s.rowEventInnerClass,p),e.display==="column"&&R(s.columnEventInnerClass,p),e.display==="list-item"&&R(s.listItemEventInnerClass,p),!e.disableLiquid&&f.liquid),E=e.display==="row"&&s.rowEventBeforeContent,T=e.display==="row"&&s.rowEventAfterContent;return d.jsx(q,{tag:l,attrs:{...e.attrs,...c,dir:e.isDragging&&s.direction==="rtl"?"rtl":void 0},className:y,style:{"--fc-event-color":p.color,"--fc-event-contrast-color":p.contrastColor},elRef:this.handleEl,renderProps:p,generatorName:"eventContent",customGenerator:s.eventContent,defaultGenerator:wp,classNameGenerator:s.eventClass,didMount:s.eventDidMount,willUnmount:s.eventWillUnmount,children:N=>d.jsxs(d.Fragment,{children:[!!(p.isSelected&&m)&&d.jsx("div",{className:e.display==="column"?f.hitX:f.hitY}),(D||E)&&d.jsxs("div",{className:b(D,!e.disableZindexes&&f.z1,p.isStartResizable&&b(e.display==="column"?f.cursorResizeT:f.cursorResizeS,f.internalEventResizer,f.internalEventResizerStart)),children:[E&&d.jsx(q,{tag:"div",style:{display:"contents"},attrs:{"aria-hidden":!0},renderProps:p,generatorName:void 0,customGenerator:E}),!!(p.isStartResizable&&p.isSelected)&&d.jsx("div",{className:f.hit})]}),d.jsx(N,{tag:"div",className:b(C,!e.disableZindexes&&f.z0)}),(x||T)&&d.jsxs("div",{className:b(x,!e.disableZindexes&&f.z1,p.isEndResizable&&b(e.display==="column"?f.cursorResizeB:f.cursorResizeE,f.internalEventResizer,f.internalEventResizerEnd)),children:[T&&d.jsx(q,{tag:"div",style:{display:"contents"},attrs:{"aria-hidden":!0},renderProps:p,generatorName:void 0,customGenerator:T}),!!(p.isEndResizable&&p.isSelected)&&d.jsx("div",{className:f.hit})]})]})})}componentDidUpdate(e){this.el&&this.props.eventRange!==e.eventRange&&cn(this.el,this.props.eventRange)}}Ot.addPropsEquality({seg:We});function wp(t){return d.jsxs(d.Fragment,{children:[t.timeText&&d.jsx("div",{className:t.timeClass,children:t.timeText}),d.jsx("div",{className:t.titleClass,children:t.event.title||d.jsx(d.Fragment,{children:" "})})]})}function Cp(t,e){return t.left>=e.left&&t.left<e.right&&t.top>=e.top&&t.top<e.bottom}function Ho(t,e){let n={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)};return n.left<n.right&&n.top<n.bottom?n:!1}function Rp(t,e){return{left:Math.min(Math.max(t.left,e.left),e.right),top:Math.min(Math.max(t.top,e.top),e.bottom)}}function xp(t){return{left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}}function Tp(t,e){return{left:t.left-e.left,top:t.top-e.top}}function Mp(t,e=!1){let n=window.getComputedStyle(t),s=parseInt(n.borderLeftWidth,10)||0,r=parseInt(n.borderRightWidth,10)||0,i=parseInt(n.borderTopWidth,10)||0,a=parseInt(n.borderBottomWidth,10)||0,o=Hp(t),l=o.y-s-r,c=o.x-i-a,u={borderLeft:s,borderRight:r,borderTop:i,borderBottom:a,scrollbarBottom:c,scrollbarLeft:0,scrollbarRight:0};return n.direction==="rtl"?u.scrollbarLeft=l:u.scrollbarRight=l,e&&(u.paddingLeft=parseInt(n.paddingLeft,10)||0,u.paddingRight=parseInt(n.paddingRight,10)||0,u.paddingTop=parseInt(n.paddingTop,10)||0,u.paddingBottom=parseInt(n.paddingBottom,10)||0),u}function Ip(t,e=!1,n){let s=Xs(t),r=Mp(t,e),i={left:s.left+r.borderLeft+r.scrollbarLeft,right:s.right-r.borderRight-r.scrollbarRight,top:s.top+r.borderTop,bottom:s.bottom-r.borderBottom-r.scrollbarBottom};return e&&(i.left+=r.paddingLeft,i.right-=r.paddingRight,i.top+=r.paddingTop,i.bottom-=r.paddingBottom),i}function Xs(t){let e=t.getBoundingClientRect();return{left:e.left+window.scrollX,top:e.top+window.scrollY,right:e.right+window.scrollX,bottom:e.bottom+window.scrollY}}function Np(t){let e=ko(t),n=t.getBoundingClientRect();for(let s of e){let r=Ho(n,s.getBoundingClientRect());if(r)n=r;else return null}return n}function ko(t){let e=[];for(;t instanceof HTMLElement;){let n=window.getComputedStyle(t);if(n.position==="fixed")break;/(auto|scroll)/.test(n.overflow+n.overflowY+n.overflowX)&&e.push(t),t=t.parentNode}return e}function Hp(t){return{x:t.offsetHeight-t.clientHeight,y:t.offsetWidth-t.clientWidth}}class Po{constructor(){this.sliceBusinessHours=k(this._sliceBusinessHours),this.sliceDateSelection=k(this._sliceDateSpan),this.sliceEventStore=k(this._sliceEventStore),this.sliceEventDrag=k(this._sliceInteraction),this.sliceEventResize=k(this._sliceInteraction),this.forceDayIfListItem=!1}sliceProps(e,n,s,r,...i){let{eventUiBases:a}=e,o=this.sliceEventStore(e.eventStore,a,n,s,...i);return{dateSelectionSegs:this.sliceDateSelection(e.dateSelection,n,s,a,r,...i),businessHourSegs:this.sliceBusinessHours(e.businessHours,n,s,r,...i),fgEventSegs:o.fg,bgEventSegs:o.bg,eventDrag:this.sliceEventDrag(e.eventDrag,a,n,s,...i),eventResize:this.sliceEventResize(e.eventResize,a,n,s,...i),eventSelection:e.eventSelection}}sliceNowDate(e,n,s,r,...i){return this._sliceDateSpan({range:{start:e,end:Ge(e,1)},allDay:!1},n,s,{},r,...i)}_sliceBusinessHours(e,n,s,r,...i){return e?this._sliceEventStore(qe(e,Yt(n,!!s),r),{},n,s,...i).bg:[]}_sliceEventStore(e,n,s,r,...i){if(e){let a=ns(e,n,Yt(s,!!r),r);return{bg:this.sliceEventRanges(a.bg,i),fg:this.sliceEventRanges(a.fg,i)}}return{bg:[],fg:[]}}_sliceInteraction(e,n,s,r,...i){if(!e)return null;let a=ns(e.mutatedEvents,n,Yt(s,!!r),r);return{segs:this.sliceEventRanges(a.fg,i),affectedInstances:e.affectedEvents.instances,isEvent:e.isEvent}}_sliceDateSpan(e,n,s,r,i,...a){if(!e)return[];let o=Yt(n,!!s),l=Ae(e.range,o);if(l){e={...e,range:l};let c=eg(e,r,i),u=this.sliceRange(e.range,...a);for(let h of u)h.eventRange=c;return u}return[]}sliceEventRanges(e,n){let s=[];for(let r of e)s.push(...this.sliceEventRange(r,n));return s}sliceEventRange(e,n){let s=e.range;this.forceDayIfListItem&&e.ui.display==="list-item"&&(s={start:s.start,end:te(s.start,1)});let r=this.sliceRange(s,...n);for(let i of r)i.eventRange=e,i.isStart=e.isStart&&i.isStart,i.isEnd=e.isEnd&&i.isEnd;return r}}function Yt(t,e){let n=t.activeRange;return e?n:{start:Ge(n.start,t.slotMinTime.milliseconds),end:Ge(n.end,t.slotMaxTime.milliseconds-864e5)}}class Ks extends Po{constructor(){super(...arguments),this.forceDayIfListItem=!0}sliceRange(e,n){return n.sliceRange(e)}}const kp=new Date(2592e5);function jo(t,e,n,s,r,i){const a=Lo(t,e,n,s,r,i),o=Do(n,i.dateEnv);if(e&&o!=="day")for(const l of a.dataConfigs)wo(l.dateMarker,o,i.dateEnv)&&(l.renderProps.isMajor=!0);return[a]}function Lo(t,e,n,s,r,i,a,o){return{isDateRow:!0,renderConfig:Pp(r,e,i),dataConfigs:jp(t,e,n,s,r,i,a,void 0,void 0,void 0,void 0,o)}}function Pp(t,e,n){const{options:s}=n;return{generatorName:"dayHeaderContent",customGenerator:s.dayHeaderContent,classNameGenerator:s.dayHeaderClass,innerClassNameGenerator:s.dayHeaderInnerClass,didMount:s.dayHeaderDidMount,willUnmount:s.dayHeaderWillUnmount,align:s.dayHeaderAlign,sticky:s._dayHeaderSticky,dayHeaderFormat:t,datesRepDistinctDays:e}}const Ao=[];for(let t=0;t<7;t++)Ao.push(te(new Date(2592e5),t));function jp(t,e,n,s,r,i,a=1,o="",l={},c={},u="",h){const{dateEnv:g,viewApi:m,options:v}=i;return e?t.map((p,y)=>{const D=Je(p,g,n,s),x=h!=null&&!(y%h),C=v.navLinks&&!D.isDisabled&&t.length>1,E={...D,...l,isMajor:x,isSticky:!1,inPopover:!1,hasNavLink:C,view:m},T=vt(i,p);return{key:o+p.toUTCString(),dateMarker:p,renderProps:E,attrs:{"aria-label":T,...D.isToday?{"aria-current":"date"}:{},"data-date":mt(p),...c},innerAttrs:C?yt(i,p,void 0,T):{"aria-hidden":!0},colSpan:a,hasNavLink:C,className:u}}):t.map((p,y)=>{const D=p.getUTCDay(),x=te(kp,D),C={date:g.toDate(p),dow:D,isDisabled:!1,isFuture:!1,isPast:!1,isToday:!1,isOther:!1},E=h!=null&&!(y%h),T={...C,date:Ao[D],isMajor:E,isSticky:!1,inPopover:!1,hasNavLink:!1,view:m,...l},N=ie(g.formatToParts(x,un));return{key:o+String(D),dateMarker:p,renderProps:T,attrs:{"aria-label":N,...c},innerAttrs:{"aria-hidden":!0},colSpan:a,className:u}})}class le{constructor(e,n=!1){this.masterCallback=e,this.ignoreDeletes=n,this.rev="",this.current=new Map,this.callbacks=new Map,this.handleValue=(s,r)=>{let{current:i,callbacks:a}=this;s===null?this.ignoreDeletes||(i.delete(r),a.delete(r)):i.set(r,s),this.rev=Te(),this.masterCallback&&this.masterCallback(s,r)}}createRef(e){let n=this.callbacks.get(e);return n||(n=s=>{this.handleValue(s,e)},this.callbacks.set(e,n)),n}}class Et extends B{constructor(){super(...arguments),this.elRef=w.createRef()}render(){return d.jsx("div",{ref:this.elRef})}componentDidMount(){this._isUnmounting=!1;const{props:e}=this,n=this.elRef.current;this.disconnectWidth=Zs(n,s=>{this._isUnmounting||L(e.widthRef,s)})}componentWillUnmount(){this._isUnmounting=!0,this.disconnectWidth();const{props:e}=this;e.widthRef&&L(e.widthRef,null)}}function _e(t){return In(t)+":"+t.start+(t.standinFor?":standin":t.isSlice?":slice":"")}function Qt(t,e){const n=[];for(let s=0;s<e;s++)n[s]=[];for(const s of t)n[s.row].push(s);return n}function ni(t,e){const n=[];if(t){for(let s=0;s<e;s++)n[s]={affectedInstances:t.affectedInstances,isEvent:t.isEvent,segs:[]};for(const s of t.segs)n[s.row].segs.push(s)}else for(let s=0;s<e;s++)n[s]=null;return n}function si(t,e){return{...t,start:e,end:e+1,isStart:t.isStart&&t.start===e,isEnd:t.isEnd&&t.end-1===e,standinFor:t}}class Oo extends B{constructor(){super(...arguments),this.buildPublicEvent=k((e,n,s)=>new $(e,n,s)),this.handleEl=e=>{this.el=e,e&&cn(e,this.props.eventRange)}}render(){const{props:e,context:n}=this,{eventRange:s}=e,{options:r}=n,i=s.ui,a=this.buildPublicEvent(n,s.def,s.instance),o={event:a,isNarrow:e.isNarrow||!1,isShort:e.isShort||!1},l={event:a,view:n.viewApi,timeText:"",color:i.color||r.backgroundEventColor,contrastColor:i.contrastColor,isDraggable:!1,isStartResizable:!1,isEndResizable:!1,isMirror:!1,isStart:e.isStart,isEnd:e.isEnd,isFirst:!1,isLast:!1,isPast:e.isPast,isFuture:e.isFuture,isToday:e.isToday,isSelected:!1,isDragging:!1,isResizing:!1,isInteractive:!1,level:0,isNarrow:e.isNarrow||!1,isShort:e.isShort||!1,timeClass:"",titleClass:R(r.backgroundEventTitleClass,o),options:{eventOverlap:!!r.eventOverlap}},c=b(i.className,f.fill,f.internalEvent,f.internalBgEvent,e.isVertical?f.flexCol:f.flexRow),u=b(R(r.backgroundEventInnerClass,l),f.liquid);return d.jsx(q,{tag:"div",className:c,style:{"--fc-event-color":l.color,"--fc-event-contrast-color":l.contrastColor},defaultGenerator:Lp,elRef:this.handleEl,renderProps:l,generatorName:"backgroundEventContent",customGenerator:r.backgroundEventContent,classNameGenerator:r.backgroundEventClass,didMount:r.backgroundEventDidMount,willUnmount:r.backgroundEventWillUnmount,children:h=>d.jsx(h,{tag:"div",className:u})})}componentDidUpdate(e){this.el&&this.props.eventRange!==e.eventRange&&cn(this.el,this.props.eventRange)}}function Lp(t){let{title:e}=t.event;return e&&d.jsx("div",{className:t.titleClass,children:t.event.title})}function Wo(t,e){return d.jsx("div",{className:b(t==="non-business"?e.nonBusinessHoursClass:t==="highlight"?e.highlightClass:void 0,f.fill)})}const Gn=10,Ap=1;class Op extends ye{constructor(){super(...arguments),this.getDateMeta=k(Je),this.closeRef=w.createRef(),this.focusStartRef=w.createRef(),this.focusEndRef=w.createRef(),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,useEventCenter:!1}):this.context.unregisterInteractiveComponent(this)},this.handleDocumentMouseDown=e=>{const n=To(e);this.rootEl.contains(n)||this.handleClose()},this.handleDocumentKeyDown=e=>{e.key==="Escape"&&this.handleClose()},this.handleClose=()=>{let{onClose:e}=this.props;e&&e()}}render(){let{props:e,context:n}=this,{options:s,dateEnv:r,viewApi:i}=n,{startDate:a,todayRange:o,dateProfile:l}=e,c=this.getDateMeta(a,r,l,o),u=r.formatToParts(a,s.popoverFormat),h=ie(u);const g={...c,isMajor:!1,isNarrow:!1,isSticky:!1,inPopover:!0,level:0,hasNavLink:!1,text:h,textParts:u,get weekdayText(){return Ht(u)},get dayNumberText(){return kt(u)},view:i},m={...c,isMajor:!1,isNarrow:!1,inPopover:!0,hasNavLink:!1,get weekdayText(){return Ht(u)},get dayNumberText(){return kt(u)},get monthText(){return Mo(u)},view:i,text:"",textParts:[],options:{businessHours:!!s.businessHours}},v=mt(a),{dayHeaderAlign:p}=s,y=typeof p=="function"?p({level:0,inPopover:!0,isNarrow:!1}):p,D=Nt(e.alignEl);return Rt.createPortal(d.jsxs("div",{"data-date":v,id:e.id,role:"dialog","aria-labelledby":e.titleId,className:b(s.popoverClass,f.flexCol,f.popoverZ,f.abs,f.borderBoxRoot,f.internalPopover),style:{top:0,left:0},dir:D?"rtl":void 0,"data-color-scheme":s.colorScheme||void 0,ref:this.handleRootEl,children:[d.jsx("div",{tabIndex:0,style:{outline:"none"},ref:this.focusStartRef}),d.jsxs("div",{className:b(R(s.dayHeaderClass,g),f.flexCol,f.borderOnlyB,y==="center"?f.alignCenter:y==="end"?f.alignEnd:f.alignStart),children:[d.jsx("div",{children:d.jsx(q,{tag:"div",attrs:{id:e.titleId},generatorName:"dayHeaderContent",renderProps:g,customGenerator:s.dayHeaderContent,defaultGenerator:Wp,classNameGenerator:s.dayHeaderInnerClass,didMount:s.dayHeaderDidMount,willUnmount:s.dayHeaderWillUnmount})}),d.jsx(q,{tag:"button",attrs:{"aria-label":s.closeHint,...Ps(this.handleClose)},elRef:this.closeRef,className:b(s.popoverCloseClass,f.flexRow,f.cursorPointer),renderProps:{},customGenerator:s.popoverCloseContent,generatorName:"popoverCloseContent"})]}),d.jsx("div",{className:b(R(s.dayCellClass,m),f.flexCol,f.borderNone),children:d.jsx("div",{className:R(s.dayCellInnerClass,m),children:e.children})}),d.jsx("div",{tabIndex:0,style:{outline:"none"},ref:this.focusEndRef})]}),xo(e.alignEl))}queryHit(e,n,s,r,i){let{rootEl:a,props:o}=this;return n>=0&&n<r&&s>=0&&s<i?{dateProfile:o.dateProfile,dateSpan:{allDay:!o.forceTimed,range:{start:o.startDate,end:o.endDate},...o.dateSpanProps},getDayEl:()=>a,rect:{left:0,top:0,right:r,bottom:i},layer:1}:null}componentDidMount(){document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown),this.focusStartRef.current.addEventListener("focus",this.handleClose),this.focusEndRef.current.addEventListener("focus",this.handleClose),this.closeRef.current.focus({preventScroll:!0}),this.updateSize()}componentWillUnmount(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown),this.focusStartRef.current.removeEventListener("focus",this.handleClose),this.focusEndRef.current.removeEventListener("focus",this.handleClose)}updateSize(){let{alignEl:e,alignParentTop:n}=this.props,{rootEl:s}=this;const r=Nt(e),i=Np(e);if(i){let a=s.getBoundingClientRect(),o=n?e.closest(n).getBoundingClientRect().top-Ap:i.top,l=r?i.right-a.width:i.left;o=Math.max(o,Gn),l=Math.min(l,document.documentElement.clientWidth-Gn-a.width),l=Math.max(l,Gn);const{offsetParent:c}=s;let u,h;if(!c||c===document.body)u=o+window.scrollY,h=l+window.scrollX;else{const g=c.getBoundingClientRect();u=o-g.top+c.scrollTop,h=l-g.left+c.scrollLeft}Jt(s,{top:u,left:h})}}}function Wp(t){return t.text}function Bp(t,e){return t.end>e.start&&t.start<e.end}function ri(t,e){const n=Math.max(t.start,e.start),s=Math.min(t.end,e.end);if(n<s)return{start:n,end:s,isStart:t.isStart&&n===t.start,isEnd:t.isEnd&&s===t.end}}function _p(t,e){return{start:Math.min(t.start,e.start),end:Math.max(t.end,e.end)}}function ds(t){return t.end}function Bo(t){return t.reduce(Fp).eventRange.range.start}function Up(t){return t.reduce(Vp).eventRange.range.end}function Fp(t,e){return t.eventRange.range.start<e.eventRange.range.start?t:e}function Vp(t,e){return t.eventRange.range.end>e.eventRange.range.end?t:e}class _o extends B{constructor(){super(...arguments),this.state={isPopoverOpen:!1},this.handleLinkEl=e=>{this.linkEl=e,this.props.elRef&&L(this.props.elRef,e)},this.handleClick=e=>{let{props:n,context:s}=this,{dateEnv:r,options:i}=s,{moreLinkClick:a}=i,o=ii(n).start;function l(c){let{def:u,instance:h,range:g}=c.eventRange;return{event:new $(s,u,h),start:r.toDate(g.start),end:r.toDate(g.end),isStart:c.isStart,isEnd:c.isEnd}}typeof a=="function"&&(a=a({date:r.toDate(o),allDay:!!n.allDayDate,allSegs:n.segs.map(l),hiddenSegs:n.hiddenSegs.map(l),jsEvent:e,view:s.viewApi})),!a||a==="popover"?this.setState({isPopoverOpen:!0}):typeof a=="string"&&s.calendarApi.zoomTo(o,a)},this.handlePopoverClose=()=>{this.linkEl&&this.linkEl.focus(),this.setState({isPopoverOpen:!1})}}render(){let{props:e,state:n}=this;return d.jsx(Me.Consumer,{children:s=>{let{viewApi:r,options:i,calendarApi:a,baseId:o}=s,{moreLinkText:l}=i,c=e.hiddenSegs.length,u=ii(e),h=o+"popover-"+u.start.toISOString(),g=`+${c}`,m=typeof l=="function"?l.call(a,c):`${g} ${l}`,v=ue(i.moreLinkHint,[c],m),p={num:c,numericText:g,longText:m,text:e.isMicro||e.display==="column"?g:m,isNarrow:e.isNarrow,view:r};return d.jsxs(d.Fragment,{children:[!!c&&d.jsx(q,{tag:"div",elRef:this.handleLinkEl,className:b(R(e.display==="row"?i.rowMoreLinkClass:i.columnMoreLinkClass,p),e.className,e.display==="row"?f.flexRow:f.flexCol,f.internalMoreLink,f.cursorPointer),style:e.style,attrs:{...e.attrs,...Ps(this.handleClick),title:v,role:"button","aria-haspopup":"dialog","aria-expanded":n.isPopoverOpen,"aria-controls":n.isPopoverOpen?h:void 0},renderProps:p,generatorName:"moreLinkContent",customGenerator:i.moreLinkContent,defaultGenerator:zp,classNameGenerator:i.moreLinkClass,didMount:i.moreLinkDidMount,willUnmount:i.moreLinkWillUnmount,children:y=>d.jsx(y,{tag:"div",className:b(R(i.moreLinkInnerClass,p),R(e.display==="row"?i.rowMoreLinkInnerClass:i.columnMoreLinkInnerClass,p),e.display==="row"?f.stickyS:f.stickyT)})}),n.isPopoverOpen&&d.jsx(Op,{id:h,titleId:h+"-title",startDate:u.start,endDate:u.end,dateProfile:e.dateProfile,todayRange:e.todayRange,dateSpanProps:e.dateSpanProps,alignEl:e.alignElRef?e.alignElRef.current:this.linkEl,alignParentTop:e.alignParentTop,forceTimed:e.forceTimed,onClose:this.handlePopoverClose,children:e.popoverContent()})]})}})}}function zp(t){return t.text}function ii(t){return t.allDayDate?{start:t.allDayDate,end:te(t.allDayDate,1)}:{start:Bo(t.hiddenSegs),end:Up(t.hiddenSegs)}}const Uo=V({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"});function Fo(t){let{display:e}=t.eventRange.ui;return e==="list-item"||e==="auto"&&!t.eventRange.def.allDay&&t.end-t.start===1&&t.isStart&&t.isEnd}class Gp extends B{render(){let{props:e}=this;return d.jsx(_o,{display:"row",className:e.className,isNarrow:e.isNarrow,isMicro:e.isMicro,dateProfile:e.dateProfile,todayRange:e.todayRange,allDayDate:e.allDayDate,segs:e.segs,hiddenSegs:e.hiddenSegs,alignElRef:e.alignElRef,alignParentTop:e.alignParentTop,dateSpanProps:e.dateSpanProps,popoverContent:()=>d.jsx(d.Fragment,{children:e.segs.map(n=>{let{eventRange:s}=n,{instanceId:r}=s.instance,i=!!(e.eventDrag&&e.eventDrag.affectedInstances[r]),a=!!(e.eventResize&&e.eventResize.affectedInstances[r]),o=i||a;return d.jsx("div",{style:{visibility:o?"hidden":void 0},children:d.jsx(Ot,{display:Fo(n)?"list-item":"row",eventRange:s,isStart:n.isStart,isEnd:n.isEnd,isDragging:i,isResizing:a,isMirror:!1,isSelected:r===e.eventSelection,defaultTimeFormat:Uo,defaultDisplayEventEnd:!1,...$e(s,e.todayRange)})},r)})})})}}class Yp extends ye{constructor(){super(...arguments),this.getDateMeta=k(Je),this.refineRenderProps=Ct(Zp),this.rootElRef=w.createRef(),this.handleBodyEl=e=>{this.disconnectBodyHeight&&(this.disconnectBodyHeight(),this.disconnectBodyHeight=void 0,L(this.props.headerHeightRef,null),L(this.props.mainHeightRef,null)),e&&(this.disconnectBodyHeight=St(e,(n,s)=>{if(this._isUnmounting)return;const{props:r}=this,i=e.getBoundingClientRect(),a=this.rootElRef.current.getBoundingClientRect(),o=i.top-a.top;as(this.headerHeight,o)||(this.headerHeight=o,L(r.headerHeightRef,o)),r.fgLiquidHeight&&L(r.mainHeightRef,s)}))}}render(){let{props:e,context:n}=this,{options:s,dateEnv:r}=n;const i=e.showDayNumber&&$p(e.date,e.dateProfile.currentRange,r),a=this.getDateMeta(e.date,r,e.dateProfile,e.todayRange),o=b(e.borderStart?f.borderOnlyS:f.borderNone,e.width!=null?"":f.liquid,f.flexCol,f.noMargin,f.noPadding),l=s.navLinks,c=this.refineRenderProps({date:e.date,isMajor:e.isMajor,isNarrow:e.isNarrow,dateMeta:a,hasLabel:e.showDayNumber,hasMonthLabel:i,hasNavLink:l,renderProps:e.renderProps,viewApi:n.viewApi,dateEnv:n.dateEnv,monthStartFormat:s.monthStartFormat,dayCellFormat:s.dayCellFormat,businessHours:!!s.businessHours});if(a.isDisabled)return d.jsx("div",{role:"gridcell","aria-disabled":!0,className:b(R(s.dayCellClass,c),e.className,o),style:{width:e.width}});const u=vt(n,e.date);return d.jsx(q,{tag:"div",elRef:this.rootElRef,className:b(e.className,o),attrs:{...e.attrs,role:"gridcell","aria-label":u,...c.isToday?{"aria-current":"date"}:{},"data-date":mt(e.date)},style:{width:e.width},renderProps:c,generatorName:"dayCellTopContent",customGenerator:s.dayCellTopContent,defaultGenerator:qp,classNameGenerator:s.dayCellClass,didMount:s.dayCellDidMount,willUnmount:s.dayCellWillUnmount,children:h=>d.jsxs(d.Fragment,{children:[d.jsx("div",{className:b(f.rel,R(s.dayCellTopClass,c)),children:e.showDayNumber&&d.jsx(h,{tag:"div",attrs:l?yt(n,e.date,void 0,u):{"aria-hidden":!0},className:R(s.dayCellTopInnerClass,c)})}),d.jsxs("div",{className:b(f.flexCol,e.fgLiquidHeight?f.liquid:f.grow),ref:this.handleBodyEl,children:[d.jsx("div",{className:R(s.dayCellInnerClass,c),style:{minHeight:e.fgHeight},children:e.fg}),d.jsx(Gp,{className:f.rel,allDayDate:e.date,segs:e.segs,hiddenSegs:e.hiddenSegs,alignElRef:this.rootElRef,alignParentTop:e.showDayNumber?"[role=row]":`.${f.internalView}`,dateSpanProps:e.dateSpanProps,dateProfile:e.dateProfile,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,todayRange:e.todayRange,isNarrow:e.isNarrow,isMicro:e.isMicro})]}),d.jsx("div",{className:b(f.rel,R(s.dayCellBottomClass,c))})]})})}componentDidMount(){this._isUnmounting=!1}componentWillUnmount(){this._isUnmounting=!0}}function qp(t){return t.text||d.jsx(d.Fragment,{children:" "})}function $p(t,e,n){const{start:s,end:r}=e,i=Ge(r,-1),a=n.getYear(s),o=n.getMonth(s),l=n.getYear(i),c=n.getMonth(i);return!(a===l&&o===c)&&(t.valueOf()===s.valueOf()||n.getDay(t)===1&&t.valueOf()<r.valueOf())}function Zp(t){let{date:e,dateEnv:n,hasLabel:s,hasMonthLabel:r,hasNavLink:i,businessHours:a}=t,o=[],l="";return s&&(o=n.formatToParts(e,r?t.monthStartFormat:t.dayCellFormat),l=ie(o)),{...t.dateMeta,...t.renderProps,text:l,textParts:o,isMajor:t.isMajor,isNarrow:t.isNarrow,inPopover:!1,hasNavLink:i,get weekdayText(){return Ht(o)},get dayNumberText(){return kt(o)},get monthText(){return Mo(o)},options:{businessHours:a},view:t.viewApi}}class us{constructor(e,n=l=>1,s=!1,r,i,a=!1,o=!1){this.getSegThickness=n,this.strictOrder=s,this.maxCoord=r,this.maxDepth=i,this.hiddenConsumes=a,this.allowSlicing=o,this.placementsByLevel=[],this.levelCoords=[],this.hiddenSegs=[];for(const l of e)this.insertSeg(l,this.getSegThickness(l))}insertSeg(e,n,s){if(n!=null){const r=this.findInsertion(e,n);if(this.isInsertionValid(r,n))this.insertSegAt(e,r,n,s);else{const{touchingPlacement:i}=r;if(i){if(this.hiddenConsumes&&!i.isZombie&&(i.isZombie=!0,this.hiddenSegs.push(i),this.allowSlicing)){const a=Object.assign({},i);Object.assign(i,ri(i,e)),i.isSlice=!0,this.splitSeg(a,i.thickness,i)}this.allowSlicing?(this.hiddenSegs.push({...e,...ri(e,i)}),this.splitSeg(e,n,i)):this.hiddenSegs.push(e)}else this.hiddenSegs.push(e)}}}isInsertionValid(e,n){return(this.maxCoord==null||e.levelCoord+n<=this.maxCoord)&&(this.maxDepth==null||e.depth<this.maxDepth)}splitSeg(e,n,s){e.start<s.start&&this.insertSeg({...e,end:s.start,isEnd:!1},n,!0),e.end>s.end&&this.insertSeg({...e,start:s.end,isStart:!1},n,!0)}insertSegAt(e,n,s,r){const i={...e,thickness:s,depth:n.depth,isSlice:r||e.isSlice||!1,isZombie:!1};n.lateralIndex===-1?(Yn(this.placementsByLevel,n.levelIndex,[i]),Yn(this.levelCoords,n.levelIndex,n.levelCoord)):Yn(this.placementsByLevel[n.levelIndex],n.lateralIndex,i)}findInsertion(e,n){let{placementsByLevel:s,levelCoords:r}=this,i=s.length,a=0,o,l,c=0;for(let g=0;g<i;g+=1){const m=r[g];if(!this.strictOrder&&m>=a+n)break;let v=s[g],p,[y,D]=hs(v,e.start,ds),x=y+D;for(;(p=v[x])&&p.start<e.end;){let C=m+p.thickness;C>a&&(a=C,o=p,l=g),C===a&&(c=Math.max(c,p.depth+1)),x+=1}}let u=0;if(o)for(u=l+1;u<i&&r[u]<a;)u+=1;let h=-1;return u<i&&r[u]===a&&([h]=hs(s[u],e.end,ds)),{touchingPlacement:o,levelCoord:a,levelIndex:u,lateralIndex:h,depth:c}}traverseSegs(e){const{placementsByLevel:n,levelCoords:s}=this;for(let r=0;r<n.length;r++){const i=n[r],a=s[r];for(const o of i)o.isZombie||e(o,a)}}}function Xp(t){let e=[];for(let n of t){let s=[],r={segs:[n],start:n.start,end:n.end};for(let i of e)Bp(i,r)?r={..._p(i,r),segs:i.segs.concat(r.segs)}:s.push(i);s.push(r),e=s}return e.map(n=>({key:_a(Bo(n.segs)),...n}))}function Yn(t,e,n){t.splice(e,0,n)}function hs(t,e,n){let s=0,r=t.length;if(!r||e<n(t[s]))return[0,0];if(e>n(t[r-1]))return[r,0];for(;s<r;){let i=Math.floor(s+(r-s)/2),a=n(t[i]);if(e<a)r=i;else if(e>a)s=i+1;else return[i,1]}return[s,0]}function Kp(t,e,n,s,r,i=!0,a,o){let l,c,u;a===!0||o===!0?(l=s,u=!0):typeof a=="number"?(c=a,u=!1):typeof o=="number"&&(c=o,u=!0);const h=new Map,g=new Map,m=new Map,v=new Map;let p=new us(t,E=>e.get(_e(E)),r,l,c,u,i);p.traverseSegs((E,T)=>{qn(h,E),m.set(_e(E),T),E.isSlice&&v.set(E.eventRange,!0)});for(const E of p.hiddenSegs)qn(g,E);if(v.size){m.clear(),p=new us(Jp(t,h),E=>e.get(_e(E)),r,l,c,u),p.traverseSegs((E,T)=>{m.set(_e(E),T)});for(const E of p.hiddenSegs)qn(g,E)}const y=[],D=[],x=[],C=[];for(let E=0;E<n.length;E++)y.push([]),D.push([]),x.push([]),C.push(0);for(const E of t){const{eventRange:T}=E,N=h.get(T)||[],I=g.get(T)||[],P=v.get(T)||!1;if(x[E.start].push(E),P)for(const H of N)x[H.start].push(H);for(const H of N){for(let U=H.start;U<H.end;U++){const F=si(H,U);y[U].push(F)}const j=_e(H),G=m.get(j);if(G!=null){const U=e.get(j);for(let F=H.start;F<H.end;F++)C[F]=Math.max(C[F],G+U)}}for(const H of I)for(let j=H.start;j<H.end;j++){const G=si(H,j);y[j].push(G),D[j].push(G)}}return[y,D,x,m,C]}function qn(t,e){let n=t.get(e.eventRange);n||t.set(e.eventRange,n=[]),n.push(e)}function Jp(t,e){const n=[];for(const s of t)n.push(...e.get(s.eventRange)||[]);return n}class Vo{constructor(e,n){let s=e.start,{end:r}=e,i=[],a=[],o=-1;for(;s<r;)n.isHiddenDay(s)?i.push(o+.5):(o+=1,i.push(o),a.push(s)),s=te(s,1);this.dates=a,this.indices=i,this.cnt=a.length}sliceRange(e){let n=this.getDateDayIndex(e.start),s=this.getDateDayIndex(te(e.end,-1)),r=Math.max(0,n),i=Math.min(this.cnt-1,s);return r=Math.ceil(r),i=Math.floor(i),r<=i?{start:r,end:i+1,isStart:n===r,isEnd:s===i}:null}getDateDayIndex(e){let{indices:n}=this,s=Math.floor(Xe(this.dates[0],e));return s<0?n[0]-1:s>=n.length?n[n.length-1]+1:n[s]}}class zo{constructor(e,n,s,r=""){this.dateEnv=s,this.majorUnit=r;let{dates:i}=e,a,o,l;if(n){for(o=i[0].getUTCDay(),a=1;a<i.length&&i[a].getUTCDay()!==o;a+=1);l=Math.ceil(i.length/a)}else l=1,a=i.length;this.rowCount=l,this.colCount=a,this.daySeries=e,this.cellRows=this.buildCells(),this.headerDates=this.buildHeaderDates()}buildCells(){let e=[];for(let n=0;n<this.rowCount;n+=1){let s=[];for(let r=0;r<this.colCount;r+=1)s.push(this.buildCell(n,r));e.push(s)}return e}buildCell(e,n){let s=this.daySeries.dates[e*this.colCount+n];return{key:s.toISOString(),date:s,isMajor:this.cellIsMajor(s)}}cellIsMajor(e){return this.majorUnit?wo(e,this.majorUnit,this.dateEnv):!1}buildHeaderDates(){let e=[];for(let n=0;n<this.colCount;n+=1)e.push(this.cellRows[0][n].date);return e}sliceRange(e){let{colCount:n}=this,s=this.daySeries.sliceRange(e),r=[];if(s){const{start:i,end:a}=s;let o=i;for(;o<a;){let l=Math.floor(o/n),c=Math.min((l+1)*n,a);r.push({row:l,start:o%n,end:(c-1)%n+1,isStart:s.isStart&&o===i,isEnd:s.isEnd&&c===a}),o=c}}return r}}function Go(t,e,n){const s=new Vo(t.renderRange,e),r=/year|month|week/.test(t.currentRangeUnit),i=!r&&Do(t,n);return new zo(s,r,n,i!=="day"?i:void 0)}function Yo(t,e,n){return n==null?[void 0,void 0]:n/t<e?[e*t,e]:[n,void 0]}function Qp(t,e,n){let s=0;for(const r of e){const i=r[0].key,a=r[0].date,o=r[r.length-1].date;if(t>=a&&t<=o)return s;const l=n.get(i);if(l==null)return;s+=l}return s}function ai(t,e,n){let s,r;if(e!=null)s=t.start*e,r=(n-t.end)*e;else{const i=1/n;s=Mt(t.start*i),r=Mt(1-t.end*i)}return{insetInlineStart:s,insetInlineEnd:r}}function Js(t,e,n,s,r){const i=n??e/s,a=Math.floor(t/i),o=r?s-a-1:a,l=a*i,c=l+i;return{col:o,left:l,right:c}}function ev(t,e,n){let s=0,r=0,i=0;for(const a of e){const o=a[0].key;if(r=i,i=r+n.get(o),t<i)break;s++}return{row:s,top:r,bottom:i}}function tv(t,e){return t.querySelectorAll("[role=row]")[e]}function Qs(t,e){return t.querySelectorAll("[role=gridcell]")[e]}const Wt=60,nv=V({weekday:"narrow"});function er(t,e,n){return t||sv(e,n)}function sv(t,e){return t?e>1?V({weekday:"short",weekdayJustify:"start",day:"numeric",omitCommas:!0,omitTrailing:!0}):V({weekday:"long",weekdayJustify:"start",day:"numeric",omitCommas:!0,omitTrailing:!0}):V({weekday:"short"})}class rv extends w.Component{constructor(){super(...arguments),this.rootElRef=w.createRef()}render(){const{props:e}=this;return d.jsx("div",{className:b(e.className,f.abs),style:e.style,ref:this.rootElRef,children:e.children})}componentDidMount(){this._isUnmounting=!1;const e=this.rootElRef.current;this.disconnectHeight=dt(e,n=>{this._isUnmounting||L(this.props.heightRef,n)})}componentWillUnmount(){this._isUnmounting=!0,this.disconnectHeight(),L(this.props.heightRef,null)}}const iv=V({week:"narrow"});class qo extends B{constructor(){super(...arguments),this.headerHeightRefMap=new le(()=>{re(this.handleSegPositioning)}),this.mainHeightRefMap=new le(()=>{(this.props.dayMaxEvents===!0||this.props.dayMaxEventRows===!0)&&re(this.handleSegPositioning)}),this.segHeightRefMap=new le(()=>{re(this.handleSegPositioning)}),this.buildWeekNumberRenderProps=k(av),this.handleRootEl=e=>{this.rootEl=e,L(this.props.rootElRef,e)},this.handleSegPositioning=()=>{this._isUnmounting||this.forceUpdate()}}render(){const{props:e,context:n,headerHeightRefMap:s,mainHeightRefMap:r}=this,{cells:i}=e,{options:a}=n,o=e.cells[0].date,l=e.dayMaxEvents===!0||e.dayMaxEventRows===!0,c=zs(e.fgEventSegs,a.eventOrder),[u,h]=this.computeFgDims(),[g,m,v,p,y]=Kp(c,this.segHeightRefMap.current,i,l?h:void 0,a.eventOrderStrict,a.eventSlicing,e.dayMaxEvents,e.dayMaxEventRows),D=[];if(u!=null){let I=0;for(const P of i){const H=s.current.get(P.key);if(H!=null){const j=u-H;D.push(y[I]+j)}else D.push(void 0);I++}}const x=this.getHighlightSegs(),C=this.getMirrorSegs(),E=a.navLinks,T=vt(n,o,"week"),N=this.buildWeekNumberRenderProps(o,n,e.cellIsNarrow,E);return d.jsxs("div",{role:e.role,"aria-label":e.role==="row"?T:void 0,className:b(a.dayRowClass,e.className,f.flexRow,f.rel,f.isolate,e.forPrint&&e.basis!==void 0&&f.printSiblingRow),style:{flexBasis:e.basis},ref:this.handleRootEl,children:[e.showWeekNumbers&&!e.cellIsMicro&&d.jsx(q,{tag:"div",attrs:{...E?yt(n,o,"week",T,!1):{},role:void 0,"aria-hidden":!0},className:f.z1,renderProps:N,generatorName:"inlineWeekNumberContent",customGenerator:a.inlineWeekNumberContent,defaultGenerator:Nn,classNameGenerator:a.inlineWeekNumberClass,didMount:a.inlineWeekNumberDidMount,willUnmount:a.inlineWeekNumberWillUnmount}),this.renderFillSegs(e.businessHourSegs,"non-business"),this.renderFillSegs(e.bgEventSegs,"bg-event"),this.renderFillSegs(x,"highlight"),e.cells.map((I,P)=>{const H=this.renderFgSegs(u,v[P],p,e.todayRange,!1);return d.jsx(Yp,{dateProfile:e.dateProfile,todayRange:e.todayRange,date:I.date,isMajor:I.isMajor,showDayNumber:e.showDayNumbers,isNarrow:e.cellIsNarrow,isMicro:e.cellIsMicro,borderStart:!!P,segs:g[P],hiddenSegs:m[P],fgLiquidHeight:l,fg:d.jsx(d.Fragment,{children:H}),eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,renderProps:I.renderProps,dateSpanProps:I.dateSpanProps,attrs:I.attrs,className:I.className,fgHeight:D[P],width:e.colWidth,headerHeightRef:s.createRef(I.key),mainHeightRef:r.createRef(I.key)},I.key)}),this.renderFgSegs(u,C,p,e.todayRange,!0)]})}renderFgSegs(e,n,s,r,i){const{props:a,segHeightRefMap:o}=this,{colWidth:l,eventSelection:c,cellIsMicro:u}=a,h=a.cells.length,g=a.cells.length===1,m=[];for(const v of n){const p=_e(v),{standinFor:y,eventRange:D}=v,{instanceId:x}=D.instance;if(y)continue;const{insetInlineStart:C,insetInlineEnd:E}=ai(v,l,h),T=s.get(y?_e(y):p)??(i?0:void 0),N=e!=null&&T!=null?e+T:void 0,I=!!(a.eventDrag&&a.eventDrag.affectedInstances[x]),P=!!(a.eventResize&&a.eventResize.affectedInstances[x]),H=!i&&(I||P||y||N==null),j=Fo(v),G=x===c;m.push(d.jsx(rv,{className:v.start?f.fakeBorderS:"",style:{visibility:H?"hidden":void 0,top:N,insetInlineStart:C,insetInlineEnd:E,zIndex:G?1e3:0},heightRef:!y&&!i?o.createRef(p):null,children:d.jsx(Ot,{display:j?"list-item":"row",eventRange:D,isStart:v.isStart,isEnd:v.isEnd,isDragging:I,isResizing:P,isMirror:i,isSelected:G,isNarrow:a.cellIsNarrow,defaultTimeFormat:Uo,defaultDisplayEventEnd:g,disableResizing:j,forcedTimeText:u?"":void 0,...$e(D,r)})},p))}return m}renderFillSegs(e,n){const{props:s,context:r}=this,{todayRange:i,colWidth:a}=s,o=s.cells.length,l=[];for(const c of e){const u=c.start+":"+c.end,{insetInlineStart:h,insetInlineEnd:g}=ai(c,a,o),m=!c.standinFor;l.push(d.jsx("div",{className:f.fillY,style:{visibility:m?"":"hidden",insetInlineStart:h,insetInlineEnd:g},children:n==="bg-event"?d.jsx(Oo,{eventRange:c.eventRange,isStart:c.isStart,isEnd:c.isEnd,isNarrow:s.cellIsNarrow,isVertical:!1,...$e(c.eventRange,i)}):Wo(n,r.options)},u))}return d.jsx(d.Fragment,{children:l})}componentDidMount(){this._isUnmounting=!1;const{rootEl:e}=this;this.disconnectHeight=dt(e,n=>{L(this.props.heightRef,n)})}componentWillUnmount(){this._isUnmounting=!0,this.disconnectHeight(),L(this.props.heightRef,null)}computeFgDims(){const{cells:e}=this.props,n=this.headerHeightRefMap.current,s=this.mainHeightRefMap.current;let r,i;for(const a of e){const o=n.get(a.key),l=s.get(a.key);if(o!=null&&((r===void 0||o>r)&&(r=o),l!=null)){const c=o+l;(i===void 0||c<i)&&(i=c)}}return[r,i!=null&&r!=null?i-r:void 0]}getMirrorSegs(){let{props:e}=this;return e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:[]}getHighlightSegs(){let{props:e}=this;return e.eventDrag&&e.eventDrag.segs.length?e.eventDrag.segs:e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:e.dateSelectionSegs}}function av(t,e,n,s){const{dateEnv:r,options:i}=e,a=r.computeWeekNumber(t),o=r.formatToParts(t,i.weekNumberFormat||iv),l=ie(o),c=r.toDate(t);return{num:a,text:l,textParts:o,date:c,isNarrow:n,hasNavLink:s}}class tr extends ye{constructor(){super(...arguments),this.splitBusinessHourSegs=k(Qt),this.splitBgEventSegs=k(lv),this.splitFgEventSegs=k(Qt),this.splitDateSelectionSegs=k(Qt),this.splitEventDrag=k(ni),this.splitEventResize=k(ni),this.rowHeightRefMap=new le((e,n)=>{const{rowHeightRefMap:s}=this.props;s&&s.handleValue(e,n)}),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,isHitComboAllowed:this.props.isHitComboAllowed}):this.context.unregisterInteractiveComponent(this)}}render(){let{props:e,context:n,rowHeightRefMap:s}=this,{options:r}=n,{cellRows:i}=e,a=i.length,o=i[0]?.[0]?.key||"",l=this.splitFgEventSegs(e.fgEventSegs,a),c=this.splitBgEventSegs(e.bgEventSegs,a),u=this.splitBusinessHourSegs(e.businessHourSegs,a),h=this.splitDateSelectionSegs(e.dateSelectionSegs,a),g=this.splitEventDrag(e.eventDrag,a),m=this.splitEventResize(e.eventResize,a),v=fe(r),p=!e.forPrint&&!v,y=cv(e.visibleWidth,a,v,r);return d.jsx("div",{role:"rowgroup",className:b(e.className,!e.forPrint&&f.flexCol),style:{width:e.width},ref:this.handleRootEl,children:i.map((D,x)=>d.jsx(qo,{role:"row",dateProfile:e.dateProfile,todayRange:e.todayRange,cells:D,cellIsNarrow:e.cellIsNarrow,cellIsMicro:e.cellIsMicro,showDayNumbers:a>1,showWeekNumbers:a>1&&r.weekNumbers,forPrint:e.forPrint,className:b(p&&f.grow,a>1&&f.breakInsideAvoid,x<a-1?f.borderOnlyB:f.borderNone),fgEventSegs:l[x],bgEventSegs:c[x],businessHourSegs:u[x],dateSelectionSegs:h[x],eventSelection:e.eventSelection,eventDrag:g[x],eventResize:m[x],dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,colWidth:e.colWidth,basis:y,heightRef:s.createRef(D[0].key)},o+":"+D[0].key))})}queryHit(e,n,s,r){const{props:i}=this,a=i.cellRows[0].length,{col:o,left:l,right:c}=Js(n,r,i.colWidth,a,e),{row:u,top:h,bottom:g}=ev(s,i.cellRows,this.rowHeightRefMap.current),m=i.cellRows[u][o],v=m.date,p=te(v,1);return{dateProfile:i.dateProfile,dateSpan:{range:{start:v,end:p},allDay:!0,...m.dateSpanProps},getDayEl:()=>Qs(tv(this.rootEl,u),o),rect:{left:l,right:c,top:h,bottom:g},layer:0}}}function ov(t){return t.eventRange.def.allDay}function lv(t,e){return Qt(t.filter(ov),e)}function cv(t,e,n,s){if(t!=null){const r=t/s.aspectRatio/6;return e>6||n?r:0}return 0}class dv extends B{constructor(){super(...arguments),this.state={},this.buildDayHeaderText=k(uv),this.handleInnerEl=e=>{this.disconnectSize&&(this.disconnectSize(),this.disconnectSize=void 0),e?this.disconnectSize=St(e,(n,s)=>{this._isUnmounting||(L(this.props.innerHeightRef,s),this.setState({innerWidth:n}))}):L(this.props.innerHeightRef,null)}}render(){const{props:e,state:n,context:s}=this,{renderConfig:r,dataConfig:i}=e,a=e.colWidth!=null?e.colWidth*(i.colSpan||1):void 0,o=i.renderProps.isDisabled,l=r.dayHeaderFormat?this.buildDayHeaderRenderProps(i.renderProps,e.cellIsNarrow,e.rowLevel,e.cellIsMicro,i.dateMarker,r.dayHeaderFormat,!!r.datesRepDistinctDays,s.dateEnv):{...i.renderProps,isNarrow:e.cellIsNarrow,level:e.rowLevel},c=r.align,u=typeof c=="function"?c({level:e.rowLevel,inPopover:i.renderProps.inPopover,isNarrow:e.cellIsNarrow}):c,h=r.sticky,g=e.rowLevel>0&&h!==!1&&(u!=="center"||a!=null&&e.viewportWidth!=null&&a>e.viewportWidth*.75);let m;return g&&(u==="center"?n.innerWidth!=null&&(m=`calc(50% - ${n.innerWidth/2}px)`):m=typeof h=="number"||typeof h=="string"?h:0),d.jsx(q,{tag:"div",attrs:{role:"columnheader","aria-colspan":i.colSpan,...i.attrs},className:b(i.className,f.noMargin,f.noPadding,f.flexCol,e.borderStart?f.borderOnlyS:f.borderNone,u==="center"?f.alignCenter:u==="end"?f.alignEnd:f.alignStart,e.colWidth==null&&f.liquid,!g&&f.crop),style:{width:a},renderProps:l,generatorName:r.generatorName,customGenerator:r.customGenerator,defaultGenerator:Nn,classNameGenerator:o?void 0:r.classNameGenerator,didMount:r.didMount,willUnmount:r.willUnmount,children:v=>d.jsx("div",{ref:this.handleInnerEl,className:b(f.flexCol,f.noShrink,f.whiteSpaceNoWrap,g&&f.sticky),style:{left:m,right:m},children:d.jsx(v,{tag:"div",attrs:i.innerAttrs,className:R(r.innerClassNameGenerator,l)})})})}componentDidMount(){this._isUnmounting=!1}componentWillUnmount(){this._isUnmounting=!0}buildDayHeaderRenderProps(e,n,s,r,i,a,o,l){const c=this.buildDayHeaderText(o?i:e.date,a,o,l),u=r?this.buildDayHeaderText(i,nv,!1,l):c;return{...e,isNarrow:n,level:s,text:u.text,textParts:u.textParts,weekdayText:r?u.text:c.weekdayText,dayNumberText:c.dayNumberText}}}function uv(t,e,n,s){const r=s.formatToParts(t,e);return{text:ie(r),textParts:r,weekdayText:Ht(r),dayNumberText:n?kt(r):""}}class Pn extends B{constructor(){super(...arguments),this.innerHeightRefMap=new le(()=>{re(this.handleInnerHeights)}),this.handleInnerHeights=()=>{if(this._isUnmounting)return;const e=this.innerHeightRefMap.current;let n=0;for(const s of e.values())n=Math.max(n,s);this.currentInnerHeight!==n&&(this.currentInnerHeight=n,L(this.props.innerHeightRef,n))}}render(){const{props:e,context:n}=this,{options:s}=n;return d.jsx("div",{role:e.role,"aria-rowindex":e.rowIndex!=null?1+e.rowIndex:void 0,className:b(s.dayHeaderRowClass,e.className,f.flexRow,f.contentBox,e.borderBottom?f.borderOnlyB:f.borderNone),style:{height:e.height},children:e.dataConfigs.map((r,i)=>d.jsx(dv,{renderConfig:e.renderConfig,dataConfig:r,borderStart:!!i,colWidth:e.colWidth,viewportWidth:e.viewportWidth,innerHeightRef:this.innerHeightRefMap.createRef(r.key),cellIsNarrow:e.cellIsNarrow,cellIsMicro:e.cellIsMicro,rowLevel:e.rowLevel},r.key))})}componentDidMount(){this._isUnmounting=!1}componentWillUnmount(){this._isUnmounting=!0,this.currentInnerHeight=void 0,L(this.props.innerHeightRef,null)}}class $o extends B{render(){const{props:e}=this,{headerTiers:n}=e;return d.jsx("div",{role:"rowgroup",className:b(e.className,f.flexCol,e.width==null&&f.liquid),style:{width:e.width},children:n.map((s,r)=>w.createElement(Pn,{...s,key:r,role:"row",borderBottom:r<n.length-1,colWidth:e.colWidth,viewportWidth:e.viewportWidth,cellIsNarrow:e.cellIsNarrow,cellIsMicro:e.cellIsMicro,rowLevel:n.length-r-1}))})}}class hv extends B{constructor(){super(...arguments),this.state={},this.handleScroller=e=>{L(this.props.scrollerRef,e)},this.handleTotalWidth=e=>{this._isUnmounting||this.setState({totalWidth:e})},this.handleClientWidth=e=>{this._isUnmounting||this.setState({clientWidth:e})}}render(){const{props:e,state:n,context:s}=this,{options:r}=s,{borderlessX:i,borderlessTop:a,borderlessBottom:o}=ve(r),{totalWidth:l,clientWidth:c}=n;let u=l!=null&&c!=null?l-c:void 0;u<3&&(u=0);const h=!e.forPrint&&!fe(r),g=!e.forPrint&&Hn(r),m=e.cellRows[0].length,v=c!=null?c/m:void 0,p=v!=null&&v<=Wt,y=p||v!=null&&v<=r.dayNarrowWidth;return d.jsxs(d.Fragment,{children:[r.dayHeaders&&d.jsxs("div",{className:b(R(r.tableHeaderClass,{isSticky:g,borderlessX:i,borderlessTop:a,borderlessBottom:o,multiMonthColumns:0}),f.printHeader,g&&f.tableHeaderSticky),children:[d.jsxs("div",{className:f.flexRow,children:[d.jsx($o,{headerTiers:e.headerTiers,cellIsNarrow:y,cellIsMicro:p}),!!u&&d.jsx("div",{className:b(R(r.fillerClass,{inTableHeader:!0}),f.borderOnlyS),style:{minWidth:u}})]}),d.jsx("div",{className:R(r.dayHeaderDividerClass,{isSticky:g,multiMonthColumns:0,options:{allDaySlot:!!r.allDaySlot}})})]}),d.jsx(pe,{vertical:h,className:b(R(r.tableBodyClass,{borderlessX:i,borderlessTop:a,borderlessBottom:o,multiMonthColumns:0}),!e.forPrint&&f.flexCol,h&&f.liquid),ref:this.handleScroller,clientWidthRef:this.handleClientWidth,children:d.jsx(tr,{dateProfile:e.dateProfile,todayRange:e.todayRange,cellRows:e.cellRows,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed,className:f.grow,dayMaxEvents:e.forPrint?void 0:r.dayMaxEvents,dayMaxEventRows:r.dayMaxEventRows,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:e.businessHourSegs,dateSelectionSegs:e.dateSelectionSegs,eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,visibleWidth:l,cellIsNarrow:y,cellIsMicro:p,rowHeightRefMap:e.rowHeightRefMap})}),d.jsx(Et,{widthRef:this.handleTotalWidth})]})}componentDidMount(){this._isUnmounting=!1}componentWillUnmount(){this._isUnmounting=!0}}class Zo extends B{constructor(){super(...arguments),this.rootElRef=w.createRef()}render(){const{props:e}=this;return d.jsx("div",{ref:this.rootElRef,className:b(f.footerScrollbar,e.isSticky&&f.footerScrollbarSticky),children:d.jsx(pe,{horizontal:!0,ref:e.scrollerRef,children:d.jsx("div",{style:{minWidth:e.canvasWidth}})})})}componentDidMount(){this._isUnmounting=!1,this.disconnectHeight=dt(this.rootElRef.current,e=>{this._isUnmounting||L(this.props.scrollbarWidthRef,e)})}componentWillUnmount(){this._isUnmounting=!0,this.disconnectHeight(),L(this.props.scrollbarWidthRef,null)}}class fv extends B{constructor(){super(...arguments),this.state={},this.headerScrollerRef=w.createRef(),this.bodyScrollerRef=w.createRef(),this.footerScrollerRef=w.createRef(),this.handleTotalWidth=e=>{this._isUnmounting||this.setState({totalWidth:e})},this.handleClientWidth=e=>{this._isUnmounting||this.setState({clientWidth:e})}}render(){const{props:e,state:n,context:s}=this,{options:r}=s,{borderlessX:i,borderlessTop:a,borderlessBottom:o}=ve(r),{totalWidth:l,clientWidth:c}=n,u=l!=null&&c!=null?l-c:void 0,h=!e.forPrint&&!fe(r),g=!e.forPrint&&Hn(r),m=!e.forPrint&&yo(r),v=e.cellRows[0].length,[p,y]=Yo(v,e.dayMinWidth,c),D=y!=null&&y<=Wt,x=D||y!=null&&y<=r.dayNarrowWidth;return d.jsxs(d.Fragment,{children:[r.dayHeaders&&d.jsxs("div",{className:b(R(r.tableHeaderClass,{isSticky:g,borderlessX:i,borderlessTop:a,borderlessBottom:o,multiMonthColumns:0}),f.printHeader,g&&f.tableHeaderSticky),children:[d.jsxs(pe,{horizontal:!0,hideScrollbars:!0,className:f.flexRow,ref:this.headerScrollerRef,children:[d.jsx($o,{headerTiers:e.headerTiers,colWidth:y,viewportWidth:c,width:p,cellIsNarrow:x,cellIsMicro:D}),!!u&&d.jsx("div",{className:b(R(r.fillerClass,{inTableHeader:!0}),f.borderOnlyS),style:{minWidth:u}})]}),d.jsx("div",{className:R(r.dayHeaderDividerClass,{isSticky:g,multiMonthColumns:0,options:{allDaySlot:!!r.allDaySlot}})})]}),d.jsx(pe,{vertical:h,horizontal:!0,hideScrollbars:m||e.forPrint,className:b(R(r.tableBodyClass,{borderlessX:i,borderlessTop:a,borderlessBottom:o,multiMonthColumns:0}),!e.forPrint&&f.flexCol,h&&f.liquid),ref:this.bodyScrollerRef,clientWidthRef:this.handleClientWidth,children:d.jsx(tr,{dateProfile:e.dateProfile,todayRange:e.todayRange,cellRows:e.cellRows,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed,className:f.grow,dayMaxEvents:e.forPrint?void 0:r.dayMaxEvents,dayMaxEventRows:r.dayMaxEventRows,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:e.businessHourSegs,dateSelectionSegs:e.dateSelectionSegs,eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,colWidth:y,width:p,visibleWidth:l,cellIsNarrow:x,cellIsMicro:D,rowHeightRefMap:e.rowHeightRefMap})}),!!m&&d.jsx(Zo,{isSticky:!0,canvasWidth:p,scrollerRef:this.footerScrollerRef}),d.jsx(Et,{widthRef:this.handleTotalWidth})]})}componentDidMount(){this._isUnmounting=!1;const e=So(this.context.pluginHooks);this.syncedScroller=new e(!0),L(this.props.scrollerRef,this.syncedScroller),this.updateSyncedScroller()}componentDidUpdate(){this.updateSyncedScroller()}componentWillUnmount(){this._isUnmounting=!0,this.syncedScroller.destroy()}updateSyncedScroller(){this.syncedScroller.handleChildren([this.headerScrollerRef.current,this.bodyScrollerRef.current,this.footerScrollerRef.current])}}class gv extends B{constructor(){super(...arguments),this.scrollerRef=w.createRef(),this.rowHeightRefMap=new le(()=>{re(this.updateScrollY)}),this.scrollDate=null,this.updateScrollY=()=>{if(this._isUnmounting)return;const e=this.rowHeightRefMap.current,n=this.scrollerRef.current;if(n&&this.scrollDate){let s=Qp(this.scrollDate,this.props.cellRows,e);s!=null&&(s&&s++,n.scrollTo({y:s}))}},this.handleScrollEnd=e=>{e&&(this.scrollDate=null)}}render(){const{props:e,context:n}=this,{options:s}=n,{borderlessX:r,borderlessTop:i,borderlessBottom:a}=ve(s),o=e.forPrint?[]:e.businessHourSegs,l=e.forPrint?[]:e.dateSelectionSegs,c=e.forPrint?null:e.eventDrag,u=e.forPrint?null:e.eventResize,h={...e,businessHourSegs:o,dateSelectionSegs:l,eventDrag:c,eventResize:u,scrollerRef:this.scrollerRef,rowHeightRefMap:this.rowHeightRefMap};return d.jsx(kn,{viewSpec:n.viewSpec,attrs:{role:"grid","aria-rowcount":e.headerTiers.length+e.cellRows.length,"aria-colcount":e.cellRows[0].length,"aria-labelledby":e.labelId,"aria-label":e.labelStr},className:b(e.className,f.printRoot,R(s.tableClass,{borderlessX:r,borderlessTop:i,borderlessBottom:a,multiMonthColumns:0})),children:s.dayMinWidth?d.jsx(fv,{...h,dayMinWidth:s.dayMinWidth}):d.jsx(hv,{...h})})}componentDidMount(){this._isUnmounting=!1,this.resetScroll(),this.scrollerRef.current.addScrollEndListener(this.handleScrollEnd)}componentDidUpdate(e){e.dateProfile!==this.props.dateProfile&&this.context.options.scrollTimeReset&&this.resetScroll()}componentWillUnmount(){this._isUnmounting=!0,this.scrollerRef.current.removeScrollEndListener(this.handleScrollEnd)}resetScroll(){this.scrollDate=this.props.dateProfile.currentDate,this.updateScrollY(),this.scrollerRef.current.scrollTo({x:0})}}class Xo extends bo{buildRenderRange(e,n,s){let r=super.buildRenderRange(e,n,s),{props:i}=this;return Ko({currentRange:r,snapToWeek:/^(year|month)$/.test(n),fixedWeekCount:i.fixedWeekCount,dateEnv:i.dateEnv})}}function Ko(t){let{dateEnv:e,currentRange:n}=t,{start:s,end:r}=n,i;if(t.snapToWeek&&(s=e.startOfWeek(s),i=e.startOfWeek(r),i.valueOf()!==r.valueOf()&&(r=Dr(i,1))),t.fixedWeekCount){let a=e.startOfWeek(e.startOfMonth(te(n.end,-1))),o=Math.ceil(Ph(a,r));r=Dr(r,6-o)}return{start:s,end:r}}class mv extends B{constructor(){super(...arguments),this.buildDayTableModel=k(Go),this.buildDateRowConfigs=k(jo),this.createDayHeaderFormatter=k(er),this.slicer=new Ks}render(){const{props:e,context:n}=this,{dateProfile:s}=e,{options:r,dateEnv:i}=n,a=this.buildDayTableModel(s,n.dateProfileGenerator,i),o=a.rowCount===1,l=this.createDayHeaderFormatter(n.options.dayHeaderFormat,o,a.colCount),c=this.slicer.sliceProps(e,s,r.nextDayThreshold,n,a);return d.jsx(At,{unit:"day",children:(u,h)=>{const g=this.buildDateRowConfigs(a.headerDates,o,s,h,l,n);return d.jsx(gv,{labelId:e.labelId,labelStr:e.labelStr,dateProfile:s,todayRange:h,cellRows:a.cellRows,forPrint:e.forPrint,className:e.className,headerTiers:g,fgEventSegs:c.fgEventSegs,bgEventSegs:c.bgEventSegs,businessHourSegs:c.businessHourSegs,dateSelectionSegs:c.dateSelectionSegs,eventDrag:c.eventDrag,eventResize:c.eventResize,eventSelection:c.eventSelection})}})}}var Jo={name:"daygrid",initialView:"dayGridMonth",views:{dayGrid:{component:mv,dateProfileGeneratorClass:Xo},dayGridDay:{type:"dayGrid",duration:{days:1}},dayGridWeek:{type:"dayGrid",duration:{weeks:1}},dayGridMonth:{type:"dayGrid",duration:{months:1},fixedWeekCount:!0},dayGridYear:{type:"dayGrid",duration:{years:1}}}};class pv{constructor(e,n){this.emitter=new Lt}destroy(){}setMirrorIsVisible(e){}setMirrorNeedsRevert(e){}setAutoScrollEnabled(e){}}const Qo={};function el(t,e,n){let{instances:s}=t.mutatedEvents;for(let r in s)if(!Rn(e.validRange,s[r].range))return!1;return tl({eventDrag:t},n)}function vv(t,e,n){return Rn(e.validRange,t.range)?tl({dateSelection:t},n):!1}function tl(t,e){let n=e.getCurrentData(),s={businessHours:n.businessHours,dateSelection:"",eventStore:n.eventStore,eventUiBases:n.eventUiBases,eventSelection:"",eventDrag:null,eventResize:null,...t};return(e.pluginHooks.isPropsValid||yv)(s,e)}function yv(t,e,n={},s){return!(t.eventDrag&&!Sv(t,e,n,s)||t.dateSelection&&!Ev(t,e,n,s))}function Sv(t,e,n,s){let r=e.getCurrentData(),i=t.eventDrag,a=i.mutatedEvents,o=a.defs,l=a.instances,c=dn(o,i.isEvent?t.eventUiBases:{"":r.selectionConfig});s&&(c=xe(c,s));let u=um(t.eventStore,i.affectedEvents.instances),h=u.defs,g=u.instances,m=dn(h,t.eventUiBases);for(let v in l){let p=l[v],y=p.range,D=c[p.defId],x=o[p.defId];if(!nl(D.constraints,y,u,t.businessHours,e))return!1;let{eventOverlap:C}=e.options,E=typeof C=="function"?C:null;for(let N in g){let I=g[N];if(Hs(y,I.range)&&(m[I.defId].overlap===!1&&i.isEvent||D.overlap===!1||E&&!E(new $(e,h[I.defId],I),new $(e,x,p))))return!1}let T=r.eventStore;for(let N of D.allows){let I={...n,range:p.range,allDay:x.allDay},P=T.defs[x.defId],H=T.instances[v],j;if(P?j=new $(e,P,H):j=new $(e,x),!N(Fs(I,e),j))return!1}}return!0}function Ev(t,e,n,s){let r=t.eventStore,i=r.defs,a=r.instances,o=t.dateSelection,l=o.range,{selectionConfig:c}=e.getCurrentData();if(s&&(c=s(c)),!nl(c.constraints,l,r,t.businessHours,e))return!1;let{selectOverlap:u}=e.options,h=typeof u=="function"?u:null;for(let g in a){let m=a[g];if(Hs(l,m.range)&&(c.overlap===!1||h&&!h(new $(e,i[m.defId],m),null)))return!1}for(let g of c.allows){let m={...n,...o};if(!g(Fs(m,e),null))return!1}return!0}function nl(t,e,n,s,r){for(let i of t)if(!Dv(bv(i,e,n,s,r),e))return!1;return!0}function bv(t,e,n,s,r){return t==="businessHours"?$n(qe(s,e,r)):typeof t=="string"?$n(Mn(n,i=>i.groupId===t)):typeof t=="object"&&t?$n(qe(t,e,r)):[]}function $n(t){let{instances:e}=t,n=[];for(let s in e)n.push(e[s].range);return n}function Dv(t,e){for(let n of t)if(Rn(n,e))return!0;return!1}Qo.touchMouseIgnoreWait=500;let fs=0,hn=0,gs=!1;class sl{constructor(e){this.subjectEl=null,this.selector="",this.handleSelector="",this.shouldIgnoreMove=!1,this.shouldWatchScroll=!0,this.isDragging=!1,this.isTouchDragging=!1,this.wasTouchScroll=!1,this.handleMouseDown=n=>{if(!this.shouldIgnoreMouse()&&wv(n)&&this.tryStart(n)){let s=this.createEventFromMouse(n,!0);this.emitter.trigger("pointerdown",s),this.initScrollWatch(s),this.shouldIgnoreMove||document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}},this.handleMouseMove=n=>{let s=this.createEventFromMouse(n);this.recordCoords(s),this.emitter.trigger("pointermove",s)},this.handleMouseUp=n=>{document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.emitter.trigger("pointerup",this.createEventFromMouse(n)),this.cleanup()},this.handleTouchStart=n=>{if(this.tryStart(n)){this.isTouchDragging=!0;let s=this.createEventFromTouch(n,!0);this.emitter.trigger("pointerdown",s),this.initScrollWatch(s);let r=n.target;this.shouldIgnoreMove||r.addEventListener("touchmove",this.handleTouchMove),r.addEventListener("touchend",this.handleTouchEnd),r.addEventListener("touchcancel",this.handleTouchEnd),window.addEventListener("scroll",this.handleTouchScroll,!0)}},this.handleTouchMove=n=>{if(this.isDragging){let s=this.createEventFromTouch(n);this.recordCoords(s),this.emitter.trigger("pointermove",s)}},this.handleTouchEnd=n=>{if(this.isDragging){let s=n.target;s.removeEventListener("touchmove",this.handleTouchMove),s.removeEventListener("touchend",this.handleTouchEnd),s.removeEventListener("touchcancel",this.handleTouchEnd),window.removeEventListener("scroll",this.handleTouchScroll,!0),this.emitter.trigger("pointerup",this.createEventFromTouch(n)),this.cleanup(),this.isTouchDragging=!1,Cv()}},this.handleTouchScroll=()=>{this.wasTouchScroll=!0},this.handleScroll=n=>{if(!this.shouldIgnoreMove){let s=window.scrollX-this.prevScrollX+this.prevPageX,r=window.scrollY-this.prevScrollY+this.prevPageY;this.emitter.trigger("pointermove",{origEvent:n,isTouch:this.isTouchDragging,subjectEl:this.subjectEl,pageX:s,pageY:r,deltaX:s-this.origPageX,deltaY:r-this.origPageY})}},this.containerEl=e,this.emitter=new Lt,e.addEventListener("mousedown",this.handleMouseDown),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),Rv()}destroy(){this.containerEl.removeEventListener("mousedown",this.handleMouseDown),this.containerEl.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),xv()}cancel(){this.isDragging&&this.cleanup()}tryStart(e){let n=this.querySubjectEl(e),s=e.target;return n&&(!this.handleSelector||s.closest(this.handleSelector))?(this.subjectEl=n,this.isDragging=!0,this.wasTouchScroll=!1,!0):!1}cleanup(){gs=!1,this.isDragging=!1,this.subjectEl=null,this.destroyScrollWatch()}querySubjectEl(e){return this.selector?e.target.closest(this.selector):this.containerEl}shouldIgnoreMouse(){return fs||this.isTouchDragging}cancelTouchScroll(){this.isDragging&&(gs=!0)}initScrollWatch(e){this.shouldWatchScroll&&(this.recordCoords(e),window.addEventListener("scroll",this.handleScroll,!0))}recordCoords(e){this.shouldWatchScroll&&(this.prevPageX=e.pageX,this.prevPageY=e.pageY,this.prevScrollX=window.scrollX,this.prevScrollY=window.scrollY)}destroyScrollWatch(){this.shouldWatchScroll&&window.removeEventListener("scroll",this.handleScroll,!0)}createEventFromMouse(e,n){let s=0,r=0;return n?(this.origPageX=e.pageX,this.origPageY=e.pageY):(s=e.pageX-this.origPageX,r=e.pageY-this.origPageY),{origEvent:e,isTouch:!1,subjectEl:this.subjectEl,pageX:e.pageX,pageY:e.pageY,deltaX:s,deltaY:r}}createEventFromTouch(e,n){let s=e.touches,r,i,a=0,o=0;return s&&s.length?(r=s[0].pageX,i=s[0].pageY):(r=e.pageX,i=e.pageY),n?(this.origPageX=r,this.origPageY=i):(a=r-this.origPageX,o=i-this.origPageY),{origEvent:e,isTouch:!0,subjectEl:this.subjectEl,pageX:r,pageY:i,deltaX:a,deltaY:o}}}function wv(t){return t.button===0&&!t.ctrlKey}function Cv(){fs+=1,setTimeout(()=>{fs-=1},Qo.touchMouseIgnoreWait)}function Rv(){hn+=1,hn===1&&window.addEventListener("touchmove",rl,{passive:!1})}function xv(){hn-=1,hn||window.removeEventListener("touchmove",rl,{passive:!1})}function rl(t){gs&&t.preventDefault()}class Tv{constructor(){this.isVisible=!1,this.sourceEl=null,this.mirrorEl=null,this.sourceElRect=null,this.parentNode=document.body,this.zIndex=9999,this.revertDuration=0,this.colorScheme=""}start(e,n,s){this.sourceEl=e,this.sourceElRect=this.sourceEl.getBoundingClientRect(),this.origScreenX=n-window.scrollX,this.origScreenY=s-window.scrollY,this.deltaX=0,this.deltaY=0,this.updateElPosition()}handleMove(e,n){this.deltaX=e-window.scrollX-this.origScreenX,this.deltaY=n-window.scrollY-this.origScreenY,this.updateElPosition()}setIsVisible(e){e?this.isVisible||(this.mirrorEl&&this.mirrorEl.style.setProperty("display","","important"),this.isVisible=e,this.updateElPosition()):this.isVisible&&(this.mirrorEl&&this.mirrorEl.style.setProperty("display","none","important"),this.isVisible=e)}stop(e,n){let s=()=>{this.cleanup(),n()};e&&this.mirrorEl&&this.isVisible&&this.revertDuration&&(this.deltaX||this.deltaY)?this.doRevertAnimation(s,this.revertDuration):setTimeout(s,0)}doRevertAnimation(e,n){let s=this.mirrorEl,r=this.sourceEl.getBoundingClientRect();s.style.transition="top "+n+"ms,left "+n+"ms",Jt(s,{left:r.left,top:r.top}),Df(s,()=>{s.style.transition="",e()})}cleanup(){this.mirrorEl&&(this.mirrorEl.remove(),this.mirrorEl=null),this.sourceEl=null}updateElPosition(){this.sourceEl&&this.isVisible&&Jt(this.getMirrorEl(),{left:this.sourceElRect.left+this.deltaX,top:this.sourceElRect.top+this.deltaY})}getMirrorEl(){let e=this.sourceElRect,n=this.mirrorEl;return n||(n=this.mirrorEl=this.sourceEl.cloneNode(!0),n.style.userSelect="none",n.style.webkitUserSelect="none",n.style.pointerEvents="none",this.colorScheme&&n.setAttribute("data-color-scheme",this.colorScheme),n.classList.add(f.borderBoxRoot),Jt(n,{position:"fixed",zIndex:this.zIndex,visibility:"",width:e.right-e.left,height:e.bottom-e.top,right:"auto",bottom:"auto",margin:0}),this.parentNode.appendChild(n)),n}}class nr{getMaxScrollTop(){return this.getScrollHeight()-this.getClientHeight()}getMaxScrollLeft(){return this.getScrollWidth()-this.getClientWidth()}canScrollVertically(){return this.getMaxScrollTop()>0}canScrollHorizontally(){return this.getMaxScrollLeft()>0}canScrollUp(){return this.getScrollTop()>0}canScrollDown(){return this.getScrollTop()<this.getMaxScrollTop()}canScrollLeft(){return this.getScrollLeft()>0}canScrollRight(){return this.getScrollLeft()<this.getMaxScrollLeft()}}class Mv extends nr{constructor(e){super(),this.el=e}getScrollTop(){return this.el.scrollTop}getScrollLeft(){return this.el.scrollLeft}setScrollTop(e){this.el.scrollTop=e}setScrollLeft(e){this.el.scrollLeft=e}getScrollWidth(){return this.el.scrollWidth}getScrollHeight(){return this.el.scrollHeight}getClientHeight(){return this.el.clientHeight}getClientWidth(){return this.el.clientWidth}}class Iv extends nr{getScrollTop(){return window.scrollY}getScrollLeft(){return window.scrollX}setScrollTop(e){window.scroll(window.scrollX,e)}setScrollLeft(e){window.scroll(e,window.scrollY)}getScrollWidth(){return document.documentElement.scrollWidth}getScrollHeight(){return document.documentElement.scrollHeight}getClientHeight(){return document.documentElement.clientHeight}getClientWidth(){return document.documentElement.clientWidth}}class il extends nr{constructor(e,n){super(),this.handleScroll=()=>{this.scrollTop=this.scrollController.getScrollTop(),this.scrollLeft=this.scrollController.getScrollLeft(),this.handleScrollChange()},this.scrollController=e,this.doesListening=n,this.scrollTop=this.origScrollTop=e.getScrollTop(),this.scrollLeft=this.origScrollLeft=e.getScrollLeft(),this.scrollWidth=e.getScrollWidth(),this.scrollHeight=e.getScrollHeight(),this.clientWidth=e.getClientWidth(),this.clientHeight=e.getClientHeight(),this.clientRect=this.computeClientRect(),this.doesListening&&this.getEventTarget().addEventListener("scroll",this.handleScroll)}destroy(){this.doesListening&&this.getEventTarget().removeEventListener("scroll",this.handleScroll)}getScrollTop(){return this.scrollTop}getScrollLeft(){return this.scrollLeft}setScrollTop(e){this.scrollController.setScrollTop(e),this.doesListening||(this.scrollTop=Math.max(Math.min(e,this.getMaxScrollTop()),0),this.handleScrollChange())}setScrollLeft(e){this.scrollController.setScrollLeft(e),this.doesListening||(this.scrollLeft=Math.max(Math.min(e,this.getMaxScrollLeft()),0),this.handleScrollChange())}getClientWidth(){return this.clientWidth}getClientHeight(){return this.clientHeight}getScrollWidth(){return this.scrollWidth}getScrollHeight(){return this.scrollHeight}handleScrollChange(){}}class al extends il{constructor(e,n){super(new Mv(e),n)}getEventTarget(){return this.scrollController.el}computeClientRect(){return Ip(this.scrollController.el)}}class Nv extends il{constructor(e){super(new Iv,e)}getEventTarget(){return window}computeClientRect(){return{left:this.scrollLeft,right:this.scrollLeft+this.clientWidth,top:this.scrollTop,bottom:this.scrollTop+this.clientHeight}}handleScrollChange(){this.clientRect=this.computeClientRect()}}const oi=typeof performance=="function"?performance.now:Date.now;class Hv{constructor(){this.isEnabled=!0,this.scrollQuery=[window,`.${f.internalScroller}`],this.edgeThreshold=50,this.maxVelocity=300,this.pointerScreenX=null,this.pointerScreenY=null,this.isAnimating=!1,this.scrollCaches=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.animate=()=>{if(this.isAnimating){let e=this.computeBestEdge(this.pointerScreenX+window.scrollX,this.pointerScreenY+window.scrollY);if(e){let n=oi();this.handleSide(e,(n-this.msSinceRequest)/1e3),this.requestAnimation(n)}else this.isAnimating=!1}}}start(e,n,s){this.isEnabled&&(this.scrollCaches=this.buildCaches(s),this.pointerScreenX=null,this.pointerScreenY=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.handleMove(e,n))}handleMove(e,n){if(this.isEnabled){let s=e-window.scrollX,r=n-window.scrollY,i=this.pointerScreenY===null?0:r-this.pointerScreenY,a=this.pointerScreenX===null?0:s-this.pointerScreenX;i<0?this.everMovedUp=!0:i>0&&(this.everMovedDown=!0),a<0?this.everMovedLeft=!0:a>0&&(this.everMovedRight=!0),this.pointerScreenX=s,this.pointerScreenY=r,this.isAnimating||(this.isAnimating=!0,this.requestAnimation(oi()))}}stop(){if(this.isEnabled){this.isAnimating=!1;for(let e of this.scrollCaches)e.destroy();this.scrollCaches=null}}requestAnimation(e){this.msSinceRequest=e,requestAnimationFrame(this.animate)}handleSide(e,n){let{scrollCache:s}=e,{edgeThreshold:r}=this,i=r-e.distance,a=i*i/(r*r)*this.maxVelocity*n,o=1;switch(e.name){case"left":o=-1;case"right":s.setScrollLeft(s.getScrollLeft()+a*o);break;case"top":o=-1;case"bottom":s.setScrollTop(s.getScrollTop()+a*o);break}}computeBestEdge(e,n){let{edgeThreshold:s}=this,r=null,i=this.scrollCaches||[];for(let a of i){let o=a.clientRect,l=e-o.left,c=o.right-e,u=n-o.top,h=o.bottom-n;l>=0&&c>=0&&u>=0&&h>=0&&(u<=s&&this.everMovedUp&&a.canScrollUp()&&(!r||r.distance>u)&&(r={scrollCache:a,name:"top",distance:u}),h<=s&&this.everMovedDown&&a.canScrollDown()&&(!r||r.distance>h)&&(r={scrollCache:a,name:"bottom",distance:h}),l<=s&&this.everMovedLeft&&a.canScrollLeft()&&(!r||r.distance>l)&&(r={scrollCache:a,name:"left",distance:l}),c<=s&&this.everMovedRight&&a.canScrollRight()&&(!r||r.distance>c)&&(r={scrollCache:a,name:"right",distance:c}))}return r}buildCaches(e){return this.queryScrollEls(e).map(n=>n===window?new Nv(!1):new al(n,!1))}queryScrollEls(e){let n=[];for(let s of this.scrollQuery)typeof s=="object"?n.push(s):n.push(...Array.prototype.slice.call(e.getRootNode().querySelectorAll(s)));return n}}class Bt extends pv{constructor(e,n){super(e),this.containerEl=e,this.delay=null,this.minDistance=0,this.touchScrollAllowed=!0,this.mirrorNeedsRevert=!1,this.isInteracting=!1,this.isDragging=!1,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.delayTimeoutId=null,this.onPointerDown=r=>{this.isDragging||(this.isInteracting=!0,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.emitter.trigger("pointerdown",r),this.isInteracting&&(wf(document.body),Rf(document.body),r.isTouch||r.origEvent.preventDefault(),this.mirror.setIsVisible(!1),this.mirror.start(r.subjectEl,r.pageX,r.pageY),this.startDelay(r),this.minDistance||this.handleDistanceSurpassed(r)))},this.onPointerMove=r=>{if(this.isInteracting){if(this.emitter.trigger("pointermove",r),!this.isDistanceSurpassed){let i=this.minDistance,a,{deltaX:o,deltaY:l}=r;a=o*o+l*l,a>=i*i&&this.handleDistanceSurpassed(r)}this.isDragging&&(r.origEvent.type!=="scroll"&&(this.mirror.handleMove(r.pageX,r.pageY),this.autoScroller.handleMove(r.pageX,r.pageY)),this.emitter.trigger("dragmove",r))}},this.onPointerUp=r=>{this.isInteracting&&(this.isInteracting=!1,Cf(document.body),xf(document.body),this.emitter.trigger("pointerup",r),this.isDragging&&(this.autoScroller.stop(),this.tryStopDrag(r)),this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=null))};let s=this.pointer=new sl(e);s.emitter.on("pointerdown",this.onPointerDown),s.emitter.on("pointermove",this.onPointerMove),s.emitter.on("pointerup",this.onPointerUp),n&&(s.selector=n),this.mirror=new Tv,this.autoScroller=new Hv}destroy(){this.pointer.destroy(),this.onPointerUp({})}startDelay(e){typeof this.delay=="number"?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=null,this.handleDelayEnd(e)},this.delay):this.handleDelayEnd(e)}handleDelayEnd(e){this.isDelayEnded=!0,this.tryStartDrag(e)}handleDistanceSurpassed(e){this.isDistanceSurpassed=!0,this.tryStartDrag(e)}tryStartDrag(e){this.isDelayEnded&&this.isDistanceSurpassed&&(!this.pointer.wasTouchScroll||this.touchScrollAllowed)&&(this.isDragging=!0,this.mirrorNeedsRevert=!1,this.autoScroller.start(e.pageX,e.pageY,this.containerEl),this.emitter.trigger("dragstart",e),this.touchScrollAllowed===!1&&this.pointer.cancelTouchScroll())}tryStopDrag(e){this.mirror.stop(this.mirrorNeedsRevert,this.stopDrag.bind(this,e))}stopDrag(e){this.isDragging=!1,this.emitter.trigger("dragend",e)}cancel(){this.isInteracting&&(this.isInteracting=!1,this.pointer.cancel())}setMirrorIsVisible(e){this.mirror.setIsVisible(e)}setMirrorNeedsRevert(e){this.mirrorNeedsRevert=e}setAutoScrollEnabled(e){this.autoScroller.isEnabled=e}}class kv{constructor(e){this.el=e,this.origRect=Xs(e),this.isRtl=Nt(e),this.scrollCaches=ko(e).map(n=>new al(n,!0))}destroy(){for(let e of this.scrollCaches)e.destroy()}computeLeft(){let e=this.origRect.left;for(let n of this.scrollCaches)e+=n.origScrollLeft-n.getScrollLeft();return e}computeTop(){let e=this.origRect.top;for(let n of this.scrollCaches)e+=n.origScrollTop-n.getScrollTop();return e}isWithinClipping(e,n){let s={left:e,top:n};for(let r of this.scrollCaches)if(!Pv(r.getEventTarget())&&!Cp(s,r.clientRect))return!1;return!0}}function Pv(t){let e=t.tagName;return e==="HTML"||e==="BODY"}class jn{constructor(e,n){this.useSubjectCenter=!1,this.requireInitial=!0,this.disablePointCheck=!1,this.initialHit=null,this.movingHit=null,this.finalHit=null,this.handlePointerDown=s=>{let{dragging:r}=this;this.initialHit=null,this.movingHit=null,this.finalHit=null,this.prepareHits(),this.processFirstCoord(s),this.initialHit||!this.requireInitial?this.emitter.trigger("pointerdown",s):r.cancel()},this.handleDragStart=s=>{this.emitter.trigger("dragstart",s),this.handleMove(s,!0)},this.handleDragMove=s=>{this.emitter.trigger("dragmove",s),this.handleMove(s)},this.handlePointerUp=s=>{this.releaseHits(),this.emitter.trigger("pointerup",s)},this.handleDragEnd=s=>{this.movingHit&&this.emitter.trigger("hitupdate",null,!0,s),this.finalHit=this.movingHit,this.movingHit=null,this.emitter.trigger("dragend",s)},this.droppableStore=n,e.emitter.on("pointerdown",this.handlePointerDown),e.emitter.on("dragstart",this.handleDragStart),e.emitter.on("dragmove",this.handleDragMove),e.emitter.on("pointerup",this.handlePointerUp),e.emitter.on("dragend",this.handleDragEnd),this.dragging=e,this.emitter=new Lt}processFirstCoord(e){let n={left:e.pageX,top:e.pageY},s=n,r=e.subjectEl,i;r instanceof HTMLElement&&(i=Xs(r),s=Rp(s,i));let a=this.initialHit=this.queryHitForOffset(s.left,s.top);if(a){if(this.useSubjectCenter&&i){let o=Ho(i,a.rect);o&&(s=xp(o))}this.coordAdjust=Tp(s,n)}else this.coordAdjust={left:0,top:0}}handleMove(e,n){let s=this.queryHitForOffset(e.pageX+this.coordAdjust.left,e.pageY+this.coordAdjust.top);(n||!Ln(this.movingHit,s))&&(this.movingHit=s,this.emitter.trigger("hitupdate",s,!1,e))}prepareHits(){this.offsetTrackers=xe(this.droppableStore,e=>(e.component.prepareHits(),new kv(e.el)))}releaseHits(){let{offsetTrackers:e}=this;for(let n in e)e[n].destroy();this.offsetTrackers={}}queryHitForOffset(e,n){let{droppableStore:s,offsetTrackers:r}=this,i=null;for(let a in s){let o=s[a].component,l=r[a];if(l&&l.isWithinClipping(e,n)){let c=l.computeLeft(),u=l.computeTop(),h=e-c,g=n-u,{origRect:m}=l,v=m.right-m.left,p=m.bottom-m.top;if(h>=0&&h<v&&g>=0&&g<p){let y=o.queryHit(l.isRtl,h,g,v,p);y&&Rn(y.dateProfile.activeRange,y.dateSpan.range)&&(this.disablePointCheck||l.el.contains(l.el.getRootNode().elementFromPoint(h+c-window.scrollX,g+u-window.scrollY)))&&(!i||y.layer>i.layer)&&(y.componentId=a,y.context=o.context,y.rect.left+=c,y.rect.right+=c,y.rect.top+=u,y.rect.bottom+=u,i=y)}}}return i}}function Ln(t,e){return!t&&!e?!0:!!t!=!!e?!1:Kf(t.dateSpan,e.dateSpan)}function ol(t,e){let n={};for(let s of e.pluginHooks.datePointTransforms)Object.assign(n,s(t,e));return Object.assign(n,jv(t,e.dateEnv)),n}function jv(t,e){return{date:e.toDate(t.range.start),dateStr:e.formatIso(t.range.start,{omitTime:t.allDay}),allDay:t.allDay}}class Lv extends pt{constructor(e){super(e),this.handlePointerDown=s=>{let{dragging:r}=this,i=s.origEvent.target;this.component.context.emitter.hasHandlers("dateClick")&&this.component.isValidDateDownEl(i)||r.cancel()},this.handleDragEnd=s=>{let{component:r}=this,{pointer:i}=this.dragging;if(!i.wasTouchScroll){let{initialHit:a,finalHit:o}=this.hitDragging;if(a&&o&&Ln(a,o)){let{context:l}=r,c={...ol(a.dateSpan,l),dayEl:a.getDayEl(),jsEvent:s.origEvent,view:l.viewApi||l.calendarApi.view};l.emitter.trigger("dateClick",c)}}},this.dragging=new Bt(e.el),this.dragging.autoScroller.isEnabled=!1;let n=this.hitDragging=new jn(this.dragging,qs(e));n.emitter.on("pointerdown",this.handlePointerDown),n.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}}class Av extends pt{constructor(e){super(e),this.dragSelection=null,this.handlePointerDown=a=>{let{component:o,dragging:l}=this,{options:c}=o.context;c.selectable&&o.isValidDateDownEl(a.origEvent.target)?l.delay=a.isTouch?Ov(o):null:l.cancel()},this.handleDragStart=a=>{this.component.context.calendarApi.unselect(a)},this.handleHitUpdate=(a,o)=>{let{context:l}=this.component,c=null,u=!1;if(a){let h=this.hitDragging.initialHit;a.componentId===h.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(h,a)||(c=Wv(h,a,l.pluginHooks.dateSelectionTransformers)),(!c||!vv(c,a.dateProfile,l))&&(u=!0,c=null)}c?l.dispatch({type:"SELECT_DATES",selection:c}):o||l.dispatch({type:"UNSELECT_DATES"}),u?js():Ls(),o||(this.dragSelection=c)},this.handlePointerUp=a=>{this.dragSelection?(no(this.dragSelection,a,this.component.context),this.dragSelection=null):this.component.context.emitter.trigger("_noDateSelect")};let{component:n}=e,{options:s}=n.context,r=this.dragging=new Bt(e.el);r.touchScrollAllowed=!1,r.minDistance=s.selectMinDistance||0,r.autoScroller.isEnabled=s.dragScroll;let i=this.hitDragging=new jn(this.dragging,qs(e));i.emitter.on("pointerdown",this.handlePointerDown),i.emitter.on("dragstart",this.handleDragStart),i.emitter.on("hitupdate",this.handleHitUpdate),i.emitter.on("pointerup",this.handlePointerUp)}destroy(){this.dragging.destroy()}}function Ov(t){let{options:e}=t.context,n=e.selectLongPressDelay;return n==null&&(n=e.longPressDelay),n}function Wv(t,e,n){let s=t.dateSpan,r=e.dateSpan,i=[s.range.start,s.range.end,r.range.start,r.range.end];i.sort(Hf);let a={};for(let o of n){let l=o(t,e);if(l===!1)return null;l&&Object.assign(a,l)}return a.range={start:i[0],end:i[3]},a.allDay=s.allDay,a}class _t extends pt{constructor(e){super(e),this.subjectEl=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=a=>{let o=a.origEvent.target,{component:l,dragging:c}=this,{mirror:u}=c,{options:h}=l.context,g=l.context;this.subjectEl=a.subjectEl;let v=(this.eventRange=ct(a.subjectEl)).instance.instanceId;this.relevantEvents=Bs(g.getCurrentData().eventStore,v),c.minDistance=a.isTouch?0:h.eventDragMinDistance,c.delay=a.isTouch&&v!==l.props.eventSelection?_v(l):null,u.parentNode=xo(o),u.revertDuration=h.dragRevertDuration,u.colorScheme=h.colorScheme||"",l.isValidSegDownEl(o)&&!o.closest(`.${f.internalEventResizer}`)?this.isDragging=a.subjectEl.classList.contains(f.internalEventDraggable):c.cancel()},this.handleDragStart=a=>{let o=this.component.context,l=this.eventRange,c=l.instance.instanceId;a.isTouch?c!==this.component.props.eventSelection&&o.dispatch({type:"SELECT_EVENT",eventInstanceId:c}):o.dispatch({type:"UNSELECT_EVENT"}),this.isDragging&&(o.calendarApi.unselect(a),o.emitter.trigger("eventDragStart",{el:this.subjectEl,event:new $(o,l.def,l.instance),jsEvent:a.origEvent,view:o.viewApi}))},this.handleHitUpdate=(a,o)=>{if(!this.isDragging)return;let l=this.relevantEvents,c=this.hitDragging.initialHit,u=this.component.context,h=null,g=null,m=null,v=!1,p={affectedEvents:l,mutatedEvents:de(),isEvent:!0};if(a){h=a.context;let y=h.options;u===h||y.editable&&y.droppable?(g=Bv(c,a,this.eventRange.instance.range.start,h.getCurrentData().pluginHooks.eventDragMutationMassagers),g&&(m=Vs(l,h.getCurrentData().eventUiBases,g,h),p.mutatedEvents=m,el(p,a.dateProfile,h)||(v=!0,g=null,m=null,p.mutatedEvents=de()))):h=null}this.displayDrag(h,p),v?js():Ls(),o||(u===h&&Ln(c,a)&&(g=null),this.dragging.setMirrorNeedsRevert(!g),this.dragging.setMirrorIsVisible(!a||!this.subjectEl.getRootNode().querySelector(`.${f.internalEventMirror}`)),this.receivingContext=h,this.validMutation=g,this.mutatedRelevantEvents=m)},this.handlePointerUp=()=>{this.isDragging||this.cleanup()},this.handleDragEnd=a=>{if(this.isDragging){let o=this.component.context,l=o.viewApi,{receivingContext:c,validMutation:u}=this,h=this.eventRange.def,g=this.eventRange.instance,m=new $(o,h,g),v=this.relevantEvents,p=this.mutatedRelevantEvents,{finalHit:y}=this.hitDragging;if(this.clearDrag(),o.emitter.trigger("eventDragStop",{el:this.subjectEl,event:m,jsEvent:a.origEvent,view:l}),u){if(c===o){let D=new $(o,p.defs[h.defId],g?p.instances[g.instanceId]:null);o.dispatch({type:"MERGE_EVENTS",eventStore:p});let x={oldEvent:m,event:D,relatedEvents:Fe(p,o,g),revert(){o.dispatch({type:"MERGE_EVENTS",eventStore:v})}},C={};for(let E of o.getCurrentData().pluginHooks.eventDropTransformers)Object.assign(C,E(u,o));o.emitter.trigger("eventDrop",{...x,...C,el:a.subjectEl,delta:u.datesDelta,jsEvent:a.origEvent,view:l}),o.emitter.trigger("eventChange",x)}else if(c){let D={event:m,relatedEvents:Fe(v,o,g),revert(){o.dispatch({type:"MERGE_EVENTS",eventStore:v})}};o.emitter.trigger("eventLeave",{...D,draggedEl:a.subjectEl,view:l}),o.dispatch({type:"REMOVE_EVENTS",eventStore:v}),o.emitter.trigger("eventRemove",D);let x=p.defs[h.defId],C=p.instances[g.instanceId],E=new $(c,x,C);c.dispatch({type:"MERGE_EVENTS",eventStore:p});let T={event:E,relatedEvents:Fe(p,c,C),revert(){c.dispatch({type:"REMOVE_EVENTS",eventStore:p})}};c.emitter.trigger("eventAdd",T),a.isTouch&&c.dispatch({type:"SELECT_EVENT",eventInstanceId:g.instanceId}),c.emitter.trigger("drop",{...ol(y.dateSpan,c),draggedEl:a.subjectEl,jsEvent:a.origEvent,view:y.context.viewApi}),c.emitter.trigger("eventReceive",{...T,draggedEl:a.subjectEl,view:y.context.viewApi})}}else o.emitter.trigger("_noEventDrop")}this.cleanup()};let{component:n}=this,{options:s}=n.context,r=this.dragging=new Bt(e.el);r.pointer.selector=_t.SELECTOR,r.touchScrollAllowed=!1,r.autoScroller.isEnabled=s.dragScroll;let i=this.hitDragging=new jn(this.dragging,rs);i.useSubjectCenter=e.useEventCenter,i.emitter.on("pointerdown",this.handlePointerDown),i.emitter.on("dragstart",this.handleDragStart),i.emitter.on("hitupdate",this.handleHitUpdate),i.emitter.on("pointerup",this.handlePointerUp),i.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}displayDrag(e,n){let s=this.component.context,r=this.receivingContext;r&&r!==e&&(r===s?r.dispatch({type:"SET_EVENT_DRAG",state:{affectedEvents:n.affectedEvents,mutatedEvents:de(),isEvent:!0}}):r.dispatch({type:"UNSET_EVENT_DRAG"})),e&&e.dispatch({type:"SET_EVENT_DRAG",state:n})}clearDrag(){let e=this.component.context,{receivingContext:n}=this;n&&n.dispatch({type:"UNSET_EVENT_DRAG"}),e!==n&&e.dispatch({type:"UNSET_EVENT_DRAG"})}cleanup(){this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null}}_t.SELECTOR=`.${f.internalEventDraggable}, .${f.internalEventResizable}`;function Bv(t,e,n,s){let r=t.dateSpan,i=e.dateSpan,a=r.range.start,o=i.range.start,l={};r.allDay!==i.allDay&&(l.allDay=i.allDay,l.hasEnd=e.context.options.allDayMaintainDuration,i.allDay?a=z(n):a=n);let c=nt(a,o,t.context.dateEnv,t.componentId===e.componentId?t.largeUnit:null);c.milliseconds&&(l.allDay=!1);let u={datesDelta:c,standardProps:l};for(let h of s)h(u,t,e);return u}function _v(t){let{options:e}=t.context,n=e.eventLongPressDelay;return n==null&&(n=e.longPressDelay),n}class Uv extends pt{constructor(e){super(e),this.draggingSegEl=null,this.draggingEventRange=null,this.eventRange=null,this.relevantEvents=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=i=>{let{component:a}=this,o=this.querySegEl(i),l=this.eventRange=ct(o);this.dragging.minDistance=a.context.options.eventDragMinDistance,this.component.isValidSegDownEl(i.origEvent.target)&&!(i.isTouch&&this.component.props.eventSelection!==l.instance.instanceId)||this.dragging.cancel()},this.handleDragStart=i=>{let{context:a}=this.component,o=this.eventRange;this.relevantEvents=Bs(a.getCurrentData().eventStore,this.eventRange.instance.instanceId);let l=this.querySegEl(i);this.draggingSegEl=l,this.draggingEventRange=ct(l),a.calendarApi.unselect(),a.emitter.trigger("eventResizeStart",{el:l,event:new $(a,o.def,o.instance),jsEvent:i.origEvent,view:a.viewApi})},this.handleHitUpdate=(i,a,o)=>{let{context:l}=this.component,c=this.relevantEvents,u=this.hitDragging.initialHit,h=this.eventRange.instance,g=null,m=null,v=!1,p={affectedEvents:c,mutatedEvents:de(),isEvent:!0};i&&(i.componentId===u.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(u,i)||(g=Fv(u,i,o.subjectEl.classList.contains(f.internalEventResizerStart),h.range))),g&&(m=Vs(c,l.getCurrentData().eventUiBases,g,l),p.mutatedEvents=m,el(p,i.dateProfile,l)||(v=!0,g=null,m=null,p.mutatedEvents=null)),m?l.dispatch({type:"SET_EVENT_RESIZE",state:p}):l.dispatch({type:"UNSET_EVENT_RESIZE"}),v?js():Ls(),a||(g&&Ln(u,i)&&(g=null),this.validMutation=g,this.mutatedRelevantEvents=m)},this.handleDragEnd=i=>{let{context:a}=this.component,o=this.eventRange.def,l=this.eventRange.instance,c=new $(a,o,l),u=this.relevantEvents,h=this.mutatedRelevantEvents;if(a.emitter.trigger("eventResizeStop",{el:this.draggingSegEl,event:c,jsEvent:i.origEvent,view:a.viewApi}),this.validMutation){let g=new $(a,h.defs[o.defId],l?h.instances[l.instanceId]:null);a.dispatch({type:"MERGE_EVENTS",eventStore:h});let m={oldEvent:c,event:g,relatedEvents:Fe(h,a,l),revert(){a.dispatch({type:"MERGE_EVENTS",eventStore:u})}};a.emitter.trigger("eventResize",{...m,el:this.draggingSegEl,startDelta:this.validMutation.startDelta||_(0),endDelta:this.validMutation.endDelta||_(0),jsEvent:i.origEvent,view:a.viewApi}),a.emitter.trigger("eventChange",m)}else a.emitter.trigger("_noEventResize");this.draggingEventRange=null,this.relevantEvents=null,this.validMutation=null};let{component:n}=e,s=this.dragging=new Bt(e.el);s.pointer.selector=`.${f.internalEventResizer}`,s.touchScrollAllowed=!1,s.autoScroller.isEnabled=n.context.options.dragScroll;let r=this.hitDragging=new jn(this.dragging,qs(e));r.emitter.on("pointerdown",this.handlePointerDown),r.emitter.on("dragstart",this.handleDragStart),r.emitter.on("hitupdate",this.handleHitUpdate),r.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}querySegEl(e){return e.subjectEl.closest(`.${f.internalEvent}`)}}function Fv(t,e,n,s){let r=t.context.dateEnv,i=t.dateSpan.range.start,a=e.dateSpan.range.start,o=nt(i,a,r,t.largeUnit);if(n){if(r.add(s.start,o)<s.end)return{startDelta:o}}else if(r.add(s.end,o)>s.start)return{endDelta:o};return null}class Vv{constructor(e){this.context=e,this.isRecentPointerDateSelect=!1,this.matchesCancel=!1,this.matchesEvent=!1,this.onSelect=s=>{s.jsEvent&&(this.isRecentPointerDateSelect=!0)},this.onDocumentPointerDown=s=>{let r=this.context.options.unselectCancel,i=To(s.origEvent);this.matchesCancel=!!i.closest(r),this.matchesEvent=!!i.closest(_t.SELECTOR)},this.onDocumentPointerUp=s=>{let{context:r}=this,{documentPointer:i}=this,a=r.getCurrentData();if(!i.wasTouchScroll){if(a.dateSelection&&!this.isRecentPointerDateSelect){let o=r.options.unselectAuto;o&&(!o||!this.matchesCancel)&&r.calendarApi.unselect(s)}a.eventSelection&&!this.matchesEvent&&r.dispatch({type:"UNSELECT_EVENT"})}this.isRecentPointerDateSelect=!1};let n=this.documentPointer=new sl(document);n.shouldIgnoreMove=!0,n.shouldWatchScroll=!1,n.emitter.on("pointerdown",this.onDocumentPointerDown),n.emitter.on("pointerup",this.onDocumentPointerUp),e.emitter.on("select",this.onSelect)}destroy(){this.context.emitter.off("select",this.onSelect),this.documentPointer.destroy()}}var zv={name:"interaction",componentInteractions:[Lv,Av,_t,Uv],calendarInteractions:[Vv],elementDraggingImpl:Bt};class li extends B{render(){const{props:e,context:n}=this,{options:s}=n,r=n.dateEnv.formatToParts(e.dayDate,e.dayFormat),i=ie(r),a=s.navLinks,o={...e.dateMeta,view:n.viewApi,text:i,textParts:r,get weekdayText(){return Ht(r)},get dayNumberText(){return kt(r)},hasNavLink:a,level:e.level},l=a?yt(this.context,e.dayDate,void 0,i,this.props.isTabbable):{};return d.jsx(q,{tag:"div",attrs:l,renderProps:o,generatorName:"listDayHeaderContent",customGenerator:s.listDayHeaderContent,defaultGenerator:Nn,classNameGenerator:s.listDayHeaderInnerClass})}}class Gv extends B{render(){let{options:e,viewApi:n,viewSpec:s}=this.context,{dayDate:r,dateMeta:i}=this.props,a=!this.props.forPrint;const o=e.listDayFormat??Yv(s),l=e.listDayAltFormat??qv(s);let c={...i,view:n};return d.jsx(q,{tag:"div",attrs:{"data-date":mt(r),...i.isToday?{"aria-current":"date"}:{}},className:a?f.stickyT:"",renderProps:c,generatorName:void 0,classNameGenerator:e.listDayHeaderClass,didMount:e.listDayHeaderDidMount,willUnmount:e.listDayHeaderWillUnmount,children:()=>d.jsxs(d.Fragment,{children:[!!o&&d.jsx(li,{dayDate:r,dayFormat:o,isTabbable:!0,dateMeta:i,level:0}),!!l&&d.jsx(li,{dayDate:r,dayFormat:l,isTabbable:!1,dateMeta:i,level:1})]})})}}function Yv({durationUnit:t,singleUnit:e}){return e==="day"||t==="day"||e==="week"?un:$s}function qv({durationUnit:t,singleUnit:e}){if(e!=="day")return t==="day"||e==="week"?$s:un}const $v=V({hour:"numeric",minute:"2-digit",meridiem:"short"});class Zv extends B{render(){let{props:e,context:n}=this,{eventRange:s}=e;const{displayEventTime:r}=n.options;let i=r!==!1&&(s.def.allDay||!e.isStart&&!e.isEnd)?n.options.allDayText:void 0;return d.jsx(Ot,{...e,attrs:{role:"listitem"},forcedTimeText:i,defaultTimeFormat:$v,disableDragging:!0,disableResizing:!0,disableZindexes:!0,display:"list-item"})}}class Xv extends B{constructor(){super(...arguments),this.getDateMeta=k(Je),this.sortEventSegs=k(zs)}render(){const{props:e,context:n}=this,{nowDate:s,todayRange:r}=e,{options:i}=n,a=this.getDateMeta(e.dayDate,n.dateEnv,void 0,r),o=this.sortEventSegs(e.segs,i.eventOrder),l=vt(this.context,e.dayDate),c={...a,isFirst:e.isFirst,isLast:e.isLast,view:n.viewApi},u={...a,view:n.viewApi};return d.jsxs("div",{role:"listitem","aria-label":l,className:R(i.listDayClass,c),children:[d.jsx(Gv,{dayDate:e.dayDate,dateMeta:a,forPrint:e.forPrint}),d.jsx("div",{role:"list","aria-label":i.eventsHint,className:b(R(i.listDayBodyClass,u),f.flexCol),children:o.map((h,g)=>{const m=In(h),v=g===0,p=g===o.length-1;return d.jsx(Zv,{eventRange:h.eventRange,slicedStart:h.slicedStart,slicedEnd:h.slicedEnd,isStart:h.isStart,isEnd:h.isEnd,isFirst:v,isLast:p,isDragging:!1,isResizing:!1,isMirror:!1,isSelected:!1,...$e(h.eventRange,r,s)},m)})})]})}}class Kv extends ye{constructor(){super(...arguments),this.computeDateVars=k(Qv),this.eventStoreToSegs=k(this._eventStoreToSegs),this.setRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e,disableHits:!0}):this.context.unregisterInteractiveComponent(this)}}render(){let{props:e,context:n}=this,{options:s}=n,{dayDates:r,dayRanges:i}=this.computeDateVars(e.dateProfile),a=this.eventStoreToSegs(e.eventStore,e.eventUiBases,i),o=!e.forPrint&&!fe(s);return d.jsx(kn,{viewSpec:n.viewSpec,className:b(e.className,f.flexCol),elRef:this.setRootEl,children:a.length?d.jsx(pe,{vertical:o,className:b(f.flexCol,o?f.liquid:""),children:this.renderSegList(a,r)}):this.renderEmptyMessage()})}renderEmptyMessage(){let{options:e,viewApi:n}=this.context,s={text:e.noEventsText,view:n};return d.jsx(q,{tag:"div",attrs:{role:"status"},renderProps:s,generatorName:"noEventsContent",customGenerator:e.noEventsContent,defaultGenerator:Jv,classNameGenerator:e.noEventsClass,className:f.grow,didMount:e.noEventsDidMount,willUnmount:e.noEventsWillUnmount,children:r=>d.jsx(r,{tag:"div",className:R(e.noEventsInnerClass,s)})})}renderSegList(e,n){let{options:s}=this.context,r=ey(e);return d.jsx("div",{role:"list","aria-labelledby":this.props.labelId,"aria-label":this.props.labelStr,className:b(f.flexCol,b(s.listDaysClass)),children:d.jsx(At,{unit:"day",children:(i,a)=>{const o=[],l=r.reduce((u,h)=>u+(h?1:0),0);let c=0;for(let u=0;u<r.length;u+=1){let h=r[u];if(h){const g=n[u],m=mt(g),v=c===0,p=c===l-1;o.push(d.jsx(Xv,{dayDate:g,nowDate:i,todayRange:a,segs:h,isFirst:v,isLast:p,forPrint:this.props.forPrint},m)),c+=1}}return d.jsx(d.Fragment,{children:o})}})})}_eventStoreToSegs(e,n,s){return this.eventRangesToSegs(ns(e,n,this.props.dateProfile.activeRange,this.context.options.nextDayThreshold).fg,s)}eventRangesToSegs(e,n){let s=[];for(let r of e)s.push(...this.eventRangeToSegs(r,n));return s}eventRangeToSegs(e,n){let s=e.range,r,i=[];for(r=0;r<n.length;r+=1){const a=Ae(s,n[r]);a&&i.push({eventRange:e,slicedStart:a.start,slicedEnd:a.end,isStart:e.isStart&&s.start.valueOf()===a.start.valueOf(),isEnd:e.isEnd&&s.end.valueOf()===a.end.valueOf(),dayIndex:r})}return i}}function Jv(t){return t.text}function Qv(t){let e=z(t.renderRange.start),n=t.renderRange.end,s=[],r=[];for(;e<n;)s.push(e),r.push({start:e,end:te(e,1)}),e=te(e,1);return{dayDates:s,dayRanges:r}}function ey(t){let e=[],n,s;for(n=0;n<t.length;n+=1)s=t[n],(e[s.dayIndex]||(e[s.dayIndex]=[])).push(s);return e}var ty={name:"list",views:{list:{component:Kv,buttonTextKey:"listText",disallowAmbigTitle:!0},listDay:{type:"list",duration:{days:1}},listWeek:{type:"list",duration:{weeks:1}},listMonth:{type:"list",duration:{month:1}},listYear:{type:"list",duration:{year:1}}}};class ny extends ye{constructor(){super(...arguments),this.state={},this.buildDayTableModel=k(Go),this.createDayHeaderFormatter=k(er),this.buildDateRowConfig=k(Lo),this.titleElRef=w.createRef(),this.tableHeaderElRef=w.createRef(),this.rowHeightRefMap=new le(()=>{re(this.handleHeights)}),this.slicer=new Ks,this.handleEl=e=>{const{options:n}=this.context;e&&(this.rootEl=e,n.singleMonthDidMount?.({el:this.rootEl,...this.renderProps}))},this.handleGridWidth=e=>{this._isUnmounting||this.setState({gridWidth:e})},this.handleHeights=()=>{this._isUnmounting||L(this.props.heightsRef,{titleHeight:this.titleHeight,tableHeaderHeight:this.tableHeaderHeight,rowHeightMap:this.rowHeightRefMap.current,cellRows:this.cellRows})}}get titleId(){return this.context.baseId+"month-"+this.props.isoDateStr}render(){const{props:e,state:n,context:s}=this,{dateProfile:r,forPrint:i}=e,{options:a,dateEnv:o}=s,{borderlessX:l,borderlessTop:c,borderlessBottom:u}=ve(a),h=this.buildDayTableModel(r,s.dateProfileGenerator,o),g=this.slicer.sliceProps(e,r,a.nextDayThreshold,s,h),m=this.createDayHeaderFormatter(a.dayHeaderFormat,!1,h.colCount),v=this.buildDateRowConfig(h.headerDates,!1,r,e.todayRange,m,s);this.cellRows=h.cellRows;const p=!i&&e.colCount===1,y=!i||e.hasLateralSiblings,D=h.cellRows[0].length,x=n.gridWidth!=null?n.gridWidth/D:void 0,C=x!=null&&x<=Wt,E=C||x!=null&&x<=a.dayNarrowWidth,T=n.gridWidth!=null?1/a.aspectRatio*n.gridWidth/6:void 0,N=p?T:void 0,I=p&&T!=null&&n.tableHeaderHeight!=null?T+n.tableHeaderHeight+1:void 0,P=i?[]:g.businessHourSegs,H=i?[]:g.dateSelectionSegs,j=i?null:g.eventDrag,G=i?null:g.eventResize,U=a.navLinks&&e.colCount>1,F={multiMonthColumns:e.colCount||0,isSticky:p,isNarrow:E,hasNavLink:U},Z=e.dateProfile.currentRange.start,Q=U?yt(s,Z,"month",e.isoDateStr):{};return d.jsx("div",{role:"listitem",style:{width:e.width},children:d.jsxs("div",{role:"grid","aria-labelledby":this.titleId,"data-date":e.isoDateStr,className:b(R(a.singleMonthClass,{isFirst:e.isFirst,isLast:e.isLast,multiMonthColumns:e.colCount||0}),f.flexCol,e.hasLateralSiblings&&f.breakInsideAvoid),children:[d.jsx(Et,{widthRef:this.handleGridWidth}),d.jsx("div",{id:this.titleId,ref:this.titleElRef,className:b(R(a.singleMonthHeaderClass,F),p&&f.stickyT,f.flexCol),style:{zIndex:p?3:void 0,marginBottom:I},children:d.jsx("div",{...Q,className:b(R(a.singleMonthHeaderInnerClass,F),Q.className),children:ie(o.formatToParts(Z,e.titleFormat))})}),d.jsxs("div",{className:b(R(a.tableClass,{borderlessX:l,borderlessTop:c,borderlessBottom:u,multiMonthColumns:e.colCount||0}),f.flexCol),style:{marginTop:I!=null?-I:void 0},children:[d.jsxs("div",{ref:this.tableHeaderElRef,className:b(R(a.tableHeaderClass,{isSticky:p,borderlessX:l,borderlessTop:c,borderlessBottom:u,multiMonthColumns:e.colCount||0}),f.flexCol,p&&f.sticky),style:{zIndex:p?2:void 0,top:p?n.titleHeight:0,marginBottom:N},children:[d.jsx(Pn,{...v,role:"row",borderBottom:!1,cellIsNarrow:E,cellIsMicro:C,rowLevel:0}),d.jsx("div",{className:R(a.dayHeaderDividerClass,{isSticky:p,multiMonthColumns:e.colCount||0,options:{allDaySlot:!!a.allDaySlot}})})]}),d.jsx("div",{className:b(R(a.tableBodyClass,{borderlessX:l,borderlessTop:c,borderlessBottom:u,multiMonthColumns:e.colCount||0}),f.flexCol,y&&f.rel),style:{zIndex:p?1:void 0,marginTop:N!=null?-N:void 0,aspectRatio:y?String(a.aspectRatio):void 0},children:d.jsx(tr,{dateProfile:e.dateProfile,todayRange:e.todayRange,cellRows:h.cellRows,className:y?f.fill:"",forPrint:i&&!e.hasLateralSiblings,dayMaxEventRows:i&&e.hasLateralSiblings?1:!0,fgEventSegs:g.fgEventSegs,bgEventSegs:g.bgEventSegs,businessHourSegs:P,dateSelectionSegs:H,eventDrag:j,eventResize:G,eventSelection:g.eventSelection,visibleWidth:n.gridWidth,cellIsNarrow:E,cellIsMicro:C,rowHeightRefMap:this.rowHeightRefMap})})]})]})})}componentDidMount(){this._isUnmounting=!1,this.disconnectTitleHeight=dt(this.titleElRef.current,e=>{this.setState({titleHeight:this.titleHeight=e}),re(this.handleHeights)}),this.disconnectTableHeaderHeight=dt(this.tableHeaderElRef.current,e=>{this.setState({tableHeaderHeight:this.tableHeaderHeight=e}),re(this.handleHeights)})}componentWillUnmount(){const{options:e}=this.context;this._isUnmounting=!0,this.disconnectTitleHeight(),this.disconnectTableHeaderHeight(),e.singleMonthWillUnmount?.({el:this.rootEl,...this.renderProps})}}class sy extends ye{constructor(){super(...arguments),this.state={},this.splitDateProfileByMonth=k(iy),this.buildMonthFormat=k(ly),this.scrollerRef=w.createRef(),this.tilesElRef=w.createRef(),this.scrollState={},this.handleInnerWidth=e=>{this._isUnmounting||this.setState({innerWidth:e})},this.handleScrollStart=()=>{this.scrollState.date=void 0,this.scrollState.top=void 0},this.handleScrollEnd=e=>{const n=this.scrollerRef.current;e&&n&&(this.scrollState.top=n.y,this.scrollState.date=void 0)}}render(){const{context:e,props:n,state:s}=this,{options:r}=e,i=!n.forPrint&&!fe(r),a=this.splitDateProfileByMonth(e.dateProfileGenerator,n.dateProfile,e.dateEnv,r.fixedWeekCount,r.showNonCurrentDates),o=this.buildMonthFormat(r.singleMonthTitleFormat,a),{multiMonthMaxColumns:l,singleMonthMinWidth:c}=r,{innerWidth:u}=s;let h,g,m=!1;return u!=null&&(h=Math.max(1,Math.min(l,Math.floor(u/c))),n.forPrint&&(h=Math.min(h,2)),g=Mt(1/h),m=h>1),d.jsx(At,{unit:"day",children:(v,p)=>d.jsxs(kn,{viewSpec:e.viewSpec,className:b(!n.forPrint&&f.flexCol,n.className),children:[d.jsx(pe,{vertical:i,className:i?f.liquid:"",ref:this.scrollerRef,children:d.jsx("div",{role:"list",ref:this.tilesElRef,"aria-labelledby":n.labelId,"aria-label":n.labelStr,className:f.safeTiles,children:a.map((y,D)=>{const x=Mr(y.currentRange.start);return w.createElement(ny,{...n,key:x,todayRange:p,isoDateStr:x,titleFormat:o,dateProfile:y,width:g,colCount:h,isFirst:!D,isLast:D===a.length-1,hasLateralSiblings:m})})})}),d.jsx(Et,{widthRef:this.handleInnerWidth})]})})}componentDidMount(){this._isUnmounting=!1,this.scrollState.date=this.props.dateProfile.currentDate,this.scrollerRef.current.addScrollStartListener(this.handleScrollStart),this.scrollerRef.current.addScrollEndListener(this.handleScrollEnd),setTimeout(()=>{this.applyScroll()},0)}componentDidUpdate(e,n){e.dateProfile!==this.props.dateProfile?this.context.options.scrollTimeReset?this.resetScroll():this.applyScroll():n.innerWidth!==this.state.innerWidth&&this.applyScroll()}componentWillUnmount(){this._isUnmounting=!0,this.scrollerRef.current.removeScrollStartListener(this.handleScrollStart),this.scrollerRef.current.removeScrollEndListener(this.handleScrollEnd)}resetScroll(){this.scrollState.date=this.props.dateProfile.currentDate,this.scrollState.top=void 0,this.applyScroll()}applyScroll(){const e=this.scrollerRef.current,n=this.computeScrollTop();e&&n!=null&&e.scrollTo({y:n})}computeScrollTop(){const{scrollState:e}=this;if(e.top!=null)return e.top;if(e.date!=null){const n=this.tilesElRef.current,r=n?.querySelector(`[data-date="${Mr(e.date)}"]`)?.parentElement;if(n&&r){const i=Math.round(r.getBoundingClientRect().top),a=Math.round(n.getBoundingClientRect().top);return i-a}}}}const ry=_(1,"month");function iy(t,e,n,s,r){const{start:i,end:a}=e.currentRange;let o=i;const l=[];for(;o.valueOf()<a.valueOf();){const c=n.add(o,ry),u={start:t.skipHiddenDays(o),end:t.skipHiddenDays(c,-1,!0)};let h=Ko({currentRange:u,snapToWeek:!0,fixedWeekCount:s,dateEnv:n});h={start:t.skipHiddenDays(h.start),end:t.skipHiddenDays(h.end,-1,!0)};const g=e.activeRange?Ae(e.activeRange,r?h:u):null;l.push({currentDate:e.currentDate,isValid:e.isValid,validRange:e.validRange,renderRange:h,activeRange:g,currentRange:u,currentRangeUnit:"month",isRangeAllDay:!0,dateIncrement:e.dateIncrement,slotMinTime:e.slotMaxTime,slotMaxTime:e.slotMinTime}),o=c}return l}const ay=V({year:"numeric",month:"long"}),oy=V({month:"long"});function ly(t,e){return t||(e[0].currentRange.start.getUTCFullYear()!==e[e.length-1].currentRange.start.getUTCFullYear()?ay:oy)}var cy={name:"multimonth",initialView:"multiMonthYear",views:{multiMonth:{component:sy,dateProfileGeneratorClass:Xo,multiMonthMaxColumns:3,singleMonthMinWidth:350},multiMonthYear:{type:"multiMonth",duration:{years:1},fixedWeekCount:!0,showNonCurrentDates:!1}}};const Zn=de();class dy{constructor(){this.getKeysForEventDefs=k(this._getKeysForEventDefs),this.splitDateSelection=k(this._splitDateSpan),this.splitEventStore=k(this._splitEventStore),this.splitIndividualUi=k(this._splitIndividualUi),this.splitEventDrag=k(this._splitInteraction),this.splitEventResize=k(this._splitInteraction),this.eventUiBuilders={}}splitProps(e){let n=this.getKeyInfo(e),s=this.getKeysForEventDefs(e.eventStore),r=this.splitDateSelection(e.dateSelection),i=this.splitIndividualUi(e.eventUiBases,s),a=this.splitEventStore(e.eventStore,s),o=this.splitEventDrag(e.eventDrag),l=this.splitEventResize(e.eventResize),c={};this.eventUiBuilders=xe(n,(u,h)=>this.eventUiBuilders[h]||k(uy));for(let u in n){let h=n[u],g=a[u]||Zn,m=this.eventUiBuilders[u];c[u]={businessHours:h.businessHours||e.businessHours,dateSelection:r[u]||null,eventStore:g,eventUiBases:m(e.eventUiBases[""],h.ui,i[u]),eventDrag:o[u]||null,eventResize:l[u]||null,eventSelection:g.instances[e.eventSelection]?e.eventSelection:""}}return c}_splitDateSpan(e){let n={};if(e){let s=this.getKeysForDateSpan(e);for(let r of s)n[r]=e}return n}_getKeysForEventDefs(e){return xe(e.defs,n=>this.getKeysForEventDef(n))}_splitEventStore(e,n){let{defs:s,instances:r}=e,i={};for(let a in s)for(let o of n[a])i[o]||(i[o]=de()),i[o].defs[a]=s[a];for(let a in r){let o=r[a];for(let l of n[o.defId])i[l]&&(i[l].instances[a]=o)}return i}_splitIndividualUi(e,n){let s={};for(let r in e)if(r)for(let i of n[r])s[i]||(s[i]={}),s[i][r]=e[r];return s}_splitInteraction(e){let n={};if(e){let s=this._splitEventStore(e.affectedEvents,this._getKeysForEventDefs(e.affectedEvents)),r=this._getKeysForEventDefs(e.mutatedEvents),i=this._splitEventStore(e.mutatedEvents,r),a=o=>{n[o]||(n[o]={affectedEvents:s[o]||Zn,mutatedEvents:i[o]||Zn,isEvent:e.isEvent})};for(let o in s)a(o);for(let o in i)a(o)}return n}}function uy(t,e,n){let s=[];t&&s.push(t),e&&s.push(e);let r={"":Xa(s)};return n&&Object.assign(r,n),r}class hy extends dy{getKeyInfo(){return{allDay:{},timed:{}}}getKeysForDateSpan(e){return e.allDay?["allDay"]:["timed"]}getKeysForEventDef(e){return e.allDay?rg(e)?["timed","allDay"]:["allDay"]:["timed"]}}class fy extends Po{sliceRange(e,n){let s=[];for(let r=0;r<n.length;r+=1){let i=Ae(e,n[r]);i&&s.push({startDate:i.start,endDate:i.end,isStart:i.start.valueOf()===e.start.valueOf(),isEnd:i.end.valueOf()===e.end.valueOf(),col:r})}return s}}function bt(t,e){let n=[],s;for(s=0;s<e;s+=1)n.push([]);if(t)for(s=0;s<t.length;s+=1)n[t[s].col].push(t[s]);return n}function ci(t,e){let n=[];if(t){for(let s=0;s<e;s+=1)n[s]={affectedInstances:t.affectedInstances,isEvent:t.isEvent,segs:[]};for(let s of t.segs)n[s.col].segs.push(s)}else for(let s=0;s<e;s+=1)n[s]=null;return n}const di=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}];function gy(t,e,n,s,r){let i=new Date(0),a=t,o=_(0),l=n||my(s),c=[],u=0;for(;Re(a)<Re(e);){let h=r.add(i,a),g=ks(o,l)!==null;c.push({date:h,time:a,key:h.toISOString(),isoTimeStr:rf(h),isLabeled:g,isFirst:u===0}),a=Kn(a,s),o=Kn(o,s),u+=1}return c}function my(t){let e,n,s;for(e=di.length-1;e>=0;e-=1)if(n=_(di[e]),s=ks(n,t),s!==null&&s>1)return n;return t}class ll extends B{constructor(){super(...arguments),this.innerElRef=w.createRef()}render(){let{props:e}=this,{options:n,viewApi:s}=this.context,r={text:n.allDayText,view:s,isNarrow:e.isNarrow};return d.jsx(q,{tag:"div",attrs:{role:"rowheader"},className:b(f.flexRow,f.noMargin,f.noPadding,f.contentBox),style:{width:e.width},renderProps:r,generatorName:"allDayHeaderContent",customGenerator:n.allDayHeaderContent,defaultGenerator:py,classNameGenerator:n.allDayHeaderClass,didMount:n.allDayHeaderDidMount,willUnmount:n.allDayHeaderWillUnmount,children:i=>d.jsx("div",{className:b(f.flexRow,f.noShrink,f.whiteSpacePre),ref:this.innerElRef,children:d.jsx(i,{tag:"div",className:R(n.allDayHeaderInnerClass,r)})})})}componentDidMount(){this._isUnmounting=!1;const{props:e}=this,n=this.innerElRef.current;this.disconnectInnerWidth=Zs(n,s=>{this._isUnmounting||L(e.innerWidthRef,s)})}componentWillUnmount(){this._isUnmounting=!0,this.disconnectInnerWidth(),L(this.props.innerWidthRef,null)}}function py(t){return t.text}class cl extends ye{constructor(){super(...arguments),this.heightRef=w.createRef(),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e}):this.context.unregisterInteractiveComponent(this)}}render(){return d.jsx(qo,{...this.props,rootElRef:this.handleRootEl,heightRef:this.heightRef})}queryHit(e,n,s,r){const{props:i,heightRef:a}=this,o=i.cells.length,{col:l,left:c,right:u}=Js(n,r,i.colWidth,o,e),h=i.cells[l],g=h.date,m=te(g,1);return{dateProfile:i.dateProfile,dateSpan:{range:{start:g,end:m},allDay:!0,...h.dateSpanProps},getDayEl:()=>Qs(this.rootEl,l),rect:{left:c,right:u,top:0,bottom:a.current},layer:0}}}function vy(t,e,n){let s=new Vo(t.renderRange,e);return new zo(s,!1,n)}function yy(t,e,n){let s=[];for(let r of t.headerDates)s.push({start:n.add(r,e.slotMinTime),end:n.add(r,e.slotMaxTime)});return s}function dl(t,e,n=0,s,r){if(!s||!r)return[void 0,!1];const i=Math.max(s+1,n),a=r/e;let o,l;return t&&a>=i?(o=!0,l=a):(o=!1,l=i),[l,o]}function fn(t,e,n){return n||(n=z(t)),ul(_(t.valueOf()-n.valueOf()),e)}function ul(t,e){const n=Re(e.slotMinTime),s=Re(e.slotMaxTime);let r=(t.milliseconds-n)/(s-n);return r=Math.max(0,r),r=Math.min(1,r),r}function ui(t,e,n,s,r,i,a){const o=[];if(r!=null){const l=r*s;for(const c of t){const u=fn(c.startDate,e,n),h=fn(c.endDate,e,n),g=u*l;let m=h*l,v=m-g;i!=null&&v<i&&(v=i,m=g+v),o.push({start:g,end:m,size:v,isShort:v<=a})}}return o}function Sy(t,e,n,s){const r=[];for(let c=0;c<t.length;c++){const u=e[c];u&&r.push({...t[c],start:u.start,end:u.end})}const i=new us(r,void 0,n,void 0,s);let a=Ey(i);a=Cy(a,1);const o=Ry(a),l=Xp(i.hiddenSegs);return[o,l]}function Ey(t){const{placementsByLevel:e}=t,n=sr((r,i)=>r+":"+i,(r,i)=>{let a=wy(t,r,i),[o,l]=hi(a,n),c=e[r][i];return[{...c,nextLevelNodes:o},c.thickness+l]}),[s]=hi(e.length?{level:0,lateralStart:0,lateralEnd:e[0].length}:null,n);return s}function hi(t,e){if(!t)return[[],0];let{level:n,lateralStart:s,lateralEnd:r}=t,i=s,a=[];for(;i<r;)a.push(e(n,i)),i+=1;return a.sort(by),[a.map(Dy),a[0][1]]}function by(t,e){return e[1]-t[1]}function Dy(t){return t[0]}function wy(t,e,n){let{levelCoords:s,placementsByLevel:r}=t,i=r[e][n],a=s[e]+i.thickness,o=s.length,l=e;for(;l<o&&s[l]<a;l+=1);for(;l<o;l+=1){let c=r[l],u,h=hs(c,i.start,ds),g=h[0]+h[1],m=g;for(;(u=c[m])&&u.start<i.end;)m+=1;if(g<m)return{level:l,lateralStart:g,lateralEnd:m}}return null}function Cy(t,e){const n=sr((s,r,i)=>In(s),(s,r,i)=>{let{nextLevelNodes:a,thickness:o}=s,l=o+i,c=o/l,u,h=[];if(!a.length)u=e;else for(let m of a)if(u===void 0){let v=n(m,r,l);u=v[0],h.push(v[1])}else{let v=n(m,u,0);h.push(v[1])}let g=(u-r)*c;return[u-g,{...s,thickness:g,nextLevelNodes:h}]});return t.map(s=>n(s,0,0)[1])}function Ry(t){let e=new Map;const n=sr((r,i,a)=>In(r),(r,i,a)=>{let o={...r,levelCoord:i,stackDepth:a,stackForward:0};return e.set(o.eventRange.instance.instanceId,o),o.stackForward=s(r.nextLevelNodes,i+r.thickness,a+1)});function s(r,i,a){let o=0;for(let l of r)o=Math.max(n(l,i,a)+1,o);return o}return s(t,0,0),e}function sr(t,e){const n={};return(...s)=>{let r=t(...s);return r in n?n[r]:n[r]=e(...s)}}const xy=V({hour:"numeric",minute:"2-digit",meridiem:!1});class hl extends B{render(){const{props:e}=this;return d.jsx(Ot,{...e,display:"column",level:e.level,isNarrow:e.isNarrow,isShort:e.isShort,className:e.isLiquid?f.liquid:"",disableLiquid:!e.isLiquid,defaultTimeFormat:xy})}}class Ty extends B{render(){let{props:e}=this;return d.jsx("div",{className:b(f.abs,f.flexCol),style:{top:e.top,height:e.height,insetInlineEnd:0,zIndex:9999},children:d.jsx(_o,{className:f.liquid,display:"column",allDayDate:null,segs:e.hiddenSegs,hiddenSegs:e.hiddenSegs,dateSpanProps:e.dateSpanProps,dateProfile:e.dateProfile,todayRange:e.todayRange,popoverContent:()=>fl(e.hiddenSegs,e,!1),forceTimed:!0,isNarrow:e.isNarrow,isMicro:e.isMicro})})}}const My=t=>d.jsx(Me.Consumer,{children:e=>{let{options:n}=e;return d.jsx("div",{className:b(t.className,n.nowIndicatorDotClass),style:t.style})}}),Iy=t=>d.jsx(Me.Consumer,{children:e=>{let{options:n}=e,s={date:e.dateEnv.toDate(t.date),view:e.viewApi};return d.jsx(q,{elRef:t.elRef,tag:t.tag||"div",attrs:t.attrs,className:t.className,style:t.style,renderProps:s,generatorName:"nowIndicatorLineContent",customGenerator:n.nowIndicatorLineContent,classNameGenerator:n.nowIndicatorLineClass,didMount:n.nowIndicatorLineDidMount,willUnmount:n.nowIndicatorLineWillUnmount,children:t.children})}});function Ny(t){const e=t.totalHeight!=null?t.totalHeight*fn(t.nowDate,t.dateProfile,t.dayDate):void 0;return d.jsxs("div",{className:f.fill,style:{zIndex:2,pointerEvents:"none"},children:[d.jsx(Iy,{className:b(f.fillX,f.noMarginX,f.borderlessX),style:{top:e},date:t.nowDate}),(t.showDot??!0)&&d.jsx(My,{className:b(f.abs,f.start0),style:{top:e}})]})}const rr=typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes("firefox");class Hy extends B{constructor(){super(...arguments),this.sortEventSegs=k(zs),this.getDateMeta=k(Je)}render(){let{props:e,context:n}=this,{options:s,dateEnv:r}=n,i=s.selectMirror,a=e.eventDrag&&e.eventDrag.segs||e.eventResize&&e.eventResize.segs||i&&e.dateSelectionSegs||[],o=this.getDateMeta(e.date,r,e.dateProfile,e.todayRange);const l=b(e.borderStart?f.borderOnlyS:f.borderNone,e.width==null&&f.liquid,f.rel),c={width:e.width,zIndex:1},u=this.getIsStack(),h={...o,...e.renderProps,isStack:u,isNarrow:e.isNarrow,isMajor:e.isMajor,view:n.viewApi};if(o.isDisabled)return d.jsx("div",{role:"gridcell","aria-disabled":!0,className:b(R(s.dayLaneClass,h),l),style:c});const g=b(R(s.dayLaneInnerClass,h),!u&&f.fill),m=this.sortEventSegs(e.fgEventSegs,s.eventOrder);return d.jsx(q,{tag:"div",attrs:{...e.attrs,role:"gridcell",...o.isToday?{"aria-current":"date"}:{},"data-date":mt(e.date)},className:l,style:c,renderProps:h,generatorName:void 0,classNameGenerator:s.dayLaneClass,didMount:s.dayLaneDidMount,willUnmount:s.dayLaneWillUnmount,children:()=>d.jsxs(d.Fragment,{children:[this.renderFillSegs(e.businessHourSegs,"non-business"),this.renderFillSegs(e.bgEventSegs,"bg-event"),this.renderFillSegs(e.dateSelectionSegs,"highlight"),d.jsx("div",{className:g,style:{zIndex:1},children:this.renderFgSegs(m,!1)}),!!a.length&&d.jsx("div",{className:g,style:{zIndex:1},children:this.renderFgSegs(a,!0)}),this.renderNowIndicator(e.nowIndicatorSegs)]})})}renderFgSegs(e,n){const{props:s}=this;return this.getIsStack()?fl(e,s,n):this.renderPositionedFgSegs(e,n)}renderPositionedFgSegs(e,n){let{props:s,context:r}=this,{date:i,dateProfile:a,eventSelection:o,todayRange:l,nowDate:c}=s,{eventMaxStack:u,eventShortHeight:h,eventOrderStrict:g,eventMinHeight:m}=r.options,v=ui(e,a,i,s.slatCnt,s.slatHeight,m,h),[p,y]=Sy(e,v,g,u);return d.jsxs(d.Fragment,{children:[e.map((D,x)=>{let{eventRange:C}=D,{instanceId:E}=C.instance,T=v[x]||{},N=p.get(E),I=!n&&N?this.computeSegHStyle(N):{left:0,right:0,zIndex:0},P=E===o;P&&(I.zIndex+=1e3);let H=!!(s.eventDrag&&s.eventDrag.affectedInstances[E]),j=!!(s.eventResize&&s.eventResize.affectedInstances[E]),G=!n&&(H||j||!N);return d.jsx("div",{className:b(f.abs,f.flexCol),style:{visibility:G?"hidden":void 0,top:T.start,height:T.size,...I},children:d.jsx(hl,{eventRange:C,slicedStart:D.startDate,slicedEnd:D.endDate,isStart:D.isStart,isEnd:D.isEnd,isDragging:H,isResizing:j,isMirror:n,isSelected:P,level:N?N.stackDepth:0,isNarrow:s.isNarrow,isShort:T.isShort||!1,isLiquid:!0,...$e(C,l,c)})},E)}),this.renderHiddenGroups(y)]})}renderHiddenGroups(e){let{dateSpanProps:n,dateProfile:s,todayRange:r,nowDate:i,eventSelection:a,eventDrag:o,eventResize:l,isNarrow:c,isMicro:u}=this.props;return d.jsx(d.Fragment,{children:e.map(h=>d.jsx(Ty,{hiddenSegs:h.segs,top:h.start,height:h.end-h.start,isNarrow:c,isMicro:u,dateSpanProps:n,dateProfile:s,todayRange:r,nowDate:i,eventSelection:a,eventDrag:o,eventResize:l},h.key))})}renderFillSegs(e,n){let{props:s,context:r}=this,i=ui(e,s.dateProfile,s.date,s.slatCnt,s.slatHeight,r.options.eventMinHeight,r.options.eventShortHeight);return d.jsx(d.Fragment,{children:e.map((a,o)=>{const{eventRange:l}=a,c=i[o]||{};return d.jsx("div",{className:f.fillX,style:{top:c.start,height:c.size,marginInlineStart:-1},children:n==="bg-event"?d.jsx(Oo,{eventRange:l,isStart:a.isStart,isEnd:a.isEnd,isNarrow:s.isNarrow,isShort:c.isShort||!1,isVertical:!0,...$e(l,s.todayRange,s.nowDate)}):Wo(n,r.options)},dg(l))})})}renderNowIndicator(e){let{props:n}=this;if(!(n.forPrint||this.getIsStack()))return e.map((s,r)=>d.jsx(Ny,{nowDate:s.startDate,dayDate:n.date,dateProfile:n.dateProfile,totalHeight:n.slatHeight!=null?n.slatHeight*n.slatCnt:void 0,showDot:s.showDot??!0},r))}computeSegHStyle(e){let{options:n}=this.context,s=n.slotEventOverlap,r=e.levelCoord,i=e.levelCoord+e.thickness;s&&(i=Math.min(1,r+(i-r)*2));let a={zIndex:e.stackDepth+1,insetInlineStart:Mt(r),insetInlineEnd:Mt(1-i),marginInlineEnd:void 0};return s&&e.stackForward&&(a.marginInlineEnd=20),a}getIsStack(){const{eventPrintLayout:e}=this.context.options;return this.props.forPrint&&(e==="stack"||e!=="grid"&&rr)}}function fl(t,{todayRange:e,nowDate:n,eventSelection:s,eventDrag:r,eventResize:i},a){return d.jsx(d.Fragment,{children:t.map(o=>{let{eventRange:l}=o,{instanceId:c}=l.instance,u=!!(r&&r.affectedInstances[c]),h=!!(i&&i.affectedInstances[c]),g=u||h;return d.jsx("div",{className:f.breakInsideAvoid,style:{visibility:g?"hidden":void 0},children:d.jsx(hl,{eventRange:l,slicedStart:o.startDate,slicedEnd:o.endDate,isStart:o.isStart,isEnd:o.isEnd,isDragging:u,isResizing:h,isMirror:a,isSelected:c===s,level:0,isShort:!1,isNarrow:!1,disableResizing:!0,...$e(l,e,n)})},c)})})}class ir extends ye{constructor(){super(...arguments),this.processSlotOptions=k(ky),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,isHitComboAllowed:this.props.isHitComboAllowed}):this.context.unregisterInteractiveComponent(this)}}render(){const{props:e}=this;return d.jsx("div",{role:e.role,className:b(e.className,f.flexRow),ref:this.handleRootEl,children:e.cells.map((n,s)=>d.jsx(Hy,{dateProfile:e.dateProfile,nowDate:e.nowDate,todayRange:e.todayRange,date:n.date,isMajor:n.isMajor,slatCnt:e.slatCnt,renderProps:n.renderProps,attrs:n.attrs,dateSpanProps:n.dateSpanProps,forPrint:e.forPrint,borderStart:!!s,isNarrow:e.cellIsNarrow,isMicro:e.cellIsMicro,fgEventSegs:e.fgEventSegsByCol[s],bgEventSegs:e.bgEventSegsByCol[s],businessHourSegs:e.businessHourSegsByCol[s],nowIndicatorSegs:e.nowIndicatorSegsByCol[s],dateSelectionSegs:e.dateSelectionSegsByCol[s],eventDrag:e.eventDragByCol[s],eventResize:e.eventResizeByCol[s],eventSelection:e.eventSelection,width:e.colWidth,slatHeight:e.slatHeight},n.key))})}queryHit(e,n,s,r){const{dateProfile:i,cells:a,colWidth:o,slatHeight:l}=this.props,{dateEnv:c,options:u}=this.context,{snapDuration:h,snapsPerSlot:g}=this.processSlotOptions(u.slotDuration,u.snapDuration),m=a.length,{col:v,left:p,right:y}=Js(n,r,o,m,e),D=a[v],x=Math.floor(s/l),C=x*l,E=(s-C)/l,T=Math.floor(E*g),N=x*g+T,I=Kn(i.slotMinTime,tf(h,N)),P=c.add(D.date,I),H=c.add(P,h);return{dateProfile:i,dateSpan:{range:{start:P,end:H},allDay:!1,...D.dateSpanProps},getDayEl:()=>Qs(this.rootEl,v),rect:{left:p,right:y,top:C,bottom:C+l},layer:0}}}ir.addPropsEquality({style:We});function ky(t,e){let n=e||t,s=ks(t,n);return s===null&&(n=t,s=1),{snapDuration:n,snapsPerSlot:s}}const Py=t=>d.jsx(Me.Consumer,{children:e=>{let{options:n}=e,s={date:e.dateEnv.toDate(t.date),view:e.viewApi};return d.jsx(q,{elRef:t.elRef,tag:t.tag||"div",attrs:t.attrs,className:t.className,style:t.style,renderProps:s,generatorName:"nowIndicatorHeaderContent",customGenerator:n.nowIndicatorHeaderContent,classNameGenerator:n.nowIndicatorHeaderClass,didMount:n.nowIndicatorHeaderDidMount,willUnmount:n.nowIndicatorHeaderWillUnmount,children:t.children})}});function gl(t){return d.jsx("div",{className:b(f.fill,f.crop),style:{zIndex:2,pointerEvents:"none"},children:d.jsx(Py,{className:f.abs,style:{top:t.totalHeight!=null?t.totalHeight*fn(t.nowDate,t.dateProfile):void 0},date:t.nowDate})})}const jy=V({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"});class ml extends B{constructor(){super(...arguments),this.createRenderProps=k(Ly),this.innerElRef=w.createRef()}render(){let{props:e,context:n}=this,{options:s}=n,r=s.slotHeaderFormat==null?jy:Array.isArray(s.slotHeaderFormat)?V(s.slotHeaderFormat[0]):V(s.slotHeaderFormat),i=this.createRenderProps(e.date,e.time,!e.isLabeled,e.isNarrow,e.isFirst,r,n),a=b(e.liquidHeight&&f.liquid,f.flexRow,f.alignStart,f.noMargin,f.noPadding,e.borderTop?f.borderOnlyT:f.borderNone);return e.isLabeled?d.jsx(q,{tag:"div",attrs:{"data-time":e.isoTimeStr},style:{height:e.height},className:a,renderProps:i,generatorName:"slotHeaderContent",customGenerator:s.slotHeaderContent,defaultGenerator:Ay,classNameGenerator:s.slotHeaderClass,didMount:s.slotHeaderDidMount,willUnmount:s.slotHeaderWillUnmount,children:o=>d.jsx("div",{ref:this.innerElRef,className:b(f.noShrink,f.whiteSpaceNoWrap,f.flexRow),children:d.jsx(o,{tag:"div",className:R(s.slotHeaderInnerClass,i)})})}):d.jsx("div",{className:b(R(s.slotHeaderClass,i),a),style:{height:e.height}})}componentDidMount(){this._isUnmounting=!1;const{props:e}=this,n=this.innerElRef.current;n&&(this.disconnectInnerSize=St(n,(s,r)=>{this._isUnmounting||(L(e.innerWidthRef,s),L(e.innerHeightRef,r))}))}componentWillUnmount(){const{props:e}=this;this._isUnmounting=!0,this.disconnectInnerSize&&(this.disconnectInnerSize(),L(e.innerWidthRef,null),L(e.innerHeightRef,null))}}function Ly(t,e,n,s,r,i,a){return{...Je(t,a.dateEnv),level:0,text:ie(a.dateEnv.formatToParts(t,i)),time:e,isMajor:!1,isMinor:n,isTime:!0,isNarrow:s,hasNavLink:!1,isFirst:r,view:a.viewApi}}function Ay(t){return t.text}class pl extends B{constructor(){super(...arguments),this.getDateMeta=k(Je)}render(){let{props:e,context:n}=this,{options:s}=n,r={...this.getDateMeta(e.date,n.dateEnv),time:e.time,isMajor:!1,isMinor:!e.isLabeled,view:n.viewApi};return d.jsx(q,{tag:"div",attrs:{"data-time":e.isoTimeStr},className:b(f.noMargin,f.noPadding,f.liquid,e.borderTop?f.borderOnlyT:f.borderNone),renderProps:r,generatorName:void 0,classNameGenerator:s.slotLaneClass,didMount:s.slotLaneDidMount,willUnmount:s.slotLaneWillUnmount})}}const Oy=V({week:"short"});class vl extends B{constructor(){super(...arguments),this.innerElRef=w.createRef()}render(){let{props:e,context:n}=this,{options:s,dateEnv:r}=n,i=e.dateProfile.renderRange,o=Xe(i.start,i.end)===1&&s.navLinks,l=i.start,c=vt(n,l,"week"),u=r.computeWeekNumber(l),h=r.formatToParts(l,s.weekNumberFormat||Oy),g=ie(h),m=r.toDate(l);const v={num:u,text:g,textParts:h,date:m,isNarrow:e.isNarrow,hasNavLink:o,options:{dayMinWidth:s.dayMinWidth}};return d.jsx(q,{tag:"div",attrs:{role:"gridcell","aria-label":c},className:b(f.flexRow,f.noMargin,f.noPadding,e.isLiquid?f.liquid:f.contentBox),style:{width:e.width},renderProps:v,generatorName:"weekNumberHeaderContent",customGenerator:s.weekNumberHeaderContent,defaultGenerator:Nn,classNameGenerator:s.weekNumberHeaderClass,didMount:s.weekNumberHeaderDidMount,willUnmount:s.weekNumberHeaderWillUnmount,children:p=>d.jsx("div",{ref:this.innerElRef,className:b(f.flexRow,f.noShrink,f.whiteSpaceNoWrap),children:d.jsx(p,{tag:"div",attrs:o?yt(n,i.start,"week",c):{"aria-label":c},className:R(s.weekNumberHeaderInnerClass,v)})})})}componentDidMount(){this._isUnmounting=!1;const{props:e}=this,n=this.innerElRef.current;this.disconnectInnerSize=St(n,(s,r)=>{this._isUnmounting||(L(e.innerWidthRef,s),L(e.innerHeightRef,r))})}componentWillUnmount(){const{props:e}=this;this._isUnmounting=!0,this.disconnectInnerSize(),L(e.innerWidthRef,null),L(e.innerHeightRef,null)}}function yl(t){return d.jsx("div",{role:"gridcell",className:t.isLiquid?f.liquid:f.contentBox,style:{width:t.width}})}class Sl extends B{constructor(){super(...arguments),this.state={headerTierHeights:[]},this.headerLabelInnerWidthRefMap=new le(()=>{re(this.handleAxisWidths)}),this.headerLabelInnerHeightRefMap=new le(()=>{re(this.handleHeaderHeights)}),this.headerMainInnerHeightRefMap=new le(()=>{re(this.handleHeaderHeights)}),this.handleAllDayLabelInnerWidth=e=>{this.allDayLabelInnerWidth=e,re(this.handleAxisWidths)},this.slatLabelInnerWidthRefMap=new le(()=>{re(this.handleAxisWidths)}),this.slatLabelInnerHeightRefMap=new le(()=>{re(this.handleSlatInnerHeights)}),this.headerScrollerRef=w.createRef(),this.allDayScrollerRef=w.createRef(),this.mainScrollerRef=w.createRef(),this.footScrollerRef=w.createRef(),this.axisScrollerRef=w.createRef(),this.handleTotalWidth=e=>{this._isUnmounting||this.setState({totalWidth:e})},this.handleBodyHeight=e=>{this._isUnmounting||this.setState({bodyHeight:e})},this.handleClientWidth=e=>{this._isUnmounting||this.setState({clientWidth:e})},this.handleClientHeight=e=>{this._isUnmounting||this.setState({clientHeight:e})},this.handleStickyBottomScrollbarWidth=e=>{this._isUnmounting||this.setState({sticykBottomScrollbarWidth:e})},this.handleHeaderHeights=()=>{if(this._isUnmounting)return;const e=this.headerLabelInnerHeightRefMap.current,n=this.headerMainInnerHeightRefMap.current,s=[];for(const[r,i]of n.entries())s[r]=Math.max(e.get(r)||0,i);this.setState({headerTierHeights:s})},this.handleSlatInnerHeights=()=>{if(this._isUnmounting)return;const e=this.slatLabelInnerHeightRefMap.current;let n=0;for(const s of e.values())n=Math.max(n,s);this.state.slatInnerHeight!==n&&this.setState({slatInnerHeight:n})},this.handleAxisWidths=()=>{if(this._isUnmounting)return;const e=this.headerLabelInnerWidthRefMap.current,n=this.slatLabelInnerWidthRefMap.current;let s=this.allDayLabelInnerWidth||0;for(const r of e.values())s=Math.max(s,r);for(const r of n.values())s=Math.max(s,r);this.state.axisWidth!==s&&this.setState({axisWidth:s})}}render(){const{props:e,state:n,context:s,headerLabelInnerWidthRefMap:r,headerLabelInnerHeightRefMap:i,headerMainInnerHeightRefMap:a,slatLabelInnerWidthRefMap:o,slatLabelInnerHeightRefMap:l}=this,{nowDate:c,headerTiers:u,forPrint:h}=e,g=c.valueOf()-z(c).valueOf(),{axisWidth:m,totalWidth:v,clientWidth:p,clientHeight:y,bodyHeight:D,sticykBottomScrollbarWidth:x}=n,{options:C}=s,{borderlessX:E,borderlessTop:T,borderlessBottom:N}=ve(C),I=v!=null&&p!=null&&m!=null?v-p-(m+1):void 0,P=!h&&!fe(C),H=!h&&Hn(C),j=!h&&yo(C),{eventPrintLayout:G}=C,U=G==="stack"||G!=="grid"&&rr,F=h&&!U,Z=h&&U,Q=e.cells.length,[X,ae]=Yo(Q,e.dayMinWidth,p),ne=ae!=null&&ae<=Wt,K=ne||ae!=null&&ae<=C.dayNarrowWidth,Se=e.slatMetas.length,[ge,Ie]=dl(P&&C.expandRows,Se,C.slotMinHeight,n.slatInnerHeight,y);this.slatHeight=ge;const A=(ge||0)*Se,J=F?A:void 0,oe=P&&!C.expandRows&&y!=null&&y>A,me=C.dayHeaders?u.length+1:1,W=j?x:D!=null&&y!=null?D-y:void 0;return d.jsxs(d.Fragment,{children:[C.dayHeaders&&d.jsxs("div",{className:b(R(C.tableHeaderClass,{isSticky:H,borderlessX:E,borderlessTop:T,borderlessBottom:N,multiMonthColumns:0}),f.flexCol,H&&f.tableHeaderSticky),style:{zIndex:1},children:[d.jsxs("div",{className:f.flexRow,children:[d.jsx("div",{role:"rowgroup",className:f.contentBox,style:{width:m},children:u.map((Y,ee)=>d.jsx("div",{role:"row","aria-rowindex":ee+1,className:b(C.dayHeaderRowClass,f.flexRow,f.contentBox,ee<e.headerTiers.length-1?f.borderOnlyB:f.borderNone),style:{height:n.headerTierHeights[ee]},children:C.weekNumbers&&Y.isDateRow?d.jsx(vl,{dateProfile:e.dateProfile,innerWidthRef:r.createRef(ee),innerHeightRef:i.createRef(ee),width:void 0,isLiquid:!0,isNarrow:K}):d.jsx(yl,{width:void 0,isLiquid:!0})},ee))}),d.jsx("div",{className:R(C.slotHeaderDividerClass,{inTableHeader:!0,options:{dayMinWidth:C.dayMinWidth}})}),d.jsxs(pe,{horizontal:!0,hideScrollbars:!0,className:b(f.flexRow,f.liquid),ref:this.headerScrollerRef,children:[d.jsx("div",{role:"rowgroup",className:X==null?f.liquid:"",style:{width:X},children:e.headerTiers.map((Y,ee)=>w.createElement(Pn,{...Y,key:ee,role:"row",rowIndex:ee,borderBottom:ee<e.headerTiers.length-1,height:n.headerTierHeights[ee],colWidth:ae,viewportWidth:p,innerHeightRef:a.createRef(ee),cellIsNarrow:K,cellIsMicro:ne,rowLevel:e.headerTiers.length-ee-1}))}),!!I&&d.jsx("div",{className:b(R(C.fillerClass,{inTableHeader:!0}),f.borderOnlyS),style:{minWidth:I}})]})]}),d.jsx("div",{className:R(C.dayHeaderDividerClass,{isSticky:H,multiMonthColumns:0,options:{allDaySlot:!!C.allDaySlot}})})]}),d.jsxs("div",{role:"rowgroup",className:b(R(C.tableBodyClass,{borderlessX:E,borderlessTop:T,borderlessBottom:N,multiMonthColumns:0}),f.flexCol,P&&f.liquid,f.isolate),style:{zIndex:0},children:[C.allDaySlot&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{role:"row","aria-rowindex":me,className:f.flexRow,style:{zIndex:1},children:[d.jsx(ll,{width:m,innerWidthRef:this.handleAllDayLabelInnerWidth,isNarrow:K}),d.jsx("div",{className:R(C.slotHeaderDividerClass,{inTableHeader:!1,options:{dayMinWidth:C.dayMinWidth}})}),d.jsxs(pe,{horizontal:!0,hideScrollbars:!0,className:b(f.flexRow,f.liquidX),ref:this.allDayScrollerRef,children:[d.jsx("div",{className:f.flexRow,style:{width:X},children:d.jsx(cl,{dateProfile:e.dateProfile,todayRange:e.todayRange,cells:e.cells,showDayNumbers:!1,forPrint:h,isHitComboAllowed:e.isHitComboAllowed,className:b(f.borderNone,f.liquidX),cellIsNarrow:K,cellIsMicro:ne,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:e.businessHourSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,colWidth:ae})}),!!I&&d.jsx("div",{className:b(R(C.fillerClass,{inTableHeader:!1}),f.borderOnlyS),style:{minWidth:I}})]})]}),d.jsx("div",{className:b(C.allDayDividerClass),style:{zIndex:2}})]}),d.jsxs("div",{role:"row","aria-rowindex":me+(C.allDaySlot?1:0),className:b(f.flexRow,f.rel,P&&f.liquid),style:{zIndex:0},children:[d.jsx(pe,{vertical:P,hideScrollbars:!0,className:b(f.flexCol,f.contentBox),style:{width:m},ref:this.axisScrollerRef,clientHeightRef:this.handleBodyHeight,children:!Z&&d.jsx(d.Fragment,{children:d.jsxs("div",{role:"rowheader","aria-label":C.timedText,className:b(f.flexCol,f.grow,f.rel),style:{height:J},children:[d.jsx("div",{"aria-hidden":!0,className:b(f.flexCol,P&&C.expandRows&&f.grow,F&&f.fillX),children:e.slatMetas.map((Y,ee)=>w.createElement(ml,{...Y,key:Y.key,innerWidthRef:o.createRef(Y.key),innerHeightRef:l.createRef(Y.key),borderTop:!!ee,isNarrow:K,height:Ie?void 0:ge,liquidHeight:Ie}))}),!h&&C.nowIndicator&&Ce(e.dateProfile.currentRange,c)&&g>=e.dateProfile.slotMinTime.milliseconds&&g<e.dateProfile.slotMaxTime.milliseconds&&d.jsx(gl,{nowDate:c,dateProfile:e.dateProfile,totalHeight:ge!=null?ge*Se:void 0}),!!(oe||W)&&d.jsx("div",{className:b(R(C.fillerClass,{inTableHeader:!1}),f.borderOnlyT,oe&&f.liquid),style:{minHeight:W}})]})})}),d.jsx("div",{className:R(C.slotHeaderDividerClass,{inTableHeader:!1,options:{dayMinWidth:C.dayMinWidth}})}),d.jsxs("div",{className:b(f.flexCol,f.liquid),children:[d.jsx(pe,{vertical:P,horizontal:!0,hideScrollbars:j||h,className:b(f.flexCol,f.rel,P&&f.liquid),ref:this.mainScrollerRef,clientWidthRef:this.handleClientWidth,clientHeightRef:this.handleClientHeight,children:d.jsxs("div",{className:b(f.flexCol,f.grow,f.rel),style:{width:X,height:J},children:[d.jsx(ir,{dateProfile:e.dateProfile,nowDate:e.nowDate,todayRange:e.todayRange,cells:e.cells,slatCnt:Se,forPrint:h,isHitComboAllowed:e.isHitComboAllowed,className:Z?"":f.fill,fgEventSegsByCol:e.fgEventSegsByCol,bgEventSegsByCol:e.bgEventSegsByCol,businessHourSegsByCol:e.businessHourSegsByCol,nowIndicatorSegsByCol:e.nowIndicatorSegsByCol,dateSelectionSegsByCol:e.dateSelectionSegsByCol,eventDragByCol:e.eventDragByCol,eventResizeByCol:e.eventResizeByCol,eventSelection:e.eventSelection,colWidth:ae,slatHeight:ge,cellIsNarrow:K,cellIsMicro:ne}),!Z&&d.jsxs(d.Fragment,{children:[d.jsx("div",{"aria-hidden":!0,className:b(f.flexCol,P&&C.expandRows&&f.grow,F?f.fillX:f.rel),children:e.slatMetas.map((Y,ee)=>d.jsx("div",{className:b(f.flexRow,Ie&&f.liquid),style:{height:Ie?"":ge},children:w.createElement(pl,{...Y,key:Y.key,borderTop:!!ee})},Y.key))}),oe&&d.jsx("div",{className:b(R(C.fillerClass,{inTableHeader:!1}),f.borderOnlyT,f.liquid)})]})]})}),!!j&&d.jsx(Zo,{isSticky:!0,canvasWidth:X,scrollerRef:this.footScrollerRef,scrollbarWidthRef:this.handleStickyBottomScrollbarWidth})]})]})]}),d.jsx(Et,{widthRef:this.handleTotalWidth})]})}componentDidMount(){this._isUnmounting=!1,this.initScrollers(),this.updateSlatHeight()}componentDidUpdate(){this.updateScrollers(),this.updateSlatHeight()}componentWillUnmount(){this._isUnmounting=!0,this.destroyScrollers(),this.prevSlatHeight=void 0,L(this.props.slatHeightRef,null)}updateSlatHeight(){this.prevSlatHeight!==this.slatHeight&&L(this.props.slatHeightRef,this.prevSlatHeight=this.slatHeight)}initScrollers(){const e=So(this.context.pluginHooks);this.dayScroller=new e(!0),this.timeScroller=new e,L(this.props.dayScrollerRef,this.dayScroller),L(this.props.timeScrollerRef,this.timeScroller),this.updateScrollers()}updateScrollers(){this.dayScroller.handleChildren([this.headerScrollerRef.current,this.allDayScrollerRef.current,this.mainScrollerRef.current,this.footScrollerRef.current]),this.timeScroller.handleChildren([this.axisScrollerRef.current,this.mainScrollerRef.current])}destroyScrollers(){L(this.props.dayScrollerRef,null),L(this.props.timeScrollerRef,null)}}Sl.addPropsEquality({headerTierHeights:lt});class Wy extends B{constructor(){super(...arguments),this.state={},this.headerLabelInnerWidthRefMap=new le(()=>{re(this.handleAxisInnerWidths)}),this.handleAllDayLabelInnerWidth=e=>{this.allDayLabelInnerWidth=e,re(this.handleAxisInnerWidths)},this.handleWeekNumberInnerWidth=e=>{this.weekNumberInnerWidth=e,re(this.handleAxisInnerWidths)},this.slatLabelInnerWidthRefMap=new le(()=>{re(this.handleAxisInnerWidths)}),this.slatLabelInnerHeightRefMap=new le(()=>{re(this.handleSlatInnerHeights)}),this.handleTotalWidth=e=>{this._isUnmounting||requestAnimationFrame(()=>{this._isUnmounting||this.setState({totalWidth:e})})},this.handleClientWidth=e=>{this._isUnmounting||this.setState({clientWidth:e})},this.handleClientHeight=e=>{this._isUnmounting||this.setState({clientHeight:e})},this.handleAxisInnerWidths=()=>{if(this._isUnmounting)return;const e=this.headerLabelInnerWidthRefMap.current,n=this.slatLabelInnerWidthRefMap.current;let s=Math.max(this.weekNumberInnerWidth||0,this.allDayLabelInnerWidth||0);for(const r of e.values())s=Math.max(s,r);for(const r of n.values())s=Math.max(s,r);this.state.axisWidth!==s&&this.setState({axisWidth:s})},this.handleSlatInnerHeights=()=>{if(this._isUnmounting)return;const e=this.slatLabelInnerHeightRefMap.current;let n=0;for(const s of e.values())n=Math.max(n,s);this.state.slatInnerHeight!==n&&this.setState({slatInnerHeight:n})}}render(){const{props:e,state:n,context:s,slatLabelInnerWidthRefMap:r,slatLabelInnerHeightRefMap:i,headerLabelInnerWidthRefMap:a}=this,{nowDate:o,forPrint:l}=e,c=o.valueOf()-z(o).valueOf(),{axisWidth:u,clientWidth:h,totalWidth:g}=n,{options:m}=s,{borderlessX:v,borderlessTop:p,borderlessBottom:y}=ve(m),D=g!=null&&h!=null&&!l?g-h:void 0,x=!l&&!fe(m),C=!l&&Hn(m),E=e.slatMetas.length,[T,N]=dl(x&&m.expandRows,E,m.slotMinHeight,n.slatInnerHeight,n.clientHeight);this.slatHeight=T;const I=(T||0)*E,P=x&&!m.expandRows&&n.clientHeight!=null&&n.clientHeight>I,{eventPrintLayout:H}=m,j=H==="stack"||H!=="grid"&&rr,G=l&&!j,U=l&&j,F=G?I:void 0,Z=e.cells.length,Q=h!=null?h/Z:void 0,X=Q!=null&&Q<=Wt,ae=X||Q!=null&&Q<=m.dayNarrowWidth;return d.jsxs(d.Fragment,{children:[m.dayHeaders&&d.jsxs("div",{role:"rowgroup",className:b(R(m.tableHeaderClass,{isSticky:C,borderlessX:v,borderlessTop:p,borderlessBottom:y,multiMonthColumns:0}),f.flexCol,C&&f.tableHeaderSticky),style:{zIndex:1},children:[e.headerTiers.map((ne,K)=>d.jsxs("div",{role:"row",className:f.flexRow,children:[d.jsx("div",{className:b(m.dayHeaderRowClass,f.flexRow,K<e.headerTiers.length-1?f.borderOnlyB:f.borderNone),children:m.weekNumbers&&ne.isDateRow?d.jsx(vl,{dateProfile:e.dateProfile,innerWidthRef:this.handleWeekNumberInnerWidth,innerHeightRef:a.createRef(K),width:u,isLiquid:!1,isNarrow:ae}):d.jsx(yl,{width:u,isLiquid:!1})}),d.jsx("div",{className:R(m.slotHeaderDividerClass,{inTableHeader:!0,options:{dayMinWidth:m.dayMinWidth}})}),d.jsx(Pn,{...ne,className:f.liquid,borderBottom:K<e.headerTiers.length-1,viewportWidth:h,cellIsNarrow:ae,cellIsMicro:X,rowLevel:e.headerTiers.length-K-1}),!!D&&d.jsx("div",{className:b(R(m.fillerClass,{inTableHeader:!0}),f.borderOnlyS),style:{minWidth:D}})]},K)),d.jsx("div",{className:R(m.dayHeaderDividerClass,{isSticky:C,multiMonthColumns:0,options:{allDaySlot:!!m.allDaySlot}})})]}),d.jsxs("div",{role:"rowgroup",className:b(R(m.tableBodyClass,{borderlessX:v,borderlessTop:p,borderlessBottom:y,multiMonthColumns:0}),f.flexCol,x&&f.liquid,f.isolate),style:{zIndex:0},children:[m.allDaySlot&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{role:"row",className:f.flexRow,style:{zIndex:1},children:[d.jsx(ll,{width:u,innerWidthRef:this.handleAllDayLabelInnerWidth,isNarrow:ae}),d.jsx("div",{className:R(m.slotHeaderDividerClass,{inTableHeader:!1,options:{dayMinWidth:m.dayMinWidth}})}),d.jsx(cl,{dateProfile:e.dateProfile,todayRange:e.todayRange,cells:e.cells,showDayNumbers:!1,forPrint:l,isHitComboAllowed:e.isHitComboAllowed,className:b(f.liquidX,f.borderNone),cellIsNarrow:ae,cellIsMicro:X,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:e.businessHourSegs,dateSelectionSegs:e.dateSelectionSegs,eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows}),!!D&&d.jsx("div",{className:b(R(m.fillerClass,{inTableHeader:!1}),f.borderOnlyS),style:{minWidth:D}})]}),d.jsx("div",{className:b(m.allDayDividerClass),style:{zIndex:2}})]}),d.jsx(pe,{vertical:x,className:b(f.flexCol,f.rel,x&&f.liquid),style:{zIndex:0},ref:e.timeScrollerRef,clientWidthRef:this.handleClientWidth,clientHeightRef:this.handleClientHeight,children:d.jsxs("div",{className:b(f.flexCol,f.grow,f.rel),style:{height:F},children:[d.jsxs("div",{role:"row",className:b(f.flexRow,!U&&f.fill),children:[d.jsx("div",{role:"rowheader","aria-label":m.timedText,className:f.contentBox,style:{width:u}}),d.jsx("div",{className:R(m.slotHeaderDividerClass,{inTableHeader:!1,options:{dayMinWidth:m.dayMinWidth}})}),d.jsx(ir,{dateProfile:e.dateProfile,nowDate:e.nowDate,todayRange:e.todayRange,cells:e.cells,slatCnt:E,forPrint:l,isHitComboAllowed:e.isHitComboAllowed,className:f.liquid,fgEventSegsByCol:e.fgEventSegsByCol,bgEventSegsByCol:e.bgEventSegsByCol,businessHourSegsByCol:e.businessHourSegsByCol,nowIndicatorSegsByCol:e.nowIndicatorSegsByCol,dateSelectionSegsByCol:e.dateSelectionSegsByCol,eventDragByCol:e.eventDragByCol,eventResizeByCol:e.eventResizeByCol,eventSelection:e.eventSelection,slatHeight:T,cellIsNarrow:ae,cellIsMicro:X})]}),!U&&d.jsxs(d.Fragment,{children:[d.jsx("div",{"aria-hidden":!0,className:b(f.flexCol,x&&m.expandRows&&f.grow,G?f.fillX:f.rel),children:e.slatMetas.map((ne,K)=>d.jsxs("div",{className:b(N&&f.liquid,f.flexRow),style:{height:N?void 0:T},children:[d.jsx("div",{className:f.flexCol,style:{width:u},children:w.createElement(ml,{...ne,key:ne.key,innerWidthRef:r.createRef(ne.key),innerHeightRef:i.createRef(ne.key),borderTop:!!K,isNarrow:ae})}),d.jsx("div",{className:R(m.slotHeaderDividerClass,{inTableHeader:!1,options:{dayMinWidth:m.dayMinWidth}}),style:{visibility:"hidden"}}),w.createElement(pl,{...ne,key:ne.key,borderTop:!!K})]},ne.key))}),P&&d.jsx("div",{className:b(R(m.fillerClass,{inTableHeader:!1}),f.borderOnlyT,f.liquid)}),!l&&m.nowIndicator&&Ce(e.dateProfile.currentRange,o)&&c>=e.dateProfile.slotMinTime.milliseconds&&c<e.dateProfile.slotMaxTime.milliseconds&&d.jsx(gl,{nowDate:o,dateProfile:e.dateProfile,totalHeight:T!=null?T*E:void 0})]})]})})]}),d.jsx(Et,{widthRef:this.handleTotalWidth})]})}componentDidMount(){this._isUnmounting=!1,this.updateSlatHeight()}componentDidUpdate(){this.updateSlatHeight()}componentWillUnmount(){this._isUnmounting=!0,this.prevSlatHeight=void 0,L(this.props.slatHeightRef,null)}updateSlatHeight(){this.prevSlatHeight!==this.slatHeight&&L(this.props.slatHeightRef,this.prevSlatHeight=this.slatHeight)}}function fi(t){return t.map(()=>[])}function gi(t){return t.map(()=>null)}class By extends B{constructor(){super(...arguments),this.buildSlatMetas=k(gy),this.dayScrollerRef=w.createRef(),this.timeScrollerRef=w.createRef(),this.scrollState={},this.handleSlatHeight=e=>{this._isUnmounting||(this.slatHeight=e,e!=null&&re(this.applyTimeScroll))},this.handleTimeScrollRequest=e=>{this.scrollState.time=e,this.scrollState.y=void 0,this.applyTimeScroll()},this.handleTimeScrollEnd=e=>{if(e){const n=this.timeScrollerRef.current.y;this.props.forPrint||(this.scrollState.y=n,this.scrollState.time=void 0)}},this.applyTimeScroll=()=>{const e=this.timeScrollerRef.current,{slatHeight:n,scrollState:s}=this;let{y:r,time:i}=s;r==null&&i&&n!=null&&e&&(r=ul(i,this.props.dateProfile)*(n*this.currentSlatCnt),r&&r++,s.y=r),r!=null&&e.scrollTo({y:r})}}render(){const{props:e,context:n}=this,{dateProfile:s}=e,{options:r,dateEnv:i}=n,{dayMinWidth:a}=r,{borderlessX:o,borderlessTop:l,borderlessBottom:c}=ve(r),u=this.buildSlatMetas(s.slotMinTime,s.slotMaxTime,r.slotHeaderInterval,r.slotDuration,i);this.currentSlatCnt=u.length;const h=e.forPrint?[]:e.businessHourSegs,g=e.forPrint?[]:e.dateSelectionSegs,m=e.forPrint?null:e.eventDrag,v=e.forPrint?null:e.eventResize,p=e.forPrint?fi(e.businessHourSegsByCol):e.businessHourSegsByCol,y=e.forPrint?fi(e.dateSelectionSegsByCol):e.dateSelectionSegsByCol,D=e.forPrint?gi(e.eventDragByCol):e.eventDragByCol,x=e.forPrint?gi(e.eventResizeByCol):e.eventResizeByCol,C={dateProfile:s,nowDate:e.nowDate,todayRange:e.todayRange,cells:e.cells,slatMetas:u,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed,headerTiers:e.headerTiers,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:h,dateSelectionSegs:g,eventDrag:m,eventResize:v,...Uy(r),fgEventSegsByCol:e.fgEventSegsByCol,bgEventSegsByCol:e.bgEventSegsByCol,businessHourSegsByCol:p,nowIndicatorSegsByCol:e.nowIndicatorSegsByCol,dateSelectionSegsByCol:y,eventDragByCol:D,eventResizeByCol:x,eventSelection:e.eventSelection,timeScrollerRef:this.timeScrollerRef,timeScrollState:this.scrollState,slatHeightRef:this.handleSlatHeight,borderlessX:o,borderlessBottom:c};return d.jsx(kn,{attrs:{role:"grid","aria-colcount":e.cells.length,"aria-labelledby":e.labelId,"aria-label":e.labelStr},className:b(e.className,R(r.tableClass,{borderlessX:o,borderlessTop:l,borderlessBottom:c,multiMonthColumns:0}),!e.forPrint&&f.flexCol,f.isolate),viewSpec:n.viewSpec,children:a?d.jsx(Sl,{...C,dayMinWidth:a,dayScrollerRef:this.dayScrollerRef}):d.jsx(Wy,{...C})})}componentDidMount(){this._isUnmounting=!1,this.resetScroll(),this.context.emitter.on("_timeScrollRequest",this.handleTimeScrollRequest);const e=this.timeScrollerRef.current;e&&e.addScrollEndListener(this.handleTimeScrollEnd)}componentDidUpdate(e){e.dateProfile!==this.props.dateProfile&&this.context.options.scrollTimeReset?this.resetScroll():e.forPrint&&!this.props.forPrint&&this.applyTimeScroll()}componentWillUnmount(){this._isUnmounting=!0,this.context.emitter.off("_timeScrollRequest",this.handleTimeScrollRequest);const e=this.timeScrollerRef.current;e&&e.removeScrollEndListener(this.handleTimeScrollEnd)}resetScroll(){this.handleTimeScrollRequest(this.context.options.scrollTime);const e=this.dayScrollerRef.current;e&&e.scrollTo({x:0})}}const _y=5;function Uy(t){let{dayMaxEvents:e,dayMaxEventRows:n}=t;return(e===!0||n===!0)&&(e=void 0,n=_y),{dayMaxEvents:e,dayMaxEventRows:n}}class Fy extends ye{constructor(){super(...arguments),this.createDayHeaderFormatter=k(er),this.buildTimeColsModel=k(vy),this.buildDayRanges=k(yy),this.buildDateRowConfigs=k(jo),this.splitFgEventSegs=k(bt),this.splitBgEventSegs=k(bt),this.splitBusinessHourSegs=k(bt),this.splitNowIndicatorSegs=k(bt),this.splitDateSelectionSegs=k(bt),this.splitEventDrag=k(ci),this.splitEventResize=k(ci),this.allDaySplitter=new hy,this.dayTableSlicer=new Ks,this.dayTimeColsSlicer=new fy}render(){const{props:e,context:n}=this,{dateProfile:s}=e,{options:r,dateProfileGenerator:i}=n,a=this.buildTimeColsModel(s,i,n.dateEnv),o=this.buildDayRanges(a,s,n.dateEnv),l=this.allDaySplitter.splitProps(e),c=this.dayTableSlicer.sliceProps(l.allDay,s,r.nextDayThreshold,n,a),u=this.dayTimeColsSlicer.sliceProps(l.timed,s,null,n,o),h=this.createDayHeaderFormatter(n.options.dayHeaderFormat,!0,a.colCount);return d.jsx(At,{unit:r.nowIndicator?"minute":"day",children:(g,m)=>{const v=a.cellRows[0].length,p=!e.forPrint&&r.nowIndicator&&this.dayTimeColsSlicer.sliceNowDate(g,s,r.nextDayThreshold,n,o),y=this.splitFgEventSegs(u.fgEventSegs,v),D=this.splitBgEventSegs(u.bgEventSegs,v),x=this.splitBusinessHourSegs(u.businessHourSegs,v),C=this.splitNowIndicatorSegs(p,v),E=this.splitDateSelectionSegs(u.dateSelectionSegs,v),T=this.splitEventDrag(u.eventDrag,v),N=this.splitEventResize(u.eventResize,v),I=this.buildDateRowConfigs(a.headerDates,!0,e.dateProfile,m,h,n);return d.jsx(By,{labelId:e.labelId,labelStr:e.labelStr,dateProfile:s,nowDate:g,todayRange:m,cells:a.cellRows[0],forPrint:e.forPrint,className:e.className,headerTiers:I,fgEventSegs:c.fgEventSegs,bgEventSegs:c.bgEventSegs,businessHourSegs:c.businessHourSegs,dateSelectionSegs:c.dateSelectionSegs,eventDrag:c.eventDrag,eventResize:c.eventResize,fgEventSegsByCol:y,bgEventSegsByCol:D,businessHourSegsByCol:x,nowIndicatorSegsByCol:C,dateSelectionSegsByCol:E,eventDragByCol:T,eventResizeByCol:N,eventSelection:e.eventSelection})}})}}var Vy={name:"timegrid",initialView:"timeGridWeek",deps:[Jo],views:{timeGrid:{component:Fy,usesMinMaxTime:!0,allDaySlot:!0,slotDuration:"00:30:00",slotEventOverlap:!0},timeGridDay:{type:"timeGrid",duration:{days:1}},timeGridWeek:{type:"timeGrid",duration:{weeks:1}}}};const zy=60,Gy=6e4,Yy=864e5;function qy(t,e,n){return n?El(t):{date:t.slice(0,10),startTime:t.slice(11,16),endTime:e.slice(11,16),allDay:!1}}function $y(t,e){if(e)return El(t);const n=t.slice(11,16);return{date:t.slice(0,10),startTime:n,endTime:Nl(n,zy),allDay:!1}}function El(t){return{date:t.slice(0,10),startTime:"",endTime:"",allDay:!0}}function Zy(t,e,n,s){const r=Date.parse(e)-Date.parse(t);return n?Math.round(r/Yy)>1:r/Gy>s}const Xy=[Jo,Vy,ty,cy,zv],mi={year:"multiMonthYear",month:"dayGridMonth",week:"timeGridWeek",day:"timeGridDay",agenda:"listWeek"},Ky={year:{weekday:"narrow"},month:{weekday:"short"},week:{weekday:"short",day:"numeric"},day:{weekday:"short",day:"numeric"},agenda:{weekday:"short",day:"numeric"}},Jy=new Set(["year","month","agenda"]),Qy={comfortable:{slotMinutes:30,slotMinHeight:26,eventShortHeight:34},compact:{slotMinutes:60,slotMinHeight:15,eventShortHeight:22}},bl="cal-1",eS={color:bl,rsvp:"accepted",status:"confirmed",hasThread:!1,isRecurring:!1,zoneCertainty:"local"};function tS(t){return{id:t.id,title:t.title,start:t.start,end:t.end,allDay:t.allDay}}function nS({view:t,date:e,events:n,colorByCalendarId:s,density:r,selectedEventId:i,timeZone:a,now:o,onSelectEvent:l,onPickSlot:c,onRangeChange:u,className:h}){const g=w.useRef(null);w.useEffect(()=>{g.current?.getApi().changeView(mi[t])},[t]),w.useEffect(()=>{g.current?.getApi().gotoDate(e)},[e]);const m=w.useMemo(()=>n.map(tS),[n]),v=w.useMemo(()=>new Map(n.map(E=>[E.id,{color:s[E.calendarId]??bl,rsvp:E.myRsvp,status:E.status,hasThread:E.threadId!=="",isRecurring:E.recurrenceRule!=="",zoneCertainty:E.zoneCertainty}])),[n,s]),p=w.useMemo(()=>E=>v.get(E)??eS,[v]),y=w.useMemo(()=>E=>E.event.allDay||Jy.has(t),[t]),D=w.useMemo(()=>E=>{const T=p(E.event.id),N=y(E);return O(ua({color:T.color,layout:N?"row":"column",density:"compact",rsvp:T.rsvp,status:T.status,selected:E.event.id===i,stacked:!1}),"cursor-pointer outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring",N?"my-px px-1 py-0":"px-1 py-0.5")},[p,y,i]),x=Qy[r],C=r==="compact";return d.jsx("div",{className:O("h-full min-h-0 w-full text-fg",h),children:d.jsx(lp,{ref:g,plugins:Xy,initialView:mi[t],initialDate:e,now:o,timeZone:a,height:"100%",headerToolbar:!1,firstDay:1,nowIndicator:!0,selectable:!0,selectMirror:!0,editable:!1,eventInteractive:!0,expandRows:!0,allDayText:"All day",dayMaxEvents:C?2:3,eventMaxStack:3,moreLinkClick:"popover",moreLinkText:E=>`+${E}`,slotMinTime:"07:00:00",slotMaxTime:"23:00:00",scrollTime:"08:30:00",scrollTimeReset:!1,slotDuration:{minutes:x.slotMinutes},slotMinHeight:x.slotMinHeight,eventShortHeight:x.eventShortHeight,displayEventEnd:!1,eventTimeFormat:{hour:"2-digit",minute:"2-digit",hour12:!1},slotHeaderFormat:{hour:"2-digit",minute:"2-digit",hour12:!1},dayHeaderFormat:Ky[t],events:m,eventClick:E=>l(E.event.id),dateClick:E=>c($y(E.dateStr,E.allDay)),select:E=>{if(!Zy(E.startStr,E.endStr,E.allDay,x.slotMinutes)){E.view.calendar.unselect();return}c(qy(E.startStr,E.endStr,E.allDay))},datesSet:E=>u(E.view.title),viewClass:"bg-surface",tableClass:"border-line",tableHeaderClass:"bg-surface",fillerClass:"border-line",dayHeaderRowClass:"h-pane-header",dayHeaderClass:E=>O("border-b border-line bg-surface",E.isToday?"text-accent":"text-fg-subtle"),dayHeaderInnerClass:"px-1 py-1 text-2xs font-semibold uppercase tracking-wider",dayHeaderDividerClass:"border-b border-line",dayCellClass:E=>O("border-line",E.isOther&&"bg-surface-sunken"),dayLaneClass:E=>O(E.isToday&&"bg-accent-soft/40"),dayCellTopInnerClass:E=>O("px-1 py-0.5 text-2xs tabular-nums",E.isToday?"font-semibold text-accent":"text-fg-muted"),dayRowClass:"border-line",slotLaneClass:E=>O("border-line",E.isMinor&&"border-dashed"),slotHeaderClass:"border-line",slotHeaderInnerClass:"pr-1.5 text-2xs tabular-nums text-fg-subtle",slotHeaderDividerClass:"border-r border-line",allDayHeaderClass:"border-line",allDayHeaderInnerClass:"px-1 text-2xs uppercase tracking-wider text-fg-subtle",allDayDividerClass:"border-b border-line-strong",nonBusinessHoursClass:"bg-surface-sunken",highlightClass:"bg-accent-soft",nowIndicatorLineClass:"border-t border-danger",nowIndicatorDotClass:"bg-danger",moreLinkClass:"rounded-sm bg-surface-sunken text-2xs font-semibold text-fg-muted hover:bg-line hover:text-fg",moreLinkInnerClass:"px-1 py-0.5",popoverClass:"rounded-lg border border-line bg-surface-raised shadow-xl shadow-black/20",popoverCloseClass:"text-fg-subtle hover:text-fg",listDaysClass:"bg-surface",listDayClass:"border-line",listDayHeaderClass:"border-y border-line bg-surface-sunken",listDayHeaderInnerClass:"flex h-section-row items-center px-row-inset text-2xs font-semibold uppercase tracking-wider text-fg-subtle",listDayBodyClass:"border-line",noEventsClass:"p-10 text-center",noEventsInnerClass:"text-sm text-fg-muted",noEventsContent:"Nothing scheduled",singleMonthClass:"p-2",singleMonthHeaderClass:"pb-1",singleMonthHeaderInnerClass:"text-xs font-semibold text-fg",eventClass:D,listItemEventClass:D,eventContent:E=>{const T=p(E.event.id),N=E.timeText!==""&&!C&&!E.isNarrow;return d.jsx(ha,{title:E.event.title,timeText:N?E.timeText:"",layout:y(E)?"row":"column",rsvp:T.rsvp,hasThread:T.hasThread,isRecurring:T.isRecurring,zoneCertainty:T.zoneCertainty})}})})}const Dl="remit:calendar-density",pi="comfortable";function sS(){try{return localStorage.getItem(Dl)==="compact"?"compact":pi}catch{return pi}}function rS(t){try{localStorage.setItem(Dl,t)}catch{}}const iS=t=>t==="compact"?"pills":"detail";function aS({days:t,calendars:e,density:n,today:s,anchorDate:r,now:i,selectedEventId:a,freeOn:o,loadingDates:l,error:c,onRetry:u,scrollTarget:h,onSelectEvent:g,onPickSlot:m,onZoomDay:v,onGoToDate:p,onReachStart:y,onReachEnd:D,atStartCap:x,atEndCap:C,onLoadEarlier:E,onLoadLater:T,onVisibleDayChange:N}){const I=w.useMemo(()=>Nu(t,i),[t,i]),P=!l.has(s);return c!=null?d.jsx("div",{className:"flex h-full items-center justify-center bg-surface",children:d.jsx(xi,{title:"Couldn't load these days",error:c,onRetry:u})}):d.jsx(Wu,{days:t,calendars:e,density:iS(n),today:s,focusDate:r,selectedEventId:a,freeOn:o,loadingDates:l,scrollTarget:h,onSelectEvent:g,onPickSlot:m,onZoomDay:v,onReachStart:y,onReachEnd:D,atStartCap:x,atEndCap:C,onLoadEarlier:E,onLoadLater:T,onVisibleDayChange:N,todayLead:P?d.jsx("div",{className:"border-b border-line bg-surface-sunken p-3",children:d.jsx(Qu,{nextUp:I,calendars:e,today:s,onSelectEvent:g,onGoTo:p})}):void 0})}const oS=24,wl=7,lS=52,gn=lS*7,Cl=t=>({from:be(t,-10),to:be(t,oS),floor:be(t,-gn),ceiling:be(t,gn)}),Rl=t=>t.from<=t.floor,xl=t=>t.to>=t.ceiling,cS=(t,e)=>t>e?t:e,dS=(t,e)=>t<e?t:e,Tl=t=>Rl(t)?t:{...t,from:cS(be(t.from,-wl),t.floor)},Ml=t=>xl(t)?t:{...t,to:dS(be(t.to,wl),t.ceiling)},uS=t=>Tl({...t,floor:be(t.from,-gn)}),hS=t=>Ml({...t,ceiling:be(t.to,gn)});function fS(t,e){return e>=t.from&&e<=t.to?t:Cl(e)}function gS(t){const e=new Map;for(const n of t){const s=bi("week",n);e.has(s.from)||e.set(s.from,s)}return[...e.values()]}const vi=t=>bi("week",t).from,mS=1440,yi=t=>t.getHours()*60+t.getMinutes();function pS(t,e){const n=new Set(t),s=new Map;for(const r of e){const i=new Date(r.start),a=new Date(r.end);if(Number.isNaN(i.getTime())||Number.isNaN(a.getTime())||a.getTime()<=i.getTime())continue;const o=qt(i),l=qt(new Date(a.getTime()-1));for(let c=o;c<=l;c=be(c,1)){if(!n.has(c))continue;const u=c===o?yi(i):0,h=qt(a)===c?yi(a):mS;if(h<=u)continue;const g=s.get(c);g?g.push({from:u,to:h}):s.set(c,[{from:u,to:h}])}}for(const[r,i]of s)s.set(r,vS(i));return s}function vS(t){const e=[...t].sort((s,r)=>s.from-r.from),n=[];for(const s of e){const r=n[n.length-1];if(r&&s.from<=r.to){r.to=Math.max(r.to,s.to);continue}n.push({...s})}return n}function yS(t,e){const n=pS(t,e);return new Map(t.map(s=>[s,da(s,n.get(s)??[])]))}const SS=t=>pu(t.from,t.to),ES=kl(400,404);function bS(t){const e=Zl({queries:t.map(o=>({...Hl({query:{from:o.from,to:o.to}}),meta:ES,staleTime:Vl}))}),n=t.map(o=>o.from).join("|"),s=e.map(o=>o.data),r=e.map(o=>o.isPending).join("|"),i=w.useMemo(()=>s.flatMap(o=>o?.items??[]),[n,r]),a=w.useMemo(()=>{const o=new Set;return t.forEach((l,c)=>{e[c]?.isPending&&o.add(l.from)}),o},[n,r]);return{spans:i,pendingWindows:a,error:e.find(o=>o.error)?.error??null,refetch:()=>{for(const o of e)o.error&&o.refetch()}}}const DS=400;function wS({density:t,onPickSlot:e}){const{date:n,calendarIds:s}=Di(),{openEvent:r,setAnchorDate:i,zoomToDay:a}=wi(),o=Ci(),[l]=w.useState(()=>new Date),c=w.useMemo(()=>qt(l),[l]),u=w.useMemo(()=>l.toISOString(),[l]),[h,g]=w.useState(()=>Cl(n)),[m,v]=w.useState(),[p,y]=w.useState(n),D=w.useRef(0),x=w.useRef(n),C=w.useCallback(W=>{x.current=W,y(W),g(Y=>fS(Y,W)),D.current+=1,v({date:W,token:D.current})},[]);w.useEffect(()=>{n!==x.current&&C(n)},[n,C]);const E=Xl(p,DS);w.useEffect(()=>{E!==x.current&&(x.current=E,i(E))},[E,i]);const T=w.useMemo(()=>SS(h),[h]),N=w.useMemo(()=>gS(T),[T]),{calendars:I,timeZoneByCalendarId:P,shown:H,narrowed:j,resolved:G,isLoading:U}=zl(s),F=Gl(N,j,G),Z=bS(N),Q=Yl(F.instances,P,H),X=w.useMemo(()=>T.map(W=>xu(W,Q,c)),[T,Q,c]),ae=w.useMemo(()=>{const W=new Set;if(U||!G)return new Set(T);for(const Y of T)F.pendingWindows.has(vi(Y))&&W.add(Y);return W},[T,F.pendingWindows,U,G]),ne=w.useMemo(()=>yS(T,Z.spans),[T,Z.spans]),K=w.useCallback(W=>Z.pendingWindows.has(vi(W.date))?rn(W):ne.get(W.date)??rn(W),[ne,Z.pendingWindows]),Se=w.useCallback(W=>{C(W),i(W)},[C,i]),ge=w.useCallback(W=>{const Y=Ol(W);r(Y.calendarObjectId,Y.recurrenceId)},[r]),Ie=w.useCallback(()=>g(Tl),[]),A=w.useCallback(()=>g(Ml),[]),J=w.useCallback(()=>g(uS),[]),oe=w.useCallback(()=>g(hS),[]),me=w.useCallback(()=>{F.refetch(),Z.refetch()},[F.refetch,Z.refetch]);return d.jsx(aS,{days:X,calendars:I,density:t,today:c,anchorDate:n,now:u,selectedEventId:o?Ri(o.calendarObjectId,o.recurrenceId??""):"",freeOn:K,loadingDates:ae,error:F.error??Z.error,onRetry:me,scrollTarget:m,onSelectEvent:ge,onPickSlot:e,onZoomDay:a,onGoToDate:Se,onReachStart:Ie,onReachEnd:A,atStartCap:Rl(h),atEndCap:xl(h),onLoadEarlier:J,onLoadLater:oe,onVisibleDayChange:y})}const CS={year:"The year grid arrives with the rest of the zoom ladder.",month:"The month grid arrives with the rest of the zoom ladder."};function RS({view:t}){return d.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-surface p-8 text-center","data-testid":`calendar-placeholder-${t}`,children:[d.jsx(nc,{className:"size-8 text-fg-subtle","aria-hidden":"true"}),d.jsx("p",{className:"text-sm font-medium text-fg",children:"Not built yet"}),d.jsxs("p",{className:"max-w-xs text-sm text-fg-muted",children:[CS[t]??"This view arrives in a later stage."," Week, Day and Agenda work now."]})]})}const xS=[{value:"comfortable",label:"Detail"},{value:"compact",label:"Glance"}];function TS(t,e){const n=new Date(`${e}T00:00:00`);return t==="year"?new Intl.DateTimeFormat(void 0,{year:"numeric"}).format(n):t==="day"?new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"long",year:"numeric"}).format(n):new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}).format(n)}function MS({view:t,date:e,events:n,colorByCalendarId:s,agenda:r,isLoading:i=!1,error:a,onRetry:o,density:l,selectedEventId:c,timeZone:u,now:h,onChangeView:g,onToday:m,onChangeDensity:v,onSelectEvent:p,onPickSlot:y,onStep:D}){const x=w.useId(),[C,E]=w.useState({key:"",title:""}),T=`${t}/${e}`,N=C.key===T?C.title:TS(t,e);return d.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-surface",children:[d.jsxs("div",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-2",children:[d.jsx(ec,{}),d.jsxs(Ju,{title:N,onPrev:()=>D(-1),onNext:()=>D(1),onToday:m,children:[d.jsxs("fieldset",{className:"inline-flex items-center gap-0.5",children:[d.jsx("legend",{className:"sr-only",children:"Calendar density"}),xS.map(I=>d.jsxs("label",{className:`${Sa(l===I.value)} h-7 text-xs`,children:[d.jsx("input",{type:"radio",name:x,value:I.value,checked:l===I.value,onChange:()=>v(I.value),className:"sr-only"}),I.label]},I.value))]}),d.jsx(Ku,{value:t,onChange:g})]})]}),Ei(t)?d.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:r}):d.jsx("div",{className:"min-h-0 flex-1",children:a!=null?d.jsx("div",{className:"flex h-full items-center justify-center",children:d.jsx(xi,{title:"Couldn't load this week",error:a,onRetry:o})}):i?d.jsx("div",{role:"status","aria-label":"Loading the calendar",className:"flex h-full items-center justify-center bg-surface",children:d.jsx(Pl,{className:"size-6 animate-spin text-fg-subtle"})}):jl(t)?d.jsx(nS,{view:t,date:e,events:n,colorByCalendarId:s,density:l,selectedEventId:c,timeZone:u,now:h,onSelectEvent:p,onPickSlot:y,onRangeChange:I=>E({key:T,title:I})}):d.jsx(RS,{view:t})})]})}function FS(){const{view:t,date:e,calendarIds:n}=Di(),s=!Ei(t),{events:r,colorByCalendarId:i,isLoading:a,error:o,retry:l,instanceOf:c}=ql({view:t,date:e,calendarIds:n,enabled:s}),{goToView:u,goToToday:h,step:g,openEvent:m,openComposer:v}=wi(),p=Ci(),y=Wl(),[D,x]=w.useState(sS),C=w.useCallback(H=>{rS(H),x(H)},[]),[E,T]=w.useState(void 0),N=w.useCallback(H=>{const j=c(H);m(j.calendarObjectId,j.recurrenceId)},[c,m]),I=w.useCallback(H=>{T(H),v()},[v]),P=d.jsx(MS,{view:t,date:e,events:r,colorByCalendarId:i,agenda:d.jsx(wS,{density:D,onPickSlot:I}),isLoading:a,error:o,onRetry:l,density:D,selectedEventId:p?Ri(p.calendarObjectId,p.recurrenceId??""):"",timeZone:Bl(),now:new Date().toISOString(),onChangeView:u,onToday:h,onStep:g,onChangeDensity:C,onSelectEvent:N,onPickSlot:I});return d.jsx(Kl,{pick:E,children:d.jsx(Jl,{workspace:P,reading:d.jsx(Ll,{}),hasOpenEvent:p!==void 0||y})})}export{FS as component};
|
|
1
|
+
import{e as Pt,t as O,j as d,r as w,Z as Si,bG as Il,bH as Rt,ar,bI as Nl,bJ as qt,bK as Hl,s as kl,bL as Ei,L as Pl,bM as jl,O as Ll}from"./index-DFvn5y4c.js";import{c as ms,R as Al,a as be,b as bi,u as Di,d as wi,e as Ci,r as Ol,f as Ri,g as Wl,h as Bl}from"./useCalendars-DaisNzpy.js";import{M as _l}from"./mail-Ct-zdzf2.js";import{G as Ul,M as Fl,C as Vl,u as zl,a as Gl,b as Yl,c as ql}from"./useCalendarData-CfICbH_6.js";import{C as $l}from"./clock-Bvb6Om5r.js";import{E as xi}from"./ErrorState-BtilFfMz.js";import{u as Zl}from"./useQueries-C-FWQch-.js";import{u as Xl}from"./useDebouncedValue-BABSGNK2.js";import{C as Kl}from"./CalendarComposeSeed-D2-h5yfx.js";import{a as Jl}from"./CalendarShell-hxAj3RCw.js";import{C as Ql}from"./chevron-left-D_5sOBUq.js";import{N as ec}from"./NavMenuButton-Dbn2UxrU.js";import"./menu-DFNsLG9c.js";const tc=Pt("CalendarOff",[["path",{d:"M4.2 4.2A2 2 0 0 0 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 1.82-1.18",key:"16swn3"}],["path",{d:"M21 15.5V6a2 2 0 0 0-2-2H9.5",key:"yhw86o"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h7",key:"1wap6i"}],["path",{d:"M21 10h-5.5",key:"quycpq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const nc=Pt("CalendarRange",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]]);const sc=Pt("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);const rc=Pt("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);const ic=Pt("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),Ze=globalThis.Temporal,ac=(t,e)=>`Non-positive ${t}: ${e}`,oc=(t,e)=>`Non-finite ${t}: ${e}`,lc=t=>`Cannot convert bigint to ${t}`,cc="Invalid object",dc=(t,e,n,s)=>mn(t,e)+`; must be between ${n}-${s}`,mn=(t,e)=>`Invalid ${t}: ${e}`,uc=1e3,hc=1e6,fc=1e9,gc=6e10,mc=36e11;function pc(t){return t===void 0?Object.create(null):Sc(t)}function Ti(t,e="number"){if(typeof t=="bigint")throw new TypeError(lc(e));if(t=Number(t),!Number.isFinite(t))throw new RangeError(oc(e,t));return t}function ps(t,e){return Math.trunc(Ti(t,e))||0}function or(t,e){return vc(ps(t,e),e)}function vc(t,e="number"){if(t<=0)throw new RangeError(ac(e,t));return t}function yc(t,e,n){return Math.min(Math.max(t,e),n)}function Mi(t){return t!==null&&(typeof t=="object"||typeof t=="function")}function Sc(t){if(!Mi(t))throw new TypeError(cc);return t}const Ec=mn,bc=t=>`Missing ${t}`,Dc=(t,e,n)=>mn(t,e)+"; must be "+Object.keys(n).join(),wc="Cannot use valueOf",Cc="Invalid calling context",Rc=(t,e)=>`Unknown calendar ${t}; might need ${e}`,xc=t=>mn("TimeZone",t),pn="Out-of-bounds date",Tc=t=>`Invalid substring: ${t}`,Ii=yc;function ce(t){throw new RangeError(t)}function ut(t){throw new TypeError(t)}function lr(t,e,n,s,r){return Ni(e,((i,a)=>{const o=i[a];return o===void 0&&ut(bc(a)),o})(t,e),n,s)}function Ni(t,e,n,s,r,i){const a=Ii(e,n,s);return e!==a&&ce(((o,l,c,u,h)=>dc(o,l,c,u))(t,e,n,s)),a}function it(t,e=Map){const n=new e;return(s,...r)=>{if(n.has(s))return n.get(s);const i=t(s,...r);return n.set(s,i),i}}const Mc=t=>Ic({name:t}),Ic=(t,e)=>vs(n=>({value:n,configurable:1,writable:!1}),t),Nc=t=>({[Symbol.toStringTag]:{value:t,configurable:1}});function vs(t,e){const n={};for(const s in e)n[s]=t(e[s],s);return n}function Hc(t,e){const n={};for(const s of t)n[s]=e;return n}function Hi(t){const e={};for(const n of t)e[n]=s=>s[n];return e}function ki(t,e,n=Object.create(null)){for(const s of t)n[s]=e[s];return n}function ys(t,...e){return(...n)=>t(...e,...n)}function cr(){}function dr(t){return t[0].toUpperCase()+t.substring(1)}function kc(t){return new RegExp(`^${t}$`,"i")}function Pc(t){return parseInt(t.padEnd(9,"0"))}function jc(t){return t&&t!=="+"?-1:1}function An(t){return t===void 0?0:parseInt(t)}function en(t,e){return String(e).padStart(t,"0")}const De=ys(en,2);function Lc(t,e){return Math.sign(t-e)}function Pi(t,e){const n=t/e;return t%e<0n?n-1n:n}function ji(t,e){const n=Pi(t,e);return[n,t-n*e]}function Pe(t,e){return[Math.floor(t/e),vn(t,e)]}function vn(t,e){return(t%e+e)%e}function Ac(t,e){return Math.trunc(t/e)||0}function Ut(t){return Math.abs(t%1)===.5}function Oc(t){const e=t.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,"");return e==="bc"||e==="b"?"bce":e==="ad"||e==="a"?"ce":e}const ht=void 0;function yn(t){return t===ht?"iso8601":t===0?"gregory":t.id}function Wc(t,e){return"M"+De(t)+(e?"L":"")}const Bc={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},_c=Object.keys(Bc),Ss=uc,Sn=hc,jt=fc,Es=gc,Li=mc,bs=864e11,Ai=BigInt(Sn),Xn=BigInt(jt),Ve=BigInt(bs),En=_c.slice(0,6),Ds=Hi(En),Uc=["day","month","year"];function Fc(t){return zc(t),t}const Vc={hour:23,minute:59,second:59};function zc(t,e){const n={};for(const s of En)n[s]=Ni(s,t[s],0,Vc[s]||999);return n}function ws(t){return Oi(t)*jt+Wi(t)}function Oi(t){return 3600*t.hour+60*t.minute+t.second}function Wi(t){return t.millisecond*Sn+t.microsecond*Ss+t.nanosecond}function Gc(t){const[e,n]=Pe(t,Sn),[s,r]=Pe(n,Ss);return Yc(e,s,r)}function Yc(t,e=0,n=0){const[s,r]=Pe(t,36e5),[i,a]=Pe(r,6e4),[o,l]=Pe(a,1e3);return{hour:s,minute:i,second:o,millisecond:l,microsecond:e,nanosecond:n}}function ur(t){const[e,n]=ji(t,Xn);return[Number(e),Number(n)]}function qc(t){return Cs(t)+BigInt(ws(t))}function Cs(t){return BigInt(tn(t))*Ve}function tn(t){return xt(t.year,t.month,t.day)}function xt(t,e=1,n=1){const s=e-1;return t+=Math.floor(s/12),e=vn(s,12),Date.UTC(t%400-400,e,0)/864e5+146097*(Ac(t,400)+1)+n}function bn(t){const[e,n]=ji(t,Ve);return{...$c(Number(e)),...Gc(Number(n))}}function $c(t){const e=new Date(864e5*vn(t,146097));return{year:e.getUTCFullYear()+400*Math.floor(t/146097),month:e.getUTCMonth()+1,day:e.getUTCDate()}}function Zc(t){return[t,0]}function Xc(t,e,n){return{year:t,month:e,day:n}}function Bi(t,e){switch(e){case 2:return Dn(t)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function Kc(t){return Dn(t)?366:365}function Dn(t){return t%4==0&&(t%100!=0||t%400==0)}function Rs(t){return vn(xt(t.year,t.month,t.day)+4,7)||7}function _i(t){return xt(t.year,t.month,t.day)-xt(t.year)+1}function Ui(t){let e=t.year,n=Math.floor((_i(t)-Rs(t)+10)/7),s=On(e);return n<1?n=s=On(--e):n>s&&(n=1,s=On(++e)),{weekOfYear:n,yearOfWeek:e,Be:s}}function On(t){const e=Rs({year:t,month:1,day:1});return e===4||e===3&&Dn(t)?53:52}function Jc({year:t}){return t<1?{era:"bce",eraYear:1-t}:{era:"ce",eraYear:t}}function Qc(t){return ed(t),Fc(t)}function ed(t){return td(t),t}function td(t,e){const{year:n}=t,s=lr(t,"month",1,12);return{year:n,month:s,day:lr(t,"day",1,Bi(n,s))}}function we(t,e){return t?t.ae(e):e}function nd(t,e,n){return t?t.L(e,n):Zc(n)}function hr(t,e){return t===0?Jc(e):t&&t.h?.(e)||{}}function sd(t,e,n,s){return t?t.de(e,n,s):Xc(e,n,s)}function rd(t,e){return t?t.j(e):12}function id(t,e,n){return t?t.o(e,n):Bi(e,n)}function ad(t,e){const{year:n,month:s}=we(t,e),[r,i]=nd(t,n,s);return Wc(r,i)}function Fi(t,e){const{year:n}=we(t,e);return t?t.q(n):Dn(n)}function Vi(t,e){const{year:n}=we(t,e);return rd(t,n)}function zi(t,e){const{year:n,month:s}=we(t,e);return id(t,n,s)}function Gi(t,e){const{year:n}=we(t,e);return t?t.i(n):Kc(n)}function od(t,e){if(!t)return _i(e);const{year:n}=we(t,e),s=sd(t,n,1,1);return tn(e)-tn(s)+1}function ld(t,e){return t===ht?Ui(e).weekOfYear:void 0}function cd(t,e){return t===ht?Ui(e).yearOfWeek:void 0}const nn=ys(dd,"string");function dd(t,e,n=t){return typeof e!==t&&ut(Ec(n,e)),e}function ud(t,e="number"){return Number.isInteger(t)||ce(((n,s)=>`Non-integer ${n}: ${s}`)(e,t)),t||0}function hd(t){return typeof t=="symbol"&&ut("Cannot convert Symbol to string"),String(t)}function fd(t,e){return Mi(t)?String(t):nn(t,e)}function gd(t,e){return ud(Ti(t,e),e)}const md={compatible:0,reject:1,earlier:2,later:3},pd=[Math.floor,t=>Ut(t)?Math.floor(t):Math.round(t),Math.ceil,t=>Ut(t)?Math.ceil(t):Math.round(t),Math.trunc,t=>Ut(t)?Math.trunc(t)||0:Math.round(t),t=>t<0?Math.floor(t):Math.ceil(t),t=>Math.sign(t)*Math.round(Math.abs(t))||0,t=>Ut(t)?(t=Math.trunc(t)||0)+t%2:Math.round(t)];function vd(t,e,n,s=0){const r=n[t];if(r===void 0)return s;const i=hd(r),a=e[i];return a===void 0&&ce(Dc(t,i,e)),a}const yd=ys(vd,"disambiguation",md),Yi=BigInt(1e8)*Ve,xs=BigInt(-1e8)*Ve,qi=xs-Ve;function Sd(t){const e=Cs(t);return Ed(e),e!==qi||ws(t)||ce(pn),t}function Ed(t,e=1){(t<(e?qi:xs)||t>Yi)&&ce(pn)}function wn(t){return(t<xs||t>Yi)&&ce(pn),t}function bd(t,e){return wn(Cs(t)+BigInt(ws(t)-e))}function Dd(t){return{epochNanoseconds:t}}function $i(t,e,n){return{calendar:n,timeZone:e,epochNanoseconds:t}}function wd(t,e){return ki(En,t,Cd(t,e))}function Cd(t,e){return ki(Uc,t,{calendar:e})}function Zi(t){return e=t.epochNanoseconds,Number(Pi(e,Ai));var e}function Xi(t){return t.epochNanoseconds}function Rd(t){return xd(t,Es,7)}function xd(t,e,n){return Td(t/e,n)*e}function Td(t,e){return pd[e](t)}const Ki=it(Md,WeakMap);function Md(t){const{epochNanoseconds:e,timeZone:n}=t,s=n.B(e);return{...bn(e+BigInt(s)),offsetNanoseconds:s}}function Id(t,e,n=0,s=t.N(e)){if(s.length===1)return s[0];if(n===1&&ce("Ambiguous offset"),s.length)return s[n===3?1:0];const r=qc(e),i=((o,l)=>{const c=o.B(l-Ve);return(u=>(u>bs&&ce("Out-of-bounds TimeZone gap"),u))(o.B(l+Ve)-c)})(t,r),a=bn(r+BigInt(i*(n===2?-1:1)));return(s=t.N(a))[n===2?0:s.length-1]}const Nd=kc("([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?");function Hd(t,e){const n=Nd.exec(t);if(n&&(s=>(r=>{r[0]!=="T"&&r[0]!=="t"||(r=r.slice(1));const i=r.search(/[.,]/),a=i<0?r:r.slice(0,i),o=a.split(":");return o.length===1?/^(?:\d{2}|\d{4}|\d{6})$/i.test(a):(o.length===2||o.length===3)&&o.every(l=>l.length===2&&/^\d{2}$/i.test(l))})(s.slice(1)))(n[0]))return((s,r)=>{const i=s[4]||s[5];return i&&ce(Tc(i)),o=(An(s[2])*Li+An(s[3])*Es+An(s[4])*jt+Pc(s[5]||""))*jc(s[1]),Math.abs(o)>=bs&&ce("Out-of-bounds offset"),o;var o})(n)}const kd={era:fd,month:or,monthCode(t,e){if(typeof t=="string")return t;if(t&&typeof t=="object"){const n=t.toString;if(typeof n=="function")return nn(n.call(t),e)}return nn(t,e)},day:or},Pd=Hc(En,ps),jd=Object.assign({},kd,Pd);({...jd});const Ld=Intl.DateTimeFormat;function Ad(t,e){e<-864e13&&ce(pn);const n=t.formatToParts(e),s={};for(const r of n)s[r.type]=r.value;return s}const Od={El_Aaiun:17,Tucuman:12,Tirane:11,Riga:10,Simferopol:9,Vienna:9,Tunis:8,Boa_Vista:6,Fortaleza:6,Maceio:6,Noronha:6,Recife:6,Gaza:6,Hebron:6,DeNoronha:6},Wn=-388152e4;function Wd(t){return Ts(bn(t.epochNanoseconds))+"Z"}function Bd(t){const e=t.calendar,n=t.timeZone,s=n.B(t.epochNanoseconds);return Ts(bn(t.epochNanoseconds+BigInt(s)))+Ji(Rd(s))+zd(n.id)+(e===ht?"":Qi(yn(e)))}function _d(t){const e=t.calendar;return Ts(t)+(e===ht?"":Qi(yn(e)))}function Ts(t,e){return Ud(t)+"T"+Vd(t)}function Ud(t){return Fd(t)+"-"+De(t.day)}function Fd(t){const{year:e}=t;return(e<0||e>9999?ta(e)+en(6,Math.abs(e)):en(4,e))+"-"+De(t.month)}function Vd(t,e){const n=[De(t.hour),De(t.minute)];return n.push(De(t.second)+((s,r,i,a)=>ea(s*Sn+r*Ss+i))(t.millisecond,t.microsecond,t.nanosecond)),n.join(":")}function Ji(t,e=0){if(e===1)return"";const[n,s]=Pe(Math.abs(t),Li),[r,i]=Pe(s,Es),[a,o]=Pe(i,jt);return ta(t)+De(n)+":"+De(r)+(a||o?":"+De(a)+ea(o):"")}function zd(t,e){return"["+t+"]"}function Qi(t,e){return"[u-ca="+t+"]"}const Gd=/0+$/;function ea(t,e){let n=en(9,t);return n=n.replace(Gd,""),n?"."+n:""}function ta(t){return t<0?"-":"+"}const Yd=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,qd=/[^\w\/:+-]+/;function na(t){return $d(nn(t))}function $d(t){return sa(t).id}function sa(t){const e=t.toUpperCase(),n=(r=>{const i=Hd(r);if(i!==void 0)return{id:Ji(i),X:i,m:i}})(e);if(n)return{kind:"fixed",...n};const s=e==="UTC"?"UTC":(r=>(qd.test(r)&&ce(xc(r)),Yd.test(r)&&ce("Forbidden ICU TimeZone"),r.toLowerCase().split("/").map((i,a)=>(i.length<=3||/\d/.test(i))&&!/etc|yap/.test(i)?i.toUpperCase():i.replace(/baja|dumont|[a-z]+/g,(o,l)=>o.length<=2&&!a||o==="in"||o==="chat"?o.toUpperCase():o.length>2||!l?dr(o).replace(/island|noronha|murdo|rivadavia|urville/,dr):o)).join("/")))(t);return Zd(s)}const Zd=it(t=>{if(t==="UTC")return{kind:"utc",id:t,m:t};const e=t.toUpperCase(),n=Xd(e);return{kind:"named",id:t,format:n,m:n.resolvedOptions().timeZone}}),Xd=it(t=>new Ld("en-u-hc-h23",{calendar:"iso8601",timeZone:t,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}));function ra(t){const e=sa(t);return Kd(e.id,e)}const Kd=it((t,e)=>e.kind==="named"?new Qd(t,e.m,e.format):new Jd(t,e.m,e.kind==="fixed"?e.X:0));class Jd{constructor(e,n,s){this.id=e,this.m=n,this.X=s}B(){return this.X}N(e){return[bd(e,this.X)]}O(){}}class Qd{constructor(e,n,s){this.id=e,this.m=n,this.ke=((r,i)=>{const a=it(r),o=it(eu),l=86400*i;function c(h){const[g,m]=gr(h,l),v=Ft(g),p=Ft(m),y=a(v),D=a(p);return y===D?y:u(o(v,p),y,D,h)}function u(h,g,m,v){let p,y;for(;(v===void 0||(p=v<h[0]?g:v>=h[1]?m:void 0)===void 0)&&(y=h[1]-h[0]);){const D=h[0]+Math.floor(y/2);r(D)===m?h[1]=D:h[0]=D+1}return p}return{xe(h){const g=c(h-86400),m=c(h+86400),v=h-g,p=h-m;if(g===m)return[v];const y=c(v);return y===c(p)?[h-y]:g>m?[v,p]:[]},we:c,O:function h(g,m){if(m>0&&g>=864e10)return;if(m<0){if(g<=Wn)return;const E=fr()+94867200;if(g>E)return h(E,-1)}const v=m>0?Math.max(g,Wn):g;let[p,y]=gr(v,l);const D=l*m,x=m>0?Math.max(g,fr())+94867200:Wn,C=()=>m<0?y>x:p<x;for(;C();){const E=Ft(p),T=Ft(y),N=a(E),I=a(T);if(N!==I){const P=o(E,T);u(P,N,I);const H=P[0];if((Lc(H,g)||1)===m)return H}p+=D,y+=D}}}})((r=>i=>{const a=Ad(r,1e3*i);return 86400*xt((o=>{const l=o.relatedYear;if(l!==void 0)return parseInt(l);const c=parseInt(o.year);return o.era!==void 0&&Oc(o.era)==="bce"?1-c:c})(a),parseInt(a.month),parseInt(a.day))+3600*parseInt(a.hour)+60*parseInt(a.minute)+parseInt(a.second)-i})(s),(r=>{const i=r.split("/").pop();return Od[i]||60})(e))}B(e){return this.ke.we((n=>ur(n)[0])(e))*jt}N(e){const n=86400*tn(e)+Oi(e),s=Wi(e);return this.ke.xe(n).map(r=>wn(BigInt(r)*Xn+BigInt(s)))}O(e,n){const[s,r]=ur(e),i=this.ke.O(s+(n>0||r?1:0),n);if(i!==void 0)return BigInt(i)*Xn}}function fr(){return Math.floor(Date.now()/1e3)}function eu(t,e){return[t,e]}function gr(t,e){const n=Math.floor(t/e)*e;return[n,n+e]}function Ft(t){return Ii(t,-1e10,864e10)}function tu(t,e,n){return $i(t.epochNanoseconds,e,n)}function nu(t,e,n){const s=Id(e,t,(r=>yd(pc(r)))(n));return $i(wn(s),e,t.calendar)}function su(t){return Dd(wn(BigInt(gd(t))*Ai))}function ru(t,e,n,s,r){const i=new Set(t),a=new Set(e),o=new Set(n);return(l,c)=>{let u,h;const g={},m={},v={};let p=0,y=0;for(const H of Object.keys(l)){const j=l[H];j===void 0||o.has(H)||(i.has(H)?H==="dateStyle"?u=j:H==="timeStyle"?h=j:g[H]=j:H==="era"?m[H]=j:a.has(H)?H==="dateStyle"||H==="timeStyle"?y=1:p=1:v[H]=j)}const D=u!==void 0,x=h!==void 0,C=D||x,E=Object.keys(g).length>0,T=p||y,N=E||D||x,I=Object.keys(m).length>0;(!c&&T||c&&T&&!N||C&&(E||I||p))&&ut("Invalid formatting options");const P={};return C||N||Object.assign(P,s),Object.assign(P,g,m,v),D&&(r?Object.assign(P,r[u]):P.dateStyle=u),x&&(P.timeStyle=h),P}}const iu={year:"numeric",month:"numeric",day:"numeric"},au={hour:"numeric",minute:"numeric",second:"numeric"},ou=Object.assign({},iu,au),lu=["weekday","year","month","day","dateStyle"],cu=["dayPeriod","hour","minute","second","fractionalSecondDigits","timeStyle"],du=lu.concat(cu);({...ou});const uu="PlainDateTime",hu="ZonedDateTime",fu="Instant";function ft(t,e,n,...s){return Object.defineProperties(e,Mc(t)),Object.defineProperties(e.prototype,Nc("Temporal."+t)),Object.defineProperties(e.prototype,vs(r=>({get(){return r(n(this))},configurable:1}),Object.assign({},...s))),e}const gt=cr.name==="noop"?t=>{Object.defineProperty(t,"_str_",{value:t.toJSON()})}:cr;function Cn(){ut(Cc)}function Ms(){ut(wc)}const Is={era(t){return hr(t.calendar,t).era},eraYear(t){return hr(t.calendar,t).eraYear},year(t){return we(t.calendar,t).year},month(t){return we(t.calendar,t).month},monthCode(t){return ad(t.calendar,t)},day(t){return we(t.calendar,t).day}},gu={daysInMonth(t){return zi(t.calendar,t)},daysInYear(t){return Gi(t.calendar,t)},monthsInYear(t){return Vi(t.calendar,t)},inLeapYear(t){return Fi(t.calendar,t)}},mu={dayOfWeek(t){return Rs(t)},dayOfYear(t){return od(t.calendar,t)},weekOfYear(t){return ld(t.calendar,t)},yearOfWeek(t){return cd(t.calendar,t)},daysInWeek(){return 7},daysInMonth(t){return zi(t.calendar,t)},daysInYear(t){return Gi(t.calendar,t)},monthsInYear(t){return Vi(t.calendar,t)},inLeapYear(t){return Fi(t.calendar,t)}};function sn(t){return Hi(Object.keys(t))}const ia=sn(Ds),aa=sn(Is);sn(gu),sn(mu);const Ue=480,He=1320,Ns=90;function je(t){return Number(t.slice(11,13))*60+Number(t.slice(14,16))}function Le(t){const e=Math.max(0,Math.min(1440,Math.round(t)));return`${String(Math.floor(e/60)).padStart(2,"0")}:${String(e%60).padStart(2,"0")}`}function ze(t){const e=Math.round(t);if(e<60)return`${e}m`;const n=Math.floor(e/60),s=e%60;return s===0?`${n}h`:`${n}h ${s}m`}function oa(t,e){const n=new Date(`${t}T00:00:00Z`);return n.setUTCDate(n.getUTCDate()+e),n.toISOString().slice(0,10)}function pu(t,e){const n=[];for(let s=t;s<=e;s=oa(s,1))n.push(s);return n}function vu(t){const[e,n,s]=t.split("-").map(Number);return new Date(e,n-1,s).toLocaleDateString("en-GB",{month:"long",year:"numeric"})}function yu(t){const[e,n,s]=t.split("-").map(Number);return new Date(e,n-1,s).toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"})}function Su(t){const[e,n,s]=t.split("-").map(Number);return new Date(e,n-1,s).toLocaleDateString("en-GB",{weekday:"long"})}function Eu(t,e){const[n,s,r]=t.split("-").map(Number),[i,a,o]=e.split("-").map(Number),l=new Date(n,s-1,r),c=new Date(i,a-1,o),u=l.toLocaleDateString("en-GB",{weekday:"short",day:"numeric",...s===a?{}:{month:"short"}}),h=c.toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"});return`${u} – ${h}`}function bu(t){const[e,n,s]=t.split("-").map(Number);return new Date(e,n-1,s).toLocaleDateString("en-GB",{weekday:"short"})}function ke(t){return new Date(t).getTime()}function Du(t,e){return t.allDay?e>=t.start.slice(0,10)&&e<t.end.slice(0,10):t.start.slice(0,10)===e}function wu(t,e){return ke(t.start)<ke(e.end)&&ke(e.start)<ke(t.end)}function Cu(t){const e=t.map(i=>[ke(i.start),ke(i.end)]).sort((i,a)=>i[0]-a[0]);let n=0,s=0,r=0;for(const[i,a]of e){if(i>r){n+=r-s,s=i,r=a;continue}r=Math.max(r,a)}return n+=r-s,Math.round(n/6e4)}function Ru(t){const e=[];for(const n of t){const s=t.filter(i=>i.id===n.id||wu(n,i)).map(i=>i.id).sort();if(s.length<2)continue;const r=s.join("|");e.some(i=>i.join("|")===r)||e.push(s)}return e.filter(n=>!e.some(s=>s!==n&&n.every(r=>s.includes(r))))}function xu(t,e,n){const s=e.filter(i=>Du(i,t)),r=s.filter(i=>!i.allDay).sort((i,a)=>ke(i.start)-ke(a.start));return{date:t,weekdayLabel:bu(t),dayNumber:Number(t.slice(8)),isToday:t===n,timed:r,allDay:s.filter(i=>i.allDay),busyMinutes:Cu(r),conflicts:Ru(r)}}function Tu(t){return t.timed.length===0&&t.allDay.length===0}function la(t){return ca(t.timed.map(e=>({from:je(e.start),to:je(e.end)})))}function ca(t){const e=[...t].sort((s,r)=>s.from-r.from),n=[];for(const s of e){const r=n[n.length-1];if(r&&s.from<=r.to){r.to=Math.max(r.to,s.to);continue}n.push({...s})}return n}function mr(t){return Math.min(Math.max(t,Ue),He)}function da(t,e,n=Ns){const s=ca(e);if(s.length===0)return[{date:t,startMinute:Ue,endMinute:He,minutes:He-Ue,wholeDay:!0}];const r=[];let i=Ue;for(const a of s){const o=mr(a.from),l=mr(a.to);o-i>=n&&r.push({date:t,startMinute:i,endMinute:o,minutes:o-i,wholeDay:!1}),i=Math.max(i,o,l)}return He-i>=n&&r.push({date:t,startMinute:i,endMinute:He,minutes:He-i,wholeDay:!1}),r}function rn(t,e=Ns){return da(t.date,la(t),e)}function Mu(t,e){const n=[];let s=[];const r=()=>{s.length!==0&&(s.length===1?n.push({kind:"day",key:s[0].date,day:s[0]}):n.push({kind:"run",key:`run_${s[0].date}`,from:s[0].date,to:s[s.length-1].date,days:s.length}),s=[])};for(const i of t){if(Tu(i)&&!e.includes(i.date)){s.push(i);continue}r(),n.push({kind:"day",key:i.date,day:i})}return r(),n}function Iu(t){const e=[];for(const n of t){const s=e[e.length-1],r=s?Math.max(...s.map(i=>Date.parse(i.end))):0;if(s&&Date.parse(n.start)<r){s.push(n);continue}e.push([n])}return e}function Nu(t,e){const n=Date.parse(e),s=e.slice(0,10),r=t.flatMap(c=>c.timed).sort((c,u)=>Date.parse(c.start)-Date.parse(u.start)),i=r.filter(c=>Date.parse(c.start)<=n&&Date.parse(c.end)>n),a=r.filter(c=>Date.parse(c.start)>n),o=a[0],l=i.filter(c=>c.start.slice(0,10)===s).length+a.filter(c=>c.start.slice(0,10)===s).length;return{running:i,next:o,minutesUntilNext:o?Math.round((Date.parse(o.start)-n)/6e4):0,after:a[1],restOfDay:l,free:Hu(t,e,1)[0]}}function Hu(t,e,n){const s=e.slice(0,10),r=je(e),i=[];for(const a of t)if(!(a.date<s))for(const o of rn(a)){if(a.date>s)i.push(o);else{const l=Math.max(o.startMinute,r);if(o.endMinute-l<Ns)continue;i.push({...o,startMinute:l,minutes:o.endMinute-l,wholeDay:o.wholeDay&&l===o.startMinute})}if(i.length===n)return i}return i}function ua(t){const e=ms(t.color),n=t.rsvp==="tentative"||t.status==="tentative";return O("flex min-w-0 overflow-hidden rounded-sm border-l-2 px-1.5 py-0.5",e.soft,e.text,e.rail,t.layout==="column"||t.stacked?"flex-col":"items-center gap-1.5",n&&"border-y border-r border-dashed",n&&e.border,t.rsvp==="declined"&&"opacity-60",t.selected&&"ring-2 ring-ring",t.density==="compact"?"text-2xs":"text-xs")}function ha({title:t,timeText:e,layout:n,rsvp:s,hasThread:r,isRecurring:i,zoneCertainty:a,trailing:o,detail:l}){const c=n==="column",u=a==="ambiguous",h=!c&&l!==void 0,g=d.jsxs("span",{className:O("flex min-w-0 items-center gap-1",c&&"w-full",s==="declined"&&"line-through"),children:[e!==""&&d.jsx("span",{className:"shrink-0 tabular-nums opacity-80",children:e}),d.jsx("span",{className:"truncate font-medium",children:t})]}),m=(i||r||u)&&d.jsxs("span",{className:O("flex shrink-0 items-center gap-1",c&&"mt-0.5",!c&&o===void 0&&"ml-auto"),children:[i&&d.jsx(Al,{className:"size-2.5","aria-label":"Repeats"}),r&&d.jsx(_l,{className:"size-2.5","aria-label":"From mail"}),u&&d.jsx(Ul,{className:"size-2.5 text-warning","aria-label":"Unclear zone"})]}),v=o!==void 0&&d.jsx("span",{className:O("shrink-0 opacity-80",!c&&"ml-auto"),children:o});return d.jsxs(d.Fragment,{children:[h?d.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[g,m,v]}):d.jsxs(d.Fragment,{children:[g,m,v]}),l]})}function fa({title:t,timeText:e,color:n,layout:s,density:r,rsvp:i,status:a,hasThread:o,isRecurring:l,zoneCertainty:c,selected:u,onClick:h,leading:g,trailing:m,detail:v}){const p=s==="column";return d.jsxs("button",{type:"button",onClick:h,"aria-pressed":u,className:O("group flex w-full min-w-0 text-left outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface",p?"h-full":"items-start",g!==void 0&&"gap-2"),children:[g,d.jsx("span",{className:O(ua({color:n,layout:s,density:r,rsvp:i,status:a,selected:u,stacked:v!==void 0}),"flex-1",p&&"h-full"),children:d.jsx(ha,{title:t,timeText:e,layout:s,rsvp:i,hasThread:o,isRecurring:l,zoneCertainty:c,trailing:m,detail:v})})]})}const Bn=32,ga=150,ku="cal-1",Pu=600,ju=900,Lu=1500,Au=new Set;function Ou(t){const e=new Map(t.map(n=>[n.id,n]));return{color:n=>e.get(n)?.color??ku,name:n=>e.get(n)?.name??""}}function Wu({days:t,calendars:e,density:n,today:s,focusDate:r,selectedEventId:i,onSelectEvent:a,onPickSlot:o,onZoomDay:l,onReachStart:c,onReachEnd:u,onVisibleDayChange:h,atStartCap:g=!1,atEndCap:m=!1,onLoadEarlier:v,onLoadLater:p,loadingDates:y=Au,freeOn:D=rn,scrollTarget:x,todayLead:C,touch:E,className:T}){const N=w.useRef(null),I=w.useRef(new Map),P=w.useRef(t[0]?.date??""),H=w.useRef(0),j=w.useRef(""),G=w.useRef(""),U=w.useRef(!1),F=w.useRef(0),Z=w.useRef(0),[Q,X]=w.useState(r),ae=w.useMemo(()=>Ou(e),[e]),ne=Mu(t,[s,r,...y]),K=t[0]?.date??"",Se=t[t.length-1]?.date??"";w.useLayoutEffect(()=>{const A=N.current;A&&(K!==""&&K<P.current&&(A.scrollTop+=A.scrollHeight-H.current),P.current=K,H.current=A.scrollHeight,F.current=A.scrollTop)}),w.useEffect(()=>{if(U.current)return;const A=N.current;if(!A)return;U.current=!0;let J=!1;const oe=()=>{const W=I.current.get(r);J||!W||(A.scrollTop=W.offsetTop-Bn,F.current=A.scrollTop)};oe(),X(r);const me=requestAnimationFrame(oe);return document.fonts?.ready.then(oe),()=>{J=!0,cancelAnimationFrame(me)}},[r]),w.useEffect(()=>{if(!x)return;const A=N.current,J=I.current.get(x.date);!A||!J||(A.scrollTop=J.offsetTop-Bn,F.current=A.scrollTop,X(x.date),h(x.date))},[x,h]),w.useEffect(()=>{const A=N.current;if(!A)return;const J=()=>{Z.current=Date.now()},oe=["wheel","pointerdown","touchstart","touchmove","keydown"],me=W=>{W.buttons!==0&&J()};for(const W of oe)A.addEventListener(W,J,{passive:!0});return A.addEventListener("pointermove",me,{passive:!0}),()=>{for(const W of oe)A.removeEventListener(W,J);A.removeEventListener("pointermove",me)}},[]);const ge=()=>{const A=N.current;if(!A)return;const J=A.scrollTop,oe=J-F.current;if(F.current=J,oe===0||Date.now()-Z.current>Lu)return;const me=[...I.current.entries()].filter(([,Y])=>Y.isConnected).sort((Y,ee)=>Y[1].offsetTop-ee[1].offsetTop);let W="";for(const[Y,ee]of me){if(ee.offsetTop-Bn-8>J)break;W=Y}W!==""&&W!==Q&&(X(W),h(W)),oe<0&&J<Pu&&j.current!==K&&(j.current=K,c()),oe>0&&J+A.clientHeight>A.scrollHeight-ju&&G.current!==Se&&(G.current=Se,u())},Ie=A=>J=>{J?I.current.set(A,J):I.current.delete(A)};return d.jsxs("div",{ref:N,onScroll:ge,"data-testid":"agenda-strip",className:O("relative min-h-0 flex-1 overflow-y-auto bg-surface",T),children:[d.jsxs("div",{className:"sticky top-0 z-20 flex h-8 items-center gap-2 border-b border-line bg-surface/95 px-row-inset backdrop-blur",children:[d.jsx("span",{className:"text-xs font-semibold text-fg",children:Su(Q)}),d.jsx("span",{className:"text-xs text-fg-subtle",children:vu(Q)}),Q===s&&d.jsx("span",{className:"rounded-full bg-accent-soft px-1.5 text-2xs font-medium text-accent",children:"Today"})]}),g&&v&&d.jsx(pr,{label:"Show earlier days",testId:"agenda-load-earlier",onLoad:v,touch:E}),ne.map(A=>d.jsx(Bu,{row:A,lookup:ae,density:n,today:s,pending:A.kind==="day"&&y.has(A.day.date),freeOn:D,selectedEventId:i,onSelectEvent:a,onPickSlot:o,onZoomDay:l,anchorRef:Ie(A.kind==="day"?A.day.date:A.from),lead:A.kind==="day"&&A.day.date===s?C:null,touch:E},A.key)),m&&p&&d.jsx(pr,{label:"Show later days",testId:"agenda-load-later",onLoad:p,touch:E})]})}function pr({label:t,testId:e,onLoad:n,touch:s}){return d.jsx("button",{type:"button",onClick:n,"data-testid":e,className:O("flex w-full items-center justify-center gap-2 border-y border-dashed border-line bg-surface-sunken px-row-inset text-xs font-medium text-fg-muted outline-none transition-colors hover:border-accent hover:text-accent focus-visible:ring-2 focus-visible:ring-ring",s?"min-h-14 py-3":"py-2"),children:t})}function Bu({row:t,lookup:e,density:n,today:s,pending:r,freeOn:i,selectedEventId:a,onSelectEvent:o,onPickSlot:l,onZoomDay:c,anchorRef:u,lead:h,touch:g}){return t.kind==="run"?d.jsx("div",{ref:u,children:d.jsx(_u,{from:t.from,to:t.to,days:t.days,onPickSlot:l,touch:g})}):r?d.jsx("div",{ref:u,children:d.jsx(Uu,{day:t.day,today:s})}):n==="dots"?d.jsxs("div",{ref:u,children:[h,d.jsx(Fu,{day:t.day,lookup:e,today:s,freeOn:i,onSelectEvent:o,onZoomDay:c,selectedEventId:a})]}):d.jsxs("div",{ref:u,children:[h,d.jsx(zu,{day:t.day,lookup:e,density:n,today:s,freeOn:i,selectedEventId:a,onSelectEvent:o,onPickSlot:l,onZoomDay:c,touch:g})]})}function _u({from:t,to:e,days:n,onPickSlot:s,touch:r}){return d.jsxs("button",{type:"button",onClick:()=>s({date:t,startTime:"10:00",endTime:"11:00",allDay:!1}),className:O("flex w-full items-center gap-3 border-y border-dashed border-line bg-surface-sunken px-row-inset text-left outline-none transition-colors hover:border-accent focus-visible:ring-2 focus-visible:ring-ring",r?"min-h-14 py-3":"py-2"),children:[d.jsx(tc,{className:"size-4 shrink-0 text-accent"}),d.jsx("span",{className:"text-sm font-medium text-fg",children:Eu(t,e)}),d.jsxs("span",{className:"text-xs text-fg-muted",children:[n," days with nothing booked"]}),d.jsx("span",{className:"ml-auto shrink-0 text-2xs text-fg-subtle",children:"Add"})]})}function Uu({day:t,today:e}){const n=t.date===e;return d.jsxs("section",{"aria-busy":"true","data-testid":`agenda-day-pending-${t.date}`,className:O("border-b border-line",n&&"border-l-2 border-l-accent bg-accent-soft/20"),children:[d.jsxs("header",{className:"flex h-section-row items-center gap-3 px-row-inset",children:[d.jsxs("div",{className:"flex w-16 shrink-0 items-baseline gap-1.5",children:[d.jsx("span",{className:O("text-lg font-semibold tabular-nums",n?"text-accent":"text-fg"),children:t.dayNumber}),d.jsx("span",{className:"text-2xs uppercase tracking-wider text-fg-subtle",children:t.weekdayLabel})]}),d.jsxs("span",{className:"sr-only",children:["Loading ",t.date]}),d.jsx("span",{className:"h-3 min-w-0 flex-1 animate-pulse rounded-full bg-surface-sunken"})]}),d.jsx("div",{className:"flex flex-col gap-1 pb-2",children:d.jsx("span",{className:"mx-row-inset h-7 animate-pulse rounded-md bg-surface-sunken"})})]})}function Fu({day:t,lookup:e,today:n,freeOn:s,selectedEventId:r,onSelectEvent:i,onZoomDay:a}){const o=t.date===n,l=[...t.allDay,...t.timed];return d.jsxs("div",{className:O("flex h-8 items-center gap-2 border-b border-line px-row-inset",o&&"bg-accent-soft/30"),children:[d.jsxs("button",{type:"button",onClick:()=>a(t.date),className:O("w-16 shrink-0 rounded-sm text-left text-xs tabular-nums outline-none focus-visible:ring-2 focus-visible:ring-ring",o?"font-semibold text-accent":"text-fg-muted"),children:[t.weekdayLabel," ",t.dayNumber]}),d.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden",children:l.map(c=>d.jsx("button",{type:"button",title:c.title,"aria-label":c.title,"aria-pressed":c.id===r,onClick:()=>i(c.id),className:O("size-2 shrink-0 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring",ms(e.color(c.calendarId)).solid,c.id===r&&"ring-2 ring-ring",c.myRsvp==="declined"&&"opacity-40")},c.id))}),d.jsx(pa,{day:t,className:"w-24 shrink-0"}),d.jsx("span",{className:"w-24 shrink-0 text-right text-2xs text-fg-subtle",children:Vu(t,s)})]})}function Vu(t,e){const n=e(t);if(t.timed.length===0&&ma(n))return"clear";const s=n.reduce((r,i)=>Math.max(r,i.minutes),0);return s>=ga?`${ze(s)} free`:`${ze(t.busyMinutes)} booked`}function ma(t){return t.length===1&&t[0].wholeDay}function zu({day:t,lookup:e,density:n,today:s,freeOn:r,selectedEventId:i,onSelectEvent:a,onPickSlot:o,onZoomDay:l,touch:c}){const u=t.date===s,h=Iu(t.timed),g=r(t),m=g.filter(y=>!y.wholeDay),v=t.timed.length===0&&ma(g),p=[...h.map(y=>({key:y[0].id,at:je(y[0].start),node:y.length===1?d.jsx(ya,{event:y[0],lookup:e,density:n,selected:y[0].id===i,onSelect:()=>a(y[0].id),touch:c}):d.jsx(Zu,{events:y,lookup:e,density:n,selectedEventId:i,onSelectEvent:a,onZoomDay:()=>l(t.date),touch:c})})),...m.map(y=>({key:`free_${y.startMinute}`,at:y.startMinute,node:d.jsx(qu,{stretch:y,onPick:()=>o({date:y.date,startTime:Le(y.startMinute),endTime:Le(Math.min(y.startMinute+60,y.endMinute)),allDay:!1}),touch:c})}))].sort((y,D)=>y.at-D.at);return d.jsxs("section",{className:O("border-b border-line",u&&"border-l-2 border-l-accent bg-accent-soft/20"),children:[d.jsxs("header",{className:"flex h-section-row items-center gap-3 px-row-inset",children:[d.jsxs("div",{className:"flex w-16 shrink-0 items-baseline gap-1.5",children:[d.jsx("span",{className:O("text-lg font-semibold tabular-nums",u?"text-accent":"text-fg"),children:t.dayNumber}),d.jsx("span",{className:"text-2xs uppercase tracking-wider text-fg-subtle",children:t.weekdayLabel})]}),d.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-muted",children:Gu(t)}),d.jsx(pa,{day:t,className:"hidden w-32 shrink-0 sm:block"}),d.jsxs("button",{type:"button",onClick:()=>l(t.date),className:O("flex shrink-0 items-center gap-0.5 rounded-md border px-2 text-2xs outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",c?"min-h-9":"h-6",t.conflicts.length>0?"border-warning text-warning hover:bg-warning-soft":"border-line text-fg-subtle hover:border-line-strong hover:text-fg"),children:["Grid",d.jsx(Si,{className:"size-3"})]})]}),d.jsxs("div",{className:"flex flex-col gap-1 pb-2",children:[t.allDay.map(y=>d.jsx($u,{event:y,lookup:e,density:n,selected:y.id===i,onSelect:()=>a(y.id),touch:c},y.id)),v?d.jsx(Yu,{day:t,onPickSlot:o,touch:c}):p.map(y=>d.jsx("div",{children:y.node},y.key))]})]})}function Gu(t){if(t.timed.length===0)return"Nothing booked";const e=[`${t.timed.length} ${t.timed.length===1?"event":"events"}`,`${ze(t.busyMinutes)} booked`];return t.conflicts.length>0&&e.push(`${t.conflicts.length} ${t.conflicts.length===1?"clash":"clashes"}`),e.join(" · ")}function pa({day:t,className:e}){const n=He-Ue;return d.jsx("div",{"aria-hidden":!0,className:O("relative h-1.5 overflow-hidden rounded-full bg-surface-sunken",e),children:la(t).map(s=>{const r=Math.max(s.from,Ue),i=Math.min(s.to,He);return i<=r?null:d.jsx("span",{className:"absolute inset-y-0 rounded-full bg-fg-subtle",style:{left:`${(r-Ue)/n*100}%`,width:`${(i-r)/n*100}%`}},`${s.from}-${s.to}`)})})}function Yu({day:t,onPickSlot:e,touch:n}){return d.jsx("button",{type:"button",onClick:()=>e({date:t.date,startTime:"10:00",endTime:"11:00",allDay:!1}),className:O("mx-row-inset flex items-center gap-2 rounded-md border border-dashed border-line px-2 text-left text-xs text-fg-muted outline-none transition-colors hover:border-accent hover:text-accent focus-visible:ring-2 focus-visible:ring-ring",n?"min-h-11":"h-8"),children:"Free all day"})}function qu({stretch:t,onPick:e,touch:n}){const s=t.minutes>=ga;return d.jsxs("button",{type:"button",onClick:e,className:O("ml-16 mr-row-inset flex items-center gap-2 rounded-md border border-dashed text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",n?"min-h-11 px-3":"h-7 px-2",s?"border-accent-2 bg-accent-2-soft/40 text-accent-2 hover:bg-accent-2-soft":"border-line text-fg-subtle hover:border-line-strong hover:text-fg-muted"),children:[d.jsxs("span",{className:O("text-xs",s&&"font-medium"),children:[ze(t.minutes)," free"]}),d.jsxs("span",{className:"text-2xs tabular-nums opacity-80",children:[Le(t.startMinute)," – ",Le(t.endMinute)]})]})}function va(t){return t==="detail"?"comfortable":"compact"}function $u({event:t,lookup:e,density:n,selected:s,onSelect:r,touch:i}){return d.jsx("div",{className:O("mx-row-inset",i&&"min-h-11"),children:d.jsx(fa,{title:t.title,timeText:"",color:e.color(t.calendarId),layout:"row",density:va(n),rsvp:t.myRsvp,status:t.status,hasThread:t.threadId!=="",isRecurring:t.recurrenceRule!=="",zoneCertainty:t.zoneCertainty,selected:s,onClick:r,trailing:d.jsx("span",{className:"text-2xs",children:"All day"})})})}function Zu({events:t,lookup:e,density:n,selectedEventId:s,onSelectEvent:r,onZoomDay:i,touch:a}){const o=Math.min(...t.map(c=>je(c.start))),l=Math.max(...t.map(c=>je(c.end)));return d.jsxs("div",{className:"mx-row-inset rounded-md border border-warning/50 bg-warning-soft/30",children:[d.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[d.jsx(sc,{className:"size-3 shrink-0 text-warning"}),d.jsxs("span",{className:"text-2xs font-medium text-warning",children:[t.length," at once · ",Le(o)," – ",Le(l)]}),d.jsx("button",{type:"button",onClick:i,className:O("ml-auto rounded-sm px-1.5 text-2xs font-medium text-warning underline underline-offset-2 outline-none hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",a&&"min-h-9"),children:"Open the grid"})]}),d.jsx("div",{className:"flex flex-col gap-0.5 pb-1",children:t.map(c=>d.jsx(ya,{event:c,lookup:e,density:n,selected:c.id===s,onSelect:()=>r(c.id),inset:!1,touch:a},c.id))})]})}function ya({event:t,lookup:e,density:n,selected:s,onSelect:r,inset:i=!0,touch:a}){const o=n==="detail",l=je(t.end)-je(t.start),c=[e.name(t.calendarId),t.location].filter(u=>u!=="").join(" · ");return d.jsx("div",{className:O(i?"px-row-inset":"px-2",a&&"min-h-12"),children:d.jsx(fa,{title:t.title,timeText:"",color:e.color(t.calendarId),layout:"row",density:va(n),rsvp:t.myRsvp,status:t.status,hasThread:t.threadId!=="",isRecurring:t.recurrenceRule!=="",zoneCertainty:t.zoneCertainty,selected:s,onClick:r,leading:d.jsxs("span",{className:O("shrink-0 pt-1 text-2xs tabular-nums text-fg-subtle",i?"w-14":"w-11"),children:[t.start.slice(11,16),o&&d.jsx("span",{className:"block opacity-70",children:t.end.slice(11,16)})]}),trailing:d.jsx("span",{className:"text-2xs tabular-nums",children:ze(l)}),detail:o&&c!==""?d.jsxs("span",{className:"flex min-w-0 items-center gap-2 text-2xs opacity-80",children:[t.location!==""&&d.jsx(Fl,{className:"size-3 shrink-0"}),d.jsx("span",{className:"truncate",children:c}),t.attendees.length>0&&d.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[d.jsx(Il,{className:"size-3"}),t.attendees.length]})]}):void 0})})}function Sa(t){return O("flex cursor-pointer items-center justify-center rounded-md px-2 font-medium transition-colors","has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring",t?"bg-accent-2-soft text-accent-2":"text-fg-muted hover:bg-surface-sunken hover:text-fg")}function Xu({options:t,value:e,onChange:n,touch:s,ariaLabel:r,className:i}){const a=w.useId();return d.jsxs("fieldset",{className:O("inline-flex items-center gap-0.5",i),children:[d.jsx("legend",{className:"sr-only",children:r}),t.map(o=>d.jsxs("label",{className:O(Sa(e===o.value),s?"min-h-11 flex-1 text-sm":"h-7 text-xs"),children:[d.jsx("input",{type:"radio",name:a,value:o.value,checked:e===o.value,onChange:()=>n(o.value),className:"sr-only"}),s?o.shortLabel:o.label]},o.value))]})}const vr=[{value:"year",label:"Year",shortLabel:"Y"},{value:"month",label:"Month",shortLabel:"M"},{value:"week",label:"Week",shortLabel:"W"},{value:"day",label:"Day",shortLabel:"D"},{value:"agenda",label:"Agenda",shortLabel:"List"}];function Ku({value:t,onChange:e,views:n,touch:s,className:r}){const i=n?vr.filter(a=>n.includes(a.value)):vr;return d.jsx(Xu,{ariaLabel:"Calendar view",options:i,value:t,onChange:e,touch:s,className:r})}function Ju({title:t,onPrev:e,onNext:n,onToday:s,children:r,touch:i}){const a=O("flex items-center justify-center rounded-md text-fg-muted outline-none transition-colors hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",i?"size-11":"size-7");return d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx("button",{type:"button",onClick:e,"aria-label":"Previous",className:a,children:d.jsx(Ql,{className:"size-4"})}),d.jsx("button",{type:"button",onClick:n,"aria-label":"Next",className:a,children:d.jsx(Si,{className:"size-4"})}),d.jsx("button",{type:"button",onClick:s,className:O("rounded-md border border-line px-2.5 font-medium text-fg outline-none transition-colors hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",i?"min-h-11 text-sm":"h-7 text-xs"),children:"Today"}),d.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:t}),r]})}function Qu({nextUp:t,calendars:e,today:n,onSelectEvent:s,onGoTo:r,touch:i,className:a}){const{running:o,next:l,minutesUntilNext:c,after:u,free:h}=t,g=w.useMemo(()=>{const m=new Map(e.map(v=>[v.id,v.color]));return v=>m.get(v)??"cal-1"},[e]);return d.jsxs("section",{className:O("flex flex-col gap-2 rounded-lg border border-line bg-surface-raised p-3",a),children:[o.length>0&&d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx(yr,{icon:d.jsx(rc,{className:"size-3 text-danger"}),children:"Now"}),o.map(m=>d.jsx(Sr,{eventId:m.id,title:m.title,color:g(m.calendarId),meta:`until ${m.end.slice(11,16)}`,onSelect:s,touch:i},m.id))]}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx(yr,{icon:d.jsx($l,{className:"size-3"}),children:l?`Next · in ${ze(c)}`:"Next"}),l?d.jsx(Sr,{eventId:l.id,title:l.title,color:g(l.calendarId),meta:`${_n(l.start.slice(0,10),n)}${l.start.slice(11,16)}${l.location===""?"":` · ${l.location}`}`,onSelect:s,touch:i}):d.jsx("p",{className:"text-sm text-fg-muted",children:"Nothing else booked."}),u&&d.jsxs("p",{className:"truncate pl-1 text-2xs text-fg-subtle",children:["then ",u.title," · ",_n(u.start.slice(0,10),n),u.start.slice(11,16)]})]}),h&&d.jsxs("button",{type:"button",onClick:()=>r(h.date),className:O("flex items-center gap-2 rounded-md border border-dashed border-accent-2 bg-accent-2-soft/40 px-2 text-left text-accent-2 outline-none transition-colors hover:bg-accent-2-soft focus-visible:ring-2 focus-visible:ring-ring",i?"min-h-11":"min-h-8"),children:[d.jsx(ic,{className:"size-3.5 shrink-0"}),d.jsxs("span",{className:"text-xs font-medium",children:[ze(h.minutes)," free"]}),d.jsxs("span",{className:"text-2xs tabular-nums opacity-80",children:[_n(h.date,n),Le(h.startMinute)," – ",Le(h.endMinute)]})]})]})}function yr({icon:t,children:e}){return d.jsxs("h3",{className:"flex items-center gap-1.5 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:[t,e]})}function Sr({eventId:t,title:e,color:n,meta:s,onSelect:r,touch:i}){const a=ms(n);return d.jsx("button",{type:"button",onClick:()=>r(t),className:O("flex w-full items-center gap-2 rounded-md border-l-2 px-2 py-1 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",a.soft,a.text,a.rail,i&&"min-h-12"),children:d.jsxs("span",{className:"min-w-0 flex-1",children:[d.jsx("span",{className:"block truncate text-sm font-medium",children:e}),d.jsx("span",{className:"block truncate text-2xs opacity-80",children:s})]})})}function _n(t,e){return t===e?"":t===oa(e,1)?"tomorrow · ":`${yu(t)} · `}const Ea=`${uu}Record`,ba=`${hu}Record`,Da=`${fu}Record`,eh=new WeakMap,wa=new WeakMap,Ca=new WeakMap,Ra=new WeakMap;function xa(t){return th(t)||Cn()}function th(t){return eh.get(t)}function Ta(t){return nh(t)||Cn()}function nh(t){return wa.get(t)}function Ma(t,e){wa.set(t,e)}function Ia(t){return sh(t)||Cn()}function sh(t){return Ca.get(t)}function Na(t,e){Ca.set(t,e)}function Ha(t){return rh(t)||Cn()}function rh(t){return Ra.get(t)}function ka(t,e){Ra.set(t,e)}function Pa(t){return xa(t).id}function ja(t){const e=xa(t).ue;return e||ce(Rc(Pa(t),"getExotic or getAny")),e}function ih(t){if(t!==void 0)return ah(t)}function ah(t){return ja(t),Pa(t)}const Dt=Ha,oh=ft(Ea,class{get calendarId(){return Dt(this).calendarId}toJSON(){return Dt(this).toJSON()}valueOf(){return Dt(this).valueOf()}},Dt,aa,ia);function lh(t){const e=Object.create(oh.prototype);return ka(e,t),gt(e),e}function ch(t,e,n,s,r,i,a,o,l,c){return lh(new Ze.PlainDateTime(t,e,n,s,r,i,a,o,l,ih(c)))}function dh(t,e,n){return La(Dt(t).toZonedDateTime(e,n))}const Ne=Ia,uh=ft(ba,class{get calendarId(){return Ne(this).calendarId}get timeZoneId(){return Ne(this).timeZoneId}get epochMilliseconds(){return Ne(this).epochMilliseconds}get epochNanoseconds(){return Ne(this).epochNanoseconds}toJSON(){return Ne(this).toJSON()}valueOf(){return Ne(this).valueOf()}},Ne,aa,ia);function La(t){const e=Object.create(uh.prototype);return Na(e,t),gt(e),e}function hh(t){return Ne(t).offsetNanoseconds}const wt=Ta,fh=ft(Da,class{get epochMilliseconds(){return wt(this).epochMilliseconds}get epochNanoseconds(){return wt(this).epochNanoseconds}toJSON(){return wt(this).toJSON()}valueOf(){return wt(this).valueOf()}});function gh(t){const e=Object.create(fh.prototype);return Ma(e,t),gt(e),e}function mh(t){return gh(Ze.Instant.fromEpochMilliseconds(t))}function ph(t,e){return La(wt(t).toZonedDateTimeISO(e))}function vh(t){return t===void 0?ht:yh(t)}function yh(t){return ja(t)()}const $t=Ha,Sh=ft(Ea,class{get calendarId(){return yn($t(this).calendar)}toJSON(){return _d($t(this))}valueOf(){return Ms()}},$t,Is,Ds);function Eh(t){const e=Object.create(Sh.prototype);return ka(e,t),gt(e),e}function bh(t,e,n,s=0,r=0,i=0,a=0,o=0,l=0,c){const u=Sd(Qc(vs(ps,{year:t,month:e,day:n,hour:s,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:l}))),h=vh(c);return Eh(wd(u,h))}function Dh(t,e,n){return Aa(nu($t(t),ra(na(e)),n))}const Be=Ia,wh=ft(ba,class{get calendarId(){return yn(Be(this).calendar)}get timeZoneId(){return Be(this).timeZone.id}get epochMilliseconds(){return Zi(Be(this))}get epochNanoseconds(){return Xi(Be(this))}toJSON(){return Bd(Be(this))}valueOf(){return Ms()}},Ch,Is,Ds);function Aa(t){const e=Object.create(wh.prototype);return Na(e,t),gt(e),e}function Ch(t){const e=Be(t);return{...Ki(e),calendar:e.calendar}}function Rh(t){return Ki(Be(t)).offsetNanoseconds}const Zt=Ta,xh=ft(Da,class{get epochMilliseconds(){return Zi(Zt(this))}get epochNanoseconds(){return Xi(Zt(this))}toJSON(){return Wd(Zt(this))}valueOf(){return Ms()}});function Th(t){const e=Object.create(xh.prototype);return Ma(e,t),gt(e),e}function Mh(t){return Th(su(t))}function Ih(t,e){return Aa(tu(Zt(t),ra(na(e))))}const Nh=Ze?hh:Rh,Er=Ze?ch:bh,br=Ze?dh:Dh,Hh=Ze?mh:Mh,kh=Ze?ph:Ih;function Dr(t,e){let n=at(t);return n[2]+=e*7,he(n)}function te(t,e){let n=at(t);return n[2]+=e,he(n)}function Ge(t,e){let n=at(t);return n[6]+=e,he(n)}function Ph(t,e){return Xe(t,e)/7}function Xe(t,e){return(e.valueOf()-t.valueOf())/(1e3*60*60*24)}function jh(t,e){return(e.valueOf()-t.valueOf())/(1e3*60*60)}function Lh(t,e){return(e.valueOf()-t.valueOf())/(1e3*60)}function Ah(t,e){return(e.valueOf()-t.valueOf())/1e3}function Oh(t,e){let n=z(t),s=z(e);return{years:0,months:0,days:Math.round(Xe(n,s)),milliseconds:e.valueOf()-s.valueOf()-(t.valueOf()-n.valueOf())}}function Oa(t,e){let n=Tt(t,e);return n!==null&&n%7===0?n/7:null}function Tt(t,e){return tt(t)===tt(e)?Math.round(Xe(t,e)):null}function z(t){return he([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()])}function Wh(t){return he([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours()])}function Bh(t){return he([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes()])}function _h(t){return he([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds()])}function Uh(t,e,n){let s=t.getUTCFullYear(),r=Un(t,s,e,n);if(r<1)return Un(t,s-1,e,n);let i=Un(t,s+1,e,n);return i>=1?Math.min(r,i):r}function Un(t,e,n,s){let r=he([e,0,1+Fh(e,n,s)]),i=z(t),a=Math.round(Xe(r,i));return Math.floor(a/7)+1}function Fh(t,e,n){let s=7+e-n;return-((7+he([t,0,s]).getUTCDay()-e)%7)+s-1}function Vh(t){return[t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()]}function wr(t){return new Date(t[0],t[1]||0,t[2]==null?1:t[2],t[3]||0,t[4]||0,t[5]||0)}function at(t){return[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()]}function he(t){return t.length===1&&(t=t.concat([0])),new Date(Date.UTC(...t))}function Wa(t){return!isNaN(t.valueOf())}function tt(t){return t.getUTCHours()*1e3*60*60+t.getUTCMinutes()*1e3*60+t.getUTCSeconds()*1e3+t.getUTCMilliseconds()}let Ba={};function zh(t,e){Ba[t]=e}function Gh(t){return new Ba[t]}class Yh{getMarkerYear(e){return e.getUTCFullYear()}getMarkerMonth(e){return e.getUTCMonth()}getMarkerDay(e){return e.getUTCDate()}arrayToMarker(e){return he(e)}markerToArray(e){return at(e)}}zh("gregory",Yh);function qh(t,e){let n=null,s=null;return t.start&&(n=e.createMarker(t.start)),t.end&&(s=e.createMarker(t.end)),!n&&!s||n&&s&&s<n?null:{start:n,end:s}}function Cr(t,e){let n=[],{start:s}=e,r,i;for(t.sort($h),r=0;r<t.length;r+=1)i=t[r],i.start>s&&n.push({start:s,end:i.start}),i.end>s&&(s=i.end);return s<e.end&&n.push({start:s,end:e.end}),n}function $h(t,e){return t.start.valueOf()-e.start.valueOf()}function Ae(t,e){let{start:n,end:s}=t,r=null;return e.start!==null&&(n===null?n=e.start:n=new Date(Math.max(n.valueOf(),e.start.valueOf()))),e.end!=null&&(s===null?s=e.end:s=new Date(Math.min(s.valueOf(),e.end.valueOf()))),(n===null||s===null||n<s)&&(r={start:n,end:s}),r}function Zh(t,e){return(t.start===null?null:t.start.valueOf())===(e.start===null?null:e.start.valueOf())&&(t.end===null?null:t.end.valueOf())===(e.end===null?null:e.end.valueOf())}function Hs(t,e){return(t.end===null||e.start===null||t.end>e.start)&&(t.start===null||e.end===null||t.start<e.end)}function Rn(t,e){return(t.start===null||e.start!==null&&e.start>=t.start)&&(t.end===null||e.end!==null&&e.end<=t.end)}function Ce(t,e){return(t.start===null||e>=t.start)&&(t.end===null||e<t.end)}function Xh(t,e){return e.start!=null&&t<e.start?e.start:e.end!=null&&t>=e.end?new Date(e.end.valueOf()-1):t}function Rr(t,e){let n=e.markerToArray(t.marker);return{marker:t.marker,timeZoneOffset:t.timeZoneOffset,array:n,year:n[0],month:n[1],day:n[2],hour:n[3],minute:n[4],second:n[5],millisecond:n[6]}}function an(t,e,n){let s=Rr(t,n.calendarSystem),r=e?Rr(e,n.calendarSystem):null;return{date:s,start:s,end:r,timeZone:n.timeZone,localeCodes:n.locale.codes}}function Xt(t){return t%1===0}function st(t,e){let n=String(t);return"000".substr(0,e-n.length)+n}const xr=["years","months","days","milliseconds"],Kh=/^(-?)(?:(\d+)\.)?(\d+):(\d\d)(?::(\d\d)(?:\.(\d\d\d))?)?/;function _(t,e){return typeof t=="string"?Jh(t):typeof t=="object"&&t?Tr(t):typeof t=="number"?Tr({[e||"milliseconds"]:t}):null}function Jh(t){let e=Kh.exec(t);if(e){let n=e[1]?-1:1;return{years:0,months:0,days:n*(e[2]?parseInt(e[2],10):0),milliseconds:n*((e[3]?parseInt(e[3],10):0)*60*60*1e3+(e[4]?parseInt(e[4],10):0)*60*1e3+(e[5]?parseInt(e[5],10):0)*1e3+(e[6]?parseInt(e[6],10):0))}}return null}function Tr(t){let e={years:t.years||t.year||0,months:t.months||t.month||0,days:t.days||t.day||0,milliseconds:(t.hours||t.hour||0)*60*60*1e3+(t.minutes||t.minute||0)*60*1e3+(t.seconds||t.second||0)*1e3+(t.milliseconds||t.millisecond||t.ms||0)},n=t.weeks||t.week;return n&&(e.days+=n*7,e.specifiedWeeks=!0),e}function Qh(t,e){return t.years===e.years&&t.months===e.months&&t.days===e.days&&t.milliseconds===e.milliseconds}function Kn(t,e){return{years:t.years+e.years,months:t.months+e.months,days:t.days+e.days,milliseconds:t.milliseconds+e.milliseconds}}function ef(t,e){return{years:t.years-e.years,months:t.months-e.months,days:t.days-e.days,milliseconds:t.milliseconds-e.milliseconds}}function tf(t,e){return{years:t.years*e,months:t.months*e,days:t.days*e,milliseconds:t.milliseconds*e}}function nf(t){return rt(t)/365}function sf(t){return rt(t)/30}function rt(t){return Re(t)/864e5}function Re(t){return t.years*(365*864e5)+t.months*(30*864e5)+t.days*864e5+t.milliseconds}function ks(t,e){let n=null;for(let s=0;s<xr.length;s+=1){let r=xr[s];if(e[r]){let i=t[r]/e[r];if(!Xt(i)||n!==null&&n!==i)return null;n=i}else if(t[r])return null}return n}function Jn(t){let e=t.milliseconds;if(e){if(e%1e3!==0)return{unit:"millisecond",value:e};if(e%(1e3*60)!==0)return{unit:"second",value:e/1e3};if(e%(1e3*60*60)!==0)return{unit:"minute",value:e/(1e3*60)};if(e)return{unit:"hour",value:e/(1e3*60*60)}}return t.days?t.specifiedWeeks&&t.days%7===0?{unit:"week",value:t.days/7}:{unit:"day",value:t.days}:t.months?{unit:"month",value:t.months}:t.years?{unit:"year",value:t.years}:{unit:"millisecond",value:0}}function _a(t,e,n=!1){let s=t.toISOString();return s=s.replace(".000",""),n&&(s=s.replace("T00:00:00Z","")),s.length>10&&(e==null?s=s.replace("Z",""):e!==0&&(s=s.replace("Z",xn(e,!0)))),s}function mt(t){return t.toISOString().replace(/T.*$/,"")}function Mr(t){return t.toISOString().match(/^\d{4}-\d{2}/)[0]}function rf(t){return st(t.getUTCHours(),2)+":"+st(t.getUTCMinutes(),2)+":"+st(t.getUTCSeconds(),2)}function xn(t,e=!1){let n=t<0?"-":"+",s=Math.abs(t),r=Math.floor(s/60),i=Math.round(s%60);return e?`${n+st(r,2)}:${st(i,2)}`:`GMT${n}${r}${i?`:${st(i,2)}`:""}`}function ie(t){let e="";for(const n of t)e+=n.value;return e}const af=/^\s*(\d{4})(-?(\d{2})(-?(\d{2})([T ](\d{2}):?(\d{2})(:?(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/;function of(t){let e=af.exec(t);if(e){let n=new Date(Date.UTC(Number(e[1]),e[3]?Number(e[3])-1:0,Number(e[5]||1),Number(e[7]||0),Number(e[8]||0),Number(e[10]||0),e[12]?+`0.${e[12]}`*1e3:0));if(Wa(n)){let s=null;return e[13]&&(s=(e[15]==="-"?-1:1)*(Number(e[16]||0)*60+Number(e[18]||0))),{marker:n,isTimeUnspecified:!e[6],timeZoneOffset:s}}}return null}class lf{constructor(e){this.timeZone=e.timeZone,this.calendarSystem=Gh(e.calendarSystem),this.locale=e.locale,this.weekDow=e.locale.week.dow,this.weekDoy=e.locale.week.doy,e.weekNumberCalculation==="ISO"&&(this.weekDow=1,this.weekDoy=4),typeof e.firstDay=="number"&&(this.weekDow=e.firstDay),typeof e.weekNumberCalculation=="function"&&(this.weekNumberFunc=e.weekNumberCalculation),this.weekTextLong=e.weekTextLong,this.weekTextShort=e.weekTextShort??e.weekTextLong,this.cmdFormatter=e.cmdFormatter}createMarker(e){let n=this.createMarkerMeta(e);return n===null?null:n.marker}createNowMarker(){return this.timestampToMarker(new Date().valueOf())}createMarkerMeta(e){if(typeof e=="string")return this.parse(e);let n=null;return typeof e=="number"?n=this.timestampToMarker(e):e instanceof Date?(e=e.valueOf(),isNaN(e)||(n=this.timestampToMarker(e))):Array.isArray(e)&&(n=he(e)),n===null||!Wa(n)?null:{marker:n,isTimeUnspecified:!1}}parse(e){let n=of(e);if(n===null)return null;let{marker:s}=n;return n.timeZoneOffset!==null&&(s=this.timestampToMarker(s.valueOf()-n.timeZoneOffset*60*1e3)),{marker:s,isTimeUnspecified:n.isTimeUnspecified}}getYear(e){return this.calendarSystem.getMarkerYear(e)}getMonth(e){return this.calendarSystem.getMarkerMonth(e)}getDay(e){return this.calendarSystem.getMarkerDay(e)}add(e,n){let s=this.calendarSystem.markerToArray(e);return s[0]+=n.years,s[1]+=n.months,s[2]+=n.days,s[6]+=n.milliseconds,this.calendarSystem.arrayToMarker(s)}subtract(e,n){let s=this.calendarSystem.markerToArray(e);return s[0]-=n.years,s[1]-=n.months,s[2]-=n.days,s[6]-=n.milliseconds,this.calendarSystem.arrayToMarker(s)}addYears(e,n){let s=this.calendarSystem.markerToArray(e);return s[0]+=n,this.calendarSystem.arrayToMarker(s)}addMonths(e,n){let s=this.calendarSystem.markerToArray(e);return s[1]+=n,this.calendarSystem.arrayToMarker(s)}diffWholeYears(e,n){let{calendarSystem:s}=this;return tt(e)===tt(n)&&s.getMarkerDay(e)===s.getMarkerDay(n)&&s.getMarkerMonth(e)===s.getMarkerMonth(n)?s.getMarkerYear(n)-s.getMarkerYear(e):null}diffWholeMonths(e,n){let{calendarSystem:s}=this;return tt(e)===tt(n)&&s.getMarkerDay(e)===s.getMarkerDay(n)?s.getMarkerMonth(n)-s.getMarkerMonth(e)+(s.getMarkerYear(n)-s.getMarkerYear(e))*12:null}greatestWholeUnit(e,n){let s=this.diffWholeYears(e,n);return s!==null?{unit:"year",value:s}:(s=this.diffWholeMonths(e,n),s!==null?{unit:"month",value:s}:(s=Oa(e,n),s!==null?{unit:"week",value:s}:(s=Tt(e,n),s!==null?{unit:"day",value:s}:(s=jh(e,n),Xt(s)?{unit:"hour",value:s}:(s=Lh(e,n),Xt(s)?{unit:"minute",value:s}:(s=Ah(e,n),Xt(s)?{unit:"second",value:s}:{unit:"millisecond",value:n.valueOf()-e.valueOf()}))))))}countDurationsBetween(e,n,s){let r;return s.years&&(r=this.diffWholeYears(e,n),r!==null)?r/nf(s):s.months&&(r=this.diffWholeMonths(e,n),r!==null)?r/sf(s):s.days&&(r=Tt(e,n),r!==null)?r/rt(s):(n.valueOf()-e.valueOf())/Re(s)}startOf(e,n){return n==="year"?this.startOfYear(e):n==="month"?this.startOfMonth(e):n==="week"?this.startOfWeek(e):n==="day"?z(e):n==="hour"?Wh(e):n==="minute"?Bh(e):n==="second"?_h(e):null}startOfYear(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e)])}startOfMonth(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e)])}startOfWeek(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e),e.getUTCDate()-(e.getUTCDay()-this.weekDow+7)%7])}computeWeekNumber(e){return this.weekNumberFunc?this.weekNumberFunc(this.toDate(e)):Uh(e,this.weekDow,this.weekDoy)}formatToParts(e,n){return n.formatToParts({marker:e,timeZoneOffset:this.offsetForMarker(e)},this)}formatRangeToParts(e,n,s,r={}){return r.isEndExclusive&&(n=Ge(n,-1)),s.formatRangeToParts({marker:e,timeZoneOffset:this.offsetForMarker(e)},{marker:n,timeZoneOffset:this.offsetForMarker(n)},this)}formatIso(e,n={}){let s=null;return n.omitTimeZoneOffset||(s=this.offsetForMarker(e)),_a(e,s,n.omitTime)}timestampToMarker(e){if(this.timeZone==="local")return he(Vh(new Date(e)));if(this.timeZone==="UTC")return new Date(e);const n=kh(Hh(e),this.timeZone);return new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond))}offsetForMarker(e){return this.timeZone==="local"?-wr(at(e)).getTimezoneOffset():this.timeZone==="UTC"?0:Nh(br(Er(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),this.timeZone))/(1e9*60)}toDate(e){return this.timeZone==="local"?wr(at(e)):this.timeZone==="UTC"?new Date(e.valueOf()):new Date(br(Er(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),this.timeZone).epochMilliseconds)}}const cf=new Set(["week","meridiem","omitZeroMinute","omitCommas","forceCommas","omitTrailing","weekdayJustify"]),Vt=/([ap])\.?m\.?/i,df=/,/g,uf=/\u200e/g,hf=/[\s.,]+$/,Qn=/^\s+$/;class ff{constructor(e){const n={},s={};for(const r in e)cf.has(r)?s[r]=e[r]:n[r]=e[r];n.timeZoneName==="long"&&(n.timeZoneName="short"),this.timeZoneOnly=Object.keys(n).length===1&&n.timeZoneName==="short",this.weekOnly=!!(!Object.keys(n).length&&s.week),this.timeZoneOnly||(n.timeZoneName&&(n.hour||(n.hour="2-digit"),n.minute||(n.minute="2-digit")),s.omitZeroMinute&&(n.second||n.fractionalSecondDigits)&&delete s.omitZeroMinute,n.timeZone="UTC"),this.standardOptions=n,this.extendedOptions=s}formatToParts(e,n){const{standardOptions:s,extendedOptions:r}=this;if(this.timeZoneOnly)return[{type:"timeZoneName",value:xn(e.timeZoneOffset)}];if(this.weekOnly)return pf(n.computeWeekNumber(e.marker),n.weekTextLong,n.weekTextShort,n.locale,r.week);const{normalFormat:i,zeroFormat:a}=this.getFormats(n),l=(a&&!e.marker.getUTCMinutes()?a:i).formatToParts(e.marker);return gf(l,e,s,r)}formatRangeToParts(e,n,s){const{standardOptions:r,extendedOptions:i}=this;if(this.timeZoneOnly||this.weekOnly)return this.formatToParts(e,s).map(u=>({source:u.type==="literal"?"shared":"startRange",...u}));const{normalFormat:a,zeroFormat:o}=this.getFormats(s),c=(o&&!e.marker.getUTCMinutes()&&!n.marker.getUTCMinutes()?o:a).formatRangeToParts(e.marker,n.marker);return mf(c,e,n,r,i)}getFormats(e){if(this.cachedContext!==e){const{standardOptions:n,extendedOptions:s}=this,{codes:r}=e.locale,i=new Intl.DateTimeFormat(r,n);let a;if(s.omitZeroMinute){const o={...n};delete o.minute,a=new Intl.DateTimeFormat(r,o)}this.cachedContext=e,this.cachedFormats={normalFormat:i,zeroFormat:a}}return this.cachedFormats}}function Ua(t,e,n){let s=!1,r;for(const i of t){const a=i.type==="literal";if(a||i.type==="dayPeriod"){let o=i.value;if(o=o.replace(uf,""),e.omitCommas&&(o=o.replace(df,"")),!a){const{meridiem:l}=e;l===!1?o=o.replace(Vt,""):l==="narrow"?o=o.replace(Vt,(c,u)=>u.toLocaleLowerCase()):l==="short"?o=o.replace(Vt,(c,u)=>`${u.toLocaleLowerCase()}m`):l==="lowercase"&&(o=o.replace(Vt,c=>c.toLocaleLowerCase())),r&&(r.value=r.value.trimEnd())}i.value=o}else if(i.type==="timeZoneName"){const o=n(i);o!=null&&(i.value=o,s=!0)}r=a?i:void 0}return{lastLiteral:r,anyTzInjected:s}}function gf(t,e,n,s){const r=n.timeZoneName==="short"?e.timeZoneOffset==null?"UTC":xn(e.timeZoneOffset):void 0,{lastLiteral:i,anyTzInjected:a}=Ua(t,s,()=>r);if(r&&!a&&(i?i.value+=" ":t.push({type:"literal",value:" "}),t.push({type:"timeZoneName",value:r})),s.weekdayJustify&&t.length===3&&Qn.test(t[1].value)&&t[s.weekdayJustify==="start"?2:0].type==="weekday"&&t.reverse(),s.forceCommas)for(const o of t)o.type==="literal"&&Qn.test(o.value)&&(o.value=`,${o.value}`);return s.omitTrailing&&Fa(t),t.filter(o=>o.value)}function mf(t,e,n,s,r){const i=s.timeZoneName==="short";if(Ua(t,r,a=>{if(!i)return;const o=a.source==="endRange"?n.timeZoneOffset:e.timeZoneOffset;return o==null?"UTC":xn(o)}),r.forceCommas)for(const a of t)a.type==="literal"&&Qn.test(a.value)&&(a.value=`,${a.value}`);return r.omitTrailing&&Fa(t),t.filter(a=>a.value)}function Fa(t){const e=t[t.length-1];e?.type==="literal"&&(e.value=e.value.replace(hf,""),e.value||t.pop())}function pf(t,e,n,s,r){const i=[];return r==="long"?i.push({type:"literal",value:e}):(r==="short"||r==="narrow")&&i.push({type:"literal",value:n}),(r==="long"||r==="short")&&i.push({type:"literal",value:" "}),i.push({type:"week",value:s.simpleNumberFormat.format(t)}),s.options.direction==="rtl"&&i.reverse(),i}class vf{constructor(e){this.cmdStr=e}formatToParts(e,n){const s=n.cmdFormatter(this.cmdStr,an(e,null,n));return Array.isArray(s)?s:[{type:"literal",value:s}]}formatRangeToParts(e,n,s){const r=s.cmdFormatter(this.cmdStr,an(e,n,s));return Array.isArray(r)?r.map(i=>({source:"shared",...i})):[{source:"shared",type:"literal",value:r}]}}class yf{constructor(e){this.func=e}formatToParts(e,n){return[{type:"literal",value:this.func(an(e,null,n))}]}formatRangeToParts(e,n,s){return[{source:"shared",type:"literal",value:this.func(an(e,n,s))}]}}var f={popoverZ:"fc-nH",isolate:"fc-7s",borderBoxRoot:"fc-wa",notAllowed:"fc-4m",noScrollbars:"fc-eM",noShrink:"fc-Qo",calendarScreenRoot:"fc-fi",safeTiles:"fc-fl",calendarPrintRoot:"fc-Jf",cursorPointer:"fc-DP",cursorResizeT:"fc-An",cursorResizeB:"fc-lZ",cursorResizeS:"fc-9V",cursorResizeE:"fc-70",hit:"fc-mN",hitX:"fc-2d",hitY:"fc-B0",borderNone:"fc-Tu",borderOnlyT:"fc-hU",borderOnlyB:"fc-3e",borderOnlyS:"fc-PB",borderlessX:"fc-MQ",fakeBorderS:"fc-2l",flexRow:"fc-Ao",flexCol:"fc-HH",grow:"fc-GV",liquid:"fc-g2",minHeight0:"fc-Ot",liquidX:"fc-hp",printRoot:"fc-uD",printHeader:"fc-jM",noPadding:"fc-OJ",noMargin:"fc-oE",noMarginX:"fc-SS",whiteSpaceNoWrap:"fc-y2",whiteSpacePre:"fc-CN",overflowAnchorNone:"fc-gZ",crop:"fc-FA",rel:"fc-cc",abs:"fc-H0",start0:"fc-6t",fill:"fc-ct",fillTop:"fc-iv",fillX:"fc-Uu",fillY:"fc-7k",fillStart:"fc-Yw",sticky:"fc-Ip",stickyT:"fc-CS",stickyS:"fc-tT",tableHeaderSticky:"fc-hy",contentBox:"fc-Np",alignCenter:"fc-6H",alignStart:"fc-K8",alignEnd:"fc-E3",footerScrollbarSticky:"fc-Px",footerScrollbar:"fc-J4",breakInsideAvoid:"fc-Yi",printSiblingRow:"fc-fx",z0:"fc-BS",z1:"fc-iu",focusZ2:"fc-Bk",internalEvent:"fc-Ft",internalEventMirror:"fc-lc",internalEventDraggable:"fc-uL",internalEventSelected:"fc-Bv",internalEventResizable:"fc-Qk",internalEventResizer:"fc-9X",internalEventResizerStart:"fc-Sj",internalEventResizerEnd:"fc-DL",internalBgEvent:"fc-oP",internalMoreLink:"fc-R2",internalNavLink:"fc-SW",internalPopover:"fc-Cs",internalView:"fc-LQ",internalScroller:"fc-dT"};function b(...t){return t.filter(Boolean).join(" ")}function Mt(t){return t*100+"%"}function V(t){return typeof t=="object"&&t?new ff(t):typeof t=="string"?new vf(t):typeof t=="function"?new yf(t):null}function Oe(...t){console.warn("FullCalendar:",...t)}const Ir={};function se(t,e){return!t||typeof t=="string"?t:(Sf(e),"")}function M(t,e){return typeof t=="function"?n=>se(t(n),e):se(t,e)}function Sf(t){Ir[t]||(Oe(`Invalid option \`${t}\`: expected a className string or a falsy value.`),Ir[t]=!0)}function Tn(t){t.preventDefault()}function Ef(t,e){return n=>{let s=n.target.closest(t);s&&e.call(s,n,s)}}function Va(t,e,n,s){let r=Ef(n,s);return t.addEventListener(e,r),()=>{t.removeEventListener(e,r)}}function bf(t,e,n,s){let r;return Va(t,"mouseover",e,(i,a)=>{if(a!==r){r=a,n(i,a);let o=l=>{r=null,s(l,a),a.removeEventListener("mouseleave",o)};a.addEventListener("mouseleave",o)}})}const Nr=["webkitTransitionEnd","otransitionend","oTransitionEnd","msTransitionEnd","transitionend"];function Df(t,e){let n=s=>{e(s),Nr.forEach(r=>{t.removeEventListener(r,n)})};Nr.forEach(s=>{t.addEventListener(s,n)})}function Ps(t){return{onClick:t,...za(t)}}function za(t){return{tabIndex:0,onKeyDown(e){(e.key==="Enter"||e.key===" ")&&(t(e),e.preventDefault())}}}let Hr=0;function Te(){return Hr+=1,String(Hr)}function js(){document.body.classList.add(f.notAllowed)}function Ls(){document.body.classList.remove(f.notAllowed)}function wf(t){t.style.userSelect="none",t.style.webkitUserSelect="none",t.addEventListener("selectstart",Tn)}function Cf(t){t.style.userSelect="",t.style.webkitUserSelect="",t.removeEventListener("selectstart",Tn)}function Rf(t){t.addEventListener("contextmenu",Tn)}function xf(t){t.removeEventListener("contextmenu",Tn)}function Tf(t){let e=[],n=[],s,r;for(typeof t=="string"?n=t.split(/\s*,\s*/):typeof t=="function"?n=[t]:Array.isArray(t)&&(n=t),s=0;s<n.length;s+=1)r=n[s],typeof r=="string"?e.push(r.charAt(0)==="-"?{field:r.substring(1),order:-1}:{field:r,order:1}):typeof r=="function"&&e.push({func:r});return e}function Mf(t,e,n){let s,r;for(s=0;s<n.length;s+=1)if(r=If(t,e,n[s]),r)return r;return 0}function If(t,e,n){return n.func?n.func(t,e):Nf(t[n.field],e[n.field])*(n.order||1)}function Nf(t,e){return!t&&!e?0:e==null?-1:t==null?1:typeof t=="string"||typeof e=="string"?String(t).localeCompare(String(e)):t-e}function ue(t,e,n){return typeof t=="function"?t(...e):typeof t=="string"?e.reduce((s,r,i)=>s.replace("$"+i,r||""),t):n}function Hf(t,e){return t-e}function Ga(t,e){return t===e}function ve(t){const e=t.borderless;return{borderlessX:!!(t.borderlessX??e),borderlessTop:!!(t.borderlessTop??e),borderlessBottom:!!(t.borderlessBottom??e)}}const{hasOwnProperty:ot}=Object.prototype;function Ye(t,e){let n={};for(let s in t)e(t[s],s)&&(n[s]=t[s]);return n}function xe(t,e){let n={};for(let s in t)n[s]=e(t[s],s);return n}function Ya(t){let e=[];for(let n in t)e.push(t[n]);return e}function qa(t){let e={};for(let n of t)e[n]=!0;return e}function kf(t,e){return typeof t=="object"&&t&&typeof e=="object"&&e?As(t,e,We):t===e}function As(t,e,n){if(t===e)return!0;for(let s in t)if(ot.call(t,s)&&!(s in e))return!1;for(let s in e)if(ot.call(e,s)&&(!(s in t)||!n(t[s],e[s],s)))return!1;return!0}function Fn(t,e){return typeof t=="object"&&typeof e=="object"&&t&&e?We(t,e):t===e}function We(t,e){return As(t,e,Ga)}function kr(t,e,n){return As(t,e,(s,r,i)=>{const a=n[i];return a?a(s,r):s===r})}function Pf(t,e){let n=[];for(let s in t)ot.call(t,s)&&(s in e||n.push(s));for(let s in e)ot.call(e,s)&&t[s]!==e[s]&&n.push(s);return n}function jf(t,e){return t?Lf(t,e,Af):e}function Lf(t,e,n){const s={};for(let r in t)ot.call(t,r)&&(r in e||(s[r]=t[r]));for(let r in e)ot.call(e,r)&&(r in t?s[r]=n(t[r],e[r]):s[r]=e[r]);return s}function Af(t,e){return Object.assign({},t,e)}function zt(t,e){return Array.isArray(t)&&Array.isArray(e)?lt(t,e):t===e}function lt(t,e,n=Ga){if(t===e)return!0;let s=t.length,r;if(s!==e.length)return!1;for(r=0;r<s;r+=1)if(!n(t[r],e[r]))return!1;return!0}const Pr={navLinkDayClick:S,navLinkWeekClick:S,duration:_,buttons:S,toolbarElements:S,prevText:String,nextText:String,prevYearText:String,nextYearText:String,todayText:String,yearText:String,monthText:String,weekTextLong:String,weekTextShort:String,dayText:String,listText:S,todayHint:S,prevHint:S,nextHint:S,buttonDisplay:S,buttonGroupClass:M,buttonClass:M,defaultAllDayEventDuration:_,defaultTimedEventDuration:_,nextDayThreshold:_,scrollTime:_,scrollTimeReset:Boolean,slotMinTime:_,slotMaxTime:_,popoverFormat:V,slotDuration:_,snapDuration:_,headerToolbar:S,footerToolbar:S,forceEventDuration:Boolean,dayLaneClass:M,dayLaneInnerClass:M,dayLaneDidMount:S,dayLaneWillUnmount:S,initialView:String,aspectRatio:Number,weekends:Boolean,weekNumberCalculation:S,weekNumbers:Boolean,weekNumberHeaderClass:M,weekNumberHeaderInnerClass:M,weekNumberHeaderContent:S,weekNumberHeaderDidMount:S,weekNumberHeaderWillUnmount:S,inlineWeekNumberClass:M,inlineWeekNumberContent:S,inlineWeekNumberDidMount:S,inlineWeekNumberWillUnmount:S,editable:Boolean,controller:S,nowIndicator:Boolean,nowIndicatorSnap:S,nowIndicatorHeaderClass:M,nowIndicatorHeaderContent:S,nowIndicatorHeaderDidMount:S,nowIndicatorHeaderWillUnmount:S,nowIndicatorDotClass:se,nowIndicatorLineClass:M,nowIndicatorLineContent:S,nowIndicatorLineDidMount:S,nowIndicatorLineWillUnmount:S,showNonCurrentDates:Boolean,lazyFetching:Boolean,startParam:String,endParam:String,timeZoneParam:String,timeZone:String,locales:S,locale:S,dragRevertDuration:Number,dragScroll:Boolean,allDayMaintainDuration:Boolean,unselectAuto:Boolean,dropAccept:S,eventOrder:Tf,eventOrderStrict:Boolean,eventSlicing:Boolean,eventPrintLayout:String,longPressDelay:Number,eventDragMinDistance:Number,expandRows:Boolean,height:S,contentHeight:S,direction:String,colorScheme:String,weekNumberFormat:V,eventResizableFromStart:Boolean,displayEventTime:Boolean,displayEventEnd:Boolean,progressiveEventRendering:Boolean,businessHours:S,initialDate:S,now:S,eventDataTransform:S,tableHeaderSticky:S,footerScrollbarSticky:S,defaultAllDay:Boolean,eventSourceFailure:S,eventSourceSuccess:S,eventDisplay:String,eventStartEditable:Boolean,eventDurationEditable:Boolean,eventOverlap:S,eventConstraint:S,eventAllow:S,eventColor:String,eventContrastColor:String,eventDidMount:S,eventWillUnmount:S,eventContent:S,eventClass:M,eventInnerClass:M,eventTimeClass:M,eventTitleClass:M,eventBeforeClass:M,eventAfterClass:M,listItemEventClass:M,listItemEventInnerClass:M,listItemEventTimeClass:M,listItemEventTitleClass:M,listItemEventBeforeClass:M,listItemEventAfterClass:M,blockEventClass:M,blockEventInnerClass:M,blockEventTimeClass:M,blockEventTitleClass:M,blockEventBeforeClass:M,blockEventAfterClass:M,rowEventClass:M,rowEventInnerClass:M,rowEventTimeClass:M,rowEventTitleClass:M,rowEventTitleSticky:Boolean,rowEventBeforeClass:M,rowEventBeforeContent:S,rowEventAfterClass:M,rowEventAfterContent:S,columnEventClass:M,columnEventInnerClass:M,columnEventTimeClass:M,columnEventTitleClass:M,columnEventTitleSticky:Boolean,columnEventBeforeClass:M,columnEventAfterClass:M,backgroundEventClass:M,backgroundEventDidMount:S,backgroundEventWillUnmount:S,backgroundEventContent:S,backgroundEventInnerClass:M,backgroundEventTitleClass:M,backgroundEventColor:String,selectConstraint:S,selectOverlap:S,selectAllow:S,droppable:Boolean,unselectCancel:String,slotHeaderFormat:S,slotLaneClass:M,slotLaneDidMount:S,slotLaneWillUnmount:S,slotHeaderClass:M,slotHeaderInnerClass:M,slotHeaderContent:S,slotHeaderDidMount:S,slotHeaderWillUnmount:S,slotHeaderAlign:S,slotHeaderSticky:S,slotHeaderRowClass:se,slotHeaderDividerClass:M,dayMaxEvents:S,dayMaxEventRows:S,dayMinWidth:Number,slotHeaderInterval:_,dayHeaderClass:M,dayHeaderInnerClass:M,dayHeaderContent:S,dayHeaderDidMount:S,dayHeaderWillUnmount:S,dayHeaderAlign:S,_dayHeaderSticky:S,dayHeaderRowClass:se,dayHeaderDividerClass:M,dayRowClass:se,dayCellDidMount:S,dayCellWillUnmount:S,dayCellClass:M,dayCellInnerClass:M,dayCellTopContent:S,dayCellTopClass:M,dayCellTopInnerClass:M,dayCellBottomClass:M,allDaySlot:Boolean,allDayText:String,allDayHeaderClass:M,allDayHeaderInnerClass:M,allDayHeaderContent:S,allDayHeaderDidMount:S,allDayHeaderWillUnmount:S,timedText:String,slotMinWidth:Number,slotMinHeight:Number,navLinks:Boolean,eventTimeFormat:V,rerenderDelay:Number,moreLinkText:S,moreLinkHint:S,selectMinDistance:Number,selectable:Boolean,selectLongPressDelay:Number,eventLongPressDelay:Number,selectMirror:Boolean,eventMaxStack:Number,eventMinHeight:Number,eventMinWidth:Number,eventShortHeight:Number,slotEventOverlap:Boolean,firstDay:Number,dayCount:Number,dateAlignment:String,dateIncrement:_,hiddenDays:S,fixedWeekCount:Boolean,validRange:S,visibleRange:S,titleFormat:S,eventInteractive:Boolean,noEventsText:String,viewHint:S,viewChangeHint:String,navLinkHint:S,closeHint:String,eventsHint:String,headingLevel:Number,moreLinkClick:S,moreLinkContent:S,moreLinkDidMount:S,moreLinkWillUnmount:S,moreLinkClass:M,moreLinkInnerClass:M,rowMoreLinkClass:M,rowMoreLinkInnerClass:M,columnMoreLinkClass:M,columnMoreLinkInnerClass:M,navLinkClass:se,monthStartFormat:V,dayCellFormat:V,handleCustomRendering:S,customRenderingMetaMap:S,popoverClass:se,popoverCloseClass:se,popoverCloseContent:S,dayNarrowWidth:Number,borderless:Boolean,borderlessX:Boolean,borderlessTop:Boolean,borderlessBottom:Boolean,fillerClass:M,headerToolbarClass:M,footerToolbarClass:M,toolbarClass:M,toolbarSectionClass:M,toolbarTitleClass:se,tableClass:M,tableHeaderClass:M,tableBodyClass:M,nonBusinessHoursClass:se,highlightClass:se,dayHeaders:Boolean,dayHeaderFormat:V,allDayDividerClass:se,listDaysClass:se,listDayClass:M,listDayFormat:Ar,listDayAltFormat:Ar,listDayHeaderDidMount:S,listDayHeaderWillUnmount:S,listDayHeaderClass:M,listDayHeaderInnerClass:M,listDayHeaderContent:S,listDayBodyClass:M,noEventsClass:M,noEventsInnerClass:M,noEventsContent:S,noEventsDidMount:S,noEventsWillUnmount:S,multiMonthMaxColumns:Number,singleMonthMinWidth:Number,singleMonthTitleFormat:V,singleMonthDidMount:S,singleMonthWillUnmount:S,singleMonthClass:M,singleMonthHeaderClass:M,singleMonthHeaderInnerClass:M},Vn={buttonDisplay:"auto",eventDisplay:"auto",defaultTimedEventDuration:"01:00:00",defaultAllDayEventDuration:{day:1},forceEventDuration:!1,nextDayThreshold:"00:00:00",initialView:"",aspectRatio:1.35,weekends:!0,weekNumbers:!1,weekNumberCalculation:"local",editable:!1,nowIndicator:!1,scrollTime:"06:00:00",scrollTimeReset:!0,slotMinTime:"00:00:00",slotMaxTime:"24:00:00",showNonCurrentDates:!0,lazyFetching:!0,startParam:"start",endParam:"end",timeZoneParam:"timeZone",timeZone:"local",locales:[],locale:"",dragRevertDuration:500,dragScroll:!0,allDayMaintainDuration:!1,unselectAuto:!0,dropAccept:"*",eventOrder:"start,-duration,allDay,title",eventPrintLayout:"auto",popoverFormat:{month:"long",day:"numeric",year:"numeric"},longPressDelay:1e3,eventDragMinDistance:5,expandRows:!1,navLinks:!1,selectable:!1,eventMinHeight:15,eventMinWidth:30,eventShortHeight:30,monthStartFormat:{month:"long",day:"numeric"},dayCellFormat:{day:"numeric",omitTrailing:!0},headingLevel:2,outerBorder:!0,dayNarrowWidth:80,eventOverlap:!0,slotHeaderAlign:"start",slotHeaderSticky:!0,dayHeaderAlign:"start",_dayHeaderSticky:!0,rowEventTitleSticky:!0,columnEventTitleSticky:!0,nowIndicatorSnap:"auto",dayHeaders:!0},jr={datesSet:S,eventsSet:S,eventAdd:S,eventChange:S,eventRemove:S,eventClick:S,eventMouseEnter:S,eventMouseLeave:S,select:S,unselect:S,loading:S,_unmount:S,_beforeprint:S,_afterprint:S,_noDateSelect:S,_noEventDrop:S,_noEventResize:S,_timeScrollRequest:S,dateClick:S,eventDragStart:S,eventDragStop:S,eventDrop:S,eventResizeStart:S,eventResizeStop:S,eventResize:S,drop:S,eventReceive:S,eventLeave:S},Lr={class:M,className:M,viewClass:M,viewDidMount:S,viewWillUnmount:S,views:S,plugins:S,initialEvents:S,events:S,eventSources:S},Of={type:String,component:S,class:M,className:M,content:S,didMount:S,willUnmount:S,buttonTextKey:String,dateProfileGeneratorClass:S,usesMinMaxTime:Boolean,disallowAmbigTitle:Boolean},Qe={dateIncrement:Fn,headerToolbar:Fn,footerToolbar:Fn,buttons:kf,plugins:zt,events:zt,eventSources:zt,resources:zt};function Os(t,e){let n={},s={};for(let r in e)r in t&&(n[r]=e[r](t[r],r));for(let r in t)r in e||(s[r]=t[r]);return{refined:n,extra:s}}function S(t){return t}function Ar(t){return t===!1?null:V(t)}function $a(t){let e=Math.floor(Xe(t.start,t.end))||1,n=z(t.start),s=te(n,e);return{start:n,end:s}}function Za(t,e=_(0)){let n=null,s=null;if(t.end){s=z(t.end);let r=t.end.valueOf()-s.valueOf();r&&r>=Re(e)&&(s=te(s,1))}return t.start&&(n=z(t.start),s&&s<=n&&(s=te(n,1))),{start:n,end:s}}function nt(t,e,n,s){return s==="year"?_(n.diffWholeYears(t,e),"year"):s==="month"?_(n.diffWholeMonths(t,e),"month"):Oh(t,e)}function Ws(t,e){return{instanceId:Te(),defId:t,range:e}}function Wf(t,e,n,s){for(let r=0;r<s.length;r+=1){let i=s[r].parse(t,n);if(i){let{allDay:a}=t;return a==null&&(a=e,a==null&&(a=i.allDayGuess,a==null&&(a=!1))),{allDay:a,duration:i.duration,typeData:i.typeData,typeId:r}}}return null}function qe(t,e,n){let{dateEnv:s,pluginHooks:r,options:i}=n,{defs:a,instances:o}=t;o=Ye(o,l=>!a[l.defId].recurringDef);for(let l in a){let c=a[l];if(c.recurringDef){let{duration:u}=c.recurringDef;u||(u=c.allDay?i.defaultAllDayEventDuration:i.defaultTimedEventDuration);let h=Bf(c,u,e,s,r.recurringTypes);for(let g of h){let m=Ws(l,{start:g,end:s.add(g,u)});o[m.instanceId]=m}}}return{defs:a,instances:o}}function Bf(t,e,n,s,r){let a=r[t.recurringDef.typeId].expand(t.recurringDef.typeData,{start:s.subtract(n.start,e),end:n.end},s);return t.allDay&&(a=a.map(z)),a}function It(t,e,n,s,r,i){let a=de(),o=Us(n);for(let l of t){let c=Ja(l,e,n,s,o,r,i);c&&es(c,a)}return a}function es(t,e=de()){return e.defs[t.def.defId]=t.def,t.instance&&(e.instances[t.instance.instanceId]=t.instance),e}function Bs(t,e){let n=t.instances[e];if(n){let s=t.defs[n.defId],r=Mn(t,i=>_f(s,i));return r.defs[s.defId]=s,r.instances[n.instanceId]=n,r}return de()}function _f(t,e){return!!(t.groupId&&t.groupId===e.groupId)}function de(){return{defs:{},instances:{}}}function _s(t,e){return{defs:{...t.defs,...e.defs},instances:{...t.instances,...e.instances}}}function Mn(t,e){let n=Ye(t.defs,e),s=Ye(t.instances,r=>n[r.defId]);return{defs:n,instances:s}}function Uf(t,e){let{defs:n,instances:s}=t,r={},i={};for(let a in n)e.defs[a]||(r[a]=n[a]);for(let a in s)!e.instances[a]&&r[s[a].defId]&&(i[a]=s[a]);return{defs:r,instances:i}}function Ff(t,e){return Array.isArray(t)?It(t,null,e,!0):typeof t=="object"&&t?It([t],null,e,!0):t!=null?String(t):null}const on={display:String,editable:Boolean,startEditable:Boolean,durationEditable:Boolean,constraint:S,overlap:S,allow:S,class:se,className:se,color:String,contrastColor:String},Vf={display:null,startEditable:null,durationEditable:null,constraints:[],overlap:null,allows:[],color:"",contrastColor:"",className:""};function ln(t,e){let n=Ff(t.constraint,e);return{display:t.display||null,startEditable:t.startEditable!=null?t.startEditable:t.editable,durationEditable:t.durationEditable!=null?t.durationEditable:t.editable,constraints:n!=null?[n]:[],overlap:t.overlap!=null?t.overlap:null,allows:t.allow!=null?[t.allow]:[],color:t.color||"",contrastColor:t.contrastColor||"",className:(t.class??t.className)||""}}function Xa(t){return t.reduce(zf,Vf)}function zf(t,e){return{display:e.display!=null?e.display:t.display,startEditable:e.startEditable!=null?e.startEditable:t.startEditable,durationEditable:e.durationEditable!=null?e.durationEditable:t.durationEditable,constraints:t.constraints.concat(e.constraints),overlap:typeof e.overlap=="boolean"?e.overlap:t.overlap,allows:t.allows.concat(e.allows),color:e.color||t.color,contrastColor:e.contrastColor||t.contrastColor,className:b(t.className,e.className)}}const Kt={id:String,groupId:String,title:String,url:String,interactive:Boolean},Ka={start:S,end:S,date:S,allDay:Boolean},Gf={...Kt,...Ka,extendedProps:S};function Ja(t,e,n,s,r=Us(n),i,a){let{refined:o,extra:l}=Qa(t,n,r),c=qf(e,n),u=Wf(o,c,n.dateEnv,n.pluginHooks.recurringTypes);if(u){let g=ts(o,l,e?e.sourceId:"",u.allDay,!!u.duration,n,i);return g.recurringDef={typeId:u.typeId,typeData:u.typeData,duration:u.duration},{def:g,instance:null}}let h=Yf(o,c,n,s);if(h){let g=ts(o,l,e?e.sourceId:"",h.allDay,h.hasEnd,n,i),m=Ws(g.defId,h.range);return a&&g.publicId&&a[g.publicId]&&(m.instanceId=a[g.publicId]),{def:g,instance:m}}return null}function Qa(t,e,n=Us(e)){return Os(t,n)}function Us(t){return{...on,...Gf,...t.pluginHooks.eventRefiners}}function ts(t,e,n,s,r,i,a){let o={title:t.title||"",groupId:t.groupId||"",publicId:t.id||"",url:t.url||"",recurringDef:null,defId:(a&&t.id?a[t.id]:"")||Te(),sourceId:n,allDay:s,hasEnd:r,interactive:t.interactive,ui:ln(t,i),extendedProps:{...t.extendedProps||{},...e}};for(let l of i.pluginHooks.eventDefMemberAdders)Object.assign(o,l(t));return Object.freeze(o.ui.className),Object.freeze(o.extendedProps),o}function Yf(t,e,n,s){let{allDay:r}=t,i,a=null,o=!1,l,c=null,u=t.start!=null?t.start:t.date;if(i=n.dateEnv.createMarkerMeta(u),i)a=i.marker;else if(!s)return null;return t.end!=null&&(l=n.dateEnv.createMarkerMeta(t.end)),r==null&&(e!=null?r=e:r=(!i||i.isTimeUnspecified)&&(!l||l.isTimeUnspecified)),r&&a&&(a=z(a)),l&&(c=l.marker,r&&(c=z(c)),a&&c<=a&&(c=null)),c?o=!0:s||(o=n.options.forceEventDuration||!1,c=n.dateEnv.add(a,r?n.options.defaultAllDayEventDuration:n.options.defaultTimedEventDuration)),{allDay:r,hasEnd:o,range:{start:a,end:c}}}function qf(t,e){let n=null;return t&&(n=t.defaultAllDay),n==null&&(n=e.options.defaultAllDay),n}const $f={start:S,end:S,allDay:Boolean};function Zf(t,e,n){let s=Xf(t,e),{range:r}=s;if(!r.start)return null;if(!r.end){if(n==null)return null;r.end=e.add(r.start,n)}return s}function Xf(t,e){let{refined:n,extra:s}=Os(t,$f),r=n.start?e.createMarkerMeta(n.start):null,i=n.end?e.createMarkerMeta(n.end):null,{allDay:a}=n;return a==null&&(a=r&&r.isTimeUnspecified&&(!i||i.isTimeUnspecified)),{range:{start:r?r.marker:null,end:i?i.marker:null},allDay:a,...s}}function Kf(t,e){return Zh(t.range,e.range)&&t.allDay===e.allDay&&Jf(t,e)}function Jf(t,e){for(let n in e)if(n!=="range"&&n!=="allDay"&&t[n]!==e[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}function Qf(t,e){return{...to(t.range,e,t.allDay),allDay:t.allDay}}function eo(t,e,n){return{...to(t,e,n),timeZone:e.timeZone}}function to(t,e,n){return{start:e.toDate(t.start),end:e.toDate(t.end),startStr:e.formatIso(t.start,{omitTime:n}),endStr:e.formatIso(t.end,{omitTime:n})}}function eg(t,e,n){let s=Qa({editable:!1},n),r=ts(s.refined,s.extra,"",t.allDay,!0,n);return{def:r,ui:ro(r,e),instance:Ws(r.defId,t.range),range:t.range,isStart:!0,isEnd:!0}}function no(t,e,n){n.emitter.trigger("select",{...Fs(t,n),jsEvent:e?e.origEvent:null,view:n.viewApi||n.calendarApi.view})}function tg(t,e){e.emitter.trigger("unselect",{jsEvent:t?t.origEvent:null,view:e.viewApi||e.calendarApi.view})}function Fs(t,e){let n={};for(let s of e.pluginHooks.dateSpanTransforms)Object.assign(n,s(t,e));return Object.assign(n,Qf(t,e.dateEnv)),n}function Or(t,e,n){let{dateEnv:s,options:r}=n,i=e;return t?(i=z(i),i=s.add(i,r.defaultAllDayEventDuration)):i=s.add(i,r.defaultTimedEventDuration),i}function Vs(t,e,n,s){let r=dn(t.defs,e),i=de();for(let a in t.defs){let o=t.defs[a];i.defs[a]=ng(o,r[a],n,s)}for(let a in t.instances){let o=t.instances[a],l=i.defs[o.defId];i.instances[a]=sg(o,l,r[o.defId],n,s)}return i}function ng(t,e,n,s){let r=n.standardProps||{};r.hasEnd==null&&e.durationEditable&&(n.startDelta||n.endDelta)&&(r.hasEnd=!0);let i={...t,...r,ui:{...t.ui,...r.ui}};n.extendedProps&&(i.extendedProps={...i.extendedProps,...n.extendedProps});for(let a of s.pluginHooks.eventDefMutationAppliers)a(i,n,s);return!i.hasEnd&&s.options.forceEventDuration&&(i.hasEnd=!0),i}function sg(t,e,n,s,r){let{dateEnv:i}=r,a=s.standardProps&&s.standardProps.allDay===!0,o=s.standardProps&&s.standardProps.hasEnd===!1,l={...t};return a&&(l.range=$a(l.range)),s.datesDelta&&n.startEditable&&(l.range={start:i.add(l.range.start,s.datesDelta),end:i.add(l.range.end,s.datesDelta)}),s.startDelta&&n.durationEditable&&(l.range={start:i.add(l.range.start,s.startDelta),end:l.range.end}),s.endDelta&&n.durationEditable&&(l.range={start:l.range.start,end:i.add(l.range.end,s.endDelta)}),o&&(l.range={start:l.range.start,end:Or(e.allDay,l.range.start,r)}),e.allDay&&(l.range={start:z(l.range.start),end:z(l.range.end)}),l.range.end<l.range.start&&(l.range.end=Or(e.allDay,l.range.start,r)),l}class et{constructor(e,n){this.context=e,this.internalEventSource=n}remove(){this.context.dispatch({type:"REMOVE_EVENT_SOURCE",sourceId:this.internalEventSource.sourceId})}refetch(){this.context.dispatch({type:"FETCH_EVENT_SOURCES",sourceIds:[this.internalEventSource.sourceId],isRefetch:!0})}get id(){return this.internalEventSource.publicId}get url(){return this.internalEventSource.meta.url}get format(){return this.internalEventSource.meta.format}}class ${constructor(e,n,s){this._context=e,this._def=n,this._instance=s||null}setProp(e,n){if(e in Ka)Oe(`Cannot set date-related event property \`${e}\`. Use a method instead.`);else if(e==="id")n=Kt[e](n),this.mutate({standardProps:{publicId:n}});else if(e in Kt)n=Kt[e](n),this.mutate({standardProps:{[e]:n}});else if(e in on){let s=on[e](n);e==="editable"?s={startEditable:n,durationEditable:n}:s={[e]:n},this.mutate({standardProps:{ui:s}})}else Oe(`Cannot set event property \`${e}\`. Use setExtendedProp instead.`)}setExtendedProp(e,n){this.mutate({extendedProps:{[e]:n}})}setStart(e,n={}){let{dateEnv:s}=this._context,r=s.createMarker(e);if(r&&this._instance){let i=this._instance.range,a=nt(i.start,r,s,n.granularity);n.maintainDuration?this.mutate({datesDelta:a}):this.mutate({startDelta:a})}}setEnd(e,n={}){let{dateEnv:s}=this._context,r;if(!(e!=null&&(r=s.createMarker(e),!r))&&this._instance)if(r){let i=nt(this._instance.range.end,r,s,n.granularity);this.mutate({endDelta:i})}else this.mutate({standardProps:{hasEnd:!1}})}setDates(e,n,s={}){let{dateEnv:r}=this._context,i={allDay:s.allDay},a=r.createMarker(e),o;if(a&&!(n!=null&&(o=r.createMarker(n),!o))&&this._instance){let l=this._instance.range;s.allDay===!0&&(l=$a(l));let c=nt(l.start,a,r,s.granularity);if(o){let u=nt(l.end,o,r,s.granularity);Qh(c,u)?this.mutate({datesDelta:c,standardProps:i}):this.mutate({startDelta:c,endDelta:u,standardProps:i})}else i.hasEnd=!1,this.mutate({datesDelta:c,standardProps:i})}}moveStart(e){let n=_(e);n&&this.mutate({startDelta:n})}moveEnd(e){let n=_(e);n&&this.mutate({endDelta:n})}moveDates(e){let n=_(e);n&&this.mutate({datesDelta:n})}setAllDay(e,n={}){let s={allDay:e},{maintainDuration:r}=n;r==null&&(r=this._context.options.allDayMaintainDuration),this._def.allDay!==e&&(s.hasEnd=r),this.mutate({standardProps:s})}formatRange(e){let{dateEnv:n}=this._context,s=this._instance,r=V(e);return this._def.hasEnd?ie(n.formatRangeToParts(s.range.start,s.range.end,r)):ie(n.formatToParts(s.range.start,r))}mutate(e){let n=this._instance;if(n){let s=this._def,r=this._context,{eventStore:i}=r.getCurrentData(),a=Bs(i,n.instanceId);a=Vs(a,{"":{display:"",startEditable:!0,durationEditable:!0,constraints:[],overlap:null,allows:[],color:"",contrastColor:"",className:""}},e,r);let l=new $(r,s,n);this._def=a.defs[s.defId],this._instance=a.instances[n.instanceId],r.dispatch({type:"MERGE_EVENTS",eventStore:a}),r.emitter.trigger("eventChange",{oldEvent:l,event:this,relatedEvents:Fe(a,r,n),revert(){r.dispatch({type:"RESET_EVENTS",eventStore:i})}})}}remove(){let e=this._context,n=so(this);e.dispatch({type:"REMOVE_EVENTS",eventStore:n}),e.emitter.trigger("eventRemove",{event:this,relatedEvents:[],revert(){e.dispatch({type:"MERGE_EVENTS",eventStore:n})}})}get source(){let{sourceId:e}=this._def;return e?new et(this._context,this._context.getCurrentData().eventSources[e]):null}get start(){return this._instance?this._context.dateEnv.toDate(this._instance.range.start):null}get end(){return this._instance&&this._def.hasEnd?this._context.dateEnv.toDate(this._instance.range.end):null}get startStr(){let e=this._instance;return e?this._context.dateEnv.formatIso(e.range.start,{omitTime:this._def.allDay}):""}get endStr(){let e=this._instance;return e&&this._def.hasEnd?this._context.dateEnv.formatIso(e.range.end,{omitTime:this._def.allDay}):""}get id(){return this._def.publicId}get groupId(){return this._def.groupId}get allDay(){return this._def.allDay}get title(){return this._def.title}get url(){return this._def.url}get display(){return this._def.ui.display||"auto"}get startEditable(){return this._def.ui.startEditable}get durationEditable(){return this._def.ui.durationEditable}get constraint(){return this._def.ui.constraints[0]||null}get overlap(){return this._def.ui.overlap}get allow(){return this._def.ui.allows[0]||null}get color(){return this._def.ui.color}get contrastColor(){return this._def.ui.contrastColor}get className(){return this._def.ui.className}get extendedProps(){return this._def.extendedProps}toPlainObject(e={}){let n=this._def,{ui:s}=n,{startStr:r,endStr:i}=this,a={allDay:n.allDay};return n.title&&(a.title=n.title),r&&(a.start=r),i&&(a.end=i),n.publicId&&(a.id=n.publicId),n.groupId&&(a.groupId=n.groupId),n.url&&(a.url=n.url),s.display&&s.display!=="auto"&&(a.display=s.display),s.color&&(a.color=s.color),s.contrastColor&&(a.contrastColor=s.contrastColor),s.className&&(a.className=s.className),Object.keys(n.extendedProps).length&&(e.collapseExtendedProps?Object.assign(a,n.extendedProps):a.extendedProps=n.extendedProps),a}toJSON(){return this.toPlainObject()}}function so(t){let e=t._def,n=t._instance;return{defs:{[e.defId]:e},instances:n?{[n.instanceId]:n}:{}}}function Fe(t,e,n){let{defs:s,instances:r}=t,i=[],a=n?n.instanceId:"";for(let o in r){let l=r[o],c=s[l.defId];l.instanceId!==a&&i.push(new $(e,c,l))}return i}function In(t){return t.eventRange.instance.instanceId}function ns(t,e,n,s){let r={},i={},a={},o=[],l=[],c=dn(t.defs,e);for(let u in t.defs){let h=t.defs[u];c[h.defId].display==="inverse-background"&&(h.groupId?(r[h.groupId]=[],a[h.groupId]||(a[h.groupId]=h)):i[u]=[])}for(let u in t.instances){let h=t.instances[u],g=t.defs[h.defId],m=c[g.defId],v=h.range,p=!g.allDay&&s?Za(v,s):v,y=Ae(p,n);y&&(m.display==="inverse-background"?g.groupId?r[g.groupId].push(y):i[h.defId].push(y):m.display!=="none"&&(m.display==="background"?o:l).push({def:g,ui:m,instance:h,range:y,isStart:p.start&&p.start.valueOf()===y.start.valueOf(),isEnd:p.end&&p.end.valueOf()===y.end.valueOf()}))}for(let u in r){let h=r[u],g=Cr(h,n);for(let m of g){let v=a[u],p=c[v.defId];o.push({def:v,ui:p,instance:null,range:m,isStart:!1,isEnd:!1})}}for(let u in i){let h=i[u],g=Cr(h,n);for(let m of g)o.push({def:t.defs[u],ui:c[u],instance:null,range:m,isStart:!1,isEnd:!1})}return{bg:o,fg:l}}function rg(t){return t.ui.display==="background"||t.ui.display==="inverse-background"}function cn(t,e){t.fcEventRange=e}function ct(t){return t.fcEventRange||t.parentNode.fcEventRange||null}function dn(t,e){return xe(t,n=>ro(n,e))}function ro(t,e){const n=[],s=e[""],r=e[t.defId];return s&&n.push(s),r&&n.push(r),n.push(t.ui),Xa(n)}function zs(t,e){let n=t.map(ig);return n.sort((s,r)=>Mf(s,r,e)),n.map(s=>s._seg)}function ig(t){let{eventRange:e}=t,n=e.def,s=e.instance?e.instance.range:e.range,r=s.start?s.start.valueOf():0,i=s.end?s.end.valueOf():0;return{...n.extendedProps,...n,id:n.publicId,start:r,end:i,duration:i-r,allDay:Number(n.allDay),_seg:t}}function ag(t,e){let{pluginHooks:n}=e,s=n.isDraggableTransformers,{def:r,ui:i}=t,a=i.startEditable;for(let o of s)a=o(a,r,i,e);return a}function og(t,e,n,s,r,i,a,o=!0,l=!0){const{dateEnv:c,options:u}=a,{def:h}=e;let{displayEventTime:g,displayEventEnd:m}=u;g==null&&(g=o!==!1),m==null&&(m=l!==!1);const v=!r&&n&&z(n).valueOf()!==z(e.instance.range.start).valueOf()?n:e.instance.range.start,p=!i&&s&&z(Ge(s,-1)).valueOf()!==z(Ge(e.instance.range.end,-1)).valueOf()?s:e.instance.range.end;if(g&&!h.allDay){if(m&&(r||i)&&h.hasEnd){const y=c.formatRangeToParts(v,p,t),D=cg(y);return D!=null?ie(c.formatToParts(v,t))+D+ie(c.formatToParts(p,t)):ie(y)}if(r)return ie(c.formatToParts(v,t))}return""}const lg=new Set(["year","month","day"]);function cg(t){let e,n=!1;for(const s of t)s.source==="shared"&&(e=s),lg.has(s.type)&&(n=!0);return n?e.value:void 0}function $e(t,e,n){let s=t.range;return{isPast:s.end<=(n||e.start),isFuture:s.start>=(n||e.end),isToday:e&&Ce(e,s.start)}}function dg(t){return t.instance?t.instance.instanceId:`${t.def.defId}:${t.range.start.toISOString()}`}function ug(t,e){let{def:n,instance:s}=t,{url:r}=n;if(r)return["a",{href:r},!0];let{emitter:i,options:a}=e,{eventInteractive:o}=a;o==null&&(o=n.interactive,o==null&&(o=!!i.hasHandlers("eventClick")));let l;return o&&(l=za(c=>{i.trigger("eventClick",{el:c.target,event:new $(e,n,s),jsEvent:c,view:e.viewApi})}),l={role:"button",...l}),["div",l,o]}const hg=/(^c|C)lass(Name)?$/,fg=/Content$/,gg=/(DidMount|WillUnmount)$/,mg=/^on[A-Z]/,pg={buttons:jf};function vg(...t){const e={};for(const n of t)for(const s in n){const r=n[s];e[s]?e[s]=Ee(e[s],r):e[s]=r}return e}function Ee(...t){let e={};for(const n of t)for(let s in n)if(s in e){const r=pg[s]||(hg.test(s)?yg:fg.test(s)?Sg:gg.test(s)?Eg:void 0);e[s]=r?r(e[s],n[s],s):n[s]}else e[s]=n[s];return e}function yg(t,e,n){const s=typeof t=="function",r=typeof e=="function";if(s||r){const i=a=>b(se(s?t(a):t,n),se(r?e(a):e,n));return i.parts=[t,e],i}return b(se(t,n),se(e,n))}function Sg(t,e){if(typeof e=="function"){const n=s=>{const r=e(s);return r===!0?typeof t=="function"?t(s):t:r};return n.parts=[t,e],n}return e??t}function Eg(t,e){if(t&&e){const n=(...s)=>{t(...s),e(...s)};return n.parts=[t,e],n}return t||e}function bg(t,e){const n=Pf(t,e);for(let s of n)if(!mg.test(s))return!1;return!0}function ss(t,e){const n=t&&t.parts,s=e&&e.parts;if(n&&s){const r=n.length,i=s.length;if(r!==i)return!1;for(let a=0;a<r;a++)if(!(n[a]===s[a]||ss(n[a],s[a])))return!1;return!0}return!1}const Dg=[],io={code:"en",week:{dow:0,doy:4},direction:"ltr",todayText:"Today",prevText:"Prev",nextText:"Next",prevYearText:"Prev year",nextYearText:"Next year",yearText:"Year",monthText:"Month",weekTextLong:"Week",dayText:"Day",listText:"List",closeHint:"Close",eventsHint:"Events",allDayText:"All-day",timedText:"Timed",moreLinkText:"more",noEventsText:"No events to display"},ao={...io,weekTextShort:"W",todayHint:(t,e)=>e==="day"?"Today":`This ${t}`,prevHint:"Previous $0",nextHint:"Next $0",viewHint:"$0 view",viewChangeHint:"Change view",navLinkHint:"Go to $0",moreLinkHint(t){return`Show ${t} more event${t===1?"":"s"}`}};function wg(t){let e=t.length>0?t[0].code:"en",n=Dg.concat(t),s={en:ao};for(let r of n)s[r.code]=r;return{map:s,defaultCode:e}}function oo(t,e){return typeof t=="object"&&!Array.isArray(t)?lo(t.code,[t.code],t):Cg(t,e)}function Cg(t,e){let n=[].concat(t||[]),s=Rg(n,e)||ao;return lo(t,n,s)}function Rg(t,e){for(let n=0;n<t.length;n+=1){let s=t[n].toLocaleLowerCase().split("-");for(let r=s.length;r>0;r-=1){let i=s.slice(0,r).join("-");if(e[i])return e[i]}}return null}function lo(t,e,n){let s=Ee(io,n);delete s.code;let{week:r}=s;return delete s.week,{codeArg:t,codes:e,week:r,simpleNumberFormat:new Intl.NumberFormat(t),options:s}}class Wr extends Error{constructor(e,n){super(e),this.response=n}}function xg(t,e,n){t=t.toUpperCase();const s={method:t};return t==="GET"?e+=(e.indexOf("?")===-1?"?":"&")+new URLSearchParams(n):(s.body=new URLSearchParams(n),s.headers={"Content-Type":"application/x-www-form-urlencoded"}),fetch(e,s).then(r=>{if(r.ok)return r.json().then(i=>[i,r],()=>{throw new Wr("Failure parsing JSON",r)});throw new Wr("Request failed",r)})}function Tg(t,e){e.emitter.trigger("datesSet",{...eo(t.activeRange,e.dateEnv),view:e.viewApi})}function Mg(t,e){let{emitter:n}=e;n.hasHandlers("eventsSet")&&n.trigger("eventsSet",Fe(t,e))}let Ig={ignoreRange:!0,parseMeta(t){return Array.isArray(t.events)?t.events:null},fetch(t,e){e({rawEvents:t.eventSource.meta})}};const Ng={name:"array-event-source",eventSourceDefs:[Ig]};function Hg(t,e,n){let s=!1,r=function(o){s||(s=!0,e(o))},i=function(o){s||(s=!0,n(o))},a=t(r,i);a&&typeof a.then=="function"&&a.then(r,i)}let kg={parseMeta(t){return typeof t.events=="function"?t.events:null},fetch(t,e,n){const{dateEnv:s}=t.context,r=t.eventSource.meta;Hg(r.bind(null,eo(t.range,s)),i=>e({rawEvents:i}),n)}};const Pg={name:"func-event-source",eventSourceDefs:[kg]},jg={method:String,extraParams:S,startParam:String,endParam:String,timeZoneParam:String};let Lg={parseMeta(t){return t.url&&(t.format==="json"||!t.format)?{url:t.url,format:"json",method:(t.method||"GET").toUpperCase(),extraParams:t.extraParams,startParam:t.startParam,endParam:t.endParam,timeZoneParam:t.timeZoneParam}:null},fetch(t,e,n){const{meta:s}=t.eventSource,r=Og(s,t.range,t.context);xg(s.method,s.url,r).then(([i,a])=>{e({rawEvents:i,response:a})},n)}};const Ag={name:"json-event-source",eventSourceRefiners:jg,eventSourceDefs:[Lg]};function Og(t,e,n){let{dateEnv:s,options:r}=n,i,a,o,l,c={};return i=t.startParam,i==null&&(i=r.startParam),a=t.endParam,a==null&&(a=r.endParam),o=t.timeZoneParam,o==null&&(o=r.timeZoneParam),typeof t.extraParams=="function"?l=t.extraParams():l=t.extraParams||{},Object.assign(c,l),c[i]=s.formatIso(e.start),c[a]=s.formatIso(e.end),s.timeZone!=="local"&&(c[o]=s.timeZone),c}const Wg={name:"change-handler",optionChangeHandlers:{controller(t,e){t._setApi(e.calendarApi)},events(t,e){Br([t],e)},eventSources:Br}};function Br(t,e){let n=Ya(e.getCurrentData().eventSources);if(n.length===1&&t.length===1&&Array.isArray(n[0]._raw)&&Array.isArray(t[0])){e.dispatch({type:"RESET_RAW_EVENTS",sourceId:n[0].sourceId,rawEvents:t[0]});return}let s=[];for(let r of t){let i=!1;for(let a=0;a<n.length;a+=1)if(n[a]._raw===r){n.splice(a,1),i=!0;break}i||s.push(r)}for(let r of n)e.dispatch({type:"REMOVE_EVENT_SOURCE",sourceId:r.sourceId});for(let r of s)e.calendarApi.addEventSource(r)}const Bg={id:String,defaultAllDay:Boolean,url:String,format:String,events:S,eventDataTransform:S,success:S,failure:S};function co(t,e,n=uo(e)){let s;if(typeof t=="string"?s={url:t}:typeof t=="function"||Array.isArray(t)?s={events:t}:typeof t=="object"&&t&&(s=t),s){let{refined:r,extra:i}=Os(s,n),a=_g(r,e);if(a)return{_raw:t,isFetching:!1,latestFetchId:"",fetchRange:null,defaultAllDay:r.defaultAllDay,eventDataTransform:r.eventDataTransform,success:r.success,failure:r.failure,publicId:r.id||"",sourceId:Te(),sourceDefId:a.sourceDefId,meta:a.meta,ui:ln(r,e),extendedProps:i}}return null}function uo(t){return{...on,...Bg,...t.pluginHooks.eventSourceRefiners}}function _g(t,e){let n=e.pluginHooks.eventSourceDefs;for(let s=n.length-1;s>=0;s-=1){let i=n[s].parseMeta(t);if(i)return{sourceDefId:s,meta:i}}return null}function Ug(t,e,n){let s=e?e.activeRange:null;return fo({},$g(t,n),s,n)}function Fg(t,e,n,s){let r=n?n.activeRange:null;switch(e.type){case"ADD_EVENT_SOURCES":return fo(t,e.sources,r,s);case"REMOVE_EVENT_SOURCE":return zg(t,e.sourceId);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return n?go(t,r,s):t;case"FETCH_EVENT_SOURCES":return Gs(t,e.sourceIds?qa(e.sourceIds):mo(t,s),r,e.isRefetch||!1,s);case"RECEIVE_EVENTS":case"RECEIVE_EVENT_ERROR":return qg(t,e.sourceId,e.fetchId,e.fetchRange);case"REMOVE_ALL_EVENT_SOURCES":return{};default:return t}}function Vg(t,e,n){let s=e?e.activeRange:null;return Gs(t,mo(t,n),s,!0,n)}function ho(t){for(let e in t)if(t[e].isFetching)return!0;return!1}function fo(t,e,n,s){let r={};for(let i of e)r[i.sourceId]=i;return n&&(r=go(r,n,s)),{...t,...r}}function zg(t,e){return Ye(t,n=>n.sourceId!==e)}function go(t,e,n){return Gs(t,Ye(t,s=>Gg(s,e,n)),e,!1,n)}function Gg(t,e,n){return po(t,n)?!n.options.lazyFetching||!t.fetchRange||t.isFetching||e.start<t.fetchRange.start||e.end>t.fetchRange.end:!t.latestFetchId}function Gs(t,e,n,s,r){let i={};for(let a in t){let o=t[a];e[a]?i[a]=Yg(o,n,s,r):i[a]=o}return i}function Yg(t,e,n,s){let{options:r,calendarApi:i}=s,a=s.pluginHooks.eventSourceDefs[t.sourceDefId],o=Te();return a.fetch({eventSource:t,range:e,isRefetch:n,context:s},l=>{let{rawEvents:c}=l;r.eventSourceSuccess&&(c=r.eventSourceSuccess.call(i,c,l.response)||c),t.success&&(c=t.success.call(i,c,l.response)||c),s.dispatch({type:"RECEIVE_EVENTS",sourceId:t.sourceId,fetchId:o,fetchRange:e,rawEvents:c})},l=>{let c=!1;r.eventSourceFailure&&(r.eventSourceFailure.call(i,l),c=!0),t.failure&&(t.failure(l),c=!0),c||Oe(`Unhandled event source error: ${l.message}`,l),s.dispatch({type:"RECEIVE_EVENT_ERROR",sourceId:t.sourceId,fetchId:o,fetchRange:e,error:l})}),{...t,isFetching:!0,latestFetchId:o}}function qg(t,e,n,s){let r=t[e];return r&&n===r.latestFetchId?{...t,[e]:{...r,isFetching:!1,fetchRange:s}}:t}function mo(t,e){return Ye(t,n=>po(n,e))}function $g(t,e){let n=uo(e),s=[].concat(t.eventSources||[]),r=[];t.initialEvents&&s.unshift(t.initialEvents),t.events&&s.unshift(t.events);for(let i of s){let a=co(i,e,n);a&&r.push(a)}return r}function po(t,e){return!e.pluginHooks.eventSourceDefs[t.sourceDefId].ignoreRange}const Zg={daysOfWeek:S,startTime:_,endTime:_,duration:_,startRecur:S,endRecur:S};let Xg={parse(t,e){if(t.daysOfWeek||t.startTime||t.endTime||t.startRecur||t.endRecur){let n={daysOfWeek:t.daysOfWeek||null,startTime:t.startTime||null,endTime:t.endTime||null,startRecur:t.startRecur?e.createMarker(t.startRecur):null,endRecur:t.endRecur?e.createMarker(t.endRecur):null,dateEnv:e},s;return t.duration&&(s=t.duration),!s&&t.startTime&&t.endTime&&(s=ef(t.endTime,t.startTime)),{allDayGuess:!t.startTime&&!t.endTime,duration:s,typeData:n}}return null},expand(t,e,n){let s=Ae(e,{start:t.startRecur,end:t.endRecur});return s?Jg(t.daysOfWeek,t.startTime,t.dateEnv,n,s):[]}};const Kg={name:"simple-recurring-event",recurringTypes:[Xg],eventRefiners:Zg};function Jg(t,e,n,s,r){let i=t?qa(t):null,a=z(r.start),o=r.end,l=[];for(e&&(e.milliseconds<0?o=te(o,1):e.milliseconds>=1e3*60*60*24&&(a=te(a,-1)));a<o;){let c;(!i||i[a.getUTCDay()])&&(e?c=s.add(a,e):c=a,l.push(s.createMarker(n.toDate(c)))),a=te(a,1)}return l}const Qg=[Ng,Pg,Ag,Kg,Wg,{name:"misc",isLoadingFuncs:[t=>ho(t.eventSources)],propSetHandlers:{dateProfile:Tg,eventStore:Mg}}];function k(t,e,n){let s,r;return function(...i){if(!s)r=t.apply(this,i);else if(!lt(s,i)){let a=t.apply(this,i);(!e||!e(a,r))&&(r=a)}return s=i,r}}function Ct(t,e,n){let s,r;return i=>(s?We(s,i)||(r=t.call(this,i)):r=t.call(this,i),s=i,r)}const Me=w.createContext({});function em(t,e,n,s,r,i,a,o,l,c,u,h,g,m){return{dateEnv:r,nowManager:i,options:n,pluginHooks:a,emitter:c,dispatch:o,getCurrentData:l,calendarApi:u,viewSpec:t,viewApi:e,dateProfileGenerator:s,baseId:h,registerInteractiveComponent:g,unregisterInteractiveComponent:m}}class Ke extends w.Component{shouldComponentUpdate(e,n){return!kr(this.props,e,this.propEquality)||!kr(this.state,n,this.stateEquality)}}Ke.addPropsEquality=tm;Ke.addStateEquality=nm;Ke.contextType=Me;Ke.prototype.propEquality={};Ke.prototype.stateEquality={};class B extends Ke{}B.contextType=Me;function tm(t){let e=Object.create(this.prototype.propEquality);Object.assign(e,t),this.prototype.propEquality=e}function nm(t){let e=Object.create(this.prototype.stateEquality);Object.assign(e,t),this.prototype.stateEquality=e}function L(t,e){typeof t=="function"?t(e):t&&(t.current=e)}class Ys extends B{constructor(){super(...arguments),this.id=Te(),this.queuedDomNodes=[],this.currentDomNodes=[],this.handleEl=e=>{this.el=e,this.props.elRef&&L(this.props.elRef,e)}}render(){const{props:e,context:n}=this,{options:s}=n,{customGenerator:r,defaultGenerator:i,renderProps:a}=e,o=vo(e,"",this.handleEl);let l=!1,c,u=[],h;if(r!=null){const g=typeof r=="function"?r(a):r;if(g===!0)l=!0;else{const m=g&&typeof g=="object";m&&"html"in g?o.dangerouslySetInnerHTML={__html:g.html}:m&&"domNodes"in g?u=Array.prototype.slice.call(g.domNodes):(m?w.isValidElement(g):typeof g!="function")?c=g:h=g}}else l=!sm(e.generatorName,s);return l&&i&&(c=i(a)),this.queuedDomNodes=u,this.currentGeneratorMeta=h,w.createElement(e.tag,o,c)}componentDidMount(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentDidUpdate(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentWillUnmount(){this.triggerCustomRendering(!1)}triggerCustomRendering(e){const{props:n,context:s}=this,{handleCustomRendering:r,customRenderingMetaMap:i}=s.options;if(r){const a=this.currentGeneratorMeta??i?.[n.generatorName];a&&r({id:this.id,isActive:e,containerEl:this.el,generatorMeta:a,renderProps:n.renderProps})}}applyQueueudDomNodes(){const{queuedDomNodes:e,currentDomNodes:n}=this,{el:s}=this;if(!lt(e,n)){for(const r of n)r.remove();for(let r of e)s.appendChild(r);this.currentDomNodes=e}}}Ys.addPropsEquality({renderProps:We,attrs:bg,style:We});function sm(t,e){return!!(e.handleCustomRendering&&t&&e.customRenderingMetaMap?.[t])}function vo(t,e,n){const s={...t.attrs,ref:n};return(t.className||e)&&(s.className=b(e,t.className,s.className)),t.style&&(s.style=t.style),s}const rm=w.createContext(0);class q extends w.Component{constructor(){super(...arguments),this.InnerContent=im.bind(void 0,this),this.handleEl=e=>{this.el=e,this.props.elRef&&(L(this.props.elRef,e),e&&this.didMountMisfire&&this.componentDidMount())}}render(){const{props:e}=this,n=R(e.classNameGenerator,e.renderProps);if(e.children){const s=vo(e,n,this.handleEl),r=e.children(this.InnerContent,e.renderProps,s);return e.tag?w.createElement(e.tag,s,r):r}else return w.createElement(Ys,{...e,elRef:this.handleEl,tag:e.tag||"div",className:b(e.className,n),renderId:this.context})}componentDidMount(){this.el?this.props.didMount?.({...this.props.renderProps,el:this.el}):this.didMountMisfire=!0}componentWillUnmount(){this.props.willUnmount?.({...this.props.renderProps,el:this.el})}}q.contextType=rm;function im(t,e){const n=t.props;return w.createElement(Ys,{renderProps:n.renderProps,generatorName:n.generatorName,customGenerator:n.customGenerator,defaultGenerator:n.defaultGenerator,renderId:t.context,...e})}function R(t,e){return(typeof t=="function"?t(e):t)||""}function Nn(t){return t.text}function fe(t){return t.height==="auto"||t.contentHeight==="auto"}function Hn(t){let{tableHeaderSticky:e}=t;return(e==null||e==="auto")&&(e=fe(t)),e}function yo(t){const e=fe(t);let{footerScrollbarSticky:n}=t;return(n==null||n==="auto")&&(n=e),!!n&&e}function So(t){const e=t.scrollerSyncerClass;if(!e)throw new RangeError("Must import @fullcalendar/scrollgrid");return e}class Eo{constructor(e){this.handleChange=e,this.isMounted=!1,this.handleRefresh=()=>{let n=this.computeTiming();n.nowDate.valueOf()!==this.nowDate.valueOf()&&(this.nowDate=n.nowDate,this.todayRange=n.todayRange,this.handleChange()),this.clearTimeout(),this.setTimeout(n.waitMs)},this.handleVisibilityChange=()=>{document.hidden||this.handleRefresh()}}update(e){if(this.isMounted)(e.unit!==this.unit||e.unitValue!==this.unitValue||e.nowIndicatorSnap!==this.nowIndicatorSnap||e.nowManager!==this.nowManager||e.dateEnv!==this.dateEnv)&&(this.unit=e.unit,this.unitValue=e.unitValue,this.nowIndicatorSnap=e.nowIndicatorSnap,this.nowManager=e.nowManager,this.dateEnv=e.dateEnv,this.clearTimeout(),this.setTimeout());else{this.isMounted=!0,this.unit=e.unit,this.unitValue=e.unitValue,this.nowIndicatorSnap=e.nowIndicatorSnap,this.nowManager=e.nowManager,this.dateEnv=e.dateEnv;const n=this.computeTiming();this.nowDate=n.nowDate,this.todayRange=n.todayRange,this.setTimeout(),this.nowManager.addResetListener(this.handleRefresh),typeof document<"u"&&document.addEventListener("visibilitychange",this.handleVisibilityChange)}return{nowDate:this.nowDate,todayRange:this.todayRange}}destroy(){this.isMounted&&(this.isMounted=!1,this.clearTimeout(),this.nowManager.removeResetListener(this.handleRefresh),typeof document<"u"&&document.removeEventListener("visibilitychange",this.handleVisibilityChange))}computeTiming(){let e=this.nowManager.getDateMarker(),{unit:n,unitValue:s,nowIndicatorSnap:r,dateEnv:i}=this;r==="auto"&&(r=/year|month|week|day/.test(n)||(s||1)===1);let a,o;return r?(a=i.startOf(e,n),o=i.add(a,_(1,n)).valueOf()-e.valueOf()):(a=e,o=1e3*60),o=Math.min(1e3*60*60*24,o),{nowDate:a,todayRange:am(a),waitMs:o}}setTimeout(e=this.computeTiming().waitMs){this.timeoutId=setTimeout(()=>{const n=this.computeTiming();this.nowDate=n.nowDate,this.todayRange=n.todayRange,this.handleChange(),this.setTimeout(n.waitMs)},e)}clearTimeout(){this.timeoutId&&clearTimeout(this.timeoutId)}}function am(t){let e=z(t),n=te(e,1);return{start:e,end:n}}class bo{constructor(e){this.props=e,this.initHiddenDays()}buildPrev(e,n,s,r){let{dateEnv:i}=this.props,a=i.subtract(i.startOf(n,e.currentRangeUnit),e.dateIncrement);return this.build(a,s,-1,r)}buildNext(e,n,s,r){let{dateEnv:i}=this.props,a=i.add(i.startOf(n,e.currentRangeUnit),e.dateIncrement);return this.build(a,s,1,r)}build(e,n,s,r=!0){let{props:i}=this,a,o,l,c,u,h;return a=this.buildValidRange(n),a=this.trimHiddenDays(a),r&&(e=Xh(e,a)),o=this.buildCurrentRangeInfo(e,s),l=/^(year|month|week|day)$/.test(o.unit),c=this.buildRenderRange(this.trimHiddenDays(o.range),o.unit,l),c=this.trimHiddenDays(c),u=c,i.showNonCurrentDates||(u=Ae(u,o.range)),u=this.adjustActiveRange(u),u=Ae(u,a),h=Hs(o.range,a),Ce(c,e)||(e=c.start),{currentDate:e,validRange:a,currentRange:o.range,currentRangeUnit:o.unit,isRangeAllDay:l,activeRange:u,renderRange:c,slotMinTime:i.slotMinTime,slotMaxTime:i.slotMaxTime,isValid:h,dateIncrement:this.buildDateIncrement(o.duration)}}buildValidRange(e){let n=this.props.validRangeInput,s=typeof n=="function"?n.call(this.props.calendarApi,this.props.dateEnv.toDate(e)):n;return this.refineRange(s)||{start:null,end:null}}buildCurrentRangeInfo(e,n){let{props:s}=this,r=null,i=null,a=null,o;return s.duration?(r=s.duration,i=s.durationUnit,a=this.buildRangeFromDuration(e,n,r,i)):(o=this.props.dayCount)?(i="day",a=this.buildRangeFromDayCount(e,n,o)):(a=this.buildCustomVisibleRange(e))?i=s.dateEnv.greatestWholeUnit(a.start,a.end).unit:(r=this.getFallbackDuration(),i=Jn(r).unit,a=this.buildRangeFromDuration(e,n,r,i)),{duration:r,unit:i,range:a}}getFallbackDuration(){return _({day:1})}adjustActiveRange(e){let{dateEnv:n,usesMinMaxTime:s,slotMinTime:r,slotMaxTime:i}=this.props,{start:a,end:o}=e;return s&&(rt(r)<0&&(a=z(a),a=n.add(a,r)),rt(i)>1&&(o=z(o),o=te(o,-1),o=n.add(o,i))),{start:a,end:o}}buildRangeFromDuration(e,n,s,r){let{dateEnv:i,dateAlignment:a}=this.props,o,l,c;if(!a){let{dateIncrement:h}=this.props;h&&Re(h)<Re(s)?a=Jn(h).unit:a=r}rt(s)<=1&&this.isHiddenDay(o)&&(o=this.skipHiddenDays(o,n),o=z(o));function u(){o=i.startOf(e,a),l=i.add(o,s),c={start:o,end:l}}return u(),this.trimHiddenDays(c)||(e=this.skipHiddenDays(e,n),u()),c}buildRangeFromDayCount(e,n,s){let{dateEnv:r,dateAlignment:i}=this.props,a=0,o=e,l;i&&(o=r.startOf(o,i)),o=z(o),o=this.skipHiddenDays(o,n),l=o;do l=te(l,1),this.isHiddenDay(l)||(a+=1);while(a<s);return{start:o,end:l}}buildCustomVisibleRange(e){let{props:n}=this,s=n.visibleRangeInput,r=typeof s=="function"?s.call(n.calendarApi,n.dateEnv.toDate(e)):s,i=this.refineRange(r);return i&&(i.start==null||i.end==null)?null:i}buildRenderRange(e,n,s){return e}buildDateIncrement(e){let{dateIncrement:n}=this.props,s;return n||((s=this.props.dateAlignment)?_(1,s):e||_({days:1}))}refineRange(e){if(e){let n=qh(e,this.props.dateEnv);return n&&(n=Za(n)),n}return null}initHiddenDays(){let e=this.props.hiddenDays||[],n=[],s=0,r;for(this.props.weekends===!1&&e.push(0,6),r=0;r<7;r+=1)(n[r]=e.indexOf(r)!==-1)||(s+=1);if(!s)throw new Error("invalid hiddenDays");this.isHiddenDayHash=n}trimHiddenDays(e){let{start:n,end:s}=e;return n&&(n=this.skipHiddenDays(n)),s&&(s=this.skipHiddenDays(s,-1,!0)),n==null||s==null||n<s?{start:n,end:s}:null}isHiddenDay(e){return e instanceof Date&&(e=e.getUTCDay()),this.isHiddenDayHash[e]}skipHiddenDays(e,n=1,s=!1){for(;this.isHiddenDayHash[(e.getUTCDay()+(s?n:0)+7)%7];)e=te(e,n);return e}}function Do(t,e){const{currentRange:n}=t;if(t.currentRangeUnit==="year")return e.diffWholeYears(n.start,n.end)>1?"year":"month";if(t.currentRangeUnit==="month"){if(e.diffWholeMonths(n.start,n.end)>1)return"month"}else if(t.currentRangeUnit==="week"){if(Oa(n.start,n.end)>1)return"week"}else if(t.currentRangeUnit==="day"&&Tt(n.start,n.end)>1)return"day"}function wo(t,e,n){if(t.valueOf()===z(t).valueOf()){if(e==="year")return!n.getMonth(t)&&n.getDay(t)===1;if(e==="month")return n.getDay(t)===1;if(e==="week")return t.getUTCDay()===n.weekDow;if(e==="day")return!0}return!1}function om(t,e,n,s,r){switch(e.type){case"RECEIVE_EVENTS":return lm(t,n[e.sourceId],e.fetchId,e.fetchRange,e.rawEvents,r);case"RESET_RAW_EVENTS":return cm(t,n[e.sourceId],e.rawEvents,s.activeRange,r);case"ADD_EVENTS":return dm(t,e.eventStore,s?s.activeRange:null,r);case"RESET_EVENTS":return e.eventStore;case"MERGE_EVENTS":return _s(t,e.eventStore);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return s?qe(t,s.activeRange,r):t;case"REMOVE_EVENTS":return Uf(t,e.eventStore);case"REMOVE_EVENT_SOURCE":return Ro(t,e.sourceId);case"REMOVE_ALL_EVENT_SOURCES":return Mn(t,i=>!i.sourceId);case"REMOVE_ALL_EVENTS":return de();default:return t}}function lm(t,e,n,s,r,i){if(e&&n===e.latestFetchId){let a=It(Co(r,e,i),e,i);return s&&(a=qe(a,s,i)),_s(Ro(t,e.sourceId),a)}return t}function cm(t,e,n,s,r){const{defIdMap:i,instanceIdMap:a}=hm(t);let o=It(Co(n,e,r),e,r,!1,i,a);return qe(o,s,r)}function Co(t,e,n){let s=n.options.eventDataTransform,r=e?e.eventDataTransform:null;return r&&(t=_r(t,r)),s&&(t=_r(t,s)),t}function _r(t,e){let n;if(!e)n=t;else{n=[];for(let s of t){let r=e(s);r?n.push(r):r==null&&n.push(s)}}return n}function dm(t,e,n,s){return n&&(e=qe(e,n,s)),_s(t,e)}function Ur(t,e,n){let{defs:s}=t,r=xe(t.instances,i=>s[i.defId].allDay?i:{...i,range:{start:n.createMarker(e.toDate(i.range.start)),end:n.createMarker(e.toDate(i.range.end))}});return{defs:s,instances:r}}function Ro(t,e){return Mn(t,n=>n.sourceId!==e)}function um(t,e){return{defs:t.defs,instances:Ye(t.instances,n=>!e[n.instanceId])}}function hm(t){const{defs:e,instances:n}=t,s={},r={};for(let i in e){const a=e[i],{publicId:o}=a;o&&(s[o]=i)}for(let i in n){const a=n[i],o=e[a.defId],{publicId:l}=o;l&&(r[l]=i)}return{defIdMap:s,instanceIdMap:r}}class pt{constructor(e){this.component=e.component,this.isHitComboAllowed=e.isHitComboAllowed||null}destroy(){}}function fm(t,e){return{component:t,el:e.el,useEventCenter:e.useEventCenter!=null?e.useEventCenter:!0,isHitComboAllowed:e.isHitComboAllowed||null}}function qs(t){return{[t.component.uid]:t}}const rs={};class Lt{constructor(){this.handlers={},this.thisContext=null}setThisContext(e){this.thisContext=e}setOptions(e){this.options=e}on(e,n){gm(this.handlers,e,n)}off(e,n){mm(this.handlers,e,n)}trigger(e,...n){let s=this.handlers[e]||[],r=this.options&&this.options[e],i=[].concat(r||[],s);for(let a of i)a.apply(this.thisContext,n)}hasHandlers(e){return!!(this.handlers[e]&&this.handlers[e].length||this.options&&this.options[e])}}function gm(t,e,n){(t[e]||(t[e]=[])).push(n)}function mm(t,e,n){n?t[e]&&(t[e]=t[e].filter(s=>s!==n)):delete t[e]}function pm(t){return{name:t.name,premiumReleaseDate:t.premiumReleaseDate?new Date(t.premiumReleaseDate):void 0,reducers:t.reducers||[],isLoadingFuncs:t.isLoadingFuncs||[],contextInit:[].concat(t.contextInit||[]),eventRefiners:t.eventRefiners||{},eventDefMemberAdders:t.eventDefMemberAdders||[],eventSourceRefiners:t.eventSourceRefiners||{},isDraggableTransformers:t.isDraggableTransformers||[],eventDragMutationMassagers:t.eventDragMutationMassagers||[],eventDefMutationAppliers:t.eventDefMutationAppliers||[],dateSelectionTransformers:t.dateSelectionTransformers||[],datePointTransforms:t.datePointTransforms||[],dateSpanTransforms:t.dateSpanTransforms||[],views:t.views||{},viewPropsTransformers:t.viewPropsTransformers||[],isPropsValid:t.isPropsValid||null,externalDefTransforms:t.externalDefTransforms||[],viewContainerAppends:t.viewContainerAppends||[],eventDropTransformers:t.eventDropTransformers||[],componentInteractions:t.componentInteractions||[],calendarInteractions:t.calendarInteractions||[],eventSourceDefs:t.eventSourceDefs||[],cmdFormatter:t.cmdFormatter,recurringTypes:t.recurringTypes||[],initialView:t.initialView||"",elementDraggingImpl:t.elementDraggingImpl,optionChangeHandlers:t.optionChangeHandlers||{},scrollerSyncerClass:t.scrollerSyncerClass||null,listenerRefiners:t.listenerRefiners||{},optionRefiners:t.optionRefiners||{},optionDefaults:t.optionDefaults?[t.optionDefaults]:[],propSetHandlers:t.propSetHandlers||{}}}function vm(t,e){let n={},s={premiumReleaseDate:void 0,reducers:[],isLoadingFuncs:[],contextInit:[],eventRefiners:{},eventDefMemberAdders:[],eventSourceRefiners:{},isDraggableTransformers:[],eventDragMutationMassagers:[],eventDefMutationAppliers:[],dateSelectionTransformers:[],datePointTransforms:[],dateSpanTransforms:[],views:{},viewPropsTransformers:[],isPropsValid:null,externalDefTransforms:[],viewContainerAppends:[],eventDropTransformers:[],componentInteractions:[],calendarInteractions:[],eventSourceDefs:[],cmdFormatter:null,recurringTypes:[],initialView:"",elementDraggingImpl:null,optionChangeHandlers:{},scrollerSyncerClass:null,listenerRefiners:{},optionRefiners:{},optionDefaults:[],propSetHandlers:{}};function r(i){for(let a of i){const{name:o}=a;if(!o)throw new Error("Plugin must specify a name");if(!n[o]){const l=n[o]=pm(a);s=Sm(s,l),r(a.deps||[])}}}return t&&r(t),r(e),s}function ym(){let t=[],e=[],n;return(s,r)=>((!n||!lt(s,t)||!lt(r,e))&&(n=vm(s,r)),t=s,e=r,n)}function Sm(t,e){return{premiumReleaseDate:Em(t.premiumReleaseDate,e.premiumReleaseDate),reducers:t.reducers.concat(e.reducers),isLoadingFuncs:t.isLoadingFuncs.concat(e.isLoadingFuncs),contextInit:t.contextInit.concat(e.contextInit),eventRefiners:{...t.eventRefiners,...e.eventRefiners},eventDefMemberAdders:t.eventDefMemberAdders.concat(e.eventDefMemberAdders),eventSourceRefiners:{...t.eventSourceRefiners,...e.eventSourceRefiners},isDraggableTransformers:t.isDraggableTransformers.concat(e.isDraggableTransformers),eventDragMutationMassagers:t.eventDragMutationMassagers.concat(e.eventDragMutationMassagers),eventDefMutationAppliers:t.eventDefMutationAppliers.concat(e.eventDefMutationAppliers),dateSelectionTransformers:t.dateSelectionTransformers.concat(e.dateSelectionTransformers),datePointTransforms:t.datePointTransforms.concat(e.datePointTransforms),dateSpanTransforms:t.dateSpanTransforms.concat(e.dateSpanTransforms),views:vg(t.views,e.views),viewPropsTransformers:t.viewPropsTransformers.concat(e.viewPropsTransformers),isPropsValid:e.isPropsValid||t.isPropsValid,externalDefTransforms:t.externalDefTransforms.concat(e.externalDefTransforms),viewContainerAppends:t.viewContainerAppends.concat(e.viewContainerAppends),eventDropTransformers:t.eventDropTransformers.concat(e.eventDropTransformers),calendarInteractions:t.calendarInteractions.concat(e.calendarInteractions),componentInteractions:t.componentInteractions.concat(e.componentInteractions),eventSourceDefs:t.eventSourceDefs.concat(e.eventSourceDefs),cmdFormatter:e.cmdFormatter||t.cmdFormatter,recurringTypes:t.recurringTypes.concat(e.recurringTypes),initialView:t.initialView||e.initialView,elementDraggingImpl:t.elementDraggingImpl||e.elementDraggingImpl,optionChangeHandlers:{...t.optionChangeHandlers,...e.optionChangeHandlers},scrollerSyncerClass:t.scrollerSyncerClass||e.scrollerSyncerClass,listenerRefiners:{...t.listenerRefiners,...e.listenerRefiners},optionRefiners:{...t.optionRefiners,...e.optionRefiners},optionDefaults:t.optionDefaults.concat(e.optionDefaults),propSetHandlers:{...t.propSetHandlers,...e.propSetHandlers}}}function Em(t,e){return t===void 0?e:e===void 0?t:new Date(Math.max(t.valueOf(),e.valueOf()))}function bm(t,e){let n={},s;for(s in t)is(s,n,t,e);for(s in e)is(s,n,t,e);return n}function is(t,e,n,s){if(e[t])return e[t];let r=Dm(t,e,n,s);return r&&(e[t]=r),r}function Dm(t,e,n,s){let r=n[t],i=s[t],a=u=>r&&r[u]!==null?r[u]:i&&i[u]!==null?i[u]:null,o=a("component"),l=a("superType"),c=null;if(l){if(l===t)throw new Error("Can't have a custom view type that references itself");c=is(l,e,n,s)}return!o&&c&&(o=c.component),o?{type:t,component:o,defaults:Ee(c?c.defaults:{},r?r.rawOptions:{}),overrides:Ee(c?c.overrides:{},i?i.rawOptions:{})}:null}function Fr(t){return xe(t,wm)}function wm(t){let e=typeof t=="function"?{component:t}:t,{component:n}=e;return e.content?n=Vr(e.content):n&&!(n.prototype instanceof B)&&(n=Vr(n)),{superType:e.type,component:n,rawOptions:e}}function Vr(t){return e=>d.jsx(Me.Consumer,{children:n=>{const{options:s,viewSpec:r}=n,i={...e,nextDayThreshold:s.nextDayThreshold,...ve(s),options:{headerToolbar:s.headerToolbar,footerToolbar:s.footerToolbar},isHeightAuto:fe(s),view:n.viewApi};return d.jsx(q,{tag:"div",className:b(R(s.viewClass,i),R(r.optionDefaults.class,i),R(r.optionDefaults.className,i),R(r.optionOverrides.class,i),R(r.optionOverrides.className,i)),renderProps:i,generatorName:void 0,customGenerator:t,didMount:s.didMount||s.viewDidMount,willUnmount:s.willUnmount||s.viewWillUnmount})}})}function Cm(t,e,n){let s=Fr(t),r=Fr(e.views),i=bm(s,r);return xe(i,a=>Rm(a,r,e,n))}function Rm(t,e,n,s){let r=t.overrides.duration||t.defaults.duration||s.duration||n.duration,i=null,a="",o="",l={};if(r&&(i=xm(r),i)){let c=Jn(i);a=c.unit,c.value===1&&(o=a,l=e[a]?e[a].rawOptions:{})}return{type:t.type,component:t.component,duration:i,durationUnit:a,singleUnit:o,optionDefaults:t.defaults,optionOverrides:{...l,...t.overrides}}}let zr={};function xm(t){let e=JSON.stringify(t),n=zr[e];return n===void 0&&(n=_(t),zr[e]=n),n}function Tm(t,e){return e.type==="CHANGE_VIEW_TYPE"&&(t=e.viewType),t}function Mm(t,e){return e.type==="CHANGE_DATE"?e.dateMarker:t}function Im(t,e,n){let s=t.initialDate;return s!=null?e.createMarker(s):n.getDateMarker()}function Nm(t,e){return e.type==="SET_OPTION"?{...t,[e.optionName]:e.rawOptionValue}:t}function Hm(t,e,n,s,r){let i;switch(e.type){case"CHANGE_VIEW_TYPE":return r.build(e.dateMarker||n,s);case"CHANGE_DATE":return r.build(e.dateMarker,s);case"PREV":if(i=r.buildPrev(t,n,s),i.isValid)return i;break;case"NEXT":if(i=r.buildNext(t,n,s),i.isValid)return i;break}return t}function km(t,e){switch(e.type){case"UNSELECT_DATES":return null;case"SELECT_DATES":return e.selection;default:return t}}function Pm(t,e){switch(e.type){case"UNSELECT_EVENT":return"";case"SELECT_EVENT":return e.eventInstanceId;default:return t}}function jm(t,e){let n;switch(e.type){case"UNSET_EVENT_DRAG":return null;case"SET_EVENT_DRAG":return n=e.state,{affectedEvents:n.affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return t}}function Lm(t,e){let n;switch(e.type){case"UNSET_EVENT_RESIZE":return null;case"SET_EVENT_RESIZE":return n=e.state,{affectedEvents:n.affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return t}}function Am(t,e,n){let s=t.headerToolbar?Gr(t.headerToolbar,t,e,n):null,r=t.footerToolbar?Gr(t.footerToolbar,t,e,n):null;return{header:s,footer:r}}function Gr(t,e,n,s){let r=e.direction==="rtl",i=[],a=!1;function o(c){let u=Om(c,e,n,s);return i.push(...u.viewsWithButtons),a=a||u.hasTitle,u.widgets}return{sectionWidgets:{start:o(t[r?"right":"left"]||t.start||""),center:o(t.center||""),end:o(t[r?"left":"right"]||t.end||"")},viewsWithButtons:i,hasTitle:a}}function Om(t,e,n,s){let r=e.buttons||{},i=e.toolbarElements||{},a=t?t.split(" "):[],o=[],l=!1;return{widgets:a.map(u=>u.split(",").map(h=>{if(h==="title")return l=!0,{name:h};if(i[h])return{name:h,customElement:i[h]};let g,m=r[h]||{},v,p,y;if(g=n[h]){o.push(h);const D=g.optionDefaults.buttonTextKey;v=m.text||(D?e[D]:"")||(g.singleUnit?e[g.singleUnit+"TextLong"]||e[g.singleUnit+"Text"]:"")||h,p=ue(m.hint||e.viewHint,[v,h],v),y=x=>{m?.click?.(x),x.defaultPrevented||s.changeView(h)}}else v=m.text||e[h+"TextLong"]||e[h+"Text"]||h,h==="prevYear"?p=ue(m.hint||e.prevHint,[e.yearText,"year"],v):h==="nextYear"?p=ue(m.hint||e.nextHint,[e.yearText,"year"],v):p=D=>ue(m.hint||e[h+"Hint"],[e[D+"TextLong"]||e[D+"Text"],D],v),y=D=>{m?.click?.(D),D.defaultPrevented||s[h]?.()};return{name:h,isView:!!g,buttonText:v,buttonHint:p,buttonDisplay:m.display,buttonIconClass:m.iconClass,buttonIconContent:m.iconContent,buttonClick:y,buttonIsPrimary:m.isPrimary||!1,buttonClass:m.class??m.className,buttonDidMount:m.didMount,buttonWillUnmount:m.willUnmount}})),viewsWithButtons:o,hasTitle:l}}class Wm{constructor(e,n,s){this.type=e,this.getCurrentData=n,this.dateEnv=s}get calendar(){return this.getCurrentData().calendarApi}get title(){return this.getCurrentData().viewTitle}get activeStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start)}get activeEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end)}get currentStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start)}get currentEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end)}getOption(e){return this.getCurrentData().options[e]}}const Bm={startTime:"09:00",endTime:"17:00",daysOfWeek:[1,2,3,4,5],display:"inverse-background",className:"",groupId:"_businessHours"};function _m(t,e){return It(Um(t),null,e)}function Um(t){let e;return t===!0?e=[{}]:Array.isArray(t)?e=t.filter(n=>n.daysOfWeek):typeof t=="object"&&t?e=[t]:e=[],e=e.map(n=>({...Bm,...n})),e}function Fm(t,e,n){let s;/^(year|month)$/.test(t.currentRangeUnit)?s=t.currentRange:s=t.activeRange;let r;const i={isEndExclusive:t.isRangeAllDay};return e.titleFormat?r=n.formatRangeToParts(s.start,s.end,V(e.titleFormat),i):(r=n.formatRangeToParts(s.start,s.end,V(Yr(t,e.disallowAmbigTitle,"long")),i),Vm(r)&&(r=n.formatRangeToParts(s.start,s.end,V(Yr(t,e.disallowAmbigTitle,"short")),i))),ie(r)}function Yr(t,e,n){const{currentRangeUnit:s}=t;if(s==="year")return{year:"numeric"};if(s==="month")return{year:"numeric",month:n};if(!e){const r=Tt(t.currentRange.start,t.currentRange.end);if(r!==null&&r>1)return{year:"numeric",month:n}}return{year:"numeric",month:"long",day:"numeric"}}function Vm(t){let e=!1,n=!1;for(const s of t)s.type==="month"&&(s.source==="startRange"&&(e=!0),s.source==="endRange"&&(n=!0));return e&&n}class qr{constructor(){this.resetListeners=new Set}handleInput(e,n){const s=this.dateEnv;if(e!==s&&(typeof n=="function"?this.nowFn=n:s||(this.nowAnchorDate=e.toDate(n?e.createMarker(n):e.createNowMarker()),this.nowAnchorQueried=Date.now()),this.dateEnv=e,s))for(const r of this.resetListeners.values())r()}getDateMarker(){return this.nowAnchorDate?this.dateEnv.timestampToMarker(this.nowAnchorDate.valueOf()+(Date.now()-this.nowAnchorQueried)):this.dateEnv.createMarker(this.nowFn())}addResetListener(e){this.resetListeners.add(e)}removeResetListener(e){this.resetListeners.delete(e)}}class zm{constructor(e){this.computeCurrentViewData=k(this._computeCurrentViewData),this.organizeRawLocales=k(wg),this.buildLocale=k(oo),this.buildPluginHooks=ym(),this.buildDateEnv=k(Gm),this.parseToolbars=k(Am),this.buildViewSpecs=k(Cm),this.buildDateProfileGenerator=Ct(Ym),this.buildViewApi=k(qm),this.buildViewUiProps=Ct(Xm),this.buildEventUiBySource=k($m,We),this.buildEventUiBases=k(Zm),this.parseContextBusinessHours=Ct(Km),this.buildToolbarProps=k(Jm),this.buildTitle=k(Fm),this.nowManager=new qr,this.isDrainingActionQueue=!1,this.actionQueue=[],this.optionOverrides={},this.emitter=new Lt,this.currentCalendarOptionsRefiners={},this.currentCalendarOptionsInput={},this.currentCalendarOptionsRefined={},this.currentViewOptionsInput={},this.currentViewOptionsRefined={},this.optionsForRefining=[],this.optionsForHandling=[],this.getCurrentData=()=>this.data,this.handleNowChange=()=>{this.dispatch({type:"UPDATE_NOW"})},this.dispatch=n=>{this.actionQueue.push(n),this.isDrainingActionQueue||this.drainActionQueue()},this.config=e,this.nowManager=new qr,this.nowTimer=new Eo(this.handleNowChange)}destroy(){this.nowTimer.destroy()}update(e){return this.optionOverrides=e,this.actionQueue.push({type:"IDLE"}),this.drainActionQueue(),this.data}resetOptions(e,n){n===void 0?this.optionOverrides=e:(this.optionOverrides={...this.optionOverrides,...e},this.optionsForRefining.push(...n)),this.dispatch({type:"RESET_OPTIONS"})}drainActionQueue(){let e,{state:n,data:s}=this;const r=!n,{actionQueue:i}=this,a=[];for(this.isDrainingActionQueue=!0;i.length;){const o=i.shift();({state:n,data:s,calendarContext:e}=this.reduce(n,s,o)),this.state=n,this.data=s,o.type!=="IDLE"&&a.push(o)}if(this.isDrainingActionQueue=!1,r){const o=e.options.controller;o&&o._setApi(this.config.calendarApi)}if(!r&&a.length){const{onDataChange:o}=this.config;o&&o(this.data,a)}}reduce(e,n,s){let{config:r}=this,i=!e,a=i?{}:Nm(e.dynamicOptionOverrides,s),o=this.computeOptionsData(this.optionOverrides,a,r.calendarApi),l=i?o.calendarOptions.initialView||o.pluginHooks.initialView:Tm(e.currentViewType,s),c=this.computeCurrentViewData(l,o,this.optionOverrides,a);r.calendarApi.currentDataManager=this,this.emitter.setThisContext(r.calendarApi),this.emitter.setOptions(c.options);let u={nowManager:this.nowManager,dateEnv:o.dateEnv,options:o.calendarOptions,pluginHooks:o.pluginHooks,calendarApi:r.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},{nowDate:h}=this.nowTimer.update({unit:"day",unitValue:1,nowIndicatorSnap:"auto",nowManager:this.nowManager,dateEnv:o.dateEnv}),g=i?Im(o.calendarOptions,o.dateEnv,this.nowManager):Mm(e.currentDate,s),m;i?m=c.dateProfileGenerator.build(g,h):(m=e.dateProfile,n&&n.dateProfileGenerator!==c.dateProfileGenerator&&(m=c.dateProfileGenerator.build(g,h)),m=Hm(m,s,g,h,c.dateProfileGenerator)),(s&&(s.type==="PREV"||s.type==="NEXT")||!Ce(m.activeRange,g))&&(g=m.currentRange.start);let v=i?Ug(o.calendarOptions,m,u):Fg(e.eventSources,s,m,u),p=i?de():om(e.eventStore,s,v,m,u),y=ho(v),D=i?de():y&&!c.options.progressiveEventRendering&&e.renderableEventStore||p,{eventUiSingleBase:x,selectionConfig:C}=this.buildViewUiProps(u),E=this.buildEventUiBySource(v),T=i?{}:this.buildEventUiBases(D.defs,x,E),N={dynamicOptionOverrides:a,currentViewType:l,currentDate:g,dateProfile:m,eventSources:v,eventStore:p,renderableEventStore:D,selectionConfig:C,eventUiBases:T,businessHours:this.parseContextBusinessHours(u),dateSelection:i?null:km(e.dateSelection,s),eventSelection:i?"":Pm(e.eventSelection,s),eventDrag:i?null:jm(e.eventDrag,s),eventResize:i?null:Lm(e.eventResize,s),nowDate:h},I={...u,...N};for(let X of o.pluginHooks.reducers)Object.assign(N,X(e,s,I));let P=e?$r(e,u):!1,H=$r(N,u);!P&&H?this.emitter.trigger("loading",!0):P&&!H&&this.emitter.trigger("loading",!1);let j=this.buildTitle(m,c.options,o.dateEnv),G=this.buildToolbarProps(c.viewSpec,m,c.dateProfileGenerator,g,h,j),U={viewTitle:j,nowManager:this.nowManager,calendarApi:r.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData,toolbarProps:G,...o,...c,...N},F=o.pluginHooks.optionChangeHandlers,Z=n&&n.calendarOptions,Q=o.calendarOptions;if(Z&&Z!==Q){Z.timeZone!==Q.timeZone&&(N.eventSources=U.eventSources=Vg(U.eventSources,m,U),N.eventStore=U.eventStore=Ur(U.eventStore,n.dateEnv,U.dateEnv),N.renderableEventStore=U.renderableEventStore=Ur(U.renderableEventStore,n.dateEnv,U.dateEnv));for(let X in F)(this.optionsForHandling.indexOf(X)!==-1||Z[X]!==Q[X])&&F[X](Q[X],U)}return this.optionsForHandling=[],{state:N,data:U,calendarContext:u}}computeOptionsData(e,n,s){if(!this.optionsForRefining.length&&e===this.stableOptionOverrides&&n===this.stableDynamicOptionOverrides)return this.stableCalendarOptionsData;let{refinedOptions:r,pluginHooks:i,localeDefaults:a,availableLocaleData:o}=this.processRawCalendarOptions(e,n),l=this.buildDateEnv(r.timeZone,r.locale,r.weekNumberCalculation,r.firstDay,r.weekTextLong,r.weekTextShort,i,o),c=this.buildViewSpecs(i.views,this.stableOptionOverrides,this.stableDynamicOptionOverrides),u=this.parseToolbars(r,c,s);return this.stableCalendarOptionsData={calendarOptions:r,pluginHooks:i,dateEnv:l,viewSpecs:c,toolbarConfig:u,localeDefaults:a,availableRawLocales:o.map}}processRawCalendarOptions(e,n){let{locales:s,locale:r}=Ee(Vn,e,n),i=this.organizeRawLocales(s),a=i.map,o=this.buildLocale(r||i.defaultCode,a).options,l=this.buildPluginHooks(e.plugins||[],Qg),c=this.currentCalendarOptionsRefiners={...Pr,...jr,...Lr,...l.listenerRefiners,...l.optionRefiners},u=Ee(Vn,...l.optionDefaults,o,Xr(Ee(e,n),c)),h={},g=this.currentCalendarOptionsInput,m=this.currentCalendarOptionsRefined,v=!1;for(let p in u)this.optionsForRefining.indexOf(p)===-1&&(u[p]===g[p]||Qe[p]&&p in g&&Qe[p](g[p],u[p])||ss(g[p],u[p]))?h[p]=m[p]:c[p]&&(h[p]=c[p](u[p],p),v=!0);return v&&(this.currentCalendarOptionsInput=u,this.currentCalendarOptionsRefined=h,this.stableOptionOverrides=e,this.stableDynamicOptionOverrides=n),this.optionsForHandling.push(...this.optionsForRefining),this.optionsForRefining=[],{rawOptions:this.currentCalendarOptionsInput,refinedOptions:this.currentCalendarOptionsRefined,pluginHooks:l,availableLocaleData:i,localeDefaults:o}}_computeCurrentViewData(e,n,s,r){let i=n.viewSpecs[e];if(!i)throw new Error(`viewType "${e}" is not available. Please make sure you've loaded all neccessary plugins`);let{refinedOptions:a}=this.processRawViewOptions(i,n.pluginHooks,n.localeDefaults,s,r);this.nowManager.handleInput(n.dateEnv,a.now);let o=this.buildDateProfileGenerator({dateProfileGeneratorClass:i.optionDefaults.dateProfileGeneratorClass,duration:i.duration,durationUnit:i.durationUnit,usesMinMaxTime:i.optionDefaults.usesMinMaxTime,dateEnv:n.dateEnv,calendarApi:this.config.calendarApi,slotMinTime:a.slotMinTime,slotMaxTime:a.slotMaxTime,showNonCurrentDates:a.showNonCurrentDates,dayCount:a.dayCount,dateAlignment:a.dateAlignment,dateIncrement:a.dateIncrement,hiddenDays:a.hiddenDays,weekends:a.weekends,validRangeInput:a.validRange,visibleRangeInput:a.visibleRange,fixedWeekCount:a.fixedWeekCount}),l=this.buildViewApi(e,this.getCurrentData,n.dateEnv);return{viewSpec:i,options:a,dateProfileGenerator:o,viewApi:l}}processRawViewOptions(e,n,s,r,i){let a={...Pr,...jr,...Lr,...Of,...n.listenerRefiners,...n.optionRefiners},o=Ee(Vn,...n.optionDefaults,e.optionDefaults,s,Xr(Ee(r,e.optionOverrides,i),a)),l={},c=this.currentViewOptionsInput,u=this.currentViewOptionsRefined,h=!1;for(let g in o)o[g]===c[g]||Qe[g]&&Qe[g](o[g],c[g])||ss(c[g],o[g])?l[g]=u[g]:(o[g]===this.currentCalendarOptionsInput[g]||Qe[g]&&Qe[g](o[g],this.currentCalendarOptionsInput[g])?g in this.currentCalendarOptionsRefined&&(l[g]=this.currentCalendarOptionsRefined[g]):a[g]&&(l[g]=a[g](o[g],g)),h=!0);return h&&(this.currentViewOptionsInput=o,this.currentViewOptionsRefined=l),{rawOptions:this.currentViewOptionsInput,refinedOptions:this.currentViewOptionsRefined}}}function Gm(t,e,n,s,r,i,a,o){let l=oo(e||o.defaultCode,o.map);return new lf({calendarSystem:"gregory",timeZone:t,locale:l,weekNumberCalculation:n,firstDay:s,weekTextLong:r,weekTextShort:i,cmdFormatter:a.cmdFormatter})}function Ym(t){let e=t.dateProfileGeneratorClass||bo;return new e(t)}function qm(t,e,n){return new Wm(t,e,n)}function $m(t){return xe(t,e=>e.ui)}function Zm(t,e,n){let s={"":e};for(let r in t){let i=t[r];i.sourceId&&n[i.sourceId]&&(s[r]=n[i.sourceId])}return s}function Xm(t){const{options:e}=t;return{eventUiSingleBase:ln({display:e.eventDisplay,editable:e.editable,startEditable:e.eventStartEditable,durationEditable:e.eventDurationEditable,constraint:e.eventConstraint,overlap:typeof e.eventOverlap=="boolean"?e.eventOverlap:void 0,allow:e.eventAllow},t),selectionConfig:ln({constraint:e.selectConstraint,overlap:typeof e.selectOverlap=="boolean"?e.selectOverlap:void 0,allow:e.selectAllow},t)}}function $r(t,e){for(let n of e.pluginHooks.isLoadingFuncs)if(n(t))return!0;return!1}function Km(t){return _m(t.options.businessHours,t)}const Zr={};function Xr(t,e){const n={};for(const s in t)e[s]?n[s]=t[s]:Zr[s]||(Oe(`Unknown option \`${s}\`.`),Zr[s]=!0);return n}function Jm(t,e,n,s,r,i){let a=n.build(r,r,void 0,!1),o=n.buildPrev(e,s,r,!1),l=n.buildNext(e,s,r,!1);return{title:i,selectedButton:t.type,navUnit:t.singleUnit,isTodayEnabled:a.isValid&&!Ce(e.currentRange,r),isPrevEnabled:o.isValid,isNextEnabled:l.isValid}}class Qm{getCurrentData(){return this.currentDataManager.getCurrentData()}dispatch(e){this.currentDataManager.dispatch(e)}get view(){return this.getCurrentData().viewApi}batchRendering(e){e()}setOption(e,n){this.dispatch({type:"SET_OPTION",optionName:e,rawOptionValue:n})}getOption(e){return this.currentDataManager.currentCalendarOptionsInput[e]}getAvailableLocaleCodes(){return Object.keys(this.getCurrentData().availableRawLocales)}on(e,n){let{currentDataManager:s}=this;s.currentCalendarOptionsRefiners[e]?s.emitter.on(e,n):Oe(`Unknown listener \`${e}\`.`)}off(e,n){this.currentDataManager.emitter.off(e,n)}trigger(e,...n){this.currentDataManager.emitter.trigger(e,...n)}changeView(e,n){this.batchRendering(()=>{if(this.unselect(),n)if(n.start&&n.end)this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e}),this.dispatch({type:"SET_OPTION",optionName:"visibleRange",rawOptionValue:n});else{let{dateEnv:s}=this.getCurrentData();this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e,dateMarker:s.createMarker(n)})}else this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e})})}zoomTo(e,n){let s=this.getCurrentData(),r;n=n||"day",r=s.viewSpecs[n]||this.getUnitViewSpec(n),this.unselect(),r?this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:r.type,dateMarker:e}):this.dispatch({type:"CHANGE_DATE",dateMarker:e})}getUnitViewSpec(e){let{viewSpecs:n,toolbarConfig:s}=this.getCurrentData(),r=[].concat(s.header?s.header.viewsWithButtons:[],s.footer?s.footer.viewsWithButtons:[]),i,a;for(let o in n)r.push(o);for(i=0;i<r.length;i+=1)if(a=n[r[i]],a&&a.singleUnit===e)return a;return null}prev(){this.unselect(),this.dispatch({type:"PREV"})}next(){this.unselect(),this.dispatch({type:"NEXT"})}prevYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.dateEnv.addYears(e.currentDate,-1)})}nextYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.dateEnv.addYears(e.currentDate,1)})}today(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.nowManager.getDateMarker()})}gotoDate(e){let n=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:n.dateEnv.createMarker(e)})}incrementDate(e){let n=this.getCurrentData(),s=_(e);s&&(this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:n.dateEnv.add(n.currentDate,s)}))}getDate(){let e=this.getCurrentData();return e.dateEnv.toDate(e.currentDate)}formatDate(e,n){let{dateEnv:s}=this.getCurrentData();return ie(s.formatToParts(s.createMarker(e),V(n)))}formatRange(e,n,s){let{dateEnv:r}=this.getCurrentData();return ie(r.formatRangeToParts(r.createMarker(e),r.createMarker(n),V(s),s))}formatIso(e,n){let{dateEnv:s}=this.getCurrentData();return s.formatIso(s.createMarker(e),{omitTime:n})}select(e,n){let s;n==null?e.start!=null?s=e:s={start:e,end:null}:s={start:e,end:n};let r=this.getCurrentData(),i=Zf(s,r.dateEnv,_({days:1}));i&&(this.dispatch({type:"SELECT_DATES",selection:i}),no(i,null,r))}unselect(e){let n=this.getCurrentData();n.dateSelection&&(this.dispatch({type:"UNSELECT_DATES"}),tg(e,n))}addEvent(e,n){if(e instanceof $){let a=e._def,o=e._instance;return this.getCurrentData().eventStore.defs[a.defId]||(this.dispatch({type:"ADD_EVENTS",eventStore:es({def:a,instance:o})}),this.triggerEventAdd(e)),e}let s=this.getCurrentData(),r;if(n instanceof et)r=n.internalEventSource;else if(typeof n=="boolean")n&&([r]=Ya(s.eventSources));else if(n!=null){let a=this.getEventSourceById(n);if(!a)return Oe(`Unknown event source ID \`${n}\`.`),null;r=a.internalEventSource}let i=Ja(e,r,s,!1);if(i){let a=new $(s,i.def,i.def.recurringDef?null:i.instance);return this.dispatch({type:"ADD_EVENTS",eventStore:es(i)}),this.triggerEventAdd(a),a}return null}triggerEventAdd(e){let{emitter:n}=this.getCurrentData();n.trigger("eventAdd",{event:e,relatedEvents:[],revert:()=>{this.dispatch({type:"REMOVE_EVENTS",eventStore:so(e)})}})}getEventById(e){let n=this.getCurrentData(),{defs:s,instances:r}=n.eventStore;e=String(e);for(let i in s){let a=s[i];if(a.publicId===e){if(a.recurringDef)return new $(n,a,null);for(let o in r){let l=r[o];if(l.defId===a.defId)return new $(n,a,l)}}}return null}getEvents(){let e=this.getCurrentData();return Fe(e.eventStore,e)}removeAllEvents(){this.dispatch({type:"REMOVE_ALL_EVENTS"})}getEventSources(){let e=this.getCurrentData(),n=e.eventSources,s=[];for(let r in n)s.push(new et(e,n[r]));return s}getEventSourceById(e){let n=this.getCurrentData(),s=n.eventSources;e=String(e);for(let r in s)if(s[r].publicId===e)return new et(n,s[r]);return null}addEventSource(e){let n=this.getCurrentData();if(e instanceof et)return n.eventSources[e.internalEventSource.sourceId]||this.dispatch({type:"ADD_EVENT_SOURCES",sources:[e.internalEventSource]}),e;let s=co(e,n);return s?(this.dispatch({type:"ADD_EVENT_SOURCES",sources:[s]}),new et(n,s)):null}removeAllEventSources(){this.dispatch({type:"REMOVE_ALL_EVENT_SOURCES"})}refetchEvents(){this.dispatch({type:"FETCH_EVENT_SOURCES",isRefetch:!0})}scrollToTime(e){let n=_(e);n&&this.trigger("_timeScrollRequest",n)}getButtonState(){const e=this.getCurrentData(),{toolbarProps:n}=e,s=e.calendarOptions,r=s.buttons||{},i=e.viewSpecs,a=e.viewSpec.singleUnit,o=[a?Kr(a,s):"",a],l={today:{text:s.todayText,hint:ue(s.todayHint,o,s.todayText),isDisabled:!n.isTodayEnabled},prev:{text:s.prevText,hint:ue(s.prevHint,o,s.prevText),isDisabled:!n.isPrevEnabled},next:{text:s.nextText,hint:ue(s.nextHint,o,s.nextText),isDisabled:!n.isNextEnabled},prevYear:{text:s.prevYearText,hint:ue(s.prevHint,[s.yearText,"year"],s.prevYearText),isDisabled:!1},nextYear:{text:s.prevYearText,hint:ue(s.nextHint,[s.yearText,"year"],s.nextYearText),isDisabled:!1}};for(const c in i){const u=i[c],{singleUnit:h}=u,g=u.optionDefaults.buttonTextKey,m=r[c]?.text||(g?s[g]:"")||(h?Kr(h,s):"")||c,v=ue(s.viewHint,[m,c],m);l[c]={text:m,hint:v}}return l}}function Kr(t,e){return e[t+"TextLong"]||e[t+"Text"]}class ep extends w.Component{constructor(){super(...arguments),this.state={forPrint:!1},this.handleBeforePrint=()=>{Rt.flushSync(()=>{this.setState({forPrint:!0})})},this.handleAfterPrint=()=>{Rt.flushSync(()=>{this.setState({forPrint:!1})})}}render(){return this.props?.children(this.state.forPrint)}componentDidMount(){const{props:e}=this,{emitter:n}=e;n.on("_beforeprint",this.handleBeforePrint),n.on("_afterprint",this.handleAfterPrint)}componentWillUnmount(){const{props:e}=this,{emitter:n}=e;n.off("_beforeprint",this.handleBeforePrint),n.off("_afterprint",this.handleAfterPrint)}}function tp(t,e){let n=t.borderlessX??t.borderless,s=t.borderlessTop??t.borderless,r=t.borderlessBottom??t.borderless;const i={borderlessX:!!n,borderlessTop:!!s,borderlessBottom:!!r};return b(R(t.class,i),R(t.className,i),f.borderBoxRoot,f.isolate,f.flexCol,e?f.calendarPrintRoot:f.calendarScreenRoot)}class np extends B{render(){const{contentGenerator:e,className:n}=this.props;if(e)return d.jsx(q,{tag:"span",style:{display:"contents"},attrs:{"aria-hidden":!0},renderProps:{},generatorName:void 0,customGenerator:e});if(n!==void 0)return d.jsx("span",{"aria-hidden":!0,className:n})}}class sp extends B{render(){let{props:e}=this,{options:n}=this.context,s=e.widgetGroups.map(r=>this.renderWidgetGroup(r));return w.createElement("div",{className:R(n.toolbarSectionClass,{name:e.name})},...s)}renderWidgetGroup(e){let{props:n,context:s}=this,{options:r}=s,i=[],a=!0,o=!0;for(const l of e){const{name:c,isView:u}=l;c==="title"?a=!1:u||(o=!1)}for(let l of e){let{name:c,customElement:u,buttonHint:h}=l;if(c==="title")i.push(d.jsx("div",{role:"heading","aria-level":r.headingLevel,id:n.titleId,className:b(r.toolbarTitleClass),children:n.title}));else if(u)i.push(d.jsx(q,{tag:"span",style:{display:"contents"},renderProps:{},generatorName:void 0,customGenerator:u}));else{let g=c===n.selectedButton,m=!n.isTodayEnabled&&c==="today"||!n.isPrevEnabled&&c==="prev"||!n.isNextEnabled&&c==="next",v=l.buttonDisplay??r.buttonDisplay;v==="auto"&&(v=l.buttonIconContent||l.buttonIconClass?"icon":"text");let p;v!=="text"&&(p=d.jsx(np,{className:l.buttonIconClass,contentGenerator:l.buttonIconContent}));let y=e.length>1&&a,D=y?{hasSelection:o}:null,x={name:c,text:l.buttonText,isPrimary:l.buttonIsPrimary,isSelected:g,isDisabled:m,isIconOnly:v==="icon",buttonGroup:D};i.push(d.jsx(q,{tag:"button",attrs:{type:"button",disabled:m,...a&&o?{role:"tab","aria-selected":g}:{"aria-pressed":g},"aria-label":typeof h=="function"?h(n.navUnit):h,onClick:l.buttonClick},className:b(R(r.buttonClass,x),!m&&f.cursorPointer,y&&b(g?f.z1:f.z0,f.focusZ2)),renderProps:x,generatorName:void 0,classNameGenerator:l.buttonClass,didMount:l.buttonDidMount,willUnmount:l.buttonWillUnmount,children:()=>v==="text"?l.buttonText:v==="icon"?p:v==="icon-text"?d.jsxs(d.Fragment,{children:[p,l.buttonText]}):d.jsxs(d.Fragment,{children:[l.buttonText,p]})}))}}return i.length>1?w.createElement("div",{role:a&&o?"tablist":void 0,"aria-label":a&&o?r.viewChangeHint:void 0,className:b(R(r.buttonGroupClass,{hasSelection:o}),f.isolate)},...i):i[0]}}class Jr extends B{render(){let{props:e}=this,n=this.context.options,{sectionWidgets:s}=e.model;const{borderlessX:r,borderlessTop:i,borderlessBottom:a}=ve(n),o=e.isHeader?n.headerToolbarClass:n.footerToolbarClass;return d.jsxs("div",{className:b(R(o,{borderlessX:r,borderlessTop:i,borderlessBottom:a}),R(n.toolbarClass,{borderlessX:r,borderlessTop:i,borderlessBottom:a})),children:[this.renderSection("start",s.start),this.renderSection("center",s.center),this.renderSection("end",s.end)]})}renderSection(e,n){let{props:s}=this;return d.jsx(sp,{name:e,widgetGroups:n,title:s.title,titleId:s.titleId,navUnit:s.navUnit,selectedButton:s.selectedButton,isTodayEnabled:s.isTodayEnabled,isPrevEnabled:s.isPrevEnabled,isNextEnabled:s.isNextEnabled},e)}}class rp extends pt{constructor(e){super(e),this.handleSegClick=(n,s)=>{let{component:r}=this,{context:i}=r,a=ct(s);a&&r.isValidSegDownEl(n.target)&&i.emitter.trigger("eventClick",{el:s,event:new $(r.context,a.def,a.instance),jsEvent:n,view:i.viewApi})},this.destroy=Va(e.el,"click",`.${f.internalEvent}`,this.handleSegClick)}}class ip extends pt{constructor(e){super(e),this.handleEventElRemove=n=>{n===this.currentSegEl&&this.handleSegLeave(null,this.currentSegEl)},this.handleSegEnter=(n,s)=>{ct(s)&&(this.currentSegEl=s,this.triggerEvent("eventMouseEnter",n,s))},this.handleSegLeave=(n,s)=>{this.currentSegEl&&(this.currentSegEl=null,this.triggerEvent("eventMouseLeave",n,s))},this.removeHoverListeners=bf(e.el,`.${f.internalEvent}`,this.handleSegEnter,this.handleSegLeave)}destroy(){this.removeHoverListeners()}triggerEvent(e,n,s){let{component:r}=this,{context:i}=r,a=ct(s);(!n||r.isValidSegDownEl(n.target))&&i.emitter.trigger(e,{el:s,event:new $(i,a.def,a.instance),jsEvent:n,view:i.viewApi})}}class ap extends Ke{constructor(){super(...arguments),this.buildViewContext=k(em),this.buildViewPropTransformers=k(op),this.interactionsStore={},this.calendarInteractions=[],this.registerInteractiveComponent=(e,n)=>{let s=fm(e,n),i=[rp,ip];n.disableHits||(i=i.concat(this.props.pluginHooks.componentInteractions));let a=i.map(o=>new o(s));this.interactionsStore[e.uid]=a,rs[e.uid]=s},this.unregisterInteractiveComponent=e=>{let n=this.interactionsStore[e.uid];if(n){for(let s of n)s.destroy();delete this.interactionsStore[e.uid]}delete rs[e.uid]}}get viewTitleId(){return this.props.baseId+"title"}render(){const{props:e}=this;let{toolbarConfig:n,options:s}=e,r,i=!1,a;e.forPrint||fe(s)||(s.height!=null?i=!0:s.contentHeight!=null?r=s.contentHeight:a=Math.max(s.aspectRatio,.5));let o=this.buildViewContext(e.viewSpec,e.viewApi,e.options,e.dateProfileGenerator,e.dateEnv,e.nowManager,e.pluginHooks,e.dispatch,e.getCurrentData,e.emitter,e.calendarApi,e.baseId,this.registerInteractiveComponent,this.unregisterInteractiveComponent);return d.jsxs(Me.Provider,{value:o,children:[n.header&&d.jsx(Jr,{model:n.header,isHeader:!0,titleId:this.viewTitleId,...e.toolbarProps}),d.jsxs("div",{className:b(f.flexCol,f.rel,f.overflowAnchorNone,f.minHeight0,i&&f.liquid),style:{height:r,aspectRatio:a!=null?String(a):void 0},children:[this.renderView(b((i||r)&&f.liquid,a!=null&&f.fill,f.internalView)),this.buildAppendContent()]}),n.footer&&d.jsx(Jr,{model:n.footer,isHeader:!1,...e.toolbarProps})]})}renderView(e){const{props:n}=this,{pluginHooks:s,viewSpec:r,toolbarConfig:i,toolbarProps:a}=n;let o={className:e,dateProfile:n.dateProfile,businessHours:n.businessHours,eventStore:n.renderableEventStore,eventUiBases:n.eventUiBases,dateSelection:n.dateSelection,eventSelection:n.eventSelection,eventDrag:n.eventDrag,eventResize:n.eventResize,forPrint:n.forPrint,labelId:i.header&&i.header.hasTitle?this.viewTitleId:void 0,labelStr:i.header&&i.header.hasTitle?void 0:a.title},l=this.buildViewPropTransformers(s.viewPropsTransformers),c={...n,toolbarProps:a,forPrint:n.forPrint};for(let h of l)Object.assign(o,h.transform(o,c));let u=r.component;return d.jsx(u,{...o})}buildAppendContent(){const{props:e}=this;return d.jsx(d.Fragment,{children:e.pluginHooks.viewContainerAppends.map((n,s)=>d.jsx(w.Fragment,{children:n(e)},s))})}componentDidMount(){const{props:e}=this;this.calendarInteractions=e.pluginHooks.calendarInteractions.map(s=>new s(e));let{propSetHandlers:n}=e.pluginHooks;for(let s in n)n[s](e[s],e);for(let s of e.pluginHooks.contextInit)s(e)}componentDidUpdate(e){const{props:n}=this;let{propSetHandlers:s}=n.pluginHooks;for(let r in s)n[r]!==e[r]&&s[r](n[r],n)}componentWillUnmount(){const{props:e}=this;for(let n of this.calendarInteractions)n.destroy();this.calendarInteractions=[],e.emitter.trigger("_unmount")}}function op(t){return t.map(e=>new e)}const lp=w.forwardRef((t,e)=>{const n=up(t.id),[s,r]=w.useState("");function i(c,u){(cp(u)?Rt.flushSync:dp)(()=>{r(Te())})}const[a]=w.useState(()=>new Qm),[o]=w.useState(()=>new zm({calendarApi:a,onDataChange:i}));w.useEffect(()=>()=>{o.destroy()},[]),w.useImperativeHandle(e,()=>({getApi:()=>a}),[]);const l=o.update(t);return d.jsx(ep,{emitter:l.emitter,children:c=>{const u=l.calendarOptions,h=u.direction==="rtl",g=tp(u,c);return d.jsx("div",{dir:h?"rtl":void 0,className:g,style:{height:u.height},"data-color-scheme":u.colorScheme||void 0,children:d.jsx(ap,{...l,baseId:n,forPrint:c})})}})});function cp(t){for(const e of t)if(e.type==="SET_EVENT_DRAG"||e.type==="UNSET_EVENT_DRAG"||e.type==="SET_EVENT_RESIZE"||e.type==="UNSET_EVENT_RESIZE"||e.type==="MERGE_EVENTS")return!0;return!1}function dp(t){t()}let Qr=!1;function up(t){if(ar.useId)return ar.useId();const[e]=w.useState(()=>Te());return t?t+":":(Qr||(Qr=!0,Oe("Missing `id` prop. Provide one for better SSR support in React 17.")),`fc:${e}:`)}function xo(t){const e=t.getRootNode();return e instanceof Document?e.body||e.documentElement:e}function Nt(t){return getComputedStyle(t).direction==="rtl"}const hp=/(top|left|right|bottom|width|height)$/i;function Jt(t,e){for(let n in e)fp(t,n,e[n])}function fp(t,e,n){n==null?t.style[e]="":typeof n=="number"&&hp.test(e)?t.style[e]=`${n}px`:t.style[e]=n}function To(t){return t.composedPath?.()[0]??t.target}class At extends w.Component{constructor(e,n){super(e,n),this.handleChange=()=>{this.forceUpdate()},this.runner=new Eo(this.handleChange)}render(){const{props:e,context:n}=this,{nowDate:s,todayRange:r}=this.runner.update({nowManager:n.nowManager,unit:e.unit,unitValue:e.unitValue,nowIndicatorSnap:n.options.nowIndicatorSnap,dateEnv:n.dateEnv});return e.children(s,r)}componentWillUnmount(){this.runner.destroy()}}At.contextType=Me;const $s=V({year:"numeric",month:"long",day:"numeric"}),gp=V({week:"long"}),un=V({weekday:"long"});function Ht(t){for(const e of t)if(e.type==="weekday")return e.value;return""}function kt(t){for(const e of t)if(e.type==="day")return e.value;return""}function Mo(t){for(const e of t)if(e.type==="month")return e.value;return""}function vt(t,e,n="day"){return ie(t.dateEnv.formatToParts(e,n==="week"?gp:$s))}function yt(t,e,n="day",s=vt(t,e,n),r=!0){const{dateEnv:i,options:a,calendarApi:o}=t,l=i.toDate(e),c=u=>{let h=n==="day"?a.navLinkDayClick:n==="week"?a.navLinkWeekClick:null;typeof h=="function"?h.call(o,i.toDate(e),u):(typeof h=="string"&&(n=h),o.zoomTo(e,n))};return{role:"link","aria-label":ue(a.navLinkHint,[s,l],s),className:b(a.navLinkClass,f.cursorPointer,f.internalNavLink),...r?Ps(c):{onClick:c}}}function Je(t,e,n,s,r){const i=!!(n&&(!n.activeRange||!Ce(n.activeRange,t)));return{date:e.toDate(t),dow:t.getUTCDay(),isDisabled:i,isOther:!i&&!!(n&&!Ce(n.currentRange,t)),isToday:!i&&!!(s&&Ce(s,t)),isPast:!i&&!!(r?t<r:s&&t<s.start),isFuture:!i&&!!(r?t>r:s&&t>=s.end)}}function as(t,e){return t!=null&&(t===e||Math.abs(t-e)<.01)}const mp=!0,os=new Map,ls=new Set;let cs=!1,zn=!1;function re(t){ls.add(t),!cs&&!zn&&(zn=!0,requestAnimationFrame(()=>{zn=!1,Io()}))}function Io(){for(const t of ls.values())t(),ls.delete(t)}const Gt=typeof ResizeObserver<"u"&&new ResizeObserver(t=>{cs=!0;for(let e of t){const n=e.target,s=os.get(n);let r,i;if(e.borderBoxSize&&mp){const o=e.borderBoxSize[0]||e.borderBoxSize;r=o.inlineSize,i=o.blockSize}else({width:r,height:i}=n.getBoundingClientRect());let a=!1;as(s.width,r)||(s.width=r,a=s.watchWidth),as(s.height,i)||(s.height=i,a||(a=s.watchHeight)),a&&s.callback(r,i)}Rt.flushSync(()=>{Io(),cs=!1})});function St(t,e,n=!0,s=!0){return os.set(t,{callback:e,watchWidth:n,watchHeight:s}),Gt&&Gt.observe(t,{box:"border-box"}),()=>{os.delete(t),Gt&&Gt.unobserve(t)}}function Zs(t,e){return St(t,e,!0)}function dt(t,e){return St(t,(n,s)=>e(s),!1,!0)}class kn extends B{constructor(){super(...arguments),this.refineRenderProps=Ct(pp)}render(){const{props:e,context:n}=this,{options:s,viewSpec:r}=n,i=this.refineRenderProps({...ve(s),options:{headerToolbar:s.headerToolbar,footerToolbar:s.footerToolbar},isHeightAuto:fe(s),viewApi:n.viewApi});return d.jsx(q,{elRef:e.elRef,tag:e.tag||"div",attrs:e.attrs,style:e.style,className:b(e.className,R(s.viewClass,i),R(r.optionDefaults.class,i),R(r.optionDefaults.className,i),R(r.optionOverrides.class,i),R(r.optionOverrides.className,i)),renderProps:i,generatorName:void 0,didMount:s.didMount||s.viewDidMount,willUnmount:s.willUnmount||s.viewWillUnmount,children:()=>e.children})}}function pp(t){return{view:t.viewApi,borderlessX:t.borderlessX,borderlessTop:t.borderlessTop,borderlessBottom:t.borderlessBottom,options:t.options,isHeightAuto:t.isHeightAuto}}class ye extends B{constructor(){super(...arguments),this.uid=Te()}prepareHits(){}queryHit(e,n,s,r,i){return null}isValidSegDownEl(e){return!this.props.eventDrag&&!this.props.eventResize&&!e.closest(`.${f.internalEventMirror}`)}isValidDateDownEl(e){return!e.closest(`.${f.internalEvent}:not(.${f.internalBgEvent})`)&&!e.closest(`.${f.internalMoreLink}`)&&!e.closest(`.${f.internalNavLink}`)&&!e.closest(`.${f.internalPopover}`)}}class ei{constructor(e){this.drainedOption=e,this.isRunning=!1,this.isDirty=!1,this.pauseDepths={},this.timeoutId=0}request(e){this.isDirty=!0,this.isPaused()||(this.clearTimeout(),e==null?this.tryDrain():this.timeoutId=setTimeout(this.tryDrain.bind(this),e))}pause(e=""){let{pauseDepths:n}=this;n[e]=(n[e]||0)+1,this.clearTimeout()}resume(e="",n){let{pauseDepths:s}=this;e in s&&(n?delete s[e]:(s[e]-=1,s[e]<=0&&delete s[e]),this.tryDrain())}isPaused(){return Object.keys(this.pauseDepths).length}tryDrain(){if(!this.isRunning&&!this.isPaused()){for(this.isRunning=!0;this.isDirty;)this.isDirty=!1,this.drained();this.isRunning=!1}}clear(){this.clearTimeout(),this.isDirty=!1,this.pauseDepths={}}clearTimeout(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=0)}drained(){this.drainedOption&&this.drainedOption()}}class vp{constructor(e){this.el=e,this.emitter=new Lt,this.isScroll=!1,this.isScrollRecent=!1,this.isWheelRecent=!1,this.isMouseDown=!1,this.isTouchDown=!1,this.isMouse=!1,this.isTouch=!1,this.isWheel=!1,this.handleScroll=()=>{this.isScrollRecent=!0,this.isMouseDown&&(this.isMouse=!0),this.isTouchDown&&(this.isTouch=!0),this.isWheelRecent&&(this.isWheel=!0),this.startScroll(),this.emitter.trigger("scroll",this.getIsDevice()),this.scrollWaiter.request(500)},this.handleScrollWait=()=>{this.isScrollRecent=!1,this.isTouchDown||this.endScroll()},this.handleWheel=()=>{this.isWheelRecent=!0,this.wheelWaiter.request(500)},this.handleWheelWait=()=>{this.isWheelRecent=!1},this.handleMouseDown=()=>{this.isMouseDown=!0},this.handleMouseUp=()=>{this.isMouseDown=!1},this.handleTouchStart=()=>{this.isTouchDown=!0},this.handleTouchEnd=()=>{this.isTouchDown=!1,this.isScrollRecent||this.endScroll()},this.wheelWaiter=new ei(this.handleWheelWait),this.scrollWaiter=new ei(this.handleScrollWait),e.addEventListener("scroll",this.handleScroll,{passive:!0}),e.addEventListener("wheel",this.handleWheel,{passive:!0}),e.addEventListener("mousedown",this.handleMouseDown),e.addEventListener("mouseup",this.handleMouseUp),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),e.addEventListener("touchend",this.handleTouchEnd)}destroy(){let{el:e}=this;e.removeEventListener("scroll",this.handleScroll,{passive:!0}),e.removeEventListener("wheel",this.handleWheel,{passive:!0}),e.removeEventListener("mousedown",this.handleMouseDown),e.removeEventListener("mouseup",this.handleMouseUp),e.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),e.removeEventListener("touchend",this.handleTouchEnd)}startScroll(){this.isScroll||(this.isScroll=!0,this.emitter.trigger("scrollStart",this.getIsDevice()))}endScroll(){this.isScroll&&(this.scrollWaiter.clear(),this.wheelWaiter.clear(),this.isScroll=!1,this.isWheelRecent=!1,this.emitter.trigger("scrollEnd",this.getIsDevice()),this.isMouse=!1,this.isTouch=!1,this.isWheel=!1)}getIsDevice(){return this.isWheel||this.isMouse||this.isTouch}}class pe extends ye{constructor(){super(...arguments),this.handleEl=e=>{this.el&&(this.el=null,this._isUnmounting=!0,this.listener.destroy()),e&&(this.el=e,this._isUnmounting=!1,this.listener=new vp(e))},this.handleHRuler=e=>{this.disconnectHRuler&&(this.disconnectHRuler(),this.disconnectHRuler=void 0,this.clientWidth!==void 0&&(this.clientWidth=void 0,L(this.props.clientWidthRef,null))),e&&(this.disconnectHRuler=Zs(e,n=>{this._isUnmounting||n!==this.clientWidth&&(this.clientWidth=n,L(this.props.clientWidthRef,n))}))},this.handleVRuler=e=>{this.disconnectVRuler&&(this.disconnectVRuler(),this.disconnectVRuler=void 0,this.clientHeight!==void 0&&(this.clientHeight=void 0,L(this.props.clientHeightRef,null))),e&&(this.disconnectVRuler=dt(e,n=>{if(this._isUnmounting)return;n!==this.clientHeight&&(this.clientHeight=n,L(this.props.clientHeightRef,n));const s=Math.round(this.el.getBoundingClientRect().height-n);s!==this.bottomScrollbarWidth&&(this.bottomScrollbarWidth=s,L(this.props.bottomScrollbarWidthRef,s))}))}}render(){const{props:e}=this,n=e.horizontal||e.vertical?"hidden":"";return d.jsxs("div",{ref:this.handleEl,className:b(e.className,f.noPadding,f.rel,e.hideScrollbars&&f.noScrollbars,f.internalScroller),style:{...e.style,overflowX:e.horizontal?"auto":n,overflowY:e.vertical?"auto":n},children:[e.children,!!e.clientWidthRef&&d.jsx("div",{ref:this.handleHRuler,className:f.fillTop}),!!(e.clientHeightRef||e.bottomScrollbarWidthRef)&&d.jsx("div",{ref:this.handleVRuler,className:f.fillStart})]})}endScroll(){this.listener.endScroll()}get x(){const{el:e}=this;return e?yp(e):0}get y(){const{el:e}=this;return e?e.scrollTop:0}scrollTo({x:e,y:n}){const{el:s}=this;s&&(n!=null&&(s.scrollTop=n),e!=null&&Sp(s,e))}addScrollStartListener(e){this.listener.emitter.on("scrollStart",e)}removeScrollStartListener(e){this.listener.emitter.off("scrollStart",e)}addScrollEndListener(e){this.listener.emitter.on("scrollEnd",e)}removeScrollEndListener(e){this.listener.emitter.off("scrollEnd",e)}}function yp(t){const{scrollLeft:e}=t;return Nt(t)?Ep(e,t):e}function Sp(t,e){const n=Nt(t);t.scrollLeft=n?bp(e,t):e}function Ep(t,e){switch(No()){case"positive":return e.scrollWidth-e.clientWidth-t;case"negative":return-t}return t}function bp(t,e){switch(No()){case"positive":return e.scrollWidth-e.clientWidth-t;case"negative":return-t}return t}let ti;function No(){return ti||(ti=Dp())}function Dp(){let t=document.createElement("div");t.style.position="absolute",t.style.top="-1000px",t.style.width="100px",t.style.height="100px",t.style.overflow="scroll",t.style.direction="rtl";let e=document.createElement("div");e.style.width="200px",e.style.height="200px",t.appendChild(e),document.body.appendChild(t);let n;return t.scrollLeft>0?n="positive":(t.scrollLeft=50,t.scrollLeft>0?n="reverse":n="negative"),t.remove(),n}class Ot extends B{constructor(){super(...arguments),this.buildPublicEvent=k((e,n,s)=>new $(e,n,s)),this.handleEl=e=>{this.el=e,L(this.props.elRef,e),e&&cn(e,this.props.eventRange)}}render(){const{props:e,context:n}=this,{options:s}=n,{eventRange:r}=e,i=r.ui,a=s.eventTimeFormat||e.defaultTimeFormat,o=e.forcedTimeText??og(a,r,e.slicedStart,e.slicedEnd,e.isStart,e.isEnd,n,e.defaultDisplayEventTime,e.defaultDisplayEventEnd),[l,c,u]=ug(r,n),h=this.buildPublicEvent(n,r.def,r.instance),g=!e.disableDragging&&ag(r,n),m=/row|column/.test(e.display),v={event:h,isNarrow:e.isNarrow||!1,isShort:e.isShort||!1,timeText:o},p={event:h,view:n.viewApi,timeText:o,color:i.color||s.eventColor,contrastColor:i.contrastColor||s.eventContrastColor,isDraggable:g,isStartResizable:!e.disableResizing&&e.isStart&&i.durationEditable&&s.eventResizableFromStart,isEndResizable:!e.disableResizing&&e.isEnd&&i.durationEditable,isMirror:e.isMirror,isStart:!!e.isStart,isEnd:!!e.isEnd,isFirst:!!e.isFirst,isLast:!!e.isLast,isPast:!!e.isPast,isFuture:!!e.isFuture,isToday:!!e.isToday,isSelected:!!e.isSelected,isDragging:!!e.isDragging,isResizing:!!e.isResizing,isInteractive:u,isNarrow:e.isNarrow||!1,isShort:e.isShort||!1,level:e.level||0,timeClass:b(R(s.eventTimeClass,v),m&&R(s.blockEventTimeClass,v),e.display==="row"&&R(s.rowEventTimeClass,v),e.display==="column"&&R(s.columnEventTimeClass,v),e.display==="list-item"&&R(s.listItemEventTimeClass,v)),titleClass:b(R(s.eventTitleClass,v),m&&R(s.blockEventTitleClass,v),e.display==="row"&&R(s.rowEventTitleClass,v),e.display==="column"&&R(s.columnEventTitleClass,v),e.display==="list-item"&&R(s.listItemEventTitleClass,v),e.display==="row"&&s.rowEventTitleSticky&&f.stickyS,e.display==="column"&&s.columnEventTitleSticky&&f.stickyT),options:{eventOverlap:!!s.eventOverlap}},y=b(m&&R(s.blockEventClass,p),e.display==="row"&&R(s.rowEventClass,p),e.display==="column"&&R(s.columnEventClass,p),e.display==="list-item"&&R(s.listItemEventClass,p),i.className,e.className,e.display==="column"?f.flexCol:f.flexRow,(r.def.url||g)&&f.cursorPointer,f.internalEvent,e.isMirror&&f.internalEventMirror,g&&f.internalEventDraggable,p.isSelected&&f.internalEventSelected,(p.isStartResizable||p.isEndResizable)&&f.internalEventResizable),D=b(R(s.eventBeforeClass,p),m&&R(s.blockEventBeforeClass,p),e.display==="row"&&R(s.rowEventBeforeClass,p),e.display==="column"&&R(s.columnEventBeforeClass,p),e.display==="list-item"&&R(s.listItemEventBeforeClass,p)),x=b(R(s.eventAfterClass,p),m&&R(s.blockEventAfterClass,p),e.display==="row"&&R(s.rowEventAfterClass,p),e.display==="column"&&R(s.columnEventAfterClass,p),e.display==="list-item"&&R(s.listItemEventAfterClass,p)),C=b(R(s.eventInnerClass,p),m&&R(s.blockEventInnerClass,p),e.display==="row"&&R(s.rowEventInnerClass,p),e.display==="column"&&R(s.columnEventInnerClass,p),e.display==="list-item"&&R(s.listItemEventInnerClass,p),!e.disableLiquid&&f.liquid),E=e.display==="row"&&s.rowEventBeforeContent,T=e.display==="row"&&s.rowEventAfterContent;return d.jsx(q,{tag:l,attrs:{...e.attrs,...c,dir:e.isDragging&&s.direction==="rtl"?"rtl":void 0},className:y,style:{"--fc-event-color":p.color,"--fc-event-contrast-color":p.contrastColor},elRef:this.handleEl,renderProps:p,generatorName:"eventContent",customGenerator:s.eventContent,defaultGenerator:wp,classNameGenerator:s.eventClass,didMount:s.eventDidMount,willUnmount:s.eventWillUnmount,children:N=>d.jsxs(d.Fragment,{children:[!!(p.isSelected&&m)&&d.jsx("div",{className:e.display==="column"?f.hitX:f.hitY}),(D||E)&&d.jsxs("div",{className:b(D,!e.disableZindexes&&f.z1,p.isStartResizable&&b(e.display==="column"?f.cursorResizeT:f.cursorResizeS,f.internalEventResizer,f.internalEventResizerStart)),children:[E&&d.jsx(q,{tag:"div",style:{display:"contents"},attrs:{"aria-hidden":!0},renderProps:p,generatorName:void 0,customGenerator:E}),!!(p.isStartResizable&&p.isSelected)&&d.jsx("div",{className:f.hit})]}),d.jsx(N,{tag:"div",className:b(C,!e.disableZindexes&&f.z0)}),(x||T)&&d.jsxs("div",{className:b(x,!e.disableZindexes&&f.z1,p.isEndResizable&&b(e.display==="column"?f.cursorResizeB:f.cursorResizeE,f.internalEventResizer,f.internalEventResizerEnd)),children:[T&&d.jsx(q,{tag:"div",style:{display:"contents"},attrs:{"aria-hidden":!0},renderProps:p,generatorName:void 0,customGenerator:T}),!!(p.isEndResizable&&p.isSelected)&&d.jsx("div",{className:f.hit})]})]})})}componentDidUpdate(e){this.el&&this.props.eventRange!==e.eventRange&&cn(this.el,this.props.eventRange)}}Ot.addPropsEquality({seg:We});function wp(t){return d.jsxs(d.Fragment,{children:[t.timeText&&d.jsx("div",{className:t.timeClass,children:t.timeText}),d.jsx("div",{className:t.titleClass,children:t.event.title||d.jsx(d.Fragment,{children:" "})})]})}function Cp(t,e){return t.left>=e.left&&t.left<e.right&&t.top>=e.top&&t.top<e.bottom}function Ho(t,e){let n={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)};return n.left<n.right&&n.top<n.bottom?n:!1}function Rp(t,e){return{left:Math.min(Math.max(t.left,e.left),e.right),top:Math.min(Math.max(t.top,e.top),e.bottom)}}function xp(t){return{left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}}function Tp(t,e){return{left:t.left-e.left,top:t.top-e.top}}function Mp(t,e=!1){let n=window.getComputedStyle(t),s=parseInt(n.borderLeftWidth,10)||0,r=parseInt(n.borderRightWidth,10)||0,i=parseInt(n.borderTopWidth,10)||0,a=parseInt(n.borderBottomWidth,10)||0,o=Hp(t),l=o.y-s-r,c=o.x-i-a,u={borderLeft:s,borderRight:r,borderTop:i,borderBottom:a,scrollbarBottom:c,scrollbarLeft:0,scrollbarRight:0};return n.direction==="rtl"?u.scrollbarLeft=l:u.scrollbarRight=l,e&&(u.paddingLeft=parseInt(n.paddingLeft,10)||0,u.paddingRight=parseInt(n.paddingRight,10)||0,u.paddingTop=parseInt(n.paddingTop,10)||0,u.paddingBottom=parseInt(n.paddingBottom,10)||0),u}function Ip(t,e=!1,n){let s=Xs(t),r=Mp(t,e),i={left:s.left+r.borderLeft+r.scrollbarLeft,right:s.right-r.borderRight-r.scrollbarRight,top:s.top+r.borderTop,bottom:s.bottom-r.borderBottom-r.scrollbarBottom};return e&&(i.left+=r.paddingLeft,i.right-=r.paddingRight,i.top+=r.paddingTop,i.bottom-=r.paddingBottom),i}function Xs(t){let e=t.getBoundingClientRect();return{left:e.left+window.scrollX,top:e.top+window.scrollY,right:e.right+window.scrollX,bottom:e.bottom+window.scrollY}}function Np(t){let e=ko(t),n=t.getBoundingClientRect();for(let s of e){let r=Ho(n,s.getBoundingClientRect());if(r)n=r;else return null}return n}function ko(t){let e=[];for(;t instanceof HTMLElement;){let n=window.getComputedStyle(t);if(n.position==="fixed")break;/(auto|scroll)/.test(n.overflow+n.overflowY+n.overflowX)&&e.push(t),t=t.parentNode}return e}function Hp(t){return{x:t.offsetHeight-t.clientHeight,y:t.offsetWidth-t.clientWidth}}class Po{constructor(){this.sliceBusinessHours=k(this._sliceBusinessHours),this.sliceDateSelection=k(this._sliceDateSpan),this.sliceEventStore=k(this._sliceEventStore),this.sliceEventDrag=k(this._sliceInteraction),this.sliceEventResize=k(this._sliceInteraction),this.forceDayIfListItem=!1}sliceProps(e,n,s,r,...i){let{eventUiBases:a}=e,o=this.sliceEventStore(e.eventStore,a,n,s,...i);return{dateSelectionSegs:this.sliceDateSelection(e.dateSelection,n,s,a,r,...i),businessHourSegs:this.sliceBusinessHours(e.businessHours,n,s,r,...i),fgEventSegs:o.fg,bgEventSegs:o.bg,eventDrag:this.sliceEventDrag(e.eventDrag,a,n,s,...i),eventResize:this.sliceEventResize(e.eventResize,a,n,s,...i),eventSelection:e.eventSelection}}sliceNowDate(e,n,s,r,...i){return this._sliceDateSpan({range:{start:e,end:Ge(e,1)},allDay:!1},n,s,{},r,...i)}_sliceBusinessHours(e,n,s,r,...i){return e?this._sliceEventStore(qe(e,Yt(n,!!s),r),{},n,s,...i).bg:[]}_sliceEventStore(e,n,s,r,...i){if(e){let a=ns(e,n,Yt(s,!!r),r);return{bg:this.sliceEventRanges(a.bg,i),fg:this.sliceEventRanges(a.fg,i)}}return{bg:[],fg:[]}}_sliceInteraction(e,n,s,r,...i){if(!e)return null;let a=ns(e.mutatedEvents,n,Yt(s,!!r),r);return{segs:this.sliceEventRanges(a.fg,i),affectedInstances:e.affectedEvents.instances,isEvent:e.isEvent}}_sliceDateSpan(e,n,s,r,i,...a){if(!e)return[];let o=Yt(n,!!s),l=Ae(e.range,o);if(l){e={...e,range:l};let c=eg(e,r,i),u=this.sliceRange(e.range,...a);for(let h of u)h.eventRange=c;return u}return[]}sliceEventRanges(e,n){let s=[];for(let r of e)s.push(...this.sliceEventRange(r,n));return s}sliceEventRange(e,n){let s=e.range;this.forceDayIfListItem&&e.ui.display==="list-item"&&(s={start:s.start,end:te(s.start,1)});let r=this.sliceRange(s,...n);for(let i of r)i.eventRange=e,i.isStart=e.isStart&&i.isStart,i.isEnd=e.isEnd&&i.isEnd;return r}}function Yt(t,e){let n=t.activeRange;return e?n:{start:Ge(n.start,t.slotMinTime.milliseconds),end:Ge(n.end,t.slotMaxTime.milliseconds-864e5)}}class Ks extends Po{constructor(){super(...arguments),this.forceDayIfListItem=!0}sliceRange(e,n){return n.sliceRange(e)}}const kp=new Date(2592e5);function jo(t,e,n,s,r,i){const a=Lo(t,e,n,s,r,i),o=Do(n,i.dateEnv);if(e&&o!=="day")for(const l of a.dataConfigs)wo(l.dateMarker,o,i.dateEnv)&&(l.renderProps.isMajor=!0);return[a]}function Lo(t,e,n,s,r,i,a,o){return{isDateRow:!0,renderConfig:Pp(r,e,i),dataConfigs:jp(t,e,n,s,r,i,a,void 0,void 0,void 0,void 0,o)}}function Pp(t,e,n){const{options:s}=n;return{generatorName:"dayHeaderContent",customGenerator:s.dayHeaderContent,classNameGenerator:s.dayHeaderClass,innerClassNameGenerator:s.dayHeaderInnerClass,didMount:s.dayHeaderDidMount,willUnmount:s.dayHeaderWillUnmount,align:s.dayHeaderAlign,sticky:s._dayHeaderSticky,dayHeaderFormat:t,datesRepDistinctDays:e}}const Ao=[];for(let t=0;t<7;t++)Ao.push(te(new Date(2592e5),t));function jp(t,e,n,s,r,i,a=1,o="",l={},c={},u="",h){const{dateEnv:g,viewApi:m,options:v}=i;return e?t.map((p,y)=>{const D=Je(p,g,n,s),x=h!=null&&!(y%h),C=v.navLinks&&!D.isDisabled&&t.length>1,E={...D,...l,isMajor:x,isSticky:!1,inPopover:!1,hasNavLink:C,view:m},T=vt(i,p);return{key:o+p.toUTCString(),dateMarker:p,renderProps:E,attrs:{"aria-label":T,...D.isToday?{"aria-current":"date"}:{},"data-date":mt(p),...c},innerAttrs:C?yt(i,p,void 0,T):{"aria-hidden":!0},colSpan:a,hasNavLink:C,className:u}}):t.map((p,y)=>{const D=p.getUTCDay(),x=te(kp,D),C={date:g.toDate(p),dow:D,isDisabled:!1,isFuture:!1,isPast:!1,isToday:!1,isOther:!1},E=h!=null&&!(y%h),T={...C,date:Ao[D],isMajor:E,isSticky:!1,inPopover:!1,hasNavLink:!1,view:m,...l},N=ie(g.formatToParts(x,un));return{key:o+String(D),dateMarker:p,renderProps:T,attrs:{"aria-label":N,...c},innerAttrs:{"aria-hidden":!0},colSpan:a,className:u}})}class le{constructor(e,n=!1){this.masterCallback=e,this.ignoreDeletes=n,this.rev="",this.current=new Map,this.callbacks=new Map,this.handleValue=(s,r)=>{let{current:i,callbacks:a}=this;s===null?this.ignoreDeletes||(i.delete(r),a.delete(r)):i.set(r,s),this.rev=Te(),this.masterCallback&&this.masterCallback(s,r)}}createRef(e){let n=this.callbacks.get(e);return n||(n=s=>{this.handleValue(s,e)},this.callbacks.set(e,n)),n}}class Et extends B{constructor(){super(...arguments),this.elRef=w.createRef()}render(){return d.jsx("div",{ref:this.elRef})}componentDidMount(){this._isUnmounting=!1;const{props:e}=this,n=this.elRef.current;this.disconnectWidth=Zs(n,s=>{this._isUnmounting||L(e.widthRef,s)})}componentWillUnmount(){this._isUnmounting=!0,this.disconnectWidth();const{props:e}=this;e.widthRef&&L(e.widthRef,null)}}function _e(t){return In(t)+":"+t.start+(t.standinFor?":standin":t.isSlice?":slice":"")}function Qt(t,e){const n=[];for(let s=0;s<e;s++)n[s]=[];for(const s of t)n[s.row].push(s);return n}function ni(t,e){const n=[];if(t){for(let s=0;s<e;s++)n[s]={affectedInstances:t.affectedInstances,isEvent:t.isEvent,segs:[]};for(const s of t.segs)n[s.row].segs.push(s)}else for(let s=0;s<e;s++)n[s]=null;return n}function si(t,e){return{...t,start:e,end:e+1,isStart:t.isStart&&t.start===e,isEnd:t.isEnd&&t.end-1===e,standinFor:t}}class Oo extends B{constructor(){super(...arguments),this.buildPublicEvent=k((e,n,s)=>new $(e,n,s)),this.handleEl=e=>{this.el=e,e&&cn(e,this.props.eventRange)}}render(){const{props:e,context:n}=this,{eventRange:s}=e,{options:r}=n,i=s.ui,a=this.buildPublicEvent(n,s.def,s.instance),o={event:a,isNarrow:e.isNarrow||!1,isShort:e.isShort||!1},l={event:a,view:n.viewApi,timeText:"",color:i.color||r.backgroundEventColor,contrastColor:i.contrastColor,isDraggable:!1,isStartResizable:!1,isEndResizable:!1,isMirror:!1,isStart:e.isStart,isEnd:e.isEnd,isFirst:!1,isLast:!1,isPast:e.isPast,isFuture:e.isFuture,isToday:e.isToday,isSelected:!1,isDragging:!1,isResizing:!1,isInteractive:!1,level:0,isNarrow:e.isNarrow||!1,isShort:e.isShort||!1,timeClass:"",titleClass:R(r.backgroundEventTitleClass,o),options:{eventOverlap:!!r.eventOverlap}},c=b(i.className,f.fill,f.internalEvent,f.internalBgEvent,e.isVertical?f.flexCol:f.flexRow),u=b(R(r.backgroundEventInnerClass,l),f.liquid);return d.jsx(q,{tag:"div",className:c,style:{"--fc-event-color":l.color,"--fc-event-contrast-color":l.contrastColor},defaultGenerator:Lp,elRef:this.handleEl,renderProps:l,generatorName:"backgroundEventContent",customGenerator:r.backgroundEventContent,classNameGenerator:r.backgroundEventClass,didMount:r.backgroundEventDidMount,willUnmount:r.backgroundEventWillUnmount,children:h=>d.jsx(h,{tag:"div",className:u})})}componentDidUpdate(e){this.el&&this.props.eventRange!==e.eventRange&&cn(this.el,this.props.eventRange)}}function Lp(t){let{title:e}=t.event;return e&&d.jsx("div",{className:t.titleClass,children:t.event.title})}function Wo(t,e){return d.jsx("div",{className:b(t==="non-business"?e.nonBusinessHoursClass:t==="highlight"?e.highlightClass:void 0,f.fill)})}const Gn=10,Ap=1;class Op extends ye{constructor(){super(...arguments),this.getDateMeta=k(Je),this.closeRef=w.createRef(),this.focusStartRef=w.createRef(),this.focusEndRef=w.createRef(),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,useEventCenter:!1}):this.context.unregisterInteractiveComponent(this)},this.handleDocumentMouseDown=e=>{const n=To(e);this.rootEl.contains(n)||this.handleClose()},this.handleDocumentKeyDown=e=>{e.key==="Escape"&&this.handleClose()},this.handleClose=()=>{let{onClose:e}=this.props;e&&e()}}render(){let{props:e,context:n}=this,{options:s,dateEnv:r,viewApi:i}=n,{startDate:a,todayRange:o,dateProfile:l}=e,c=this.getDateMeta(a,r,l,o),u=r.formatToParts(a,s.popoverFormat),h=ie(u);const g={...c,isMajor:!1,isNarrow:!1,isSticky:!1,inPopover:!0,level:0,hasNavLink:!1,text:h,textParts:u,get weekdayText(){return Ht(u)},get dayNumberText(){return kt(u)},view:i},m={...c,isMajor:!1,isNarrow:!1,inPopover:!0,hasNavLink:!1,get weekdayText(){return Ht(u)},get dayNumberText(){return kt(u)},get monthText(){return Mo(u)},view:i,text:"",textParts:[],options:{businessHours:!!s.businessHours}},v=mt(a),{dayHeaderAlign:p}=s,y=typeof p=="function"?p({level:0,inPopover:!0,isNarrow:!1}):p,D=Nt(e.alignEl);return Rt.createPortal(d.jsxs("div",{"data-date":v,id:e.id,role:"dialog","aria-labelledby":e.titleId,className:b(s.popoverClass,f.flexCol,f.popoverZ,f.abs,f.borderBoxRoot,f.internalPopover),style:{top:0,left:0},dir:D?"rtl":void 0,"data-color-scheme":s.colorScheme||void 0,ref:this.handleRootEl,children:[d.jsx("div",{tabIndex:0,style:{outline:"none"},ref:this.focusStartRef}),d.jsxs("div",{className:b(R(s.dayHeaderClass,g),f.flexCol,f.borderOnlyB,y==="center"?f.alignCenter:y==="end"?f.alignEnd:f.alignStart),children:[d.jsx("div",{children:d.jsx(q,{tag:"div",attrs:{id:e.titleId},generatorName:"dayHeaderContent",renderProps:g,customGenerator:s.dayHeaderContent,defaultGenerator:Wp,classNameGenerator:s.dayHeaderInnerClass,didMount:s.dayHeaderDidMount,willUnmount:s.dayHeaderWillUnmount})}),d.jsx(q,{tag:"button",attrs:{"aria-label":s.closeHint,...Ps(this.handleClose)},elRef:this.closeRef,className:b(s.popoverCloseClass,f.flexRow,f.cursorPointer),renderProps:{},customGenerator:s.popoverCloseContent,generatorName:"popoverCloseContent"})]}),d.jsx("div",{className:b(R(s.dayCellClass,m),f.flexCol,f.borderNone),children:d.jsx("div",{className:R(s.dayCellInnerClass,m),children:e.children})}),d.jsx("div",{tabIndex:0,style:{outline:"none"},ref:this.focusEndRef})]}),xo(e.alignEl))}queryHit(e,n,s,r,i){let{rootEl:a,props:o}=this;return n>=0&&n<r&&s>=0&&s<i?{dateProfile:o.dateProfile,dateSpan:{allDay:!o.forceTimed,range:{start:o.startDate,end:o.endDate},...o.dateSpanProps},getDayEl:()=>a,rect:{left:0,top:0,right:r,bottom:i},layer:1}:null}componentDidMount(){document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown),this.focusStartRef.current.addEventListener("focus",this.handleClose),this.focusEndRef.current.addEventListener("focus",this.handleClose),this.closeRef.current.focus({preventScroll:!0}),this.updateSize()}componentWillUnmount(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown),this.focusStartRef.current.removeEventListener("focus",this.handleClose),this.focusEndRef.current.removeEventListener("focus",this.handleClose)}updateSize(){let{alignEl:e,alignParentTop:n}=this.props,{rootEl:s}=this;const r=Nt(e),i=Np(e);if(i){let a=s.getBoundingClientRect(),o=n?e.closest(n).getBoundingClientRect().top-Ap:i.top,l=r?i.right-a.width:i.left;o=Math.max(o,Gn),l=Math.min(l,document.documentElement.clientWidth-Gn-a.width),l=Math.max(l,Gn);const{offsetParent:c}=s;let u,h;if(!c||c===document.body)u=o+window.scrollY,h=l+window.scrollX;else{const g=c.getBoundingClientRect();u=o-g.top+c.scrollTop,h=l-g.left+c.scrollLeft}Jt(s,{top:u,left:h})}}}function Wp(t){return t.text}function Bp(t,e){return t.end>e.start&&t.start<e.end}function ri(t,e){const n=Math.max(t.start,e.start),s=Math.min(t.end,e.end);if(n<s)return{start:n,end:s,isStart:t.isStart&&n===t.start,isEnd:t.isEnd&&s===t.end}}function _p(t,e){return{start:Math.min(t.start,e.start),end:Math.max(t.end,e.end)}}function ds(t){return t.end}function Bo(t){return t.reduce(Fp).eventRange.range.start}function Up(t){return t.reduce(Vp).eventRange.range.end}function Fp(t,e){return t.eventRange.range.start<e.eventRange.range.start?t:e}function Vp(t,e){return t.eventRange.range.end>e.eventRange.range.end?t:e}class _o extends B{constructor(){super(...arguments),this.state={isPopoverOpen:!1},this.handleLinkEl=e=>{this.linkEl=e,this.props.elRef&&L(this.props.elRef,e)},this.handleClick=e=>{let{props:n,context:s}=this,{dateEnv:r,options:i}=s,{moreLinkClick:a}=i,o=ii(n).start;function l(c){let{def:u,instance:h,range:g}=c.eventRange;return{event:new $(s,u,h),start:r.toDate(g.start),end:r.toDate(g.end),isStart:c.isStart,isEnd:c.isEnd}}typeof a=="function"&&(a=a({date:r.toDate(o),allDay:!!n.allDayDate,allSegs:n.segs.map(l),hiddenSegs:n.hiddenSegs.map(l),jsEvent:e,view:s.viewApi})),!a||a==="popover"?this.setState({isPopoverOpen:!0}):typeof a=="string"&&s.calendarApi.zoomTo(o,a)},this.handlePopoverClose=()=>{this.linkEl&&this.linkEl.focus(),this.setState({isPopoverOpen:!1})}}render(){let{props:e,state:n}=this;return d.jsx(Me.Consumer,{children:s=>{let{viewApi:r,options:i,calendarApi:a,baseId:o}=s,{moreLinkText:l}=i,c=e.hiddenSegs.length,u=ii(e),h=o+"popover-"+u.start.toISOString(),g=`+${c}`,m=typeof l=="function"?l.call(a,c):`${g} ${l}`,v=ue(i.moreLinkHint,[c],m),p={num:c,numericText:g,longText:m,text:e.isMicro||e.display==="column"?g:m,isNarrow:e.isNarrow,view:r};return d.jsxs(d.Fragment,{children:[!!c&&d.jsx(q,{tag:"div",elRef:this.handleLinkEl,className:b(R(e.display==="row"?i.rowMoreLinkClass:i.columnMoreLinkClass,p),e.className,e.display==="row"?f.flexRow:f.flexCol,f.internalMoreLink,f.cursorPointer),style:e.style,attrs:{...e.attrs,...Ps(this.handleClick),title:v,role:"button","aria-haspopup":"dialog","aria-expanded":n.isPopoverOpen,"aria-controls":n.isPopoverOpen?h:void 0},renderProps:p,generatorName:"moreLinkContent",customGenerator:i.moreLinkContent,defaultGenerator:zp,classNameGenerator:i.moreLinkClass,didMount:i.moreLinkDidMount,willUnmount:i.moreLinkWillUnmount,children:y=>d.jsx(y,{tag:"div",className:b(R(i.moreLinkInnerClass,p),R(e.display==="row"?i.rowMoreLinkInnerClass:i.columnMoreLinkInnerClass,p),e.display==="row"?f.stickyS:f.stickyT)})}),n.isPopoverOpen&&d.jsx(Op,{id:h,titleId:h+"-title",startDate:u.start,endDate:u.end,dateProfile:e.dateProfile,todayRange:e.todayRange,dateSpanProps:e.dateSpanProps,alignEl:e.alignElRef?e.alignElRef.current:this.linkEl,alignParentTop:e.alignParentTop,forceTimed:e.forceTimed,onClose:this.handlePopoverClose,children:e.popoverContent()})]})}})}}function zp(t){return t.text}function ii(t){return t.allDayDate?{start:t.allDayDate,end:te(t.allDayDate,1)}:{start:Bo(t.hiddenSegs),end:Up(t.hiddenSegs)}}const Uo=V({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"});function Fo(t){let{display:e}=t.eventRange.ui;return e==="list-item"||e==="auto"&&!t.eventRange.def.allDay&&t.end-t.start===1&&t.isStart&&t.isEnd}class Gp extends B{render(){let{props:e}=this;return d.jsx(_o,{display:"row",className:e.className,isNarrow:e.isNarrow,isMicro:e.isMicro,dateProfile:e.dateProfile,todayRange:e.todayRange,allDayDate:e.allDayDate,segs:e.segs,hiddenSegs:e.hiddenSegs,alignElRef:e.alignElRef,alignParentTop:e.alignParentTop,dateSpanProps:e.dateSpanProps,popoverContent:()=>d.jsx(d.Fragment,{children:e.segs.map(n=>{let{eventRange:s}=n,{instanceId:r}=s.instance,i=!!(e.eventDrag&&e.eventDrag.affectedInstances[r]),a=!!(e.eventResize&&e.eventResize.affectedInstances[r]),o=i||a;return d.jsx("div",{style:{visibility:o?"hidden":void 0},children:d.jsx(Ot,{display:Fo(n)?"list-item":"row",eventRange:s,isStart:n.isStart,isEnd:n.isEnd,isDragging:i,isResizing:a,isMirror:!1,isSelected:r===e.eventSelection,defaultTimeFormat:Uo,defaultDisplayEventEnd:!1,...$e(s,e.todayRange)})},r)})})})}}class Yp extends ye{constructor(){super(...arguments),this.getDateMeta=k(Je),this.refineRenderProps=Ct(Zp),this.rootElRef=w.createRef(),this.handleBodyEl=e=>{this.disconnectBodyHeight&&(this.disconnectBodyHeight(),this.disconnectBodyHeight=void 0,L(this.props.headerHeightRef,null),L(this.props.mainHeightRef,null)),e&&(this.disconnectBodyHeight=St(e,(n,s)=>{if(this._isUnmounting)return;const{props:r}=this,i=e.getBoundingClientRect(),a=this.rootElRef.current.getBoundingClientRect(),o=i.top-a.top;as(this.headerHeight,o)||(this.headerHeight=o,L(r.headerHeightRef,o)),r.fgLiquidHeight&&L(r.mainHeightRef,s)}))}}render(){let{props:e,context:n}=this,{options:s,dateEnv:r}=n;const i=e.showDayNumber&&$p(e.date,e.dateProfile.currentRange,r),a=this.getDateMeta(e.date,r,e.dateProfile,e.todayRange),o=b(e.borderStart?f.borderOnlyS:f.borderNone,e.width!=null?"":f.liquid,f.flexCol,f.noMargin,f.noPadding),l=s.navLinks,c=this.refineRenderProps({date:e.date,isMajor:e.isMajor,isNarrow:e.isNarrow,dateMeta:a,hasLabel:e.showDayNumber,hasMonthLabel:i,hasNavLink:l,renderProps:e.renderProps,viewApi:n.viewApi,dateEnv:n.dateEnv,monthStartFormat:s.monthStartFormat,dayCellFormat:s.dayCellFormat,businessHours:!!s.businessHours});if(a.isDisabled)return d.jsx("div",{role:"gridcell","aria-disabled":!0,className:b(R(s.dayCellClass,c),e.className,o),style:{width:e.width}});const u=vt(n,e.date);return d.jsx(q,{tag:"div",elRef:this.rootElRef,className:b(e.className,o),attrs:{...e.attrs,role:"gridcell","aria-label":u,...c.isToday?{"aria-current":"date"}:{},"data-date":mt(e.date)},style:{width:e.width},renderProps:c,generatorName:"dayCellTopContent",customGenerator:s.dayCellTopContent,defaultGenerator:qp,classNameGenerator:s.dayCellClass,didMount:s.dayCellDidMount,willUnmount:s.dayCellWillUnmount,children:h=>d.jsxs(d.Fragment,{children:[d.jsx("div",{className:b(f.rel,R(s.dayCellTopClass,c)),children:e.showDayNumber&&d.jsx(h,{tag:"div",attrs:l?yt(n,e.date,void 0,u):{"aria-hidden":!0},className:R(s.dayCellTopInnerClass,c)})}),d.jsxs("div",{className:b(f.flexCol,e.fgLiquidHeight?f.liquid:f.grow),ref:this.handleBodyEl,children:[d.jsx("div",{className:R(s.dayCellInnerClass,c),style:{minHeight:e.fgHeight},children:e.fg}),d.jsx(Gp,{className:f.rel,allDayDate:e.date,segs:e.segs,hiddenSegs:e.hiddenSegs,alignElRef:this.rootElRef,alignParentTop:e.showDayNumber?"[role=row]":`.${f.internalView}`,dateSpanProps:e.dateSpanProps,dateProfile:e.dateProfile,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,todayRange:e.todayRange,isNarrow:e.isNarrow,isMicro:e.isMicro})]}),d.jsx("div",{className:b(f.rel,R(s.dayCellBottomClass,c))})]})})}componentDidMount(){this._isUnmounting=!1}componentWillUnmount(){this._isUnmounting=!0}}function qp(t){return t.text||d.jsx(d.Fragment,{children:" "})}function $p(t,e,n){const{start:s,end:r}=e,i=Ge(r,-1),a=n.getYear(s),o=n.getMonth(s),l=n.getYear(i),c=n.getMonth(i);return!(a===l&&o===c)&&(t.valueOf()===s.valueOf()||n.getDay(t)===1&&t.valueOf()<r.valueOf())}function Zp(t){let{date:e,dateEnv:n,hasLabel:s,hasMonthLabel:r,hasNavLink:i,businessHours:a}=t,o=[],l="";return s&&(o=n.formatToParts(e,r?t.monthStartFormat:t.dayCellFormat),l=ie(o)),{...t.dateMeta,...t.renderProps,text:l,textParts:o,isMajor:t.isMajor,isNarrow:t.isNarrow,inPopover:!1,hasNavLink:i,get weekdayText(){return Ht(o)},get dayNumberText(){return kt(o)},get monthText(){return Mo(o)},options:{businessHours:a},view:t.viewApi}}class us{constructor(e,n=l=>1,s=!1,r,i,a=!1,o=!1){this.getSegThickness=n,this.strictOrder=s,this.maxCoord=r,this.maxDepth=i,this.hiddenConsumes=a,this.allowSlicing=o,this.placementsByLevel=[],this.levelCoords=[],this.hiddenSegs=[];for(const l of e)this.insertSeg(l,this.getSegThickness(l))}insertSeg(e,n,s){if(n!=null){const r=this.findInsertion(e,n);if(this.isInsertionValid(r,n))this.insertSegAt(e,r,n,s);else{const{touchingPlacement:i}=r;if(i){if(this.hiddenConsumes&&!i.isZombie&&(i.isZombie=!0,this.hiddenSegs.push(i),this.allowSlicing)){const a=Object.assign({},i);Object.assign(i,ri(i,e)),i.isSlice=!0,this.splitSeg(a,i.thickness,i)}this.allowSlicing?(this.hiddenSegs.push({...e,...ri(e,i)}),this.splitSeg(e,n,i)):this.hiddenSegs.push(e)}else this.hiddenSegs.push(e)}}}isInsertionValid(e,n){return(this.maxCoord==null||e.levelCoord+n<=this.maxCoord)&&(this.maxDepth==null||e.depth<this.maxDepth)}splitSeg(e,n,s){e.start<s.start&&this.insertSeg({...e,end:s.start,isEnd:!1},n,!0),e.end>s.end&&this.insertSeg({...e,start:s.end,isStart:!1},n,!0)}insertSegAt(e,n,s,r){const i={...e,thickness:s,depth:n.depth,isSlice:r||e.isSlice||!1,isZombie:!1};n.lateralIndex===-1?(Yn(this.placementsByLevel,n.levelIndex,[i]),Yn(this.levelCoords,n.levelIndex,n.levelCoord)):Yn(this.placementsByLevel[n.levelIndex],n.lateralIndex,i)}findInsertion(e,n){let{placementsByLevel:s,levelCoords:r}=this,i=s.length,a=0,o,l,c=0;for(let g=0;g<i;g+=1){const m=r[g];if(!this.strictOrder&&m>=a+n)break;let v=s[g],p,[y,D]=hs(v,e.start,ds),x=y+D;for(;(p=v[x])&&p.start<e.end;){let C=m+p.thickness;C>a&&(a=C,o=p,l=g),C===a&&(c=Math.max(c,p.depth+1)),x+=1}}let u=0;if(o)for(u=l+1;u<i&&r[u]<a;)u+=1;let h=-1;return u<i&&r[u]===a&&([h]=hs(s[u],e.end,ds)),{touchingPlacement:o,levelCoord:a,levelIndex:u,lateralIndex:h,depth:c}}traverseSegs(e){const{placementsByLevel:n,levelCoords:s}=this;for(let r=0;r<n.length;r++){const i=n[r],a=s[r];for(const o of i)o.isZombie||e(o,a)}}}function Xp(t){let e=[];for(let n of t){let s=[],r={segs:[n],start:n.start,end:n.end};for(let i of e)Bp(i,r)?r={..._p(i,r),segs:i.segs.concat(r.segs)}:s.push(i);s.push(r),e=s}return e.map(n=>({key:_a(Bo(n.segs)),...n}))}function Yn(t,e,n){t.splice(e,0,n)}function hs(t,e,n){let s=0,r=t.length;if(!r||e<n(t[s]))return[0,0];if(e>n(t[r-1]))return[r,0];for(;s<r;){let i=Math.floor(s+(r-s)/2),a=n(t[i]);if(e<a)r=i;else if(e>a)s=i+1;else return[i,1]}return[s,0]}function Kp(t,e,n,s,r,i=!0,a,o){let l,c,u;a===!0||o===!0?(l=s,u=!0):typeof a=="number"?(c=a,u=!1):typeof o=="number"&&(c=o,u=!0);const h=new Map,g=new Map,m=new Map,v=new Map;let p=new us(t,E=>e.get(_e(E)),r,l,c,u,i);p.traverseSegs((E,T)=>{qn(h,E),m.set(_e(E),T),E.isSlice&&v.set(E.eventRange,!0)});for(const E of p.hiddenSegs)qn(g,E);if(v.size){m.clear(),p=new us(Jp(t,h),E=>e.get(_e(E)),r,l,c,u),p.traverseSegs((E,T)=>{m.set(_e(E),T)});for(const E of p.hiddenSegs)qn(g,E)}const y=[],D=[],x=[],C=[];for(let E=0;E<n.length;E++)y.push([]),D.push([]),x.push([]),C.push(0);for(const E of t){const{eventRange:T}=E,N=h.get(T)||[],I=g.get(T)||[],P=v.get(T)||!1;if(x[E.start].push(E),P)for(const H of N)x[H.start].push(H);for(const H of N){for(let U=H.start;U<H.end;U++){const F=si(H,U);y[U].push(F)}const j=_e(H),G=m.get(j);if(G!=null){const U=e.get(j);for(let F=H.start;F<H.end;F++)C[F]=Math.max(C[F],G+U)}}for(const H of I)for(let j=H.start;j<H.end;j++){const G=si(H,j);y[j].push(G),D[j].push(G)}}return[y,D,x,m,C]}function qn(t,e){let n=t.get(e.eventRange);n||t.set(e.eventRange,n=[]),n.push(e)}function Jp(t,e){const n=[];for(const s of t)n.push(...e.get(s.eventRange)||[]);return n}class Vo{constructor(e,n){let s=e.start,{end:r}=e,i=[],a=[],o=-1;for(;s<r;)n.isHiddenDay(s)?i.push(o+.5):(o+=1,i.push(o),a.push(s)),s=te(s,1);this.dates=a,this.indices=i,this.cnt=a.length}sliceRange(e){let n=this.getDateDayIndex(e.start),s=this.getDateDayIndex(te(e.end,-1)),r=Math.max(0,n),i=Math.min(this.cnt-1,s);return r=Math.ceil(r),i=Math.floor(i),r<=i?{start:r,end:i+1,isStart:n===r,isEnd:s===i}:null}getDateDayIndex(e){let{indices:n}=this,s=Math.floor(Xe(this.dates[0],e));return s<0?n[0]-1:s>=n.length?n[n.length-1]+1:n[s]}}class zo{constructor(e,n,s,r=""){this.dateEnv=s,this.majorUnit=r;let{dates:i}=e,a,o,l;if(n){for(o=i[0].getUTCDay(),a=1;a<i.length&&i[a].getUTCDay()!==o;a+=1);l=Math.ceil(i.length/a)}else l=1,a=i.length;this.rowCount=l,this.colCount=a,this.daySeries=e,this.cellRows=this.buildCells(),this.headerDates=this.buildHeaderDates()}buildCells(){let e=[];for(let n=0;n<this.rowCount;n+=1){let s=[];for(let r=0;r<this.colCount;r+=1)s.push(this.buildCell(n,r));e.push(s)}return e}buildCell(e,n){let s=this.daySeries.dates[e*this.colCount+n];return{key:s.toISOString(),date:s,isMajor:this.cellIsMajor(s)}}cellIsMajor(e){return this.majorUnit?wo(e,this.majorUnit,this.dateEnv):!1}buildHeaderDates(){let e=[];for(let n=0;n<this.colCount;n+=1)e.push(this.cellRows[0][n].date);return e}sliceRange(e){let{colCount:n}=this,s=this.daySeries.sliceRange(e),r=[];if(s){const{start:i,end:a}=s;let o=i;for(;o<a;){let l=Math.floor(o/n),c=Math.min((l+1)*n,a);r.push({row:l,start:o%n,end:(c-1)%n+1,isStart:s.isStart&&o===i,isEnd:s.isEnd&&c===a}),o=c}}return r}}function Go(t,e,n){const s=new Vo(t.renderRange,e),r=/year|month|week/.test(t.currentRangeUnit),i=!r&&Do(t,n);return new zo(s,r,n,i!=="day"?i:void 0)}function Yo(t,e,n){return n==null?[void 0,void 0]:n/t<e?[e*t,e]:[n,void 0]}function Qp(t,e,n){let s=0;for(const r of e){const i=r[0].key,a=r[0].date,o=r[r.length-1].date;if(t>=a&&t<=o)return s;const l=n.get(i);if(l==null)return;s+=l}return s}function ai(t,e,n){let s,r;if(e!=null)s=t.start*e,r=(n-t.end)*e;else{const i=1/n;s=Mt(t.start*i),r=Mt(1-t.end*i)}return{insetInlineStart:s,insetInlineEnd:r}}function Js(t,e,n,s,r){const i=n??e/s,a=Math.floor(t/i),o=r?s-a-1:a,l=a*i,c=l+i;return{col:o,left:l,right:c}}function ev(t,e,n){let s=0,r=0,i=0;for(const a of e){const o=a[0].key;if(r=i,i=r+n.get(o),t<i)break;s++}return{row:s,top:r,bottom:i}}function tv(t,e){return t.querySelectorAll("[role=row]")[e]}function Qs(t,e){return t.querySelectorAll("[role=gridcell]")[e]}const Wt=60,nv=V({weekday:"narrow"});function er(t,e,n){return t||sv(e,n)}function sv(t,e){return t?e>1?V({weekday:"short",weekdayJustify:"start",day:"numeric",omitCommas:!0,omitTrailing:!0}):V({weekday:"long",weekdayJustify:"start",day:"numeric",omitCommas:!0,omitTrailing:!0}):V({weekday:"short"})}class rv extends w.Component{constructor(){super(...arguments),this.rootElRef=w.createRef()}render(){const{props:e}=this;return d.jsx("div",{className:b(e.className,f.abs),style:e.style,ref:this.rootElRef,children:e.children})}componentDidMount(){this._isUnmounting=!1;const e=this.rootElRef.current;this.disconnectHeight=dt(e,n=>{this._isUnmounting||L(this.props.heightRef,n)})}componentWillUnmount(){this._isUnmounting=!0,this.disconnectHeight(),L(this.props.heightRef,null)}}const iv=V({week:"narrow"});class qo extends B{constructor(){super(...arguments),this.headerHeightRefMap=new le(()=>{re(this.handleSegPositioning)}),this.mainHeightRefMap=new le(()=>{(this.props.dayMaxEvents===!0||this.props.dayMaxEventRows===!0)&&re(this.handleSegPositioning)}),this.segHeightRefMap=new le(()=>{re(this.handleSegPositioning)}),this.buildWeekNumberRenderProps=k(av),this.handleRootEl=e=>{this.rootEl=e,L(this.props.rootElRef,e)},this.handleSegPositioning=()=>{this._isUnmounting||this.forceUpdate()}}render(){const{props:e,context:n,headerHeightRefMap:s,mainHeightRefMap:r}=this,{cells:i}=e,{options:a}=n,o=e.cells[0].date,l=e.dayMaxEvents===!0||e.dayMaxEventRows===!0,c=zs(e.fgEventSegs,a.eventOrder),[u,h]=this.computeFgDims(),[g,m,v,p,y]=Kp(c,this.segHeightRefMap.current,i,l?h:void 0,a.eventOrderStrict,a.eventSlicing,e.dayMaxEvents,e.dayMaxEventRows),D=[];if(u!=null){let I=0;for(const P of i){const H=s.current.get(P.key);if(H!=null){const j=u-H;D.push(y[I]+j)}else D.push(void 0);I++}}const x=this.getHighlightSegs(),C=this.getMirrorSegs(),E=a.navLinks,T=vt(n,o,"week"),N=this.buildWeekNumberRenderProps(o,n,e.cellIsNarrow,E);return d.jsxs("div",{role:e.role,"aria-label":e.role==="row"?T:void 0,className:b(a.dayRowClass,e.className,f.flexRow,f.rel,f.isolate,e.forPrint&&e.basis!==void 0&&f.printSiblingRow),style:{flexBasis:e.basis},ref:this.handleRootEl,children:[e.showWeekNumbers&&!e.cellIsMicro&&d.jsx(q,{tag:"div",attrs:{...E?yt(n,o,"week",T,!1):{},role:void 0,"aria-hidden":!0},className:f.z1,renderProps:N,generatorName:"inlineWeekNumberContent",customGenerator:a.inlineWeekNumberContent,defaultGenerator:Nn,classNameGenerator:a.inlineWeekNumberClass,didMount:a.inlineWeekNumberDidMount,willUnmount:a.inlineWeekNumberWillUnmount}),this.renderFillSegs(e.businessHourSegs,"non-business"),this.renderFillSegs(e.bgEventSegs,"bg-event"),this.renderFillSegs(x,"highlight"),e.cells.map((I,P)=>{const H=this.renderFgSegs(u,v[P],p,e.todayRange,!1);return d.jsx(Yp,{dateProfile:e.dateProfile,todayRange:e.todayRange,date:I.date,isMajor:I.isMajor,showDayNumber:e.showDayNumbers,isNarrow:e.cellIsNarrow,isMicro:e.cellIsMicro,borderStart:!!P,segs:g[P],hiddenSegs:m[P],fgLiquidHeight:l,fg:d.jsx(d.Fragment,{children:H}),eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,renderProps:I.renderProps,dateSpanProps:I.dateSpanProps,attrs:I.attrs,className:I.className,fgHeight:D[P],width:e.colWidth,headerHeightRef:s.createRef(I.key),mainHeightRef:r.createRef(I.key)},I.key)}),this.renderFgSegs(u,C,p,e.todayRange,!0)]})}renderFgSegs(e,n,s,r,i){const{props:a,segHeightRefMap:o}=this,{colWidth:l,eventSelection:c,cellIsMicro:u}=a,h=a.cells.length,g=a.cells.length===1,m=[];for(const v of n){const p=_e(v),{standinFor:y,eventRange:D}=v,{instanceId:x}=D.instance;if(y)continue;const{insetInlineStart:C,insetInlineEnd:E}=ai(v,l,h),T=s.get(y?_e(y):p)??(i?0:void 0),N=e!=null&&T!=null?e+T:void 0,I=!!(a.eventDrag&&a.eventDrag.affectedInstances[x]),P=!!(a.eventResize&&a.eventResize.affectedInstances[x]),H=!i&&(I||P||y||N==null),j=Fo(v),G=x===c;m.push(d.jsx(rv,{className:v.start?f.fakeBorderS:"",style:{visibility:H?"hidden":void 0,top:N,insetInlineStart:C,insetInlineEnd:E,zIndex:G?1e3:0},heightRef:!y&&!i?o.createRef(p):null,children:d.jsx(Ot,{display:j?"list-item":"row",eventRange:D,isStart:v.isStart,isEnd:v.isEnd,isDragging:I,isResizing:P,isMirror:i,isSelected:G,isNarrow:a.cellIsNarrow,defaultTimeFormat:Uo,defaultDisplayEventEnd:g,disableResizing:j,forcedTimeText:u?"":void 0,...$e(D,r)})},p))}return m}renderFillSegs(e,n){const{props:s,context:r}=this,{todayRange:i,colWidth:a}=s,o=s.cells.length,l=[];for(const c of e){const u=c.start+":"+c.end,{insetInlineStart:h,insetInlineEnd:g}=ai(c,a,o),m=!c.standinFor;l.push(d.jsx("div",{className:f.fillY,style:{visibility:m?"":"hidden",insetInlineStart:h,insetInlineEnd:g},children:n==="bg-event"?d.jsx(Oo,{eventRange:c.eventRange,isStart:c.isStart,isEnd:c.isEnd,isNarrow:s.cellIsNarrow,isVertical:!1,...$e(c.eventRange,i)}):Wo(n,r.options)},u))}return d.jsx(d.Fragment,{children:l})}componentDidMount(){this._isUnmounting=!1;const{rootEl:e}=this;this.disconnectHeight=dt(e,n=>{L(this.props.heightRef,n)})}componentWillUnmount(){this._isUnmounting=!0,this.disconnectHeight(),L(this.props.heightRef,null)}computeFgDims(){const{cells:e}=this.props,n=this.headerHeightRefMap.current,s=this.mainHeightRefMap.current;let r,i;for(const a of e){const o=n.get(a.key),l=s.get(a.key);if(o!=null&&((r===void 0||o>r)&&(r=o),l!=null)){const c=o+l;(i===void 0||c<i)&&(i=c)}}return[r,i!=null&&r!=null?i-r:void 0]}getMirrorSegs(){let{props:e}=this;return e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:[]}getHighlightSegs(){let{props:e}=this;return e.eventDrag&&e.eventDrag.segs.length?e.eventDrag.segs:e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:e.dateSelectionSegs}}function av(t,e,n,s){const{dateEnv:r,options:i}=e,a=r.computeWeekNumber(t),o=r.formatToParts(t,i.weekNumberFormat||iv),l=ie(o),c=r.toDate(t);return{num:a,text:l,textParts:o,date:c,isNarrow:n,hasNavLink:s}}class tr extends ye{constructor(){super(...arguments),this.splitBusinessHourSegs=k(Qt),this.splitBgEventSegs=k(lv),this.splitFgEventSegs=k(Qt),this.splitDateSelectionSegs=k(Qt),this.splitEventDrag=k(ni),this.splitEventResize=k(ni),this.rowHeightRefMap=new le((e,n)=>{const{rowHeightRefMap:s}=this.props;s&&s.handleValue(e,n)}),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,isHitComboAllowed:this.props.isHitComboAllowed}):this.context.unregisterInteractiveComponent(this)}}render(){let{props:e,context:n,rowHeightRefMap:s}=this,{options:r}=n,{cellRows:i}=e,a=i.length,o=i[0]?.[0]?.key||"",l=this.splitFgEventSegs(e.fgEventSegs,a),c=this.splitBgEventSegs(e.bgEventSegs,a),u=this.splitBusinessHourSegs(e.businessHourSegs,a),h=this.splitDateSelectionSegs(e.dateSelectionSegs,a),g=this.splitEventDrag(e.eventDrag,a),m=this.splitEventResize(e.eventResize,a),v=fe(r),p=!e.forPrint&&!v,y=cv(e.visibleWidth,a,v,r);return d.jsx("div",{role:"rowgroup",className:b(e.className,!e.forPrint&&f.flexCol),style:{width:e.width},ref:this.handleRootEl,children:i.map((D,x)=>d.jsx(qo,{role:"row",dateProfile:e.dateProfile,todayRange:e.todayRange,cells:D,cellIsNarrow:e.cellIsNarrow,cellIsMicro:e.cellIsMicro,showDayNumbers:a>1,showWeekNumbers:a>1&&r.weekNumbers,forPrint:e.forPrint,className:b(p&&f.grow,a>1&&f.breakInsideAvoid,x<a-1?f.borderOnlyB:f.borderNone),fgEventSegs:l[x],bgEventSegs:c[x],businessHourSegs:u[x],dateSelectionSegs:h[x],eventSelection:e.eventSelection,eventDrag:g[x],eventResize:m[x],dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,colWidth:e.colWidth,basis:y,heightRef:s.createRef(D[0].key)},o+":"+D[0].key))})}queryHit(e,n,s,r){const{props:i}=this,a=i.cellRows[0].length,{col:o,left:l,right:c}=Js(n,r,i.colWidth,a,e),{row:u,top:h,bottom:g}=ev(s,i.cellRows,this.rowHeightRefMap.current),m=i.cellRows[u][o],v=m.date,p=te(v,1);return{dateProfile:i.dateProfile,dateSpan:{range:{start:v,end:p},allDay:!0,...m.dateSpanProps},getDayEl:()=>Qs(tv(this.rootEl,u),o),rect:{left:l,right:c,top:h,bottom:g},layer:0}}}function ov(t){return t.eventRange.def.allDay}function lv(t,e){return Qt(t.filter(ov),e)}function cv(t,e,n,s){if(t!=null){const r=t/s.aspectRatio/6;return e>6||n?r:0}return 0}class dv extends B{constructor(){super(...arguments),this.state={},this.buildDayHeaderText=k(uv),this.handleInnerEl=e=>{this.disconnectSize&&(this.disconnectSize(),this.disconnectSize=void 0),e?this.disconnectSize=St(e,(n,s)=>{this._isUnmounting||(L(this.props.innerHeightRef,s),this.setState({innerWidth:n}))}):L(this.props.innerHeightRef,null)}}render(){const{props:e,state:n,context:s}=this,{renderConfig:r,dataConfig:i}=e,a=e.colWidth!=null?e.colWidth*(i.colSpan||1):void 0,o=i.renderProps.isDisabled,l=r.dayHeaderFormat?this.buildDayHeaderRenderProps(i.renderProps,e.cellIsNarrow,e.rowLevel,e.cellIsMicro,i.dateMarker,r.dayHeaderFormat,!!r.datesRepDistinctDays,s.dateEnv):{...i.renderProps,isNarrow:e.cellIsNarrow,level:e.rowLevel},c=r.align,u=typeof c=="function"?c({level:e.rowLevel,inPopover:i.renderProps.inPopover,isNarrow:e.cellIsNarrow}):c,h=r.sticky,g=e.rowLevel>0&&h!==!1&&(u!=="center"||a!=null&&e.viewportWidth!=null&&a>e.viewportWidth*.75);let m;return g&&(u==="center"?n.innerWidth!=null&&(m=`calc(50% - ${n.innerWidth/2}px)`):m=typeof h=="number"||typeof h=="string"?h:0),d.jsx(q,{tag:"div",attrs:{role:"columnheader","aria-colspan":i.colSpan,...i.attrs},className:b(i.className,f.noMargin,f.noPadding,f.flexCol,e.borderStart?f.borderOnlyS:f.borderNone,u==="center"?f.alignCenter:u==="end"?f.alignEnd:f.alignStart,e.colWidth==null&&f.liquid,!g&&f.crop),style:{width:a},renderProps:l,generatorName:r.generatorName,customGenerator:r.customGenerator,defaultGenerator:Nn,classNameGenerator:o?void 0:r.classNameGenerator,didMount:r.didMount,willUnmount:r.willUnmount,children:v=>d.jsx("div",{ref:this.handleInnerEl,className:b(f.flexCol,f.noShrink,f.whiteSpaceNoWrap,g&&f.sticky),style:{left:m,right:m},children:d.jsx(v,{tag:"div",attrs:i.innerAttrs,className:R(r.innerClassNameGenerator,l)})})})}componentDidMount(){this._isUnmounting=!1}componentWillUnmount(){this._isUnmounting=!0}buildDayHeaderRenderProps(e,n,s,r,i,a,o,l){const c=this.buildDayHeaderText(o?i:e.date,a,o,l),u=r?this.buildDayHeaderText(i,nv,!1,l):c;return{...e,isNarrow:n,level:s,text:u.text,textParts:u.textParts,weekdayText:r?u.text:c.weekdayText,dayNumberText:c.dayNumberText}}}function uv(t,e,n,s){const r=s.formatToParts(t,e);return{text:ie(r),textParts:r,weekdayText:Ht(r),dayNumberText:n?kt(r):""}}class Pn extends B{constructor(){super(...arguments),this.innerHeightRefMap=new le(()=>{re(this.handleInnerHeights)}),this.handleInnerHeights=()=>{if(this._isUnmounting)return;const e=this.innerHeightRefMap.current;let n=0;for(const s of e.values())n=Math.max(n,s);this.currentInnerHeight!==n&&(this.currentInnerHeight=n,L(this.props.innerHeightRef,n))}}render(){const{props:e,context:n}=this,{options:s}=n;return d.jsx("div",{role:e.role,"aria-rowindex":e.rowIndex!=null?1+e.rowIndex:void 0,className:b(s.dayHeaderRowClass,e.className,f.flexRow,f.contentBox,e.borderBottom?f.borderOnlyB:f.borderNone),style:{height:e.height},children:e.dataConfigs.map((r,i)=>d.jsx(dv,{renderConfig:e.renderConfig,dataConfig:r,borderStart:!!i,colWidth:e.colWidth,viewportWidth:e.viewportWidth,innerHeightRef:this.innerHeightRefMap.createRef(r.key),cellIsNarrow:e.cellIsNarrow,cellIsMicro:e.cellIsMicro,rowLevel:e.rowLevel},r.key))})}componentDidMount(){this._isUnmounting=!1}componentWillUnmount(){this._isUnmounting=!0,this.currentInnerHeight=void 0,L(this.props.innerHeightRef,null)}}class $o extends B{render(){const{props:e}=this,{headerTiers:n}=e;return d.jsx("div",{role:"rowgroup",className:b(e.className,f.flexCol,e.width==null&&f.liquid),style:{width:e.width},children:n.map((s,r)=>w.createElement(Pn,{...s,key:r,role:"row",borderBottom:r<n.length-1,colWidth:e.colWidth,viewportWidth:e.viewportWidth,cellIsNarrow:e.cellIsNarrow,cellIsMicro:e.cellIsMicro,rowLevel:n.length-r-1}))})}}class hv extends B{constructor(){super(...arguments),this.state={},this.handleScroller=e=>{L(this.props.scrollerRef,e)},this.handleTotalWidth=e=>{this._isUnmounting||this.setState({totalWidth:e})},this.handleClientWidth=e=>{this._isUnmounting||this.setState({clientWidth:e})}}render(){const{props:e,state:n,context:s}=this,{options:r}=s,{borderlessX:i,borderlessTop:a,borderlessBottom:o}=ve(r),{totalWidth:l,clientWidth:c}=n;let u=l!=null&&c!=null?l-c:void 0;u<3&&(u=0);const h=!e.forPrint&&!fe(r),g=!e.forPrint&&Hn(r),m=e.cellRows[0].length,v=c!=null?c/m:void 0,p=v!=null&&v<=Wt,y=p||v!=null&&v<=r.dayNarrowWidth;return d.jsxs(d.Fragment,{children:[r.dayHeaders&&d.jsxs("div",{className:b(R(r.tableHeaderClass,{isSticky:g,borderlessX:i,borderlessTop:a,borderlessBottom:o,multiMonthColumns:0}),f.printHeader,g&&f.tableHeaderSticky),children:[d.jsxs("div",{className:f.flexRow,children:[d.jsx($o,{headerTiers:e.headerTiers,cellIsNarrow:y,cellIsMicro:p}),!!u&&d.jsx("div",{className:b(R(r.fillerClass,{inTableHeader:!0}),f.borderOnlyS),style:{minWidth:u}})]}),d.jsx("div",{className:R(r.dayHeaderDividerClass,{isSticky:g,multiMonthColumns:0,options:{allDaySlot:!!r.allDaySlot}})})]}),d.jsx(pe,{vertical:h,className:b(R(r.tableBodyClass,{borderlessX:i,borderlessTop:a,borderlessBottom:o,multiMonthColumns:0}),!e.forPrint&&f.flexCol,h&&f.liquid),ref:this.handleScroller,clientWidthRef:this.handleClientWidth,children:d.jsx(tr,{dateProfile:e.dateProfile,todayRange:e.todayRange,cellRows:e.cellRows,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed,className:f.grow,dayMaxEvents:e.forPrint?void 0:r.dayMaxEvents,dayMaxEventRows:r.dayMaxEventRows,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:e.businessHourSegs,dateSelectionSegs:e.dateSelectionSegs,eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,visibleWidth:l,cellIsNarrow:y,cellIsMicro:p,rowHeightRefMap:e.rowHeightRefMap})}),d.jsx(Et,{widthRef:this.handleTotalWidth})]})}componentDidMount(){this._isUnmounting=!1}componentWillUnmount(){this._isUnmounting=!0}}class Zo extends B{constructor(){super(...arguments),this.rootElRef=w.createRef()}render(){const{props:e}=this;return d.jsx("div",{ref:this.rootElRef,className:b(f.footerScrollbar,e.isSticky&&f.footerScrollbarSticky),children:d.jsx(pe,{horizontal:!0,ref:e.scrollerRef,children:d.jsx("div",{style:{minWidth:e.canvasWidth}})})})}componentDidMount(){this._isUnmounting=!1,this.disconnectHeight=dt(this.rootElRef.current,e=>{this._isUnmounting||L(this.props.scrollbarWidthRef,e)})}componentWillUnmount(){this._isUnmounting=!0,this.disconnectHeight(),L(this.props.scrollbarWidthRef,null)}}class fv extends B{constructor(){super(...arguments),this.state={},this.headerScrollerRef=w.createRef(),this.bodyScrollerRef=w.createRef(),this.footerScrollerRef=w.createRef(),this.handleTotalWidth=e=>{this._isUnmounting||this.setState({totalWidth:e})},this.handleClientWidth=e=>{this._isUnmounting||this.setState({clientWidth:e})}}render(){const{props:e,state:n,context:s}=this,{options:r}=s,{borderlessX:i,borderlessTop:a,borderlessBottom:o}=ve(r),{totalWidth:l,clientWidth:c}=n,u=l!=null&&c!=null?l-c:void 0,h=!e.forPrint&&!fe(r),g=!e.forPrint&&Hn(r),m=!e.forPrint&&yo(r),v=e.cellRows[0].length,[p,y]=Yo(v,e.dayMinWidth,c),D=y!=null&&y<=Wt,x=D||y!=null&&y<=r.dayNarrowWidth;return d.jsxs(d.Fragment,{children:[r.dayHeaders&&d.jsxs("div",{className:b(R(r.tableHeaderClass,{isSticky:g,borderlessX:i,borderlessTop:a,borderlessBottom:o,multiMonthColumns:0}),f.printHeader,g&&f.tableHeaderSticky),children:[d.jsxs(pe,{horizontal:!0,hideScrollbars:!0,className:f.flexRow,ref:this.headerScrollerRef,children:[d.jsx($o,{headerTiers:e.headerTiers,colWidth:y,viewportWidth:c,width:p,cellIsNarrow:x,cellIsMicro:D}),!!u&&d.jsx("div",{className:b(R(r.fillerClass,{inTableHeader:!0}),f.borderOnlyS),style:{minWidth:u}})]}),d.jsx("div",{className:R(r.dayHeaderDividerClass,{isSticky:g,multiMonthColumns:0,options:{allDaySlot:!!r.allDaySlot}})})]}),d.jsx(pe,{vertical:h,horizontal:!0,hideScrollbars:m||e.forPrint,className:b(R(r.tableBodyClass,{borderlessX:i,borderlessTop:a,borderlessBottom:o,multiMonthColumns:0}),!e.forPrint&&f.flexCol,h&&f.liquid),ref:this.bodyScrollerRef,clientWidthRef:this.handleClientWidth,children:d.jsx(tr,{dateProfile:e.dateProfile,todayRange:e.todayRange,cellRows:e.cellRows,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed,className:f.grow,dayMaxEvents:e.forPrint?void 0:r.dayMaxEvents,dayMaxEventRows:r.dayMaxEventRows,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:e.businessHourSegs,dateSelectionSegs:e.dateSelectionSegs,eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,colWidth:y,width:p,visibleWidth:l,cellIsNarrow:x,cellIsMicro:D,rowHeightRefMap:e.rowHeightRefMap})}),!!m&&d.jsx(Zo,{isSticky:!0,canvasWidth:p,scrollerRef:this.footerScrollerRef}),d.jsx(Et,{widthRef:this.handleTotalWidth})]})}componentDidMount(){this._isUnmounting=!1;const e=So(this.context.pluginHooks);this.syncedScroller=new e(!0),L(this.props.scrollerRef,this.syncedScroller),this.updateSyncedScroller()}componentDidUpdate(){this.updateSyncedScroller()}componentWillUnmount(){this._isUnmounting=!0,this.syncedScroller.destroy()}updateSyncedScroller(){this.syncedScroller.handleChildren([this.headerScrollerRef.current,this.bodyScrollerRef.current,this.footerScrollerRef.current])}}class gv extends B{constructor(){super(...arguments),this.scrollerRef=w.createRef(),this.rowHeightRefMap=new le(()=>{re(this.updateScrollY)}),this.scrollDate=null,this.updateScrollY=()=>{if(this._isUnmounting)return;const e=this.rowHeightRefMap.current,n=this.scrollerRef.current;if(n&&this.scrollDate){let s=Qp(this.scrollDate,this.props.cellRows,e);s!=null&&(s&&s++,n.scrollTo({y:s}))}},this.handleScrollEnd=e=>{e&&(this.scrollDate=null)}}render(){const{props:e,context:n}=this,{options:s}=n,{borderlessX:r,borderlessTop:i,borderlessBottom:a}=ve(s),o=e.forPrint?[]:e.businessHourSegs,l=e.forPrint?[]:e.dateSelectionSegs,c=e.forPrint?null:e.eventDrag,u=e.forPrint?null:e.eventResize,h={...e,businessHourSegs:o,dateSelectionSegs:l,eventDrag:c,eventResize:u,scrollerRef:this.scrollerRef,rowHeightRefMap:this.rowHeightRefMap};return d.jsx(kn,{viewSpec:n.viewSpec,attrs:{role:"grid","aria-rowcount":e.headerTiers.length+e.cellRows.length,"aria-colcount":e.cellRows[0].length,"aria-labelledby":e.labelId,"aria-label":e.labelStr},className:b(e.className,f.printRoot,R(s.tableClass,{borderlessX:r,borderlessTop:i,borderlessBottom:a,multiMonthColumns:0})),children:s.dayMinWidth?d.jsx(fv,{...h,dayMinWidth:s.dayMinWidth}):d.jsx(hv,{...h})})}componentDidMount(){this._isUnmounting=!1,this.resetScroll(),this.scrollerRef.current.addScrollEndListener(this.handleScrollEnd)}componentDidUpdate(e){e.dateProfile!==this.props.dateProfile&&this.context.options.scrollTimeReset&&this.resetScroll()}componentWillUnmount(){this._isUnmounting=!0,this.scrollerRef.current.removeScrollEndListener(this.handleScrollEnd)}resetScroll(){this.scrollDate=this.props.dateProfile.currentDate,this.updateScrollY(),this.scrollerRef.current.scrollTo({x:0})}}class Xo extends bo{buildRenderRange(e,n,s){let r=super.buildRenderRange(e,n,s),{props:i}=this;return Ko({currentRange:r,snapToWeek:/^(year|month)$/.test(n),fixedWeekCount:i.fixedWeekCount,dateEnv:i.dateEnv})}}function Ko(t){let{dateEnv:e,currentRange:n}=t,{start:s,end:r}=n,i;if(t.snapToWeek&&(s=e.startOfWeek(s),i=e.startOfWeek(r),i.valueOf()!==r.valueOf()&&(r=Dr(i,1))),t.fixedWeekCount){let a=e.startOfWeek(e.startOfMonth(te(n.end,-1))),o=Math.ceil(Ph(a,r));r=Dr(r,6-o)}return{start:s,end:r}}class mv extends B{constructor(){super(...arguments),this.buildDayTableModel=k(Go),this.buildDateRowConfigs=k(jo),this.createDayHeaderFormatter=k(er),this.slicer=new Ks}render(){const{props:e,context:n}=this,{dateProfile:s}=e,{options:r,dateEnv:i}=n,a=this.buildDayTableModel(s,n.dateProfileGenerator,i),o=a.rowCount===1,l=this.createDayHeaderFormatter(n.options.dayHeaderFormat,o,a.colCount),c=this.slicer.sliceProps(e,s,r.nextDayThreshold,n,a);return d.jsx(At,{unit:"day",children:(u,h)=>{const g=this.buildDateRowConfigs(a.headerDates,o,s,h,l,n);return d.jsx(gv,{labelId:e.labelId,labelStr:e.labelStr,dateProfile:s,todayRange:h,cellRows:a.cellRows,forPrint:e.forPrint,className:e.className,headerTiers:g,fgEventSegs:c.fgEventSegs,bgEventSegs:c.bgEventSegs,businessHourSegs:c.businessHourSegs,dateSelectionSegs:c.dateSelectionSegs,eventDrag:c.eventDrag,eventResize:c.eventResize,eventSelection:c.eventSelection})}})}}var Jo={name:"daygrid",initialView:"dayGridMonth",views:{dayGrid:{component:mv,dateProfileGeneratorClass:Xo},dayGridDay:{type:"dayGrid",duration:{days:1}},dayGridWeek:{type:"dayGrid",duration:{weeks:1}},dayGridMonth:{type:"dayGrid",duration:{months:1},fixedWeekCount:!0},dayGridYear:{type:"dayGrid",duration:{years:1}}}};class pv{constructor(e,n){this.emitter=new Lt}destroy(){}setMirrorIsVisible(e){}setMirrorNeedsRevert(e){}setAutoScrollEnabled(e){}}const Qo={};function el(t,e,n){let{instances:s}=t.mutatedEvents;for(let r in s)if(!Rn(e.validRange,s[r].range))return!1;return tl({eventDrag:t},n)}function vv(t,e,n){return Rn(e.validRange,t.range)?tl({dateSelection:t},n):!1}function tl(t,e){let n=e.getCurrentData(),s={businessHours:n.businessHours,dateSelection:"",eventStore:n.eventStore,eventUiBases:n.eventUiBases,eventSelection:"",eventDrag:null,eventResize:null,...t};return(e.pluginHooks.isPropsValid||yv)(s,e)}function yv(t,e,n={},s){return!(t.eventDrag&&!Sv(t,e,n,s)||t.dateSelection&&!Ev(t,e,n,s))}function Sv(t,e,n,s){let r=e.getCurrentData(),i=t.eventDrag,a=i.mutatedEvents,o=a.defs,l=a.instances,c=dn(o,i.isEvent?t.eventUiBases:{"":r.selectionConfig});s&&(c=xe(c,s));let u=um(t.eventStore,i.affectedEvents.instances),h=u.defs,g=u.instances,m=dn(h,t.eventUiBases);for(let v in l){let p=l[v],y=p.range,D=c[p.defId],x=o[p.defId];if(!nl(D.constraints,y,u,t.businessHours,e))return!1;let{eventOverlap:C}=e.options,E=typeof C=="function"?C:null;for(let N in g){let I=g[N];if(Hs(y,I.range)&&(m[I.defId].overlap===!1&&i.isEvent||D.overlap===!1||E&&!E(new $(e,h[I.defId],I),new $(e,x,p))))return!1}let T=r.eventStore;for(let N of D.allows){let I={...n,range:p.range,allDay:x.allDay},P=T.defs[x.defId],H=T.instances[v],j;if(P?j=new $(e,P,H):j=new $(e,x),!N(Fs(I,e),j))return!1}}return!0}function Ev(t,e,n,s){let r=t.eventStore,i=r.defs,a=r.instances,o=t.dateSelection,l=o.range,{selectionConfig:c}=e.getCurrentData();if(s&&(c=s(c)),!nl(c.constraints,l,r,t.businessHours,e))return!1;let{selectOverlap:u}=e.options,h=typeof u=="function"?u:null;for(let g in a){let m=a[g];if(Hs(l,m.range)&&(c.overlap===!1||h&&!h(new $(e,i[m.defId],m),null)))return!1}for(let g of c.allows){let m={...n,...o};if(!g(Fs(m,e),null))return!1}return!0}function nl(t,e,n,s,r){for(let i of t)if(!Dv(bv(i,e,n,s,r),e))return!1;return!0}function bv(t,e,n,s,r){return t==="businessHours"?$n(qe(s,e,r)):typeof t=="string"?$n(Mn(n,i=>i.groupId===t)):typeof t=="object"&&t?$n(qe(t,e,r)):[]}function $n(t){let{instances:e}=t,n=[];for(let s in e)n.push(e[s].range);return n}function Dv(t,e){for(let n of t)if(Rn(n,e))return!0;return!1}Qo.touchMouseIgnoreWait=500;let fs=0,hn=0,gs=!1;class sl{constructor(e){this.subjectEl=null,this.selector="",this.handleSelector="",this.shouldIgnoreMove=!1,this.shouldWatchScroll=!0,this.isDragging=!1,this.isTouchDragging=!1,this.wasTouchScroll=!1,this.handleMouseDown=n=>{if(!this.shouldIgnoreMouse()&&wv(n)&&this.tryStart(n)){let s=this.createEventFromMouse(n,!0);this.emitter.trigger("pointerdown",s),this.initScrollWatch(s),this.shouldIgnoreMove||document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}},this.handleMouseMove=n=>{let s=this.createEventFromMouse(n);this.recordCoords(s),this.emitter.trigger("pointermove",s)},this.handleMouseUp=n=>{document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.emitter.trigger("pointerup",this.createEventFromMouse(n)),this.cleanup()},this.handleTouchStart=n=>{if(this.tryStart(n)){this.isTouchDragging=!0;let s=this.createEventFromTouch(n,!0);this.emitter.trigger("pointerdown",s),this.initScrollWatch(s);let r=n.target;this.shouldIgnoreMove||r.addEventListener("touchmove",this.handleTouchMove),r.addEventListener("touchend",this.handleTouchEnd),r.addEventListener("touchcancel",this.handleTouchEnd),window.addEventListener("scroll",this.handleTouchScroll,!0)}},this.handleTouchMove=n=>{if(this.isDragging){let s=this.createEventFromTouch(n);this.recordCoords(s),this.emitter.trigger("pointermove",s)}},this.handleTouchEnd=n=>{if(this.isDragging){let s=n.target;s.removeEventListener("touchmove",this.handleTouchMove),s.removeEventListener("touchend",this.handleTouchEnd),s.removeEventListener("touchcancel",this.handleTouchEnd),window.removeEventListener("scroll",this.handleTouchScroll,!0),this.emitter.trigger("pointerup",this.createEventFromTouch(n)),this.cleanup(),this.isTouchDragging=!1,Cv()}},this.handleTouchScroll=()=>{this.wasTouchScroll=!0},this.handleScroll=n=>{if(!this.shouldIgnoreMove){let s=window.scrollX-this.prevScrollX+this.prevPageX,r=window.scrollY-this.prevScrollY+this.prevPageY;this.emitter.trigger("pointermove",{origEvent:n,isTouch:this.isTouchDragging,subjectEl:this.subjectEl,pageX:s,pageY:r,deltaX:s-this.origPageX,deltaY:r-this.origPageY})}},this.containerEl=e,this.emitter=new Lt,e.addEventListener("mousedown",this.handleMouseDown),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),Rv()}destroy(){this.containerEl.removeEventListener("mousedown",this.handleMouseDown),this.containerEl.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),xv()}cancel(){this.isDragging&&this.cleanup()}tryStart(e){let n=this.querySubjectEl(e),s=e.target;return n&&(!this.handleSelector||s.closest(this.handleSelector))?(this.subjectEl=n,this.isDragging=!0,this.wasTouchScroll=!1,!0):!1}cleanup(){gs=!1,this.isDragging=!1,this.subjectEl=null,this.destroyScrollWatch()}querySubjectEl(e){return this.selector?e.target.closest(this.selector):this.containerEl}shouldIgnoreMouse(){return fs||this.isTouchDragging}cancelTouchScroll(){this.isDragging&&(gs=!0)}initScrollWatch(e){this.shouldWatchScroll&&(this.recordCoords(e),window.addEventListener("scroll",this.handleScroll,!0))}recordCoords(e){this.shouldWatchScroll&&(this.prevPageX=e.pageX,this.prevPageY=e.pageY,this.prevScrollX=window.scrollX,this.prevScrollY=window.scrollY)}destroyScrollWatch(){this.shouldWatchScroll&&window.removeEventListener("scroll",this.handleScroll,!0)}createEventFromMouse(e,n){let s=0,r=0;return n?(this.origPageX=e.pageX,this.origPageY=e.pageY):(s=e.pageX-this.origPageX,r=e.pageY-this.origPageY),{origEvent:e,isTouch:!1,subjectEl:this.subjectEl,pageX:e.pageX,pageY:e.pageY,deltaX:s,deltaY:r}}createEventFromTouch(e,n){let s=e.touches,r,i,a=0,o=0;return s&&s.length?(r=s[0].pageX,i=s[0].pageY):(r=e.pageX,i=e.pageY),n?(this.origPageX=r,this.origPageY=i):(a=r-this.origPageX,o=i-this.origPageY),{origEvent:e,isTouch:!0,subjectEl:this.subjectEl,pageX:r,pageY:i,deltaX:a,deltaY:o}}}function wv(t){return t.button===0&&!t.ctrlKey}function Cv(){fs+=1,setTimeout(()=>{fs-=1},Qo.touchMouseIgnoreWait)}function Rv(){hn+=1,hn===1&&window.addEventListener("touchmove",rl,{passive:!1})}function xv(){hn-=1,hn||window.removeEventListener("touchmove",rl,{passive:!1})}function rl(t){gs&&t.preventDefault()}class Tv{constructor(){this.isVisible=!1,this.sourceEl=null,this.mirrorEl=null,this.sourceElRect=null,this.parentNode=document.body,this.zIndex=9999,this.revertDuration=0,this.colorScheme=""}start(e,n,s){this.sourceEl=e,this.sourceElRect=this.sourceEl.getBoundingClientRect(),this.origScreenX=n-window.scrollX,this.origScreenY=s-window.scrollY,this.deltaX=0,this.deltaY=0,this.updateElPosition()}handleMove(e,n){this.deltaX=e-window.scrollX-this.origScreenX,this.deltaY=n-window.scrollY-this.origScreenY,this.updateElPosition()}setIsVisible(e){e?this.isVisible||(this.mirrorEl&&this.mirrorEl.style.setProperty("display","","important"),this.isVisible=e,this.updateElPosition()):this.isVisible&&(this.mirrorEl&&this.mirrorEl.style.setProperty("display","none","important"),this.isVisible=e)}stop(e,n){let s=()=>{this.cleanup(),n()};e&&this.mirrorEl&&this.isVisible&&this.revertDuration&&(this.deltaX||this.deltaY)?this.doRevertAnimation(s,this.revertDuration):setTimeout(s,0)}doRevertAnimation(e,n){let s=this.mirrorEl,r=this.sourceEl.getBoundingClientRect();s.style.transition="top "+n+"ms,left "+n+"ms",Jt(s,{left:r.left,top:r.top}),Df(s,()=>{s.style.transition="",e()})}cleanup(){this.mirrorEl&&(this.mirrorEl.remove(),this.mirrorEl=null),this.sourceEl=null}updateElPosition(){this.sourceEl&&this.isVisible&&Jt(this.getMirrorEl(),{left:this.sourceElRect.left+this.deltaX,top:this.sourceElRect.top+this.deltaY})}getMirrorEl(){let e=this.sourceElRect,n=this.mirrorEl;return n||(n=this.mirrorEl=this.sourceEl.cloneNode(!0),n.style.userSelect="none",n.style.webkitUserSelect="none",n.style.pointerEvents="none",this.colorScheme&&n.setAttribute("data-color-scheme",this.colorScheme),n.classList.add(f.borderBoxRoot),Jt(n,{position:"fixed",zIndex:this.zIndex,visibility:"",width:e.right-e.left,height:e.bottom-e.top,right:"auto",bottom:"auto",margin:0}),this.parentNode.appendChild(n)),n}}class nr{getMaxScrollTop(){return this.getScrollHeight()-this.getClientHeight()}getMaxScrollLeft(){return this.getScrollWidth()-this.getClientWidth()}canScrollVertically(){return this.getMaxScrollTop()>0}canScrollHorizontally(){return this.getMaxScrollLeft()>0}canScrollUp(){return this.getScrollTop()>0}canScrollDown(){return this.getScrollTop()<this.getMaxScrollTop()}canScrollLeft(){return this.getScrollLeft()>0}canScrollRight(){return this.getScrollLeft()<this.getMaxScrollLeft()}}class Mv extends nr{constructor(e){super(),this.el=e}getScrollTop(){return this.el.scrollTop}getScrollLeft(){return this.el.scrollLeft}setScrollTop(e){this.el.scrollTop=e}setScrollLeft(e){this.el.scrollLeft=e}getScrollWidth(){return this.el.scrollWidth}getScrollHeight(){return this.el.scrollHeight}getClientHeight(){return this.el.clientHeight}getClientWidth(){return this.el.clientWidth}}class Iv extends nr{getScrollTop(){return window.scrollY}getScrollLeft(){return window.scrollX}setScrollTop(e){window.scroll(window.scrollX,e)}setScrollLeft(e){window.scroll(e,window.scrollY)}getScrollWidth(){return document.documentElement.scrollWidth}getScrollHeight(){return document.documentElement.scrollHeight}getClientHeight(){return document.documentElement.clientHeight}getClientWidth(){return document.documentElement.clientWidth}}class il extends nr{constructor(e,n){super(),this.handleScroll=()=>{this.scrollTop=this.scrollController.getScrollTop(),this.scrollLeft=this.scrollController.getScrollLeft(),this.handleScrollChange()},this.scrollController=e,this.doesListening=n,this.scrollTop=this.origScrollTop=e.getScrollTop(),this.scrollLeft=this.origScrollLeft=e.getScrollLeft(),this.scrollWidth=e.getScrollWidth(),this.scrollHeight=e.getScrollHeight(),this.clientWidth=e.getClientWidth(),this.clientHeight=e.getClientHeight(),this.clientRect=this.computeClientRect(),this.doesListening&&this.getEventTarget().addEventListener("scroll",this.handleScroll)}destroy(){this.doesListening&&this.getEventTarget().removeEventListener("scroll",this.handleScroll)}getScrollTop(){return this.scrollTop}getScrollLeft(){return this.scrollLeft}setScrollTop(e){this.scrollController.setScrollTop(e),this.doesListening||(this.scrollTop=Math.max(Math.min(e,this.getMaxScrollTop()),0),this.handleScrollChange())}setScrollLeft(e){this.scrollController.setScrollLeft(e),this.doesListening||(this.scrollLeft=Math.max(Math.min(e,this.getMaxScrollLeft()),0),this.handleScrollChange())}getClientWidth(){return this.clientWidth}getClientHeight(){return this.clientHeight}getScrollWidth(){return this.scrollWidth}getScrollHeight(){return this.scrollHeight}handleScrollChange(){}}class al extends il{constructor(e,n){super(new Mv(e),n)}getEventTarget(){return this.scrollController.el}computeClientRect(){return Ip(this.scrollController.el)}}class Nv extends il{constructor(e){super(new Iv,e)}getEventTarget(){return window}computeClientRect(){return{left:this.scrollLeft,right:this.scrollLeft+this.clientWidth,top:this.scrollTop,bottom:this.scrollTop+this.clientHeight}}handleScrollChange(){this.clientRect=this.computeClientRect()}}const oi=typeof performance=="function"?performance.now:Date.now;class Hv{constructor(){this.isEnabled=!0,this.scrollQuery=[window,`.${f.internalScroller}`],this.edgeThreshold=50,this.maxVelocity=300,this.pointerScreenX=null,this.pointerScreenY=null,this.isAnimating=!1,this.scrollCaches=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.animate=()=>{if(this.isAnimating){let e=this.computeBestEdge(this.pointerScreenX+window.scrollX,this.pointerScreenY+window.scrollY);if(e){let n=oi();this.handleSide(e,(n-this.msSinceRequest)/1e3),this.requestAnimation(n)}else this.isAnimating=!1}}}start(e,n,s){this.isEnabled&&(this.scrollCaches=this.buildCaches(s),this.pointerScreenX=null,this.pointerScreenY=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.handleMove(e,n))}handleMove(e,n){if(this.isEnabled){let s=e-window.scrollX,r=n-window.scrollY,i=this.pointerScreenY===null?0:r-this.pointerScreenY,a=this.pointerScreenX===null?0:s-this.pointerScreenX;i<0?this.everMovedUp=!0:i>0&&(this.everMovedDown=!0),a<0?this.everMovedLeft=!0:a>0&&(this.everMovedRight=!0),this.pointerScreenX=s,this.pointerScreenY=r,this.isAnimating||(this.isAnimating=!0,this.requestAnimation(oi()))}}stop(){if(this.isEnabled){this.isAnimating=!1;for(let e of this.scrollCaches)e.destroy();this.scrollCaches=null}}requestAnimation(e){this.msSinceRequest=e,requestAnimationFrame(this.animate)}handleSide(e,n){let{scrollCache:s}=e,{edgeThreshold:r}=this,i=r-e.distance,a=i*i/(r*r)*this.maxVelocity*n,o=1;switch(e.name){case"left":o=-1;case"right":s.setScrollLeft(s.getScrollLeft()+a*o);break;case"top":o=-1;case"bottom":s.setScrollTop(s.getScrollTop()+a*o);break}}computeBestEdge(e,n){let{edgeThreshold:s}=this,r=null,i=this.scrollCaches||[];for(let a of i){let o=a.clientRect,l=e-o.left,c=o.right-e,u=n-o.top,h=o.bottom-n;l>=0&&c>=0&&u>=0&&h>=0&&(u<=s&&this.everMovedUp&&a.canScrollUp()&&(!r||r.distance>u)&&(r={scrollCache:a,name:"top",distance:u}),h<=s&&this.everMovedDown&&a.canScrollDown()&&(!r||r.distance>h)&&(r={scrollCache:a,name:"bottom",distance:h}),l<=s&&this.everMovedLeft&&a.canScrollLeft()&&(!r||r.distance>l)&&(r={scrollCache:a,name:"left",distance:l}),c<=s&&this.everMovedRight&&a.canScrollRight()&&(!r||r.distance>c)&&(r={scrollCache:a,name:"right",distance:c}))}return r}buildCaches(e){return this.queryScrollEls(e).map(n=>n===window?new Nv(!1):new al(n,!1))}queryScrollEls(e){let n=[];for(let s of this.scrollQuery)typeof s=="object"?n.push(s):n.push(...Array.prototype.slice.call(e.getRootNode().querySelectorAll(s)));return n}}class Bt extends pv{constructor(e,n){super(e),this.containerEl=e,this.delay=null,this.minDistance=0,this.touchScrollAllowed=!0,this.mirrorNeedsRevert=!1,this.isInteracting=!1,this.isDragging=!1,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.delayTimeoutId=null,this.onPointerDown=r=>{this.isDragging||(this.isInteracting=!0,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.emitter.trigger("pointerdown",r),this.isInteracting&&(wf(document.body),Rf(document.body),r.isTouch||r.origEvent.preventDefault(),this.mirror.setIsVisible(!1),this.mirror.start(r.subjectEl,r.pageX,r.pageY),this.startDelay(r),this.minDistance||this.handleDistanceSurpassed(r)))},this.onPointerMove=r=>{if(this.isInteracting){if(this.emitter.trigger("pointermove",r),!this.isDistanceSurpassed){let i=this.minDistance,a,{deltaX:o,deltaY:l}=r;a=o*o+l*l,a>=i*i&&this.handleDistanceSurpassed(r)}this.isDragging&&(r.origEvent.type!=="scroll"&&(this.mirror.handleMove(r.pageX,r.pageY),this.autoScroller.handleMove(r.pageX,r.pageY)),this.emitter.trigger("dragmove",r))}},this.onPointerUp=r=>{this.isInteracting&&(this.isInteracting=!1,Cf(document.body),xf(document.body),this.emitter.trigger("pointerup",r),this.isDragging&&(this.autoScroller.stop(),this.tryStopDrag(r)),this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=null))};let s=this.pointer=new sl(e);s.emitter.on("pointerdown",this.onPointerDown),s.emitter.on("pointermove",this.onPointerMove),s.emitter.on("pointerup",this.onPointerUp),n&&(s.selector=n),this.mirror=new Tv,this.autoScroller=new Hv}destroy(){this.pointer.destroy(),this.onPointerUp({})}startDelay(e){typeof this.delay=="number"?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=null,this.handleDelayEnd(e)},this.delay):this.handleDelayEnd(e)}handleDelayEnd(e){this.isDelayEnded=!0,this.tryStartDrag(e)}handleDistanceSurpassed(e){this.isDistanceSurpassed=!0,this.tryStartDrag(e)}tryStartDrag(e){this.isDelayEnded&&this.isDistanceSurpassed&&(!this.pointer.wasTouchScroll||this.touchScrollAllowed)&&(this.isDragging=!0,this.mirrorNeedsRevert=!1,this.autoScroller.start(e.pageX,e.pageY,this.containerEl),this.emitter.trigger("dragstart",e),this.touchScrollAllowed===!1&&this.pointer.cancelTouchScroll())}tryStopDrag(e){this.mirror.stop(this.mirrorNeedsRevert,this.stopDrag.bind(this,e))}stopDrag(e){this.isDragging=!1,this.emitter.trigger("dragend",e)}cancel(){this.isInteracting&&(this.isInteracting=!1,this.pointer.cancel())}setMirrorIsVisible(e){this.mirror.setIsVisible(e)}setMirrorNeedsRevert(e){this.mirrorNeedsRevert=e}setAutoScrollEnabled(e){this.autoScroller.isEnabled=e}}class kv{constructor(e){this.el=e,this.origRect=Xs(e),this.isRtl=Nt(e),this.scrollCaches=ko(e).map(n=>new al(n,!0))}destroy(){for(let e of this.scrollCaches)e.destroy()}computeLeft(){let e=this.origRect.left;for(let n of this.scrollCaches)e+=n.origScrollLeft-n.getScrollLeft();return e}computeTop(){let e=this.origRect.top;for(let n of this.scrollCaches)e+=n.origScrollTop-n.getScrollTop();return e}isWithinClipping(e,n){let s={left:e,top:n};for(let r of this.scrollCaches)if(!Pv(r.getEventTarget())&&!Cp(s,r.clientRect))return!1;return!0}}function Pv(t){let e=t.tagName;return e==="HTML"||e==="BODY"}class jn{constructor(e,n){this.useSubjectCenter=!1,this.requireInitial=!0,this.disablePointCheck=!1,this.initialHit=null,this.movingHit=null,this.finalHit=null,this.handlePointerDown=s=>{let{dragging:r}=this;this.initialHit=null,this.movingHit=null,this.finalHit=null,this.prepareHits(),this.processFirstCoord(s),this.initialHit||!this.requireInitial?this.emitter.trigger("pointerdown",s):r.cancel()},this.handleDragStart=s=>{this.emitter.trigger("dragstart",s),this.handleMove(s,!0)},this.handleDragMove=s=>{this.emitter.trigger("dragmove",s),this.handleMove(s)},this.handlePointerUp=s=>{this.releaseHits(),this.emitter.trigger("pointerup",s)},this.handleDragEnd=s=>{this.movingHit&&this.emitter.trigger("hitupdate",null,!0,s),this.finalHit=this.movingHit,this.movingHit=null,this.emitter.trigger("dragend",s)},this.droppableStore=n,e.emitter.on("pointerdown",this.handlePointerDown),e.emitter.on("dragstart",this.handleDragStart),e.emitter.on("dragmove",this.handleDragMove),e.emitter.on("pointerup",this.handlePointerUp),e.emitter.on("dragend",this.handleDragEnd),this.dragging=e,this.emitter=new Lt}processFirstCoord(e){let n={left:e.pageX,top:e.pageY},s=n,r=e.subjectEl,i;r instanceof HTMLElement&&(i=Xs(r),s=Rp(s,i));let a=this.initialHit=this.queryHitForOffset(s.left,s.top);if(a){if(this.useSubjectCenter&&i){let o=Ho(i,a.rect);o&&(s=xp(o))}this.coordAdjust=Tp(s,n)}else this.coordAdjust={left:0,top:0}}handleMove(e,n){let s=this.queryHitForOffset(e.pageX+this.coordAdjust.left,e.pageY+this.coordAdjust.top);(n||!Ln(this.movingHit,s))&&(this.movingHit=s,this.emitter.trigger("hitupdate",s,!1,e))}prepareHits(){this.offsetTrackers=xe(this.droppableStore,e=>(e.component.prepareHits(),new kv(e.el)))}releaseHits(){let{offsetTrackers:e}=this;for(let n in e)e[n].destroy();this.offsetTrackers={}}queryHitForOffset(e,n){let{droppableStore:s,offsetTrackers:r}=this,i=null;for(let a in s){let o=s[a].component,l=r[a];if(l&&l.isWithinClipping(e,n)){let c=l.computeLeft(),u=l.computeTop(),h=e-c,g=n-u,{origRect:m}=l,v=m.right-m.left,p=m.bottom-m.top;if(h>=0&&h<v&&g>=0&&g<p){let y=o.queryHit(l.isRtl,h,g,v,p);y&&Rn(y.dateProfile.activeRange,y.dateSpan.range)&&(this.disablePointCheck||l.el.contains(l.el.getRootNode().elementFromPoint(h+c-window.scrollX,g+u-window.scrollY)))&&(!i||y.layer>i.layer)&&(y.componentId=a,y.context=o.context,y.rect.left+=c,y.rect.right+=c,y.rect.top+=u,y.rect.bottom+=u,i=y)}}}return i}}function Ln(t,e){return!t&&!e?!0:!!t!=!!e?!1:Kf(t.dateSpan,e.dateSpan)}function ol(t,e){let n={};for(let s of e.pluginHooks.datePointTransforms)Object.assign(n,s(t,e));return Object.assign(n,jv(t,e.dateEnv)),n}function jv(t,e){return{date:e.toDate(t.range.start),dateStr:e.formatIso(t.range.start,{omitTime:t.allDay}),allDay:t.allDay}}class Lv extends pt{constructor(e){super(e),this.handlePointerDown=s=>{let{dragging:r}=this,i=s.origEvent.target;this.component.context.emitter.hasHandlers("dateClick")&&this.component.isValidDateDownEl(i)||r.cancel()},this.handleDragEnd=s=>{let{component:r}=this,{pointer:i}=this.dragging;if(!i.wasTouchScroll){let{initialHit:a,finalHit:o}=this.hitDragging;if(a&&o&&Ln(a,o)){let{context:l}=r,c={...ol(a.dateSpan,l),dayEl:a.getDayEl(),jsEvent:s.origEvent,view:l.viewApi||l.calendarApi.view};l.emitter.trigger("dateClick",c)}}},this.dragging=new Bt(e.el),this.dragging.autoScroller.isEnabled=!1;let n=this.hitDragging=new jn(this.dragging,qs(e));n.emitter.on("pointerdown",this.handlePointerDown),n.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}}class Av extends pt{constructor(e){super(e),this.dragSelection=null,this.handlePointerDown=a=>{let{component:o,dragging:l}=this,{options:c}=o.context;c.selectable&&o.isValidDateDownEl(a.origEvent.target)?l.delay=a.isTouch?Ov(o):null:l.cancel()},this.handleDragStart=a=>{this.component.context.calendarApi.unselect(a)},this.handleHitUpdate=(a,o)=>{let{context:l}=this.component,c=null,u=!1;if(a){let h=this.hitDragging.initialHit;a.componentId===h.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(h,a)||(c=Wv(h,a,l.pluginHooks.dateSelectionTransformers)),(!c||!vv(c,a.dateProfile,l))&&(u=!0,c=null)}c?l.dispatch({type:"SELECT_DATES",selection:c}):o||l.dispatch({type:"UNSELECT_DATES"}),u?js():Ls(),o||(this.dragSelection=c)},this.handlePointerUp=a=>{this.dragSelection?(no(this.dragSelection,a,this.component.context),this.dragSelection=null):this.component.context.emitter.trigger("_noDateSelect")};let{component:n}=e,{options:s}=n.context,r=this.dragging=new Bt(e.el);r.touchScrollAllowed=!1,r.minDistance=s.selectMinDistance||0,r.autoScroller.isEnabled=s.dragScroll;let i=this.hitDragging=new jn(this.dragging,qs(e));i.emitter.on("pointerdown",this.handlePointerDown),i.emitter.on("dragstart",this.handleDragStart),i.emitter.on("hitupdate",this.handleHitUpdate),i.emitter.on("pointerup",this.handlePointerUp)}destroy(){this.dragging.destroy()}}function Ov(t){let{options:e}=t.context,n=e.selectLongPressDelay;return n==null&&(n=e.longPressDelay),n}function Wv(t,e,n){let s=t.dateSpan,r=e.dateSpan,i=[s.range.start,s.range.end,r.range.start,r.range.end];i.sort(Hf);let a={};for(let o of n){let l=o(t,e);if(l===!1)return null;l&&Object.assign(a,l)}return a.range={start:i[0],end:i[3]},a.allDay=s.allDay,a}class _t extends pt{constructor(e){super(e),this.subjectEl=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=a=>{let o=a.origEvent.target,{component:l,dragging:c}=this,{mirror:u}=c,{options:h}=l.context,g=l.context;this.subjectEl=a.subjectEl;let v=(this.eventRange=ct(a.subjectEl)).instance.instanceId;this.relevantEvents=Bs(g.getCurrentData().eventStore,v),c.minDistance=a.isTouch?0:h.eventDragMinDistance,c.delay=a.isTouch&&v!==l.props.eventSelection?_v(l):null,u.parentNode=xo(o),u.revertDuration=h.dragRevertDuration,u.colorScheme=h.colorScheme||"",l.isValidSegDownEl(o)&&!o.closest(`.${f.internalEventResizer}`)?this.isDragging=a.subjectEl.classList.contains(f.internalEventDraggable):c.cancel()},this.handleDragStart=a=>{let o=this.component.context,l=this.eventRange,c=l.instance.instanceId;a.isTouch?c!==this.component.props.eventSelection&&o.dispatch({type:"SELECT_EVENT",eventInstanceId:c}):o.dispatch({type:"UNSELECT_EVENT"}),this.isDragging&&(o.calendarApi.unselect(a),o.emitter.trigger("eventDragStart",{el:this.subjectEl,event:new $(o,l.def,l.instance),jsEvent:a.origEvent,view:o.viewApi}))},this.handleHitUpdate=(a,o)=>{if(!this.isDragging)return;let l=this.relevantEvents,c=this.hitDragging.initialHit,u=this.component.context,h=null,g=null,m=null,v=!1,p={affectedEvents:l,mutatedEvents:de(),isEvent:!0};if(a){h=a.context;let y=h.options;u===h||y.editable&&y.droppable?(g=Bv(c,a,this.eventRange.instance.range.start,h.getCurrentData().pluginHooks.eventDragMutationMassagers),g&&(m=Vs(l,h.getCurrentData().eventUiBases,g,h),p.mutatedEvents=m,el(p,a.dateProfile,h)||(v=!0,g=null,m=null,p.mutatedEvents=de()))):h=null}this.displayDrag(h,p),v?js():Ls(),o||(u===h&&Ln(c,a)&&(g=null),this.dragging.setMirrorNeedsRevert(!g),this.dragging.setMirrorIsVisible(!a||!this.subjectEl.getRootNode().querySelector(`.${f.internalEventMirror}`)),this.receivingContext=h,this.validMutation=g,this.mutatedRelevantEvents=m)},this.handlePointerUp=()=>{this.isDragging||this.cleanup()},this.handleDragEnd=a=>{if(this.isDragging){let o=this.component.context,l=o.viewApi,{receivingContext:c,validMutation:u}=this,h=this.eventRange.def,g=this.eventRange.instance,m=new $(o,h,g),v=this.relevantEvents,p=this.mutatedRelevantEvents,{finalHit:y}=this.hitDragging;if(this.clearDrag(),o.emitter.trigger("eventDragStop",{el:this.subjectEl,event:m,jsEvent:a.origEvent,view:l}),u){if(c===o){let D=new $(o,p.defs[h.defId],g?p.instances[g.instanceId]:null);o.dispatch({type:"MERGE_EVENTS",eventStore:p});let x={oldEvent:m,event:D,relatedEvents:Fe(p,o,g),revert(){o.dispatch({type:"MERGE_EVENTS",eventStore:v})}},C={};for(let E of o.getCurrentData().pluginHooks.eventDropTransformers)Object.assign(C,E(u,o));o.emitter.trigger("eventDrop",{...x,...C,el:a.subjectEl,delta:u.datesDelta,jsEvent:a.origEvent,view:l}),o.emitter.trigger("eventChange",x)}else if(c){let D={event:m,relatedEvents:Fe(v,o,g),revert(){o.dispatch({type:"MERGE_EVENTS",eventStore:v})}};o.emitter.trigger("eventLeave",{...D,draggedEl:a.subjectEl,view:l}),o.dispatch({type:"REMOVE_EVENTS",eventStore:v}),o.emitter.trigger("eventRemove",D);let x=p.defs[h.defId],C=p.instances[g.instanceId],E=new $(c,x,C);c.dispatch({type:"MERGE_EVENTS",eventStore:p});let T={event:E,relatedEvents:Fe(p,c,C),revert(){c.dispatch({type:"REMOVE_EVENTS",eventStore:p})}};c.emitter.trigger("eventAdd",T),a.isTouch&&c.dispatch({type:"SELECT_EVENT",eventInstanceId:g.instanceId}),c.emitter.trigger("drop",{...ol(y.dateSpan,c),draggedEl:a.subjectEl,jsEvent:a.origEvent,view:y.context.viewApi}),c.emitter.trigger("eventReceive",{...T,draggedEl:a.subjectEl,view:y.context.viewApi})}}else o.emitter.trigger("_noEventDrop")}this.cleanup()};let{component:n}=this,{options:s}=n.context,r=this.dragging=new Bt(e.el);r.pointer.selector=_t.SELECTOR,r.touchScrollAllowed=!1,r.autoScroller.isEnabled=s.dragScroll;let i=this.hitDragging=new jn(this.dragging,rs);i.useSubjectCenter=e.useEventCenter,i.emitter.on("pointerdown",this.handlePointerDown),i.emitter.on("dragstart",this.handleDragStart),i.emitter.on("hitupdate",this.handleHitUpdate),i.emitter.on("pointerup",this.handlePointerUp),i.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}displayDrag(e,n){let s=this.component.context,r=this.receivingContext;r&&r!==e&&(r===s?r.dispatch({type:"SET_EVENT_DRAG",state:{affectedEvents:n.affectedEvents,mutatedEvents:de(),isEvent:!0}}):r.dispatch({type:"UNSET_EVENT_DRAG"})),e&&e.dispatch({type:"SET_EVENT_DRAG",state:n})}clearDrag(){let e=this.component.context,{receivingContext:n}=this;n&&n.dispatch({type:"UNSET_EVENT_DRAG"}),e!==n&&e.dispatch({type:"UNSET_EVENT_DRAG"})}cleanup(){this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null}}_t.SELECTOR=`.${f.internalEventDraggable}, .${f.internalEventResizable}`;function Bv(t,e,n,s){let r=t.dateSpan,i=e.dateSpan,a=r.range.start,o=i.range.start,l={};r.allDay!==i.allDay&&(l.allDay=i.allDay,l.hasEnd=e.context.options.allDayMaintainDuration,i.allDay?a=z(n):a=n);let c=nt(a,o,t.context.dateEnv,t.componentId===e.componentId?t.largeUnit:null);c.milliseconds&&(l.allDay=!1);let u={datesDelta:c,standardProps:l};for(let h of s)h(u,t,e);return u}function _v(t){let{options:e}=t.context,n=e.eventLongPressDelay;return n==null&&(n=e.longPressDelay),n}class Uv extends pt{constructor(e){super(e),this.draggingSegEl=null,this.draggingEventRange=null,this.eventRange=null,this.relevantEvents=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=i=>{let{component:a}=this,o=this.querySegEl(i),l=this.eventRange=ct(o);this.dragging.minDistance=a.context.options.eventDragMinDistance,this.component.isValidSegDownEl(i.origEvent.target)&&!(i.isTouch&&this.component.props.eventSelection!==l.instance.instanceId)||this.dragging.cancel()},this.handleDragStart=i=>{let{context:a}=this.component,o=this.eventRange;this.relevantEvents=Bs(a.getCurrentData().eventStore,this.eventRange.instance.instanceId);let l=this.querySegEl(i);this.draggingSegEl=l,this.draggingEventRange=ct(l),a.calendarApi.unselect(),a.emitter.trigger("eventResizeStart",{el:l,event:new $(a,o.def,o.instance),jsEvent:i.origEvent,view:a.viewApi})},this.handleHitUpdate=(i,a,o)=>{let{context:l}=this.component,c=this.relevantEvents,u=this.hitDragging.initialHit,h=this.eventRange.instance,g=null,m=null,v=!1,p={affectedEvents:c,mutatedEvents:de(),isEvent:!0};i&&(i.componentId===u.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(u,i)||(g=Fv(u,i,o.subjectEl.classList.contains(f.internalEventResizerStart),h.range))),g&&(m=Vs(c,l.getCurrentData().eventUiBases,g,l),p.mutatedEvents=m,el(p,i.dateProfile,l)||(v=!0,g=null,m=null,p.mutatedEvents=null)),m?l.dispatch({type:"SET_EVENT_RESIZE",state:p}):l.dispatch({type:"UNSET_EVENT_RESIZE"}),v?js():Ls(),a||(g&&Ln(u,i)&&(g=null),this.validMutation=g,this.mutatedRelevantEvents=m)},this.handleDragEnd=i=>{let{context:a}=this.component,o=this.eventRange.def,l=this.eventRange.instance,c=new $(a,o,l),u=this.relevantEvents,h=this.mutatedRelevantEvents;if(a.emitter.trigger("eventResizeStop",{el:this.draggingSegEl,event:c,jsEvent:i.origEvent,view:a.viewApi}),this.validMutation){let g=new $(a,h.defs[o.defId],l?h.instances[l.instanceId]:null);a.dispatch({type:"MERGE_EVENTS",eventStore:h});let m={oldEvent:c,event:g,relatedEvents:Fe(h,a,l),revert(){a.dispatch({type:"MERGE_EVENTS",eventStore:u})}};a.emitter.trigger("eventResize",{...m,el:this.draggingSegEl,startDelta:this.validMutation.startDelta||_(0),endDelta:this.validMutation.endDelta||_(0),jsEvent:i.origEvent,view:a.viewApi}),a.emitter.trigger("eventChange",m)}else a.emitter.trigger("_noEventResize");this.draggingEventRange=null,this.relevantEvents=null,this.validMutation=null};let{component:n}=e,s=this.dragging=new Bt(e.el);s.pointer.selector=`.${f.internalEventResizer}`,s.touchScrollAllowed=!1,s.autoScroller.isEnabled=n.context.options.dragScroll;let r=this.hitDragging=new jn(this.dragging,qs(e));r.emitter.on("pointerdown",this.handlePointerDown),r.emitter.on("dragstart",this.handleDragStart),r.emitter.on("hitupdate",this.handleHitUpdate),r.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}querySegEl(e){return e.subjectEl.closest(`.${f.internalEvent}`)}}function Fv(t,e,n,s){let r=t.context.dateEnv,i=t.dateSpan.range.start,a=e.dateSpan.range.start,o=nt(i,a,r,t.largeUnit);if(n){if(r.add(s.start,o)<s.end)return{startDelta:o}}else if(r.add(s.end,o)>s.start)return{endDelta:o};return null}class Vv{constructor(e){this.context=e,this.isRecentPointerDateSelect=!1,this.matchesCancel=!1,this.matchesEvent=!1,this.onSelect=s=>{s.jsEvent&&(this.isRecentPointerDateSelect=!0)},this.onDocumentPointerDown=s=>{let r=this.context.options.unselectCancel,i=To(s.origEvent);this.matchesCancel=!!i.closest(r),this.matchesEvent=!!i.closest(_t.SELECTOR)},this.onDocumentPointerUp=s=>{let{context:r}=this,{documentPointer:i}=this,a=r.getCurrentData();if(!i.wasTouchScroll){if(a.dateSelection&&!this.isRecentPointerDateSelect){let o=r.options.unselectAuto;o&&(!o||!this.matchesCancel)&&r.calendarApi.unselect(s)}a.eventSelection&&!this.matchesEvent&&r.dispatch({type:"UNSELECT_EVENT"})}this.isRecentPointerDateSelect=!1};let n=this.documentPointer=new sl(document);n.shouldIgnoreMove=!0,n.shouldWatchScroll=!1,n.emitter.on("pointerdown",this.onDocumentPointerDown),n.emitter.on("pointerup",this.onDocumentPointerUp),e.emitter.on("select",this.onSelect)}destroy(){this.context.emitter.off("select",this.onSelect),this.documentPointer.destroy()}}var zv={name:"interaction",componentInteractions:[Lv,Av,_t,Uv],calendarInteractions:[Vv],elementDraggingImpl:Bt};class li extends B{render(){const{props:e,context:n}=this,{options:s}=n,r=n.dateEnv.formatToParts(e.dayDate,e.dayFormat),i=ie(r),a=s.navLinks,o={...e.dateMeta,view:n.viewApi,text:i,textParts:r,get weekdayText(){return Ht(r)},get dayNumberText(){return kt(r)},hasNavLink:a,level:e.level},l=a?yt(this.context,e.dayDate,void 0,i,this.props.isTabbable):{};return d.jsx(q,{tag:"div",attrs:l,renderProps:o,generatorName:"listDayHeaderContent",customGenerator:s.listDayHeaderContent,defaultGenerator:Nn,classNameGenerator:s.listDayHeaderInnerClass})}}class Gv extends B{render(){let{options:e,viewApi:n,viewSpec:s}=this.context,{dayDate:r,dateMeta:i}=this.props,a=!this.props.forPrint;const o=e.listDayFormat??Yv(s),l=e.listDayAltFormat??qv(s);let c={...i,view:n};return d.jsx(q,{tag:"div",attrs:{"data-date":mt(r),...i.isToday?{"aria-current":"date"}:{}},className:a?f.stickyT:"",renderProps:c,generatorName:void 0,classNameGenerator:e.listDayHeaderClass,didMount:e.listDayHeaderDidMount,willUnmount:e.listDayHeaderWillUnmount,children:()=>d.jsxs(d.Fragment,{children:[!!o&&d.jsx(li,{dayDate:r,dayFormat:o,isTabbable:!0,dateMeta:i,level:0}),!!l&&d.jsx(li,{dayDate:r,dayFormat:l,isTabbable:!1,dateMeta:i,level:1})]})})}}function Yv({durationUnit:t,singleUnit:e}){return e==="day"||t==="day"||e==="week"?un:$s}function qv({durationUnit:t,singleUnit:e}){if(e!=="day")return t==="day"||e==="week"?$s:un}const $v=V({hour:"numeric",minute:"2-digit",meridiem:"short"});class Zv extends B{render(){let{props:e,context:n}=this,{eventRange:s}=e;const{displayEventTime:r}=n.options;let i=r!==!1&&(s.def.allDay||!e.isStart&&!e.isEnd)?n.options.allDayText:void 0;return d.jsx(Ot,{...e,attrs:{role:"listitem"},forcedTimeText:i,defaultTimeFormat:$v,disableDragging:!0,disableResizing:!0,disableZindexes:!0,display:"list-item"})}}class Xv extends B{constructor(){super(...arguments),this.getDateMeta=k(Je),this.sortEventSegs=k(zs)}render(){const{props:e,context:n}=this,{nowDate:s,todayRange:r}=e,{options:i}=n,a=this.getDateMeta(e.dayDate,n.dateEnv,void 0,r),o=this.sortEventSegs(e.segs,i.eventOrder),l=vt(this.context,e.dayDate),c={...a,isFirst:e.isFirst,isLast:e.isLast,view:n.viewApi},u={...a,view:n.viewApi};return d.jsxs("div",{role:"listitem","aria-label":l,className:R(i.listDayClass,c),children:[d.jsx(Gv,{dayDate:e.dayDate,dateMeta:a,forPrint:e.forPrint}),d.jsx("div",{role:"list","aria-label":i.eventsHint,className:b(R(i.listDayBodyClass,u),f.flexCol),children:o.map((h,g)=>{const m=In(h),v=g===0,p=g===o.length-1;return d.jsx(Zv,{eventRange:h.eventRange,slicedStart:h.slicedStart,slicedEnd:h.slicedEnd,isStart:h.isStart,isEnd:h.isEnd,isFirst:v,isLast:p,isDragging:!1,isResizing:!1,isMirror:!1,isSelected:!1,...$e(h.eventRange,r,s)},m)})})]})}}class Kv extends ye{constructor(){super(...arguments),this.computeDateVars=k(Qv),this.eventStoreToSegs=k(this._eventStoreToSegs),this.setRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e,disableHits:!0}):this.context.unregisterInteractiveComponent(this)}}render(){let{props:e,context:n}=this,{options:s}=n,{dayDates:r,dayRanges:i}=this.computeDateVars(e.dateProfile),a=this.eventStoreToSegs(e.eventStore,e.eventUiBases,i),o=!e.forPrint&&!fe(s);return d.jsx(kn,{viewSpec:n.viewSpec,className:b(e.className,f.flexCol),elRef:this.setRootEl,children:a.length?d.jsx(pe,{vertical:o,className:b(f.flexCol,o?f.liquid:""),children:this.renderSegList(a,r)}):this.renderEmptyMessage()})}renderEmptyMessage(){let{options:e,viewApi:n}=this.context,s={text:e.noEventsText,view:n};return d.jsx(q,{tag:"div",attrs:{role:"status"},renderProps:s,generatorName:"noEventsContent",customGenerator:e.noEventsContent,defaultGenerator:Jv,classNameGenerator:e.noEventsClass,className:f.grow,didMount:e.noEventsDidMount,willUnmount:e.noEventsWillUnmount,children:r=>d.jsx(r,{tag:"div",className:R(e.noEventsInnerClass,s)})})}renderSegList(e,n){let{options:s}=this.context,r=ey(e);return d.jsx("div",{role:"list","aria-labelledby":this.props.labelId,"aria-label":this.props.labelStr,className:b(f.flexCol,b(s.listDaysClass)),children:d.jsx(At,{unit:"day",children:(i,a)=>{const o=[],l=r.reduce((u,h)=>u+(h?1:0),0);let c=0;for(let u=0;u<r.length;u+=1){let h=r[u];if(h){const g=n[u],m=mt(g),v=c===0,p=c===l-1;o.push(d.jsx(Xv,{dayDate:g,nowDate:i,todayRange:a,segs:h,isFirst:v,isLast:p,forPrint:this.props.forPrint},m)),c+=1}}return d.jsx(d.Fragment,{children:o})}})})}_eventStoreToSegs(e,n,s){return this.eventRangesToSegs(ns(e,n,this.props.dateProfile.activeRange,this.context.options.nextDayThreshold).fg,s)}eventRangesToSegs(e,n){let s=[];for(let r of e)s.push(...this.eventRangeToSegs(r,n));return s}eventRangeToSegs(e,n){let s=e.range,r,i=[];for(r=0;r<n.length;r+=1){const a=Ae(s,n[r]);a&&i.push({eventRange:e,slicedStart:a.start,slicedEnd:a.end,isStart:e.isStart&&s.start.valueOf()===a.start.valueOf(),isEnd:e.isEnd&&s.end.valueOf()===a.end.valueOf(),dayIndex:r})}return i}}function Jv(t){return t.text}function Qv(t){let e=z(t.renderRange.start),n=t.renderRange.end,s=[],r=[];for(;e<n;)s.push(e),r.push({start:e,end:te(e,1)}),e=te(e,1);return{dayDates:s,dayRanges:r}}function ey(t){let e=[],n,s;for(n=0;n<t.length;n+=1)s=t[n],(e[s.dayIndex]||(e[s.dayIndex]=[])).push(s);return e}var ty={name:"list",views:{list:{component:Kv,buttonTextKey:"listText",disallowAmbigTitle:!0},listDay:{type:"list",duration:{days:1}},listWeek:{type:"list",duration:{weeks:1}},listMonth:{type:"list",duration:{month:1}},listYear:{type:"list",duration:{year:1}}}};class ny extends ye{constructor(){super(...arguments),this.state={},this.buildDayTableModel=k(Go),this.createDayHeaderFormatter=k(er),this.buildDateRowConfig=k(Lo),this.titleElRef=w.createRef(),this.tableHeaderElRef=w.createRef(),this.rowHeightRefMap=new le(()=>{re(this.handleHeights)}),this.slicer=new Ks,this.handleEl=e=>{const{options:n}=this.context;e&&(this.rootEl=e,n.singleMonthDidMount?.({el:this.rootEl,...this.renderProps}))},this.handleGridWidth=e=>{this._isUnmounting||this.setState({gridWidth:e})},this.handleHeights=()=>{this._isUnmounting||L(this.props.heightsRef,{titleHeight:this.titleHeight,tableHeaderHeight:this.tableHeaderHeight,rowHeightMap:this.rowHeightRefMap.current,cellRows:this.cellRows})}}get titleId(){return this.context.baseId+"month-"+this.props.isoDateStr}render(){const{props:e,state:n,context:s}=this,{dateProfile:r,forPrint:i}=e,{options:a,dateEnv:o}=s,{borderlessX:l,borderlessTop:c,borderlessBottom:u}=ve(a),h=this.buildDayTableModel(r,s.dateProfileGenerator,o),g=this.slicer.sliceProps(e,r,a.nextDayThreshold,s,h),m=this.createDayHeaderFormatter(a.dayHeaderFormat,!1,h.colCount),v=this.buildDateRowConfig(h.headerDates,!1,r,e.todayRange,m,s);this.cellRows=h.cellRows;const p=!i&&e.colCount===1,y=!i||e.hasLateralSiblings,D=h.cellRows[0].length,x=n.gridWidth!=null?n.gridWidth/D:void 0,C=x!=null&&x<=Wt,E=C||x!=null&&x<=a.dayNarrowWidth,T=n.gridWidth!=null?1/a.aspectRatio*n.gridWidth/6:void 0,N=p?T:void 0,I=p&&T!=null&&n.tableHeaderHeight!=null?T+n.tableHeaderHeight+1:void 0,P=i?[]:g.businessHourSegs,H=i?[]:g.dateSelectionSegs,j=i?null:g.eventDrag,G=i?null:g.eventResize,U=a.navLinks&&e.colCount>1,F={multiMonthColumns:e.colCount||0,isSticky:p,isNarrow:E,hasNavLink:U},Z=e.dateProfile.currentRange.start,Q=U?yt(s,Z,"month",e.isoDateStr):{};return d.jsx("div",{role:"listitem",style:{width:e.width},children:d.jsxs("div",{role:"grid","aria-labelledby":this.titleId,"data-date":e.isoDateStr,className:b(R(a.singleMonthClass,{isFirst:e.isFirst,isLast:e.isLast,multiMonthColumns:e.colCount||0}),f.flexCol,e.hasLateralSiblings&&f.breakInsideAvoid),children:[d.jsx(Et,{widthRef:this.handleGridWidth}),d.jsx("div",{id:this.titleId,ref:this.titleElRef,className:b(R(a.singleMonthHeaderClass,F),p&&f.stickyT,f.flexCol),style:{zIndex:p?3:void 0,marginBottom:I},children:d.jsx("div",{...Q,className:b(R(a.singleMonthHeaderInnerClass,F),Q.className),children:ie(o.formatToParts(Z,e.titleFormat))})}),d.jsxs("div",{className:b(R(a.tableClass,{borderlessX:l,borderlessTop:c,borderlessBottom:u,multiMonthColumns:e.colCount||0}),f.flexCol),style:{marginTop:I!=null?-I:void 0},children:[d.jsxs("div",{ref:this.tableHeaderElRef,className:b(R(a.tableHeaderClass,{isSticky:p,borderlessX:l,borderlessTop:c,borderlessBottom:u,multiMonthColumns:e.colCount||0}),f.flexCol,p&&f.sticky),style:{zIndex:p?2:void 0,top:p?n.titleHeight:0,marginBottom:N},children:[d.jsx(Pn,{...v,role:"row",borderBottom:!1,cellIsNarrow:E,cellIsMicro:C,rowLevel:0}),d.jsx("div",{className:R(a.dayHeaderDividerClass,{isSticky:p,multiMonthColumns:e.colCount||0,options:{allDaySlot:!!a.allDaySlot}})})]}),d.jsx("div",{className:b(R(a.tableBodyClass,{borderlessX:l,borderlessTop:c,borderlessBottom:u,multiMonthColumns:e.colCount||0}),f.flexCol,y&&f.rel),style:{zIndex:p?1:void 0,marginTop:N!=null?-N:void 0,aspectRatio:y?String(a.aspectRatio):void 0},children:d.jsx(tr,{dateProfile:e.dateProfile,todayRange:e.todayRange,cellRows:h.cellRows,className:y?f.fill:"",forPrint:i&&!e.hasLateralSiblings,dayMaxEventRows:i&&e.hasLateralSiblings?1:!0,fgEventSegs:g.fgEventSegs,bgEventSegs:g.bgEventSegs,businessHourSegs:P,dateSelectionSegs:H,eventDrag:j,eventResize:G,eventSelection:g.eventSelection,visibleWidth:n.gridWidth,cellIsNarrow:E,cellIsMicro:C,rowHeightRefMap:this.rowHeightRefMap})})]})]})})}componentDidMount(){this._isUnmounting=!1,this.disconnectTitleHeight=dt(this.titleElRef.current,e=>{this.setState({titleHeight:this.titleHeight=e}),re(this.handleHeights)}),this.disconnectTableHeaderHeight=dt(this.tableHeaderElRef.current,e=>{this.setState({tableHeaderHeight:this.tableHeaderHeight=e}),re(this.handleHeights)})}componentWillUnmount(){const{options:e}=this.context;this._isUnmounting=!0,this.disconnectTitleHeight(),this.disconnectTableHeaderHeight(),e.singleMonthWillUnmount?.({el:this.rootEl,...this.renderProps})}}class sy extends ye{constructor(){super(...arguments),this.state={},this.splitDateProfileByMonth=k(iy),this.buildMonthFormat=k(ly),this.scrollerRef=w.createRef(),this.tilesElRef=w.createRef(),this.scrollState={},this.handleInnerWidth=e=>{this._isUnmounting||this.setState({innerWidth:e})},this.handleScrollStart=()=>{this.scrollState.date=void 0,this.scrollState.top=void 0},this.handleScrollEnd=e=>{const n=this.scrollerRef.current;e&&n&&(this.scrollState.top=n.y,this.scrollState.date=void 0)}}render(){const{context:e,props:n,state:s}=this,{options:r}=e,i=!n.forPrint&&!fe(r),a=this.splitDateProfileByMonth(e.dateProfileGenerator,n.dateProfile,e.dateEnv,r.fixedWeekCount,r.showNonCurrentDates),o=this.buildMonthFormat(r.singleMonthTitleFormat,a),{multiMonthMaxColumns:l,singleMonthMinWidth:c}=r,{innerWidth:u}=s;let h,g,m=!1;return u!=null&&(h=Math.max(1,Math.min(l,Math.floor(u/c))),n.forPrint&&(h=Math.min(h,2)),g=Mt(1/h),m=h>1),d.jsx(At,{unit:"day",children:(v,p)=>d.jsxs(kn,{viewSpec:e.viewSpec,className:b(!n.forPrint&&f.flexCol,n.className),children:[d.jsx(pe,{vertical:i,className:i?f.liquid:"",ref:this.scrollerRef,children:d.jsx("div",{role:"list",ref:this.tilesElRef,"aria-labelledby":n.labelId,"aria-label":n.labelStr,className:f.safeTiles,children:a.map((y,D)=>{const x=Mr(y.currentRange.start);return w.createElement(ny,{...n,key:x,todayRange:p,isoDateStr:x,titleFormat:o,dateProfile:y,width:g,colCount:h,isFirst:!D,isLast:D===a.length-1,hasLateralSiblings:m})})})}),d.jsx(Et,{widthRef:this.handleInnerWidth})]})})}componentDidMount(){this._isUnmounting=!1,this.scrollState.date=this.props.dateProfile.currentDate,this.scrollerRef.current.addScrollStartListener(this.handleScrollStart),this.scrollerRef.current.addScrollEndListener(this.handleScrollEnd),setTimeout(()=>{this.applyScroll()},0)}componentDidUpdate(e,n){e.dateProfile!==this.props.dateProfile?this.context.options.scrollTimeReset?this.resetScroll():this.applyScroll():n.innerWidth!==this.state.innerWidth&&this.applyScroll()}componentWillUnmount(){this._isUnmounting=!0,this.scrollerRef.current.removeScrollStartListener(this.handleScrollStart),this.scrollerRef.current.removeScrollEndListener(this.handleScrollEnd)}resetScroll(){this.scrollState.date=this.props.dateProfile.currentDate,this.scrollState.top=void 0,this.applyScroll()}applyScroll(){const e=this.scrollerRef.current,n=this.computeScrollTop();e&&n!=null&&e.scrollTo({y:n})}computeScrollTop(){const{scrollState:e}=this;if(e.top!=null)return e.top;if(e.date!=null){const n=this.tilesElRef.current,r=n?.querySelector(`[data-date="${Mr(e.date)}"]`)?.parentElement;if(n&&r){const i=Math.round(r.getBoundingClientRect().top),a=Math.round(n.getBoundingClientRect().top);return i-a}}}}const ry=_(1,"month");function iy(t,e,n,s,r){const{start:i,end:a}=e.currentRange;let o=i;const l=[];for(;o.valueOf()<a.valueOf();){const c=n.add(o,ry),u={start:t.skipHiddenDays(o),end:t.skipHiddenDays(c,-1,!0)};let h=Ko({currentRange:u,snapToWeek:!0,fixedWeekCount:s,dateEnv:n});h={start:t.skipHiddenDays(h.start),end:t.skipHiddenDays(h.end,-1,!0)};const g=e.activeRange?Ae(e.activeRange,r?h:u):null;l.push({currentDate:e.currentDate,isValid:e.isValid,validRange:e.validRange,renderRange:h,activeRange:g,currentRange:u,currentRangeUnit:"month",isRangeAllDay:!0,dateIncrement:e.dateIncrement,slotMinTime:e.slotMaxTime,slotMaxTime:e.slotMinTime}),o=c}return l}const ay=V({year:"numeric",month:"long"}),oy=V({month:"long"});function ly(t,e){return t||(e[0].currentRange.start.getUTCFullYear()!==e[e.length-1].currentRange.start.getUTCFullYear()?ay:oy)}var cy={name:"multimonth",initialView:"multiMonthYear",views:{multiMonth:{component:sy,dateProfileGeneratorClass:Xo,multiMonthMaxColumns:3,singleMonthMinWidth:350},multiMonthYear:{type:"multiMonth",duration:{years:1},fixedWeekCount:!0,showNonCurrentDates:!1}}};const Zn=de();class dy{constructor(){this.getKeysForEventDefs=k(this._getKeysForEventDefs),this.splitDateSelection=k(this._splitDateSpan),this.splitEventStore=k(this._splitEventStore),this.splitIndividualUi=k(this._splitIndividualUi),this.splitEventDrag=k(this._splitInteraction),this.splitEventResize=k(this._splitInteraction),this.eventUiBuilders={}}splitProps(e){let n=this.getKeyInfo(e),s=this.getKeysForEventDefs(e.eventStore),r=this.splitDateSelection(e.dateSelection),i=this.splitIndividualUi(e.eventUiBases,s),a=this.splitEventStore(e.eventStore,s),o=this.splitEventDrag(e.eventDrag),l=this.splitEventResize(e.eventResize),c={};this.eventUiBuilders=xe(n,(u,h)=>this.eventUiBuilders[h]||k(uy));for(let u in n){let h=n[u],g=a[u]||Zn,m=this.eventUiBuilders[u];c[u]={businessHours:h.businessHours||e.businessHours,dateSelection:r[u]||null,eventStore:g,eventUiBases:m(e.eventUiBases[""],h.ui,i[u]),eventDrag:o[u]||null,eventResize:l[u]||null,eventSelection:g.instances[e.eventSelection]?e.eventSelection:""}}return c}_splitDateSpan(e){let n={};if(e){let s=this.getKeysForDateSpan(e);for(let r of s)n[r]=e}return n}_getKeysForEventDefs(e){return xe(e.defs,n=>this.getKeysForEventDef(n))}_splitEventStore(e,n){let{defs:s,instances:r}=e,i={};for(let a in s)for(let o of n[a])i[o]||(i[o]=de()),i[o].defs[a]=s[a];for(let a in r){let o=r[a];for(let l of n[o.defId])i[l]&&(i[l].instances[a]=o)}return i}_splitIndividualUi(e,n){let s={};for(let r in e)if(r)for(let i of n[r])s[i]||(s[i]={}),s[i][r]=e[r];return s}_splitInteraction(e){let n={};if(e){let s=this._splitEventStore(e.affectedEvents,this._getKeysForEventDefs(e.affectedEvents)),r=this._getKeysForEventDefs(e.mutatedEvents),i=this._splitEventStore(e.mutatedEvents,r),a=o=>{n[o]||(n[o]={affectedEvents:s[o]||Zn,mutatedEvents:i[o]||Zn,isEvent:e.isEvent})};for(let o in s)a(o);for(let o in i)a(o)}return n}}function uy(t,e,n){let s=[];t&&s.push(t),e&&s.push(e);let r={"":Xa(s)};return n&&Object.assign(r,n),r}class hy extends dy{getKeyInfo(){return{allDay:{},timed:{}}}getKeysForDateSpan(e){return e.allDay?["allDay"]:["timed"]}getKeysForEventDef(e){return e.allDay?rg(e)?["timed","allDay"]:["allDay"]:["timed"]}}class fy extends Po{sliceRange(e,n){let s=[];for(let r=0;r<n.length;r+=1){let i=Ae(e,n[r]);i&&s.push({startDate:i.start,endDate:i.end,isStart:i.start.valueOf()===e.start.valueOf(),isEnd:i.end.valueOf()===e.end.valueOf(),col:r})}return s}}function bt(t,e){let n=[],s;for(s=0;s<e;s+=1)n.push([]);if(t)for(s=0;s<t.length;s+=1)n[t[s].col].push(t[s]);return n}function ci(t,e){let n=[];if(t){for(let s=0;s<e;s+=1)n[s]={affectedInstances:t.affectedInstances,isEvent:t.isEvent,segs:[]};for(let s of t.segs)n[s.col].segs.push(s)}else for(let s=0;s<e;s+=1)n[s]=null;return n}const di=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}];function gy(t,e,n,s,r){let i=new Date(0),a=t,o=_(0),l=n||my(s),c=[],u=0;for(;Re(a)<Re(e);){let h=r.add(i,a),g=ks(o,l)!==null;c.push({date:h,time:a,key:h.toISOString(),isoTimeStr:rf(h),isLabeled:g,isFirst:u===0}),a=Kn(a,s),o=Kn(o,s),u+=1}return c}function my(t){let e,n,s;for(e=di.length-1;e>=0;e-=1)if(n=_(di[e]),s=ks(n,t),s!==null&&s>1)return n;return t}class ll extends B{constructor(){super(...arguments),this.innerElRef=w.createRef()}render(){let{props:e}=this,{options:n,viewApi:s}=this.context,r={text:n.allDayText,view:s,isNarrow:e.isNarrow};return d.jsx(q,{tag:"div",attrs:{role:"rowheader"},className:b(f.flexRow,f.noMargin,f.noPadding,f.contentBox),style:{width:e.width},renderProps:r,generatorName:"allDayHeaderContent",customGenerator:n.allDayHeaderContent,defaultGenerator:py,classNameGenerator:n.allDayHeaderClass,didMount:n.allDayHeaderDidMount,willUnmount:n.allDayHeaderWillUnmount,children:i=>d.jsx("div",{className:b(f.flexRow,f.noShrink,f.whiteSpacePre),ref:this.innerElRef,children:d.jsx(i,{tag:"div",className:R(n.allDayHeaderInnerClass,r)})})})}componentDidMount(){this._isUnmounting=!1;const{props:e}=this,n=this.innerElRef.current;this.disconnectInnerWidth=Zs(n,s=>{this._isUnmounting||L(e.innerWidthRef,s)})}componentWillUnmount(){this._isUnmounting=!0,this.disconnectInnerWidth(),L(this.props.innerWidthRef,null)}}function py(t){return t.text}class cl extends ye{constructor(){super(...arguments),this.heightRef=w.createRef(),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e}):this.context.unregisterInteractiveComponent(this)}}render(){return d.jsx(qo,{...this.props,rootElRef:this.handleRootEl,heightRef:this.heightRef})}queryHit(e,n,s,r){const{props:i,heightRef:a}=this,o=i.cells.length,{col:l,left:c,right:u}=Js(n,r,i.colWidth,o,e),h=i.cells[l],g=h.date,m=te(g,1);return{dateProfile:i.dateProfile,dateSpan:{range:{start:g,end:m},allDay:!0,...h.dateSpanProps},getDayEl:()=>Qs(this.rootEl,l),rect:{left:c,right:u,top:0,bottom:a.current},layer:0}}}function vy(t,e,n){let s=new Vo(t.renderRange,e);return new zo(s,!1,n)}function yy(t,e,n){let s=[];for(let r of t.headerDates)s.push({start:n.add(r,e.slotMinTime),end:n.add(r,e.slotMaxTime)});return s}function dl(t,e,n=0,s,r){if(!s||!r)return[void 0,!1];const i=Math.max(s+1,n),a=r/e;let o,l;return t&&a>=i?(o=!0,l=a):(o=!1,l=i),[l,o]}function fn(t,e,n){return n||(n=z(t)),ul(_(t.valueOf()-n.valueOf()),e)}function ul(t,e){const n=Re(e.slotMinTime),s=Re(e.slotMaxTime);let r=(t.milliseconds-n)/(s-n);return r=Math.max(0,r),r=Math.min(1,r),r}function ui(t,e,n,s,r,i,a){const o=[];if(r!=null){const l=r*s;for(const c of t){const u=fn(c.startDate,e,n),h=fn(c.endDate,e,n),g=u*l;let m=h*l,v=m-g;i!=null&&v<i&&(v=i,m=g+v),o.push({start:g,end:m,size:v,isShort:v<=a})}}return o}function Sy(t,e,n,s){const r=[];for(let c=0;c<t.length;c++){const u=e[c];u&&r.push({...t[c],start:u.start,end:u.end})}const i=new us(r,void 0,n,void 0,s);let a=Ey(i);a=Cy(a,1);const o=Ry(a),l=Xp(i.hiddenSegs);return[o,l]}function Ey(t){const{placementsByLevel:e}=t,n=sr((r,i)=>r+":"+i,(r,i)=>{let a=wy(t,r,i),[o,l]=hi(a,n),c=e[r][i];return[{...c,nextLevelNodes:o},c.thickness+l]}),[s]=hi(e.length?{level:0,lateralStart:0,lateralEnd:e[0].length}:null,n);return s}function hi(t,e){if(!t)return[[],0];let{level:n,lateralStart:s,lateralEnd:r}=t,i=s,a=[];for(;i<r;)a.push(e(n,i)),i+=1;return a.sort(by),[a.map(Dy),a[0][1]]}function by(t,e){return e[1]-t[1]}function Dy(t){return t[0]}function wy(t,e,n){let{levelCoords:s,placementsByLevel:r}=t,i=r[e][n],a=s[e]+i.thickness,o=s.length,l=e;for(;l<o&&s[l]<a;l+=1);for(;l<o;l+=1){let c=r[l],u,h=hs(c,i.start,ds),g=h[0]+h[1],m=g;for(;(u=c[m])&&u.start<i.end;)m+=1;if(g<m)return{level:l,lateralStart:g,lateralEnd:m}}return null}function Cy(t,e){const n=sr((s,r,i)=>In(s),(s,r,i)=>{let{nextLevelNodes:a,thickness:o}=s,l=o+i,c=o/l,u,h=[];if(!a.length)u=e;else for(let m of a)if(u===void 0){let v=n(m,r,l);u=v[0],h.push(v[1])}else{let v=n(m,u,0);h.push(v[1])}let g=(u-r)*c;return[u-g,{...s,thickness:g,nextLevelNodes:h}]});return t.map(s=>n(s,0,0)[1])}function Ry(t){let e=new Map;const n=sr((r,i,a)=>In(r),(r,i,a)=>{let o={...r,levelCoord:i,stackDepth:a,stackForward:0};return e.set(o.eventRange.instance.instanceId,o),o.stackForward=s(r.nextLevelNodes,i+r.thickness,a+1)});function s(r,i,a){let o=0;for(let l of r)o=Math.max(n(l,i,a)+1,o);return o}return s(t,0,0),e}function sr(t,e){const n={};return(...s)=>{let r=t(...s);return r in n?n[r]:n[r]=e(...s)}}const xy=V({hour:"numeric",minute:"2-digit",meridiem:!1});class hl extends B{render(){const{props:e}=this;return d.jsx(Ot,{...e,display:"column",level:e.level,isNarrow:e.isNarrow,isShort:e.isShort,className:e.isLiquid?f.liquid:"",disableLiquid:!e.isLiquid,defaultTimeFormat:xy})}}class Ty extends B{render(){let{props:e}=this;return d.jsx("div",{className:b(f.abs,f.flexCol),style:{top:e.top,height:e.height,insetInlineEnd:0,zIndex:9999},children:d.jsx(_o,{className:f.liquid,display:"column",allDayDate:null,segs:e.hiddenSegs,hiddenSegs:e.hiddenSegs,dateSpanProps:e.dateSpanProps,dateProfile:e.dateProfile,todayRange:e.todayRange,popoverContent:()=>fl(e.hiddenSegs,e,!1),forceTimed:!0,isNarrow:e.isNarrow,isMicro:e.isMicro})})}}const My=t=>d.jsx(Me.Consumer,{children:e=>{let{options:n}=e;return d.jsx("div",{className:b(t.className,n.nowIndicatorDotClass),style:t.style})}}),Iy=t=>d.jsx(Me.Consumer,{children:e=>{let{options:n}=e,s={date:e.dateEnv.toDate(t.date),view:e.viewApi};return d.jsx(q,{elRef:t.elRef,tag:t.tag||"div",attrs:t.attrs,className:t.className,style:t.style,renderProps:s,generatorName:"nowIndicatorLineContent",customGenerator:n.nowIndicatorLineContent,classNameGenerator:n.nowIndicatorLineClass,didMount:n.nowIndicatorLineDidMount,willUnmount:n.nowIndicatorLineWillUnmount,children:t.children})}});function Ny(t){const e=t.totalHeight!=null?t.totalHeight*fn(t.nowDate,t.dateProfile,t.dayDate):void 0;return d.jsxs("div",{className:f.fill,style:{zIndex:2,pointerEvents:"none"},children:[d.jsx(Iy,{className:b(f.fillX,f.noMarginX,f.borderlessX),style:{top:e},date:t.nowDate}),(t.showDot??!0)&&d.jsx(My,{className:b(f.abs,f.start0),style:{top:e}})]})}const rr=typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes("firefox");class Hy extends B{constructor(){super(...arguments),this.sortEventSegs=k(zs),this.getDateMeta=k(Je)}render(){let{props:e,context:n}=this,{options:s,dateEnv:r}=n,i=s.selectMirror,a=e.eventDrag&&e.eventDrag.segs||e.eventResize&&e.eventResize.segs||i&&e.dateSelectionSegs||[],o=this.getDateMeta(e.date,r,e.dateProfile,e.todayRange);const l=b(e.borderStart?f.borderOnlyS:f.borderNone,e.width==null&&f.liquid,f.rel),c={width:e.width,zIndex:1},u=this.getIsStack(),h={...o,...e.renderProps,isStack:u,isNarrow:e.isNarrow,isMajor:e.isMajor,view:n.viewApi};if(o.isDisabled)return d.jsx("div",{role:"gridcell","aria-disabled":!0,className:b(R(s.dayLaneClass,h),l),style:c});const g=b(R(s.dayLaneInnerClass,h),!u&&f.fill),m=this.sortEventSegs(e.fgEventSegs,s.eventOrder);return d.jsx(q,{tag:"div",attrs:{...e.attrs,role:"gridcell",...o.isToday?{"aria-current":"date"}:{},"data-date":mt(e.date)},className:l,style:c,renderProps:h,generatorName:void 0,classNameGenerator:s.dayLaneClass,didMount:s.dayLaneDidMount,willUnmount:s.dayLaneWillUnmount,children:()=>d.jsxs(d.Fragment,{children:[this.renderFillSegs(e.businessHourSegs,"non-business"),this.renderFillSegs(e.bgEventSegs,"bg-event"),this.renderFillSegs(e.dateSelectionSegs,"highlight"),d.jsx("div",{className:g,style:{zIndex:1},children:this.renderFgSegs(m,!1)}),!!a.length&&d.jsx("div",{className:g,style:{zIndex:1},children:this.renderFgSegs(a,!0)}),this.renderNowIndicator(e.nowIndicatorSegs)]})})}renderFgSegs(e,n){const{props:s}=this;return this.getIsStack()?fl(e,s,n):this.renderPositionedFgSegs(e,n)}renderPositionedFgSegs(e,n){let{props:s,context:r}=this,{date:i,dateProfile:a,eventSelection:o,todayRange:l,nowDate:c}=s,{eventMaxStack:u,eventShortHeight:h,eventOrderStrict:g,eventMinHeight:m}=r.options,v=ui(e,a,i,s.slatCnt,s.slatHeight,m,h),[p,y]=Sy(e,v,g,u);return d.jsxs(d.Fragment,{children:[e.map((D,x)=>{let{eventRange:C}=D,{instanceId:E}=C.instance,T=v[x]||{},N=p.get(E),I=!n&&N?this.computeSegHStyle(N):{left:0,right:0,zIndex:0},P=E===o;P&&(I.zIndex+=1e3);let H=!!(s.eventDrag&&s.eventDrag.affectedInstances[E]),j=!!(s.eventResize&&s.eventResize.affectedInstances[E]),G=!n&&(H||j||!N);return d.jsx("div",{className:b(f.abs,f.flexCol),style:{visibility:G?"hidden":void 0,top:T.start,height:T.size,...I},children:d.jsx(hl,{eventRange:C,slicedStart:D.startDate,slicedEnd:D.endDate,isStart:D.isStart,isEnd:D.isEnd,isDragging:H,isResizing:j,isMirror:n,isSelected:P,level:N?N.stackDepth:0,isNarrow:s.isNarrow,isShort:T.isShort||!1,isLiquid:!0,...$e(C,l,c)})},E)}),this.renderHiddenGroups(y)]})}renderHiddenGroups(e){let{dateSpanProps:n,dateProfile:s,todayRange:r,nowDate:i,eventSelection:a,eventDrag:o,eventResize:l,isNarrow:c,isMicro:u}=this.props;return d.jsx(d.Fragment,{children:e.map(h=>d.jsx(Ty,{hiddenSegs:h.segs,top:h.start,height:h.end-h.start,isNarrow:c,isMicro:u,dateSpanProps:n,dateProfile:s,todayRange:r,nowDate:i,eventSelection:a,eventDrag:o,eventResize:l},h.key))})}renderFillSegs(e,n){let{props:s,context:r}=this,i=ui(e,s.dateProfile,s.date,s.slatCnt,s.slatHeight,r.options.eventMinHeight,r.options.eventShortHeight);return d.jsx(d.Fragment,{children:e.map((a,o)=>{const{eventRange:l}=a,c=i[o]||{};return d.jsx("div",{className:f.fillX,style:{top:c.start,height:c.size,marginInlineStart:-1},children:n==="bg-event"?d.jsx(Oo,{eventRange:l,isStart:a.isStart,isEnd:a.isEnd,isNarrow:s.isNarrow,isShort:c.isShort||!1,isVertical:!0,...$e(l,s.todayRange,s.nowDate)}):Wo(n,r.options)},dg(l))})})}renderNowIndicator(e){let{props:n}=this;if(!(n.forPrint||this.getIsStack()))return e.map((s,r)=>d.jsx(Ny,{nowDate:s.startDate,dayDate:n.date,dateProfile:n.dateProfile,totalHeight:n.slatHeight!=null?n.slatHeight*n.slatCnt:void 0,showDot:s.showDot??!0},r))}computeSegHStyle(e){let{options:n}=this.context,s=n.slotEventOverlap,r=e.levelCoord,i=e.levelCoord+e.thickness;s&&(i=Math.min(1,r+(i-r)*2));let a={zIndex:e.stackDepth+1,insetInlineStart:Mt(r),insetInlineEnd:Mt(1-i),marginInlineEnd:void 0};return s&&e.stackForward&&(a.marginInlineEnd=20),a}getIsStack(){const{eventPrintLayout:e}=this.context.options;return this.props.forPrint&&(e==="stack"||e!=="grid"&&rr)}}function fl(t,{todayRange:e,nowDate:n,eventSelection:s,eventDrag:r,eventResize:i},a){return d.jsx(d.Fragment,{children:t.map(o=>{let{eventRange:l}=o,{instanceId:c}=l.instance,u=!!(r&&r.affectedInstances[c]),h=!!(i&&i.affectedInstances[c]),g=u||h;return d.jsx("div",{className:f.breakInsideAvoid,style:{visibility:g?"hidden":void 0},children:d.jsx(hl,{eventRange:l,slicedStart:o.startDate,slicedEnd:o.endDate,isStart:o.isStart,isEnd:o.isEnd,isDragging:u,isResizing:h,isMirror:a,isSelected:c===s,level:0,isShort:!1,isNarrow:!1,disableResizing:!0,...$e(l,e,n)})},c)})})}class ir extends ye{constructor(){super(...arguments),this.processSlotOptions=k(ky),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,isHitComboAllowed:this.props.isHitComboAllowed}):this.context.unregisterInteractiveComponent(this)}}render(){const{props:e}=this;return d.jsx("div",{role:e.role,className:b(e.className,f.flexRow),ref:this.handleRootEl,children:e.cells.map((n,s)=>d.jsx(Hy,{dateProfile:e.dateProfile,nowDate:e.nowDate,todayRange:e.todayRange,date:n.date,isMajor:n.isMajor,slatCnt:e.slatCnt,renderProps:n.renderProps,attrs:n.attrs,dateSpanProps:n.dateSpanProps,forPrint:e.forPrint,borderStart:!!s,isNarrow:e.cellIsNarrow,isMicro:e.cellIsMicro,fgEventSegs:e.fgEventSegsByCol[s],bgEventSegs:e.bgEventSegsByCol[s],businessHourSegs:e.businessHourSegsByCol[s],nowIndicatorSegs:e.nowIndicatorSegsByCol[s],dateSelectionSegs:e.dateSelectionSegsByCol[s],eventDrag:e.eventDragByCol[s],eventResize:e.eventResizeByCol[s],eventSelection:e.eventSelection,width:e.colWidth,slatHeight:e.slatHeight},n.key))})}queryHit(e,n,s,r){const{dateProfile:i,cells:a,colWidth:o,slatHeight:l}=this.props,{dateEnv:c,options:u}=this.context,{snapDuration:h,snapsPerSlot:g}=this.processSlotOptions(u.slotDuration,u.snapDuration),m=a.length,{col:v,left:p,right:y}=Js(n,r,o,m,e),D=a[v],x=Math.floor(s/l),C=x*l,E=(s-C)/l,T=Math.floor(E*g),N=x*g+T,I=Kn(i.slotMinTime,tf(h,N)),P=c.add(D.date,I),H=c.add(P,h);return{dateProfile:i,dateSpan:{range:{start:P,end:H},allDay:!1,...D.dateSpanProps},getDayEl:()=>Qs(this.rootEl,v),rect:{left:p,right:y,top:C,bottom:C+l},layer:0}}}ir.addPropsEquality({style:We});function ky(t,e){let n=e||t,s=ks(t,n);return s===null&&(n=t,s=1),{snapDuration:n,snapsPerSlot:s}}const Py=t=>d.jsx(Me.Consumer,{children:e=>{let{options:n}=e,s={date:e.dateEnv.toDate(t.date),view:e.viewApi};return d.jsx(q,{elRef:t.elRef,tag:t.tag||"div",attrs:t.attrs,className:t.className,style:t.style,renderProps:s,generatorName:"nowIndicatorHeaderContent",customGenerator:n.nowIndicatorHeaderContent,classNameGenerator:n.nowIndicatorHeaderClass,didMount:n.nowIndicatorHeaderDidMount,willUnmount:n.nowIndicatorHeaderWillUnmount,children:t.children})}});function gl(t){return d.jsx("div",{className:b(f.fill,f.crop),style:{zIndex:2,pointerEvents:"none"},children:d.jsx(Py,{className:f.abs,style:{top:t.totalHeight!=null?t.totalHeight*fn(t.nowDate,t.dateProfile):void 0},date:t.nowDate})})}const jy=V({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"});class ml extends B{constructor(){super(...arguments),this.createRenderProps=k(Ly),this.innerElRef=w.createRef()}render(){let{props:e,context:n}=this,{options:s}=n,r=s.slotHeaderFormat==null?jy:Array.isArray(s.slotHeaderFormat)?V(s.slotHeaderFormat[0]):V(s.slotHeaderFormat),i=this.createRenderProps(e.date,e.time,!e.isLabeled,e.isNarrow,e.isFirst,r,n),a=b(e.liquidHeight&&f.liquid,f.flexRow,f.alignStart,f.noMargin,f.noPadding,e.borderTop?f.borderOnlyT:f.borderNone);return e.isLabeled?d.jsx(q,{tag:"div",attrs:{"data-time":e.isoTimeStr},style:{height:e.height},className:a,renderProps:i,generatorName:"slotHeaderContent",customGenerator:s.slotHeaderContent,defaultGenerator:Ay,classNameGenerator:s.slotHeaderClass,didMount:s.slotHeaderDidMount,willUnmount:s.slotHeaderWillUnmount,children:o=>d.jsx("div",{ref:this.innerElRef,className:b(f.noShrink,f.whiteSpaceNoWrap,f.flexRow),children:d.jsx(o,{tag:"div",className:R(s.slotHeaderInnerClass,i)})})}):d.jsx("div",{className:b(R(s.slotHeaderClass,i),a),style:{height:e.height}})}componentDidMount(){this._isUnmounting=!1;const{props:e}=this,n=this.innerElRef.current;n&&(this.disconnectInnerSize=St(n,(s,r)=>{this._isUnmounting||(L(e.innerWidthRef,s),L(e.innerHeightRef,r))}))}componentWillUnmount(){const{props:e}=this;this._isUnmounting=!0,this.disconnectInnerSize&&(this.disconnectInnerSize(),L(e.innerWidthRef,null),L(e.innerHeightRef,null))}}function Ly(t,e,n,s,r,i,a){return{...Je(t,a.dateEnv),level:0,text:ie(a.dateEnv.formatToParts(t,i)),time:e,isMajor:!1,isMinor:n,isTime:!0,isNarrow:s,hasNavLink:!1,isFirst:r,view:a.viewApi}}function Ay(t){return t.text}class pl extends B{constructor(){super(...arguments),this.getDateMeta=k(Je)}render(){let{props:e,context:n}=this,{options:s}=n,r={...this.getDateMeta(e.date,n.dateEnv),time:e.time,isMajor:!1,isMinor:!e.isLabeled,view:n.viewApi};return d.jsx(q,{tag:"div",attrs:{"data-time":e.isoTimeStr},className:b(f.noMargin,f.noPadding,f.liquid,e.borderTop?f.borderOnlyT:f.borderNone),renderProps:r,generatorName:void 0,classNameGenerator:s.slotLaneClass,didMount:s.slotLaneDidMount,willUnmount:s.slotLaneWillUnmount})}}const Oy=V({week:"short"});class vl extends B{constructor(){super(...arguments),this.innerElRef=w.createRef()}render(){let{props:e,context:n}=this,{options:s,dateEnv:r}=n,i=e.dateProfile.renderRange,o=Xe(i.start,i.end)===1&&s.navLinks,l=i.start,c=vt(n,l,"week"),u=r.computeWeekNumber(l),h=r.formatToParts(l,s.weekNumberFormat||Oy),g=ie(h),m=r.toDate(l);const v={num:u,text:g,textParts:h,date:m,isNarrow:e.isNarrow,hasNavLink:o,options:{dayMinWidth:s.dayMinWidth}};return d.jsx(q,{tag:"div",attrs:{role:"gridcell","aria-label":c},className:b(f.flexRow,f.noMargin,f.noPadding,e.isLiquid?f.liquid:f.contentBox),style:{width:e.width},renderProps:v,generatorName:"weekNumberHeaderContent",customGenerator:s.weekNumberHeaderContent,defaultGenerator:Nn,classNameGenerator:s.weekNumberHeaderClass,didMount:s.weekNumberHeaderDidMount,willUnmount:s.weekNumberHeaderWillUnmount,children:p=>d.jsx("div",{ref:this.innerElRef,className:b(f.flexRow,f.noShrink,f.whiteSpaceNoWrap),children:d.jsx(p,{tag:"div",attrs:o?yt(n,i.start,"week",c):{"aria-label":c},className:R(s.weekNumberHeaderInnerClass,v)})})})}componentDidMount(){this._isUnmounting=!1;const{props:e}=this,n=this.innerElRef.current;this.disconnectInnerSize=St(n,(s,r)=>{this._isUnmounting||(L(e.innerWidthRef,s),L(e.innerHeightRef,r))})}componentWillUnmount(){const{props:e}=this;this._isUnmounting=!0,this.disconnectInnerSize(),L(e.innerWidthRef,null),L(e.innerHeightRef,null)}}function yl(t){return d.jsx("div",{role:"gridcell",className:t.isLiquid?f.liquid:f.contentBox,style:{width:t.width}})}class Sl extends B{constructor(){super(...arguments),this.state={headerTierHeights:[]},this.headerLabelInnerWidthRefMap=new le(()=>{re(this.handleAxisWidths)}),this.headerLabelInnerHeightRefMap=new le(()=>{re(this.handleHeaderHeights)}),this.headerMainInnerHeightRefMap=new le(()=>{re(this.handleHeaderHeights)}),this.handleAllDayLabelInnerWidth=e=>{this.allDayLabelInnerWidth=e,re(this.handleAxisWidths)},this.slatLabelInnerWidthRefMap=new le(()=>{re(this.handleAxisWidths)}),this.slatLabelInnerHeightRefMap=new le(()=>{re(this.handleSlatInnerHeights)}),this.headerScrollerRef=w.createRef(),this.allDayScrollerRef=w.createRef(),this.mainScrollerRef=w.createRef(),this.footScrollerRef=w.createRef(),this.axisScrollerRef=w.createRef(),this.handleTotalWidth=e=>{this._isUnmounting||this.setState({totalWidth:e})},this.handleBodyHeight=e=>{this._isUnmounting||this.setState({bodyHeight:e})},this.handleClientWidth=e=>{this._isUnmounting||this.setState({clientWidth:e})},this.handleClientHeight=e=>{this._isUnmounting||this.setState({clientHeight:e})},this.handleStickyBottomScrollbarWidth=e=>{this._isUnmounting||this.setState({sticykBottomScrollbarWidth:e})},this.handleHeaderHeights=()=>{if(this._isUnmounting)return;const e=this.headerLabelInnerHeightRefMap.current,n=this.headerMainInnerHeightRefMap.current,s=[];for(const[r,i]of n.entries())s[r]=Math.max(e.get(r)||0,i);this.setState({headerTierHeights:s})},this.handleSlatInnerHeights=()=>{if(this._isUnmounting)return;const e=this.slatLabelInnerHeightRefMap.current;let n=0;for(const s of e.values())n=Math.max(n,s);this.state.slatInnerHeight!==n&&this.setState({slatInnerHeight:n})},this.handleAxisWidths=()=>{if(this._isUnmounting)return;const e=this.headerLabelInnerWidthRefMap.current,n=this.slatLabelInnerWidthRefMap.current;let s=this.allDayLabelInnerWidth||0;for(const r of e.values())s=Math.max(s,r);for(const r of n.values())s=Math.max(s,r);this.state.axisWidth!==s&&this.setState({axisWidth:s})}}render(){const{props:e,state:n,context:s,headerLabelInnerWidthRefMap:r,headerLabelInnerHeightRefMap:i,headerMainInnerHeightRefMap:a,slatLabelInnerWidthRefMap:o,slatLabelInnerHeightRefMap:l}=this,{nowDate:c,headerTiers:u,forPrint:h}=e,g=c.valueOf()-z(c).valueOf(),{axisWidth:m,totalWidth:v,clientWidth:p,clientHeight:y,bodyHeight:D,sticykBottomScrollbarWidth:x}=n,{options:C}=s,{borderlessX:E,borderlessTop:T,borderlessBottom:N}=ve(C),I=v!=null&&p!=null&&m!=null?v-p-(m+1):void 0,P=!h&&!fe(C),H=!h&&Hn(C),j=!h&&yo(C),{eventPrintLayout:G}=C,U=G==="stack"||G!=="grid"&&rr,F=h&&!U,Z=h&&U,Q=e.cells.length,[X,ae]=Yo(Q,e.dayMinWidth,p),ne=ae!=null&&ae<=Wt,K=ne||ae!=null&&ae<=C.dayNarrowWidth,Se=e.slatMetas.length,[ge,Ie]=dl(P&&C.expandRows,Se,C.slotMinHeight,n.slatInnerHeight,y);this.slatHeight=ge;const A=(ge||0)*Se,J=F?A:void 0,oe=P&&!C.expandRows&&y!=null&&y>A,me=C.dayHeaders?u.length+1:1,W=j?x:D!=null&&y!=null?D-y:void 0;return d.jsxs(d.Fragment,{children:[C.dayHeaders&&d.jsxs("div",{className:b(R(C.tableHeaderClass,{isSticky:H,borderlessX:E,borderlessTop:T,borderlessBottom:N,multiMonthColumns:0}),f.flexCol,H&&f.tableHeaderSticky),style:{zIndex:1},children:[d.jsxs("div",{className:f.flexRow,children:[d.jsx("div",{role:"rowgroup",className:f.contentBox,style:{width:m},children:u.map((Y,ee)=>d.jsx("div",{role:"row","aria-rowindex":ee+1,className:b(C.dayHeaderRowClass,f.flexRow,f.contentBox,ee<e.headerTiers.length-1?f.borderOnlyB:f.borderNone),style:{height:n.headerTierHeights[ee]},children:C.weekNumbers&&Y.isDateRow?d.jsx(vl,{dateProfile:e.dateProfile,innerWidthRef:r.createRef(ee),innerHeightRef:i.createRef(ee),width:void 0,isLiquid:!0,isNarrow:K}):d.jsx(yl,{width:void 0,isLiquid:!0})},ee))}),d.jsx("div",{className:R(C.slotHeaderDividerClass,{inTableHeader:!0,options:{dayMinWidth:C.dayMinWidth}})}),d.jsxs(pe,{horizontal:!0,hideScrollbars:!0,className:b(f.flexRow,f.liquid),ref:this.headerScrollerRef,children:[d.jsx("div",{role:"rowgroup",className:X==null?f.liquid:"",style:{width:X},children:e.headerTiers.map((Y,ee)=>w.createElement(Pn,{...Y,key:ee,role:"row",rowIndex:ee,borderBottom:ee<e.headerTiers.length-1,height:n.headerTierHeights[ee],colWidth:ae,viewportWidth:p,innerHeightRef:a.createRef(ee),cellIsNarrow:K,cellIsMicro:ne,rowLevel:e.headerTiers.length-ee-1}))}),!!I&&d.jsx("div",{className:b(R(C.fillerClass,{inTableHeader:!0}),f.borderOnlyS),style:{minWidth:I}})]})]}),d.jsx("div",{className:R(C.dayHeaderDividerClass,{isSticky:H,multiMonthColumns:0,options:{allDaySlot:!!C.allDaySlot}})})]}),d.jsxs("div",{role:"rowgroup",className:b(R(C.tableBodyClass,{borderlessX:E,borderlessTop:T,borderlessBottom:N,multiMonthColumns:0}),f.flexCol,P&&f.liquid,f.isolate),style:{zIndex:0},children:[C.allDaySlot&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{role:"row","aria-rowindex":me,className:f.flexRow,style:{zIndex:1},children:[d.jsx(ll,{width:m,innerWidthRef:this.handleAllDayLabelInnerWidth,isNarrow:K}),d.jsx("div",{className:R(C.slotHeaderDividerClass,{inTableHeader:!1,options:{dayMinWidth:C.dayMinWidth}})}),d.jsxs(pe,{horizontal:!0,hideScrollbars:!0,className:b(f.flexRow,f.liquidX),ref:this.allDayScrollerRef,children:[d.jsx("div",{className:f.flexRow,style:{width:X},children:d.jsx(cl,{dateProfile:e.dateProfile,todayRange:e.todayRange,cells:e.cells,showDayNumbers:!1,forPrint:h,isHitComboAllowed:e.isHitComboAllowed,className:b(f.borderNone,f.liquidX),cellIsNarrow:K,cellIsMicro:ne,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:e.businessHourSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,colWidth:ae})}),!!I&&d.jsx("div",{className:b(R(C.fillerClass,{inTableHeader:!1}),f.borderOnlyS),style:{minWidth:I}})]})]}),d.jsx("div",{className:b(C.allDayDividerClass),style:{zIndex:2}})]}),d.jsxs("div",{role:"row","aria-rowindex":me+(C.allDaySlot?1:0),className:b(f.flexRow,f.rel,P&&f.liquid),style:{zIndex:0},children:[d.jsx(pe,{vertical:P,hideScrollbars:!0,className:b(f.flexCol,f.contentBox),style:{width:m},ref:this.axisScrollerRef,clientHeightRef:this.handleBodyHeight,children:!Z&&d.jsx(d.Fragment,{children:d.jsxs("div",{role:"rowheader","aria-label":C.timedText,className:b(f.flexCol,f.grow,f.rel),style:{height:J},children:[d.jsx("div",{"aria-hidden":!0,className:b(f.flexCol,P&&C.expandRows&&f.grow,F&&f.fillX),children:e.slatMetas.map((Y,ee)=>w.createElement(ml,{...Y,key:Y.key,innerWidthRef:o.createRef(Y.key),innerHeightRef:l.createRef(Y.key),borderTop:!!ee,isNarrow:K,height:Ie?void 0:ge,liquidHeight:Ie}))}),!h&&C.nowIndicator&&Ce(e.dateProfile.currentRange,c)&&g>=e.dateProfile.slotMinTime.milliseconds&&g<e.dateProfile.slotMaxTime.milliseconds&&d.jsx(gl,{nowDate:c,dateProfile:e.dateProfile,totalHeight:ge!=null?ge*Se:void 0}),!!(oe||W)&&d.jsx("div",{className:b(R(C.fillerClass,{inTableHeader:!1}),f.borderOnlyT,oe&&f.liquid),style:{minHeight:W}})]})})}),d.jsx("div",{className:R(C.slotHeaderDividerClass,{inTableHeader:!1,options:{dayMinWidth:C.dayMinWidth}})}),d.jsxs("div",{className:b(f.flexCol,f.liquid),children:[d.jsx(pe,{vertical:P,horizontal:!0,hideScrollbars:j||h,className:b(f.flexCol,f.rel,P&&f.liquid),ref:this.mainScrollerRef,clientWidthRef:this.handleClientWidth,clientHeightRef:this.handleClientHeight,children:d.jsxs("div",{className:b(f.flexCol,f.grow,f.rel),style:{width:X,height:J},children:[d.jsx(ir,{dateProfile:e.dateProfile,nowDate:e.nowDate,todayRange:e.todayRange,cells:e.cells,slatCnt:Se,forPrint:h,isHitComboAllowed:e.isHitComboAllowed,className:Z?"":f.fill,fgEventSegsByCol:e.fgEventSegsByCol,bgEventSegsByCol:e.bgEventSegsByCol,businessHourSegsByCol:e.businessHourSegsByCol,nowIndicatorSegsByCol:e.nowIndicatorSegsByCol,dateSelectionSegsByCol:e.dateSelectionSegsByCol,eventDragByCol:e.eventDragByCol,eventResizeByCol:e.eventResizeByCol,eventSelection:e.eventSelection,colWidth:ae,slatHeight:ge,cellIsNarrow:K,cellIsMicro:ne}),!Z&&d.jsxs(d.Fragment,{children:[d.jsx("div",{"aria-hidden":!0,className:b(f.flexCol,P&&C.expandRows&&f.grow,F?f.fillX:f.rel),children:e.slatMetas.map((Y,ee)=>d.jsx("div",{className:b(f.flexRow,Ie&&f.liquid),style:{height:Ie?"":ge},children:w.createElement(pl,{...Y,key:Y.key,borderTop:!!ee})},Y.key))}),oe&&d.jsx("div",{className:b(R(C.fillerClass,{inTableHeader:!1}),f.borderOnlyT,f.liquid)})]})]})}),!!j&&d.jsx(Zo,{isSticky:!0,canvasWidth:X,scrollerRef:this.footScrollerRef,scrollbarWidthRef:this.handleStickyBottomScrollbarWidth})]})]})]}),d.jsx(Et,{widthRef:this.handleTotalWidth})]})}componentDidMount(){this._isUnmounting=!1,this.initScrollers(),this.updateSlatHeight()}componentDidUpdate(){this.updateScrollers(),this.updateSlatHeight()}componentWillUnmount(){this._isUnmounting=!0,this.destroyScrollers(),this.prevSlatHeight=void 0,L(this.props.slatHeightRef,null)}updateSlatHeight(){this.prevSlatHeight!==this.slatHeight&&L(this.props.slatHeightRef,this.prevSlatHeight=this.slatHeight)}initScrollers(){const e=So(this.context.pluginHooks);this.dayScroller=new e(!0),this.timeScroller=new e,L(this.props.dayScrollerRef,this.dayScroller),L(this.props.timeScrollerRef,this.timeScroller),this.updateScrollers()}updateScrollers(){this.dayScroller.handleChildren([this.headerScrollerRef.current,this.allDayScrollerRef.current,this.mainScrollerRef.current,this.footScrollerRef.current]),this.timeScroller.handleChildren([this.axisScrollerRef.current,this.mainScrollerRef.current])}destroyScrollers(){L(this.props.dayScrollerRef,null),L(this.props.timeScrollerRef,null)}}Sl.addPropsEquality({headerTierHeights:lt});class Wy extends B{constructor(){super(...arguments),this.state={},this.headerLabelInnerWidthRefMap=new le(()=>{re(this.handleAxisInnerWidths)}),this.handleAllDayLabelInnerWidth=e=>{this.allDayLabelInnerWidth=e,re(this.handleAxisInnerWidths)},this.handleWeekNumberInnerWidth=e=>{this.weekNumberInnerWidth=e,re(this.handleAxisInnerWidths)},this.slatLabelInnerWidthRefMap=new le(()=>{re(this.handleAxisInnerWidths)}),this.slatLabelInnerHeightRefMap=new le(()=>{re(this.handleSlatInnerHeights)}),this.handleTotalWidth=e=>{this._isUnmounting||requestAnimationFrame(()=>{this._isUnmounting||this.setState({totalWidth:e})})},this.handleClientWidth=e=>{this._isUnmounting||this.setState({clientWidth:e})},this.handleClientHeight=e=>{this._isUnmounting||this.setState({clientHeight:e})},this.handleAxisInnerWidths=()=>{if(this._isUnmounting)return;const e=this.headerLabelInnerWidthRefMap.current,n=this.slatLabelInnerWidthRefMap.current;let s=Math.max(this.weekNumberInnerWidth||0,this.allDayLabelInnerWidth||0);for(const r of e.values())s=Math.max(s,r);for(const r of n.values())s=Math.max(s,r);this.state.axisWidth!==s&&this.setState({axisWidth:s})},this.handleSlatInnerHeights=()=>{if(this._isUnmounting)return;const e=this.slatLabelInnerHeightRefMap.current;let n=0;for(const s of e.values())n=Math.max(n,s);this.state.slatInnerHeight!==n&&this.setState({slatInnerHeight:n})}}render(){const{props:e,state:n,context:s,slatLabelInnerWidthRefMap:r,slatLabelInnerHeightRefMap:i,headerLabelInnerWidthRefMap:a}=this,{nowDate:o,forPrint:l}=e,c=o.valueOf()-z(o).valueOf(),{axisWidth:u,clientWidth:h,totalWidth:g}=n,{options:m}=s,{borderlessX:v,borderlessTop:p,borderlessBottom:y}=ve(m),D=g!=null&&h!=null&&!l?g-h:void 0,x=!l&&!fe(m),C=!l&&Hn(m),E=e.slatMetas.length,[T,N]=dl(x&&m.expandRows,E,m.slotMinHeight,n.slatInnerHeight,n.clientHeight);this.slatHeight=T;const I=(T||0)*E,P=x&&!m.expandRows&&n.clientHeight!=null&&n.clientHeight>I,{eventPrintLayout:H}=m,j=H==="stack"||H!=="grid"&&rr,G=l&&!j,U=l&&j,F=G?I:void 0,Z=e.cells.length,Q=h!=null?h/Z:void 0,X=Q!=null&&Q<=Wt,ae=X||Q!=null&&Q<=m.dayNarrowWidth;return d.jsxs(d.Fragment,{children:[m.dayHeaders&&d.jsxs("div",{role:"rowgroup",className:b(R(m.tableHeaderClass,{isSticky:C,borderlessX:v,borderlessTop:p,borderlessBottom:y,multiMonthColumns:0}),f.flexCol,C&&f.tableHeaderSticky),style:{zIndex:1},children:[e.headerTiers.map((ne,K)=>d.jsxs("div",{role:"row",className:f.flexRow,children:[d.jsx("div",{className:b(m.dayHeaderRowClass,f.flexRow,K<e.headerTiers.length-1?f.borderOnlyB:f.borderNone),children:m.weekNumbers&&ne.isDateRow?d.jsx(vl,{dateProfile:e.dateProfile,innerWidthRef:this.handleWeekNumberInnerWidth,innerHeightRef:a.createRef(K),width:u,isLiquid:!1,isNarrow:ae}):d.jsx(yl,{width:u,isLiquid:!1})}),d.jsx("div",{className:R(m.slotHeaderDividerClass,{inTableHeader:!0,options:{dayMinWidth:m.dayMinWidth}})}),d.jsx(Pn,{...ne,className:f.liquid,borderBottom:K<e.headerTiers.length-1,viewportWidth:h,cellIsNarrow:ae,cellIsMicro:X,rowLevel:e.headerTiers.length-K-1}),!!D&&d.jsx("div",{className:b(R(m.fillerClass,{inTableHeader:!0}),f.borderOnlyS),style:{minWidth:D}})]},K)),d.jsx("div",{className:R(m.dayHeaderDividerClass,{isSticky:C,multiMonthColumns:0,options:{allDaySlot:!!m.allDaySlot}})})]}),d.jsxs("div",{role:"rowgroup",className:b(R(m.tableBodyClass,{borderlessX:v,borderlessTop:p,borderlessBottom:y,multiMonthColumns:0}),f.flexCol,x&&f.liquid,f.isolate),style:{zIndex:0},children:[m.allDaySlot&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{role:"row",className:f.flexRow,style:{zIndex:1},children:[d.jsx(ll,{width:u,innerWidthRef:this.handleAllDayLabelInnerWidth,isNarrow:ae}),d.jsx("div",{className:R(m.slotHeaderDividerClass,{inTableHeader:!1,options:{dayMinWidth:m.dayMinWidth}})}),d.jsx(cl,{dateProfile:e.dateProfile,todayRange:e.todayRange,cells:e.cells,showDayNumbers:!1,forPrint:l,isHitComboAllowed:e.isHitComboAllowed,className:b(f.liquidX,f.borderNone),cellIsNarrow:ae,cellIsMicro:X,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:e.businessHourSegs,dateSelectionSegs:e.dateSelectionSegs,eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows}),!!D&&d.jsx("div",{className:b(R(m.fillerClass,{inTableHeader:!1}),f.borderOnlyS),style:{minWidth:D}})]}),d.jsx("div",{className:b(m.allDayDividerClass),style:{zIndex:2}})]}),d.jsx(pe,{vertical:x,className:b(f.flexCol,f.rel,x&&f.liquid),style:{zIndex:0},ref:e.timeScrollerRef,clientWidthRef:this.handleClientWidth,clientHeightRef:this.handleClientHeight,children:d.jsxs("div",{className:b(f.flexCol,f.grow,f.rel),style:{height:F},children:[d.jsxs("div",{role:"row",className:b(f.flexRow,!U&&f.fill),children:[d.jsx("div",{role:"rowheader","aria-label":m.timedText,className:f.contentBox,style:{width:u}}),d.jsx("div",{className:R(m.slotHeaderDividerClass,{inTableHeader:!1,options:{dayMinWidth:m.dayMinWidth}})}),d.jsx(ir,{dateProfile:e.dateProfile,nowDate:e.nowDate,todayRange:e.todayRange,cells:e.cells,slatCnt:E,forPrint:l,isHitComboAllowed:e.isHitComboAllowed,className:f.liquid,fgEventSegsByCol:e.fgEventSegsByCol,bgEventSegsByCol:e.bgEventSegsByCol,businessHourSegsByCol:e.businessHourSegsByCol,nowIndicatorSegsByCol:e.nowIndicatorSegsByCol,dateSelectionSegsByCol:e.dateSelectionSegsByCol,eventDragByCol:e.eventDragByCol,eventResizeByCol:e.eventResizeByCol,eventSelection:e.eventSelection,slatHeight:T,cellIsNarrow:ae,cellIsMicro:X})]}),!U&&d.jsxs(d.Fragment,{children:[d.jsx("div",{"aria-hidden":!0,className:b(f.flexCol,x&&m.expandRows&&f.grow,G?f.fillX:f.rel),children:e.slatMetas.map((ne,K)=>d.jsxs("div",{className:b(N&&f.liquid,f.flexRow),style:{height:N?void 0:T},children:[d.jsx("div",{className:f.flexCol,style:{width:u},children:w.createElement(ml,{...ne,key:ne.key,innerWidthRef:r.createRef(ne.key),innerHeightRef:i.createRef(ne.key),borderTop:!!K,isNarrow:ae})}),d.jsx("div",{className:R(m.slotHeaderDividerClass,{inTableHeader:!1,options:{dayMinWidth:m.dayMinWidth}}),style:{visibility:"hidden"}}),w.createElement(pl,{...ne,key:ne.key,borderTop:!!K})]},ne.key))}),P&&d.jsx("div",{className:b(R(m.fillerClass,{inTableHeader:!1}),f.borderOnlyT,f.liquid)}),!l&&m.nowIndicator&&Ce(e.dateProfile.currentRange,o)&&c>=e.dateProfile.slotMinTime.milliseconds&&c<e.dateProfile.slotMaxTime.milliseconds&&d.jsx(gl,{nowDate:o,dateProfile:e.dateProfile,totalHeight:T!=null?T*E:void 0})]})]})})]}),d.jsx(Et,{widthRef:this.handleTotalWidth})]})}componentDidMount(){this._isUnmounting=!1,this.updateSlatHeight()}componentDidUpdate(){this.updateSlatHeight()}componentWillUnmount(){this._isUnmounting=!0,this.prevSlatHeight=void 0,L(this.props.slatHeightRef,null)}updateSlatHeight(){this.prevSlatHeight!==this.slatHeight&&L(this.props.slatHeightRef,this.prevSlatHeight=this.slatHeight)}}function fi(t){return t.map(()=>[])}function gi(t){return t.map(()=>null)}class By extends B{constructor(){super(...arguments),this.buildSlatMetas=k(gy),this.dayScrollerRef=w.createRef(),this.timeScrollerRef=w.createRef(),this.scrollState={},this.handleSlatHeight=e=>{this._isUnmounting||(this.slatHeight=e,e!=null&&re(this.applyTimeScroll))},this.handleTimeScrollRequest=e=>{this.scrollState.time=e,this.scrollState.y=void 0,this.applyTimeScroll()},this.handleTimeScrollEnd=e=>{if(e){const n=this.timeScrollerRef.current.y;this.props.forPrint||(this.scrollState.y=n,this.scrollState.time=void 0)}},this.applyTimeScroll=()=>{const e=this.timeScrollerRef.current,{slatHeight:n,scrollState:s}=this;let{y:r,time:i}=s;r==null&&i&&n!=null&&e&&(r=ul(i,this.props.dateProfile)*(n*this.currentSlatCnt),r&&r++,s.y=r),r!=null&&e.scrollTo({y:r})}}render(){const{props:e,context:n}=this,{dateProfile:s}=e,{options:r,dateEnv:i}=n,{dayMinWidth:a}=r,{borderlessX:o,borderlessTop:l,borderlessBottom:c}=ve(r),u=this.buildSlatMetas(s.slotMinTime,s.slotMaxTime,r.slotHeaderInterval,r.slotDuration,i);this.currentSlatCnt=u.length;const h=e.forPrint?[]:e.businessHourSegs,g=e.forPrint?[]:e.dateSelectionSegs,m=e.forPrint?null:e.eventDrag,v=e.forPrint?null:e.eventResize,p=e.forPrint?fi(e.businessHourSegsByCol):e.businessHourSegsByCol,y=e.forPrint?fi(e.dateSelectionSegsByCol):e.dateSelectionSegsByCol,D=e.forPrint?gi(e.eventDragByCol):e.eventDragByCol,x=e.forPrint?gi(e.eventResizeByCol):e.eventResizeByCol,C={dateProfile:s,nowDate:e.nowDate,todayRange:e.todayRange,cells:e.cells,slatMetas:u,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed,headerTiers:e.headerTiers,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:h,dateSelectionSegs:g,eventDrag:m,eventResize:v,...Uy(r),fgEventSegsByCol:e.fgEventSegsByCol,bgEventSegsByCol:e.bgEventSegsByCol,businessHourSegsByCol:p,nowIndicatorSegsByCol:e.nowIndicatorSegsByCol,dateSelectionSegsByCol:y,eventDragByCol:D,eventResizeByCol:x,eventSelection:e.eventSelection,timeScrollerRef:this.timeScrollerRef,timeScrollState:this.scrollState,slatHeightRef:this.handleSlatHeight,borderlessX:o,borderlessBottom:c};return d.jsx(kn,{attrs:{role:"grid","aria-colcount":e.cells.length,"aria-labelledby":e.labelId,"aria-label":e.labelStr},className:b(e.className,R(r.tableClass,{borderlessX:o,borderlessTop:l,borderlessBottom:c,multiMonthColumns:0}),!e.forPrint&&f.flexCol,f.isolate),viewSpec:n.viewSpec,children:a?d.jsx(Sl,{...C,dayMinWidth:a,dayScrollerRef:this.dayScrollerRef}):d.jsx(Wy,{...C})})}componentDidMount(){this._isUnmounting=!1,this.resetScroll(),this.context.emitter.on("_timeScrollRequest",this.handleTimeScrollRequest);const e=this.timeScrollerRef.current;e&&e.addScrollEndListener(this.handleTimeScrollEnd)}componentDidUpdate(e){e.dateProfile!==this.props.dateProfile&&this.context.options.scrollTimeReset?this.resetScroll():e.forPrint&&!this.props.forPrint&&this.applyTimeScroll()}componentWillUnmount(){this._isUnmounting=!0,this.context.emitter.off("_timeScrollRequest",this.handleTimeScrollRequest);const e=this.timeScrollerRef.current;e&&e.removeScrollEndListener(this.handleTimeScrollEnd)}resetScroll(){this.handleTimeScrollRequest(this.context.options.scrollTime);const e=this.dayScrollerRef.current;e&&e.scrollTo({x:0})}}const _y=5;function Uy(t){let{dayMaxEvents:e,dayMaxEventRows:n}=t;return(e===!0||n===!0)&&(e=void 0,n=_y),{dayMaxEvents:e,dayMaxEventRows:n}}class Fy extends ye{constructor(){super(...arguments),this.createDayHeaderFormatter=k(er),this.buildTimeColsModel=k(vy),this.buildDayRanges=k(yy),this.buildDateRowConfigs=k(jo),this.splitFgEventSegs=k(bt),this.splitBgEventSegs=k(bt),this.splitBusinessHourSegs=k(bt),this.splitNowIndicatorSegs=k(bt),this.splitDateSelectionSegs=k(bt),this.splitEventDrag=k(ci),this.splitEventResize=k(ci),this.allDaySplitter=new hy,this.dayTableSlicer=new Ks,this.dayTimeColsSlicer=new fy}render(){const{props:e,context:n}=this,{dateProfile:s}=e,{options:r,dateProfileGenerator:i}=n,a=this.buildTimeColsModel(s,i,n.dateEnv),o=this.buildDayRanges(a,s,n.dateEnv),l=this.allDaySplitter.splitProps(e),c=this.dayTableSlicer.sliceProps(l.allDay,s,r.nextDayThreshold,n,a),u=this.dayTimeColsSlicer.sliceProps(l.timed,s,null,n,o),h=this.createDayHeaderFormatter(n.options.dayHeaderFormat,!0,a.colCount);return d.jsx(At,{unit:r.nowIndicator?"minute":"day",children:(g,m)=>{const v=a.cellRows[0].length,p=!e.forPrint&&r.nowIndicator&&this.dayTimeColsSlicer.sliceNowDate(g,s,r.nextDayThreshold,n,o),y=this.splitFgEventSegs(u.fgEventSegs,v),D=this.splitBgEventSegs(u.bgEventSegs,v),x=this.splitBusinessHourSegs(u.businessHourSegs,v),C=this.splitNowIndicatorSegs(p,v),E=this.splitDateSelectionSegs(u.dateSelectionSegs,v),T=this.splitEventDrag(u.eventDrag,v),N=this.splitEventResize(u.eventResize,v),I=this.buildDateRowConfigs(a.headerDates,!0,e.dateProfile,m,h,n);return d.jsx(By,{labelId:e.labelId,labelStr:e.labelStr,dateProfile:s,nowDate:g,todayRange:m,cells:a.cellRows[0],forPrint:e.forPrint,className:e.className,headerTiers:I,fgEventSegs:c.fgEventSegs,bgEventSegs:c.bgEventSegs,businessHourSegs:c.businessHourSegs,dateSelectionSegs:c.dateSelectionSegs,eventDrag:c.eventDrag,eventResize:c.eventResize,fgEventSegsByCol:y,bgEventSegsByCol:D,businessHourSegsByCol:x,nowIndicatorSegsByCol:C,dateSelectionSegsByCol:E,eventDragByCol:T,eventResizeByCol:N,eventSelection:e.eventSelection})}})}}var Vy={name:"timegrid",initialView:"timeGridWeek",deps:[Jo],views:{timeGrid:{component:Fy,usesMinMaxTime:!0,allDaySlot:!0,slotDuration:"00:30:00",slotEventOverlap:!0},timeGridDay:{type:"timeGrid",duration:{days:1}},timeGridWeek:{type:"timeGrid",duration:{weeks:1}}}};const zy=60,Gy=6e4,Yy=864e5;function qy(t,e,n){return n?El(t):{date:t.slice(0,10),startTime:t.slice(11,16),endTime:e.slice(11,16),allDay:!1}}function $y(t,e){if(e)return El(t);const n=t.slice(11,16);return{date:t.slice(0,10),startTime:n,endTime:Nl(n,zy),allDay:!1}}function El(t){return{date:t.slice(0,10),startTime:"",endTime:"",allDay:!0}}function Zy(t,e,n,s){const r=Date.parse(e)-Date.parse(t);return n?Math.round(r/Yy)>1:r/Gy>s}const Xy=[Jo,Vy,ty,cy,zv],mi={year:"multiMonthYear",month:"dayGridMonth",week:"timeGridWeek",day:"timeGridDay",agenda:"listWeek"},Ky={year:{weekday:"narrow"},month:{weekday:"short"},week:{weekday:"short",day:"numeric"},day:{weekday:"short",day:"numeric"},agenda:{weekday:"short",day:"numeric"}},Jy=new Set(["year","month","agenda"]),Qy={comfortable:{slotMinutes:30,slotMinHeight:26,eventShortHeight:34},compact:{slotMinutes:60,slotMinHeight:15,eventShortHeight:22}},bl="cal-1",eS={color:bl,rsvp:"accepted",status:"confirmed",hasThread:!1,isRecurring:!1,zoneCertainty:"local"};function tS(t){return{id:t.id,title:t.title,start:t.start,end:t.end,allDay:t.allDay}}function nS({view:t,date:e,events:n,colorByCalendarId:s,density:r,selectedEventId:i,timeZone:a,now:o,onSelectEvent:l,onPickSlot:c,onRangeChange:u,className:h}){const g=w.useRef(null);w.useEffect(()=>{g.current?.getApi().changeView(mi[t])},[t]),w.useEffect(()=>{g.current?.getApi().gotoDate(e)},[e]);const m=w.useMemo(()=>n.map(tS),[n]),v=w.useMemo(()=>new Map(n.map(E=>[E.id,{color:s[E.calendarId]??bl,rsvp:E.myRsvp,status:E.status,hasThread:E.threadId!=="",isRecurring:E.recurrenceRule!=="",zoneCertainty:E.zoneCertainty}])),[n,s]),p=w.useMemo(()=>E=>v.get(E)??eS,[v]),y=w.useMemo(()=>E=>E.event.allDay||Jy.has(t),[t]),D=w.useMemo(()=>E=>{const T=p(E.event.id),N=y(E);return O(ua({color:T.color,layout:N?"row":"column",density:"compact",rsvp:T.rsvp,status:T.status,selected:E.event.id===i,stacked:!1}),"cursor-pointer outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring",N?"my-px px-1 py-0":"px-1 py-0.5")},[p,y,i]),x=Qy[r],C=r==="compact";return d.jsx("div",{className:O("h-full min-h-0 w-full text-fg",h),children:d.jsx(lp,{ref:g,plugins:Xy,initialView:mi[t],initialDate:e,now:o,timeZone:a,height:"100%",headerToolbar:!1,firstDay:1,nowIndicator:!0,selectable:!0,selectMirror:!0,editable:!1,eventInteractive:!0,expandRows:!0,allDayText:"All day",dayMaxEvents:C?2:3,eventMaxStack:3,moreLinkClick:"popover",moreLinkText:E=>`+${E}`,slotMinTime:"07:00:00",slotMaxTime:"23:00:00",scrollTime:"08:30:00",scrollTimeReset:!1,slotDuration:{minutes:x.slotMinutes},slotMinHeight:x.slotMinHeight,eventShortHeight:x.eventShortHeight,displayEventEnd:!1,eventTimeFormat:{hour:"2-digit",minute:"2-digit",hour12:!1},slotHeaderFormat:{hour:"2-digit",minute:"2-digit",hour12:!1},dayHeaderFormat:Ky[t],events:m,eventClick:E=>l(E.event.id),dateClick:E=>c($y(E.dateStr,E.allDay)),select:E=>{if(!Zy(E.startStr,E.endStr,E.allDay,x.slotMinutes)){E.view.calendar.unselect();return}c(qy(E.startStr,E.endStr,E.allDay))},datesSet:E=>u(E.view.title),viewClass:"bg-surface",tableClass:"border-line",tableHeaderClass:"bg-surface",fillerClass:"border-line",dayHeaderRowClass:"h-pane-header",dayHeaderClass:E=>O("border-b border-line bg-surface",E.isToday?"text-accent":"text-fg-subtle"),dayHeaderInnerClass:"px-1 py-1 text-2xs font-semibold uppercase tracking-wider",dayHeaderDividerClass:"border-b border-line",dayCellClass:E=>O("border-line",E.isOther&&"bg-surface-sunken"),dayLaneClass:E=>O(E.isToday&&"bg-accent-soft/40"),dayCellTopInnerClass:E=>O("px-1 py-0.5 text-2xs tabular-nums",E.isToday?"font-semibold text-accent":"text-fg-muted"),dayRowClass:"border-line",slotLaneClass:E=>O("border-line",E.isMinor&&"border-dashed"),slotHeaderClass:"border-line",slotHeaderInnerClass:"pr-1.5 text-2xs tabular-nums text-fg-subtle",slotHeaderDividerClass:"border-r border-line",allDayHeaderClass:"border-line",allDayHeaderInnerClass:"px-1 text-2xs uppercase tracking-wider text-fg-subtle",allDayDividerClass:"border-b border-line-strong",nonBusinessHoursClass:"bg-surface-sunken",highlightClass:"bg-accent-soft",nowIndicatorLineClass:"border-t border-danger",nowIndicatorDotClass:"bg-danger",moreLinkClass:"rounded-sm bg-surface-sunken text-2xs font-semibold text-fg-muted hover:bg-line hover:text-fg",moreLinkInnerClass:"px-1 py-0.5",popoverClass:"rounded-lg border border-line bg-surface-raised shadow-xl shadow-black/20",popoverCloseClass:"text-fg-subtle hover:text-fg",listDaysClass:"bg-surface",listDayClass:"border-line",listDayHeaderClass:"border-y border-line bg-surface-sunken",listDayHeaderInnerClass:"flex h-section-row items-center px-row-inset text-2xs font-semibold uppercase tracking-wider text-fg-subtle",listDayBodyClass:"border-line",noEventsClass:"p-10 text-center",noEventsInnerClass:"text-sm text-fg-muted",noEventsContent:"Nothing scheduled",singleMonthClass:"p-2",singleMonthHeaderClass:"pb-1",singleMonthHeaderInnerClass:"text-xs font-semibold text-fg",eventClass:D,listItemEventClass:D,eventContent:E=>{const T=p(E.event.id),N=E.timeText!==""&&!C&&!E.isNarrow;return d.jsx(ha,{title:E.event.title,timeText:N?E.timeText:"",layout:y(E)?"row":"column",rsvp:T.rsvp,hasThread:T.hasThread,isRecurring:T.isRecurring,zoneCertainty:T.zoneCertainty})}})})}const Dl="remit:calendar-density",pi="comfortable";function sS(){try{return localStorage.getItem(Dl)==="compact"?"compact":pi}catch{return pi}}function rS(t){try{localStorage.setItem(Dl,t)}catch{}}const iS=t=>t==="compact"?"pills":"detail";function aS({days:t,calendars:e,density:n,today:s,anchorDate:r,now:i,selectedEventId:a,freeOn:o,loadingDates:l,error:c,onRetry:u,scrollTarget:h,onSelectEvent:g,onPickSlot:m,onZoomDay:v,onGoToDate:p,onReachStart:y,onReachEnd:D,atStartCap:x,atEndCap:C,onLoadEarlier:E,onLoadLater:T,onVisibleDayChange:N}){const I=w.useMemo(()=>Nu(t,i),[t,i]),P=!l.has(s);return c!=null?d.jsx("div",{className:"flex h-full items-center justify-center bg-surface",children:d.jsx(xi,{title:"Couldn't load these days",error:c,onRetry:u})}):d.jsx(Wu,{days:t,calendars:e,density:iS(n),today:s,focusDate:r,selectedEventId:a,freeOn:o,loadingDates:l,scrollTarget:h,onSelectEvent:g,onPickSlot:m,onZoomDay:v,onReachStart:y,onReachEnd:D,atStartCap:x,atEndCap:C,onLoadEarlier:E,onLoadLater:T,onVisibleDayChange:N,todayLead:P?d.jsx("div",{className:"border-b border-line bg-surface-sunken p-3",children:d.jsx(Qu,{nextUp:I,calendars:e,today:s,onSelectEvent:g,onGoTo:p})}):void 0})}const oS=24,wl=7,lS=52,gn=lS*7,Cl=t=>({from:be(t,-10),to:be(t,oS),floor:be(t,-gn),ceiling:be(t,gn)}),Rl=t=>t.from<=t.floor,xl=t=>t.to>=t.ceiling,cS=(t,e)=>t>e?t:e,dS=(t,e)=>t<e?t:e,Tl=t=>Rl(t)?t:{...t,from:cS(be(t.from,-wl),t.floor)},Ml=t=>xl(t)?t:{...t,to:dS(be(t.to,wl),t.ceiling)},uS=t=>Tl({...t,floor:be(t.from,-gn)}),hS=t=>Ml({...t,ceiling:be(t.to,gn)});function fS(t,e){return e>=t.from&&e<=t.to?t:Cl(e)}function gS(t){const e=new Map;for(const n of t){const s=bi("week",n);e.has(s.from)||e.set(s.from,s)}return[...e.values()]}const vi=t=>bi("week",t).from,mS=1440,yi=t=>t.getHours()*60+t.getMinutes();function pS(t,e){const n=new Set(t),s=new Map;for(const r of e){const i=new Date(r.start),a=new Date(r.end);if(Number.isNaN(i.getTime())||Number.isNaN(a.getTime())||a.getTime()<=i.getTime())continue;const o=qt(i),l=qt(new Date(a.getTime()-1));for(let c=o;c<=l;c=be(c,1)){if(!n.has(c))continue;const u=c===o?yi(i):0,h=qt(a)===c?yi(a):mS;if(h<=u)continue;const g=s.get(c);g?g.push({from:u,to:h}):s.set(c,[{from:u,to:h}])}}for(const[r,i]of s)s.set(r,vS(i));return s}function vS(t){const e=[...t].sort((s,r)=>s.from-r.from),n=[];for(const s of e){const r=n[n.length-1];if(r&&s.from<=r.to){r.to=Math.max(r.to,s.to);continue}n.push({...s})}return n}function yS(t,e){const n=pS(t,e);return new Map(t.map(s=>[s,da(s,n.get(s)??[])]))}const SS=t=>pu(t.from,t.to),ES=kl(400,404);function bS(t){const e=Zl({queries:t.map(o=>({...Hl({query:{from:o.from,to:o.to}}),meta:ES,staleTime:Vl}))}),n=t.map(o=>o.from).join("|"),s=e.map(o=>o.data),r=e.map(o=>o.isPending).join("|"),i=w.useMemo(()=>s.flatMap(o=>o?.items??[]),[n,r]),a=w.useMemo(()=>{const o=new Set;return t.forEach((l,c)=>{e[c]?.isPending&&o.add(l.from)}),o},[n,r]);return{spans:i,pendingWindows:a,error:e.find(o=>o.error)?.error??null,refetch:()=>{for(const o of e)o.error&&o.refetch()}}}const DS=400;function wS({density:t,onPickSlot:e}){const{date:n,calendarIds:s}=Di(),{openEvent:r,setAnchorDate:i,zoomToDay:a}=wi(),o=Ci(),[l]=w.useState(()=>new Date),c=w.useMemo(()=>qt(l),[l]),u=w.useMemo(()=>l.toISOString(),[l]),[h,g]=w.useState(()=>Cl(n)),[m,v]=w.useState(),[p,y]=w.useState(n),D=w.useRef(0),x=w.useRef(n),C=w.useCallback(W=>{x.current=W,y(W),g(Y=>fS(Y,W)),D.current+=1,v({date:W,token:D.current})},[]);w.useEffect(()=>{n!==x.current&&C(n)},[n,C]);const E=Xl(p,DS);w.useEffect(()=>{E!==x.current&&(x.current=E,i(E))},[E,i]);const T=w.useMemo(()=>SS(h),[h]),N=w.useMemo(()=>gS(T),[T]),{calendars:I,timeZoneByCalendarId:P,shown:H,narrowed:j,resolved:G,isLoading:U}=zl(s),F=Gl(N,j,G),Z=bS(N),Q=Yl(F.instances,P,H),X=w.useMemo(()=>T.map(W=>xu(W,Q,c)),[T,Q,c]),ae=w.useMemo(()=>{const W=new Set;if(U||!G)return new Set(T);for(const Y of T)F.pendingWindows.has(vi(Y))&&W.add(Y);return W},[T,F.pendingWindows,U,G]),ne=w.useMemo(()=>yS(T,Z.spans),[T,Z.spans]),K=w.useCallback(W=>Z.pendingWindows.has(vi(W.date))?rn(W):ne.get(W.date)??rn(W),[ne,Z.pendingWindows]),Se=w.useCallback(W=>{C(W),i(W)},[C,i]),ge=w.useCallback(W=>{const Y=Ol(W);r(Y.calendarObjectId,Y.recurrenceId)},[r]),Ie=w.useCallback(()=>g(Tl),[]),A=w.useCallback(()=>g(Ml),[]),J=w.useCallback(()=>g(uS),[]),oe=w.useCallback(()=>g(hS),[]),me=w.useCallback(()=>{F.refetch(),Z.refetch()},[F.refetch,Z.refetch]);return d.jsx(aS,{days:X,calendars:I,density:t,today:c,anchorDate:n,now:u,selectedEventId:o?Ri(o.calendarObjectId,o.recurrenceId??""):"",freeOn:K,loadingDates:ae,error:F.error??Z.error,onRetry:me,scrollTarget:m,onSelectEvent:ge,onPickSlot:e,onZoomDay:a,onGoToDate:Se,onReachStart:Ie,onReachEnd:A,atStartCap:Rl(h),atEndCap:xl(h),onLoadEarlier:J,onLoadLater:oe,onVisibleDayChange:y})}const CS={year:"The year grid arrives with the rest of the zoom ladder.",month:"The month grid arrives with the rest of the zoom ladder."};function RS({view:t}){return d.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-surface p-8 text-center","data-testid":`calendar-placeholder-${t}`,children:[d.jsx(nc,{className:"size-8 text-fg-subtle","aria-hidden":"true"}),d.jsx("p",{className:"text-sm font-medium text-fg",children:"Not built yet"}),d.jsxs("p",{className:"max-w-xs text-sm text-fg-muted",children:[CS[t]??"This view arrives in a later stage."," Week, Day and Agenda work now."]})]})}const xS=[{value:"comfortable",label:"Detail"},{value:"compact",label:"Glance"}];function TS(t,e){const n=new Date(`${e}T00:00:00`);return t==="year"?new Intl.DateTimeFormat(void 0,{year:"numeric"}).format(n):t==="day"?new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"long",year:"numeric"}).format(n):new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}).format(n)}function MS({view:t,date:e,events:n,colorByCalendarId:s,agenda:r,isLoading:i=!1,error:a,onRetry:o,density:l,selectedEventId:c,timeZone:u,now:h,onChangeView:g,onToday:m,onChangeDensity:v,onSelectEvent:p,onPickSlot:y,onStep:D}){const x=w.useId(),[C,E]=w.useState({key:"",title:""}),T=`${t}/${e}`,N=C.key===T?C.title:TS(t,e);return d.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-surface",children:[d.jsxs("div",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-2",children:[d.jsx(ec,{}),d.jsxs(Ju,{title:N,onPrev:()=>D(-1),onNext:()=>D(1),onToday:m,children:[d.jsxs("fieldset",{className:"inline-flex items-center gap-0.5",children:[d.jsx("legend",{className:"sr-only",children:"Calendar density"}),xS.map(I=>d.jsxs("label",{className:`${Sa(l===I.value)} h-7 text-xs`,children:[d.jsx("input",{type:"radio",name:x,value:I.value,checked:l===I.value,onChange:()=>v(I.value),className:"sr-only"}),I.label]},I.value))]}),d.jsx(Ku,{value:t,onChange:g})]})]}),Ei(t)?d.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:r}):d.jsx("div",{className:"min-h-0 flex-1",children:a!=null?d.jsx("div",{className:"flex h-full items-center justify-center",children:d.jsx(xi,{title:"Couldn't load this week",error:a,onRetry:o})}):i?d.jsx("div",{role:"status","aria-label":"Loading the calendar",className:"flex h-full items-center justify-center bg-surface",children:d.jsx(Pl,{className:"size-6 animate-spin text-fg-subtle"})}):jl(t)?d.jsx(nS,{view:t,date:e,events:n,colorByCalendarId:s,density:l,selectedEventId:c,timeZone:u,now:h,onSelectEvent:p,onPickSlot:y,onRangeChange:I=>E({key:T,title:I})}):d.jsx(RS,{view:t})})]})}function FS(){const{view:t,date:e,calendarIds:n}=Di(),s=!Ei(t),{events:r,colorByCalendarId:i,isLoading:a,error:o,retry:l,instanceOf:c}=ql({view:t,date:e,calendarIds:n,enabled:s}),{goToView:u,goToToday:h,step:g,openEvent:m,openComposer:v}=wi(),p=Ci(),y=Wl(),[D,x]=w.useState(sS),C=w.useCallback(H=>{rS(H),x(H)},[]),[E,T]=w.useState(void 0),N=w.useCallback(H=>{const j=c(H);m(j.calendarObjectId,j.recurrenceId)},[c,m]),I=w.useCallback(H=>{T(H),v()},[v]),P=d.jsx(MS,{view:t,date:e,events:r,colorByCalendarId:i,agenda:d.jsx(wS,{density:D,onPickSlot:I}),isLoading:a,error:o,onRetry:l,density:D,selectedEventId:p?Ri(p.calendarObjectId,p.recurrenceId??""):"",timeZone:Bl(),now:new Date().toISOString(),onChangeView:u,onToday:h,onStep:g,onChangeDensity:C,onSelectEvent:N,onPickSlot:I});return d.jsx(Kl,{pick:E,children:d.jsx(Jl,{workspace:P,reading:d.jsx(Ll,{}),hasOpenEvent:p!==void 0||y})})}export{FS as component};
|