@daxence/flexy-date-picker 1.0.0 → 1.0.2
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/dist/features/date-picker/components/calendar/calendar.d.ts +7 -0
- package/dist/features/date-picker/components/calendar/index.d.ts +1 -0
- package/dist/features/date-picker/components/calendar-day/calendar-day.d.ts +7 -0
- package/dist/features/date-picker/components/calendar-day/index.d.ts +1 -0
- package/dist/features/date-picker/components/calendar-header/calendar-header.d.ts +7 -0
- package/dist/features/date-picker/components/calendar-header/index.d.ts +1 -0
- package/dist/features/date-picker/components/calendar-legend/calendar-legend.d.ts +11 -0
- package/dist/features/date-picker/components/calendar-legend/calendar-legend.stories.d.ts +17 -0
- package/dist/features/date-picker/components/calendar-legend/index.d.ts +2 -0
- package/dist/features/date-picker/components/date-input/date-input.d.ts +20 -0
- package/dist/features/date-picker/components/date-input/index.d.ts +1 -0
- package/dist/features/date-picker/components/date-picker/date-picker.d.ts +2 -0
- package/dist/features/date-picker/components/date-picker/date-picker.stories.d.ts +525 -0
- package/dist/features/date-picker/components/date-picker/index.d.ts +1 -0
- package/dist/features/date-picker/components/tooltip/index.d.ts +1 -0
- package/dist/features/date-picker/components/tooltip/tooltip.d.ts +15 -0
- package/dist/features/date-picker/context/date-picker-context.d.ts +30 -0
- package/dist/features/date-picker/context/index.d.ts +2 -0
- package/dist/features/date-picker/index.d.ts +10 -0
- package/dist/features/date-picker/styles/theme-vars.d.ts +3 -0
- package/dist/features/date-picker/types/date-picker.types.d.ts +355 -0
- package/dist/features/date-picker/types/index.d.ts +1 -0
- package/dist/features/date-picker/utils/date-utils.d.ts +37 -0
- package/dist/features/date-picker/utils/index.d.ts +1 -0
- package/dist/features/time-picker/components/time-picker/index.d.ts +2 -0
- package/dist/features/time-picker/components/time-picker/time-picker.d.ts +61 -0
- package/dist/features/time-picker/components/time-picker/time-picker.stories.d.ts +62 -0
- package/dist/features/time-picker/components/time-slot-list/index.d.ts +2 -0
- package/dist/features/time-picker/components/time-slot-list/time-slot-list.d.ts +16 -0
- package/dist/features/time-picker/index.d.ts +4 -0
- package/dist/flexy-date-picker.js +1518 -1541
- package/dist/flexy-date-picker.js.map +1 -1
- package/dist/flexy-date-picker.umd.cjs +2 -2
- package/dist/flexy-date-picker.umd.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/shared/utils/cx.d.ts +2 -0
- package/dist/styles.d.ts +1 -0
- package/package.json +11 -10
- package/dist/types/index.d.ts +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(K,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react/jsx-runtime"),require("react"),require("dayjs"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","dayjs","react-dom"],y):(K=typeof globalThis<"u"?globalThis:K||self,y(K.FlexyDatePicker={},K.jsxRuntime,K.React,K.dayjs,K.ReactDOM))})(this,function(K,y,$,Q,lr){"use strict";function Jt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const h=Jt($),Qt=Jt(lr);var en=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nn={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(en,function(){return function(n,r,o){r.prototype.isToday=function(){var i="YYYY-MM-DD",s=o();return this.format(i)===s.format(i)}}})})(nn);var cr=nn.exports;const ar=tn(cr);var rn={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(en,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,i){var s=o.prototype,l=s.format;i.en.formats=n,s.format=function(a){a===void 0&&(a="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,f=function(d,p){return d.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(u,v,m){var b=m&&m.toUpperCase();return v||p[m]||n[m]||p[b].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(g,E,S){return E||S.slice(1)})})}(a,c===void 0?{}:c);return l.call(this,f)}}})})(rn);var ur=rn.exports;const fr=tn(ur),vt=$.createContext(null);function ze(){const e=$.useContext(vt);if(!e)throw new Error("useDatePickerContext must be used inside <DatePicker>");return e}function U(...e){return e.filter(Boolean).join(" ")}function ce(e,t){return!e||!t?!1:e.isSame(t,"day")}function qe(e,t,n){if(!t||!n)return!1;const r=t.isBefore(n)?t:n,o=t.isBefore(n)?n:t;return e.isAfter(r,"day")&&e.isBefore(o,"day")}function ht(e,t){if(!t.start)return!1;const n=t.end&&t.start.isAfter(t.end)?t.end:t.start;return ce(e,n)}function gt(e,t){if(!t.end)return!1;const n=t.start&&t.start.isAfter(t.end)?t.start:t.end;return ce(e,n)}function dr(e,t){return!t.start||!t.end?!1:ht(e,t)||gt(e,t)||qe(e,t.start,t.end)}function on(e,t){var n,r;return t===!0?!0:t?!!(t.before&&e.isBefore(t.before,"day")||t.after&&e.isAfter(t.after,"day")||(n=t.dates)!=null&&n.some(o=>ce(e,o))||(r=t.predicate)!=null&&r.call(t,e)):!1}function sn(e,t,n=0){const r=Q(new Date(e,t,1)),o=r.endOf("month");let i=r.day()-n;i<0&&(i+=7);const s=i+o.date(),l=s%7===0?0:7-s%7,a=[];for(let c=i;c>0;c--)a.push(r.subtract(c,"day"));for(let c=1;c<=o.date();c++)a.push(Q(new Date(e,t,c)));for(let c=1;c<=l;c++)a.push(o.add(c,"day"));return a}function ln(e=0,t){const n=Q().locale(t??"en"),r=[];for(let o=0;o<7;o++){const i=(e+o)%7;r.push(n.day(i).format("dd"))}return r}function cn(e){const t=Q().locale(e??"en");return Array.from({length:12},(n,r)=>t.month(r).format("MMMM"))}function pr(e=50){const t=Q().year(),n=[];for(let r=t-e;r<=t+e;r++)n.push(r);return n}function an(e){const[t,n]=e.split(":"),r=Number(t),o=Number(n);return!Number.isInteger(r)||!Number.isInteger(o)||r<0||r>23||o<0||o>59?null:r*60+o}function Ge(e=15,t="00:00",n="23:59"){const r=an(t)??0,o=an(n)??24*60-1,i=Math.max(1,e),s=Math.min(r,o),l=Math.max(r,o),a=[];for(let c=s;c<=l;c+=i){const f=String(Math.floor(c/60)).padStart(2,"0"),d=String(c%60).padStart(2,"0");a.push(`${f}:${d}`)}return a}function un(e){var r;if(e.unavailable)return[];if(!((r=e.ranges)!=null&&r.length))return[];const t=new Set,n=[];for(const o of e.ranges){const i=Ge(o.step,o.from,o.to);for(const s of i)t.has(s)||(t.add(s),n.push(s))}return n}function yt(e,t,n){var l,a,c;if(!n)return!1;const r=e.day(),o=(l=n.weekdays)==null?void 0:l[r];if(o!=null&&o.includes(t))return!0;const i=e.format("YYYY-MM-DD"),s=(a=n.dates)==null?void 0:a[i];return!!(s!=null&&s.includes(t)||(c=n.predicate)!=null&&c.call(n,e,t))}const mr="‹",vr="›";function fn({panelIndex:e=0,totalPanels:t=1}){const n=$.useRef(null),[r,o]=$.useState(null),{currentYear:i,currentMonth:s,setCurrentYear:l,setCurrentMonth:a,locale:c,showMonthYearSelectors:f=!0,classNames:d,styles:p,renderNavButton:u,onMonthChange:v,onYearChange:m}=ze(),b=(s+e)%12,g=i+Math.floor((s+e)/12),E=cn(c),S=pr(50),L=e===0,R=e===t-1;$.useEffect(()=>{function T(x){n.current&&!n.current.contains(x.target)&&o(null)}return r&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[r]);function P(T){const x=i*12+s+T,O=Math.floor(x/12),F=(x%12+12)%12;a(F),l(O),v==null||v(F,O)}function N(T,x){const O=x*12+T-e,F=Math.floor(O/12),D=(O%12+12)%12;a(D),l(F),v==null||v(T,x)}function M(T,x){(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),x())}function I(){P(-1)}function C(){P(1)}function V(T){N(T,g),o(null)}function _(T){N(b,T),m==null||m(T),o(null)}return y.jsxs("div",{ref:n,className:U("fldp-calendar-header",d.calendarHeader),style:p.calendarHeader,children:[L?u?u("prev",I):y.jsx("span",{onClick:I,onKeyDown:T=>M(T,I),"aria-label":"Previous month",role:"button",tabIndex:0,className:U("fldp-nav-button",d.navButton),style:p.navButton,children:mr}):y.jsx("span",{style:{width:28}}),y.jsx("div",{className:"fldp-month-year-selectors",style:p.monthYearLabel,children:f?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"fldp-header-field-group",children:[y.jsxs("span",{className:U("fldp-header-trigger",r==="month"&&"fldp-header-trigger--open"),role:"button",tabIndex:0,"aria-haspopup":"listbox","aria-expanded":r==="month",onClick:()=>o(r==="month"?null:"month"),onKeyDown:T=>M(T,()=>o(r==="month"?null:"month")),children:[y.jsx("span",{className:"fldp-header-trigger-label",children:E[b]}),y.jsx("span",{className:"fldp-header-trigger-caret","aria-hidden":"true",children:"▾"})]}),r==="month"&&y.jsx("div",{className:"fldp-header-menu",role:"listbox","aria-label":"Select month",children:E.map((T,x)=>y.jsx("span",{className:U("fldp-header-option",x===b&&"fldp-header-option--active"),role:"option","aria-selected":x===b,tabIndex:0,onClick:()=>V(x),onKeyDown:O=>M(O,()=>V(x)),children:T},T))})]}),y.jsxs("div",{className:"fldp-header-field-group",children:[y.jsxs("span",{className:U("fldp-header-trigger",r==="year"&&"fldp-header-trigger--open"),role:"button",tabIndex:0,"aria-haspopup":"listbox","aria-expanded":r==="year",onClick:()=>o(r==="year"?null:"year"),onKeyDown:T=>M(T,()=>o(r==="year"?null:"year")),children:[y.jsx("span",{className:"fldp-header-trigger-label",children:g}),y.jsx("span",{className:"fldp-header-trigger-caret","aria-hidden":"true",children:"▾"})]}),r==="year"&&y.jsx("div",{className:"fldp-header-menu fldp-header-menu--year",role:"listbox","aria-label":"Select year",children:S.map(T=>y.jsx("span",{className:U("fldp-header-option",T===g&&"fldp-header-option--active"),role:"option","aria-selected":T===g,tabIndex:0,onClick:()=>_(T),onKeyDown:x=>M(x,()=>_(T)),children:T},T))})]})]}):y.jsxs("div",{className:"fldp-month-year-label",children:[E[b].toUpperCase()," ",g]})}),R?u?u("next",C):y.jsx("span",{onClick:C,onKeyDown:T=>M(T,C),"aria-label":"Next month",role:"button",tabIndex:0,className:U("fldp-nav-button",d.navButton),style:p.navButton,children:vr}):y.jsx("span",{style:{width:28}})]})}function Ze(){return typeof window<"u"}function Te(e){return bt(e)?(e.nodeName||"").toLowerCase():"#document"}function ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ae(e){var t;return(t=(bt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bt(e){return Ze()?e instanceof Node||e instanceof ne(e).Node:!1}function z(e){return Ze()?e instanceof Element||e instanceof ne(e).Element:!1}function oe(e){return Ze()?e instanceof HTMLElement||e instanceof ne(e).HTMLElement:!1}function wt(e){return!Ze()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ne(e).ShadowRoot}function Ie(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=re(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function hr(e){return/^(table|td|th)$/.test(Te(e))}function Je(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const gr=/transform|translate|scale|rotate|perspective|filter/,yr=/paint|layout|strict|content/,we=e=>!!e&&e!=="none";let xt;function Et(e){const t=z(e)?re(e):e;return we(t.transform)||we(t.translate)||we(t.scale)||we(t.rotate)||we(t.perspective)||!Qe()&&(we(t.backdropFilter)||we(t.filter))||gr.test(t.willChange||"")||yr.test(t.contain||"")}function br(e){let t=he(e);for(;oe(t)&&!ve(t);){if(Et(t))return t;if(Je(t))return null;t=he(t)}return null}function Qe(){return xt==null&&(xt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xt}function ve(e){return/^(html|body|#document)$/.test(Te(e))}function re(e){return ne(e).getComputedStyle(e)}function et(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function he(e){if(Te(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wt(e)&&e.host||ae(e);return wt(t)?t.host:t}function dn(e){const t=he(e);return ve(t)?e.ownerDocument?e.ownerDocument.body:e.body:oe(t)&&Ie(t)?t:dn(t)}function ge(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=dn(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ne(o);if(i){const l=St(s);return t.concat(s,s.visualViewport||[],Ie(o)?o:[],l&&n?ge(l):[])}else return t.concat(o,ge(o,[],n))}function St(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const De=Math.min,xe=Math.max,tt=Math.round,nt=Math.floor,ue=e=>({x:e,y:e}),wr={left:"right",right:"left",bottom:"top",top:"bottom"};function Mt(e,t,n){return xe(e,De(t,n))}function Fe(e,t){return typeof e=="function"?e(t):e}function Ee(e){return e.split("-")[0]}function Ye(e){return e.split("-")[1]}function pn(e){return e==="x"?"y":"x"}function Lt(e){return e==="y"?"height":"width"}function ye(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Tt(e){return pn(ye(e))}function xr(e,t,n){n===void 0&&(n=!1);const r=Ye(e),o=Tt(e),i=Lt(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=rt(s)),[s,rt(s)]}function Er(e){const t=rt(e);return[Dt(e),t,Dt(t)]}function Dt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const mn=["left","right"],vn=["right","left"],Sr=["top","bottom"],Mr=["bottom","top"];function Lr(e,t,n){switch(e){case"top":case"bottom":return n?t?vn:mn:t?mn:vn;case"left":case"right":return t?Sr:Mr;default:return[]}}function Tr(e,t,n,r){const o=Ye(e);let i=Lr(Ee(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Dt)))),i}function rt(e){const t=Ee(e);return wr[t]+e.slice(t.length)}function Dr(e){return{top:0,right:0,bottom:0,left:0,...e}}function hn(e){return typeof e!="number"?Dr(e):{top:e,right:e,bottom:e,left:e}}function ot(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
|
|
1
|
+
(function(K,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react/jsx-runtime"),require("react"),require("dayjs"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","dayjs","react-dom"],b):(K=typeof globalThis<"u"?globalThis:K||self,b(K.FlexyDatePicker={},K.jsxRuntime,K.React,K.dayjs,K.ReactDOM))})(this,function(K,b,$,Q,sr){"use strict";function Zt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const h=Zt($),Jt=Zt(sr);var Qt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function en(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tn={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Qt,function(){return function(n,r,o){r.prototype.isToday=function(){var s="YYYY-MM-DD",i=o();return this.format(s)===i.format(s)}}})})(tn);var ir=tn.exports;const lr=en(ir);var nn={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Qt,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,s){var i=o.prototype,l=i.format;s.en.formats=n,i.format=function(a){a===void 0&&(a="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,f=function(d,p){return d.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(u,m,v){var y=v&&v.toUpperCase();return m||p[v]||n[v]||p[y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(g,E,R){return E||R.slice(1)})})}(a,c===void 0?{}:c);return l.call(this,f)}}})})(nn);var cr=nn.exports;const ar=en(cr),vt=$.createContext(null);function ze(){const e=$.useContext(vt);if(!e)throw new Error("useDatePickerContext must be used inside <DatePicker>");return e}function U(...e){return e.filter(Boolean).join(" ")}function ce(e,t){return!e||!t?!1:e.isSame(t,"day")}function Xe(e,t,n){if(!t||!n)return!1;const r=t.isBefore(n)?t:n,o=t.isBefore(n)?n:t;return e.isAfter(r,"day")&&e.isBefore(o,"day")}function gt(e,t){if(!t.start)return!1;const n=t.end&&t.start.isAfter(t.end)?t.end:t.start;return ce(e,n)}function ht(e,t){if(!t.end)return!1;const n=t.start&&t.start.isAfter(t.end)?t.start:t.end;return ce(e,n)}function ur(e,t){return!t.start||!t.end?!1:gt(e,t)||ht(e,t)||Xe(e,t.start,t.end)}function rn(e,t){var n,r;return t===!0?!0:t?!!(t.before&&e.isBefore(t.before,"day")||t.after&&e.isAfter(t.after,"day")||(n=t.dates)!=null&&n.some(o=>ce(e,o))||(r=t.predicate)!=null&&r.call(t,e)):!1}function on(e,t,n=0){const r=Q(new Date(e,t,1)),o=r.endOf("month");let s=r.day()-n;s<0&&(s+=7);const i=s+o.date(),l=i%7===0?0:7-i%7,a=[];for(let c=s;c>0;c--)a.push(r.subtract(c,"day"));for(let c=1;c<=o.date();c++)a.push(Q(new Date(e,t,c)));for(let c=1;c<=l;c++)a.push(o.add(c,"day"));return a}function sn(e=0,t){const n=Q().locale(t??"en"),r=[];for(let o=0;o<7;o++){const s=(e+o)%7;r.push(n.day(s).format("dd"))}return r}function ln(e){const t=Q().locale(e??"en");return Array.from({length:12},(n,r)=>t.month(r).format("MMMM"))}function fr(e=50){const t=Q().year(),n=[];for(let r=t-e;r<=t+e;r++)n.push(r);return n}function cn(e){const[t,n]=e.split(":"),r=Number(t),o=Number(n);return!Number.isInteger(r)||!Number.isInteger(o)||r<0||r>23||o<0||o>59?null:r*60+o}function qe(e=15,t="00:00",n="23:59"){const r=cn(t)??0,o=cn(n)??24*60-1,s=Math.max(1,e),i=Math.min(r,o),l=Math.max(r,o),a=[];for(let c=i;c<=l;c+=s){const f=String(Math.floor(c/60)).padStart(2,"0"),d=String(c%60).padStart(2,"0");a.push(`${f}:${d}`)}return a}function an(e){var r;if(e.unavailable)return[];if(!((r=e.ranges)!=null&&r.length))return[];const t=new Set,n=[];for(const o of e.ranges){const s=qe(o.step,o.from,o.to);for(const i of s)t.has(i)||(t.add(i),n.push(i))}return n}function yt(e,t,n){var l,a,c;if(!n)return!1;const r=e.day(),o=(l=n.weekdays)==null?void 0:l[r];if(o!=null&&o.includes(t))return!0;const s=e.format("YYYY-MM-DD"),i=(a=n.dates)==null?void 0:a[s];return!!(i!=null&&i.includes(t)||(c=n.predicate)!=null&&c.call(n,e,t))}const dr="‹",pr="›";function un({panelIndex:e=0,totalPanels:t=1}){const n=$.useRef(null),[r,o]=$.useState(null),{currentYear:s,currentMonth:i,setCurrentYear:l,setCurrentMonth:a,locale:c,showMonthYearSelectors:f=!0,classNames:d,styles:p,renderNavButton:u,onMonthChange:m,onYearChange:v}=ze(),y=(i+e)%12,g=s+Math.floor((i+e)/12),E=ln(c),R=fr(50),L=e===0,D=e===t-1;$.useEffect(()=>{function M(x){n.current&&!n.current.contains(x.target)&&o(null)}return r&&document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[r]);function P(M){const x=s*12+i+M,O=Math.floor(x/12),F=(x%12+12)%12;a(F),l(O),m==null||m(F,O)}function T(M,x){const O=x*12+M-e,F=Math.floor(O/12),k=(O%12+12)%12;a(k),l(F),m==null||m(M,x)}function S(M,x){(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),x())}function I(){P(-1)}function C(){P(1)}function B(M){T(M,g),o(null)}function V(M){T(y,M),v==null||v(M),o(null)}return b.jsxs("div",{ref:n,className:U("fldp-calendar-header",d.calendarHeader),style:p.calendarHeader,children:[L?u?u("prev",I):b.jsx("span",{onClick:I,onKeyDown:M=>S(M,I),"aria-label":"Previous month",role:"button",tabIndex:0,className:U("fldp-nav-button",d.navButton),style:p.navButton,children:dr}):b.jsx("span",{style:{width:28}}),b.jsx("div",{className:"fldp-month-year-selectors",style:p.monthYearLabel,children:f?b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"fldp-header-field-group",children:[b.jsxs("span",{className:U("fldp-header-trigger",r==="month"&&"fldp-header-trigger--open"),role:"button",tabIndex:0,"aria-haspopup":"listbox","aria-expanded":r==="month",onClick:()=>o(r==="month"?null:"month"),onKeyDown:M=>S(M,()=>o(r==="month"?null:"month")),children:[b.jsx("span",{className:"fldp-header-trigger-label",children:E[y]}),b.jsx("span",{className:"fldp-header-trigger-caret","aria-hidden":"true",children:"▾"})]}),r==="month"&&b.jsx("div",{className:"fldp-header-menu",role:"listbox","aria-label":"Select month",children:E.map((M,x)=>b.jsx("span",{className:U("fldp-header-option",x===y&&"fldp-header-option--active"),role:"option","aria-selected":x===y,tabIndex:0,onClick:()=>B(x),onKeyDown:O=>S(O,()=>B(x)),children:M},M))})]}),b.jsxs("div",{className:"fldp-header-field-group",children:[b.jsxs("span",{className:U("fldp-header-trigger",r==="year"&&"fldp-header-trigger--open"),role:"button",tabIndex:0,"aria-haspopup":"listbox","aria-expanded":r==="year",onClick:()=>o(r==="year"?null:"year"),onKeyDown:M=>S(M,()=>o(r==="year"?null:"year")),children:[b.jsx("span",{className:"fldp-header-trigger-label",children:g}),b.jsx("span",{className:"fldp-header-trigger-caret","aria-hidden":"true",children:"▾"})]}),r==="year"&&b.jsx("div",{className:"fldp-header-menu fldp-header-menu--year",role:"listbox","aria-label":"Select year",children:R.map(M=>b.jsx("span",{className:U("fldp-header-option",M===g&&"fldp-header-option--active"),role:"option","aria-selected":M===g,tabIndex:0,onClick:()=>V(M),onKeyDown:x=>S(x,()=>V(M)),children:M},M))})]})]}):b.jsxs("div",{className:"fldp-month-year-label",children:[E[y].toUpperCase()," ",g]})}),D?u?u("next",C):b.jsx("span",{onClick:C,onKeyDown:M=>S(M,C),"aria-label":"Next month",role:"button",tabIndex:0,className:U("fldp-nav-button",d.navButton),style:p.navButton,children:pr}):b.jsx("span",{style:{width:28}})]})}function Ge(){return typeof window<"u"}function Le(e){return bt(e)?(e.nodeName||"").toLowerCase():"#document"}function ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pe(e){var t;return(t=(bt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bt(e){return Ge()?e instanceof Node||e instanceof ne(e).Node:!1}function X(e){return Ge()?e instanceof Element||e instanceof ne(e).Element:!1}function se(e){return Ge()?e instanceof HTMLElement||e instanceof ne(e).HTMLElement:!1}function wt(e){return!Ge()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ne(e).ShadowRoot}function Ze(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=re(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function mr(e){return/^(table|td|th)$/.test(Le(e))}function Je(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const vr=/transform|translate|scale|rotate|perspective|filter/,gr=/paint|layout|strict|content/,we=e=>!!e&&e!=="none";let xt;function Et(e){const t=X(e)?re(e):e;return we(t.transform)||we(t.translate)||we(t.scale)||we(t.rotate)||we(t.perspective)||!Qe()&&(we(t.backdropFilter)||we(t.filter))||vr.test(t.willChange||"")||gr.test(t.contain||"")}function hr(e){let t=ge(e);for(;se(t)&&!ve(t);){if(Et(t))return t;if(Je(t))return null;t=ge(t)}return null}function Qe(){return xt==null&&(xt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xt}function ve(e){return/^(html|body|#document)$/.test(Le(e))}function re(e){return ne(e).getComputedStyle(e)}function et(e){return X(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ge(e){if(Le(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wt(e)&&e.host||pe(e);return wt(t)?t.host:t}function fn(e){const t=ge(e);return ve(t)?(e.ownerDocument||e).body:se(t)&&Ze(t)?t:fn(t)}function he(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=fn(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=ne(o);if(s){const l=St(i);return t.concat(i,i.visualViewport||[],Ze(o)?o:[],l&&n?he(l):[])}else return t.concat(o,he(o,[],n))}function St(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Te=Math.min,xe=Math.max,tt=Math.round,nt=Math.floor,me=e=>({x:e,y:e}),yr={left:"right",right:"left",bottom:"top",top:"bottom"};function dn(e,t,n){return xe(e,Te(t,n))}function Ie(e,t){return typeof e=="function"?e(t):e}function Re(e){return e.split("-")[0]}function Fe(e){return e.split("-")[1]}function pn(e){return e==="x"?"y":"x"}function Mt(e){return e==="y"?"height":"width"}function ye(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Lt(e){return pn(ye(e))}function br(e,t,n){n===void 0&&(n=!1);const r=Fe(e),o=Lt(e),s=Mt(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=rt(i)),[i,rt(i)]}function wr(e){const t=rt(e);return[Tt(e),t,Tt(t)]}function Tt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const mn=["left","right"],vn=["right","left"],xr=["top","bottom"],Er=["bottom","top"];function Sr(e,t,n){switch(e){case"top":case"bottom":return n?t?vn:mn:t?mn:vn;case"left":case"right":return t?xr:Er;default:return[]}}function Mr(e,t,n,r){const o=Fe(e);let s=Sr(Re(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Tt)))),s}function rt(e){const t=Re(e);return yr[t]+e.slice(t.length)}function Lr(e){var t,n,r,o;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(o=e.left)!=null?o:0}}function gn(e){return typeof e!="number"?Lr(e):{top:e,right:e,bottom:e,left:e}}function ot(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
|
|
2
2
|
* tabbable 6.4.0
|
|
3
3
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
4
|
-
*/var Rr=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Rt=Rr.join(","),gn=typeof Element>"u",_e=gn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,st=!gn&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},it=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):it(t.parentNode));return s},Pr=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},kr=function(t,n,r){if(it(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Rt));return n&&_e.call(t,Rt)&&o.unshift(t),o=o.filter(r),o},Pt=function(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!it(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),a=l.length?l:s.children,c=Pt(a,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:s,candidates:c})}else{var f=_e.call(s,Rt);f&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!it(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&p){var u=Pt(d===!0?s.children:d.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else i.unshift.apply(i,s.children)}}return o},yn=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},bn=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Pr(t))&&!yn(t)?0:t.tabIndex},Ar=function(t,n){var r=bn(t);return r<0&&n&&!yn(t)?0:r},Nr=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},wn=function(t){return t.tagName==="INPUT"},Or=function(t){return wn(t)&&t.type==="hidden"},Cr=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Ir=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Fr=function(t){if(!t.name)return!0;var n=t.form||st(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=Ir(o,t.form);return!i||i===t},Yr=function(t){return wn(t)&&t.type==="radio"},_r=function(t){return Yr(t)&&!Fr(t)},Br=function(t){var n,r=t&&st(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,l,a;for(i=!!((s=o)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!i&&o;){var c,f,d;r=st(o),o=(c=r)===null||c===void 0?void 0:c.host,i=!!((f=o)!==null&&f!==void 0&&(d=f.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},xn=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},$r=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var s=_e.call(t,"details>summary:first-of-type"),l=s?t.parentElement:t;if(_e.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var c=t.parentElement,f=st(t);if(c&&!c.shadowRoot&&o(c)===!0)return xn(t);t.assignedSlot?t=t.assignedSlot:!c&&f!==t.ownerDocument?t=f.host:t=c}t=a}if(Br(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return xn(t);return!1},Vr=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return _e.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Wr=function(t,n){return!(n.disabled||Or(n)||$r(n,t)||Cr(n)||Vr(n))},En=function(t,n){return!(_r(n)||bn(n)<0||!Wr(t,n))},Hr=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Sn=function(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,l=s?o.scopeParent:o,a=Ar(l,s),c=s?Sn(o.candidates):l;a===0?s?n.push.apply(n,c):n.push(l):r.push({documentOrder:i,tabIndex:a,item:o,isScope:s,content:c})}),r.sort(Nr).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Mn=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Pt([t],n.includeContainer,{filter:En.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Hr}):r=kr(t,n.includeContainer,En.bind(null,n)),Sn(r)};function Kr(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ur(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Ln(){return/apple/i.test(navigator.vendor)}function jr(){return Kr().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Xr(){return Ur().includes("jsdom/")}const Tn="data-floating-ui-focusable",zr="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function kt(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Re(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&wt(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Pe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function At(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function qr(e){return e.matches("html,body")}function fe(e){return(e==null?void 0:e.ownerDocument)||document}function Gr(e){return oe(e)&&e.matches(zr)}function Zr(e){if(!e||Xr())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Jr(e){return e?e.hasAttribute(Tn)?e:e.querySelector("["+Tn+"]")||e:null}function lt(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...lt(e,o.id,n)])}function Qr(e){return"nativeEvent"in e}function Nt(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var eo=typeof document<"u",to=function(){},ie=eo?$.useLayoutEffect:to;const no={...h};function ct(e){const t=h.useRef(e);return ie(()=>{t.current=e}),t}const ro=no.useInsertionEffect||(e=>e());function de(e){const t=h.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ro(()=>{t.current=e}),h.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Dn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Rn(e,t){const n=Mn(e,Dn()),r=n.length;if(r===0)return;const o=kt(fe(e)),i=n.indexOf(o),s=i===-1?t===1?0:r-1:i+t;return n[s]}function oo(e){return Rn(fe(e).body,1)||e}function so(e){return Rn(fe(e).body,-1)||e}function Ot(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Re(n,r)}function io(e){Mn(e,Dn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Pn(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function kn(e,t,n){let{reference:r,floating:o}=e;const i=ye(t),s=Tt(t),l=Lt(s),a=Ee(t),c=i==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[l]/2-o[l]/2;let u;switch(a){case"top":u={x:f,y:r.y-o.height};break;case"bottom":u={x:f,y:r.y+r.height};break;case"right":u={x:r.x+r.width,y:d};break;case"left":u={x:r.x-o.width,y:d};break;default:u={x:r.x,y:r.y}}switch(Ye(t)){case"start":u[s]-=p*(n&&c?-1:1);break;case"end":u[s]+=p*(n&&c?-1:1);break}return u}async function lo(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:u=0}=Fe(t,e),v=hn(u),b=l[p?d==="floating"?"reference":"floating":d],g=ot(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:a})),E=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),L=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},R=ot(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:S,strategy:a}):E);return{top:(g.top-R.top+v.top)/L.y,bottom:(R.bottom-g.bottom+v.bottom)/L.y,left:(g.left-R.left+v.left)/L.x,right:(R.right-g.right+v.right)/L.x}}const co=50,ao=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:lo},a=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=kn(c,r,a),p=r,u=0;const v={};for(let m=0;m<i.length;m++){const b=i[m];if(!b)continue;const{name:g,fn:E}=b,{x:S,y:L,data:R,reset:P}=await E({x:f,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:v,rects:c,platform:l,elements:{reference:e,floating:t}});f=S??f,d=L??d,v[g]={...v[g],...R},P&&u<co&&(u++,typeof P=="object"&&(P.placement&&(p=P.placement),P.rects&&(c=P.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:f,y:d}=kn(c,p,a)),m=-1)}return{x:f,y:d,placement:p,strategy:o,middlewareData:v}},uo=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:l,middlewareData:a}=t,{element:c,padding:f=0}=Fe(e,t)||{};if(c==null)return{};const d=hn(f),p={x:n,y:r},u=Tt(o),v=Lt(u),m=await s.getDimensions(c),b=u==="y",g=b?"top":"left",E=b?"bottom":"right",S=b?"clientHeight":"clientWidth",L=i.reference[v]+i.reference[u]-p[u]-i.floating[v],R=p[u]-i.reference[u],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let N=P?P[S]:0;(!N||!await(s.isElement==null?void 0:s.isElement(P)))&&(N=l.floating[S]||i.floating[v]);const M=L/2-R/2,I=N/2-m[v]/2-1,C=De(d[g],I),V=De(d[E],I),_=C,T=N-m[v]-V,x=N/2-m[v]/2+M,O=Mt(_,x,T),F=!a.arrow&&Ye(o)!=null&&x!==O&&i.reference[v]/2-(x<_?C:V)-m[v]/2<0,D=F?x<_?x-_:x-T:0;return{[u]:p[u]+D,data:{[u]:O,centerOffset:x-O-D,...F&&{alignmentOffset:D}},reset:F}}}),fo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...b}=Fe(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=Ee(o),E=ye(l),S=Ee(l)===l,L=await(a.isRTL==null?void 0:a.isRTL(c.floating)),R=p||(S||!m?[rt(l)]:Er(l)),P=v!=="none";!p&&P&&R.push(...Tr(l,m,v,L));const N=[l,...R],M=await a.detectOverflow(t,b),I=[];let C=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&I.push(M[g]),d){const x=xr(o,s,L);I.push(M[x[0]],M[x[1]])}if(C=[...C,{placement:o,overflows:I}],!I.every(x=>x<=0)){var V,_;const x=(((V=i.flip)==null?void 0:V.index)||0)+1,O=N[x];if(O&&(!(d==="alignment"?E!==ye(O):!1)||C.every(w=>ye(w.placement)===E?w.overflows[0]>0:!0)))return{data:{index:x,overflows:C},reset:{placement:O}};let F=(_=C.filter(D=>D.overflows[0]<=0).sort((D,w)=>D.overflows[1]-w.overflows[1])[0])==null?void 0:_.placement;if(!F)switch(u){case"bestFit":{var T;const D=(T=C.filter(w=>{if(P){const A=ye(w.placement);return A===E||A==="y"}return!0}).map(w=>[w.placement,w.overflows.filter(A=>A>0).reduce((A,k)=>A+k,0)]).sort((w,A)=>w[1]-A[1])[0])==null?void 0:T[0];D&&(F=D);break}case"initialPlacement":F=l;break}if(o!==F)return{reset:{placement:F}}}return{}}}},po=new Set(["left","top"]);async function mo(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ee(n),l=Ye(n),a=ye(n)==="y",c=po.has(s)?-1:1,f=i&&a?-1:1,d=Fe(t,e);let{mainAxis:p,crossAxis:u,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof v=="number"&&(u=l==="end"?v*-1:v),a?{x:u*f,y:p*c}:{x:p*c,y:u*f}}const vo=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:l}=t,a=await mo(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:s}}}}},ho=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:a={fn:g=>{let{x:E,y:S}=g;return{x:E,y:S}}},...c}=Fe(e,t),f={x:n,y:r},d=await i.detectOverflow(t,c),p=ye(Ee(o)),u=pn(p);let v=f[u],m=f[p];if(s){const g=u==="y"?"top":"left",E=u==="y"?"bottom":"right",S=v+d[g],L=v-d[E];v=Mt(S,v,L)}if(l){const g=p==="y"?"top":"left",E=p==="y"?"bottom":"right",S=m+d[g],L=m-d[E];m=Mt(S,m,L)}const b=a.fn({...t,[u]:v,[p]:m});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[u]:s,[p]:l}}}}}};function An(e){const t=re(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=oe(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,l=tt(n)!==i||tt(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function Ct(e){return z(e)?e:e.contextElement}function ke(e){const t=Ct(e);if(!oe(t))return ue(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=An(t);let s=(i?tt(n.width):n.width)/r,l=(i?tt(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const go=ue(0);function Nn(e){const t=ne(e);return!Qe()||!t.visualViewport?go:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yo(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ne(e)?!1:t}function Se(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ct(e);let s=ue(1);t&&(r?z(r)&&(s=ke(r)):s=ke(e));const l=yo(i,n,r)?Nn(i):ue(0);let a=(o.left+l.x)/s.x,c=(o.top+l.y)/s.y,f=o.width/s.x,d=o.height/s.y;if(i){const p=ne(i),u=r&&z(r)?ne(r):r;let v=p,m=St(v);for(;m&&r&&u!==v;){const b=ke(m),g=m.getBoundingClientRect(),E=re(m),S=g.left+(m.clientLeft+parseFloat(E.paddingLeft))*b.x,L=g.top+(m.clientTop+parseFloat(E.paddingTop))*b.y;a*=b.x,c*=b.y,f*=b.x,d*=b.y,a+=S,c+=L,v=ne(m),m=St(v)}}return ot({width:f,height:d,x:a,y:c})}function at(e,t){const n=et(e).scrollLeft;return t?t.left+n:Se(ae(e)).left+n}function On(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-at(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function bo(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ae(r),l=t?Je(t.floating):!1;if(r===s||l&&i)return n;let a={scrollLeft:0,scrollTop:0},c=ue(1);const f=ue(0),d=oe(r);if((d||!d&&!i)&&((Te(r)!=="body"||Ie(s))&&(a=et(r)),d)){const u=Se(r);c=ke(r),f.x=u.x+r.clientLeft,f.y=u.y+r.clientTop}const p=s&&!d&&!i?On(s,a):ue(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-a.scrollTop*c.y+f.y+p.y}}function wo(e){return Array.from(e.getClientRects())}function xo(e){const t=ae(e),n=et(e),r=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=xe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+at(e);const l=-n.scrollTop;return re(r).direction==="rtl"&&(s+=xe(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Cn=25;function Eo(e,t){const n=ne(e),r=ae(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,a=0;if(o){i=o.width,s=o.height;const f=Qe();(!f||f&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}const c=at(r);if(c<=0){const f=r.ownerDocument,d=f.body,p=getComputedStyle(d),u=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(r.clientWidth-d.clientWidth-u);v<=Cn&&(i-=v)}else c<=Cn&&(i+=c);return{width:i,height:s,x:l,y:a}}function So(e,t){const n=Se(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=oe(e)?ke(e):ue(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,a=o*i.x,c=r*i.y;return{width:s,height:l,x:a,y:c}}function In(e,t,n){let r;if(t==="viewport")r=Eo(e,n);else if(t==="document")r=xo(ae(e));else if(z(t))r=So(t,n);else{const o=Nn(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ot(r)}function Fn(e,t){const n=he(e);return n===t||!z(n)||ve(n)?!1:re(n).position==="fixed"||Fn(n,t)}function Mo(e,t){const n=t.get(e);if(n)return n;let r=ge(e,[],!1).filter(l=>z(l)&&Te(l)!=="body"),o=null;const i=re(e).position==="fixed";let s=i?he(e):e;for(;z(s)&&!ve(s);){const l=re(s),a=Et(s);!a&&l.position==="fixed"&&(o=null),(i?!a&&!o:!a&&l.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Ie(s)&&!a&&Fn(e,s))?r=r.filter(f=>f!==s):o=l,s=he(s)}return t.set(e,r),r}function Lo(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Je(t)?[]:Mo(t,this._c):[].concat(n),r],l=In(t,s[0],o);let a=l.top,c=l.right,f=l.bottom,d=l.left;for(let p=1;p<s.length;p++){const u=In(t,s[p],o);a=xe(u.top,a),c=De(u.right,c),f=De(u.bottom,f),d=xe(u.left,d)}return{width:c-d,height:f-a,x:d,y:a}}function To(e){const{width:t,height:n}=An(e);return{width:t,height:n}}function Do(e,t,n){const r=oe(t),o=ae(t),i=n==="fixed",s=Se(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const a=ue(0);function c(){a.x=at(o)}if(r||!r&&!i)if((Te(t)!=="body"||Ie(o))&&(l=et(t)),r){const u=Se(t,!0,i,t);a.x=u.x+t.clientLeft,a.y=u.y+t.clientTop}else o&&c();i&&!r&&o&&c();const f=o&&!r&&!i?On(o,l):ue(0),d=s.left+l.scrollLeft-a.x-f.x,p=s.top+l.scrollTop-a.y-f.y;return{x:d,y:p,width:s.width,height:s.height}}function It(e){return re(e).position==="static"}function Yn(e,t){if(!oe(e)||re(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ae(e)===n&&(n=n.ownerDocument.body),n}function _n(e,t){const n=ne(e);if(Je(e))return n;if(!oe(e)){let o=he(e);for(;o&&!ve(o);){if(z(o)&&!It(o))return o;o=he(o)}return n}let r=Yn(e,t);for(;r&&hr(r)&&It(r);)r=Yn(r,t);return r&&ve(r)&&It(r)&&!Et(r)?n:r||br(e)||n}const Ro=async function(e){const t=this.getOffsetParent||_n,n=this.getDimensions,r=await n(e.floating);return{reference:Do(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Po(e){return re(e).direction==="rtl"}const ko={convertOffsetParentRelativeRectToViewportRelativeRect:bo,getDocumentElement:ae,getClippingRect:Lo,getOffsetParent:_n,getElementRects:Ro,getClientRects:wo,getDimensions:To,getScale:ke,isElement:z,isRTL:Po};function Bn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ao(e,t){let n=null,r;const o=ae(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),i();const c=e.getBoundingClientRect(),{left:f,top:d,width:p,height:u}=c;if(l||t(),!p||!u)return;const v=nt(d),m=nt(o.clientWidth-(f+p)),b=nt(o.clientHeight-(d+u)),g=nt(f),S={rootMargin:-v+"px "+-m+"px "+-b+"px "+-g+"px",threshold:xe(0,De(1,a))||1};let L=!0;function R(P){const N=P[0].intersectionRatio;if(N!==a){if(!L)return s();N?s(!1,N):r=setTimeout(()=>{s(!1,1e-7)},1e3)}N===1&&!Bn(c,e.getBoundingClientRect())&&s(),L=!1}try{n=new IntersectionObserver(R,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,S)}n.observe(e)}return s(!0),i}function No(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=Ct(e),f=o||i?[...c?ge(c):[],...t?ge(t):[]]:[];f.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const d=c&&l?Ao(c,n):null;let p=-1,u=null;s&&(u=new ResizeObserver(g=>{let[E]=g;E&&E.target===c&&u&&t&&(u.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=u)==null||S.observe(t)})),n()}),c&&!a&&u.observe(c),t&&u.observe(t));let v,m=a?Se(e):null;a&&b();function b(){const g=Se(e);m&&!Bn(m,g)&&n(),m=g,v=requestAnimationFrame(b)}return n(),()=>{var g;f.forEach(E=>{o&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),d==null||d(),(g=u)==null||g.disconnect(),u=null,a&&cancelAnimationFrame(v)}}const Oo=vo,Co=ho,Io=fo,$n=uo,Fo=(e,t,n)=>{const r=new Map,o={platform:ko,...n},i={...o.platform,_c:r};return ao(e,t,{...o,platform:i})};var Yo=typeof document<"u",_o=function(){},ut=Yo?$.useLayoutEffect:_o;function ft(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ft(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ft(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Vn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wn(e,t){const n=Vn(e);return Math.round(t*n)/n}function Ft(e){const t=h.useRef(e);return ut(()=>{t.current=e}),t}function Bo(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:a,open:c}=e,[f,d]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,u]=h.useState(r);ft(p,r)||u(r);const[v,m]=h.useState(null),[b,g]=h.useState(null),E=h.useCallback(w=>{w!==P.current&&(P.current=w,m(w))},[]),S=h.useCallback(w=>{w!==N.current&&(N.current=w,g(w))},[]),L=i||v,R=s||b,P=h.useRef(null),N=h.useRef(null),M=h.useRef(f),I=a!=null,C=Ft(a),V=Ft(o),_=Ft(c),T=h.useCallback(()=>{if(!P.current||!N.current)return;const w={placement:t,strategy:n,middleware:p};V.current&&(w.platform=V.current),Fo(P.current,N.current,w).then(A=>{const k={...A,isPositioned:_.current!==!1};x.current&&!ft(M.current,k)&&(M.current=k,Qt.flushSync(()=>{d(k)}))})},[p,t,n,V,_]);ut(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,d(w=>({...w,isPositioned:!1})))},[c]);const x=h.useRef(!1);ut(()=>(x.current=!0,()=>{x.current=!1}),[]),ut(()=>{if(L&&(P.current=L),R&&(N.current=R),L&&R){if(C.current)return C.current(L,R,T);T()}},[L,R,T,C,I]);const O=h.useMemo(()=>({reference:P,floating:N,setReference:E,setFloating:S}),[E,S]),F=h.useMemo(()=>({reference:L,floating:R}),[L,R]),D=h.useMemo(()=>{const w={position:n,left:0,top:0};if(!F.floating)return w;const A=Wn(F.floating,f.x),k=Wn(F.floating,f.y);return l?{...w,transform:"translate("+A+"px, "+k+"px)",...Vn(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:k}},[n,l,F.floating,f.x,f.y]);return h.useMemo(()=>({...f,update:T,refs:O,elements:F,floatingStyles:D}),[f,T,O,F,D])}const $o=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?$n({element:r.current,padding:o}).fn(n):{}:r?$n({element:r,padding:o}).fn(n):{}}}},Vo=(e,t)=>{const n=Oo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wo=(e,t)=>{const n=Co(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ho=(e,t)=>{const n=Io(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ko=(e,t)=>{const n=$o(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Uo(e){const t=h.useRef(void 0),n=h.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,l=s(r);return typeof l=="function"?l:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i==null?void 0:i())}},e);return h.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const jo="data-floating-ui-focusable",Hn="active",Kn="selected",Xo={...h};let Un=!1,zo=0;const jn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+zo++;function qo(){const[e,t]=h.useState(()=>Un?jn():void 0);return ie(()=>{e==null&&t(jn())},[]),h.useEffect(()=>{Un=!0},[]),e}const dt=Xo.useId||qo;let Be;process.env.NODE_ENV!=="production"&&(Be=new Set);function Go(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Be)!=null&&e.has(o))){var i;(i=Be)==null||i.add(o),console.warn(o)}}function Zo(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Be)!=null&&e.has(o))){var i;(i=Be)==null||i.add(o),console.error(o)}}const Jo=h.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:s}},width:l=14,height:a=7,tipRadius:c=0,strokeWidth:f=0,staticOffset:d,stroke:p,d:u,style:{transform:v,...m}={},...b}=t;process.env.NODE_ENV!=="production"&&(n||Go("The `ref` prop is required for `FloatingArrow`."));const g=dt(),[E,S]=h.useState(!1);if(ie(()=>{if(!o)return;re(o).direction==="rtl"&&S(!0)},[o]),!o)return null;const[L,R]=r.split("-"),P=L==="top"||L==="bottom";let N=d;(P&&s!=null&&s.x||!P&&s!=null&&s.y)&&(N=null);const M=f*2,I=M/2,C=l/2*(c/-8+1),V=a/2*c/4,_=!!u,T=N&&R==="end"?"bottom":"top";let x=N&&R==="end"?"right":"left";N&&E&&(x=R==="end"?"left":"right");const O=(i==null?void 0:i.x)!=null?N||i.x:"",F=(i==null?void 0:i.y)!=null?N||i.y:"",D=u||"M0,0"+(" H"+l)+(" L"+(l-C)+","+(a-V))+(" Q"+l/2+","+a+" "+C+","+(a-V))+" Z",w={top:_?"rotate(180deg)":"",left:_?"rotate(90deg)":"rotate(-90deg)",bottom:_?"":"rotate(180deg)",right:_?"rotate(-90deg)":"rotate(90deg)"}[L];return y.jsxs("svg",{...b,"aria-hidden":!0,ref:n,width:_?l:l+M,height:l,viewBox:"0 0 "+l+" "+(a>l?a:l),style:{position:"absolute",pointerEvents:"none",[x]:O,[T]:F,[L]:P||_?"100%":"calc(100% - "+M/2+"px)",transform:[w,v].filter(A=>!!A).join(" "),...m},children:[M>0&&y.jsx("path",{clipPath:"url(#"+g+")",fill:"none",stroke:p,strokeWidth:M+(u?0:1),d:D}),y.jsx("path",{stroke:M&&!u?b.fill:"none",d:D}),y.jsx("clipPath",{id:g,children:y.jsx("rect",{x:-I,y:I*(_?-1:1),width:l+M,height:l})})]})});function Qo(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const es=h.createContext(null),ts=h.createContext(null),Yt=()=>{var e;return((e=h.useContext(es))==null?void 0:e.id)||null},_t=()=>h.useContext(ts);function $e(e){return"data-floating-ui-"+e}function se(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Xn=$e("safe-polygon");function Bt(e,t,n){if(n&&!Nt(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}function $t(e){return typeof e=="function"?e():e}function ns(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:l=!0,delay:a=0,handleClose:c=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=t,u=_t(),v=Yt(),m=ct(c),b=ct(a),g=ct(n),E=ct(d),S=h.useRef(),L=h.useRef(-1),R=h.useRef(),P=h.useRef(-1),N=h.useRef(!0),M=h.useRef(!1),I=h.useRef(()=>{}),C=h.useRef(!1),V=de(()=>{var D;const w=(D=o.current.openEvent)==null?void 0:D.type;return(w==null?void 0:w.includes("mouse"))&&w!=="mousedown"});h.useEffect(()=>{if(!l)return;function D(w){let{open:A}=w;A||(se(L),se(P),N.current=!0,C.current=!1)}return i.on("openchange",D),()=>{i.off("openchange",D)}},[l,i]),h.useEffect(()=>{if(!l||!m.current||!n)return;function D(A){V()&&r(!1,A,"hover")}const w=fe(s.floating).documentElement;return w.addEventListener("mouseleave",D),()=>{w.removeEventListener("mouseleave",D)}},[s.floating,n,r,l,m,V]);const _=h.useCallback(function(D,w,A){w===void 0&&(w=!0),A===void 0&&(A="hover");const k=Bt(b.current,"close",S.current);k&&!R.current?(se(L),L.current=window.setTimeout(()=>r(!1,D,A),k)):w&&(se(L),r(!1,D,A))},[b,r]),T=de(()=>{I.current(),R.current=void 0}),x=de(()=>{if(M.current){const D=fe(s.floating).body;D.style.pointerEvents="",D.removeAttribute(Xn),M.current=!1}}),O=de(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);h.useEffect(()=>{if(!l)return;function D(B){if(se(L),N.current=!1,f&&!Nt(S.current)||$t(E.current)>0&&!Bt(b.current,"open"))return;const q=Bt(b.current,"open",S.current);q?L.current=window.setTimeout(()=>{g.current||r(!0,B,"hover")},q):n||r(!0,B,"hover")}function w(B){if(O()){x();return}I.current();const q=fe(s.floating);if(se(P),C.current=!1,m.current&&o.current.floatingContext){n||se(L),R.current=m.current({...o.current.floatingContext,tree:u,x:B.clientX,y:B.clientY,onClose(){x(),T(),O()||_(B,!0,"safe-polygon")}});const j=R.current;q.addEventListener("mousemove",j),I.current=()=>{q.removeEventListener("mousemove",j)};return}(S.current==="touch"?!Re(s.floating,B.relatedTarget):!0)&&_(B)}function A(B){O()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:u,x:B.clientX,y:B.clientY,onClose(){x(),T(),O()||_(B)}})(B))}function k(){se(L)}function W(B){O()||_(B,!1)}if(z(s.domReference)){const B=s.domReference,q=s.floating;return n&&B.addEventListener("mouseleave",A),p&&B.addEventListener("mousemove",D,{once:!0}),B.addEventListener("mouseenter",D),B.addEventListener("mouseleave",w),q&&(q.addEventListener("mouseleave",A),q.addEventListener("mouseenter",k),q.addEventListener("mouseleave",W)),()=>{n&&B.removeEventListener("mouseleave",A),p&&B.removeEventListener("mousemove",D),B.removeEventListener("mouseenter",D),B.removeEventListener("mouseleave",w),q&&(q.removeEventListener("mouseleave",A),q.removeEventListener("mouseenter",k),q.removeEventListener("mouseleave",W))}}},[s,l,e,f,p,_,T,x,r,n,g,u,b,m,o,O,E]),ie(()=>{var D;if(l&&n&&(D=m.current)!=null&&(D=D.__options)!=null&&D.blockPointerEvents&&V()){M.current=!0;const A=s.floating;if(z(s.domReference)&&A){var w;const k=fe(s.floating).body;k.setAttribute(Xn,"");const W=s.domReference,B=u==null||(w=u.nodesRef.current.find(q=>q.id===v))==null||(w=w.context)==null?void 0:w.elements.floating;return B&&(B.style.pointerEvents=""),k.style.pointerEvents="none",W.style.pointerEvents="auto",A.style.pointerEvents="auto",()=>{k.style.pointerEvents="",W.style.pointerEvents="",A.style.pointerEvents=""}}}},[l,n,v,s,u,m,V]),ie(()=>{n||(S.current=void 0,C.current=!1,T(),x())},[n,T,x]),h.useEffect(()=>()=>{T(),se(L),se(P),x()},[l,s.domReference,T,x]);const F=h.useMemo(()=>{function D(w){S.current=w.pointerType}return{onPointerDown:D,onPointerEnter:D,onMouseMove(w){const{nativeEvent:A}=w;function k(){!N.current&&!g.current&&r(!0,A,"hover")}f&&!Nt(S.current)||n||$t(E.current)===0||C.current&&w.movementX**2+w.movementY**2<2||(se(P),S.current==="touch"?k():(C.current=!0,P.current=window.setTimeout(k,$t(E.current))))}}},[f,r,n,g,E]);return h.useMemo(()=>l?{reference:F}:{},[l,F])}const rs={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},zn=h.forwardRef(function(t,n){const[r,o]=h.useState();ie(()=>{Ln()&&o("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[$e("focus-guard")]:"",style:rs};return y.jsx("span",{...t,...i})}),os={clipPath:"inset(50%)",position:"fixed",top:0,left:0},qn=h.createContext(null),Gn=$e("portal");function ss(e){e===void 0&&(e={});const{id:t,root:n}=e,r=dt(),o=ls(),[i,s]=h.useState(null),l=h.useRef(null);return ie(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{l.current=null})},[i]),ie(()=>{if(!r||l.current)return;const a=t?document.getElementById(t):null;if(!a)return;const c=document.createElement("div");c.id=r,c.setAttribute(Gn,""),a.appendChild(c),l.current=c,s(c)},[t,r]),ie(()=>{if(n===null||!r||l.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!bt(a)&&(a=a.current),a=a||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,a.appendChild(c));const f=document.createElement("div");f.id=r,f.setAttribute(Gn,""),a=c||a,a.appendChild(f),l.current=f,s(f)},[t,n,r,o]),i}function is(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=ss({id:n,root:r}),[s,l]=h.useState(null),a=h.useRef(null),c=h.useRef(null),f=h.useRef(null),d=h.useRef(null),p=s==null?void 0:s.modal,u=s==null?void 0:s.open,v=!!s&&!s.modal&&s.open&&o&&!!(r||i);return h.useEffect(()=>{if(!i||!o||p)return;function m(b){i&&Ot(b)&&(b.type==="focusin"?Pn:io)(i)}return i.addEventListener("focusin",m,!0),i.addEventListener("focusout",m,!0),()=>{i.removeEventListener("focusin",m,!0),i.removeEventListener("focusout",m,!0)}},[i,o,p]),h.useEffect(()=>{i&&(u||Pn(i))},[u,i]),y.jsxs(qn.Provider,{value:h.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:c,beforeInsideRef:f,afterInsideRef:d,portalNode:i,setFocusManagerState:l}),[o,i]),children:[v&&i&&y.jsx(zn,{"data-type":"outside",ref:a,onFocus:m=>{if(Ot(m,i)){var b;(b=f.current)==null||b.focus()}else{const g=s?s.domReference:null,E=so(g);E==null||E.focus()}}}),v&&i&&y.jsx("span",{"aria-owns":i.id,style:os}),i&&Qt.createPortal(t,i),v&&i&&y.jsx(zn,{"data-type":"outside",ref:c,onFocus:m=>{if(Ot(m,i)){var b;(b=d.current)==null||b.focus()}else{const g=s?s.domReference:null,E=oo(g);E==null||E.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,m.nativeEvent,"focus-out"))}}})]})}const ls=()=>h.useContext(qn),cs={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},as={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Zn=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function us(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:l=!0,outsidePress:a=!0,outsidePressEvent:c="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:u,capture:v}=t,m=_t(),b=de(typeof a=="function"?a:()=>!1),g=typeof a=="function"?b:a,E=h.useRef(!1),{escapeKey:S,outsidePress:L}=Zn(u),{escapeKey:R,outsidePress:P}=Zn(v),N=h.useRef(!1),M=de(x=>{var O;if(!n||!s||!l||x.key!=="Escape"||N.current)return;const F=(O=i.current.floatingContext)==null?void 0:O.nodeId,D=m?lt(m.nodesRef.current,F):[];if(!S&&(x.stopPropagation(),D.length>0)){let w=!0;if(D.forEach(A=>{var k;if((k=A.context)!=null&&k.open&&!A.context.dataRef.current.__escapeKeyBubbles){w=!1;return}}),!w)return}r(!1,Qr(x)?x.nativeEvent:x,"escape-key")}),I=de(x=>{var O;const F=()=>{var D;M(x),(D=Pe(x))==null||D.removeEventListener("keydown",F)};(O=Pe(x))==null||O.addEventListener("keydown",F)}),C=de(x=>{var O;const F=i.current.insideReactTree;i.current.insideReactTree=!1;const D=E.current;if(E.current=!1,c==="click"&&D||F||typeof g=="function"&&!g(x))return;const w=Pe(x),A="["+$e("inert")+"]",k=fe(o.floating).querySelectorAll(A);let W=z(w)?w:null;for(;W&&!ve(W);){const j=he(W);if(ve(j)||!z(j))break;W=j}if(k.length&&z(w)&&!qr(w)&&!Re(w,o.floating)&&Array.from(k).every(j=>!Re(W,j)))return;if(oe(w)&&T){const j=ve(w),X=re(w),ee=/auto|scroll/,Kt=j||ee.test(X.overflowX),Ae=j||ee.test(X.overflowY),Ut=Kt&&w.clientWidth>0&&w.scrollWidth>w.clientWidth,Me=Ae&&w.clientHeight>0&&w.scrollHeight>w.clientHeight,Le=X.direction==="rtl",Ne=Me&&(Le?x.offsetX<=w.offsetWidth-w.clientWidth:x.offsetX>w.clientWidth),Oe=Ut&&x.offsetY>w.clientHeight;if(Ne||Oe)return}const B=(O=i.current.floatingContext)==null?void 0:O.nodeId,q=m&<(m.nodesRef.current,B).some(j=>{var X;return At(x,(X=j.context)==null?void 0:X.elements.floating)});if(At(x,o.floating)||At(x,o.domReference)||q)return;const Ve=m?lt(m.nodesRef.current,B):[];if(Ve.length>0){let j=!0;if(Ve.forEach(X=>{var ee;if((ee=X.context)!=null&&ee.open&&!X.context.dataRef.current.__outsidePressBubbles){j=!1;return}}),!j)return}r(!1,x,"outside-press")}),V=de(x=>{var O;const F=()=>{var D;C(x),(D=Pe(x))==null||D.removeEventListener(c,F)};(O=Pe(x))==null||O.addEventListener(c,F)});h.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=S,i.current.__outsidePressBubbles=L;let x=-1;function O(k){r(!1,k,"ancestor-scroll")}function F(){window.clearTimeout(x),N.current=!0}function D(){x=window.setTimeout(()=>{N.current=!1},Qe()?5:0)}const w=fe(o.floating);l&&(w.addEventListener("keydown",R?I:M,R),w.addEventListener("compositionstart",F),w.addEventListener("compositionend",D)),g&&w.addEventListener(c,P?V:C,P);let A=[];return p&&(z(o.domReference)&&(A=ge(o.domReference)),z(o.floating)&&(A=A.concat(ge(o.floating))),!z(o.reference)&&o.reference&&o.reference.contextElement&&(A=A.concat(ge(o.reference.contextElement)))),A=A.filter(k=>{var W;return k!==((W=w.defaultView)==null?void 0:W.visualViewport)}),A.forEach(k=>{k.addEventListener("scroll",O,{passive:!0})}),()=>{l&&(w.removeEventListener("keydown",R?I:M,R),w.removeEventListener("compositionstart",F),w.removeEventListener("compositionend",D)),g&&w.removeEventListener(c,P?V:C,P),A.forEach(k=>{k.removeEventListener("scroll",O)}),window.clearTimeout(x)}},[i,o,l,g,c,n,r,p,s,S,L,M,R,I,C,P,V]),h.useEffect(()=>{i.current.insideReactTree=!1},[i,g,c]);const _=h.useMemo(()=>({onKeyDown:M,...f&&{[cs[d]]:x=>{r(!1,x.nativeEvent,"reference-press")},...d!=="click"&&{onClick(x){r(!1,x.nativeEvent,"reference-press")}}}}),[M,r,f,d]),T=h.useMemo(()=>{function x(O){O.button===0&&(E.current=!0)}return{onKeyDown:M,onMouseDown:x,onMouseUp:x,[as[c]]:()=>{i.current.insideReactTree=!0}}},[M,c,i]);return h.useMemo(()=>s?{reference:_,floating:T}:{},[s,_,T])}function fs(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=dt(),i=h.useRef({}),[s]=h.useState(()=>Qo()),l=Yt()!=null;if(process.env.NODE_ENV!=="production"){const u=r.reference;u&&!z(u)&&Zo("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,c]=h.useState(r.reference),f=de((u,v,m)=>{i.current.openEvent=u?v:void 0,s.emit("openchange",{open:u,event:v,reason:m,nested:l}),n==null||n(u,v,m)}),d=h.useMemo(()=>({setPositionReference:c}),[]),p=h.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return h.useMemo(()=>({dataRef:i,open:t,onOpenChange:f,elements:p,events:s,floatingId:o,refs:d}),[t,f,p,s,o,d])}function ds(e){e===void 0&&(e={});const{nodeId:t}=e,n=fs({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=h.useState(null),[l,a]=h.useState(null),f=(o==null?void 0:o.domReference)||i,d=h.useRef(null),p=_t();ie(()=>{f&&(d.current=f)},[f]);const u=Bo({...e,elements:{...o,...l&&{reference:l}}}),v=h.useCallback(S=>{const L=z(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),getClientRects:()=>S.getClientRects(),contextElement:S}:S;a(L),u.refs.setReference(L)},[u.refs]),m=h.useCallback(S=>{(z(S)||S===null)&&(d.current=S,s(S)),(z(u.refs.reference.current)||u.refs.reference.current===null||S!==null&&!z(S))&&u.refs.setReference(S)},[u.refs]),b=h.useMemo(()=>({...u.refs,setReference:m,setPositionReference:v,domReference:d}),[u.refs,m,v]),g=h.useMemo(()=>({...u.elements,domReference:f}),[u.elements,f]),E=h.useMemo(()=>({...u,...r,refs:b,elements:g,nodeId:t}),[u,b,g,t,r]);return ie(()=>{r.dataRef.current.floatingContext=E;const S=p==null?void 0:p.nodesRef.current.find(L=>L.id===t);S&&(S.context=E)}),h.useMemo(()=>({...u,context:E,refs:b,elements:g}),[u,b,g,E])}function Vt(){return jr()&&Ln()}function ps(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:l=!0,visibleOnly:a=!0}=t,c=h.useRef(!1),f=h.useRef(-1),d=h.useRef(!0);h.useEffect(()=>{if(!l)return;const u=ne(s.domReference);function v(){!n&&oe(s.domReference)&&s.domReference===kt(fe(s.domReference))&&(c.current=!0)}function m(){d.current=!0}function b(){d.current=!1}return u.addEventListener("blur",v),Vt()&&(u.addEventListener("keydown",m,!0),u.addEventListener("pointerdown",b,!0)),()=>{u.removeEventListener("blur",v),Vt()&&(u.removeEventListener("keydown",m,!0),u.removeEventListener("pointerdown",b,!0))}},[s.domReference,n,l]),h.useEffect(()=>{if(!l)return;function u(v){let{reason:m}=v;(m==="reference-press"||m==="escape-key")&&(c.current=!0)}return o.on("openchange",u),()=>{o.off("openchange",u)}},[o,l]),h.useEffect(()=>()=>{se(f)},[]);const p=h.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(u){if(c.current)return;const v=Pe(u.nativeEvent);if(a&&z(v)){if(Vt()&&!u.relatedTarget){if(!d.current&&!Gr(v))return}else if(!Zr(v))return}r(!0,u.nativeEvent,"focus")},onBlur(u){c.current=!1;const v=u.relatedTarget,m=u.nativeEvent,b=z(v)&&v.hasAttribute($e("focus-guard"))&&v.getAttribute("data-type")==="outside";f.current=window.setTimeout(()=>{var g;const E=kt(s.domReference?s.domReference.ownerDocument:document);!v&&E===s.domReference||Re((g=i.current.floatingContext)==null?void 0:g.refs.floating.current,E)||Re(s.domReference,E)||b||r(!1,m,"focus")})}}),[i,s.domReference,r,a]);return h.useMemo(()=>l?{reference:p}:{},[l,p])}function Wt(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[Hn]:s,[Kn]:l,...a}=e;i=a}return{...n==="floating"&&{tabIndex:-1,[jo]:""},...i,...t.map(s=>{const l=s?s[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((s,l)=>(l&&Object.entries(l).forEach(a=>{let[c,f]=a;if(!(o&&[Hn,Kn].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof f=="function"){var d;(d=r.get(c))==null||d.push(f),s[c]=function(){for(var p,u=arguments.length,v=new Array(u),m=0;m<u;m++)v[m]=arguments[m];return(p=r.get(c))==null?void 0:p.map(b=>b(...v)).find(b=>b!==void 0)}}}else s[c]=f}),s),{})}}function ms(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),o=h.useCallback(l=>Wt(l,e,"reference"),t),i=h.useCallback(l=>Wt(l,e,"floating"),n),s=h.useCallback(l=>Wt(l,e,"item"),r);return h.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}const vs=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function hs(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:l=!0,role:a="dialog"}=t,c=dt(),f=((n=i.domReference)==null?void 0:n.id)||c,d=h.useMemo(()=>{var E;return((E=Jr(i.floating))==null?void 0:E.id)||s},[i.floating,s]),p=(r=vs.get(a))!=null?r:a,v=Yt()!=null,m=h.useMemo(()=>p==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:o?d:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?d:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:f},...p==="menu"&&v&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[p,d,v,o,f,a]),b=h.useMemo(()=>{const E={id:d,...p&&{role:p}};return p==="tooltip"||a==="label"?E:{...E,...p==="menu"&&{"aria-labelledby":f}}},[p,d,f,a]),g=h.useCallback(E=>{let{active:S,selected:L}=E;const R={role:"option",...S&&{id:d+"-fui-option"}};switch(a){case"select":case"combobox":return{...R,"aria-selected":L}}return{}},[d,a]);return h.useMemo(()=>l?{reference:m,floating:b,item:g}:{},[l,m,b,g])}function Jn({content:e,renderProps:t,delay:n=300,placement:r="top",classNames:o={},styles:i={},children:s}){const[l,a]=$.useState(!1),[c,f]=$.useState(null),d=typeof e=="function"?e(t):e,p=d!=null,{refs:u,floatingStyles:v,context:m}=ds({open:l&&p,onOpenChange:a,placement:r,strategy:"fixed",transform:!1,whileElementsMounted:No,middleware:[Vo(8),Ho({padding:8}),Wo({padding:8}),Ko({element:c})]}),b=ns(m,{move:!1,delay:{open:n,close:0}}),g=ps(m),E=us(m),S=hs(m,{role:"tooltip"}),{getReferenceProps:L,getFloatingProps:R}=ms([b,g,E,S]),P=s.ref,N=Uo([u.setReference,P??null]),M=$.cloneElement(s,L({...s.props,ref:N})),I=u.reference.current,C=(I instanceof HTMLElement?I.closest(".fldp-root"):null)??void 0;return y.jsxs(y.Fragment,{children:[M,l&&p&&y.jsx(is,{root:C,children:y.jsxs("div",{ref:u.setFloating,className:U("fldp-tooltip",o.tooltip),style:{...v,...i.tooltip},...R(),children:[d,y.jsx(Jo,{ref:f,context:m,style:{fill:"var(--fldp-foreground)"},width:10,height:5})]})})]})}function Qn({date:e,isOutside:t}){var B;const{mode:n,singleValue:r,rangeValue:o,hoveredDate:i,selectDate:s,setHoveredDate:l,disabled:a,isDisabled:c,readOnly:f,highlightToday:d,showAdjacentMonthDays:p,locale:u,tooltip:v,tooltipDelay:m,classNames:b,styles:g,renderDay:E,onDayHover:S}=ze(),L=((B=e.isToday)==null?void 0:B.call(e))??e.isSame(new Date,"day"),R=c||on(e,a),P=n==="single"?ce(e,r):ce(e,o.start)&&ce(e,o.end),N=n==="range"?ht(e,o):!1,M=n==="range"?gt(e,o):!1,I=n==="range"?qe(e,o.start,o.end):!1,C=n==="range"&&o.start&&!o.end&&i?{start:o.start,end:i}:null,V=C?qe(e,C.start,C.end)||ce(e,C.end):!1,_=C?ce(e,C.start):!1,T=C?ce(e,C.end):!1,x=n==="range"?o.end??(C==null?void 0:C.end)??null:null,O=n==="range"&&o.start&&x&&x.diff(o.start,"day")||null,F={date:e,isToday:L,isSelected:P||N||M,isDisabled:R,isRangeStart:N,isRangeEnd:M,isInRange:I||V,isRangeSelecting:n==="range"&&!!o.start&&!o.end,isInPreviewRange:V,isPreviewRangeEnd:T,rangeStart:n==="range"?o.start??null:null,rangeEnd:x,nights:O};if(t&&!p)return y.jsx("div",{className:"fldp-day fldp-day--outside","aria-hidden":"true"});function D(){R||f||s(e)}function w(){l(e),S==null||S(e)}function A(){l(null),S==null||S(null)}function k(q){(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),D())}const W=y.jsx("div",{onClick:D,onMouseEnter:w,onMouseLeave:A,onKeyDown:k,"aria-pressed":P||N||M,"aria-disabled":R,"aria-label":e.locale(u??"en").format("MMMM D, YYYY"),role:"button",tabIndex:R?-1:0,className:U("fldp-day",L&&d&&"fldp-day--today",P&&"fldp-day--selected",N&&!M&&"fldp-day--range-start",M&&!N&&"fldp-day--range-end",N&&M&&"fldp-day--selected",I&&"fldp-day--in-range",(V||_)&&!I&&!N&&!M&&"fldp-day--hovered-range",R&&"fldp-day--disabled",t&&"fldp-day--outside",(V||_)&&b.dayHovered,b.day,L&&b.dayToday,P&&b.daySelected,N&&b.dayRangeStart,M&&b.dayRangeEnd,I&&b.dayInRange,R&&b.dayDisabled,t&&b.dayOutside),style:{...g.day,...L&&g.dayToday,...P&&g.daySelected,...N&&g.dayRangeStart,...M&&g.dayRangeEnd,...I&&g.dayInRange,...R&&g.dayDisabled,...t&&g.dayOutside,...(V||_)&&g.dayHovered},children:E?E(e,F):y.jsx("span",{className:"fldp-day-number",children:e.date()})});return v?y.jsx(Jn,{content:v,renderProps:F,delay:m,classNames:b,styles:g,children:W}):W}function er({panelIndex:e=0,totalPanels:t=1}){const{currentYear:n,currentMonth:r,weekStartsOn:o,locale:i,classNames:s,styles:l}=ze(),a=r+e,c=n+Math.floor(a/12),f=a%12,d=sn(c,f,o),p=ln(o,i);return y.jsxs("div",{role:"grid","aria-label":`${Q(new Date(c,f)).locale(i??"en").format("MMMM YYYY")}`,className:U("fldp-calendar",s.calendar),style:l.calendar,children:[y.jsx(fn,{panelIndex:e,totalPanels:t}),y.jsx("div",{role:"row",className:U("fldp-weekdays",s.weekdays),style:l.weekdays,children:p.map(u=>y.jsx("div",{role:"columnheader","aria-label":u,className:U("fldp-weekday",s.weekday),style:l.weekday,children:u},u))}),y.jsx("div",{role:"rowgroup",className:U("fldp-days-grid",s.daysGrid),style:l.daysGrid,children:d.map(u=>{const v=u.month()!==f||u.year()!==c;return y.jsx(Qn,{date:u,isOutside:v},u.format("YYYY-MM-DD"))})})]})}function gs(){return y.jsxs("svg",{className:"fldp-calendar-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[y.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),y.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),y.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),y.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}function ys(){return y.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true",children:[y.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),y.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function bs({mode:e,singleValue:t,rangeValue:n,format:r,locale:o,placeholder:i,isOpen:s,isDisabled:l,readOnly:a,clearable:c,classNames:f,styles:d,onOpen:p,onClear:u,renderInput:v}){const m=e==="single"?t!=null:n.start!=null,b=M=>M?M.locale(o??"en").format(r):"",g=b(t),E=b(n.start),S=b(n.end),L=Array.isArray(i)?i[0]:i,R=Array.isArray(i)?i[1]:i;if(v){const M=e==="single"?g:[E,S].filter(Boolean).join(" → ");return y.jsx(y.Fragment,{children:v({value:M,onClick:p,onClear:u,isOpen:s,placeholder:L,isDisabled:l,readOnly:a})})}const P=d.inputWrapper??{};function N(M){(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),p())}return y.jsxs("div",{className:U("fldp-input-wrapper",s&&"fldp-input-wrapper--open",l&&"fldp-input-wrapper--disabled",f.inputWrapper),style:P,onClick:p,role:"button","aria-haspopup":"dialog","aria-expanded":s,"aria-disabled":l,tabIndex:l?-1:0,onKeyDown:N,children:[y.jsx(gs,{}),y.jsx("span",{className:"fldp-input-content","aria-hidden":"true",children:e==="single"?y.jsx("span",{className:U("fldp-input-value",!g&&"fldp-input-value--placeholder",f.input),style:d.input,children:g||L}):y.jsxs(y.Fragment,{children:[y.jsx("span",{className:U("fldp-input-value",!E&&"fldp-input-value--placeholder",f.input),style:d.input,children:E||L}),y.jsx("span",{className:U("fldp-separator",f.separator),style:d.separator,children:"→"}),y.jsx("span",{className:U("fldp-input-value",!S&&"fldp-input-value--placeholder",f.input),style:d.input,children:S||R})]})}),c&&m&&!a&&y.jsx("span",{className:U("fldp-clear-button",f.clearButton),style:d.clearButton,role:"button",tabIndex:0,"aria-label":"Clear date",onClick:M=>{M.stopPropagation(),u()},onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),M.stopPropagation(),u())},children:y.jsx(ys,{})})]})}function ws(e){if(!e)return{};const t={"--fldp-primary":e.primary,"--fldp-primary-hover":e.primaryHover,"--fldp-primary-foreground":e.primaryForeground,"--fldp-background":e.background,"--fldp-surface":e.surface,"--fldp-surface-strong":e.surfaceStrong,"--fldp-foreground":e.foreground,"--fldp-muted":e.muted,"--fldp-accent-soft":e.accentSoft,"--fldp-muted-foreground":e.mutedForeground,"--fldp-border":e.border,"--fldp-input-background":e.inputBackground,"--fldp-border-radius":e.borderRadius,"--fldp-day-border-radius":e.dayBorderRadius,"--fldp-shadow":e.shadow,"--fldp-font-family":e.fontFamily,"--fldp-font-size":e.fontSize,"--fldp-today-color":e.todayColor,"--fldp-disabled-opacity":e.disabledOpacity,"--fldp-transition-duration":e.transitionDuration,"--fldp-z-index":e.zIndex,"--fldp-gold":e.primary,"--fldp-gold-light":e.primaryHover??e.primary},n={};for(const[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return n}function Ht({timeSlots:e,selectedTime:t,onSelectTime:n,timeFormat:r,locale:o,targetDate:i,disabledTime:s,isDisabled:l,readOnly:a,classNames:c={},styles:f={}}){return y.jsxs("div",{className:U("fldp-time-picker",c.timePicker),style:f.timePicker,children:[y.jsx("div",{className:U("fldp-time-title",c.timeTitle),style:f.timeTitle,children:"Time"}),y.jsxs("div",{className:U("fldp-time-slot-list",c.timeSlotList),style:f.timeSlotList,children:[e.length===0&&y.jsx("span",{className:"fldp-time-empty",children:"No availability"}),e.map(d=>{const p=d===t,u=yt(i,d,s),v=Q(`2000-01-01T${d}`).locale(o??"en").format(r);return y.jsx("span",{role:"button",tabIndex:u||l||a?-1:0,"aria-disabled":u||l||a,className:U("fldp-time-slot",p&&"fldp-time-slot--selected",u&&"fldp-time-slot--disabled",c.timeSlot,p&&c.timeSlotSelected,u&&c.timeSlotDisabled),style:{...f.timeSlot,...p&&f.timeSlotSelected,...u&&f.timeSlotDisabled},onClick:()=>{!u&&!l&&!a&&n(d)},onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&!u&&!l&&!a&&(m.preventDefault(),n(d))},children:v},d)})]})]})}Q.extend(ar),Q.extend(fr);const xs="MMM D, YYYY",Es="Select date",Ss=["Start date","End date"],Ms=15,Ls="HH:mm",Ts="00:00",Ds="23:59";function Rs({mode:e="single",value:t,defaultValue:n,rangeValue:r,defaultRangeValue:o,format:i=xs,locale:s,lang:l,weekStartsOn:a=0,enableTime:c=!1,timeStep:f=Ms,timeFormat:d=Ls,minTime:p=Ts,maxTime:u=Ds,disabledTime:v,timeSchedule:m,defaultTimeSchedule:b,minDate:g,maxDate:E,placeholder:S,disabled:L,isDisabled:R=!1,readOnly:P=!1,clearable:N=!0,highlightToday:M=!0,showAdjacentMonthDays:I=!1,showOutsideDays:C,tooltip:V,tooltipDelay:_=300,theme:T,classNames:x={},styles:O={},className:F,style:D,numberOfMonths:w=1,showMonthYearSelectors:A=!0,inline:k=!1,placement:W="auto",renderDay:B,renderNavButton:q,renderInput:Ve,onDateChange:j,onRangeChange:X,onTimeChange:ee,onMonthChange:Kt,onYearChange:Ae,onDayHover:Ut,onOpen:Me,onClose:Le,onClear:Ne,onBeforeSelect:Oe,onAfterSelect:pt}){const We=t!==void 0,[Cs,jt]=$.useState(n??null),pe=We?t??null:Cs,be=r!==void 0,[tr,He]=$.useState(o??{start:null,end:null}),G=$.useMemo(()=>be?r??{start:null,end:null}:tr,[be,r,tr]),[Is,Fs]=$.useState(null),[le,nr]=$.useState(!1),Ke=$.useRef(null),[Ys,rr]=$.useState("bottom"),Ce=$.useCallback(()=>{if(k||W!=="auto"){rr(W==="top"?"top":"bottom");return}if(!Ke.current)return;const Y=Ke.current.getBoundingClientRect(),H=window.innerHeight-Y.bottom,J=Y.top;rr(H>=J?"bottom":"top")},[k,W]);$.useEffect(()=>{if(!le)return;const Y=window.requestAnimationFrame(Ce);return window.addEventListener("resize",Ce),window.addEventListener("scroll",Ce,!0),()=>{window.cancelAnimationFrame(Y),window.removeEventListener("resize",Ce),window.removeEventListener("scroll",Ce,!0)}},[le,Ce]);const or=e==="single"?pe??Q():G.start??Q(),[Xt,_s]=$.useState(or.month()),[zt,Bs]=$.useState(or.year()),sr=$.useCallback(()=>{k||R||P||(nr(!0),Me==null||Me())},[k,R,P,Me]),me=$.useCallback(()=>{k||(nr(!1),Le==null||Le())},[k,Le]),$s=$.useCallback(()=>{k||(le?me():sr())},[k,le,me,sr]),ir=$.useCallback((Y,H)=>({mode:e,phase:Y,currentValue:pe,currentRange:G,nextValue:H}),[e,pe,G]);$.useEffect(()=>{if(k)return;function Y(H){Ke.current&&!Ke.current.contains(H.target)&&me()}return le&&document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[le,k,me]),$.useEffect(()=>{if(k)return;function Y(H){H.key==="Escape"&&me()}return le&&document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[le,k,me]);function qt(Y,H){const[J,Xe]=H.split(":").map(Number),te=Number.isFinite(J)?J:0,Zt=Number.isFinite(Xe)?Xe:0;return Y.hour(te).minute(Zt).second(0).millisecond(0)}const Vs=$.useCallback(Y=>{let H,J;if(e==="single")J="single",H=c&&pe?Y.hour(pe.hour()).minute(pe.minute()):Y;else if(!G.start||G.start&&G.end)J="range-start",H={start:c&&G.start?Y.hour(G.start.hour()).minute(G.start.minute()):Y,end:null};else{J="range-end";const te=Y,[Zt,Js]=te.isBefore(G.start)?[te,G.start]:[G.start,te];H={start:Zt,end:Js}}const Xe=ir(J,H);if((Oe==null?void 0:Oe(Y,Xe))!==!1){if(e==="single"){const te=H;We||jt(te),j==null||j(te)}else if(J==="range-start"){const te=H;be||He(te),X==null||X(te)}else{const te=H;be||He(te),X==null||X(te)}pt==null||pt(Y,Xe),!c&&(e==="single"||J==="range-end")&&me()}},[e,G,pe,We,be,Oe,pt,j,X,c,ir,me]);function Ws(){if(e==="single")We||jt(null),j==null||j(null);else{const Y={start:null,end:null};be||He(Y),X==null||X(Y)}Ne==null||Ne()}const Ue=x,je=O,Hs=ws(T),Ks=C??I,Gt=l??s,Z=L&&typeof L=="object"?L:void 0,Us=L===!0?!0:{...Z,before:g?Z!=null&&Z.before&&Z.before.isAfter(g,"day")?Z.before:g:Z==null?void 0:Z.before,after:E?Z!=null&&Z.after&&Z.after.isBefore(E,"day")?Z.after:E:Z==null?void 0:Z.after},js={mode:e,singleValue:pe,rangeValue:G,hoveredDate:Is,currentYear:zt,currentMonth:Xt,setCurrentYear:Y=>{Bs(Y),Ae==null||Ae(Y)},setCurrentMonth:Y=>{_s(Y)},selectDate:Vs,setHoveredDate:Fs,weekStartsOn:a,locale:Gt,showMonthYearSelectors:A,disabled:Us,isDisabled:R,readOnly:P,highlightToday:M,showAdjacentMonthDays:Ks,tooltip:V,tooltipDelay:_,format:i,classNames:Ue,styles:je,renderDay:B,renderNavButton:q,onDateChange:j,onRangeChange:X,onTimeChange:ee,onMonthChange:Kt,onYearChange:Ae,onDayHover:Ut,onOpen:Me,onClose:Le,onClear:Ne},Xs=S??(e==="single"?Es:Ss),mt=e==="single"?pe??Q(new Date(zt,Xt,1)):G.end??G.start??Q(new Date(zt,Xt,1)),zs=(()=>{const Y=mt.format("YYYY-MM-DD"),H=(m==null?void 0:m[Y])??b;return H?un(H):Ge(f,p,u)})(),qs=mt.format("HH:mm");function Gs(Y){if(!(R||P)){if(e==="single"){const H=qt(mt,Y);We||jt(H),j==null||j(H),ee==null||ee(H,Y),k||me();return}if(G.end){const H=qt(G.end,Y),J={...G,end:H};be||He(J),X==null||X(J),ee==null||ee(H,Y),k||me();return}if(G.start){const H=qt(G.start,Y),J={...G,start:H};be||He(J),X==null||X(J),ee==null||ee(H,Y)}}}const Zs={...Hs,...D};return y.jsx(vt.Provider,{value:js,children:y.jsxs("div",{ref:Ke,className:U("fldp-root",F,Ue.root),style:{...Zs,...je.root},"data-mode":e,"data-open":le,"data-inline":k,children:[!k&&y.jsx(bs,{mode:e,singleValue:pe,rangeValue:G,format:i,locale:Gt,placeholder:Xs,isOpen:le,isDisabled:R,readOnly:P,clearable:N,classNames:Ue,styles:je,onOpen:$s,onClear:Ws,renderInput:Ve}),(k||le)&&y.jsxs("div",{role:"dialog","aria-label":"Date picker","aria-modal":"false",className:U("fldp-popover",k&&"fldp-popover--inline",!k&&`fldp-popover--${Ys}`,Ue.popover),style:je.popover,children:[Array.from({length:w},(Y,H)=>y.jsx(er,{panelIndex:H,totalPanels:w},H)),c&&y.jsx(Ht,{timeSlots:zs,selectedTime:qs,onSelectTime:Gs,timeFormat:d,locale:Gt,targetDate:mt,disabledTime:v,isDisabled:R,readOnly:P,classNames:Ue,styles:je})]})]})})}const Ps=[{label:"Dates Sélectionnées",className:"fldp-legend-box--selected"},{label:"Disponibilité",className:"fldp-legend-box--available"},{label:"Pas De Disponibilité",className:"fldp-legend-box--unavailable"},{label:"Séjour Minimal",className:"fldp-legend-box--minimal-stay"},{label:"Pas D'Arrivée",className:"fldp-legend-box--no-arrival"}];function ks({items:e=Ps,className:t,style:n}){return y.jsx("div",{className:`fldp-calendar-legend ${t||""}`,style:n,children:e.map((r,o)=>y.jsxs("div",{className:"fldp-legend-item",children:[y.jsx("div",{className:`fldp-legend-box ${r.className}`}),y.jsx("span",{className:"fldp-legend-label",children:r.label})]},o))})}const As="HH:mm",Ns="Select time";function Os({value:e,defaultValue:t,onChange:n,timeStep:r=15,minTime:o="00:00",maxTime:i="23:59",schedule:s,timeFormat:l=As,placeholder:a=Ns,locale:c,date:f,disabledTime:d,inline:p=!1,isDisabled:u=!1,readOnly:v=!1,clearable:m=!0,onOpen:b,onClose:g,onClear:E,className:S,style:L}){const R=e!==void 0,[P,N]=$.useState(t??""),M=R?e:P,[I,C]=$.useState(!1),V=$.useRef(null),_=$.useCallback(()=>{p||u||v||(C(!0),b==null||b())},[p,u,v,b]),T=$.useCallback(()=>{C(!1),g==null||g()},[g]),x=$.useCallback(()=>{I?T():_()},[I,T,_]),O=f??Q(),F=s?un(s):Ge(r,o,i);$.useEffect(()=>{if(p)return;function W(B){V.current&&!V.current.contains(B.target)&&T()}return I&&document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[I,p,T]),$.useEffect(()=>{if(p)return;function W(B){B.key==="Escape"&&T()}return I&&document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[I,p,T]);function D(W){R||N(W),n==null||n(W),p||T()}function w(W){W.stopPropagation(),R||N(""),n==null||n(""),E==null||E()}const A=M&&!yt(O,M,d)?Q(`2000-01-01T${M}`).locale(c??"en").format(l):M?Q(`2000-01-01T${M}`).locale(c??"en").format(l):"",k=y.jsx(Ht,{timeSlots:F,selectedTime:M,onSelectTime:D,timeFormat:l,locale:c,targetDate:O,disabledTime:d,isDisabled:u,readOnly:v});return p?y.jsx("div",{ref:V,className:U("fldp-root fldp-root--time-only",S),style:L,"data-inline":"true",children:y.jsx("div",{role:"region","aria-label":"Time picker",className:"fldp-popover fldp-popover--inline fldp-popover--time-only",children:k})}):y.jsxs("div",{ref:V,className:U("fldp-root fldp-root--time-only",S),style:L,"data-open":I,children:[y.jsxs("div",{role:"button",tabIndex:u?-1:0,"aria-label":A||a,"aria-haspopup":"dialog","aria-expanded":I,className:U("fldp-input-wrapper",u&&"fldp-input-wrapper--disabled",v&&"fldp-input-wrapper--readonly",I&&"fldp-input-wrapper--open"),onClick:x,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),x())},children:[y.jsxs("svg",{className:"fldp-clock-icon","aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("circle",{cx:"12",cy:"12",r:"10"}),y.jsx("polyline",{points:"12 6 12 12 16 14"})]}),y.jsx("span",{className:U("fldp-input-value",!A&&"fldp-input-value--placeholder"),children:A||a}),m&&M&&!u&&!v&&y.jsx("button",{type:"button","aria-label":"Clear time",className:"fldp-clear-button",tabIndex:-1,onClick:w,children:"×"}),y.jsx("svg",{className:U("fldp-input-chevron",I&&"fldp-input-chevron--open"),"aria-hidden":"true",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:y.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),I&&y.jsx("div",{role:"dialog","aria-label":"Time picker","aria-modal":"false",className:"fldp-popover fldp-popover--time-only",children:k})]})}K.Calendar=er,K.CalendarDay=Qn,K.CalendarHeader=fn,K.CalendarLegend=ks,K.DatePicker=Rs,K.DatePickerContext=vt,K.TimePicker=Os,K.TimeSlotList=Ht,K.Tooltip=Jn,K.generateCalendarDays=sn,K.generateTimeSlots=Ge,K.getMonthNames=cn,K.getWeekdayLabels=ln,K.isBetween=qe,K.isDateDisabled=on,K.isInRange=dr,K.isRangeEnd=gt,K.isRangeStart=ht,K.isSameDay=ce,K.isTimeDisabled=yt,K.useDatePickerContext=ze,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
|
|
4
|
+
*/var Tr=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Rt=Tr.join(","),hn=typeof Element>"u",Ye=hn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,st=!hn&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},it=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):it(t.parentNode));return i},Rr=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Dr=function(t,n,r){if(it(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Rt));return n&&Ye.call(t,Rt)&&o.unshift(t),o=o.filter(r),o},Dt=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!it(i,!1))if(i.tagName==="SLOT"){var l=i.assignedElements(),a=l.length?l:i.children,c=Dt(a,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var f=Ye.call(i,Rt);f&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),p=!it(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&p){var u=Dt(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else s.unshift.apply(s,i.children)}}return o},yn=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},bn=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Rr(t))&&!yn(t)?0:t.tabIndex},Pr=function(t,n){var r=bn(t);return r<0&&n&&!yn(t)?0:r},kr=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},wn=function(t){return t.tagName==="INPUT"},Ar=function(t){return wn(t)&&t.type==="hidden"},Nr=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Cr=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Or=function(t){if(!t.name)return!0;var n=t.form||st(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Cr(o,t.form);return!s||s===t},Ir=function(t){return wn(t)&&t.type==="radio"},Fr=function(t){return Ir(t)&&!Or(t)},Yr=function(t){var n,r=t&&st(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,l,a;for(s=!!((i=o)!==null&&i!==void 0&&(l=i.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!s&&o;){var c,f,d;r=st(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((f=o)!==null&&f!==void 0&&(d=f.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},xn=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},_r=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Ye.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(Ye.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var c=t.parentElement,f=st(t);if(c&&!c.shadowRoot&&o(c)===!0)return xn(t);t.assignedSlot?t=t.assignedSlot:!c&&f!==t.ownerDocument?t=f.host:t=c}t=a}if(Yr(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return xn(t);return!1},$r=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Ye.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Br=function(t,n){return!(n.disabled||Ar(n)||_r(n,t)||Nr(n)||$r(n))},En=function(t,n){return!(Fr(n)||bn(n)<0||!Br(t,n))},Vr=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Sn=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,l=i?o.scopeParent:o,a=Pr(l,i),c=i?Sn(o.candidates):l;a===0?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:s,tabIndex:a,item:o,isScope:i,content:c})}),r.sort(kr).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Mn=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Dt([t],n.includeContainer,{filter:En.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Vr}):r=Dr(t,n.includeContainer,En.bind(null,n)),Sn(r)};function Wr(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Hr(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Ln(){return/apple/i.test(navigator.vendor)}function Kr(){return Wr().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Ur(){return Hr().includes("jsdom/")}const Tn="data-floating-ui-focusable",jr="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Pt(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function De(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&wt(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Pe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function kt(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function zr(e){return e.matches("html,body")}function ae(e){return(e==null?void 0:e.ownerDocument)||document}function Xr(e){return se(e)&&e.matches(jr)}function qr(e){if(!e||Ur())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Gr(e){return e?e.hasAttribute(Tn)?e:e.querySelector("["+Tn+"]")||e:null}function lt(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...lt(e,o.id,n)])}function Zr(e){return"nativeEvent"in e}function At(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var Jr=typeof document<"u",Qr=function(){},ie=Jr?$.useLayoutEffect:Qr;const eo={...h};function ct(e){const t=h.useRef(e);return ie(()=>{t.current=e}),t}const to=eo.useInsertionEffect||(e=>e());function ue(e){const t=h.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return to(()=>{t.current=e}),h.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Rn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Dn(e,t){const n=Mn(e,Rn()),r=n.length;if(r===0)return;const o=Pt(ae(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function no(e){return Dn(ae(e).body,1)||e}function ro(e){return Dn(ae(e).body,-1)||e}function Nt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!De(n,r)}function oo(e){Mn(e,Rn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Pn(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function kn(e,t,n){let{reference:r,floating:o}=e;const s=ye(t),i=Lt(t),l=Mt(i),a=Re(t),c=s==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[l]/2-o[l]/2;let u;switch(a){case"top":u={x:f,y:r.y-o.height};break;case"bottom":u={x:f,y:r.y+r.height};break;case"right":u={x:r.x+r.width,y:d};break;case"left":u={x:r.x-o.width,y:d};break;default:u={x:r.x,y:r.y}}const m=Fe(t);return m&&(u[i]+=p*(m==="end"?1:-1)*(n&&c?-1:1)),u}async function so(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:u=0}=Ie(t,e),m=gn(u),y=l[p?d==="floating"?"reference":"floating":d],g=ot(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:a})),E=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),L=await(s.isElement==null?void 0:s.isElement(R))&&await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1},D=ot(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:R,strategy:a}):E);return{top:(g.top-D.top+m.top)/L.y,bottom:(D.bottom-g.bottom+m.bottom)/L.y,left:(g.left-D.left+m.left)/L.x,right:(D.right-g.right+m.right)/L.x}}const io=50,lo=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:so},a=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=kn(c,r,a),p=r,u=0;const m={};for(let v=0;v<s.length;v++){const y=s[v];if(!y)continue;const{name:g,fn:E}=y,{x:R,y:L,data:D,reset:P}=await E({x:f,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:m,rects:c,platform:l,elements:{reference:e,floating:t}});f=R??f,d=L??d,m[g]={...m[g],...D},P&&u<io&&(u++,typeof P=="object"&&(P.placement&&(p=P.placement),P.rects&&(c=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:f,y:d}=kn(c,p,a)),v=-1)}return{x:f,y:d,placement:p,strategy:o,middlewareData:m}},co=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l,middlewareData:a}=t,{element:c,padding:f=0}=Ie(e,t)||{};if(c==null)return{};const d=gn(f),p={x:n,y:r},u=Lt(o),m=Mt(u),v=await i.getDimensions(c),y=u==="y",g=y?"top":"left",E=y?"bottom":"right",R=y?"clientHeight":"clientWidth",L=s.reference[m]+s.reference[u]-p[u]-s.floating[m],D=p[u]-s.reference[u],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let T=P?P[R]:0;(!T||!await(i.isElement==null?void 0:i.isElement(P)))&&(T=l.floating[R]||s.floating[m]);const S=L/2-D/2,I=T/2-v[m]/2-1,C=Te(d[g],I),B=Te(d[E],I),V=T-v[m]-B,M=T/2-v[m]/2+S,x=dn(C,M,V),O=!a.arrow&&Fe(o)!=null&&M!==x&&s.reference[m]/2-(M<C?C:B)-v[m]/2<0,F=O?M<C?M-C:M-V:0;return{[u]:p[u]+F,data:{[u]:x,centerOffset:M-x-F,...O&&{alignmentOffset:F}},reset:O}}}),ao=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...y}=Ie(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=Re(o),E=ye(l),R=Re(l)===l,L=await(a.isRTL==null?void 0:a.isRTL(c.floating)),D=p||(R||!v?[rt(l)]:wr(l)),P=m!=="none";!p&&P&&D.push(...Mr(l,v,m,L));const T=[l,...D],S=await a.detectOverflow(t,y),I=[];let C=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&I.push(S[g]),d){const x=br(o,i,L);I.push(S[x[0]],S[x[1]])}if(C=[...C,{placement:o,overflows:I}],!I.every(x=>x<=0)){var B,V;const x=(((B=s.flip)==null?void 0:B.index)||0)+1,O=T[x];if(O&&(!(d==="alignment"?E!==ye(O):!1)||C.every(w=>ye(w.placement)===E?w.overflows[0]>0:!0)))return{data:{index:x,overflows:C},reset:{placement:O}};let F=(V=C.filter(k=>k.overflows[0]<=0).sort((k,w)=>k.overflows[1]-w.overflows[1])[0])==null?void 0:V.placement;if(!F)switch(u){case"bestFit":{var M;const k=(M=C.filter(w=>{if(P){const N=ye(w.placement);return N===E||N==="y"}return!0}).map(w=>[w.placement,w.overflows.filter(N=>N>0).reduce((N,A)=>N+A,0)]).sort((w,N)=>w[1]-N[1])[0])==null?void 0:M[0];k&&(F=k);break}case"initialPlacement":F=l;break}if(o!==F)return{reset:{placement:F}}}return{}}}},uo=new Set(["left","top"]);async function fo(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Re(n),l=Fe(n),a=ye(n)==="y",c=uo.has(i)?-1:1,f=s&&a?-1:1,d=Ie(t,e);let{mainAxis:p,crossAxis:u,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof m=="number"&&(u=l==="end"?m*-1:m),a?{x:u*f,y:p*c}:{x:p*c,y:u*f}}const po=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:l}=t,a=await fo(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:{...a,placement:i}}}}},mo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:E=>{let{x:R,y:L}=E;return{x:R,y:L}}},...c}=Ie(e,t),f={x:n,y:r},d=await s.detectOverflow(t,c),p=ye(o),u=pn(p);let m=f[u],v=f[p];const y=(E,R)=>dn(R+d[E==="y"?"top":"left"],R,R-d[E==="y"?"bottom":"right"]);i&&(m=y(u,m)),l&&(v=y(p,v));const g=a.fn({...t,[u]:m,[p]:v});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[u]:i,[p]:l}}}}}};function An(e){const t=re(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=se(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=tt(n)!==s||tt(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function Ct(e){return X(e)?e:e.contextElement}function ke(e){const t=Ct(e);if(!se(t))return me(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=An(t);let i=(s?tt(n.width):n.width)/r,l=(s?tt(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const vo=me(0);function Nn(e){const t=ne(e);return!Qe()||!t.visualViewport?vo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function go(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ne(e)}function Ee(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ct(e);let i=me(1);t&&(r?X(r)&&(i=ke(r)):i=ke(e));const l=go(s,n,r)?Nn(s):me(0);let a=(o.left+l.x)/i.x,c=(o.top+l.y)/i.y,f=o.width/i.x,d=o.height/i.y;if(s&&r){const p=ne(s),u=X(r)?ne(r):r;let m=p,v=St(m);for(;v&&u!==m;){const y=ke(v),g=v.getBoundingClientRect(),E=re(v),R=g.left+(v.clientLeft+parseFloat(E.paddingLeft))*y.x,L=g.top+(v.clientTop+parseFloat(E.paddingTop))*y.y;a*=y.x,c*=y.y,f*=y.x,d*=y.y,a+=R,c+=L,m=ne(v),v=St(m)}}return ot({width:f,height:d,x:a,y:c})}function at(e,t){const n=et(e).scrollLeft;return t?t.left+n:Ee(pe(e)).left+n}function Cn(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-at(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function ho(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=pe(r),l=t?Je(t.floating):!1;if(r===i||l&&s)return n;let a={scrollLeft:0,scrollTop:0},c=me(1);const f=me(0),d=se(r);if((d||!s)&&((Le(r)!=="body"||Ze(i))&&(a=et(r)),d)){const u=Ee(r);c=ke(r),f.x=u.x+r.clientLeft,f.y=u.y+r.clientTop}const p=i&&!d&&!s?Cn(i,a):me(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-a.scrollTop*c.y+f.y+p.y}}function yo(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function bo(e){const t=et(e),n=e.ownerDocument.body,r=xe(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=xe(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+at(e);const i=-t.scrollTop;return re(n).direction==="rtl"&&(s+=xe(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:s,y:i}}const wo=25;function xo(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",o=ne(e),s=pe(e),i=o.visualViewport;let l=s.clientWidth,a=s.clientHeight,c=0,f=0;if(i){const p=!Qe()||t==="fixed";r?p||(c=-i.offsetLeft,f=-i.offsetTop):(l=i.width,a=i.height,p&&(c=i.offsetLeft,f=i.offsetTop))}if(at(s)<=0){const p=s.ownerDocument,u=p.body,m=getComputedStyle(u),v=p.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,y=Math.abs(s.clientWidth-u.clientWidth-v),g=getComputedStyle(s).scrollbarGutter==="stable both-edges"?y/2:y;g<=wo&&(l-=g)}return{width:l,height:a,x:c,y:f}}function Eo(e,t){const n=Ee(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ke(e),i=e.clientWidth*s.x,l=e.clientHeight*s.y,a=o*s.x,c=r*s.y;return{width:i,height:l,x:a,y:c}}function On(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=xo(e,n,t);else if(t==="document")r=bo(pe(e));else if(X(t))r=Eo(t,n);else{const o=Nn(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ot(r)}function So(e,t){const n=t.get(e);if(n)return n;let r=he(e,[],!1).filter(l=>X(l)&&Le(l)!=="body"),o=null;const s=re(e).position==="fixed";let i=s?ge(e):e;for(;X(i)&&!ve(i);){const l=re(i),a=Et(i),c=o?o.position:s?"fixed":"";!a&&(c==="fixed"||c==="absolute"&&l.position==="static")?r=r.filter(d=>d!==i):o=l,i=ge(i)}return t.set(e,r),r}function Mo(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Je(t)?[]:So(t,this._c):[].concat(n),r],l=On(t,i[0],o);let a=l.top,c=l.right,f=l.bottom,d=l.left;for(let p=1;p<i.length;p++){const u=On(t,i[p],o);a=xe(u.top,a),c=Te(u.right,c),f=Te(u.bottom,f),d=xe(u.left,d)}return{width:c-d,height:f-a,x:d,y:a}}function Lo(e){const{width:t,height:n}=An(e);return{width:t,height:n}}function To(e,t,n){const r=se(t),o=pe(t),s=n==="fixed",i=Ee(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const a=me(0);if((r||!s)&&((Le(t)!=="body"||Ze(o))&&(l=et(t)),r)){const p=Ee(t,!0,s,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}!r&&o&&(a.x=at(o));const c=o&&!r&&!s?Cn(o,l):me(0),f=i.left+l.scrollLeft-a.x-c.x,d=i.top+l.scrollTop-a.y-c.y;return{x:f,y:d,width:i.width,height:i.height}}function Ot(e){return re(e).position==="static"}function In(e,t){if(!se(e)||re(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return pe(e)===n&&(n=n.ownerDocument.body),n}function Fn(e,t){const n=ne(e);if(Je(e))return n;if(!se(e)){let o=ge(e);for(;o&&!ve(o);){if(X(o)&&!Ot(o))return o;o=ge(o)}return n}let r=In(e,t);for(;r&&mr(r)&&Ot(r);)r=In(r,t);return r&&ve(r)&&Ot(r)&&!Et(r)?n:r||hr(e)||n}const Ro=async function(e){const t=this.getOffsetParent||Fn,n=this.getDimensions,r=await n(e.floating);return{reference:To(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Do(e){return re(e).direction==="rtl"}const Po={convertOffsetParentRelativeRectToViewportRelativeRect:ho,getDocumentElement:pe,getClippingRect:Mo,getOffsetParent:Fn,getElementRects:Ro,getClientRects:yo,getDimensions:Lo,getScale:ke,isElement:X,isRTL:Do};function Yn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ko(e,t,n){let r=null,o;const s=pe(e);function i(){var f;clearTimeout(o),(f=r)==null||f.disconnect(),r=null}function l(f,d){f===void 0&&(f=!1),d===void 0&&(d=1),i();const p=e.getBoundingClientRect(),{left:u,top:m,width:v,height:y}=p;if(f||t(),!v||!y)return;const g=nt(m),E=nt(s.clientWidth-(u+v)),R=nt(s.clientHeight-(m+y)),L=nt(u),P={rootMargin:-g+"px "+-E+"px "+-R+"px "+-L+"px",threshold:xe(0,Te(1,d))||1};let T=!0;function S(I){const C=I[0].intersectionRatio;if(!Yn(p,e.getBoundingClientRect()))return l();if(C!==d){if(!T)return l();C?l(!1,C):o=setTimeout(()=>{l(!1,1e-7)},1e3)}T=!1}try{r=new IntersectionObserver(S,{...P,root:s.ownerDocument})}catch{r=new IntersectionObserver(S,P)}r.observe(e)}const a=ne(e),c=()=>l(n);return a.addEventListener("resize",c),l(!0),()=>{a.removeEventListener("resize",c),i()}}function Ao(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=Ct(e),f=o||s?[...c?he(c):[],...t?he(t):[]]:[];f.forEach(g=>{o&&g.addEventListener("scroll",n),s&&g.addEventListener("resize",n)});const d=c&&l?ko(c,n,s):null;let p=-1,u=null;i&&(u=new ResizeObserver(g=>{let[E]=g;E&&E.target===c&&u&&t&&(u.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var R;(R=u)==null||R.observe(t)})),n()}),c&&!a&&u.observe(c),t&&u.observe(t));let m,v=a?Ee(e):null;a&&y();function y(){const g=Ee(e);v&&!Yn(v,g)&&n(),v=g,m=requestAnimationFrame(y)}return n(),()=>{var g;f.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),d==null||d(),(g=u)==null||g.disconnect(),u=null,a&&cancelAnimationFrame(m)}}const No=po,Co=mo,Oo=ao,_n=co,Io=(e,t,n)=>{const r=new Map,o=n??{},s={...Po,...o.platform,_c:r};return lo(e,t,{...o,platform:s})};var Fo=typeof document<"u",Yo=function(){},ut=Fo?$.useLayoutEffect:Yo;function ft(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ft(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!ft(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function $n(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bn(e,t){const n=$n(e);return Math.round(t*n)/n}function It(e){const t=h.useRef(e);return ut(()=>{t.current=e}),t}function _o(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:a,open:c}=e,[f,d]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,u]=h.useState(r);ft(p,r)||u(r);const[m,v]=h.useState(null),[y,g]=h.useState(null),E=h.useCallback(w=>{w!==P.current&&(P.current=w,v(w))},[]),R=h.useCallback(w=>{w!==T.current&&(T.current=w,g(w))},[]),L=s||m,D=i||y,P=h.useRef(null),T=h.useRef(null),S=h.useRef(f),I=a!=null,C=It(a),B=It(o),V=It(c),M=h.useCallback(()=>{if(!P.current||!T.current)return;const w={placement:t,strategy:n,middleware:p};B.current&&(w.platform=B.current),Io(P.current,T.current,w).then(N=>{const A={...N,isPositioned:V.current!==!1};x.current&&!ft(S.current,A)&&(S.current=A,Jt.flushSync(()=>{d(A)}))})},[p,t,n,B,V]);ut(()=>{c===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,d(w=>({...w,isPositioned:!1})))},[c]);const x=h.useRef(!1);ut(()=>(x.current=!0,()=>{x.current=!1}),[]),ut(()=>{if(L&&(P.current=L),D&&(T.current=D),L&&D){if(C.current)return C.current(L,D,M);M()}},[L,D,M,C,I]);const O=h.useMemo(()=>({reference:P,floating:T,setReference:E,setFloating:R}),[E,R]),F=h.useMemo(()=>({reference:L,floating:D}),[L,D]),k=h.useMemo(()=>{const w={position:n,left:0,top:0};if(!F.floating)return w;const N=Bn(F.floating,f.x),A=Bn(F.floating,f.y);return l?{...w,transform:"translate("+N+"px, "+A+"px)",...$n(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:N,top:A}},[n,l,F.floating,f.x,f.y]);return h.useMemo(()=>({...f,update:M,refs:O,elements:F,floatingStyles:k}),[f,M,O,F,k])}const $o=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?_n({element:r.current,padding:o}).fn(n):{}:r?_n({element:r,padding:o}).fn(n):{}}}},Bo=(e,t)=>{const n=No(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vo=(e,t)=>{const n=Co(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wo=(e,t)=>{const n=Oo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ho=(e,t)=>{const n=$o(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Ko(e){const t=h.useRef(void 0),n=h.useCallback(r=>{const o=e.map(s=>{if(s!=null){if(typeof s=="function"){const i=s,l=i(r);return typeof l=="function"?l:()=>{i(null)}}return s.current=r,()=>{s.current=null}}});return()=>{o.forEach(s=>s==null?void 0:s())}},e);return h.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const Uo="data-floating-ui-focusable",Vn="active",Wn="selected",jo={...h};let Hn=!1,zo=0;const Kn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+zo++;function Xo(){const[e,t]=h.useState(()=>Hn?Kn():void 0);return ie(()=>{e==null&&t(Kn())},[]),h.useEffect(()=>{Hn=!0},[]),e}const dt=jo.useId||Xo;let _e;process.env.NODE_ENV!=="production"&&(_e=new Set);function qo(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=_e)!=null&&e.has(o))){var s;(s=_e)==null||s.add(o),console.warn(o)}}function Go(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=_e)!=null&&e.has(o))){var s;(s=_e)==null||s.add(o),console.error(o)}}const Zo=h.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:s,shift:i}},width:l=14,height:a=7,tipRadius:c=0,strokeWidth:f=0,staticOffset:d,stroke:p,d:u,style:{transform:m,...v}={},...y}=t;process.env.NODE_ENV!=="production"&&(n||qo("The `ref` prop is required for `FloatingArrow`."));const g=dt(),[E,R]=h.useState(!1);if(ie(()=>{if(!o)return;re(o).direction==="rtl"&&R(!0)},[o]),!o)return null;const[L,D]=r.split("-"),P=L==="top"||L==="bottom";let T=d;(P&&i!=null&&i.x||!P&&i!=null&&i.y)&&(T=null);const S=f*2,I=S/2,C=l/2*(c/-8+1),B=a/2*c/4,V=!!u,M=T&&D==="end"?"bottom":"top";let x=T&&D==="end"?"right":"left";T&&E&&(x=D==="end"?"left":"right");const O=(s==null?void 0:s.x)!=null?T||s.x:"",F=(s==null?void 0:s.y)!=null?T||s.y:"",k=u||"M0,0"+(" H"+l)+(" L"+(l-C)+","+(a-B))+(" Q"+l/2+","+a+" "+C+","+(a-B))+" Z",w={top:V?"rotate(180deg)":"",left:V?"rotate(90deg)":"rotate(-90deg)",bottom:V?"":"rotate(180deg)",right:V?"rotate(-90deg)":"rotate(90deg)"}[L];return b.jsxs("svg",{...y,"aria-hidden":!0,ref:n,width:V?l:l+S,height:l,viewBox:"0 0 "+l+" "+(a>l?a:l),style:{position:"absolute",pointerEvents:"none",[x]:O,[M]:F,[L]:P||V?"100%":"calc(100% - "+S/2+"px)",transform:[w,m].filter(N=>!!N).join(" "),...v},children:[S>0&&b.jsx("path",{clipPath:"url(#"+g+")",fill:"none",stroke:p,strokeWidth:S+(u?0:1),d:k}),b.jsx("path",{stroke:S&&!u?y.fill:"none",d:k}),b.jsx("clipPath",{id:g,children:b.jsx("rect",{x:-I,y:I*(V?-1:1),width:l+S,height:l})})]})});function Jo(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const Qo=h.createContext(null),es=h.createContext(null),Ft=()=>{var e;return((e=h.useContext(Qo))==null?void 0:e.id)||null},Yt=()=>h.useContext(es);function $e(e){return"data-floating-ui-"+e}function oe(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Un=$e("safe-polygon");function _t(e,t,n){if(n&&!At(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}function $t(e){return typeof e=="function"?e():e}function ts(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:l=!0,delay:a=0,handleClose:c=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=t,u=Yt(),m=Ft(),v=ct(c),y=ct(a),g=ct(n),E=ct(d),R=h.useRef(),L=h.useRef(-1),D=h.useRef(),P=h.useRef(-1),T=h.useRef(!0),S=h.useRef(!1),I=h.useRef(()=>{}),C=h.useRef(!1),B=ue(()=>{var k;const w=(k=o.current.openEvent)==null?void 0:k.type;return(w==null?void 0:w.includes("mouse"))&&w!=="mousedown"});h.useEffect(()=>{if(!l)return;function k(w){let{open:N}=w;N||(oe(L),oe(P),T.current=!0,C.current=!1)}return s.on("openchange",k),()=>{s.off("openchange",k)}},[l,s]),h.useEffect(()=>{if(!l||!v.current||!n)return;function k(N){B()&&r(!1,N,"hover")}const w=ae(i.floating).documentElement;return w.addEventListener("mouseleave",k),()=>{w.removeEventListener("mouseleave",k)}},[i.floating,n,r,l,v,B]);const V=h.useCallback(function(k,w,N){w===void 0&&(w=!0),N===void 0&&(N="hover");const A=_t(y.current,"close",R.current);A&&!D.current?(oe(L),L.current=window.setTimeout(()=>r(!1,k,N),A)):w&&(oe(L),r(!1,k,N))},[y,r]),M=ue(()=>{I.current(),D.current=void 0}),x=ue(()=>{if(S.current){const k=ae(i.floating).body;k.style.pointerEvents="",k.removeAttribute(Un),S.current=!1}}),O=ue(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);h.useEffect(()=>{if(!l)return;function k(_){if(oe(L),T.current=!1,f&&!At(R.current)||$t(E.current)>0&&!_t(y.current,"open"))return;const q=_t(y.current,"open",R.current);q?L.current=window.setTimeout(()=>{g.current||r(!0,_,"hover")},q):n||r(!0,_,"hover")}function w(_){if(O()){x();return}I.current();const q=ae(i.floating);if(oe(P),C.current=!1,v.current&&o.current.floatingContext){n||oe(L),D.current=v.current({...o.current.floatingContext,tree:u,x:_.clientX,y:_.clientY,onClose(){x(),M(),O()||V(_,!0,"safe-polygon")}});const j=D.current;q.addEventListener("mousemove",j),I.current=()=>{q.removeEventListener("mousemove",j)};return}(R.current==="touch"?!De(i.floating,_.relatedTarget):!0)&&V(_)}function N(_){O()||o.current.floatingContext&&(v.current==null||v.current({...o.current.floatingContext,tree:u,x:_.clientX,y:_.clientY,onClose(){x(),M(),O()||V(_)}})(_))}function A(){oe(L)}function W(_){O()||V(_,!1)}if(X(i.domReference)){const _=i.domReference,q=i.floating;return n&&_.addEventListener("mouseleave",N),p&&_.addEventListener("mousemove",k,{once:!0}),_.addEventListener("mouseenter",k),_.addEventListener("mouseleave",w),q&&(q.addEventListener("mouseleave",N),q.addEventListener("mouseenter",A),q.addEventListener("mouseleave",W)),()=>{n&&_.removeEventListener("mouseleave",N),p&&_.removeEventListener("mousemove",k),_.removeEventListener("mouseenter",k),_.removeEventListener("mouseleave",w),q&&(q.removeEventListener("mouseleave",N),q.removeEventListener("mouseenter",A),q.removeEventListener("mouseleave",W))}}},[i,l,e,f,p,V,M,x,r,n,g,u,y,v,o,O,E]),ie(()=>{var k;if(l&&n&&(k=v.current)!=null&&(k=k.__options)!=null&&k.blockPointerEvents&&B()){S.current=!0;const N=i.floating;if(X(i.domReference)&&N){var w;const A=ae(i.floating).body;A.setAttribute(Un,"");const W=i.domReference,_=u==null||(w=u.nodesRef.current.find(q=>q.id===m))==null||(w=w.context)==null?void 0:w.elements.floating;return _&&(_.style.pointerEvents=""),A.style.pointerEvents="none",W.style.pointerEvents="auto",N.style.pointerEvents="auto",()=>{A.style.pointerEvents="",W.style.pointerEvents="",N.style.pointerEvents=""}}}},[l,n,m,i,u,v,B]),ie(()=>{n||(R.current=void 0,C.current=!1,M(),x())},[n,M,x]),h.useEffect(()=>()=>{M(),oe(L),oe(P),x()},[l,i.domReference,M,x]);const F=h.useMemo(()=>{function k(w){R.current=w.pointerType}return{onPointerDown:k,onPointerEnter:k,onMouseMove(w){const{nativeEvent:N}=w;function A(){!T.current&&!g.current&&r(!0,N,"hover")}f&&!At(R.current)||n||$t(E.current)===0||C.current&&w.movementX**2+w.movementY**2<2||(oe(P),R.current==="touch"?A():(C.current=!0,P.current=window.setTimeout(A,$t(E.current))))}}},[f,r,n,g,E]);return h.useMemo(()=>l?{reference:F}:{},[l,F])}const ns={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},jn=h.forwardRef(function(t,n){const[r,o]=h.useState();ie(()=>{Ln()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[$e("focus-guard")]:"",style:ns};return b.jsx("span",{...t,...s})}),rs={clipPath:"inset(50%)",position:"fixed",top:0,left:0},zn=h.createContext(null),Xn=$e("portal");function os(e){e===void 0&&(e={});const{id:t,root:n}=e,r=dt(),o=is(),[s,i]=h.useState(null),l=h.useRef(null);return ie(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{l.current=null})},[s]),ie(()=>{if(!r||l.current)return;const a=t?document.getElementById(t):null;if(!a)return;const c=document.createElement("div");c.id=r,c.setAttribute(Xn,""),a.appendChild(c),l.current=c,i(c)},[t,r]),ie(()=>{if(n===null||!r||l.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!bt(a)&&(a=a.current),a=a||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,a.appendChild(c));const f=document.createElement("div");f.id=r,f.setAttribute(Xn,""),a=c||a,a.appendChild(f),l.current=f,i(f)},[t,n,r,o]),s}function ss(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=os({id:n,root:r}),[i,l]=h.useState(null),a=h.useRef(null),c=h.useRef(null),f=h.useRef(null),d=h.useRef(null),p=i==null?void 0:i.modal,u=i==null?void 0:i.open,m=!!i&&!i.modal&&i.open&&o&&!!(r||s);return h.useEffect(()=>{if(!s||!o||p)return;function v(y){s&&Nt(y)&&(y.type==="focusin"?Pn:oo)(s)}return s.addEventListener("focusin",v,!0),s.addEventListener("focusout",v,!0),()=>{s.removeEventListener("focusin",v,!0),s.removeEventListener("focusout",v,!0)}},[s,o,p]),h.useEffect(()=>{s&&(u||Pn(s))},[u,s]),b.jsxs(zn.Provider,{value:h.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:c,beforeInsideRef:f,afterInsideRef:d,portalNode:s,setFocusManagerState:l}),[o,s]),children:[m&&s&&b.jsx(jn,{"data-type":"outside",ref:a,onFocus:v=>{if(Nt(v,s)){var y;(y=f.current)==null||y.focus()}else{const g=i?i.domReference:null,E=ro(g);E==null||E.focus()}}}),m&&s&&b.jsx("span",{"aria-owns":s.id,style:rs}),s&&Jt.createPortal(t,s),m&&s&&b.jsx(jn,{"data-type":"outside",ref:c,onFocus:v=>{if(Nt(v,s)){var y;(y=d.current)==null||y.focus()}else{const g=i?i.domReference:null,E=no(g);E==null||E.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,v.nativeEvent,"focus-out"))}}})]})}const is=()=>h.useContext(zn),ls={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},cs={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},qn=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function as(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:l=!0,outsidePress:a=!0,outsidePressEvent:c="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:u,capture:m}=t,v=Yt(),y=ue(typeof a=="function"?a:()=>!1),g=typeof a=="function"?y:a,E=h.useRef(!1),{escapeKey:R,outsidePress:L}=qn(u),{escapeKey:D,outsidePress:P}=qn(m),T=h.useRef(!1),S=ue(x=>{var O;if(!n||!i||!l||x.key!=="Escape"||T.current)return;const F=(O=s.current.floatingContext)==null?void 0:O.nodeId,k=v?lt(v.nodesRef.current,F):[];if(!R&&(x.stopPropagation(),k.length>0)){let w=!0;if(k.forEach(N=>{var A;if((A=N.context)!=null&&A.open&&!N.context.dataRef.current.__escapeKeyBubbles){w=!1;return}}),!w)return}r(!1,Zr(x)?x.nativeEvent:x,"escape-key")}),I=ue(x=>{var O;const F=()=>{var k;S(x),(k=Pe(x))==null||k.removeEventListener("keydown",F)};(O=Pe(x))==null||O.addEventListener("keydown",F)}),C=ue(x=>{var O;const F=s.current.insideReactTree;s.current.insideReactTree=!1;const k=E.current;if(E.current=!1,c==="click"&&k||F||typeof g=="function"&&!g(x))return;const w=Pe(x),N="["+$e("inert")+"]",A=ae(o.floating).querySelectorAll(N);let W=X(w)?w:null;for(;W&&!ve(W);){const j=ge(W);if(ve(j)||!X(j))break;W=j}if(A.length&&X(w)&&!zr(w)&&!De(w,o.floating)&&Array.from(A).every(j=>!De(W,j)))return;if(se(w)&&M){const j=ve(w),z=re(w),ee=/auto|scroll/,Ht=j||ee.test(z.overflowX),Ae=j||ee.test(z.overflowY),Kt=Ht&&w.clientWidth>0&&w.scrollWidth>w.clientWidth,Se=Ae&&w.clientHeight>0&&w.scrollHeight>w.clientHeight,Me=z.direction==="rtl",Ne=Se&&(Me?x.offsetX<=w.offsetWidth-w.clientWidth:x.offsetX>w.clientWidth),Ce=Kt&&x.offsetY>w.clientHeight;if(Ne||Ce)return}const _=(O=s.current.floatingContext)==null?void 0:O.nodeId,q=v&<(v.nodesRef.current,_).some(j=>{var z;return kt(x,(z=j.context)==null?void 0:z.elements.floating)});if(kt(x,o.floating)||kt(x,o.domReference)||q)return;const Be=v?lt(v.nodesRef.current,_):[];if(Be.length>0){let j=!0;if(Be.forEach(z=>{var ee;if((ee=z.context)!=null&&ee.open&&!z.context.dataRef.current.__outsidePressBubbles){j=!1;return}}),!j)return}r(!1,x,"outside-press")}),B=ue(x=>{var O;const F=()=>{var k;C(x),(k=Pe(x))==null||k.removeEventListener(c,F)};(O=Pe(x))==null||O.addEventListener(c,F)});h.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=R,s.current.__outsidePressBubbles=L;let x=-1;function O(A){r(!1,A,"ancestor-scroll")}function F(){window.clearTimeout(x),T.current=!0}function k(){x=window.setTimeout(()=>{T.current=!1},Qe()?5:0)}const w=ae(o.floating);l&&(w.addEventListener("keydown",D?I:S,D),w.addEventListener("compositionstart",F),w.addEventListener("compositionend",k)),g&&w.addEventListener(c,P?B:C,P);let N=[];return p&&(X(o.domReference)&&(N=he(o.domReference)),X(o.floating)&&(N=N.concat(he(o.floating))),!X(o.reference)&&o.reference&&o.reference.contextElement&&(N=N.concat(he(o.reference.contextElement)))),N=N.filter(A=>{var W;return A!==((W=w.defaultView)==null?void 0:W.visualViewport)}),N.forEach(A=>{A.addEventListener("scroll",O)}),()=>{l&&(w.removeEventListener("keydown",D?I:S,D),w.removeEventListener("compositionstart",F),w.removeEventListener("compositionend",k)),g&&w.removeEventListener(c,P?B:C,P),N.forEach(A=>{A.removeEventListener("scroll",O)}),window.clearTimeout(x)}},[s,o,l,g,c,n,r,p,i,R,L,S,D,I,C,P,B]),h.useEffect(()=>{s.current.insideReactTree=!1},[s,g,c]);const V=h.useMemo(()=>({onKeyDown:S,...f&&{[ls[d]]:x=>{r(!1,x.nativeEvent,"reference-press")},...d!=="click"&&{onClick(x){r(!1,x.nativeEvent,"reference-press")}}}}),[S,r,f,d]),M=h.useMemo(()=>{function x(O){O.button===0&&(E.current=!0)}return{onKeyDown:S,onMouseDown:x,onMouseUp:x,[cs[c]]:()=>{s.current.insideReactTree=!0}}},[S,c,s]);return h.useMemo(()=>i?{reference:V,floating:M}:{},[i,V,M])}function us(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=dt(),s=h.useRef({}),[i]=h.useState(()=>Jo()),l=Ft()!=null;if(process.env.NODE_ENV!=="production"){const u=r.reference;u&&!X(u)&&Go("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,c]=h.useState(r.reference),f=ue((u,m,v)=>{s.current.openEvent=u?m:void 0,i.emit("openchange",{open:u,event:m,reason:v,nested:l}),n==null||n(u,m,v)}),d=h.useMemo(()=>({setPositionReference:c}),[]),p=h.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return h.useMemo(()=>({dataRef:s,open:t,onOpenChange:f,elements:p,events:i,floatingId:o,refs:d}),[t,f,p,i,o,d])}function fs(e){var t,n;let{elements:r,...o}=e===void 0?{}:e;const{nodeId:s}=o,i=us({...o,elements:{reference:(t=r==null?void 0:r.reference)!=null?t:null,floating:(n=r==null?void 0:r.floating)!=null?n:null}}),l=o.rootContext||i,a=l.elements,[c,f]=h.useState(null),[d,p]=h.useState(null),m=(a==null?void 0:a.domReference)||c,v=h.useRef(null),y=Yt();ie(()=>{m&&(v.current=m)},[m]);const g=_o({...o,elements:{...a,...d&&{reference:d}}}),E=h.useCallback(T=>{const S=X(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;p(S),g.refs.setReference(S)},[g.refs]),R=h.useCallback(T=>{(X(T)||T===null)&&(v.current=T,f(T)),(X(g.refs.reference.current)||g.refs.reference.current===null||T!==null&&!X(T))&&g.refs.setReference(T)},[g.refs]),L=h.useMemo(()=>({...g.refs,setReference:R,setPositionReference:E,domReference:v}),[g.refs,R,E]),D=h.useMemo(()=>({...g.elements,domReference:m}),[g.elements,m]),P=h.useMemo(()=>({...g,...l,refs:L,elements:D,nodeId:s}),[g,L,D,s,l]);return ie(()=>{l.dataRef.current.floatingContext=P;const T=y==null?void 0:y.nodesRef.current.find(S=>S.id===s);T&&(T.context=P)}),h.useMemo(()=>({...g,context:P,refs:L,elements:D}),[g,L,D,P])}function Bt(){return Kr()&&Ln()}function ds(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:l=!0,visibleOnly:a=!0}=t,c=h.useRef(!1),f=h.useRef(-1),d=h.useRef(!0);h.useEffect(()=>{if(!l)return;const u=ne(i.domReference);function m(){!n&&se(i.domReference)&&i.domReference===Pt(ae(i.domReference))&&(c.current=!0)}function v(){d.current=!0}function y(){d.current=!1}return u.addEventListener("blur",m),Bt()&&(u.addEventListener("keydown",v,!0),u.addEventListener("pointerdown",y,!0)),()=>{u.removeEventListener("blur",m),Bt()&&(u.removeEventListener("keydown",v,!0),u.removeEventListener("pointerdown",y,!0))}},[i.domReference,n,l]),h.useEffect(()=>{if(!l)return;function u(m){let{reason:v}=m;(v==="reference-press"||v==="escape-key")&&(c.current=!0)}return o.on("openchange",u),()=>{o.off("openchange",u)}},[o,l]),h.useEffect(()=>()=>{oe(f)},[]);const p=h.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(u){if(c.current)return;const m=Pe(u.nativeEvent);if(a&&X(m)){if(Bt()&&!u.relatedTarget){if(!d.current&&!Xr(m))return}else if(!qr(m))return}r(!0,u.nativeEvent,"focus")},onBlur(u){c.current=!1;const m=u.relatedTarget,v=u.nativeEvent,y=X(m)&&m.hasAttribute($e("focus-guard"))&&m.getAttribute("data-type")==="outside";f.current=window.setTimeout(()=>{var g;const E=Pt(i.domReference?i.domReference.ownerDocument:document);!m&&E===i.domReference||De((g=s.current.floatingContext)==null?void 0:g.refs.floating.current,E)||De(i.domReference,E)||y||r(!1,v,"focus")})}}),[s,i.domReference,r,a]);return h.useMemo(()=>l?{reference:p}:{},[l,p])}function Vt(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Vn]:i,[Wn]:l,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[Uo]:""},...s,...t.map(i=>{const l=i?i[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((i,l)=>(l&&Object.entries(l).forEach(a=>{let[c,f]=a;if(!(o&&[Vn,Wn].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof f=="function"){var d;(d=r.get(c))==null||d.push(f),i[c]=function(){for(var p,u=arguments.length,m=new Array(u),v=0;v<u;v++)m[v]=arguments[v];return(p=r.get(c))==null?void 0:p.map(y=>y(...m)).find(y=>y!==void 0)}}}else i[c]=f}),i),{})}}function ps(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),o=h.useCallback(l=>Vt(l,e,"reference"),t),s=h.useCallback(l=>Vt(l,e,"floating"),n),i=h.useCallback(l=>Vt(l,e,"item"),r);return h.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const ms=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function vs(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:l=!0,role:a="dialog"}=t,c=dt(),f=((n=s.domReference)==null?void 0:n.id)||c,d=h.useMemo(()=>{var E;return((E=Gr(s.floating))==null?void 0:E.id)||i},[s.floating,i]),p=(r=ms.get(a))!=null?r:a,m=Ft()!=null,v=h.useMemo(()=>p==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:o?d:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?d:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:f},...p==="menu"&&m&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[p,d,m,o,f,a]),y=h.useMemo(()=>{const E={id:d,...p&&{role:p}};return p==="tooltip"||a==="label"?E:{...E,...p==="menu"&&{"aria-labelledby":f}}},[p,d,f,a]),g=h.useCallback(E=>{let{active:R,selected:L}=E;const D={role:"option",...R&&{id:d+"-fui-option"}};switch(a){case"select":case"combobox":return{...D,"aria-selected":L}}return{}},[d,a]);return h.useMemo(()=>l?{reference:v,floating:y,item:g}:{},[l,v,y,g])}function Gn({content:e,renderProps:t,delay:n=300,placement:r="top",classNames:o={},styles:s={},children:i}){const[l,a]=$.useState(!1),[c,f]=$.useState(null),d=typeof e=="function"?e(t):e,p=d!=null,{refs:u,floatingStyles:m,context:v}=fs({open:l&&p,onOpenChange:a,placement:r,strategy:"fixed",transform:!1,whileElementsMounted:Ao,middleware:[Bo(8),Wo({padding:8}),Vo({padding:8}),Ho({element:c})]}),y=ts(v,{move:!1,delay:{open:n,close:0}}),g=ds(v),E=as(v),R=vs(v,{role:"tooltip"}),{getReferenceProps:L,getFloatingProps:D}=ps([y,g,E,R]),P=i.ref,T=Ko([u.setReference,P??null]),S=$.cloneElement(i,L({...i.props,ref:T})),I=u.reference.current,C=(I instanceof HTMLElement?I.closest(".fldp-root"):null)??void 0;return b.jsxs(b.Fragment,{children:[S,l&&p&&b.jsx(ss,{root:C,children:b.jsxs("div",{ref:u.setFloating,className:U("fldp-tooltip",o.tooltip),style:{...m,...s.tooltip},...D(),children:[d,b.jsx(Zo,{ref:f,context:v,style:{fill:"var(--fldp-foreground)"},width:10,height:5})]})})]})}function Zn({date:e,isOutside:t}){var _;const{mode:n,singleValue:r,rangeValue:o,hoveredDate:s,selectDate:i,setHoveredDate:l,disabled:a,isDisabled:c,readOnly:f,highlightToday:d,showAdjacentMonthDays:p,locale:u,tooltip:m,tooltipDelay:v,classNames:y,styles:g,renderDay:E,onDayHover:R}=ze(),L=((_=e.isToday)==null?void 0:_.call(e))??e.isSame(new Date,"day"),D=c||rn(e,a),P=n==="single"?ce(e,r):ce(e,o.start)&&ce(e,o.end),T=n==="range"?gt(e,o):!1,S=n==="range"?ht(e,o):!1,I=n==="range"?Xe(e,o.start,o.end):!1,C=n==="range"&&o.start&&!o.end&&s?{start:o.start,end:s}:null,B=C?Xe(e,C.start,C.end)||ce(e,C.end):!1,V=C?ce(e,C.start):!1,M=C?ce(e,C.end):!1,x=n==="range"?o.end??(C==null?void 0:C.end)??null:null,O=n==="range"&&o.start&&x&&x.diff(o.start,"day")||null,F={date:e,isToday:L,isSelected:P||T||S,isDisabled:D,isRangeStart:T,isRangeEnd:S,isInRange:I||B,isRangeSelecting:n==="range"&&!!o.start&&!o.end,isInPreviewRange:B,isPreviewRangeEnd:M,rangeStart:n==="range"?o.start??null:null,rangeEnd:x,nights:O};if(t&&!p)return b.jsx("div",{className:"fldp-day fldp-day--outside","aria-hidden":"true"});function k(){D||f||i(e)}function w(){l(e),R==null||R(e)}function N(){l(null),R==null||R(null)}function A(q){(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),k())}const W=b.jsx("div",{onClick:k,onMouseEnter:w,onMouseLeave:N,onKeyDown:A,"aria-pressed":P||T||S,"aria-disabled":D,"aria-label":e.locale(u??"en").format("MMMM D, YYYY"),role:"button",tabIndex:D?-1:0,className:U("fldp-day",L&&d&&"fldp-day--today",P&&"fldp-day--selected",T&&!S&&"fldp-day--range-start",S&&!T&&"fldp-day--range-end",T&&S&&"fldp-day--selected",I&&"fldp-day--in-range",(B||V)&&!I&&!T&&!S&&"fldp-day--hovered-range",D&&"fldp-day--disabled",t&&"fldp-day--outside",(B||V)&&y.dayHovered,y.day,L&&y.dayToday,P&&y.daySelected,T&&y.dayRangeStart,S&&y.dayRangeEnd,I&&y.dayInRange,D&&y.dayDisabled,t&&y.dayOutside),style:{...g.day,...L&&g.dayToday,...P&&g.daySelected,...T&&g.dayRangeStart,...S&&g.dayRangeEnd,...I&&g.dayInRange,...D&&g.dayDisabled,...t&&g.dayOutside,...(B||V)&&g.dayHovered},children:E?E(e,F):b.jsx("span",{className:"fldp-day-number",children:e.date()})});return m?b.jsx(Gn,{content:m,renderProps:F,delay:v,classNames:y,styles:g,children:W}):W}function Jn({panelIndex:e=0,totalPanels:t=1}){const{currentYear:n,currentMonth:r,weekStartsOn:o,locale:s,classNames:i,styles:l}=ze(),a=r+e,c=n+Math.floor(a/12),f=a%12,d=on(c,f,o),p=sn(o,s);return b.jsxs("div",{role:"grid","aria-label":`${Q(new Date(c,f)).locale(s??"en").format("MMMM YYYY")}`,className:U("fldp-calendar",i.calendar),style:l.calendar,children:[b.jsx(un,{panelIndex:e,totalPanels:t}),b.jsx("div",{role:"row",className:U("fldp-weekdays",i.weekdays),style:l.weekdays,children:p.map(u=>b.jsx("div",{role:"columnheader","aria-label":u,className:U("fldp-weekday",i.weekday),style:l.weekday,children:u},u))}),b.jsx("div",{role:"rowgroup",className:U("fldp-days-grid",i.daysGrid),style:l.daysGrid,children:d.map(u=>{const m=u.month()!==f||u.year()!==c;return b.jsx(Zn,{date:u,isOutside:m},u.format("YYYY-MM-DD"))})})]})}function gs(){return b.jsxs("svg",{className:"fldp-calendar-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[b.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),b.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),b.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),b.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}function hs(){return b.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true",children:[b.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),b.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function ys({mode:e,singleValue:t,rangeValue:n,format:r,locale:o,placeholder:s,isOpen:i,isDisabled:l,readOnly:a,clearable:c,classNames:f,styles:d,onOpen:p,onClear:u,renderInput:m}){const v=e==="single"?t!=null:n.start!=null,y=S=>S?S.locale(o??"en").format(r):"",g=y(t),E=y(n.start),R=y(n.end),L=Array.isArray(s)?s[0]:s,D=Array.isArray(s)?s[1]:s;if(m){const S=e==="single"?g:[E,R].filter(Boolean).join(" → ");return b.jsx(b.Fragment,{children:m({value:S,onClick:p,onClear:u,isOpen:i,placeholder:L,isDisabled:l,readOnly:a})})}const P=d.inputWrapper??{};function T(S){(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),p())}return b.jsxs("div",{className:U("fldp-input-wrapper",i&&"fldp-input-wrapper--open",l&&"fldp-input-wrapper--disabled",f.inputWrapper),style:P,onClick:p,role:"button","aria-haspopup":"dialog","aria-expanded":i,"aria-disabled":l,tabIndex:l?-1:0,onKeyDown:T,children:[b.jsx(gs,{}),b.jsx("span",{className:"fldp-input-content","aria-hidden":"true",children:e==="single"?b.jsx("span",{className:U("fldp-input-value",!g&&"fldp-input-value--placeholder",f.input),style:d.input,children:g||L}):b.jsxs(b.Fragment,{children:[b.jsx("span",{className:U("fldp-input-value",!E&&"fldp-input-value--placeholder",f.input),style:d.input,children:E||L}),b.jsx("span",{className:U("fldp-separator",f.separator),style:d.separator,children:"→"}),b.jsx("span",{className:U("fldp-input-value",!R&&"fldp-input-value--placeholder",f.input),style:d.input,children:R||D})]})}),c&&v&&!a&&b.jsx("span",{className:U("fldp-clear-button",f.clearButton),style:d.clearButton,role:"button",tabIndex:0,"aria-label":"Clear date",onClick:S=>{S.stopPropagation(),u()},onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),S.stopPropagation(),u())},children:b.jsx(hs,{})})]})}function bs(e){if(!e)return{};const t={"--fldp-primary":e.primary,"--fldp-primary-hover":e.primaryHover,"--fldp-primary-foreground":e.primaryForeground,"--fldp-background":e.background,"--fldp-surface":e.surface,"--fldp-surface-strong":e.surfaceStrong,"--fldp-foreground":e.foreground,"--fldp-muted":e.muted,"--fldp-accent-soft":e.accentSoft,"--fldp-muted-foreground":e.mutedForeground,"--fldp-border":e.border,"--fldp-input-background":e.inputBackground,"--fldp-border-radius":e.borderRadius,"--fldp-day-border-radius":e.dayBorderRadius,"--fldp-shadow":e.shadow,"--fldp-font-family":e.fontFamily,"--fldp-font-size":e.fontSize,"--fldp-today-color":e.todayColor,"--fldp-disabled-opacity":e.disabledOpacity,"--fldp-transition-duration":e.transitionDuration,"--fldp-z-index":e.zIndex,"--fldp-gold":e.primary,"--fldp-gold-light":e.primaryHover??e.primary},n={};for(const[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return n}function Wt({timeSlots:e,selectedTime:t,onSelectTime:n,timeFormat:r,locale:o,targetDate:s,disabledTime:i,isDisabled:l,readOnly:a,classNames:c={},styles:f={}}){return b.jsxs("div",{className:U("fldp-time-picker",c.timePicker),style:f.timePicker,children:[b.jsx("div",{className:U("fldp-time-title",c.timeTitle),style:f.timeTitle,children:"Time"}),b.jsxs("div",{className:U("fldp-time-slot-list",c.timeSlotList),style:f.timeSlotList,children:[e.length===0&&b.jsx("span",{className:"fldp-time-empty",children:"No availability"}),e.map(d=>{const p=d===t,u=yt(s,d,i),m=Q(`2000-01-01T${d}`).locale(o??"en").format(r);return b.jsx("span",{role:"button",tabIndex:u||l||a?-1:0,"aria-disabled":u||l||a,className:U("fldp-time-slot",p&&"fldp-time-slot--selected",u&&"fldp-time-slot--disabled",c.timeSlot,p&&c.timeSlotSelected,u&&c.timeSlotDisabled),style:{...f.timeSlot,...p&&f.timeSlotSelected,...u&&f.timeSlotDisabled},onClick:()=>{!u&&!l&&!a&&n(d)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&!u&&!l&&!a&&(v.preventDefault(),n(d))},children:m},d)})]})]})}Q.extend(lr),Q.extend(ar);const ws="MMM D, YYYY",xs="Select date",Es=["Start date","End date"],Ss=15,Ms="HH:mm",Ls="00:00",Ts="23:59";function Rs({mode:e="single",value:t,defaultValue:n,rangeValue:r,defaultRangeValue:o,format:s=ws,locale:i,lang:l,weekStartsOn:a=0,enableTime:c=!1,timeStep:f=Ss,timeFormat:d=Ms,minTime:p=Ls,maxTime:u=Ts,disabledTime:m,timeSchedule:v,defaultTimeSchedule:y,minDate:g,maxDate:E,placeholder:R,disabled:L,isDisabled:D=!1,readOnly:P=!1,clearable:T=!0,highlightToday:S=!0,showAdjacentMonthDays:I=!1,showOutsideDays:C,tooltip:B,tooltipDelay:V=300,theme:M,classNames:x={},styles:O={},className:F,style:k,numberOfMonths:w=1,showMonthYearSelectors:N=!0,inline:A=!1,placement:W="auto",renderDay:_,renderNavButton:q,renderInput:Be,onDateChange:j,onRangeChange:z,onTimeChange:ee,onMonthChange:Ht,onYearChange:Ae,onDayHover:Kt,onOpen:Se,onClose:Me,onClear:Ne,onBeforeSelect:Ce,onAfterSelect:pt}){const Ve=t!==void 0,[Cs,Ut]=$.useState(n??null),fe=Ve?t??null:Cs,be=r!==void 0,[Qn,We]=$.useState(o??{start:null,end:null}),G=$.useMemo(()=>be?r??{start:null,end:null}:Qn,[be,r,Qn]),[Os,Is]=$.useState(null),[le,er]=$.useState(!1),He=$.useRef(null),[Fs,tr]=$.useState("bottom"),Oe=$.useCallback(()=>{if(A||W!=="auto"){tr(W==="top"?"top":"bottom");return}if(!He.current)return;const Y=He.current.getBoundingClientRect(),H=window.innerHeight-Y.bottom,J=Y.top;tr(H>=J?"bottom":"top")},[A,W]);$.useEffect(()=>{if(!le)return;const Y=window.requestAnimationFrame(Oe);return window.addEventListener("resize",Oe),window.addEventListener("scroll",Oe,!0),()=>{window.cancelAnimationFrame(Y),window.removeEventListener("resize",Oe),window.removeEventListener("scroll",Oe,!0)}},[le,Oe]);const nr=e==="single"?fe??Q():G.start??Q(),[jt,Ys]=$.useState(nr.month()),[zt,_s]=$.useState(nr.year()),rr=$.useCallback(()=>{A||D||P||(er(!0),Se==null||Se())},[A,D,P,Se]),de=$.useCallback(()=>{A||(er(!1),Me==null||Me())},[A,Me]),$s=$.useCallback(()=>{A||(le?de():rr())},[A,le,de,rr]),or=$.useCallback((Y,H)=>({mode:e,phase:Y,currentValue:fe,currentRange:G,nextValue:H}),[e,fe,G]);$.useEffect(()=>{if(A)return;function Y(H){He.current&&!He.current.contains(H.target)&&de()}return le&&document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[le,A,de]),$.useEffect(()=>{if(A)return;function Y(H){H.key==="Escape"&&de()}return le&&document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[le,A,de]);function Xt(Y,H){const[J,je]=H.split(":").map(Number),te=Number.isFinite(J)?J:0,Gt=Number.isFinite(je)?je:0;return Y.hour(te).minute(Gt).second(0).millisecond(0)}const Bs=$.useCallback(Y=>{let H,J;if(e==="single")J="single",H=c&&fe?Y.hour(fe.hour()).minute(fe.minute()):Y;else if(!G.start||G.start&&G.end)J="range-start",H={start:c&&G.start?Y.hour(G.start.hour()).minute(G.start.minute()):Y,end:null};else{J="range-end";const te=Y,[Gt,Zs]=te.isBefore(G.start)?[te,G.start]:[G.start,te];H={start:Gt,end:Zs}}const je=or(J,H);if((Ce==null?void 0:Ce(Y,je))!==!1){if(e==="single"){const te=H;Ve||Ut(te),j==null||j(te)}else if(J==="range-start"){const te=H;be||We(te),z==null||z(te)}else{const te=H;be||We(te),z==null||z(te)}pt==null||pt(Y,je),!c&&(e==="single"||J==="range-end")&&de()}},[e,G,fe,Ve,be,Ce,pt,j,z,c,or,de]);function Vs(){if(e==="single")Ve||Ut(null),j==null||j(null);else{const Y={start:null,end:null};be||We(Y),z==null||z(Y)}Ne==null||Ne()}const Ke=x,Ue=O,Ws=bs(M),Hs=C??I,qt=l??i,Z=L&&typeof L=="object"?L:void 0,Ks=L===!0?!0:{...Z,before:g?Z!=null&&Z.before&&Z.before.isAfter(g,"day")?Z.before:g:Z==null?void 0:Z.before,after:E?Z!=null&&Z.after&&Z.after.isBefore(E,"day")?Z.after:E:Z==null?void 0:Z.after},Us={mode:e,singleValue:fe,rangeValue:G,hoveredDate:Os,currentYear:zt,currentMonth:jt,setCurrentYear:Y=>{_s(Y),Ae==null||Ae(Y)},setCurrentMonth:Y=>{Ys(Y)},selectDate:Bs,setHoveredDate:Is,weekStartsOn:a,locale:qt,showMonthYearSelectors:N,disabled:Ks,isDisabled:D,readOnly:P,highlightToday:S,showAdjacentMonthDays:Hs,tooltip:B,tooltipDelay:V,format:s,classNames:Ke,styles:Ue,renderDay:_,renderNavButton:q,onDateChange:j,onRangeChange:z,onTimeChange:ee,onMonthChange:Ht,onYearChange:Ae,onDayHover:Kt,onOpen:Se,onClose:Me,onClear:Ne},js=R??(e==="single"?xs:Es),mt=e==="single"?fe??Q(new Date(zt,jt,1)):G.end??G.start??Q(new Date(zt,jt,1)),zs=(()=>{const Y=mt.format("YYYY-MM-DD"),H=(v==null?void 0:v[Y])??y;return H?an(H):qe(f,p,u)})(),Xs=mt.format("HH:mm");function qs(Y){if(!(D||P)){if(e==="single"){const H=Xt(mt,Y);Ve||Ut(H),j==null||j(H),ee==null||ee(H,Y),A||de();return}if(G.end){const H=Xt(G.end,Y),J={...G,end:H};be||We(J),z==null||z(J),ee==null||ee(H,Y),A||de();return}if(G.start){const H=Xt(G.start,Y),J={...G,start:H};be||We(J),z==null||z(J),ee==null||ee(H,Y)}}}const Gs={...Ws,...k};return b.jsx(vt.Provider,{value:Us,children:b.jsxs("div",{ref:He,className:U("fldp-root",F,Ke.root),style:{...Gs,...Ue.root},"data-mode":e,"data-open":le,"data-inline":A,children:[!A&&b.jsx(ys,{mode:e,singleValue:fe,rangeValue:G,format:s,locale:qt,placeholder:js,isOpen:le,isDisabled:D,readOnly:P,clearable:T,classNames:Ke,styles:Ue,onOpen:$s,onClear:Vs,renderInput:Be}),(A||le)&&b.jsxs("div",{role:"dialog","aria-label":"Date picker","aria-modal":"false",className:U("fldp-popover",A&&"fldp-popover--inline",!A&&`fldp-popover--${Fs}`,Ke.popover),style:Ue.popover,children:[Array.from({length:w},(Y,H)=>b.jsx(Jn,{panelIndex:H,totalPanels:w},H)),c&&b.jsx(Wt,{timeSlots:zs,selectedTime:Xs,onSelectTime:qs,timeFormat:d,locale:qt,targetDate:mt,disabledTime:m,isDisabled:D,readOnly:P,classNames:Ke,styles:Ue})]})]})})}const Ds=[{label:"Dates Sélectionnées",className:"fldp-legend-box--selected"},{label:"Disponibilité",className:"fldp-legend-box--available"},{label:"Pas De Disponibilité",className:"fldp-legend-box--unavailable"},{label:"Séjour Minimal",className:"fldp-legend-box--minimal-stay"},{label:"Pas D'Arrivée",className:"fldp-legend-box--no-arrival"}];function Ps({items:e=Ds,className:t,style:n}){return b.jsx("div",{className:`fldp-calendar-legend ${t||""}`,style:n,children:e.map((r,o)=>b.jsxs("div",{className:"fldp-legend-item",children:[b.jsx("div",{className:`fldp-legend-box ${r.className}`}),b.jsx("span",{className:"fldp-legend-label",children:r.label})]},o))})}const ks="HH:mm",As="Select time";function Ns({value:e,defaultValue:t,onChange:n,timeStep:r=15,minTime:o="00:00",maxTime:s="23:59",schedule:i,timeFormat:l=ks,placeholder:a=As,locale:c,date:f,disabledTime:d,inline:p=!1,isDisabled:u=!1,readOnly:m=!1,clearable:v=!0,onOpen:y,onClose:g,onClear:E,className:R,style:L}){const D=e!==void 0,[P,T]=$.useState(t??""),S=D?e:P,[I,C]=$.useState(!1),B=$.useRef(null),V=$.useCallback(()=>{p||u||m||(C(!0),y==null||y())},[p,u,m,y]),M=$.useCallback(()=>{C(!1),g==null||g()},[g]),x=$.useCallback(()=>{I?M():V()},[I,M,V]),O=f??Q(),F=i?an(i):qe(r,o,s);$.useEffect(()=>{if(p)return;function W(_){B.current&&!B.current.contains(_.target)&&M()}return I&&document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[I,p,M]),$.useEffect(()=>{if(p)return;function W(_){_.key==="Escape"&&M()}return I&&document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[I,p,M]);function k(W){D||T(W),n==null||n(W),p||M()}function w(W){W.stopPropagation(),D||T(""),n==null||n(""),E==null||E()}const N=S&&!yt(O,S,d)?Q(`2000-01-01T${S}`).locale(c??"en").format(l):S?Q(`2000-01-01T${S}`).locale(c??"en").format(l):"",A=b.jsx(Wt,{timeSlots:F,selectedTime:S,onSelectTime:k,timeFormat:l,locale:c,targetDate:O,disabledTime:d,isDisabled:u,readOnly:m});return p?b.jsx("div",{ref:B,className:U("fldp-root fldp-root--time-only",R),style:L,"data-inline":"true",children:b.jsx("div",{role:"region","aria-label":"Time picker",className:"fldp-popover fldp-popover--inline fldp-popover--time-only",children:A})}):b.jsxs("div",{ref:B,className:U("fldp-root fldp-root--time-only",R),style:L,"data-open":I,children:[b.jsxs("div",{role:"button",tabIndex:u?-1:0,"aria-label":N||a,"aria-haspopup":"dialog","aria-expanded":I,className:U("fldp-input-wrapper",u&&"fldp-input-wrapper--disabled",m&&"fldp-input-wrapper--readonly",I&&"fldp-input-wrapper--open"),onClick:x,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),x())},children:[b.jsxs("svg",{className:"fldp-clock-icon","aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("circle",{cx:"12",cy:"12",r:"10"}),b.jsx("polyline",{points:"12 6 12 12 16 14"})]}),b.jsx("span",{className:U("fldp-input-value",!N&&"fldp-input-value--placeholder"),children:N||a}),v&&S&&!u&&!m&&b.jsx("button",{type:"button","aria-label":"Clear time",className:"fldp-clear-button",tabIndex:-1,onClick:w,children:"×"}),b.jsx("svg",{className:U("fldp-input-chevron",I&&"fldp-input-chevron--open"),"aria-hidden":"true",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:b.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),I&&b.jsx("div",{role:"dialog","aria-label":"Time picker","aria-modal":"false",className:"fldp-popover fldp-popover--time-only",children:A})]})}K.Calendar=Jn,K.CalendarDay=Zn,K.CalendarHeader=un,K.CalendarLegend=Ps,K.DatePicker=Rs,K.DatePickerContext=vt,K.TimePicker=Ns,K.TimeSlotList=Wt,K.Tooltip=Gn,K.generateCalendarDays=on,K.generateTimeSlots=qe,K.getMonthNames=ln,K.getWeekdayLabels=sn,K.isBetween=Xe,K.isDateDisabled=rn,K.isInRange=ur,K.isRangeEnd=ht,K.isRangeStart=gt,K.isSameDay=ce,K.isTimeDisabled=yt,K.useDatePickerContext=ze,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
|
|
5
5
|
//# sourceMappingURL=flexy-date-picker.umd.cjs.map
|