1 line
63 KiB
JavaScript
1 line
63 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43359,e=>{"use strict";let t=(0,e.i(27706).default)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);e.s(["Users",()=>t],43359)},49326,e=>{"use strict";let t=(0,e.i(27706).default)("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["default",()=>t])},91258,e=>{"use strict";var t=e.i(49326);e.s(["Calendar",()=>t.default])},90432,7790,e=>{"use strict";var t=e.i(36792),r=e.i(97185),a=e.i(6315),a=a,n=e.i(69744);function i({...e}){return(0,t.jsx)(r.Root,{"data-slot":"dialog",...e})}function o({...e}){return(0,t.jsx)(r.Trigger,{"data-slot":"dialog-trigger",...e})}function s({...e}){return(0,t.jsx)(r.Portal,{"data-slot":"dialog-portal",...e})}function l({className:e,...a}){return(0,t.jsx)(r.Overlay,{"data-slot":"dialog-overlay",className:(0,n.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...a})}function d({className:e,children:i,showCloseButton:o=!0,...d}){return(0,t.jsxs)(s,{"data-slot":"dialog-portal",children:[(0,t.jsx)(l,{}),(0,t.jsxs)(r.Content,{"data-slot":"dialog-content",className:(0,n.cn)("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...d,children:[i,o&&(0,t.jsxs)(r.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,t.jsx)(a.default,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function c({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"dialog-header",className:(0,n.cn)("flex flex-col gap-2 text-center sm:text-left",e),...r})}function u({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"dialog-footer",className:(0,n.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r})}function h({className:e,...a}){return(0,t.jsx)(r.Title,{"data-slot":"dialog-title",className:(0,n.cn)("text-lg leading-none font-semibold",e),...a})}function m({className:e,...a}){return(0,t.jsx)(r.Description,{"data-slot":"dialog-description",className:(0,n.cn)("text-muted-foreground text-sm",e),...a})}e.s(["Dialog",()=>i,"DialogContent",()=>d,"DialogDescription",()=>m,"DialogFooter",()=>u,"DialogHeader",()=>c,"DialogTitle",()=>h,"DialogTrigger",()=>o],90432);let f=(0,e.i(27706).default)("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);e.s(["Edit",()=>f],7790)},89084,e=>{"use strict";e.s([],80266),e.i(80266);var t=e.i(6612),r=e.i(61611),a=e.i(94657),n=e.i(62157),i=e.i(5767),o=e.i(11707),s=e.i(47989),s=s,l=e.i(90653),d=e.i(33846),c=e.i(86905),u=e.i(62604),h=e.i(67323),m=e.i(84140),f=e.i(49565),g=e.i(35763),p=e.i(79633),p=p,x=e.i(30233),b=e.i(34769),v=e.i(83554),v=v,w=e.i(47566);e.s(["Arc",()=>g.Arc,"BezierCurve",()=>f.BezierCurve,"BoundingRect",()=>w.BoundingRect,"Circle",()=>o.Circle,"CompoundPath",()=>x.CompoundPath,"Ellipse",()=>s.default,"Group",()=>a.Group,"Image",()=>n.Image,"IncrementalDisplayable",()=>p.default,"Line",()=>m.Line,"LinearGradient",()=>b.LinearGradient,"Polygon",()=>c.Polygon,"Polyline",()=>u.Polyline,"RadialGradient",()=>v.default,"Rect",()=>h.Rect,"Ring",()=>d.Ring,"Sector",()=>l.Sector,"Text",()=>i.Text,"clipPointsByRect",()=>t.clipPointsByRect,"clipRectByRect",()=>t.clipRectByRect,"createIcon",()=>t.createIcon,"extendPath",()=>t.extendPath,"extendShape",()=>t.extendShape,"getShapeClass",()=>t.getShapeClass,"getTransform",()=>t.getTransform,"initProps",()=>r.initProps,"makeImage",()=>t.makeImage,"makePath",()=>t.makePath,"mergePath",()=>t.mergePath,"registerShape",()=>t.registerShape,"resizePath",()=>t.resizePath,"updateProps",()=>r.updateProps],89084)},86467,e=>{"use strict";var t;let r={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function a(e){return (t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}let n={date:a({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:a({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:a({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},i={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function o(e){return(t,r)=>{let a;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,n=r?.width?String(r.width):t;a=e.formattingValues[n]||e.formattingValues[t]}else{let t=e.defaultWidth,n=r?.width?String(r.width):e.defaultWidth;a=e.values[n]||e.values[t]}return a[e.argumentCallback?e.argumentCallback(t):t]}}function s(e){return(t,r={})=>{let a,n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;let s=o[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(l)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}(l,e=>e.test(s)):function(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}(l,e=>e.test(s));return a=e.valueCallback?e.valueCallback(d):d,{value:a=r.valueCallback?r.valueCallback(a):a,rest:t.slice(s.length)}}}let l={code:"en-US",formatDistance:(e,t,a)=>{let n,i=r[e];if(n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),a?.addSuffix)if(a.comparison&&a.comparison>0)return"in "+n;else return n+" ago";return n},formatLong:n,formatRelative:(e,t,r,a)=>i[e],localize:{ordinalNumber:(e,t)=>{let r=Number(e),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:o({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:o({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:o({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:o({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:o({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(t={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,r={})=>{let a=e.match(t.matchPattern);if(!a)return null;let n=a[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];return{value:o=r.valueCallback?r.valueCallback(o):o,rest:e.slice(n.length)}}),era:s({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:s({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:s({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:s({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},d={},c=Symbol.for("constructDateFrom");function u(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&c in e?e[c](t):e instanceof Date?new e.constructor(t):new Date(t)}function h(e,t){return u(t||e,e)}function m(e){let t=h(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),e-r}function f(e,t){let r=h(e,t?.in);return r.setHours(0,0,0,0),r}function g(e,t){let r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??d.weekStartsOn??d.locale?.options?.weekStartsOn??0,a=h(e,t?.in),n=a.getDay();return a.setDate(a.getDate()-(7*(n<r)+n-r)),a.setHours(0,0,0,0),a}function p(e,t){return g(e,{...t,weekStartsOn:1})}function x(e,t){let r=h(e,t?.in),a=r.getFullYear(),n=u(r,0);n.setFullYear(a+1,0,4),n.setHours(0,0,0,0);let i=p(n),o=u(r,0);o.setFullYear(a,0,4),o.setHours(0,0,0,0);let s=p(o);return r.getTime()>=i.getTime()?a+1:r.getTime()>=s.getTime()?a:a-1}function b(e,t){let r=h(e,t?.in),a=r.getFullYear(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??d.firstWeekContainsDate??d.locale?.options?.firstWeekContainsDate??1,i=u(t?.in||e,0);i.setFullYear(a+1,0,n),i.setHours(0,0,0,0);let o=g(i,t),s=u(t?.in||e,0);s.setFullYear(a,0,n),s.setHours(0,0,0,0);let l=g(s,t);return+r>=+o?a+1:+r>=+l?a:a-1}function v(e,t){let r=Math.abs(e).toString().padStart(t,"0");return(e<0?"-":"")+r}let w={y(e,t){let r=e.getFullYear(),a=r>0?r:1-r;return v("yy"===t?a%100:a,t.length)},M(e,t){let r=e.getMonth();return"M"===t?String(r+1):v(r+1,2)},d:(e,t)=>v(e.getDate(),t.length),a(e,t){let r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>v(e.getHours()%12||12,t.length),H:(e,t)=>v(e.getHours(),t.length),m:(e,t)=>v(e.getMinutes(),t.length),s:(e,t)=>v(e.getSeconds(),t.length),S(e,t){let r=t.length;return v(Math.trunc(e.getMilliseconds()*Math.pow(10,r-3)),t.length)}},y={G:function(e,t,r){let a=+(e.getFullYear()>0);switch(t){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});default:return r.era(a,{width:"wide"})}},y:function(e,t,r){if("yo"===t){let t=e.getFullYear();return r.ordinalNumber(t>0?t:1-t,{unit:"year"})}return w.y(e,t)},Y:function(e,t,r,a){let n=b(e,a),i=n>0?n:1-n;return"YY"===t?v(i%100,2):"Yo"===t?r.ordinalNumber(i,{unit:"year"}):v(i,t.length)},R:function(e,t){return v(x(e),t.length)},u:function(e,t){return v(e.getFullYear(),t.length)},Q:function(e,t,r){let a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return v(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,r){let a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return v(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,r){let a=e.getMonth();switch(t){case"M":case"MM":return w.M(e,t);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,r){let a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return v(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,r,a){let n,i,o,s,l=Math.round((g(n=h(e,a?.in),a)-(i=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??d.firstWeekContainsDate??d.locale?.options?.firstWeekContainsDate??1,o=b(n,a),(s=u(a?.in||n,0)).setFullYear(o,0,i),s.setHours(0,0,0,0),g(s,a)))/6048e5)+1;return"wo"===t?r.ordinalNumber(l,{unit:"week"}):v(l,t.length)},I:function(e,t,r){let a,n,i,o=Math.round((p(a=h(e,void 0))-(n=x(a,void 0),(i=u(a,0)).setFullYear(n,0,4),i.setHours(0,0,0,0),p(i)))/6048e5)+1;return"Io"===t?r.ordinalNumber(o,{unit:"week"}):v(o,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):w.d(e,t)},D:function(e,t,r){let a,n,i=function(e,t,r){let[a,n]=function(e,...t){let r=u.bind(null,e||t.find(e=>"object"==typeof e));return t.map(r)}(void 0,e,t),i=f(a),o=f(n);return Math.round((i-m(i)-(o-m(o)))/864e5)}(a=h(e,void 0),((n=h(a,void 0)).setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n))+1;return"Do"===t?r.ordinalNumber(i,{unit:"dayOfYear"}):v(i,t.length)},E:function(e,t,r){let a=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,r,a){let n=e.getDay(),i=(n-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return v(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},c:function(e,t,r,a){let n=e.getDay(),i=(n-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return v(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(n,{width:"narrow",context:"standalone"});case"cccccc":return r.day(n,{width:"short",context:"standalone"});default:return r.day(n,{width:"wide",context:"standalone"})}},i:function(e,t,r){let a=e.getDay(),n=0===a?7:a;switch(t){case"i":return String(n);case"ii":return v(n,t.length);case"io":return r.ordinalNumber(n,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,r){let a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){let a,n=e.getHours();switch(a=12===n?"noon":0===n?"midnight":n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){let a,n=e.getHours();switch(a=n>=17?"evening":n>=12?"afternoon":n>=4?"morning":"night",t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return w.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):w.H(e,t)},K:function(e,t,r){let a=e.getHours()%12;return"Ko"===t?r.ordinalNumber(a,{unit:"hour"}):v(a,t.length)},k:function(e,t,r){let a=e.getHours();return(0===a&&(a=24),"ko"===t)?r.ordinalNumber(a,{unit:"hour"}):v(a,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):w.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):w.s(e,t)},S:function(e,t){return w.S(e,t)},X:function(e,t,r){let a=e.getTimezoneOffset();if(0===a)return"Z";switch(t){case"X":return N(a);case"XXXX":case"XX":return C(a);default:return C(a,":")}},x:function(e,t,r){let a=e.getTimezoneOffset();switch(t){case"x":return N(a);case"xxxx":case"xx":return C(a);default:return C(a,":")}},O:function(e,t,r){let a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+j(a,":");default:return"GMT"+C(a,":")}},z:function(e,t,r){let a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+j(a,":");default:return"GMT"+C(a,":")}},t:function(e,t,r){return v(Math.trunc(e/1e3),t.length)},T:function(e,t,r){return v(+e,t.length)}};function j(e,t=""){let r=e>0?"-":"+",a=Math.abs(e),n=Math.trunc(a/60),i=a%60;return 0===i?r+String(n):r+String(n)+t+v(i,2)}function N(e,t){return e%60==0?(e>0?"-":"+")+v(Math.abs(e)/60,2):C(e,t)}function C(e,t=""){let r=Math.abs(e);return(e>0?"-":"+")+v(Math.trunc(r/60),2)+t+v(r%60,2)}let S=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},D=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},T={p:D,P:(e,t)=>{let r,a=e.match(/(P+)(p+)?/)||[],n=a[1],i=a[2];if(!i)return S(e,t);switch(n){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",S(n,t)).replace("{{time}}",D(i,t))}},P=/^D+$/,k=/^Y+$/,E=["D","DD","YY","YYYY"],M=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,R=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,L=/^'([^]*?)'?$/,W=/''/g,H=/[a-zA-Z]/;function O(e,t,r){let a=r?.locale??d.locale??l,n=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??d.firstWeekContainsDate??d.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??d.weekStartsOn??d.locale?.options?.weekStartsOn??0,o=h(e,r?.in);if(!(o instanceof Date||"object"==typeof o&&"[object Date]"===Object.prototype.toString.call(o))&&"number"!=typeof o||isNaN(+h(o)))throw RangeError("Invalid time value");let s=t.match(R).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,T[t])(e,a.formatLong):e}).join("").match(M).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let t=e[0];if("'"===t){var r;let t;return{isToken:!1,value:(t=(r=e).match(L))?t[1].replace(W,"'"):r}}if(y[t])return{isToken:!0,value:e};if(t.match(H))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});a.localize.preprocessor&&(s=a.localize.preprocessor(o,s));let c={firstWeekContainsDate:n,weekStartsOn:i,locale:a};return s.map(n=>{if(!n.isToken)return n.value;let i=n.value;return(!r?.useAdditionalWeekYearTokens&&k.test(i)||!r?.useAdditionalDayOfYearTokens&&P.test(i))&&function(e,t,r){var a,n,i;let o,s=(a=e,n=t,i=r,o="Y"===a[0]?"years":"days of the month",`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${n}\`) for formatting ${o} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(s),E.includes(e))throw RangeError(s)}(i,t,String(e)),(0,y[i[0]])(o,i,a.localize,c)}).join("")}e.s(["format",()=>O],86467)},43840,e=>{"use strict";var t=e.i(36792),r=e.i(34346),a=e.i(14268),n=e.i(19594),i=e.i(57213),o=e.i(6580),s=e.i(60515),l=e.i(79096),d=e.i(42668),c=e.i(20998),u=e.i(82502),h="ScrollArea",[m,f]=(0,i.createContextScope)(h),[g,p]=m(h),x=r.forwardRef((e,n)=>{let{__scopeScrollArea:i,type:s="hover",dir:d,scrollHideDelay:c=600,...u}=e,[h,m]=r.useState(null),[f,p]=r.useState(null),[x,b]=r.useState(null),[v,w]=r.useState(null),[y,j]=r.useState(null),[N,C]=r.useState(0),[S,D]=r.useState(0),[T,P]=r.useState(!1),[k,E]=r.useState(!1),M=(0,o.useComposedRefs)(n,e=>m(e)),R=(0,l.useDirection)(d);return(0,t.jsx)(g,{scope:i,type:s,dir:R,scrollHideDelay:c,scrollArea:h,viewport:f,onViewportChange:p,content:x,onContentChange:b,scrollbarX:v,onScrollbarXChange:w,scrollbarXEnabled:T,onScrollbarXEnabledChange:P,scrollbarY:y,onScrollbarYChange:j,scrollbarYEnabled:k,onScrollbarYEnabledChange:E,onCornerWidthChange:C,onCornerHeightChange:D,children:(0,t.jsx)(a.Primitive.div,{dir:R,...u,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})});x.displayName=h;var b="ScrollAreaViewport",v=r.forwardRef((e,n)=>{let{__scopeScrollArea:i,children:s,nonce:l,...d}=e,c=p(b,i),u=r.useRef(null),h=(0,o.useComposedRefs)(n,u,c.onViewportChange);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),(0,t.jsx)(a.Primitive.div,{"data-radix-scroll-area-viewport":"",...d,ref:h,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,t.jsx)("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});v.displayName=b;var w="ScrollAreaScrollbar",y=r.forwardRef((e,a)=>{let{forceMount:n,...i}=e,o=p(w,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=o,d="horizontal"===e.orientation;return r.useEffect(()=>(d?s(!0):l(!0),()=>{d?s(!1):l(!1)}),[d,s,l]),"hover"===o.type?(0,t.jsx)(j,{...i,ref:a,forceMount:n}):"scroll"===o.type?(0,t.jsx)(N,{...i,ref:a,forceMount:n}):"auto"===o.type?(0,t.jsx)(C,{...i,ref:a,forceMount:n}):"always"===o.type?(0,t.jsx)(S,{...i,ref:a}):null});y.displayName=w;var j=r.forwardRef((e,a)=>{let{forceMount:i,...o}=e,s=p(w,e.__scopeScrollArea),[l,d]=r.useState(!1);return r.useEffect(()=>{let e=s.scrollArea,t=0;if(e){let r=()=>{window.clearTimeout(t),d(!0)},a=()=>{t=window.setTimeout(()=>d(!1),s.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",a),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",a)}}},[s.scrollArea,s.scrollHideDelay]),(0,t.jsx)(n.Presence,{present:i||l,children:(0,t.jsx)(C,{"data-state":l?"visible":"hidden",...o,ref:a})})}),N=r.forwardRef((e,a)=>{var i;let{forceMount:o,...s}=e,l=p(w,e.__scopeScrollArea),d="horizontal"===e.orientation,c=q(()=>m("SCROLL_END"),100),[h,m]=(i={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},r.useReducer((e,t)=>i[e][t]??e,"hidden"));return r.useEffect(()=>{if("idle"===h){let e=window.setTimeout(()=>m("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(e)}},[h,l.scrollHideDelay,m]),r.useEffect(()=>{let e=l.viewport,t=d?"scrollLeft":"scrollTop";if(e){let r=e[t],a=()=>{let a=e[t];r!==a&&(m("SCROLL"),c()),r=a};return e.addEventListener("scroll",a),()=>e.removeEventListener("scroll",a)}},[l.viewport,d,m,c]),(0,t.jsx)(n.Presence,{present:o||"hidden"!==h,children:(0,t.jsx)(S,{"data-state":"hidden"===h?"hidden":"visible",...s,ref:a,onPointerEnter:(0,u.composeEventHandlers)(e.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:(0,u.composeEventHandlers)(e.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),C=r.forwardRef((e,a)=>{let i=p(w,e.__scopeScrollArea),{forceMount:o,...s}=e,[l,d]=r.useState(!1),c="horizontal"===e.orientation,u=q(()=>{if(i.viewport){let e=i.viewport.offsetWidth<i.viewport.scrollWidth,t=i.viewport.offsetHeight<i.viewport.scrollHeight;d(c?e:t)}},10);return B(i.viewport,u),B(i.content,u),(0,t.jsx)(n.Presence,{present:o||l,children:(0,t.jsx)(S,{"data-state":l?"visible":"hidden",...s,ref:a})})}),S=r.forwardRef((e,a)=>{let{orientation:n="vertical",...i}=e,o=p(w,e.__scopeScrollArea),s=r.useRef(null),l=r.useRef(0),[d,c]=r.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Y(d.viewport,d.content),h={...i,sizes:d,onSizesChange:c,hasThumb:!!(u>0&&u<1),onThumbChange:e=>s.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function m(e,t){return function(e,t,r,a="ltr"){let n=z(r),i=t||n/2,o=r.scrollbar.paddingStart+i,s=r.scrollbar.size-r.scrollbar.paddingEnd-(n-i),l=r.content-r.viewport;return I([o,s],"ltr"===a?[0,l]:[-1*l,0])(e)}(e,l.current,d,t)}return"horizontal"===n?(0,t.jsx)(D,{...h,ref:a,onThumbPositionChange:()=>{if(o.viewport&&s.current){let e=F(o.viewport.scrollLeft,d,o.dir);s.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollLeft=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollLeft=m(e,o.dir))}}):"vertical"===n?(0,t.jsx)(T,{...h,ref:a,onThumbPositionChange:()=>{if(o.viewport&&s.current){let e=F(o.viewport.scrollTop,d);s.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollTop=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollTop=m(e))}}):null}),D=r.forwardRef((e,a)=>{let{sizes:n,onSizesChange:i,...s}=e,l=p(w,e.__scopeScrollArea),[d,c]=r.useState(),u=r.useRef(null),h=(0,o.useComposedRefs)(a,u,l.onScrollbarXChange);return r.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),(0,t.jsx)(E,{"data-orientation":"horizontal",...s,ref:h,sizes:n,style:{bottom:0,left:"rtl"===l.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===l.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":z(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(l.viewport){var a,n;let i=l.viewport.scrollLeft+t.deltaX;e.onWheelScroll(i),a=i,n=r,a>0&&a<n&&t.preventDefault()}},onResize:()=>{u.current&&l.viewport&&d&&i({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:A(d.paddingLeft),paddingEnd:A(d.paddingRight)}})}})}),T=r.forwardRef((e,a)=>{let{sizes:n,onSizesChange:i,...s}=e,l=p(w,e.__scopeScrollArea),[d,c]=r.useState(),u=r.useRef(null),h=(0,o.useComposedRefs)(a,u,l.onScrollbarYChange);return r.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),(0,t.jsx)(E,{"data-orientation":"vertical",...s,ref:h,sizes:n,style:{top:0,right:"ltr"===l.dir?0:void 0,left:"rtl"===l.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":z(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(l.viewport){var a,n;let i=l.viewport.scrollTop+t.deltaY;e.onWheelScroll(i),a=i,n=r,a>0&&a<n&&t.preventDefault()}},onResize:()=>{u.current&&l.viewport&&d&&i({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:A(d.paddingTop),paddingEnd:A(d.paddingBottom)}})}})}),[P,k]=m(w),E=r.forwardRef((e,n)=>{let{__scopeScrollArea:i,sizes:l,hasThumb:d,onThumbChange:c,onThumbPointerUp:h,onThumbPointerDown:m,onThumbPositionChange:f,onDragScroll:g,onWheelScroll:x,onResize:b,...v}=e,y=p(w,i),[j,N]=r.useState(null),C=(0,o.useComposedRefs)(n,e=>N(e)),S=r.useRef(null),D=r.useRef(""),T=y.viewport,k=l.content-l.viewport,E=(0,s.useCallbackRef)(x),M=(0,s.useCallbackRef)(f),R=q(b,10);function L(e){S.current&&g({x:e.clientX-S.current.left,y:e.clientY-S.current.top})}return r.useEffect(()=>{let e=e=>{let t=e.target;j?.contains(t)&&E(e,k)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[T,j,k,E]),r.useEffect(M,[l,M]),B(j,R),B(y.content,R),(0,t.jsx)(P,{scope:i,scrollbar:j,hasThumb:d,onThumbChange:(0,s.useCallbackRef)(c),onThumbPointerUp:(0,s.useCallbackRef)(h),onThumbPositionChange:M,onThumbPointerDown:(0,s.useCallbackRef)(m),children:(0,t.jsx)(a.Primitive.div,{...v,ref:C,style:{position:"absolute",...v.style},onPointerDown:(0,u.composeEventHandlers)(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),S.current=j.getBoundingClientRect(),D.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),L(e))}),onPointerMove:(0,u.composeEventHandlers)(e.onPointerMove,L),onPointerUp:(0,u.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=D.current,y.viewport&&(y.viewport.style.scrollBehavior=""),S.current=null})})})}),M="ScrollAreaThumb",R=r.forwardRef((e,r)=>{let{forceMount:a,...i}=e,o=k(M,e.__scopeScrollArea);return(0,t.jsx)(n.Presence,{present:a||o.hasThumb,children:(0,t.jsx)(L,{ref:r,...i})})}),L=r.forwardRef((e,n)=>{let{__scopeScrollArea:i,style:s,...l}=e,d=p(M,i),c=k(M,i),{onThumbPositionChange:h}=c,m=(0,o.useComposedRefs)(n,e=>c.onThumbChange(e)),f=r.useRef(void 0),g=q(()=>{f.current&&(f.current(),f.current=void 0)},100);return r.useEffect(()=>{let e=d.viewport;if(e){let t=()=>{g(),f.current||(f.current=$(e,h),h())};return h(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[d.viewport,g,h]),(0,t.jsx)(a.Primitive.div,{"data-state":c.hasThumb?"visible":"hidden",...l,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:(0,u.composeEventHandlers)(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),r=e.clientX-t.left,a=e.clientY-t.top;c.onThumbPointerDown({x:r,y:a})}),onPointerUp:(0,u.composeEventHandlers)(e.onPointerUp,c.onThumbPointerUp)})});R.displayName=M;var W="ScrollAreaCorner",H=r.forwardRef((e,r)=>{let a=p(W,e.__scopeScrollArea),n=!!(a.scrollbarX&&a.scrollbarY);return"scroll"!==a.type&&n?(0,t.jsx)(O,{...e,ref:r}):null});H.displayName=W;var O=r.forwardRef((e,n)=>{let{__scopeScrollArea:i,...o}=e,s=p(W,i),[l,d]=r.useState(0),[c,u]=r.useState(0),h=!!(l&&c);return B(s.scrollbarX,()=>{let e=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(e),u(e)}),B(s.scrollbarY,()=>{let e=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(e),d(e)}),h?(0,t.jsx)(a.Primitive.div,{...o,ref:n,style:{width:l,height:c,position:"absolute",right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:0,...e.style}}):null});function A(e){return e?parseInt(e,10):0}function Y(e,t){let r=e/t;return isNaN(r)?0:r}function z(e){let t=Y(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-r)*t,18)}function F(e,t,r="ltr"){let a=z(t),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-n,o=t.content-t.viewport,s=(0,c.clamp)(e,"ltr"===r?[0,o]:[-1*o,0]);return I([0,o],[0,i-a])(s)}function I(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(r-e[0])}}var $=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},a=0;return!function n(){let i={left:e.scrollLeft,top:e.scrollTop},o=r.left!==i.left,s=r.top!==i.top;(o||s)&&t(),r=i,a=window.requestAnimationFrame(n)}(),()=>window.cancelAnimationFrame(a)};function q(e,t){let a=(0,s.useCallbackRef)(e),n=r.useRef(0);return r.useEffect(()=>()=>window.clearTimeout(n.current),[]),r.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(a,t)},[a,t])}function B(e,t){let r=(0,s.useCallbackRef)(t);(0,d.useLayoutEffect)(()=>{let t=0;if(e){let a=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return a.observe(e),()=>{window.cancelAnimationFrame(t),a.unobserve(e)}}},[e,r])}var _=e.i(69744);function U({className:e,children:r,...a}){return(0,t.jsxs)(x,{"data-slot":"scroll-area",className:(0,_.cn)("relative",e),...a,children:[(0,t.jsx)(v,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:r}),(0,t.jsx)(G,{}),(0,t.jsx)(H,{})]})}function G({className:e,orientation:r="vertical",...a}){return(0,t.jsx)(y,{"data-slot":"scroll-area-scrollbar",orientation:r,className:(0,_.cn)("flex touch-none p-px transition-colors select-none","vertical"===r&&"h-full w-2.5 border-l border-l-transparent","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent",e),...a,children:(0,t.jsx)(R,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}e.s(["ScrollArea",()=>U],43840)},33483,e=>{"use strict";var t=e.i(36792),r=e.i(34346),a=e.i(82502),n=e.i(57213),i=e.i(88434),o=e.i(19594),s=e.i(14268),l=e.i(79096),d=e.i(53607),c=e.i(21471),u="Tabs",[h,m]=(0,n.createContextScope)(u,[i.createRovingFocusGroupScope]),f=(0,i.createRovingFocusGroupScope)(),[g,p]=h(u),x=r.forwardRef((e,r)=>{let{__scopeTabs:a,value:n,onValueChange:i,defaultValue:o,orientation:u="horizontal",dir:h,activationMode:m="automatic",...f}=e,p=(0,l.useDirection)(h),[x,b]=(0,d.useControllableState)({prop:n,onChange:i,defaultProp:o});return(0,t.jsx)(g,{scope:a,baseId:(0,c.useId)(),value:x,onValueChange:b,orientation:u,dir:p,activationMode:m,children:(0,t.jsx)(s.Primitive.div,{dir:p,"data-orientation":u,...f,ref:r})})});x.displayName=u;var b="TabsList",v=r.forwardRef((e,r)=>{let{__scopeTabs:a,loop:n=!0,...o}=e,l=p(b,a),d=f(a);return(0,t.jsx)(i.Root,{asChild:!0,...d,orientation:l.orientation,dir:l.dir,loop:n,children:(0,t.jsx)(s.Primitive.div,{role:"tablist","aria-orientation":l.orientation,...o,ref:r})})});v.displayName=b;var w="TabsTrigger",y=r.forwardRef((e,r)=>{let{__scopeTabs:n,value:o,disabled:l=!1,...d}=e,c=p(w,n),u=f(n),h=C(c.baseId,o),m=S(c.baseId,o),g=o===c.value;return(0,t.jsx)(i.Item,{asChild:!0,...u,focusable:!l,active:g,children:(0,t.jsx)(s.Primitive.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":m,"data-state":g?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:h,...d,ref:r,onMouseDown:(0,a.composeEventHandlers)(e.onMouseDown,e=>{l||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(o)}),onKeyDown:(0,a.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(o)}),onFocus:(0,a.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==c.activationMode;g||l||!e||c.onValueChange(o)})})})});y.displayName=w;var j="TabsContent",N=r.forwardRef((e,a)=>{let{__scopeTabs:n,value:i,forceMount:l,children:d,...c}=e,u=p(j,n),h=C(u.baseId,i),m=S(u.baseId,i),f=i===u.value,g=r.useRef(f);return r.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(o.Presence,{present:l||f,children:({present:r})=>(0,t.jsx)(s.Primitive.div,{"data-state":f?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":h,hidden:!r,id:m,tabIndex:0,...c,ref:a,style:{...e.style,animationDuration:g.current?"0s":void 0},children:r&&d})})});function C(e,t){return`${e}-trigger-${t}`}function S(e,t){return`${e}-content-${t}`}N.displayName=j;var D=e.i(69744);function T({className:e,...r}){return(0,t.jsx)(x,{"data-slot":"tabs",className:(0,D.cn)("flex flex-col gap-2",e),...r})}function P({className:e,...r}){return(0,t.jsx)(v,{"data-slot":"tabs-list",className:(0,D.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...r})}function k({className:e,...r}){return(0,t.jsx)(y,{"data-slot":"tabs-trigger",className:(0,D.cn)("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function E({className:e,...r}){return(0,t.jsx)(N,{"data-slot":"tabs-content",className:(0,D.cn)("flex-1 outline-none",e),...r})}e.s(["Tabs",()=>T,"TabsContent",()=>E,"TabsList",()=>P,"TabsTrigger",()=>k],33483)},90288,e=>{"use strict";let t=(0,e.i(27706).default)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);e.s(["ArrowRight",()=>t],90288)},49954,e=>{"use strict";let t=(0,e.i(27706).default)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);e.s(["Clock",()=>t],49954)},38315,e=>{"use strict";var t=e.i(36792),r=e.i(3965),a=e.i(9991),n=e.i(10743),i=e.i(82772),o=e.i(43840),s=e.i(33483),l=e.i(27706);let d=(0,l.default)("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);var c=e.i(32301),u=e.i(91258),h=e.i(43359),m=e.i(90288),f=e.i(49954),g=e.i(92879),p=e.i(34346);e.i(75246);var x=e.i(12908),b=e.i(89084),b=b;function v({members:e}){let r=(0,p.useRef)(null),a=(0,p.useRef)(null),i=(0,p.useRef)(null),o=(0,p.useRef)(null);return(0,p.useEffect)(()=>{if(!r.current||0===e.length)return;let t=x.init(r.current),a={male:e.filter(e=>"male"===e.gender).length,female:e.filter(e=>"female"===e.gender).length,other:e.filter(e=>"other"===e.gender).length};return t.setOption({title:{text:"性别分布",left:"center",top:10,textStyle:{fontSize:14,fontWeight:"normal"}},tooltip:{trigger:"item",formatter:"{b}: {c} 人 ({d}%)"},legend:{bottom:10,left:"center"},series:[{type:"pie",radius:["40%","70%"],center:["50%","50%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:10,borderColor:"#fff",borderWidth:2},label:{show:!1},emphasis:{label:{show:!0,fontSize:16,fontWeight:"bold"}},data:[{value:a.male,name:"男性",itemStyle:{color:"#3b82f6"}},{value:a.female,name:"女性",itemStyle:{color:"#ec4899"}},...a.other>0?[{value:a.other,name:"其他",itemStyle:{color:"#8b5cf6"}}]:[]]}]}),()=>{t.dispose()}},[e]),(0,p.useEffect)(()=>{if(!a.current||0===e.length)return;let t=x.init(a.current),r=new Map;e.forEach(e=>{let t=e.generation||0;r.set(t,(r.get(t)||0)+1)});let n=Array.from(r.entries()).sort((e,t)=>e[0]-t[0]);return t.setOption({title:{text:"世代分布",left:"center",top:10,textStyle:{fontSize:14,fontWeight:"normal"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:"{b}世: {c} 人"},grid:{left:"3%",right:"4%",bottom:"3%",top:"15%",containLabel:!0},xAxis:{type:"category",data:n.map(([e])=>`第${e}世`),axisLabel:{rotate:45}},yAxis:{type:"value",name:"人数"},series:[{type:"bar",data:n.map(([,e])=>e),itemStyle:{color:new b.LinearGradient(0,0,0,1,[{offset:0,color:"#83bff6"},{offset:.5,color:"#188df0"},{offset:1,color:"#188df0"}])},emphasis:{itemStyle:{color:new b.LinearGradient(0,0,0,1,[{offset:0,color:"#2378f7"},{offset:.7,color:"#2378f7"},{offset:1,color:"#83bff6"}])}}}]}),()=>{t.dispose()}},[e]),(0,p.useEffect)(()=>{if(!i.current||0===e.length)return;let t=x.init(i.current),r=new Date().getFullYear(),a={"0-18":0,"19-35":0,"36-50":0,"51-65":0,"66+":0,已故:0};return e.forEach(e=>{if(e.deathDate)a["已故"]++;else if(e.birthDate){let t=r-new Date(e.birthDate).getFullYear();t<=18?a["0-18"]++:t<=35?a["19-35"]++:t<=50?a["36-50"]++:t<=65?a["51-65"]++:a["66+"]++}}),t.setOption({title:{text:"年龄分布",left:"center",top:10,textStyle:{fontSize:14,fontWeight:"normal"}},tooltip:{trigger:"item",formatter:"{b}: {c} 人 ({d}%)"},legend:{bottom:10,left:"center"},series:[{type:"pie",radius:"60%",center:["50%","50%"],data:Object.entries(a).filter(([,e])=>e>0).map(([e,t])=>({name:e,value:t})),emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}),()=>{t.dispose()}},[e]),(0,p.useEffect)(()=>{if(!o.current||0===e.length)return;let t=x.init(o.current),r=new Map;e.forEach(e=>{if(e.birthDate){let t=new Date(e.birthDate).getFullYear();if(t>=1900){let e=10*Math.floor(t/10);r.set(e,(r.get(e)||0)+1)}}});let a=Array.from(r.entries()).sort((e,t)=>e[0]-t[0]);return t.setOption({title:{text:"出生年代分布",left:"center",top:10,textStyle:{fontSize:14,fontWeight:"normal"}},tooltip:{trigger:"axis",formatter:"{b}年代: {c} 人"},grid:{left:"3%",right:"4%",bottom:"3%",top:"15%",containLabel:!0},xAxis:{type:"category",data:a.map(([e])=>`${e}s`),axisLabel:{rotate:45}},yAxis:{type:"value",name:"人数"},series:[{type:"line",data:a.map(([,e])=>e),smooth:!0,areaStyle:{color:new b.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(99, 102, 241, 0.5)"},{offset:1,color:"rgba(99, 102, 241, 0.1)"}])},lineStyle:{color:"#6366f1",width:2},itemStyle:{color:"#6366f1"}}]}),()=>{t.dispose()}},[e]),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsxs)(n.Card,{children:[(0,t.jsxs)(n.CardHeader,{children:[(0,t.jsx)(n.CardTitle,{children:"性别分布"}),(0,t.jsx)(n.CardDescription,{children:"家族成员性别比例"})]}),(0,t.jsx)(n.CardContent,{children:(0,t.jsx)("div",{ref:r,className:"h-[300px]"})})]}),(0,t.jsxs)(n.Card,{children:[(0,t.jsxs)(n.CardHeader,{children:[(0,t.jsx)(n.CardTitle,{children:"世代分布"}),(0,t.jsx)(n.CardDescription,{children:"各世代人数统计"})]}),(0,t.jsx)(n.CardContent,{children:(0,t.jsx)("div",{ref:a,className:"h-[300px]"})})]}),(0,t.jsxs)(n.Card,{children:[(0,t.jsxs)(n.CardHeader,{children:[(0,t.jsx)(n.CardTitle,{children:"年龄分布"}),(0,t.jsx)(n.CardDescription,{children:"按年龄段划分的人数"})]}),(0,t.jsx)(n.CardContent,{children:(0,t.jsx)("div",{ref:i,className:"h-[300px]"})})]}),(0,t.jsxs)(n.Card,{children:[(0,t.jsxs)(n.CardHeader,{children:[(0,t.jsx)(n.CardTitle,{children:"出生年代分布"}),(0,t.jsx)(n.CardDescription,{children:"各年代出生人数趋势"})]}),(0,t.jsx)(n.CardContent,{children:(0,t.jsx)("div",{ref:o,className:"h-[300px]"})})]})]})}var w=e.i(86467),y=e.i(87830),j=e.i(90432),N=e.i(77627),C=e.i(75985),S=e.i(50314),D=e.i(59786),T=e.i(34072);let P=(0,l.default)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var k=e.i(7790),E=e.i(12039),M=e.i(75212);function R(){let{data:e}=(0,y.useSession)(),{currentTree:r}=(0,g.useFamily)(),{showConfirm:n,showAlert:i}=(0,M.useDialog)(),[o,s]=(0,p.useState)(!1),[l,d]=(0,p.useState)([]),[c,u]=(0,p.useState)(!1),[m,f]=(0,p.useState)(""),[x,b]=(0,p.useState)("VIEWER"),[v,w]=(0,p.useState)(""),[R,L]=(0,p.useState)(""),[W,H]=(0,p.useState)("");(0,p.useEffect)(()=>{o&&r?.id&&O()},[o,r?.id]);let O=async()=>{if(r?.id)try{let e=await fetch(`/api/trees/${r.id}/collaborators`);if(e.ok){let t=await e.json();d(t.collaborators)}}catch(e){console.error("加载协作者失败:",e)}},A=async e=>{if(e.preventDefault(),r?.id){u(!0),L(""),H("");try{let e=await fetch(`/api/trees/${r.id}/invite`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:m,role:x,password:v||void 0})}),t=await e.json();if(!e.ok)throw Error(t.error||"邀请失败");H(t.message),f(""),w(""),O()}catch(e){L(e.message)}finally{u(!1)}}},Y=async e=>{if(r?.id&&await n("确定要移除此协作者吗?","移除协作者"))try{if(!(await fetch(`/api/trees/${r.id}/collaborators?userId=${e}`,{method:"DELETE"})).ok)throw Error("移除失败");O()}catch(e){console.error(e),await i("移除失败","错误")}};return r&&r.ownerId===e?.user?.id?(0,t.jsxs)(j.Dialog,{open:o,onOpenChange:s,children:[(0,t.jsx)(j.DialogTrigger,{asChild:!0,children:(0,t.jsxs)(a.Button,{variant:"outline",className:"gap-2",children:[(0,t.jsx)(h.Users,{className:"h-4 w-4"}),"协作管理"]})}),(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-[600px]",children:[(0,t.jsxs)(j.DialogHeader,{children:[(0,t.jsxs)(j.DialogTitle,{children:["协作管理 - ",r.name]}),(0,t.jsx)(j.DialogDescription,{children:"邀请其他用户协作编辑或查看您的家族树。"})]}),(0,t.jsxs)("div",{className:"space-y-6 py-4",children:[(0,t.jsxs)("form",{onSubmit:A,className:"space-y-4 border-b pb-6",children:[(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(C.Label,{htmlFor:"email",children:"邮箱地址"}),(0,t.jsx)(N.Input,{id:"email",type:"email",placeholder:"输入对方邮箱",value:m,onChange:e=>f(e.target.value),required:!0})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(C.Label,{htmlFor:"role",children:"权限角色"}),(0,t.jsxs)(S.Select,{value:x,onValueChange:e=>b(e),children:[(0,t.jsx)(S.SelectTrigger,{children:(0,t.jsx)(S.SelectValue,{})}),(0,t.jsxs)(S.SelectContent,{children:[(0,t.jsx)(S.SelectItem,{value:"EDITOR",children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(k.Edit,{className:"mr-2 h-4 w-4"}),"编辑者 (可以增删改)"]})}),(0,t.jsx)(S.SelectItem,{value:"VIEWER",children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(P,{className:"mr-2 h-4 w-4"}),"查看者 (只读)"]})})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,t.jsx)(C.Label,{htmlFor:"password",children:"初始密码 (仅新用户)"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(N.Input,{id:"password",type:"text",placeholder:"为新用户设置密码(可选)",value:v,onChange:e=>w(e.target.value),minLength:6,className:"flex-1"}),(0,t.jsx)(a.Button,{type:"submit",disabled:c,children:c?"处理中...":"发送邀请"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"如果是现有用户,此密码将被忽略。"})]})]}),R&&(0,t.jsxs)(E.Alert,{variant:"destructive",children:[(0,t.jsx)(E.AlertTitle,{children:"错误"}),(0,t.jsx)(E.AlertDescription,{children:R})]}),W&&(0,t.jsxs)(E.Alert,{className:"bg-green-50 text-green-700 border-green-200",children:[(0,t.jsx)(E.AlertTitle,{children:"成功"}),(0,t.jsx)(E.AlertDescription,{children:W})]})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("h3",{className:"font-medium text-sm text-muted-foreground",children:"现有协作者"}),0===l.length?(0,t.jsx)("div",{className:"text-center py-8 text-muted-foreground border border-dashed rounded-lg",children:"暂无协作者"}):(0,t.jsx)("div",{className:"space-y-2 max-h-[300px] overflow-y-auto pr-2",children:l.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-muted/30",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(D.Avatar,{className:"h-9 w-9 border border-border",children:(0,t.jsx)(D.AvatarFallback,{children:e.user.name?.charAt(0).toUpperCase()||e.user.email.charAt(0).toUpperCase()})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium text-sm",children:e.user.name||"用户"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:e.user.email})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:`text-[10px] px-2 py-0.5 rounded-full border ${"EDITOR"===e.role?"bg-blue-50 text-blue-700 border-blue-200":"bg-gray-50 text-gray-700 border-gray-200"}`,children:"EDITOR"===e.role?"编辑者":"查看者"}),(0,t.jsx)(a.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:()=>Y(e.userId),children:(0,t.jsx)(T.Trash2,{className:"h-4 w-4"})})]})]},e.id))})]})]})]})]}):null}function L(){let e,l,x,b,{treeData:j,isLoading:N,currentTree:C}=(0,g.useFamily)(),{data:S}=(0,y.useSession)(),[D,T]=(0,p.useState)([]);(0,p.useEffect)(()=>{C?.id&&S?.user?.id?fetch(`/api/trees/${C.id}/activity-logs?limit=10`).then(e=>{if(!e.ok)throw Error("获取活动日志失败");return e.json()}).then(e=>{e.logs&&T(e.logs)}).catch(e=>{console.error("获取活动日志失败:",e),T([])}):T([])},[C?.id,S?.user?.id]);let P=(0,p.useMemo)(()=>{let e=Object.values(j.members),t=e.length,r=e.map(e=>e.generation||0),a=r.length>0?Math.max(...r):0,n=e.map(e=>e.birthDate?new Date(e.birthDate).getFullYear():null).filter(e=>null!==e),i=n.length>0?Math.min(...n):new Date().getFullYear();return{totalMembers:t,maxGeneration:a,yearsSpan:n.length>0?new Date().getFullYear()-i:0,earliestYear:i}},[j]);(0,p.useMemo)(()=>Object.values(j.members).sort((e,t)=>parseInt(t.id)-parseInt(e.id)).slice(0,5),[j]);let k=(0,p.useMemo)(()=>{let e=new Date().getMonth()+1,t=Object.values(j.members),r=[];return t.forEach(t=>{if(t.birthDate){let a=new Date(t.birthDate).getMonth()+1,n=new Date(t.birthDate).getDate();a===e&&r.push({member:t,type:"birth",date:t.birthDate,day:n})}if(t.deathDate){let a=new Date(t.deathDate).getMonth()+1,n=new Date(t.deathDate).getDate();a===e&&r.push({member:t,type:"death",date:t.deathDate,day:n})}}),r.sort((e,t)=>e.day-t.day).slice(0,5)},[j]);return(0,t.jsxs)("div",{className:"flex min-h-screen flex-col bg-background font-sans",children:[(0,t.jsx)(i.SiteHeader,{}),(0,t.jsxs)("main",{className:"flex-1 container mx-auto py-8 px-4 md:px-6",children:[(0,t.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4 mb-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("h1",{className:"text-3xl font-serif font-bold text-foreground",children:C?.name||"家族族谱"}),C?.currentUserRole&&(0,t.jsx)("span",{className:`text-xs px-2 py-1 rounded-full border font-sans font-normal translate-y-[2px] ${"OWNER"===C.currentUserRole?"bg-purple-100 text-purple-700 border-purple-200":"EDITOR"===C.currentUserRole?"bg-blue-100 text-blue-700 border-blue-200":"bg-gray-100 text-gray-700 border-gray-200"}`,children:"OWNER"===C.currentUserRole?"所有者":"EDITOR"===C.currentUserRole?"编辑者":"查看者"})]}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-1",children:[C?.description||"记录家族历史,传承家族文化",P.maxGeneration>0&&` \xb7 第 ${P.maxGeneration} 代传人`]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[S&&C?.ownerId===S.user?.id&&(0,t.jsx)(R,{}),(0,t.jsx)(r.default,{href:"/tree",children:(0,t.jsxs)(a.Button,{variant:"outline",className:"gap-2 bg-transparent",children:[(0,t.jsx)(c.Network,{className:"h-4 w-4"}),"查看世系图"]})}),(C?.currentUserRole==="OWNER"||C?.currentUserRole==="EDITOR")&&(0,t.jsx)(r.default,{href:"/members/new",children:(0,t.jsxs)(a.Button,{className:"gap-2 bg-primary text-primary-foreground hover:bg-primary/90",children:[(0,t.jsx)(d,{className:"h-4 w-4"}),"添加成员"]})})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[(0,t.jsx)(W,{title:"家族成员",value:P.totalMembers.toString(),subtitle:`记录在册的家族成员`,icon:(0,t.jsx)(h.Users,{className:"h-4 w-4"})}),(0,t.jsx)(W,{title:"记录年代",value:`${P.yearsSpan} 年`,subtitle:`始于 ${P.earliestYear} 年`,icon:(0,t.jsx)(f.Clock,{className:"h-4 w-4"})}),(0,t.jsx)(W,{title:"繁衍代数",value:`${P.maxGeneration} 代`,subtitle:`当前最高世代`,icon:(0,t.jsx)(c.Network,{className:"h-4 w-4"})})]}),(0,t.jsxs)(s.Tabs,{defaultValue:"recent",className:"w-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)(s.TabsList,{className:"bg-muted/50",children:[(0,t.jsx)(s.TabsTrigger,{value:"recent",children:"最近更新"}),(0,t.jsx)(s.TabsTrigger,{value:"anniversaries",children:"近期纪念日"}),(0,t.jsx)(s.TabsTrigger,{value:"statistics",children:"统计图表"}),(0,t.jsx)(s.TabsTrigger,{value:"migration",children:"迁徙记录"})]}),(0,t.jsx)(r.default,{href:"/members",children:(0,t.jsxs)(a.Button,{variant:"ghost",size:"sm",className:"text-muted-foreground gap-1",children:["查看全部 ",(0,t.jsx)(m.ArrowRight,{className:"h-3 w-3"})]})})]}),(0,t.jsx)(s.TabsContent,{value:"recent",className:"mt-0",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[(0,t.jsxs)(n.Card,{className:"lg:col-span-2 border-none shadow-sm bg-card/50 backdrop-blur",children:[(0,t.jsxs)(n.CardHeader,{children:[(0,t.jsx)(n.CardTitle,{className:"font-serif",children:"近期修谱动态"}),(0,t.jsx)(n.CardDescription,{children:"记录家族成员的最新变动与修订"})]}),(0,t.jsx)(n.CardContent,{children:(0,t.jsx)(o.ScrollArea,{className:"h-[400px] pr-4",children:(0,t.jsx)("div",{className:"space-y-4",children:D.length>0?D.map((e,r)=>(0,t.jsxs)("div",{className:"flex gap-3 group hover:bg-muted/30 p-2 rounded-lg transition-colors",children:[(0,t.jsxs)("div",{className:"relative flex flex-col items-center",children:[(0,t.jsx)("div",{className:"h-full w-px bg-border group-last:hidden"}),(0,t.jsx)("div",{className:`absolute top-2 h-2 w-2 rounded-full ring-4 ring-background ${"create"===e.action?"bg-green-500":"update"===e.action?"bg-blue-500":"delete"===e.action?"bg-red-500":"bg-purple-500"}`})]}),(0,t.jsxs)("div",{className:"pb-2 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-full ${"create"===e.action?"bg-green-100 text-green-700":"update"===e.action?"bg-blue-100 text-blue-700":"delete"===e.action?"bg-red-100 text-red-700":"bg-purple-100 text-purple-700"}`,children:"create"===e.action?"创建":"update"===e.action?"更新":"delete"===e.action?"删除":"导入"}),(0,t.jsx)("span",{className:"font-medium",children:e.entityName||"未知"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,w.format)(new Date(e.timestamp),"MM-dd HH:mm")})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["create"===e.action&&"新增了家族成员","update"===e.action&&"更新了成员信息","delete"===e.action&&"删除了成员","import"===e.action&&"导入了家族数据"]})]})]},e.id)):(0,t.jsx)("div",{className:"text-center text-muted-foreground py-8",children:"暂无修谱记录"})})})})]}),(0,t.jsx)("div",{className:"space-y-6",children:(0,t.jsxs)(n.Card,{className:"border-none shadow-sm bg-primary/5",children:[(0,t.jsx)(n.CardHeader,{children:(0,t.jsxs)(n.CardTitle,{className:"flex items-center gap-2 text-primary font-serif",children:[(0,t.jsx)(u.Calendar,{className:"h-5 w-5"}),"本月祭祖/纪念"]})}),(0,t.jsx)(n.CardContent,{className:"grid gap-4",children:k.length>0?k.map((e,a)=>{let n=new Date().getFullYear()-new Date(e.date).getFullYear();return(0,t.jsx)(r.default,{href:`/members/${e.member.id}`,children:(0,t.jsxs)("div",{className:"flex items-center gap-4 p-3 rounded-lg bg-background/60 border border-border/50 hover:bg-background transition-colors cursor-pointer",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center w-12 h-12 rounded bg-primary/10 text-primary font-serif",children:[(0,t.jsxs)("span",{className:"text-xs",children:[new Date(e.date).getMonth()+1,"月"]}),(0,t.jsx)("span",{className:"font-bold text-lg",children:e.day})]}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("p",{className:"font-medium",children:[e.member.fullName," ","birth"===e.type?"诞辰":"忌日"]}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["第 ",e.member.generation," 世 · 距今 ",n," 年","death"===e.type&&" · 已故"]})]})]})},`${e.member.id}-${e.type}`)}):(0,t.jsx)("div",{className:"text-center text-muted-foreground py-8 text-sm",children:"本月暂无纪念日"})})]})})]})}),(0,t.jsx)(s.TabsContent,{value:"anniversaries",className:"mt-0",children:(0,t.jsxs)(n.Card,{className:"border-none shadow-sm bg-card/50 backdrop-blur",children:[(0,t.jsxs)(n.CardHeader,{children:[(0,t.jsx)(n.CardTitle,{className:"font-serif",children:"近期纪念日"}),(0,t.jsx)(n.CardDescription,{children:"未来三个月内的生日和忌日"})]}),(0,t.jsx)(n.CardContent,{children:(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:(l=new Date((e=new Date).getFullYear(),e.getMonth()+3,e.getDate()),x=Object.values(j.members),b=[],x.forEach(t=>{if(t.birthDate){let r=new Date(t.birthDate),a=new Date(e.getFullYear(),r.getMonth(),r.getDate());a>=e&&a<=l&&b.push({member:t,type:"birth",date:a,originalDate:t.birthDate})}if(t.deathDate){let r=new Date(t.deathDate),a=new Date(e.getFullYear(),r.getMonth(),r.getDate());a>=e&&a<=l&&b.push({member:t,type:"death",date:a,originalDate:t.deathDate})}}),b.sort((e,t)=>e.date.getTime()-t.date.getTime()),b.length>0?b.map((a,i)=>{let o=e.getFullYear()-new Date(a.originalDate).getFullYear();return(0,t.jsx)(r.default,{href:`/members/${a.member.id}`,children:(0,t.jsx)(n.Card,{className:"hover:border-primary transition-colors cursor-pointer",children:(0,t.jsx)(n.CardContent,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center w-14 h-14 rounded-lg bg-primary/10 text-primary font-serif",children:[(0,t.jsxs)("span",{className:"text-xs",children:[a.date.getMonth()+1,"月"]}),(0,t.jsx)("span",{className:"font-bold text-lg",children:a.date.getDate()})]}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("p",{className:"font-medium text-sm",children:[a.member.fullName," ","birth"===a.type?"诞辰":"忌日"]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["第 ",a.member.generation," 世 · ",o," 年","death"===a.type&&" · 已故"]})]})]})})})},`${a.member.id}-${a.type}-${i}`)}):(0,t.jsx)("div",{className:"col-span-full text-center py-12 text-muted-foreground",children:"未来三个月暂无纪念日"}))})})]})}),(0,t.jsx)(s.TabsContent,{value:"statistics",className:"mt-0",children:(0,t.jsx)(v,{members:Object.values(j.members)})}),(0,t.jsx)(s.TabsContent,{value:"migration",className:"mt-0",children:(0,t.jsxs)(n.Card,{className:"border-none shadow-sm bg-card/50 backdrop-blur",children:[(0,t.jsxs)(n.CardHeader,{children:[(0,t.jsx)(n.CardTitle,{className:"font-serif",children:"家族迁徙记录"}),(0,t.jsx)(n.CardDescription,{children:"记录家族成员的籍贯分布"})]}),(0,t.jsx)(n.CardContent,{children:(0,t.jsx)("div",{className:"space-y-6",children:(0,p.useMemo)(()=>{let e=Object.values(j.members),a={};e.forEach(e=>{e.ancestralHome&&(a[e.ancestralHome]||(a[e.ancestralHome]=[]),a[e.ancestralHome].push(e))});let n=Object.entries(a).sort((e,t)=>t[1].length-e[1].length);return n.length>0?n.map(([e,a])=>(0,t.jsxs)("div",{className:"border-l-4 border-primary pl-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h3",{className:"text-lg font-serif font-bold",children:e}),(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[a.length," 人"]})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2",children:a.map(e=>(0,t.jsx)(r.default,{href:`/members/${e.id}`,children:(0,t.jsxs)("div",{className:"px-3 py-2 bg-muted rounded hover:bg-muted/80 transition-colors",children:[(0,t.jsx)("p",{className:"text-sm font-medium truncate",children:e.fullName}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["第 ",e.generation," 世"]})]})},e.id))})]},e)):(0,t.jsx)("div",{className:"text-center py-12 text-muted-foreground",children:"暂无迁徙记录"})},[j])})})]})})]})]})]})}function W({title:e,value:r,subtitle:a,icon:i}){return(0,t.jsx)(n.Card,{className:"border-none shadow-sm bg-card/50 backdrop-blur transition-all hover:bg-card hover:shadow-md",children:(0,t.jsxs)(n.CardContent,{className:"p-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between space-y-0 pb-2",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"text-muted-foreground bg-muted p-2 rounded-full",children:i})]}),(0,t.jsxs)("div",{className:"flex flex-col mt-2",children:[(0,t.jsx)("span",{className:"text-3xl font-serif font-bold text-foreground",children:r}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:a})]})]})})}e.s(["default",()=>L],38315)}]); |