1import{m as Mt,r as p,j as o,W as Y,a2 as Pe,p as kt,q as Ye,t as Be,w as He,z as ze,x as V,v as Ue,J as Pt,D as St,y as Ot,G as Ft,T as Rt,Q as It,V as Tt,M as Wt,i as Et,N as Lt,L as At,B as E,l as Yt,Y as O,I as Q,Z as U,C as Se,c as Oe,a as Bt,b as Ht,s as X}from"./index-DwD5y2V5.js";import{D as zt,a as Ut,b as Vt,c as qt,d as Kt}from"./dialog-qKweyqJH.js";import{S as $t,a as Gt,b as Zt,c as Jt,d as Fe}from"./select-_1JRRUTQ.js";import{B as ie}from"./badge-tGAspnuj.js";import{s as te,a as q,d as W,b as Qt,c as pe,g as Xt,e as en,f as L,i as Ve}from"./format-BwcsVm1d.js";import{t as D,c as B,g as Re,m as tn,a as nn,e as an}from"./en-US-DWrl2lTx.js";import{e as ge,d as K}from"./endOfMonth-DIWrT0r0.js";import{C as rn}from"./chevron-right-BSsGFU6b.js";import{h as on,R as sn,u as ln,F as dn}from"./Combination-Dj9zWLPK.js";import{P as Ie}from"./ProtectedRoute-CWczz8ol.js";import{P as cn}from"./plus-CPoFmkL1.js";import{C as un}from"./calendar-BXlgp5pm.js";import{S as fn}from"./square-pen-CwZZa_Kz.js";import{T as vn}from"./trash-2-DaWULBFJ.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const hn=Mt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);function k(e,n){const t=D(e);return isNaN(n)?B(e,NaN):(n&&t.setDate(t.getDate()+n),t)}function F(e,n){const t=D(e);if(isNaN(n))return B(e,NaN);if(!n)return t;const a=t.getDate(),r=B(e,t.getTime());r.setMonth(t.getMonth()+n+1,0);const s=r.getDate();return a>=s?r:(t.setFullYear(r.getFullYear(),r.getMonth(),a),t)}function he(e,n){const t=n*7;return k(e,t)}function mn(e,n){return F(e,n*12)}function pn(e){let n;return e.forEach(function(t){const a=D(t);(n===void 0||n<a||isNaN(Number(a)))&&(n=a)}),n||new Date(NaN)}function gn(e){let n;return e.forEach(t=>{const a=D(t);(!n||n>a||isNaN(+a))&&(n=a)}),n||new Date(NaN)}function P(e,n){const t=te(e),a=te(n);return+t==+a}function yn(e,n,t){const a=q(e,t),r=q(n,t),s=+a-Re(a),i=+r-Re(r);return Math.round((s-i)/tn)}function S(e){const n=D(e);return n.setDate(1),n.setHours(0,0,0,0),n}function ye(e,n){var l,d,c,u;const t=nn(),a=(n==null?void 0:n.weekStartsOn)??((d=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??t.weekStartsOn??((u=(c=t.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,r=D(e),s=r.getDay(),i=(s<a?-7:0)+6-(s-a);return r.setDate(r.getDate()+i),r.setHours(23,59,59,999),r}function qe(e){return ye(e,{weekStartsOn:1})}function xn(e){const n=D(e),t=n.getFullYear(),a=n.getMonth(),r=B(e,0);return r.setFullYear(t,a+1,0),r.setHours(0,0,0,0),r.getDate()}function bn(e){return Math.trunc(+D(e)/1e3)}function _n(e){const n=D(e),t=n.getMonth();return n.setFullYear(n.getFullYear(),t+1,0),n.setHours(0,0,0,0),n}function wn(e,n){return yn(_n(e),S(e),n)+1}function me(e,n){const t=D(e),a=D(n);return t.getTime()>a.getTime()}function Ke(e,n){const t=D(e),a=D(n);return+t<+a}function xe(e,n){const t=D(e),a=D(n);return t.getFullYear()===a.getFullYear()&&t.getMonth()===a.getMonth()}function Cn(e,n){const t=D(e),a=D(n);return t.getFullYear()===a.getFullYear()}function le(e,n){return k(e,-n)}function de(e,n){const t=D(e),a=t.getFullYear(),r=t.getDate(),s=B(e,0);s.setFullYear(a,n,15),s.setHours(0,0,0,0);const i=xn(s);return t.setMonth(n,Math.min(r,i)),t}function Te(e,n){const t=D(e);return isNaN(+t)?B(e,NaN):(t.setFullYear(n),t)}var y=function(){return y=Object.assign||function(n){for(var t,a=1,r=arguments.length;a<r;a++){t=arguments[a];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=t[s])}return n},y.apply(this,arguments)};function Nn(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)n.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(t[a[r]]=e[a[r]]);return t}function $e(e,n,t){for(var a=0,r=n.length,s;a<r;a++)(s||!(a in n))&&(s||(s=Array.prototype.slice.call(n,0,a)),s[a]=n[a]);return e.concat(s||Array.prototype.slice.call(n))}function $(e){return e.mode==="multiple"}function G(e){return e.mode==="range"}function ae(e){return e.mode==="single"}var jn={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rd
6p-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function Dn(e,n){return L(e,"LLLL y",n)}function Mn(e,n){return L(e,"d",n)}function kn(e,n){return L(e,"LLLL",n)}function Pn(e){return"".concat(e)}function Sn(e,n){return L(e,"cccccc",n)}function On(e,n){return L(e,"yyyy",n)}var Fn=Object.freeze({__proto__:null,formatCaption:Dn,formatDay:Mn,formatMonthCaption:kn,formatWeekNumber:Pn,formatWeekdayName:Sn,formatYearCaption:On}),Rn=function(e,n,t){return L(e,"do MMMM (EEEE)",t)},In=function(){return"Month: "},Tn=function(){return"Go to next month"},Wn=function(){return"Go to previous month"},En=function(e,n){return L(e,"cccc",n)},Ln=function(e){return"Week n. ".concat(e)},An=function(){return"Year: "},Yn=Object.freeze({__proto__:null,labelDay:Rn,labelMonthDropdown:In,labelNext:Tn,labelPrevious:Wn,labelWeekNumber:Ln,labelWeekday:En,labelYearDropdown:An});function Bn(){var e="buttons",n=jn,t=an,a={},r={},s=1,i={},l=new Date;return{captionLayout:e,classNames:n,formatters:Fn,labels:Yn,locale:t,modifiersClassNames:a,modifiers:r,numberOfMonths:s,styles:i,today:l,mode:"default"}}function Hn(e){var n=e.fromYear,t=e.toYear,a=e.fromMonth,r=e.toMonth,s=e.fromDate,i=e.toDate;return a?s=S(a):n&&(s=new Date(n,0,1)),r?i=ge(r):t&&(i=new Date(t,11,31)),{fromDate:s?te(s):void 0,toDate:i?te(i):void 0}}var Ge=p.createContext(void 0);function zn(e){var n,t=e.initialProps,a=Bn(),r=Hn(t),s=r.fromDate,i=r.toDate,l=(n=t.captionLayout)!==null&&n!==void 0?n:a.captionLayout;l!=="buttons"&&(!s||!i)&&(l="buttons");var d;(ae(t)||$(t)||G(t))&&(d=t.onSelect);var c=y(y(y({},a),t),{captionLayout:l,classNames:y(y({},a.classNames),t.classNames),components:y({},t.components),formatters:y(y({},a.formatters),t.formatters),fromDate:s,labels:y(y({},a.labels),t.labels),mode:t.mode||a.mode,modifiers:y(y({},a.modifiers),t.modifiers),modifiersClassNames:y(y({},a.modifiersClassNames),t.modifiersClassNames),onSelect:d,styles:y(y({},a.styles),t.styles),toDate:i});return o.jsx(Ge.Provider,{value:c,children:e.children})}function C(){var e=p.useContext(Ge);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function Ze(e){var n=C(),t=n.locale,a=n.classNames,r=n.styles,s=n.formatters.formatCaption;return o.jsx("div",{className:a.caption_label,style:r.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:s(e.displayMonth,{locale:t})})}function Un(e){return o.jsx("svg",y({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:o.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Je(e){var n,t,a=e.onChange,r=e.value,s=e.children,i=e.caption,l=e.className,d=e.style,c=C(),u=(t=(n=c.components)===null||n===void 0?void 0:n.IconDropdown)!==null&&t!==void 0?t:Un;return o.jsxs("div",{className:l,style:d,children:[o.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),o.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:r,onChange:a,children:s}),o.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[i,o.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function Vn(e){var n,t=C(),a=t.fromDate,r=t.toDate,s=t.styles,i=t.locale,l=t.formatters.formatMonthCaption,d=t.classNames,c=t.components,u=t.labels.labelMonthDropdown;if(!a)return o.jsx(o.Fragment,{});if(!r)return o.jsx(o.Fragment,{});var v=[];
6if(Cn(a,r))for(var h=S(a),m=a.getMonth();m<=r.getMonth();m++)v.push(de(h,m));else for(var h=S(new Date),m=0;m<=11;m++)v.push(de(h,m));var b=function(_){var j=Number(_.target.value),N=de(S(e.displayMonth),j);e.onChange(N)},w=(n=c==null?void 0:c.Dropdown)!==null&&n!==void 0?n:Je;return o.jsx(w,{name:"months","aria-label":u(),className:d.dropdown_month,style:s.dropdown_month,onChange:b,value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:i}),children:v.map(function(_){return o.jsx("option",{value:_.getMonth(),children:l(_,{locale:i})},_.getMonth())})})}function qn(e){var n,t=e.displayMonth,a=C(),r=a.fromDate,s=a.toDate,i=a.locale,l=a.styles,d=a.classNames,c=a.components,u=a.formatters.formatYearCaption,v=a.labels.labelYearDropdown,h=[];if(!r)return o.jsx(o.Fragment,{});if(!s)return o.jsx(o.Fragment,{});for(var m=r.getFullYear(),b=s.getFullYear(),w=m;w<=b;w++)h.push(Te(Qt(new Date),w));var _=function(N){var f=Te(S(t),Number(N.target.value));e.onChange(f)},j=(n=c==null?void 0:c.Dropdown)!==null&&n!==void 0?n:Je;return o.jsx(j,{name:"years","aria-label":v(),className:d.dropdown_year,style:l.dropdown_year,onChange:_,value:t.getFullYear(),caption:u(t,{locale:i}),children:h.map(function(N){return o.jsx("option",{value:N.getFullYear(),children:u(N,{locale:i})},N.getFullYear())})})}function Kn(e,n){var t=p.useState(e),a=t[0],r=t[1],s=n===void 0?a:n;return[s,r]}function $n(e){var n=e.month,t=e.defaultMonth,a=e.today,r=n||t||a||new Date,s=e.toDate,i=e.fromDate,l=e.numberOfMonths,d=l===void 0?1:l;if(s&&K(s,r)<0){var c=-1*(d-1);r=F(s,c)}return i&&K(r,i)<0&&(r=i),S(r)}function Gn(){var e=C(),n=$n(e),t=Kn(n,e.month),a=t[0],r=t[1],s=function(i){var l;if(!e.disableNavigation){var d=S(i);r(d),(l=e.onMonthChange)===null||l===void 0||l.call(e,d)}};return[a,s]}function Zn(e,n){for(var t=n.reverseMonths,a=n.numberOfMonths,r=S(e),s=S(F(r,a)),i=K(s,r),l=[],d=0;d<i;d++){var c=F(r,d);l.push(c)}return t&&(l=l.reverse()),l}function Jn(e,n){if(!n.disableNavigation){var t=n.toDate,a=n.pagedNavigation,r=n.numberOfMonths,s=r===void 0?1:r,i=a?s:1,l=S(e);if(!t)return F(l,i);var d=K(t,e);if(!(d<s))return F(l,i)}}function Qn(e,n){if(!n.disableNavigation){var t=n.fromDate,a=n.pagedNavigation,r=n.numberOfMonths,s=r===void 0?1:r,i=a?s:1,l=S(e);if(!t)return F(l,-i);var d=K(l,t);if(!(d<=0))return F(l,-i)}}var Qe=p.createContext(void 0);function Xn(e){var n=C(),t=Gn(),a=t[0],r=t[1],s=Zn(a,n),i=Jn(a,n),l=Qn(a,n),d=function(v){return s.some(function(h){return xe(v,h)})},c=function(v,h){d(v)||(h&&Ke(v,h)?r(F(v,1+n.numberOfMonths*-1)):r(v))},u={currentMonth:a,displayMonths:s,goToMonth:r,goToDate:c,previousMonth:l,nextMonth:i,isDateDisplayed:d};return o.jsx(Qe.Provider,{value:u,children:e.children})}function Z(){var e=p.useContext(Qe);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function We(e){var n,t=C(),a=t.classNames,r=t.styles,s=t.components,i=Z().goToMonth,l=function(u){i(F(u,e.displayIndex?-e.dis
6playIndex:0))},d=(n=s==null?void 0:s.CaptionLabel)!==null&&n!==void 0?n:Ze,c=o.jsx(d,{id:e.id,displayMonth:e.displayMonth});return o.jsxs("div",{className:a.caption_dropdowns,style:r.caption_dropdowns,children:[o.jsx("div",{className:a.vhidden,children:c}),o.jsx(Vn,{onChange:l,displayMonth:e.displayMonth}),o.jsx(qn,{onChange:l,displayMonth:e.displayMonth})]})}function ea(e){return o.jsx("svg",y({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:o.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function ta(e){return o.jsx("svg",y({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:o.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var ne=p.forwardRef(function(e,n){var t=C(),a=t.classNames,r=t.styles,s=[a.button_reset,a.button];e.className&&s.push(e.className);var i=s.join(" "),l=y(y({},r.button_reset),r.button);return e.style&&Object.assign(l,e.style),o.jsx("button",y({},e,{ref:n,type:"button",className:i,style:l}))});function na(e){var n,t,a=C(),r=a.dir,s=a.locale,i=a.classNames,l=a.styles,d=a.labels,c=d.labelPrevious,u=d.labelNext,v=a.components;if(!e.nextMonth&&!e.previousMonth)return o.jsx(o.Fragment,{});var h=c(e.previousMonth,{locale:s}),m=[i.nav_button,i.nav_button_previous].join(" "),b=u(e.nextMonth,{locale:s}),w=[i.nav_button,i.nav_button_next].join(" "),_=(n=v==null?void 0:v.IconRight)!==null&&n!==void 0?n:ta,j=(t=v==null?void 0:v.IconLeft)!==null&&t!==void 0?t:ea;return o.jsxs("div",{className:i.nav,style:l.nav,children:[!e.hidePrevious&&o.jsx(ne,{name:"previous-month","aria-label":h,className:m,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:r==="rtl"?o.jsx(_,{className:i.nav_icon,style:l.nav_icon}):o.jsx(j,{className:i.nav_icon,style:l.nav_icon})}),!e.hideNext&&o.jsx(ne,{name:"next-month","aria-label":b,className:w,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:r==="rtl"?o.jsx(j,{className:i.nav_icon,style:l.nav_icon}):o.jsx(_,{className:i.nav_icon,style:l.nav_icon})})]})}function Ee(e){var n=C().numberOfMonths,t=Z(),a=t.previousMonth,r=t.nextMonth,s=t.goToMonth,i=t.displayMonths,l=i.findIndex(function(b){return xe(e.displayMonth,b)}),d=l===0,c=l===i.length-1,u=n>1&&(d||!c),v=n>1&&(c||!d),h=function(){a&&s(a)},m=function(){r&&s(r)};return o.jsx(na,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:v,nextMonth:r,previousMonth:a,onPreviousClick:h,onNextClick:m})}function aa(e){var n,t=C(),a=t.classNames,r=t.disableNavigation,s=t.styles,i=t.captionLayout,l=t.components,d=(n=l==null?void 0:l.CaptionLabel)!==null&&n!==void 0?n:Ze,c;return r?c=o.jsx(d,{id:e.id,displayMonth:e.displayMonth}):i==="dropdown"?c=o.jsx(We,{displayMonth:e.displayMonth,id:e.id}):i==="dropdown-buttons"?c=o.jsxs(o.Fragment,{children:[o.jsx(We,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),o.jsx(Ee,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=o.jsxs(o.Fragment,{children:[o.jsx(d,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),o.jsx(Ee,{displayMonth:e.displayMonth,id:e.id})]}),o.jsx("div",{className:a.caption,style:s.caption,children:c})}function ra(e){var n=C(),t=n.footer,a=n.styles,r=n.classNames.tfoot;return t?o.jsx("tfoot",{className:r,style:a.tfoot,children:o.jsx("tr",{children:o.jsx("td",{colSpan:8,children:t})})}):o.jsx(o.Fragment,{})}function oa(e,n,t){for(var a=t?pe(new Date):q(new Date,{locale:e,weekStartsOn:n}),r=[],s=0;s<7;s++){var i=k(a,s);r.push(i)}return r}function sa(){var e=C(),n=e.classNames,t=e.styles,a=e.showWeekNumber,r=e.locale,s=e.weekStartsOn,i=e.ISOWeek,l=e.formatters.formatWeekdayName,d=e.labels.labelWeekday,c=oa(r,s,i);return o.jsxs("tr",{style:t.head_row,className:n.head_row,children:[a&&o.jsx("td",{style:t.head_cell,className:n.head_cell}),c.map(function(u,v){return o.jsx("th",{scope:"col",className:n.head_cell,style:t.head_cell,"aria-label":d(u,{locale:r}),children:l(u,{locale:r})},v)})]})}function ia(){var e,n=C(),t=n.classNames,a=n.styles,r=n.components,s=(e=r==null?void 0:r.HeadRow)!==null&&e!==void 0?e:sa;return o.jsx("thead",{style:a.head,className:t.head,children:o.jsx(s,{})})}function la(e){var n=C(),t=n.locale,a=n.formatters.formatDay;return o.jsx(o.Fragment,{children:a(e.date,{locale:t})})}var be=p.createContext(void 0);function da(e){if(!$(e.initialProps)){var n={selected:void 0,modifiers:{disabled:[]}};return o.jsx(be.Provider,{value:n,children:e.children})}return o.jsx(ca,{initialProps:e.initialProps,children:e.children})}function ca(e){var n=e.initialProps,t=e.children,a=n.selected,r=n.min,s=n.max,i=function(c,u,v){var h,m;
6(h=n.onDayClick)===null||h===void 0||h.call(n,c,u,v);var b=!!(u.selected&&r&&(a==null?void 0:a.length)===r);if(!b){var w=!!(!u.selected&&s&&(a==null?void 0:a.length)===s);if(!w){var _=a?$e([],a):[];if(u.selected){var j=_.findIndex(function(N){return P(c,N)});_.splice(j,1)}else _.push(c);(m=n.onSelect)===null||m===void 0||m.call(n,_,c,u,v)}}},l={disabled:[]};a&&l.disabled.push(function(c){var u=s&&a.length>s-1,v=a.some(function(h){return P(h,c)});return!!(u&&!v)});var d={selected:a,onDayClick:i,modifiers:l};return o.jsx(be.Provider,{value:d,children:t})}function _e(){var e=p.useContext(be);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function ua(e,n){var t=n||{},a=t.from,r=t.to;return a&&r?P(r,e)&&P(a,e)?void 0:P(r,e)?{from:r,to:void 0}:P(a,e)?void 0:me(a,e)?{from:e,to:r}:{from:a,to:e}:r?me(e,r)?{from:r,to:e}:{from:e,to:r}:a?Ke(e,a)?{from:e,to:a}:{from:a,to:e}:{from:e,to:void 0}}var we=p.createContext(void 0);function fa(e){if(!G(e.initialProps)){var n={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return o.jsx(we.Provider,{value:n,children:e.children})}return o.jsx(va,{initialProps:e.initialProps,children:e.children})}function va(e){var n=e.initialProps,t=e.children,a=n.selected,r=a||{},s=r.from,i=r.to,l=n.min,d=n.max,c=function(m,b,w){var _,j;(_=n.onDayClick)===null||_===void 0||_.call(n,m,b,w);var N=ua(m,a);(j=n.onSelect)===null||j===void 0||j.call(n,N,m,b,w)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(s?(u.range_start=[s],i?(u.range_end=[i],P(s,i)||(u.range_middle=[{after:s,before:i}])):u.range_end=[s]):i&&(u.range_start=[i],u.range_end=[i]),l&&(s&&!i&&u.disabled.push({after:le(s,l-1),before:k(s,l-1)}),s&&i&&u.disabled.push({after:s,before:k(s,l-1)}),!s&&i&&u.disabled.push({after:le(i,l-1),before:k(i,l-1)})),d){if(s&&!i&&(u.disabled.push({before:k(s,-d+1)}),u.disabled.push({after:k(s,d-1)})),s&&i){var v=W(i,s)+1,h=d-v;u.disabled.push({before:le(s,h)}),u.disabled.push({after:k(i,h)})}!s&&i&&(u.disabled.push({before:k(i,-d+1)}),u.disabled.push({after:k(i,d-1)}))}return o.jsx(we.Provider,{value:{selected:a,onDayClick:c,modifiers:u},children:t})}function Ce(){var e=p.useContext(we);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function ee(e){return Array.isArray(e)?$e([],e):e!==void 0?[e]:[]}function ha(e){var n={};return Object.entries(e).forEach(function(t){var a=t[0],r=t[1];n[a]=ee(r)}),n}var R;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(R||(R={}));var ma=R.Selected,T=R.Disabled,pa=R.Hidden,ga=R.Today,ce=R.RangeEnd,ue=R.RangeMiddle,fe=R.RangeStart,ya=R.Outside;function xa(e,n,t){var a,r=(a={},a[ma]=ee(e.selected),a[T]=ee(e.disabled),a[pa]=ee(e.hidden),a[ga]=[e.today],a[ce]=[],a[ue]=[],a[fe]=[],a[ya]=[],a);return e.fromDate&&r[T].push({before:e.fromDate}),e.toDate&&r[T].push({after:e.toDate}),$(e)?r[T]=r[T].concat(n.modifiers[T]):G(e)&&(r[T]=r[T].concat(t.modifiers[T]),r[fe]=t.modifiers[fe],r[ue]=t.modifiers[ue],r[ce]=t.modifiers[ce]),r}var Xe=p.createContext(void 0);function ba(e){var n=C(),t=_e(),a=Ce(),r=xa(n,t,a),s=ha(n.modifiers),i=y(y({},r),s);return o.jsx(Xe.Provider,{value:i,children:e.children})}function et(){var e=p.useContext(Xe);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function _a(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function wa(e){return!!(e&&typeof e=="object"&&"from"in e)}function Ca(e){return!!(e&&typeof e=="object"&&"after"in e)}function Na(e){return!!(e&&typeof e=="object"&&"before"in e)}function ja(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Da(e,n){var t,a=n.from,r=n.to;if(a&&r){var s=W(r,a)<0;s&&(t=[r,a],a=t[0],r=t[1]);var i=W(e,a)>=0&&W(r,e)>=0;return i}return r?P(r,e):a?P(a,e):!1}function Ma(e){return Ve(e)}function ka(e){return Array.isArray(e)&&e.every(Ve)}function Pa(e,n){return n.some(function(t){if(typeof t=="boolean")return t;if(Ma(t))return P(e,t);if(ka(t))return t.includes(e);if(wa(t))return Da(e,t);if(ja(t))return t.dayOfWeek.includes(e.getDay());if(_a(t)){var a=W(t.before,e),r=W(t.after,e),s=a>0,i=r<0,l=me(t.before,t.after);return l?i&&s:s||i}return Ca(t)?W(e,t.after)>0:Na(t)?W(t.before,e)>0:typeof t=="function"?t(e):!1})}function Ne(e,n,t){var a=Object.keys(n).reduce(function(s,i){var l=n[i];return Pa(e,l)&&s.push(i),s},[]),r={};return a.forEach(function(s){return r[s]=!0}),t&&!xe(e,t)&&(r.outside=!0),r}function Sa(e,n){for(var t=S(e[0]),a=ge(e[e.length-1]),r,s,i=t;i<=a;){var l=Ne(i,n),d=!l.disabled&&!l.hidden;if(!d){i=k(i,1);continue}if(l.selected)return i;l.today&&!s&&(s=i),r||(r=i),i=k(i,1)}return s||r}var Oa=365;function tt(e,n){var t=n.moveBy,a=n.direction,r=n.context,s=n.modifiers,i=n.retry,l=i===void 0?{count:0,lastFocused:e}:i,d=r.weekStartsOn,c=r.fromDate,u=r.toDate,v=r.locale,h={day:k,week:he,month:F,year:mn,startOfWeek:function(_){return r.ISOWeek?pe(_):q(_,{locale:v,weekStartsOn:d})},endOfWeek:function(_){return r.ISOWeek?qe(_):ye(_,{locale:v,weekStartsOn:d})}},m=h[t](e,a==="after"?1:-1);a==="before"&&c?m=pn([c,m]):a==="after"&&u&&(m=gn([u,m]));var b=!0;if(s){var w=Ne(m,s);b=!w.disabled&&!w.hidden}return b?m:l.count>Oa?l.lastFocused:tt(m,{moveBy:t,direction:a,context:r,modifiers:s,retry:y(y({},l),{count:l.count+1})})}var nt=p.createContext(void 0);function Fa(e){var n=Z(),t=et(),a=p.useState(),r=a[0],s=a[1],i=p.useState(),l=i[0],d=i[1],c=Sa(n.displayMonths,t),u=r??(l&&n.isDateDisplayed(l))?l:c,v=function(){d(r),s(void 0)},h=function(_){s(_)},m=C(),b=function(_,j){if(r){var N=tt(r,{moveBy:_,direction:j,context:m,modifiers:t});P(r,N)||(n.goToDate(N,r),h(N))}}
6,w={focusedDay:r,focusTarget:u,blur:v,focus:h,focusDayAfter:function(){return b("day","after")},focusDayBefore:function(){return b("day","before")},focusWeekAfter:function(){return b("week","after")},focusWeekBefore:function(){return b("week","before")},focusMonthBefore:function(){return b("month","before")},focusMonthAfter:function(){return b("month","after")},focusYearBefore:function(){return b("year","before")},focusYearAfter:function(){return b("year","after")},focusStartOfWeek:function(){return b("startOfWeek","before")},focusEndOfWeek:function(){return b("endOfWeek","after")}};return o.jsx(nt.Provider,{value:w,children:e.children})}function je(){var e=p.useContext(nt);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Ra(e,n){var t=et(),a=Ne(e,t,n);return a}var De=p.createContext(void 0);function Ia(e){if(!ae(e.initialProps)){var n={selected:void 0};return o.jsx(De.Provider,{value:n,children:e.children})}return o.jsx(Ta,{initialProps:e.initialProps,children:e.children})}function Ta(e){var n=e.initialProps,t=e.children,a=function(s,i,l){var d,c,u;if((d=n.onDayClick)===null||d===void 0||d.call(n,s,i,l),i.selected&&!n.required){(c=n.onSelect)===null||c===void 0||c.call(n,void 0,s,i,l);return}(u=n.onSelect)===null||u===void 0||u.call(n,s,s,i,l)},r={selected:n.selected,onDayClick:a};return o.jsx(De.Provider,{value:r,children:t})}function at(){var e=p.useContext(De);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Wa(e,n){var t=C(),a=at(),r=_e(),s=Ce(),i=je(),l=i.focusDayAfter,d=i.focusDayBefore,c=i.focusWeekAfter,u=i.focusWeekBefore,v=i.blur,h=i.focus,m=i.focusMonthBefore,b=i.focusMonthAfter,w=i.focusYearBefore,_=i.focusYearAfter,j=i.focusStartOfWeek,N=i.focusEndOfWeek,f=function(x){var g,re,oe,se;ae(t)?(g=a.onDayClick)===null||g===void 0||g.call(a,e,n,x):$(t)?(re=r.onDayClick)===null||re===void 0||re.call(r,e,n,x):G(t)?(oe=s.onDayClick)===null||oe===void 0||oe.call(s,e,n,x):(se=t.onDayClick)===null||se===void 0||se.call(t,e,n,x)},M=function(x){var g;h(e),(g=t.onDayFocus)===null||g===void 0||g.call(t,e,n,x)},I=function(x){var g;v(),(g=t.onDayBlur)===null||g===void 0||g.call(t,e,n,x)},z=function(x){var g;(g=t.onDayMouseEnter)===null||g===void 0||g.call(t,e,n,x)},gt=function(x){var g;(g=t.onDayMouseLeave)===null||g===void 0||g.call(t,e,n,x)},yt=function(x){var g;(g=t.onDayPointerEnter)===null||g===void 0||g.call(t,e,n,x)},xt=function(x){var g;(g=t.onDayPointerLeave)===null||g===void 0||g.call(t,e,n,x)},bt=function(x){var g;(g=t.onDayTouchCancel)===null||g===void 0||g.call(t,e,n,x)},_t=function(x){var g;(g=t.onDayTouchEnd)===null||g===void 0||g.call(t,e,n,x)},wt=function(x){var g;(g=t.onDayTouchMove)===null||g===void 0||g.call(t,e,n,x)},Ct=function(x){var g;(g=t.onDayTouchStart)===null||g===void 0||g.call(t,e,n,x)},Nt=function(x){var g;(g=t.onDayKeyUp)===null||g===void 0||g.call(t,e,n,x)},jt=function(x){var g;switch(x.key){case"ArrowLeft":x.preventDefault(),x.stopPropagation(),t.dir==="rtl"?l():d();break;case"ArrowRight":x.preventDefault(),x.stopPropagation(),t.dir==="rtl"?d():l();break;case"ArrowDown":x.preventDefault(),x.stopPropagation(),c();break;case"ArrowUp":x.preventDefault(),x.stopPropagation(),u();break;case"PageUp":x.preventDefault(),x.stopPropagation(),x.shiftKey?w():m();break;case"PageDown":x.preventDefault(),x.stopPropagation(),x.shiftKey?_():b();break;case"Home":x.preventDefault(),x.stopPropagation(),j();break;case"End":x.preventDefault(),x.stopPropagation(),N();break}(g=t.onDayKeyDown)===null||g===void 0||g.call(t,e,n,x)},Dt={onClick:f,onFocus:M,onBlur:I,onKeyDown:jt,onKeyUp:Nt,onMouseEnter:z,onMouseLeave:gt,onPointerEnter:yt,onPointerLeave:xt,onTouchCancel:bt,onTouchEnd:_t,onTouchMove:wt,onTouchStart:Ct};return Dt}function Ea(){var e=C(),n=at(),t=_e(),a=Ce(),r=ae(e)?n.selected:$(e)?t.selected:G(e)?a.selected:void 0;return r}function La(e){return Object.values(R).includes(e)}function Aa(e,n){var t=[e.classNames.day];return Object.keys(n).forEach(function(a){var r=e.modifiersClassNames[a];if(r)t.push(r);else if(La(a)){var s=e.classNames["day_".concat(a)];
6s&&t.push(s)}}),t}function Ya(e,n){var t=y({},e.styles.day);return Object.keys(n).forEach(function(a){var r;t=y(y({},t),(r=e.modifiersStyles)===null||r===void 0?void 0:r[a])}),t}function Ba(e,n,t){var a,r,s,i=C(),l=je(),d=Ra(e,n),c=Wa(e,d),u=Ea(),v=!!(i.onDayClick||i.mode!=="default");p.useEffect(function(){var z;d.outside||l.focusedDay&&v&&P(l.focusedDay,e)&&((z=t.current)===null||z===void 0||z.focus())},[l.focusedDay,e,t,v,d.outside]);var h=Aa(i,d).join(" "),m=Ya(i,d),b=!!(d.outside&&!i.showOutsideDays||d.hidden),w=(s=(r=i.components)===null||r===void 0?void 0:r.DayContent)!==null&&s!==void 0?s:la,_=o.jsx(w,{date:e,displayMonth:n,activeModifiers:d}),j={style:m,className:h,children:_,role:"gridcell"},N=l.focusTarget&&P(l.focusTarget,e)&&!d.outside,f=l.focusedDay&&P(l.focusedDay,e),M=y(y(y({},j),(a={disabled:d.disabled,role:"gridcell"},a["aria-selected"]=d.selected,a.tabIndex=f||N?0:-1,a)),c),I={isButton:v,isHidden:b,activeModifiers:d,selectedDays:u,buttonProps:M,divProps:j};return I}function Ha(e){var n=p.useRef(null),t=Ba(e.date,e.displayMonth,n);return t.isHidden?o.jsx("div",{role:"gridcell"}):t.isButton?o.jsx(ne,y({name:"day",ref:n},t.buttonProps)):o.jsx("div",y({},t.divProps))}function za(e){var n=e.number,t=e.dates,a=C(),r=a.onWeekNumberClick,s=a.styles,i=a.classNames,l=a.locale,d=a.labels.labelWeekNumber,c=a.formatters.formatWeekNumber,u=c(Number(n),{locale:l});if(!r)return o.jsx("span",{className:i.weeknumber,style:s.weeknumber,children:u});var v=d(Number(n),{locale:l}),h=function(m){r(n,t,m)};return o.jsx(ne,{name:"week-number","aria-label":v,className:i.weeknumber,style:s.weeknumber,onClick:h,children:u})}function Ua(e){var n,t,a=C(),r=a.styles,s=a.classNames,i=a.showWeekNumber,l=a.components,d=(n=l==null?void 0:l.Day)!==null&&n!==void 0?n:Ha,c=(t=l==null?void 0:l.WeekNumber)!==null&&t!==void 0?t:za,u;return i&&(u=o.jsx("td",{className:s.cell,style:r.cell,children:o.jsx(c,{number:e.weekNumber,dates:e.dates})})),o.jsxs("tr",{className:s.row,style:r.row,children:[u,e.dates.map(function(v){return o.jsx("td",{className:s.cell,style:r.cell,role:"presentation",children:o.jsx(d,{displayMonth:e.displayMonth,date:v})},bn(v))})]})}function Le(e,n,t){for(var a=t!=null&&t.ISOWeek?qe(n):ye(n,t),r=t!=null&&t.ISOWeek?pe(e):q(e,t),s=W(a,r),i=[],l=0;l<=s;l++)i.push(k(r,l));var d=i.reduce(function(c,u){var v=t!=null&&t.ISOWeek?Xt(u):en(u,t),h=c.find(function(m){return m.weekNumber===v});return h?(h.dates.push(u),c):(c.push({weekNumber:v,dates:[u]}),c)},[]);return d}function Va(e,n){var t=Le(S(e),ge(e),n);if(n!=null&&n.useFixedWeeks){var a=wn(e,n);if(a<6){var r=t[t.length-1],s=r.dates[r.dates.length-1],i=he(s,6-a),l=Le(he(s,1),i,n);t.push.apply(t,l)}}return t}function qa(e){var n,t,a,r=C(),s=r.locale,i=r.classNames,l=r.styles,d=r.hideHead,c=r.fixedWeeks,u=r.components,v=r.weekStartsOn,h=r.firstWeekContainsDate,m=r.ISOWeek,b=Va(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:m,locale:s,weekStartsOn:v,firstWeekContainsDate:h}),w=(n=u==null?void 0:u.Head)!==null&&n!==void 0?n:ia,_=(t=u==null?void 0:u.Row)!==null&&t!==void 0?t:Ua,j=(a=u==null?void 0:u.Footer)!==null&&a!==void 0?a:ra;return o.jsxs("table",{id:e.id,className:i.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!d&&o.jsx(w,{}),o.jsx("tbody",{className:i.tbody,style:l.tbody,children:b.map(function(N){return o.jsx(_,{displayMonth:e.displayMonth,dates:N.dates,weekNumber:N.weekNumber},N.weekNumber)})}),o.jsx(j,{displayMonth:e.displayMonth})]})}function Ka(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var $a=Ka()?p.useLayoutEffect:p.useEffect,ve=!1,Ga=0;function Ae(){return"react-day-picker-".concat(++Ga)}function Za(e){var n,t=e??(ve?Ae():null),a=p.useState(t),r=a[0],s=a[1];return $a(function(){r===null&&s(Ae())},[]),p.useEffect(function(){ve===!1&&(ve=!0)},[]),(n=e??r)!==null&&n!==void 0?n:void 0}function Ja(e){var n,t,a=C(),r=a.dir,s=a.classNames,i=a.styles,l=a.components,d=Z().displayMonths,c=Za(a.id?"".concat(a.id,"-").concat(e.displayIndex):void 0),u=a.id?"".concat(a.id,"-grid-").concat(e.displayIndex):void 0,v=[s.month],h=i.month,m=e.displayIndex===0,b=e.dis
vendor: 4,132 bytes, line 6
6playIndex===d.length-1,w=!m&&!b;r==="rtl"&&(n=[m,b],b=n[0],m=n[1]),m&&(v.push(s.caption_start),h=y(y({},h),i.caption_start)),b&&(v.push(s.caption_end),h=y(y({},h),i.caption_end)),w&&(v.push(s.caption_between),h=y(y({},h),i.caption_between));var _=(t=l==null?void 0:l.Caption)!==null&&t!==void 0?t:aa;return o.jsxs("div",{className:v.join(" "),style:h,children:[o.jsx(_,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),o.jsx(qa,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function Qa(e){var n=C(),t=n.classNames,a=n.styles;return o.jsx("div",{className:t.months,style:a.months,children:e.children})}function Xa(e){var n,t,a=e.initialProps,r=C(),s=je(),i=Z(),l=p.useState(!1),d=l[0],c=l[1];p.useEffect(function(){r.initialFocus&&s.focusTarget&&(d||(s.focus(s.focusTarget),c(!0)))},[r.initialFocus,d,s.focus,s.focusTarget,s]);var u=[r.classNames.root,r.className];r.numberOfMonths>1&&u.push(r.classNames.multiple_months),r.showWeekNumber&&u.push(r.classNames.with_weeknumber);var v=y(y({},r.styles.root),r.style),h=Object.keys(a).filter(function(b){return b.startsWith("data-")}).reduce(function(b,w){var _;return y(y({},b),(_={},_[w]=a[w],_))},{}),m=(t=(n=a.components)===null||n===void 0?void 0:n.Months)!==null&&t!==void 0?t:Qa;return o.jsx("div",y({className:u.join(" "),style:v,dir:r.dir,id:r.id,nonce:a.nonce,title:a.title,lang:a.lang},h,{children:o.jsx(m,{children:i.displayMonths.map(function(b,w){return o.jsx(Ja,{displayIndex:w,displayMonth:b},w)})})}))}function er(e){var n=e.children,t=Nn(e,["children"]);return o.jsx(zn,{initialProps:t,children:o.jsx(Xn,{children:o.jsx(Ia,{initialProps:t,children:o.jsx(da,{initialProps:t,children:o.jsx(fa,{initialProps:t,children:o.jsx(ba,{children:o.jsx(Fa,{children:n})})})})})})})}function tr(e){return o.jsx(er,y({},e,{children:o.jsx(Xa,{initialProps:e})}))}function rt({className:e,classNames:n,showOutsideDays:t=!0,...a}){return o.jsx(tr,{showOutsideDays:t,className:Y("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Y(Pe({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:Y(Pe({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...n},components:{IconLeft:({...r})=>o.jsx(hn,{className:"h-4 w-4"}),IconRight:({...r})=>o.jsx(rn,{className:"h-4 w-4"})},...a})}rt.displayName="Calendar";var Me="Popover",[ot,Sr]=kt(Me,[Ye]),J=Ye(),[nr,A]=ot(Me),st=e=>{const{__scopePopover:n,children:t,open:a,defaultOpen:r,onOpenChange:s,modal:i=!1}=e,l=J(n),d=p.useRef(null),[c,u]=p.useState(!1),[v=!1,h]=Rt({prop:a,defaultProp:r,onChange:s});return o.jsx(It,{...l,children:o.jsx(nr,{scope:n,contentId:Tt(),triggerRef:d,open:v,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:c,onCustomAnchorAdd:p.useCallback(()=>u(!0),[]),onCustomAnchorRemove:p.useCallback(()=>u(!1),[]),modal:i,children:t})})};st.displayName=Me;
vendor: 4,433 bytes, line 6
6var it="PopoverAnchor",ar=p.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,r=A(it,t),s=J(t),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=r;return p.useEffect(()=>(i(),()=>l()),[i,l]),o.jsx(Be,{...s,...a,ref:n})});ar.displayName=it;var lt="PopoverTrigger",dt=p.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,r=A(lt,t),s=J(t),i=He(n,r.triggerRef),l=o.jsx(ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":ht(r.open),...a,ref:i,onClick:V(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?l:o.jsx(Be,{asChild:!0,...s,children:l})});dt.displayName=lt;var ke="PopoverPortal",[rr,or]=ot(ke,{forceMount:void 0}),ct=e=>{const{__scopePopover:n,forceMount:t,children:a,container:r}=e,s=A(ke,n);return o.jsx(rr,{scope:n,forceMount:t,children:o.jsx(Ue,{present:t||s.open,children:o.jsx(Wt,{asChild:!0,container:r,children:a})})})};ct.displayName=ke;var H="PopoverContent",ut=p.forwardRef((e,n)=>{const t=or(H,e.__scopePopover),{forceMount:a=t.forceMount,...r}=e,s=A(H,e.__scopePopover);return o.jsx(Ue,{present:a||s.open,children:s.modal?o.jsx(sr,{...r,ref:n}):o.jsx(ir,{...r,ref:n})})});ut.displayName=H;var sr=p.forwardRef((e,n)=>{const t=A(H,e.__scopePopover),a=p.useRef(null),r=He(n,a),s=p.useRef(!1);return p.useEffect(()=>{const i=a.current;if(i)return on(i)},[]),o.jsx(sn,{as:Pt,allowPinchZoom:!0,children:o.jsx(ft,{...e,ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),s.current||(l=t.triggerRef.current)==null||l.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,d=l.button===0&&l.ctrlKey===!0,c=l.button===2||d;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),ir=p.forwardRef((e,n)=>{const t=A(H,e.__scopePopover),a=p.useRef(!1),r=p.useRef(!1);return o.jsx(ft,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(a.current||(l=t.triggerRef.current)==null||l.focus(),s.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:s=>{var d,c;(d=e.onInteractOutside)==null||d.call(e,s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=s.target;((c=t.triggerRef.current)==null?void 0:c.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),ft=p.forwardRef((e,n)=>{const{__scopePopover:t,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:u,...v}=e,h=A(H,t),m=J(t);return ln(),o.jsx(dn,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:s,children:o.jsx(St,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:o.jsx(Ot,{"data-state":ht(h.open),role:"dialog",id:h.contentId,...m,...v,ref:n,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),vt="PopoverClose",lr=p.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,r=A(vt,t);return o.jsx(ze.button,{type:"button",...a,ref:n,onClick:V(e.onClick,()=>r.onOpenChange(!1))})});lr.displayName=vt;var dr="PopoverArrow",cr=p.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,r=J(t);return o.jsx(Ft,{...r,...a,ref:n})});cr.displayName=dr;function ht(e){return e?"open":"closed"}var ur=st,fr=dt,vr=ct,mt=ut;const hr=ur,mr=fr,pt=p.forwardRef(({className:e,align:n="center",sideOffset:t=4,...a},r)=>o.jsx(vr,{children:o.jsx(mt,{ref:r,align:n,sideOffset:t,className:Y("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
6de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));pt.displayName=mt.displayName;function Or(){const[e,n]=p.useState([]),[t,a]=p.useState(!0),[r,s]=p.useState(!1),[i,l]=p.useState(null),[d,c]=p.useState({title:"",excerpt:"",content:"",client_name:"",industry:"",challenge:"",solution:"",results:"",featured_image_url:"",status:"draft",published_at:null}),{toast:u}=Et(),v=()=>{c({title:"FTC Compliance & Cybersecurity Transformation for Accounting Firm",excerpt:"Summit Tax & Accounting needed to meet FTC Safeguards requirements and reduce cybersecurity risks. NetFocus implemented a managed IT solution that brought them into compliance and dramatically reduced phishing threats.",content:`Summit Tax & Accounting had grown steadily, but their IT and security posture hadn't kept pace. With the FTC Safeguards Rule taking effect, the managing partners realized they needed to act quickly to protect sensitive financial data and remain compliant. 7 8NetFocus stepped in with a managed services approach that included security software deployment, compliance-focused audits, and documentation of risk management policies. Using the NIST framework, NetFocus guided Summit through a process that was efficient and minimally disruptive. 9 10Security awareness training was delivered to all employees, email filtering was hardened, and remote access was secured using MFA. Within two months, Summit passed an internal compliance check and gained confidence in their infrastructure. 11 12"We were nervous about compliance and cyber threats. NetFocus made it simple â now we sleep better at night." 13â Managing Partner`,client_name:"Summit Tax & Accounting",industry:"Financial Services â Accounting",challenge:"The firm lacked formal IT policies, endpoint protection, and visibility into cloud-based tools. Compliance with the new FTC Safeguards Rule was unclear and time-sensitive. Staff were also vulnerable to phishing attempts and lacked training.",solution:"NetFocus implemented endpoint security, email protection, and a centralized monitoring solution. A gap analysis aligned their setup with the NIST cybersecurity framework. Security awareness training and compliance documentation were rolled out organization-wide.",results:`Achieved FTC Safeguards compliance in under 60 days 14 15Reduced phishing exposure by 82% 16 17Streamlined IT support workflows for faster resolution`,featured_image_url:"",status:"draft",published_at:null}),s(!0)},h=async()=>{try{const{data:f,error:M}=await X.from("case_studies").select("*").order("created_at",{ascending:!1});if(M)throw M;n(f||[])}catch(f){console.error("Error fetching case studies:",f),u({title:"Error",description:"Failed to fetch case studies",variant:"destructive"})}finally{a(!1)}};p.useEffect(()=>{h()},[]);const m=f=>f.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").trim(),b=async f=>{f.preventDefault();try{const M=m(d.title);if(i){const{error:I}=await X.from("case_studies").update({title:d.title,slug:M,excerpt:d.excerpt||null,content:d.content||null,client_name:d.client_name||null,industry:d.industry||null,challenge:d.challenge||null,solution:d.solution||null,results:d.results||null,featured_image_url:d.featured_image_url||null,status:d.status,published_at:d.published_at?d.published_at.toISOString():null}).eq("id",i.id);if(I)throw I;u({title:"Success",description:"Case study updated successfully"})}else{const{error:I}=await X.from("case_studies").insert({title:d.title,slug:M,excerpt:d.excerpt||null,content:d.content||null,client_name:d.client_name||null,industry:d.industry||null,challenge:d.challenge||null,solution:d.solution||null,results:d.results||null,featured_image_url:d.featured_image_url||null,status:d.status,published_at:d.published_at?d.published_at.toISOString():null});if(I)throw I;u({title:"Success",description:"Case study created successfully"})}s(!1),l(null),c({title:"",excerpt:"",content:"",client_name:"",industry:"",challenge:"",solution:"",results:"",featured_image_url:"",status:"draft",published_at:null}),h()}catch(M){console.error("Error saving case study:",M),u({title:"Error",description:"Failed to save case study",variant:"destructive"})}},w=f=>{l(f),c({title:f.title,excerpt:f.excerpt||"",content:f.content||"",client_name:f.client_name||"",industry:f.industry||"",challenge:f.challenge||"",solution:f.solution||"",results:f.results||"",featured_image_url:f.featured_image_url||"",status:f.status,published_at:f.published_at?new Date(f.published_at):null}),s(!0)},_=async f=>{if(confirm("Are you sure you want to delete this case study?"))try{const{error:M}=await X.from("case_studies").delete().eq("id",f);if(M)throw M;u({title:"Success",description:"Case study deleted successfully"}),h()}catch(M){console.error("Error deleting case study:",M),u({title:"Error",description:"Failed to delete case study",variant:"destructive"})}},j=f=>new Date(f).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),N=f=>{switch(f){case"published":return"bg-green-100 text-green-800";
17case"draft":return"bg-yellow-100 text-yellow-800";default:return"bg-gray-100 text-gray-800"}};return t?o.jsx(Ie,{requiredRole:"admin",children:o.jsx("div",{className:"min-h-screen flex items-center justify-center",children:o.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})})}):o.jsx(Ie,{requiredRole:"admin",children:o.jsxs("div",{className:"min-h-screen",children:[o.jsx(Lt,{}),o.jsx("div",{className:"container mx-auto px-6 py-20 pt-40",children:o.jsxs("div",{className:"max-w-6xl mx-auto",children:[o.jsxs("div",{className:"flex justify-between items-center mb-8 bg-white p-6 rounded-lg shadow-lg border-2 border-primary/20 relative z-10",children:[o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center gap-4 mb-2",children:o.jsx(At,{to:"/blog/admin",children:o.jsxs(E,{variant:"outline",size:"sm",children:[o.jsx(Yt,{className:"mr-2 h-4 w-4"}),"Back to Admin"]})})}),o.jsx("h1",{className:"text-2xl font-bold text-primary",children:"Case Study Admin"}),o.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:"Manage your case studies and success stories"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(E,{variant:"outline",onClick:v,children:"Add Summit Case Study"}),o.jsxs(zt,{open:r,onOpenChange:s,children:[o.jsx(Ut,{asChild:!0,children:o.jsxs(E,{children:[o.jsx(cn,{className:"mr-2 h-4 w-4"}),"New Case Study"]})}),o.jsxs(Vt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[o.jsx(qt,{children:o.jsx(Kt,{children:i?"Edit Case Study":"Create New Case Study"})}),o.jsxs("form",{onSubmit:b,className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx(O,{htmlFor:"title",children:"Title"}),o.jsx(Q,{id:"title",value:d.title,onChange:f=>c({...d,title:f.target.value}),required:!0})]}),o.jsxs("div",{children:[o.jsx(O,{htmlFor:"client_name",children:"Client Name"}),o.jsx(Q,{id:"client_name",value:d.client_name,onChange:f=>c({...d,client_name:f.target.value})})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx(O,{htmlFor:"industry",children:"Industry"}),o.jsx(Q,{id:"industry",value:d.industry,onChange:f=>c({...d,industry:f.target.value})})]}),o.jsxs("div",{children:[o.jsx(O,{htmlFor:"status",children:"Status"}),o.jsxs($t,{value:d.status,onValueChange:f=>c({...d,status:f}),children:[o.jsx(Gt,{children:o.jsx(Zt,{})}),o.jsxs(Jt,{children:[o.jsx(Fe,{value:"draft",children:"Draft"}),o.jsx(Fe,{value:"published",children:"Published"})]})]})]})]}),o.jsxs("div",{children:[o.jsx(O,{htmlFor:"excerpt",children:"Excerpt"}),o.jsx(U,{id:"excerpt",value:d.excerpt,onChange:f=>c({...d,excerpt:f.target.value}),rows:2,placeholder:"Brief summary of the case study"})]}),o.jsxs("div",{children:[o.jsx(O,{htmlFor:"challenge",children:"Challenge"}),o.jsx(U,{id:"challenge",value:d.challenge,onChange:f=>c({...d,challenge:f.target.value}),rows:3,placeholder:"What challenges did the client face?"})]}),o.jsxs("div",{children:[o.jsx(O,{htmlFor:"solution",children:"Solution"}),o.jsx(U,{id:"solution",value:d.solution,onChange:f=>c({...d,solution:f.target.value}),rows:3,placeholder:"How did you solve their problems?"})]}),o.jsxs("div",{children:[o.jsx(O,{htmlFor:"results",children:"Results"}),o.jsx(U,{id:"results",value:d.results,onChange:f=>c({...d,results:f.target.value}),rows:3,placeholder:"What were the outcomes and achievements?"})]}),o.jsxs("div",{children:[o.jsx(O,{htmlFor:"content",children:"Full Content"}),o.jsx(U,{id:"content",value:d.content,onChange:f=>c({...d,content:f.target.value}),rows:6,placeholder:"Detailed case study content"})]}),o.jsxs("div",{children:[o.jsx(O,{htmlFor:"featured_image_url",children:"Featured Image URL"}),o.jsx(Q,{id:"featured_image_url",value:d.featured_image_url,onChange:f=>c({...d,featured_image_url:f.target.value}),placeholder:"https://example.com/image.jpg"})]}),o.jsxs("div",{children:[o.jsx(O,{htmlFor:"published_at",children:"Published Date"}),o.jsxs(hr,{children:[o.jsx(mr,{asChild:!0,children:o.jsxs(E,{variant:"outline",className:Y("w-full justify-start text-left font-normal",!d.published_at&&"text-muted-foreground"),children:[o.jsx(un,{className:"mr-2 h-4 w-4"}),d.published_at?L(d.published_at,"PPP"):o.jsx("span",{children:"Pick a date"})]})}),o.jsx(pt,{className:"w-auto p-0",align:"start",children:o.jsx(rt,{mode:"single",selected:d.published_at,onSelect:f=>c({...d,published_at:f||null}),initialFocus:!0,className:Y("p-3 pointer-events-auto")})})]})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(E,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),o.jsx(E,{type:"submit",children:i?"Update Case Study":"Create Case Study"})]})]})]})]})]})]}),o.jsx("div",{className:"space-y-4",children:e.length===0?o.jsx(Se,{children:o.jsx(Oe,{className:"text-center py-12",children:o.jsx("p",{className:"text-muted-foreground",children:"No case studies found. Create your first case study!"})})}):e.map(f=>o.jsxs(Se,{children:[o.jsx(Bt,{children:o.jsxs("div",{className:"flex justify-between items-start",children:[o.jsxs("div",{className:"flex-1",children:[o.jsx(Ht,{className:"text-lg",children:f.title}),o.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[o.jsx(ie,{className:N(f.status),children:f.status}),f.client_name&&o.jsx(ie,{variant:"outline",children:f.client_name}),f.industry&&o.jsx(ie,{variant:"outline",children:f.industry}),o.jsx("span",{className:"text-sm text-muted-foreground",children:j(f.created_at)})]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(E,{variant:"outline",size:"sm",onClick:()=>w(f),children:o.jsx(fn,{className:"h-4 w-4"})}),o.jsx(E,{variant:"outline",size:"sm",onClick:()=>_(f.id),children:o.jsx(vn,{className:"h-4 w-4"})})]})]})}),o.jsxs(Oe,{children:[f.excerpt&&o.jsx("p",{className:"text-muted-foreground mb-2",children:f.excerpt}),f.challenge&&o.jsxs("div",{className:"text-sm",children:[o.jsx("strong",{children:"Challenge:"})," ",f.challenge.substring(0,100),"..."]})]})]},f.id))})]})})]})})}export{Or as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.