1import{u as k,b2 as Je,p as Xe,C as Ve,j as e,t as Qe,b3 as et,b4 as tt,L as at,A as st,K as H,n as xe,Z as me,b5 as rt,D as he,x as J,b6 as ae,w as ue,b7 as $e,b8 as Le,b9 as nt,ba as lt,bb as it,b as ot}from"./index-DmlpkOWh.js";import{L as ct,d as dt,r as M}from"./vendor-react-DoYKvL2_.js";import{a as z,b as O,X as P,Y as K,T as Y,c as R,d as ge,e as B,f as Z}from"./vendor-charts-BG70vqA_.js";const Ae=s=>s==null||Number.isNaN(s)?"â":Math.round(s).toLocaleString(),De=s=>s==null||Number.isNaN(s)?"â":`${s>0?"+":""}${s.toFixed(1)}%`,pe=({kicker:s,headline:U,bullets:m,to:$,loading:h})=>e.jsxs("div",{className:"flex flex-col rounded-2xl border border-dark-600 bg-dark-800/50 p-5",children:[e.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest text-teal-400",children:s}),h?e.jsxs("div",{className:"mt-2 space-y-2 animate-pulse",children:[e.jsx("div",{className:"h-5 w-2/3 rounded bg-dark-700"}),e.jsx("div",{className:"h-3 w-full rounded bg-dark-700"}),e.jsx("div",{className:"h-3 w-5/6 rounded bg-dark-700"})]}):e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"font-heading text-base text-white mt-1 leading-snug",children:U}),e.jsx("ul",{className:"mt-2 space-y-1 flex-1",children:m.filter(Boolean).slice(0,3).map((A,r)=>e.jsxs("li",{className:"text-[12px] text-gray-400 flex gap-2",children:[e.jsx("span",{className:"text-teal-400/60 mt-px",children:"â¢"}),e.jsx("span",{children:A})]},r))})]}),e.jsxs(ct,{to:$,className:"mt-4 inline-flex items-center gap-1 text-[12px] font-medium text-teal-300 hover:text-teal-200",children:["View underlying data",e.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]}),xt=()=>{var D,q,n,I;const{data:s,loading:U}=k(Je),{data:m,loading:$}=k(Xe),{data:h,loading:A}=k(()=>Ve(14)),r=(s==null?void 0:s.movers)??[],W=r.find(c=>String(c.delta).trim().startsWith("+")),C=r.find(c=>String(c.delta).trim().startsWith("-"));return e.jsxs("section",{className:"mb-2",children:[e.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest text-gray-500 mb-3",children:"This period's read"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsx(pe,{kicker:"Source markets",headline:(s==null?void 0:s.headline)??"Market mix",loading:U,to:"/stats/markets",bullets:[W&&e.jsxs(e.Fragment,{children:["Leading gainer: ",e.jsxs("span",{className:"text-emerald-400",children:[W.label," ",W.delta]})]}),C&&e.jsxs(e.Fragment,{children:["Steepest decline: ",e.jsxs("span",{className:"text-rose-400",children:[C.label," ",C.delta]})]}),((s==null?void 0:s.watchouts)??[])[0]]}),e.jsx(pe,{kicker:"Arrivals momentum",headline:(D=m==null?void 0:m.month)!=null&&D.label?`${m.month.label} pace`:"Arrivals pace",loading:$,to:"/stats/daily",bullets:[e.jsxs(e.Fragment,{children:[Ae((q=m==null?void 0:m.month)==null?void 0:q.mtd_tourists)," tourists month-to-date"]}),e.jsxs(e.Fragment,{children:["Latest day ",e.jsx("span",{className:((m==null?void 0:m.dod_pct)??0)<0?"text-rose-400":"text-emerald-400",children:De(m==null?void 0:m.dod_pct)})," day-over-day"]}),e.jsxs(e.Fragment,{children:[De(m==null?void 0:m.yoy_pct)," versus the same day last year"]})]}),e.jsx(pe,{kicker:"Committed capacity",headline:"Seats already scheduled inbound",loading:A,to:"/capacity/forward",bullets:[e.jsxs(e.Fragment,{children:[Ae(h==null?void 0:h.total_seats)," seats over the next ",((n=h==null?void 0:h.window)==null?void 0:n.days)??14," days"]}),e.jsxs(e.Fragment,{children:["Across ",(h==null?void 0:h.total_flights)??"â"," scheduled flights"]}),((I=h==null?void 0:h.window)==null?void 0:I.start)&&e.jsxs(e.Fragment,{children:["Window ",h.window.start," â ",h.window.end]})]})]})]})},_e={Europe:"#3b82f6","Asia Pacific":"#10b981",Americas:"#f97316","Middle East":"#f59e0b",Africa:"#a855f7",Other:"#6b7280"},se=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],gt=()=>{var Ne,Se,we,Me,Ce;const s=Qe(),U=dt(),m=new Date,$=m.getFullYear(),h=a=>String(a).padStart(2,"0"),A=`${$}-${h(m.getMonth()+1)}-${h(m.getDate())}
1`,[r,W]=M.useState($),[C,D]=M.useState({from:`${$}-01-01`,to:A}),q=(a,l)=>new Date(a,l,0).getDate(),n=(()=>{const a=new Date(C.from+"T00:00:00Z"),l=new Date(C.to+"T00:00:00Z");return a.getUTCFullYear()!==r||l.getUTCFullYear()!==r||a.getUTCMonth()!==l.getUTCMonth()||a.getUTCDate()!==1||l.getUTCDate()!==q(r,a.getUTCMonth()+1)?null:a.getUTCMonth()+1})(),I=a=>{D(a===null?{from:`${r}-01-01`,to:r===$?A:`${r}-12-31`}:{from:`${r}-${h(a)}-01`,to:`${r}-${h(a)}-${h(q(r,a))}`})};M.useEffect(()=>{const a=new Date(C.from+"T00:00:00Z").getUTCFullYear();a!==r&&W(a)},[C.from]);const[c,re]=M.useState(null),[j,ne]=M.useState(null),[le,fe]=M.useState(""),[x,Fe]=M.useState([]),[v,_]=M.useState(null),[N,F]=M.useState(null),[S,T]=M.useState(null);M.useEffect(()=>{_(null),F(null),T(null)},[r,x,c,j]);const w=(a,l)=>{if(!l)return a;const g=a.map(i=>i.label),d=g.indexOf(l.from),t=g.indexOf(l.to);return d<0||t<0?a:a.slice(Math.min(d,t),Math.max(d,t)+1)},{data:Te}=k(it),{data:o,loading:ze,error:Oe,refetch:Pe}=k(()=>lt(r),[r]),{data:E}=k(()=>Le(r,c||void 0,j||void 0),[r,c,j]),{data:Ke}=k(()=>x.length>=2?et(x,c||void 0,j||void 0):Promise.resolve(null),[x.join(","),c,j]),u=x.length===1?x[0]:r,{data:Ye}=k(()=>u!==r?Le(u,c||void 0,j||void 0):Promise.resolve(null),[u,r,c,j]),Re=u===r?E:Ye,{data:X}=k(()=>ot(r,n||void 0),[r,n]),{data:f}=k(()=>nt(r),[r]),{data:Be}=k(()=>x.length>=2?tt(x):Promise.resolve(null),[x.join(",")]),{data:ie}=k(()=>$e(r),[r]),{data:V}=k(()=>n?$e(r,n):Promise.resolve(null),[r,n]),oe=c&&ie?ie.find(a=>a.country===c):null,be=a=>{const l=((f==null?void 0:f.current)||[]).filter(t=>t.metric===a),g=((f==null?void 0:f.previous)||[]).filter(t=>t.metric===a),d={};for(const t of g)d[t.month]=t.value;return l.map(t=>({month:t.month,label:se[t.month-1],[String(r)]:t.value,[String(r-1)]:d[t.month]||0}))},Q=be("occupancy_rate"),ee=be("avg_stay"),L=(Re||[]).map(a=>({label:a.label,month:a.month,source:a.source||"mot",[String(u)]:a.arrivals,[String(u-1)]:a.prev_arrivals})),Ze=L.some(a=>a.source==="macl_preliminary"),Ue=L.filter(a=>a.source==="macl_preliminary").map(a=>a.label),ce=a=>a==="daily"||a==="daily_mtd",ye=L.some(a=>ce(a.source)),We=L.filter(a=>ce(a.source)).map(a=>a.label+(a.source==="daily_mtd"?" (MTD)":"")),je=n&&E?((Ne=E.find(a=>a.month===n))==null?void 0:Ne.arrivals)||0:null,te=n&&E?((Se=E.find(a=>a.month===n))==null?void 0:Se.prev_arrivals)||0:null,qe=te&&te>0?Math.round((je-te)/te*1e3)/10:null,Ie=V!=null&&V.length?V[0].country:null,Ee=n?(we=((f==null?void 0:f.current)||[]).find(a=>a.metric==="occupancy_rate"&&a.month===n))==null?void 0:we.value:null,Ge=n?(Me=((f==null?void 0:f.current)||[]).find(a=>a.metric==="avg_stay"&&a.month===n))==null?void 0:Me.value:null,ke=n?(Ce=((f==null?void 0:f.current)||[]).find(a=>a.metric==="beds_in_operation"&&a.month===n))==null?void 0:Ce.value:null,de=a=>{var l,g,d;if((d=(g=(l=a==null?void 0:a.activePayload)==null?void 0:l[0])==null?void 0:g.payload)!=null&&d.month){const t=a.activePayload[0].payload.month;I(n===t?null:t)}},ve=n?`${se[n-1]} ${r}`:(o==null?void 0:o.period_label)||`${r}`;return e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-white",children:"Monthly Arrivals & Statistics"}),e.jsxs("p",{className:"text-sm text-gray-400 mt-1",children:["Ministry of Tourism â ",(o==null?void 0:o.reports_loaded)||0," reports, ",(o==null?void 0:o.months_with_data)||0," months of ",r," data"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",placeholder:"Filter by country...",value:c||le,onChange:a=>{fe(a.target.value),c&&re(null)},className:"bg-dark-600 border border-dark-400 rounded-lg px-3 py-2 text-sm text-white placeholder-gray-500 w-56"}),le&&!c&&e.jsx("div",{className:"absolute z-20 mt-1 w-full bg-dark-800 border border-dark-400 rounded-lg max-h-48 overflow-y-auto",children:(ie||[]).filter(a=>a.country.toLowerCase().includes(le.toLowerCase())).slice(0,10).map(a=>{var l;return e.jsxs("button",{onClick:()=>{re(a.country),fe("")},className:"w-full text-left px-3 py-2 text-sm text-gray-300 hover:bg-dark-700 hover:text-white",children:[a.country," ",e.jsxs("span",{className:"text-gray-500 text-xs",children:["(",(l=a.arrivals)==null?void 0:l.toLocaleStr
1ing(),")"]})]},a.country)})})]})]}),e.jsx(xt,{}),e.jsx(at,{value:C,onChange:D,showCompare:!1}),(n||c||j)&&e.jsxs("div",{className:"flex items-center gap-3 bg-teal-400/10 border border-teal-400/20 rounded-xl px-4 py-2.5",children:[e.jsxs("span",{className:"text-sm text-teal-400 font-mono font-medium",children:[ve,j?` · ${j}`:"",c?` · ${c}`:""]}),e.jsx("span",{className:"text-xs text-gray-400",children:"â click chart bars or regions to filter"}),e.jsx("button",{onClick:()=>{I(null),re(null),ne(null)},className:"ml-auto text-xs text-gray-400 hover:text-white px-2 py-1 bg-dark-700 rounded-md",children:"Clear All"})]}),e.jsx(st,{loading:ze,error:Oe,data:o,onRetry:Pe,label:"tourism statistics",minHeight:"130px",children:e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-4",children:[e.jsx(H,{title:`${ve} Arrivals`,value:c?(oe==null?void 0:oe.arrivals)||0:n?je||0:(o==null?void 0:o.ytd_arrivals)||0,change:n?qe:o==null?void 0:o.change_pct}),e.jsx(H,{title:c?"Country":"Top Market",value:c||(n?Ie||"N/A":(o==null?void 0:o.top_market)||"N/A")}),e.jsx(H,{title:"Avg Stay",value:n?Ge||0:(o==null?void 0:o.avg_stay)||0,suffix:" days"}),e.jsx(H,{title:"Occupancy",value:n?Ee||0:(o==null?void 0:o.occupancy)||0,format:"percent"}),e.jsx(H,{title:"Total Beds",value:n?ke?Math.round(ke):0:(o==null?void 0:o.beds)||0})]})}),L.length>0&&e.jsx(xe,{title:"Maldives tourism statistics",subtitle:"From Ministry of Tourism monthly reports",source:"Source: Maldives Ministry of Tourism · arrivaliq.ai",children:e.jsxs("div",{className:"bg-dark-700 rounded-xl p-5 border border-dark-600",children:[e.jsxs("div",{className:"mb-3 flex items-start justify-between flex-wrap gap-2",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"font-heading font-semibold text-white mb-1",children:[x.length>=2?`Monthly Arrivals · multi-year compare${c?` · ${c}`:""}`:c?`${c}: ${u-1} vs ${u}`:`Monthly Arrivals: ${u-1} vs ${u}`,v&&e.jsxs("span",{className:"ml-2 text-[11px] font-mono uppercase tracking-wide text-teal-300 bg-teal-400/15 border border-teal-400/30 rounded px-2 py-0.5",children:["ð zoomed · ",v.from,v.from!==v.to?`â${v.to}`:""]})]}),e.jsxs("p",{className:"text-xs text-gray-400",children:[x.length>=2?"One line per year â toggle years in the chip strip below.":"Click any month to filter the entire dashboard. Pick 2+ years below to switch to a trend line per year.",e.jsx(me,{}),ye&&e.jsxs("span",{className:"ml-2 text-amber-300",children:["· amber bars = from MoT daily reports (",We.join(", "),") â provisional until the monthly report publishes"]}),Ze&&!ye&&e.jsxs("span",{className:"ml-2 text-amber-300",children:["· amber bars = preliminary (",Ue.join(", "),")"]})]})]}),v&&e.jsxs("button",{onClick:()=>_(null),className:"text-[11px] font-mono text-gray-300 hover:text-white px-2.5 py-1 bg-dark-600 hover:bg-dark-500 border border-dark-500 rounded-md inline-flex items-center gap-1.5",children:[e.jsx("span",{children:"â¶"})," Reset zoom"]})]}),e.jsx("div",{className:"mb-4 pb-3 border-b border-dark-600/60",children:e.jsx(rt,{available:(Te||[new Date().getFullYear()]).slice().sort((a,l)=>l-a),selected:x,onChange:Fe,max:6})}),x.length>=2?(()=>{const a=Ke||[],l={};for(const t of a)l[t.month]||(l[t.month]={month:t.month,label:t.label}),l[t.month][String(t.year)]=t.arrivals,l[t.month][`${t.year}_src`]=t.source||"mot";const g=Object.values(l).sort((t,i)=>t.month-i.month),d=[...x].sort((t,i)=>t-i);return e.jsx("div",{className:`animate-line-reveal rounded-lg transition-all ${v?"ring-2 ring-teal-400/30 p-2":""}`,children:e.jsx(z,{width:"100%",height:320,children:e.jsxs(he,{data:w(g,v),selection:null,onSelect:t=>{if(!t){_(null);return}t.start!==t.end&&_({from:t.start,to:t.end})},children:[e.jsx(O,{strokeDasharray:"3 3",stroke:s.grid}),e.jsx(P,{dataKey:"label",tick:{fill:s.tick,fontSize:11},tickLine:!1,axisLine:{stroke:s.axis}}),e.jsx(K,{tick:{fill:s.tick,fontSize:11},tickLine:!1,axisLine:{stroke:s.axis},tickFormatter:t=>t>=1e3?`${(t/1e3).toFixed(0)}k`:String(t)}),e.jsx(Y,{...J(s),formatter:(t,i)=>[t.toLocaleString(),i]}),e.jsx(R,{wrapperStyle:{color:s.tick,fontSize:11}}),d.map(t=>e.jsx(ge,{type:"monotone",dataKey:String(t),stroke:ae(t,d),strokeWidth:2,dot:i=>{var y;const b=["daily","daily_mtd"].includes((y=i==null?void 0:i.payload)==null?void 0:y[`${t}_src`]);return e.jsx("circle",{cx:i.cx,cy:i.cy,r:b?5:3,fill:b?"#f59e0b":ae(t,d),stroke:b?"#fbbf24":"none",strokeWidth:b?1:0})},connectNulls:!0,isAnimationActive:!1},t))]})})},d.join(","))})():e.jsx("div",{className:`rounded-lg transition-all ${v?"ring-2 ring-teal-400/30 p-2":""}`,children:e.jsx(z,{width:"100%",height:300,children:e.jsxs(ue,{data:w(L,v),onClick:u===r?de:void 0,selection:null,onSelect:a=>{if(!a){_(null);return}a.start!==a.end&&_({from:a.start,to:a.end})},children:[e.jsx(O,{strokeDasharray:"3 3",stroke:s.grid}),e.jsx(P,{dataKey:"label",tick:{fill:s.tick,fontSize:11}
1,tickLine:!1,axisLine:{stroke:s.axis}}),e.jsx(K,{tick:{fill:s.tick,fontSize:11},tickLine:!1,axisLine:{stroke:s.axis},tickFormatter:a=>a>=1e3?`${(a/1e3).toFixed(0)}k`:String(a)}),e.jsx(Y,{cursor:{fill:"#33415533"},content:({active:a,payload:l})=>{if(!a||!l||l.length===0)return null;const g=l[0].payload,d=g[String(u-1)]||0,t=g[String(u)]||0,i=d>0&&t>0,b=t-d,y=d>0?b/d*100:null,p=b>0,G=b===0?"â":p?"â²":"â¼",He=b===0?"text-gray-300":p?"text-emerald-400":"text-rose-400";return e.jsxs("div",{style:{background:s.tooltipBg,border:`1px solid ${s.tooltipBorder}`,borderRadius:8,padding:"10px 12px",fontFamily:"DM Mono",color:s.tooltipText,minWidth:180},children:[e.jsxs("div",{className:"text-sm font-semibold mb-2",children:[g.label," â arrivals"]}),e.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[e.jsx("span",{className:"text-gray-400",children:u-1}),e.jsx("span",{children:d.toLocaleString()})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs mb-2",children:[e.jsx("span",{className:"text-teal-400",children:u}),e.jsx("span",{className:"text-teal-300 font-semibold",children:t.toLocaleString()})]}),i?e.jsxs("div",{className:`flex items-center justify-between text-xs pt-2 border-t border-dark-500 ${He}`,children:[e.jsx("span",{children:"YoY"}),e.jsxs("span",{className:"font-semibold",children:[G," ",y!==null?`${Math.abs(y).toFixed(1)}%`:"â",e.jsxs("span",{className:"text-gray-500 ml-2",children:["(",b>0?"+":"",b.toLocaleString(),")"]})]})]}):e.jsx("div",{className:"text-[11px] text-gray-500 pt-2 border-t border-dark-500",children:t===0?`No ${u} data yet`:`No ${u-1} baseline`})]})}}),e.jsx(R,{wrapperStyle:{color:s.tick},payload:[{value:String(u-1),type:"square",color:"#475569"},{value:String(u),type:"square",color:"#00d4b4"}]}),e.jsx(B,{dataKey:String(u-1),radius:[4,4,0,0],children:w(L,v).map((a,l)=>e.jsx(Z,{fill:n===a.month?"#64748b":"#475569",opacity:n&&n!==a.month?.3:1},l))}),e.jsx(B,{dataKey:String(u),radius:[4,4,0,0],children:w(L,v).map((a,l)=>{const g=ce(a.source)||a.source==="macl_preliminary",d=g?"#f59e0b":"#00d4b4",t=g?"#fbbf24":"#00ffcc";return e.jsx(Z,{fill:n===a.month?t:d,opacity:n&&n!==a.month?.3:1},l)})})]})})})]})}),(()=>{const a=t=>{const b=(Be||[]).filter(p=>p.metric===t),y={};for(const p of b)y[p.month]||(y[p.month]={month:p.month,label:se[p.month-1]}),y[p.month][String(p.year)]=p.value;return Object.values(y).sort((p,G)=>p.month-G.month)},l=[...x].sort((t,i)=>t-i),g=x.length>=2?a("occupancy_rate"):[],d=x.length>=2?a("avg_stay"):[];return e.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[(x.length>=2?g.length>0:Q.length>0)&&e.jsx(xe,{title:"Maldives tourism statistics",subtitle:"From Ministry of Tourism monthly reports",source:"Source: Maldives Ministry of Tourism · arrivaliq.ai",children:e.jsxs("div",{className:"bg-dark-700 rounded-xl p-5 border border-dark-600",children:[e.jsxs("div",{className:"flex items-start justify-between flex-wrap gap-2 mb-1",children:[e.jsxs("h3",{className:"font-heading font-semibold text-white",children:["Occupancy Rate (%)",N&&e.jsxs("span",{className:"ml-2 text-[11px] font-mono uppercase tracking-wide text-teal-300 bg-teal-400/15 border border-teal-400/30 rounded px-2 py-0.5",children:["ð zoomed · ",N.from,N.from!==N.to?`â${N.to}`:""]})]}),N&&e.jsxs("button",{onClick:()=>F(null),className:"text-[11px] font-mono text-gray-300 hover:text-white px-2.5 py-1 bg-dark-600 hover:bg-dark-500 border border-dark-500 rounded-md inline-flex items-center gap-1.5",children:[e.jsx("span",{children:"â¶"})," Reset zoom"]})]}),e.jsxs("p",{className:"text-xs text-gray-400 mb-3",children:[x.length>=2?"One line per selected year · National level data":"Click a month to filter · National level data",e.jsx(me,{})]}),x.length>=2?e.jsx("div",{className:`animate-line-reveal rounded-lg transition-all ${N?"ring-2 ring-teal-400/30 p-2":""}`,children:e.jsx(z,{width:"100%",height:250,children:e.jsxs(he,{data:w(g,N),selection:null,onSelect:t=>{if(!t){F(null);return}t.start!==t.end&&F({from:t.start,to:t.end})},children:[e.jsx(O,{strokeDasharray:"3 3",stroke:s.grid}),e.jsx(P,{dataKey:"label",tick:{fill:s.tick,fontSize:11}
1,tickLine:!1,axisLine:{stroke:s.axis}}),e.jsx(K,{tick:{fill:s.tick,fontSize:11},tickLine:!1,axisLine:{stroke:s.axis},domain:[0,100]}),e.jsx(Y,{...J(s),formatter:(t,i)=>[`${t}%`,i]}),e.jsx(R,{wrapperStyle:{color:s.tick,fontSize:11}}),l.map(t=>e.jsx(ge,{type:"monotone",dataKey:String(t),stroke:ae(t,l),strokeWidth:2,dot:{r:3},connectNulls:!0,isAnimationActive:!1},t))]})})},`occ-${l.join(",")}`):e.jsx("div",{className:`rounded-lg transition-all ${N?"ring-2 ring-teal-400/30 p-2":""}`,children:e.jsx(z,{width:"100%",height:250,children:e.jsxs(ue,{data:w(Q,N),onClick:de,selection:null,onSelect:t=>{if(!t){F(null);return}t.start!==t.end&&F({from:t.start,to:t.end})},children:[e.jsx(O,{strokeDasharray:"3 3",stroke:s.grid}),e.jsx(P,{dataKey:"label",tick:{fill:s.tick,fontSize:11},tickLine:!1,axisLine:{stroke:s.axis}}),e.jsx(K,{tick:{fill:s.tick,fontSize:11},tickLine:!1,axisLine:{stroke:s.axis},domain:[0,100]}),e.jsx(Y,{...J(s),formatter:(t,i)=>[`${t}%`,i]}),e.jsx(R,{wrapperStyle:{color:s.tick},payload:[{value:String(r-1),type:"square",color:"#475569"},{value:String(r),type:"square",color:"#f59e0b"}]}),e.jsx(B,{dataKey:String(r-1),radius:[4,4,0,0],children:w(Q,N).map((t,i)=>e.jsx(Z,{fill:"#475569",opacity:n&&n!==t.month?.3:1},i))}),e.jsx(B,{dataKey:String(r),radius:[4,4,0,0],children:w(Q,N).map((t,i)=>e.jsx(Z,{fill:n===t.month?"#fbbf24":"#f59e0b",opacity:n&&n!==t.month?.3:1},i))})]})})})]})}),(x.length>=2?d.length>0:ee.length>0)&&e.jsx(xe,{title:"Maldives tourism statistics",subtitle:"From Ministry of Tourism monthly reports",source:"Source: Maldives Ministry of Tourism · arrivaliq.ai",children:e.jsxs("div",{className:"bg-dark-700 rounded-xl p-5 border border-dark-600",children:[e.jsxs("div",{className:"flex items-start justify-between flex-wrap gap-2 mb-1",children:[e.jsxs("h3",{className:"font-heading font-semibold text-white",children:["Avg Duration of Stay (days)",S&&e.jsxs("span",{className:"ml-2 text-[11px] font-mono uppercase tracking-wide text-teal-300 bg-teal-400/15 border border-teal-400/30 rounded px-2 py-0.5",children:["ð zoomed · ",S.from,S.from!==S.to?`â${S.to}`:""]})]}),S&&e.jsxs("button",{onClick:()=>T(null),className:"text-[11px] font-mono text-gray-300 hover:text-white px-2.5 py-1 bg-dark-600 hover:bg-dark-500 border border-dark-500 rounded-md inline-flex items-center gap-1.5",children:[e.jsx("span",{children:"â¶"})," Reset zoom"]})]}),e.jsxs("p",{className:"text-xs text-gray-400 mb-3",children:[x.length>=2?"One line per selected year · National level data":"Click a month to filter · National level data",e.jsx(me,{})]}),x.length>=2?e.jsx("div",{className:`animate-line-reveal rounded-lg transition-all ${S?"ring-2 ring-teal-400/30 p-2":""}`,children:e.jsx(z,{width:"100%",height:250,children:e.jsxs(he,{data:w(d,S),selection:null,onSelect:t=>{if(!t){T(null);return}t.start!==t.end&&T({from:t.start,to:t.end})},children:[e.jsx(O,{strokeDasharray:"3 3",stroke:s.grid}),e.jsx(P,{dataKey:"label",tick:{fill:s.tick,fontSize:11},tickLine:!1,axisLine:{stroke:s.axis}}),e.jsx(K,{tick:{fill:s.tick,fontSize:11},tickLine:!1,axisLine:{stroke:s.axis},domain:[3,10]}),e.jsx(Y,{...J(s),formatter:(t,i)=>[`${t} days`,i]}),e.jsx(R,{wrapperStyle:{color:s.tick,fontSize:11}}),l.map(t=>e.jsx(ge,{type:"monotone",dataKey:String(t),stroke:ae(t,l),strokeWidth:2,dot:{r:3},connectNulls:!0,isAnimationActive:!1},t))]})})},`stay-${l.join(",")}`):e.jsx("div",{className:`rounded-lg transition-all ${S?"ring-2 ring-teal-400/30 p-2":""}`,children:e.jsx(z,{width:"100%",height:250,children:e.jsxs(ue,{data:w(ee,S),onClick:de,selection:null,onSelect:t=>{if(!t){T(null);return}t.start!==t.end&&T({from:t.start,to:t.end})},children:[e.jsx(O,{strokeDasharray:"3 3",stroke:s.grid}),e.jsx(P,{dataKey:"label",tick:{fill:s.tick,fontSize:11},tickLine:!1,axisLine:{stroke:s.axis}}),e.jsx(K,{tick:{fill:s.tick,fontSize:11},tickLine:!1,axisLine:{stroke:s.axis},domain:[5,10]}),e.jsx(Y,{...J(s),formatter:(t,i)=>[`${t} days`,i]}),e.jsx(R,{wrapperStyle:{color:s.tick},payload:[{value:String(r-1),type:"square",color:"#475569"},{value:String(r),type:"square",color:"#3b82f6"}]}),e.jsx(B,{dataKey:String(r-1),radius:[4,4,0,0],children:w(ee,S).map((t,i)=>e.jsx(Z,{fill:"#475569",opacity:n&&n!==t.month?.3:1},i))}),e.jsx(B,{dataKey:String(r),radius:[4,4,0,0],children:w(ee,S).map((t,i)=>e.jsx(Z,{fill:n===t.month?"#60a5fa":"#3b82f6",opacity:n&&n!==t.month?.3:1},i))})]})})})]})}),X&&X.length>0&&e.jsxs("div",{className:"bg-dark-700 rounded-xl p-5 border border-dark-600 lg:col-span-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h3",{className:"font-heading font-semibold text-white",children:["Regional Mix ",n?`(${se[n-1]} ${r})`:`(${r})`]}),j&&e.jsx("button",{onClick:()=>ne(null),className:"text-xs text-teal-400 hover:underline",children:"Clear region"})]}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-3",children:X.map(t=>{const i=Math.max(...X.map(G=>G.arrivals||0)),b=i>0?t.arrivals/i*100:0,y=j===t.region,p=j&&!y;return e.jsxs("div",{className:`flex items-center gap-3 cursor-pointer transition-all ${p?"opacity-30":"hover:opacity-80"} ${y?"ring-1 ring-teal-400/50 rounded-lg p-1 -m-1":""}`,onClick:()=>ne(y?null:t.region),children:[e.jsx("div",{className:"w-3 h-3 rounded-sm flex-shrink-0",style:{background:_e[t.region]||"#6b7280"}}),e.jsx("span",{className:"text-xs text-gray-300 w-28 flex-shrink-0",children:t.regi
1on}),e.jsxs("div",{className:"flex-1 bg-dark-800 rounded-full h-5 relative overflow-hidden",children:[e.jsx("div",{className:"h-full rounded-full",style:{width:`${b}%`,background:_e[t.region]||"#6b7280",opacity:p?.3:.7}}),e.jsx("span",{className:"absolute inset-0 flex items-center px-2 text-[10px] font-mono text-white",children:(t.arrivals||0).toLocaleString()})]}),e.jsxs("span",{className:"text-xs font-mono text-white font-bold w-12 text-right",children:[t.share,"%"]})]},t.region)})})]})]})})(),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-4",children:[{path:"/stats/markets",title:"Market Intelligence",desc:"Country rankings, regional mix, market growth",color:"border-blue-500/30 hover:border-blue-400/50"},{path:"/stats/accommodation",title:"Accommodation",desc:"Resort vs guesthouse beds & bed nights, occupancy, choice by nationality",color:"border-teal-500/30 hover:border-teal-400/50"},{path:"/stats/age-gender",title:"Age & Gender",desc:"8 age bands à Male/Female mix per month",color:"border-pink-500/30 hover:border-pink-400/50"},{path:"/stats/atolls",title:"Atoll Distribution",desc:"Geographic spread by atoll & month",color:"border-amber-500/30 hover:border-amber-400/50"},{path:"/stats/indicators",title:"Key Indicators",desc:"Duration, airports, gender, sea ports",color:"border-purple-500/30 hover:border-purple-400/50"}].map(a=>e.jsxs("div",{onClick:()=>U(a.path),className:`bg-dark-700 rounded-xl p-5 border ${a.color} cursor-pointer transition-all group`,children:[e.jsx("h3",{className:"text-sm font-semibold text-white group-hover:text-teal-400",children:a.title}),e.jsx("p",{className:"text-xs text-gray-400 mt-2",children:a.desc})]},a.path))})]})};export{gt 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.