PageSourceSearch

https://app.airplate.dk/assets/c-C9Pfb_Yw.js

js airplate.dk collected 2026-10-04 20:23:32 UTC 53,185 bytes, 1 lines download raw bytes

1import{a as e}from"./c-BEU_UCik.js";import{L as t,V as a,a as s}from"./c-CunvooSj.js";import{At as n,Kt as o,Xt as r,Z as i,dt as l,kt as d,lt as c,q as m,qt as h}from"./c-DEBGJ1U0.js";import{Ct as u,S as f,b as x,dn as p,fn as g,ht as b,t as y,zt as j}from"./c-DbdO63CX.js";import{F as w,Ht as v,N as D,c as M,er as Y,g as N,gn as S,h as C,hn as k,lt as O,o as z,u as I,z as L}from"./c-Wf3c6K4g.js";import{a as T,c as A,i as B,n as $,o as Z,r as P,s as R,t as E,u as _}from"./c-B5gLDmIc.js";import{it as F}from"./c-BalEYWlx.js";import{c as W,f as V,p as U,t as X}from"./c-jx7cwB3y.js";import{J as q,a as H,o as K}from"./c-fEiIylQS.js";import{i as Q,n as J,r as G,t as ee}from"./c-DTrKzfxB.js";import{_ as te,y as ae}from"./e-CccRQ8Zq.js";import{t as se}from"./c-CrDN46Q2.js";import{t as ne}from"./c-0TUws9sA.js";import{_ as oe,g as re}from"./c-C29JTmcG.js";import{r as ie,t as le}from"./c-ByGUPZCo.js";import"./c-DdhiWR6T.js";import{i as de,o as ce,r as me}from"./c-DjZdGa_v.js";import{t as he}from"./c-BCGrLbfn.js";import{t as ue}from"./c-BtMkKS5V.js";import{i as fe,n as xe,r as pe,t as ge}from"./c-DTXXVjSs.js";import{t as be}from"./c-CZysE7rr.js";import{a as ye,c as je,l as we,n as ve,r as De,t as Me}from"./c-CkN8DGly.js";import{t as Ye}from"./c-BMRPz5nG.js";import{t as Ne}from"./c-D6baxURt.js";import{t as Se}from"./c-Br3vFK1k.js";import{t as Ce}from"./c-aP5DZzPJ.js";import{t as ke}from"./c-CU4c9biV.js";var Oe=e(q(),1),ze=e(r(),1);var Ie=_(),Le="flex flex-col gap-2 max-w-full min-h-0 flex-1 -mb-4 pb-4 overflow-y-auto overflow-x-hidden pr-1 scrollbar-thin scrollbar-thumb-rounded scrollbar-thumb-zinc-400 scrollbar-track-transparent dark:scrollbar-thumb-[#5A5A5A] dark:scrollbar-track-transparent";function Te({isDesktop:e,subscribedZones:a,scanners:s,wolfpacks:n,batteryVoltageOffProcentive:o,className:r,onLocateScanner:i,onLocateZone:l}){const{t:d}=t(),c=function(){const[e,t]=(0,ze.useState)(Date.now);return(0,ze.useEffect)(()=>{const e=window.setInterval(()=>t(Date.now()),6e4);return()=>window.clearInterval(e)},[]),e}(),m=!!a&&a.length>0,h=!!s&&s.length>0,u=n&&Array.isArray(n)&&n.length>0?d("airboard.sensors","Sensors"):d("nav.airDetectSystems","AirDetect Systems");return(0,Ie.jsx)("div",{className:r??y("bg-white rounded-2xl p-4 dark:bg-dark-backgroundBox dark:text-white min-w-0 overflow-x-hidden dark:border-dark-backgroundBox scrollbar-thin scrollbar-thumb-rounded scrollbar-thumb-zinc-400 scrollbar-track-transparent dark:scrollbar-thumb-[#5A5A5A] dark:scrollbar-track-transparent h-64 max-[850px]:max-h-none max-[850px]:overflow-y-visible",e?"flex flex-col overflow-y-hidden":"overflow-y-auto"),children:m?e?(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)("h4",{className:"mx-4 mb-2 mt-0 select-none",children:d("dashboard.subscriptionZones","Subscription Zones")}),(0,Ie.jsx)("div",{className:Le,children:a.map(e=>(0,Ie.jsx)(ve,{zone:e,onLocate:l},e.id))})]}):(0,Ie.jsx)(he,{alwaysOpen:!0,title:d("dashboard.subscriptionZones","Subscription Zones"),children:(0,Ie.jsx)("div",{className:"flex flex-col gap-2 max-w-full",children:a.map(e=>(0,Ie.jsx)(ve,{zone:e,onLocate:l},e.id))})}):h?e?(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)("h4",{className:"mx-4 mb-2 mt-0 select-none",children:u}),(0,Ie.jsx)("div",{className:y(Le,"gap-0"),children:Object.entries(de(s)).map(([e,t])=>(0,Ie.jsx)(ye,{groupName:e,scanners:t,children:t.map(e=>{const t=me(e,o,c),a=t.hasBattery?`${d("airboard.battery","Battery")} ${t.online?`${t.batteryPercentNum}%`:d("airboard.off","Off")}`:void 0;return(0,Ie.jsx)(De,{title:e.name||e.IMEI,subtitle:a,online:t.online,charging:t.charging,signalBars:e.signalBars,hasCoords:t.hasCoords,onLocate:t.hasCoords&&i?()=>i(e.longitude,e.latitude):void 0},e.IMEI)})},e))})]}):(0,Ie.jsx)(he,{alwaysOpen:!0,title:u,children:(0,Ie.jsx)("div",{className:"flex flex-col gap-2 max-w-full",children:Object.entries(de(s)).map(([e,t])=>(0,Ie.jsx)(ye,{groupName:e,scanners:t,children:t.map(e=>{const t=me(e,o,c),a=t.hasBattery?`${d("airboard.battery","Battery")} ${t.online?`${t.batteryPercentNum}%`:d("airboard.off","Off")}`:void 0;return(0,Ie.jsx)(De,{title:e.name||e.IMEI,subtitle:a,online:t.online,charging:t.charging,signalBars:e.signalBars,hasCoords:t.hasCoords,onLocate:t.hasCoords&&i?()=>i(e.longitude,e.latitude):void 0},e.IMEI)})},e))})}):null})}function Ae({selectedZones:e,setSelectedZones:a}){const{t:s}=t();return 0===e.length?null:(0,Ie.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-2",children:[(0,Ie.jsx)("button",{className:"!bg-red-500 !text-white !border-none 
1!rounded-xl !px-5 !py-2.5 text-sm font-medium cursor-pointer whitespace-nowrap shrink-0 !w-auto !h-auto min-w-fit overflow-visible shadow-[0_2px_4px_rgba(0,_0,_0,_0.1)] transition-all duration-200 hover:!bg-red-600 hover:shadow-[0_4px_6px_rgba(0,_0,_0,_0.15)]",onClick:()=>a([]),children:s("intrusion.clearAll","Clear All")}),e.map(t=>(0,Ie.jsxs)("div",{className:"inline-flex items-center bg-blue-500 text-white border-none rounded-xl px-4 py-2.5 text-sm font-medium whitespace-nowrap shadow-[0_2px_4px_rgba(0,_0,_0,_0.1)] transition-shadow duration-200 hover:shadow-[0_4px_6px_rgba(0,_0,_0,_0.15)]",children:[t.name,(0,Ie.jsx)("span",{onClick:()=>a(e.filter(e=>e.id!==t.id)),className:"cursor-pointer ml-3 text-lg text-white/70 font-normal bg-none border-none p-0 leading-none transition-colors duration-200 hover:text-white",children:"X"})]},t.id))]})}function Be({zones:e,subscriptions:a=!0,setSelectedZones:s,selectedZones:o,className:r}){const{t:i}=t(),l=0===o.length||o.length===e.length,c=a?l?i("filters.allSubscriptionZones","All subscription zones"):i("dashboard.selectedZones","Selected zones"):l?i("filters.allSensorUnits","All sensor units"):i("dashboard.selectedSensors","Selected sensors"),h=a?i("filters.subscriptionZones","Subscription Zones"):i("filters.sensorUnits","Sensor Units");return(0,Ie.jsx)("div",{className:y("w-full",r),children:(0,Ie.jsxs)(ge,{children:[(0,Ie.jsx)(pe,{asChild:!0,children:(0,Ie.jsxs)(se,{type:"button",variant:"outline",className:"h-[3.25rem] w-full justify-between gap-2 rounded-xl border-0 bg-backgroundBox px-3 text-left shadow-sm transition-shadow hover:shadow-md focus-visible:ring-offset-0 dark:bg-dark-backgroundBox dark:text-white","aria-label":h,children:[(0,Ie.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,Ie.jsx)(m,{className:"h-5 w-5 shrink-0 text-zinc-600 dark:text-zinc-300"}),(0,Ie.jsx)("span",{className:"truncate text-base font-normal",children:c})]}),(0,Ie.jsx)(d,{className:"h-4 w-4 shrink-0 opacity-60"})]})}),(0,Ie.jsx)(xe,{align:"start",className:"w-[var(--radix-popover-trigger-width)] select-none p-1",onOpenAutoFocus:e=>e.preventDefault(),children:(0,Ie.jsx)("div",{className:"max-h-72 overflow-auto",children:0===e.length?(0,Ie.jsx)("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:i("filters.noOptions","No options")}):(0,Ie.jsx)(G,{delayDuration:150,skipDelayDuration:0,children:e.map(e=>{const t=o.some(t=>t.id===e.id);return(0,Ie.jsxs)(ee,{children:[(0,Ie.jsx)(Q,{asChild:!0,children:(0,Ie.jsxs)("button",{type:"button",onClick:()=>(e=>{s(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e])})(e),className:"flex w-full items-center gap-2 rounded-sm px-2 py-2 text-left text-sm hover:bg-accent hover:text-accent-foreground",children:[(0,Ie.jsx)("span",{className:y("flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border",t?"border-secondary bg-secondary text-white":"border-zinc-400 dark:border-zinc-500"),children:t?(0,Ie.jsx)(n,{className:"h-3 w-3"}):null}),(0,Ie.jsx)("span",{className:"truncate",children:e.name})]})}),(0,Ie.jsx)(J,{side:"right",sideOffset:8,children:e.name})]},e.id)})})})})]})})}var $e=E.create({page:{padding:30,backgroundColor:"#fff"},title:{fontSize:24,marginBottom:20,fontWeight:"bold"},subtitle:{fontSize:18,marginTop:10,fontWeight:"bold"},zoneContainer:{margin:20,padding:20,backgroundColor:"#fff",borderRadius:8,border:"3px solid #e5e7eb",flex:1},pageNumber:{position:"absolute",bottom:30,alignSelf:"flex-end",textAlign:"center",color:"#666666",fontSize:12},frontPageContainer:{margin:5,padding:5,backgroundColor:"#fff",borderRadius:8,border:"3px solid #3b82f6",flex:1},imageLogo:{width:150,height:"auto",alignSelf:"flex-end",marginBottom:10},frontPageContent:{flex:1,height:500,justifyContent:"center",alignItems:"center"},frontPageTitle:{fontSize:45,marginBottom:20,fontWeight:"bold",textAlign:"center"},OrganizationTitle:{fontSize:28,marginBottom:20,fontWeight:"bold"},dateTitle:{fontSize:28,marginBottom:20,fontWeight:"bold"},zoneName:{fontSize:18,fontWeight:"bold",textAlign:"center"},tableOfContentTitle:{fontSize:24,fontWeight:"bold",marginBottom:30,color:"#1f2937"},tableOfContent:{padding:20,marginTop:20},tableOfContentRow:{flexDirection:"row",alignItems:"center",width:"100%",marginBottom:5},tableOfContentSection:{marginLeft:20,marginTop:5},tableOfContentItem:{fontSize:16,marginBottom:15,marginTop:20,color:"#3b82f6",textDecoration:"none"},tableOfContentItemSubtitle:{fontSize:14,color:"#6b7280",textDecoration:"none",marginTop:10,marginBottom:5},tableOfContentDot:{borderBottom:"1px dotted #6b7280",flex:1,marginHorizontal:4},tableOfContentPageNumber:{color:"#6b7280",fontSize:14},row:{flexDirection:"row",width:"100%",marginTop:20},content:{padding:20,backgroundColor:"#3b82f6",borderRadius:8,flex:1,marginRight:5,marginTop:10},label:{fontSize:14,marginBottom:10,color:"#fff"},value:{fontSize:32,color:"#fff",fontWeight:"bold"},period:{fontSize:12,color:"#fff",marginTop:5},monthlyContainer:{marginTop:20,padding:20,paddingLeft:20,paddingRight:20,backgroundColor:"#fff"}
1,graphYLabel:{fontSize:8,color:"#666666",textAlign:"right"},graphBar:{width:8,backgroundColor:"#3b82f6",borderRadius:2,position:"absolute",bottom:0},graphXLabel:{position:"absolute",bottom:-25,fontSize:7,color:"#666666",textAlign:"center",transformOrigin:"top left",width:20},graphContainer:{marginTop:20,width:"100%",height:150,flexDirection:"row",borderBottomWidth:1,borderLeftWidth:1,borderColor:"#e5e7eb",position:"relative",justifyContent:"space-between"},graphYAxis:{position:"absolute",left:-25,height:"100%",flexDirection:"column",justifyContent:"space-between"},chartContainer:{marginBottom:10,width:"100%",height:230,flexDirection:"row",justifyContent:"space-around",alignItems:"flex-end"},chartValue:{fontSize:12,color:"#666666",textAlign:"center",marginBottom:4},chartBar:{width:55,backgroundColor:"#3b82f6",borderRadius:4,marginHorizontal:20},chartLabel:{fontSize:8,color:"#666666",textAlign:"center",marginTop:8,width:80,height:40},zoneStats:{flexDirection:"row",justifyContent:"space-between",marginTop:20,padding:10,backgroundColor:"#f3f4f6",borderRadius:6},statBox:{flex:1,alignItems:"center",padding:10,marginTop:10},statLabel:{fontSize:12,color:"#4b5563",marginBottom:5},statValue:{fontSize:18,fontWeight:"bold",color:"#3b82f6"},mapContainer:{marginTop:60,marginBottom:20,width:"100%",height:300},mapImage:{width:"100%",height:"100%"}}),Ze=async(e,t)=>{const a=document.createElement("div");a.style.position="absolute",a.style.visibility="hidden",a.style.left="-9999px",a.style.width="1000px",a.style.height="700px",document.body.appendChild(a);const s=Math.log2(360/(2*e.radius/111.32))-1+.7,{map:n,dispose:o}=ie({id:le.PDF_EXPORT,container:a,styleUrl:"mapbox://styles/mapbox/streets-v12",initial:{center:[e.longitude,e.latitude],zoom:s},preserveDrawingBuffer:!0,interactive:!1,trackResize:!1,refreshExpiredTiles:!1,hardenPixelRatio:!1});return new Promise((s,r)=>{let i=!1;const l=()=>{if(!i){i=!0,window.clearTimeout(d);try{o()}catch{}try{n.remove()}catch{}try{a.parentNode&&document.body.removeChild(a)}catch{}}},d=window.setTimeout(()=>{l(),r(new Error("generatePDF: map did not load within 20s"))},2e4);n.once("load",()=>{try{const a={latitude:e.latitude,longitude:e.longitude},o=[],i=e.radius/(111.32*Math.cos(a.latitude*Math.PI/180)),d=e.radius/110.574;for(let e=0;e<64;e++){const t=e/64*(2*Math.PI),s=i*Math.cos(t),n=d*Math.sin(t);o.push([a.longitude+s,a.latitude+n])}o.push(o[0]),re(n,"zone-circle",{type:"Feature",geometry:{type:"Polygon",coordinates:[o]},properties:{}}),oe(n,{id:"zone-circle",type:"fill",source:"zone-circle",paint:{"fill-color":"#cbcbcb","fill-opacity":.5,"fill-translate":[0,0],"fill-translate-anchor":"viewport"}}),t&&t.length>0&&(re(n,"drone-flights",{type:"FeatureCollection",features:t.map((e,t)=>({type:"Feature",properties:{id:`heatmap-flight-${t}`,level:200},geometry:{type:"Point",coordinates:[e.operator_longitude,e.operator_latitude]}}))}),oe(n,{id:"drone-flights-heat",type:"heatmap",source:"drone-flights",maxzoom:15,paint:{"heatmap-weight":{property:"level",type:"exponential",stops:[[1,0],[62,1]]},"heatmap-intensity":["interpolate",["linear"],["zoom"],11,1,15,3],"heatmap-color":["interpolate",["linear"],["heatmap-density"],0,"rgba(255,255,255,0)",.2,"rgba(255,182,193,0.6)",.4,"rgba(255,105,97,0.8)",.6,"rgba(220,20,60,0.9)",.8,"rgba(139,0,0,1)"],"heatmap-radius":{stops:[[11,15],[15,20]]},"heatmap-opacity":["interpolate",["linear"],["zoom"],14,1,15,0]}})),setTimeout(()=>{try{const e=n.getCanvas().toDataURL();l(),s(e)}catch(e){l(),r(e)}},1e3)}catch(a){l(),r(a)}})})},Pe=({mapImage:e})=>(0,Ie.jsx)(A,{children:(0,Ie.jsx)(A,{style:$e.mapContainer,children:(0,Ie.jsx)(B,{src:e,style:$e.mapImage})})}),Re=({startDate:e,endDate:t,allTimeFlights:a,allTimeDrones:s,averagePerDay:n,daysWithDrones:o,selectedOption:r,calendarData:i,topUasIds:l,topOperatorsIds:d,allSubscriptionZones:c,selectedZones:m=[],heatmapData:h,mapImages:u,organizationName:f})=>{const x=m.length>0?m:c;return(0,Ie.jsxs)(P,{children:[(0,Ie.jsx)(Z,{size:"A4",style:$e.page,children:(0,Ie.jsxs)(A,{style:$e.frontPageContainer,children:[(0,Ie.jsx)(B,{src:"/images/AirPlate-Logo.png",style:$e.imageLogo}),(0,Ie.jsxs)(A,{style:$e.frontPageContent,children:[(0,Ie.jsx)(R,{style:$e.frontPageTitle,children:"Drone Detection Report"}),(0,Ie.jsx)(R,{style:$e.OrganizationTitle,children:f.replace(/\s+/g," ").trim()}),(0,Ie.jsxs)(R,{style:$e.dateTitle,children:["Generated on ",(0,Oe.default)().format("MMM. DD, YYYY")]}),(0,Ie.jsxs)(R,{style:$e.dateTitle,children:["Period: ",r]}),e&&t&&(0,Ie.jsx)(Ie.Fragment,{children:(0,Ie.jsxs)("TEXT",{style:[$e.dateTitle,{fontSize:20}],children:[(0,Oe.default)(e).format("MMM DD, YYYY")," -"," ",(0,Oe.default)(t).format("MMM DD, YYYY")]})}),(0,Ie.jsxs)(R,{style:[$e.dateTitle,{textAlign:"center"}],children:["Zones: ","\n",(0,Ie.jsx)(R,{style:[$e.zoneName],children:(m.length>0?m:c).map(e=>e.name).join("\n")})]})]})]})}),(0,Ie.jsxs)(Z,{size:"A4",style:$e.page,children:[(0,Ie.jsxs)(A,{style:$e.zoneContainer,children:[(0,Ie.jsx)(R,{style:$e.tableOfContentTitle,children:"Table of Contents"}),(0,Ie.jsxs)(A,{style:$e.tableOfContent,children:[(0,Ie.jsxs)(A,{style:$e.tableOfContentRow,children:[(0,Ie.jsx)(T,{src:"#overview",children:(0,Ie.jsx)(R,{style:$e.tableOfContentItem,children:"1. Overview"})}),(0,Ie.jsx)(A,{style:$e.tableOfContentDot}),(0,Ie.jsx)(R,{style:$e.tableOfContentPageNumber,children:"3"})]}),(0,Ie.jsx)(A,{style:$e.tableOfContentSection,children:(0,Ie.jsxs)(A,{style:$e.tableOfContentRow,children:[(0,Ie.jsx)(T,{src:"#monthly-heatmap",children:(0,Ie.jsx)(R,{style:$e.tableOfContentItemSubtitle,children:"1.2. Monthly Heatmap"})}),(0,Ie.jsx)(A,{style:$e.tableOfContentDot}),(0,Ie.jsx)(R,{style:$e.tableOfContentPageNumber,children:"3"})]})}),(0,Ie.jsxs)(A,{style:$e.tableOfContentRow,children:[(0,Ie.jsx)(T,{src:"#most-frequent",children:(0,Ie.jsx)(R,{style:$e.tableOfContentItem,children:"2. Most Frequent"})}),(0,Ie.jsx)(A,{style:$e.tableOfContentDot}),(0,Ie.jsx)(R,{style:$e.tableOfContentPageNumber,children:"4"})]}),(0,Ie.jsxs)(A,{style:$e.tableOfContentSection,children:[(0,Ie.jsxs)(A,{style:$e.tableOfContentRow,children:[(0,Ie.jsx)(T,{src:"#top-serial",children:(0,Ie.jsx)(R,{style:$e.tableOfContentItemSubtitle,children:"2.1 Serial Numbers"})}),(0,Ie.jsx)(A,{style:$e.tableOfContentDot}),(0,Ie.jsx)(R,{style:$e.tableOfContentPageNumber,children:"4"})]}),(0,Ie.jsxs)(A,{style:$e.tableOfContentRow,children:[(0,Ie.jsx)(T,{src:"#top-operators",children:(0,Ie.jsx)(R,{style:$e.tableOfContentItemSubtitle,children:"2.2 Known Operators"})}),(0,Ie.jsx)(A,{style:$e.tableOfContentDot}),(0,Ie.jsx)(R,{style:$e.tableOfContentPageNumber,children:"4"})]})]}),(0,Ie.jsx)(T,{src:"#zones",children:(0,Ie.jsx)(R,{style:$e.tableOfContentItem,children:"3. Zone Activity"})}),x.map((e,t)=>(0,Ie.jsx)(A,{style:$e.tableOfContentSection,children:(0,Ie.jsxs)(A,{style:$e.tableOfContentRow,children:[(0,Ie.jsx)(T,{src:`#zone-${e.id}`,children:(0,Ie.jsxs)(R,{style:$e.tableOfContentItemSubtitle,children:["3.",t+1," ",e.name||`Zone ${e.id}`]})}),(0,Ie.jsx)(A,{style:$e.tableOfContentDot}),(0,Ie.jsx)(R,{style:$e.tableOfContentPageNumber,children:6+t})]})},e.id))]})]}),(0,Ie.jsx)(R,{style:$e.pageNumber,render:({pageNumber:e})=>`${e}`,fixed:!0})]}),(0,Ie.jsxs)(Z,{size:"A4",style:$e.page,children:[(0,Ie.jsxs)(A,{style:$e.zoneContainer,id:"overview",children:[(0,Ie.jsx)(R,{style:[$e.title,{marginBottom:20}],children:"Overview"}),(0,Ie.jsxs)(A,{style:$e.row,children:[(0,Ie.jsxs)(A,{style:$e.content,children:[(0,Ie.jsx)(R,{style:$e.label,children:"Total Flights Detected:"}),(0,Ie.jsx)(R,{style:$e.value,children:a}),(0,Ie.jsx)(R,{style:$e.period,children:r})]}),(0,Ie.jsxs)(A,{style:$e.content,children:[(0,Ie.jsx)(R,{style:$e.label,children:"Total Drone Detected"}),(0,Ie.jsx)(R,{style:$e.value,children:s}),(0,Ie.jsx)(R,{style:$e.period,children:r})]})]}),(0,Ie.jsxs)(A,{style:$e.row,children:[(0,Ie.jsxs)(A,{style:$e.content,children:[(0,Ie.jsx)(R,{style:$e.label,children:"Flights Scanned Per Day"}),(0,Ie.jsx)(R,{style:$e.value,children:n}),(0,Ie.jsx)(R,{style:$e.period,children:r})]}),(0,Ie.jsxs)(A,{style:$e.content,children:[(0,Ie.jsx)(R,{style:$e.label,children:"Days with Seen Drones"}),(0,Ie.jsx)(R,{style:$e.value,children:o}),(0,Ie.jsx)(R,{style:$e.period,children:r})]})]}),(0,Ie.jsxs)(A,{style:$e.monthlyContainer,id:"monthly-heatmap",children:[(0,Ie.jsx)(R,{style:[$e.title,{marginBottom:10}],children:"Monthly Heatmap"}),(0,Ie.jsx)(R,{style:[$e.subtitle,{marginBottom:10}],children:(()=>{const a=i.filter(e=>0===e.monthIndex),s=(0,Oe.default)(a[0]?.day);if("Latest year"===r||"All time"===r)return r;if(r.includes("Q")||"Latest 3 months"===r)return`${s.format("MMMM YYYY")}`;const n=(0,Oe.default)(e).format("YYYY-MM")===(0,Oe.default)(t).format("YYYY-MM"),o=(0,Oe.default)(e).format("D"),l=n?(0,Oe.default)(t).format("D"):s.endOf("month").format("D"),d=s.format("YYYY");return`${o}. - ${l}. ${s.format("MMMM")} ${d}`})()}),(r.includes("Q")||"Latest 3 months"===r||e&&t&&(0,Oe.default)(e).format("YYYY-MM")!==(0,Oe.default)(t).format("YYYY-MM"))&&(0,Ie.jsxs)("TEXT",{style:[$e.subtitle,{marginBottom:10}],children:["Total Detections:"," ",i.filter(e=>0===e.monthIndex).reduce((e,t)=>
1e+t.count,0)]}),(0,Ie.jsxs)(A,{style:[$e.graphContainer,{marginTop:10}],children:[(0,Ie.jsx)(A,{style:$e.graphYAxis,children:(()=>{const e=Math.max(...i.map(e=>e.count));return[e,Math.round(.75*e),Math.round(.5*e),Math.round(.25*e),0].map(e=>(0,Ie.jsx)(R,{style:$e.graphYLabel,children:e},e))})()}),i.map((a,s)=>{const n=Math.max(...i.map(e=>e.count)),o=a.count/n*150||0;return(r.includes("Q")||"Latest 3 months"===r||e&&t&&(0,Oe.default)(e).format("YYYY-MM")!==(0,Oe.default)(t).format("YYYY-MM"))&&0!==a.monthIndex?null:(0,Ie.jsxs)(A,{style:{alignItems:"center",width:20},children:[(0,Ie.jsx)(A,{style:[$e.graphBar,{height:o,width:8}]}),(0,Ie.jsx)(R,{style:[$e.graphXLabel],children:"Latest year"===r||"All time"===r?(0,Oe.default)(a.day).format("MMM"):(0,Oe.default)(a.day).date()})]},s)})]})]})]}),(0,Ie.jsx)(R,{style:$e.pageNumber,render:({pageNumber:e})=>`${e}`,fixed:!0})]}),(r.includes("Q")||"Latest 3 months"===r||e&&t&&(0,Oe.default)(e).format("YYYY-MM")!==(0,Oe.default)(t).format("YYYY-MM")&&"Latest year"!==r)&&(0,Ie.jsxs)("PAGE",{size:"A4",style:$e.page,children:[(0,Ie.jsx)("VIEW",{style:$e.zoneContainer,children:Array.from(new Set(i.map(e=>e.monthIndex))).filter(e=>0!==e).map(a=>{const s=i.filter(e=>e.monthIndex===a),n=(0,Oe.default)(s[0]?.day),o=a===Math.max(...i.map(e=>e.monthIndex??0)),l=0===a?(0,Oe.default)(e).format("D"):"1",d=o?(0,Oe.default)(t).format("D"):n.endOf("month").format("D"),c=s.reduce((e,t)=>e+t.count,0);return(0,Ie.jsxs)("VIEW",{style:$e.monthlyContainer,children:[(0,Ie.jsx)("TEXT",{style:[$e.subtitle,{marginBottom:20}],children:r.includes("Q")||"Latest 3 months"===r?`${n.format("MMMM YYYY")}`:`${l}. - ${d}. ${n.format("MMMM")} ${n.format("YYYY")}`}),(0,Ie.jsxs)("TEXT",{style:[$e.subtitle,{marginBottom:10}],children:["Total Detections: ",c]}),(0,Ie.jsxs)("VIEW",{style:$e.graphContainer,children:[(0,Ie.jsx)("VIEW",{style:$e.graphYAxis,children:(()=>{const e=Math.max(...s.map(e=>e.count));return[e,Math.round(.75*e),Math.round(.5*e),Math.round(.25*e),0].map(e=>(0,Ie.jsx)("TEXT",{style:$e.graphYLabel,children:e},e))})()}),s.map((e,t)=>{const a=Math.max(...s.map(e=>e.count)),n=e.count/a*150||0;return(0,Ie.jsxs)("VIEW",{style:{alignItems:"center",width:20},children:[(0,Ie.jsx)("VIEW",{style:[$e.graphBar,{height:n,width:8}]}),(0,Ie.jsx)("TEXT",{style:$e.graphXLabel,children:(0,Oe.default)(e.day).date()})]},t)})]})]},a)})}),(0,Ie.jsx)("TEXT",{style:$e.pageNumber,render:({pageNumber:e})=>`${e}`,fixed:!0})]}),(0,Ie.jsxs)(Z,{size:"A4",style:$e.page,children:[(0,Ie.jsxs)(A,{style:$e.zoneContainer,id:"most-frequent",children:[(0,Ie.jsx)(R,{style:$e.title,children:"Most Frequent"}),(0,Ie.jsxs)(A,{style:{marginTop:20},id:"top-serial",children:[(0,Ie.jsx)(R,{style:[$e.subtitle,{marginBottom:20}],children:"Serial Numbers"}),(0,Ie.jsx)(A,{style:$e.chartContainer,children:l.slice(0,5).map(e=>{const t=Math.max(...l.map(e=>e.count)),a=e.count/t*180;return(0,Ie.jsxs)(A,{style:{alignItems:"center"},children:[(0,Ie.jsx)(R,{style:$e.chartValue,children:e.count}),(0,Ie.jsx)(A,{style:[$e.chartBar,{height:a}]}),(0,Ie.jsx)(R,{style:$e.chartLabel,children:e.uas_id})]},e.uas_id)})})]}),(0,Ie.jsxs)(A,{style:{marginTop:40},id:"top-operators",children:[(0,Ie.jsx)(R,{style:[$e.subtitle,{marginBottom:20}],children:"Known Operators"}),(0,Ie.jsx)(A,{style:$e.chartContainer,children:d.filter(e=>e.operatorID).slice(0,5).map(e=>{const t=Math.max(...d.filter(e=>e.operatorID).map(e=>e.count)),a=e.count/t*150;return(0,Ie.jsxs)(A,{style:{alignItems:"center"},children:[(0,Ie.jsx)(R,{style:$e.chartValue,children:e.count}),(0,Ie.jsx)(A,{style:[$e.chartBar,{height:a}]}),(0,Ie.jsx)(R,{style:$e.chartLabel,children:e.operatorID})]}
1,e.operatorID)})})]})]}),(0,Ie.jsx)(R,{style:$e.pageNumber,render:({pageNumber:e})=>`${e}`,fixed:!0})]}),x.map(a=>(0,Ie.jsxs)(Z,{size:"A4",style:$e.page,children:[(0,Ie.jsxs)(A,{style:$e.zoneContainer,id:`zone-${a.id}`,children:[(0,Ie.jsx)(R,{style:$e.title,children:a.name||`Zone ${a.id}`}),(0,Ie.jsx)(R,{style:[$e.subtitle,{marginTop:20}],children:"Zone Activity Overview"}),(0,Ie.jsxs)(A,{style:$e.zoneStats,children:[(0,Ie.jsxs)(A,{style:$e.statBox,children:[(0,Ie.jsx)(R,{style:$e.statLabel,children:"Total Detections"}),(0,Ie.jsx)(R,{style:$e.statValue,children:h.filter(s=>s.subscription_id===a.id&&(!e||(0,Oe.default)(s.start).isAfter(e))&&(!t||(0,Oe.default)(s.start).isBefore(t))).length})]}),(0,Ie.jsxs)(A,{style:$e.statBox,children:[(0,Ie.jsx)(R,{style:$e.statLabel,children:"Unique Drones"}),(0,Ie.jsx)(R,{style:$e.statValue,children:new Set(h.filter(s=>s.subscription_id===a.id&&(!e||(0,Oe.default)(s.start).isAfter(e))&&(!t||(0,Oe.default)(s.start).isBefore(t))).map(e=>e.uas_id)).size})]}),(0,Ie.jsxs)(A,{style:$e.statBox,children:[(0,Ie.jsx)(R,{style:$e.statLabel,children:"Unique Operators"}),(0,Ie.jsx)(R,{style:$e.statValue,children:new Set(h.filter(s=>s.subscription_id===a.id&&(!e||(0,Oe.default)(s.start).isAfter(e))&&(!t||(0,Oe.default)(s.start).isBefore(t))).map(e=>e.operatorID)).size})]})]}),(0,Ie.jsx)(R,{style:[$e.subtitle,{marginTop:40}],children:"Zone Heatmap"}),(0,Ie.jsx)(Pe,{selectedZone:a,heatmapData:h,mapImage:u[a.id]})]}),(0,Ie.jsx)(R,{style:$e.pageNumber,render:({pageNumber:e})=>`${e}`,fixed:!0})]},a.id))]})},Ee=!1,_e=async(e,t,a,s,n,o,r,i,l,d,c=[],m=[],h)=>{if(!Ee)try{Ee=!0;const p=Array.from(document.querySelectorAll("*")).map(e=>e.webSocket).find(e=>e?.url?.includes("ws.airplate.dk/scanning"));p&&p.close(),h(0),await x(),h(5);const g=O(await b());h(10);const y=(await u(String(g??""))).replace(/\s+/g," ").trim();h(20);const w=c.length>0?c:await j();h(30);const v={},D=30/w.length;for(const e of w)v[e.id]=await Ze(e,m),h(30+D);h(60);const M=document.querySelector(".MuiPickersCalendarHeader-label")?.textContent;if(M){const e={January:"01",February:"02",March:"03",April:"04",May:"05",June:"06",July:"07",August:"08",September:"09",October:"10",November:"11",December:"12"},[t,a]=M.split(" ");i=`${a}-${e[t]}-01`}const Y=await(async(e,t,a)=>{if("Latest 7 days"===e){const e=(0,Oe.default)(),t=e.subtract(6,"days"),a=await f(!0,e.format("YYYY-MM-DD"),[])??[],s=[...t.format("MM")!==e.format("MM")?await f(!0,t.format("YYYY-MM-DD"),[])??[]:[],...a],n=[];for(let o=t;o.isBefore(e)||o.isSame(e,"day");o=o.add(1,"day")){const e=s.find(e=>(0,Oe.default)(e.day).format("YYYY-MM-DD")===o.format("YYYY-MM-DD"));n.push({day:o.format("YYYY-MM-DD"),count:e?.count||0})}return n}if("Latest month"===e){const e=(0,Oe.default)(),t=e.subtract(30,"days"),a=e.format("YYYY-MM")!==t.format("YYYY-MM")?1:0,s=[];for(let n=0;n<=a;n++){const o=t.add(n,"month"),r=await f(!0,o.format("YYYY-MM-DD"),[])??[];let i=o.startOf("month"),l=o.endOf("month");0===n&&(i=t),n===a&&(l=e);for(let e=i;e.isBefore(l)||e.isSame(l,"day");e=e.add(1,"day")){const t=r.find(t=>(0,Oe.default)(t.day).format("YYYY-MM-DD")===e.format("YYYY-MM-DD"));s.push({day:e.format("YYYY-MM-DD"),count:t?.count||0,monthIndex:n})}}return s}if("Latest 3 months"===e||e.includes("Q")){const e=(0,Oe.default)(t),a=[];for(let t=0;t<3;t++){const s=e.add(t,"month"),n=await f(!0,s.format("YYYY-MM-DD"),[])??[],o=s.startOf("month"),r=s.endOf("month");for(let e=o;e.isBefore(r)||e.isSame(r,"day");e=e.add(1,"day")){const s=n.find(t=>(0,Oe.default)(t.day).format("YYYY-MM-DD")===e.format("YYYY-MM-DD"));a.push({day:e.format("YYYY-MM-DD"),count:s?.count||0,monthIndex:t})}}return a}if("Latest year"===e||"All time"===e){const e=(0,Oe.default)(),t=[];for(let a=11;a>=0;a--){const s=e.subtract(a,"month"),n=(await f(!0,s.format("YYYY-MM-DD"),[])??[]).reduce((e,t)=>e+t.count,0);t.push({day:s.format("YYYY-MM-DD"),count:n,monthIndex:0})}return t}{const e=(0,Oe.default)(t),s=(0,Oe.default)(a),n=s.diff(e,"month"),o=e.format("YYYY-MM")!==s.format("YYYY-MM")?Math.max(1,n):n,r=[];for(let t=0;t<=o;t++){const a=e.add(t,"month"),n=await f(!0,a.format("YYYY-MM-DD"),[])??[],i=0===t?e:a.startOf("month"),l=t===o?s:a.endOf("month");for(let e=i;e.isBefore(l)||e.isSame(l,"day");e=e.add(1,"day")){const a=n.find(t=>(0,Oe.default)(t.day).format("YYYY-MM-DD")===e.format("YYYY-MM-DD"));
1r.push({day:e.format("YYYY-MM-DD"),count:a?.count||0,monthIndex:t})}}return r}})(r,e,t);h(80);const N=await $((0,Ie.jsx)(Re,{startDate:e,endDate:t,allTimeFlights:a,allTimeDrones:s,averagePerDay:n,daysWithDrones:o,selectedOption:r,selectedDate:i,calendarData:Y,topUasIds:l,topOperatorsIds:d,allSubscriptionZones:w,selectedZones:c,heatmapData:m,mapImages:v,organizationName:y})).toBlob();h(90);const S=URL.createObjectURL(N),C=document.createElement("a"),k=(0,Oe.default)().format("YYYY_MM_DD");C.href=S,C.download=`${k}_${y}_Report.pdf`,C.click(),URL.revokeObjectURL(S),h(100)}catch(p){console.error("Error generating PDF:",p)}finally{Ee=!1,h(0)}};function Fe({value:e}){const t=2*Math.PI*13,a=t-Math.max(0,Math.min(100,e))/100*t;return(0,Ie.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",className:"-rotate-90","aria-hidden":"true",children:[(0,Ie.jsx)("circle",{cx:"15",cy:"15",r:13,stroke:"rgba(255,255,255,0.3)",strokeWidth:3,fill:"none"}),(0,Ie.jsx)("circle",{cx:"15",cy:"15",r:13,stroke:"#fff",strokeWidth:3,strokeLinecap:"round",fill:"none",strokeDasharray:t,strokeDashoffset:a})]})}var We=({startDate:e,endDate:t,allTimeFlights:a,allTimeDrones:s,averagePerDay:n,daysWithDrones:o,selectedOption:r,selectedDate:i,topUasIds:d,topOperatorsIds:c,selectedZone:m,heatmapData:h=[]})=>{const[u,f]=(0,ze.useState)(0),[x,p]=(0,ze.useState)(!1);return void 0!==a&&void 0!==s&&void 0!==n&&void 0!==o&&(0,Ie.jsx)("div",{className:"pdfButtonContainer",children:(0,Ie.jsx)(se,{type:"button",onClick:async()=>{p(!0);try{await _e(e,t,a??0,s??0,n??0,o??0,r,i,d,c,m||[],h,f)}finally{p(!1)}},disabled:x,className:"relative h-14 w-full min-w-[250px] gap-2 whitespace-nowrap rounded-xl border border-[#5490ec] !bg-secondary px-4 text-base font-medium text-white shadow-sm transition-colors hover:!bg-[#146aed] disabled:opacity-100 dark:!bg-dark-secondary",children:x?(0,Ie.jsxs)("span",{className:"absolute inset-0 flex items-center justify-center gap-2 rounded-xl bg-[#146aed]",children:[(0,Ie.jsx)(Fe,{value:u}),(0,Ie.jsx)("span",{className:"text-sm text-white",children:`${Math.round(u)}%`})]}):(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)(l,{className:"h-5 w-5"}),"Generate Drone Detection Report"]})})})};function Ve({handleDateRangeChanges:e,subscribedZones:t,scanners:a,selectedZones:s,setSelectedZones:n,dashboardLoading:o,dashboardData:r,selectedOption:i,intrusionLogDate:l,dateRangeOptionStart:d,dateRangeOptionStop:c,setPdfLoading:m}){return(0,Ie.jsxs)("div",{className:"flex items-center gap-4 w-full relative z-[1] select-none max-[1050px]:flex-col max-[1050px]:items-stretch",children:[(0,Ie.jsx)(Ne,{onDateRangeChange:e,initialValue:"Latest month"}),(0,Ie.jsxs)("div",{className:"flex items-center gap-4 max-[1050px]:justify-start max-[1050px]:w-full max-[630px]:flex-col max-[450px]:flex-col",children:[t&&t.length>0?(0,Ie.jsx)("div",{className:"mt-2 min-w-[180px] md:mt-0 max-[1050px]:w-full",children:(0,Ie.jsx)(Be,{zones:t.map(e=>({name:e.name||`${e.latitude} - ${e.longitude}`,id:e.id})),setSelectedZones:n,selectedZones:s})}):a?(0,Ie.jsx)("div",{className:"mt-2 min-w-[180px] md:mt-0 max-[1050px]:w-full",children:(0,Ie.jsx)(Be,{zones:a?a.map(e=>({name:e.name||e.IMEI,id:e.IMEI})):[],setSelectedZones:n,selectedZones:s,subscriptions:!1})}):null,(0,Ie.jsx)("div",{className:"flex items-center whitespace-nowrap [&>button]:w-full",children:!o&&r&&""!==i&&r.heatmapData&&r.heatmapData.length>0&&t&&t.length>0&&(0,Ie.jsx)("div",{onClick:()=>m(!0),children:(0,Ie.jsx)(We,{startDate:d,endDate:c,allTimeFlights:r.allTimeFlights,allTimeDrones:r.allTimeDrones,averagePerDay:r.averagePerDay,daysWithDrones:r.daysWithDrones,selectedOption:i,selectedDate:l.startOf("month").format("YYYY-MM-DD"),topUasIds:r.topUasIds||[],topOperatorsIds:r.topOperatorIds||[],selectedZone:s.length>0?s.map(e=>t.find(t=>t.id===e.id)).filter(Boolean):t,heatmapData:r.heatmapData})})})]})]})}function Ue({value:e}){const t=e??0,s=t>0?o:t<0?h:null,n=0===t?a("common.noChange","No change"):`${t>0?"+":""}${t}%`;return(0,Ie.jsxs)("span",{className:"inline-flex flex-col items-center justify-center gap-0.5 rounded-md px-1.5 py-1 text-l font-semibold leading-none whitespace-nowrap h-8 "+(t>0?"bg-green-700 text-white":t<0?"bg-red-700 text-white":"bg-zinc-200 text-zinc-600"),children:[(0,Ie.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[s&&(0,Ie.jsx)(s,{className:"h-7 w-7 shrink-0","aria-hidden":"true"}),(0,Ie.jsx)("span",{"aria-hidden":"true",children:n})]}),(0,Ie.jsx)("span",{className:"sr-only",children:`${n} : ""}`})]})}var Xe="rounded-2xl p-4 text-white text-left flex flex-col items-start justify-center gap-2 min-w-0";function qe({dashboardLoading:e,dashboardData:a,selectedOption:s}){const{t:n}=t(),o={"Latest 7 days":n("dateRange.latest7Days","Latest 7 days"),"Latest month":n("dateRange.latestMonth","Latest month"),"L
1atest 3 months":n("dateRange.latest3Months","Latest 3 months"),"Latest year":n("dateRange.latestYear","Latest year"),"All time":n("dateRange.allTime","All time"),"selected period":n("dateRange.tile.selectedPeriod",{days:a?.datePeriod??"",defaultValue:"Past {{days}} days"})}[s]||s,r=(0,Ie.jsx)(i,{className:"h-5 w-5 animate-spin text-white","aria-hidden":"true"}),l=!e&&!!a,d={allTimeFlights:"prevAllTimeFlights",allTimeDrones:"allTimeDronesPrev",averagePerDay:"averagePerDayPrev",daysWithDrones:"daysWithDronesPrev"},c=e=>{if(!l)return null;const t=d[e];if(!t)return null;const s=a?.[t];return void 0===s?null:(0,Ie.jsx)(Ue,{value:Number(s)})};return(0,Ie.jsxs)("div",{className:"grid grid-cols-4 gap-4 w-full select-none max-[850px]:grid-cols-2 max-[350px]:grid-cols-1",children:[(0,Ie.jsxs)("div",{className:`${Xe} !bg-secondary`,children:[(0,Ie.jsxs)("div",{className:"text-sm font-semibold mb-1 flex justify-between w-full",children:[n("dashboard.totalFlightsDetected","Total Flights Detected"),c("allTimeFlights")]}),(0,Ie.jsx)("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1 w-full",children:(0,Ie.jsx)("div",{className:"text-3xl font-bold","data-testid":"dashboard-total-flights",children:e?r:a?.allTimeFlights})}),(0,Ie.jsx)("div",{className:"text-xs opacity-70 mt-1",children:o})]}),(0,Ie.jsxs)("div",{className:`${Xe} !bg-tertiary dark:!bg-dark-tertiary`,children:[(0,Ie.jsxs)("div",{className:"text-sm font-semibold mb-1 flex justify-between w-full",children:[n("dashboard.totalDronesDetected","Total Drones Detected"),c("allTimeDrones")]}),(0,Ie.jsx)("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1 w-full",children:(0,Ie.jsx)("div",{className:"text-3xl font-bold","data-testid":"dashboard-total-drones",children:e?r:a?.allTimeDrones})}),(0,Ie.jsx)("div",{className:"text-xs opacity-70 mt-1",children:o})]}),(0,Ie.jsxs)("div",{className:`${Xe} !bg-secondary dark:!bg-dark-secondary`,children:[(0,Ie.jsxs)("div",{className:"text-sm font-semibold mb-1 flex justify-between w-full",children:[n("dashboard.flightsScannedPerDay","Flights Scanned Per Day"),c("averagePerDay")]}),(0,Ie.jsx)("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1 w-full",children:(0,Ie.jsx)("div",{className:"text-3xl font-bold",children:e?r:a?.averagePerDay})}),(0,Ie.jsx)("div",{className:"text-xs opacity-70 mt-1",children:n("dashboard.averageSlash",{period:o,defaultValue:"Average / {{period}}"})})]}),(0,Ie.jsxs)("div",{className:`${Xe} !bg-tertiary dark:!bg-dark-tertiary`,children:[(0,Ie.jsxs)("div",{className:"text-sm font-semibold mb-1 flex justify-between w-full",children:[n("dashboard.daysWithSeenDrones","Days With Seen Drones"),c("daysWithDrones")]}),(0,Ie.jsx)("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1 w-full",children:(0,Ie.jsx)("div",{className:"text-3xl font-bold",children:e?r:a?.daysWithDrones})}),(0,Ie.jsx)("div",{className:"text-xs opacity-70 mt-1",children:o})]})]})}function He({dashboardLoading:e,heatmapData:t,scanners:a,subscribedZones:s,dateRangeOptionStart:n,dateRangeOptionStop:o,containerClassName:r,loadingWrapperClassName:l}){const d=Ye(t),[c,m]=(0,ze.useState)(!1),[h,u]=(0,ze.useState)(null),f=(0,ze.useCallback)(e=>{u(e),m(!0)},[]),x=(0,ze.useCallback)(()=>{m(!1)},[]),p=(0,ze.useCallback)(()=>{u(null)},[]);return(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsxs)("div",{className:`relative ${l??""}`,children:[(0,Ie.jsx)(Se,{scanners:a,subscribedZones:s,dateRangeOptionStart:n,dateRangeOptionStop:o,loading:e,heatmapData:t??[],onViewLog:f,containerClassName:r}),e&&(0,Ie.jsx)("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-2xl bg-white/55 dark:bg-dark-backgroundBox/55",children:(0,Ie.jsx)(i,{className:"h-8 w-8 animate-spin text-zinc-400","aria-hidden":"true"})})]}),(0,Ie.jsx)(ne,{open:c,close:x,onExited:p,preserveMapOnClose:!1,macAddress:h?.MAC_address??"",start:h?.start??"",stop:h?.stop??"",initialData:h??void 0,seenCount:d(h)},h?`${h.MAC_address}|${h.start}`:"none")]})}var Ke=e(K(),1);H();function Qe({subscriber:e,setDate:a,selectedDate:s,todaysScannedDeviceAmount:n,selectedZones:o}){const{t:r}=t(),[i,l]=(0,ze.useState)([]),d=(0,ze.useMemo)(()=>o?.map(e=>e.id.toString())??[],[o]),c=(0,ze.useMemo)(()=>(0,Oe.default)(),[]),m=s.startOf("month").format("YYYY-MM-DD"),{data:h,isLoading:u}=M(e,m,d);(0,ze.useEffect)(()=>
1{if(u||!h)return;const e=Math.max(...h.map(e=>e.count),n,0),t=Math.min(e,20),a=e=>0===e?"":e<=.2?"#FFCDD2":e<=.4?"#EF9A9A":e<=.6?"#E57373":e<=.8?"#EF5350":"#D32F2F",s=a=>e>100?Math.log(a+1)/Math.log(e+1):0===t?0:Math.min(a/t,1),o=h.map(e=>({day:e.day.split("T")[0],color:a(s(e.count)),count:e.count})),r=(0,Oe.default)().format("YYYY-MM-DD");o.some(e=>e.day===r)||o.push({day:r,color:a(s(n)),count:n}),l(o)},[h,n,u]);const f=(0,ze.useMemo)(()=>{const e=new Map;for(const t of i)e.set(t.day,t);return e},[i]),x=s.toDate(),p=s.startOf("month").toDate(),g=c.toDate();return(0,Ie.jsx)(fe,{className:"w-full max-w-[360px]",mode:"single",selected:x,onSelect:e=>{e&&a((0,Oe.default)(e))},month:p,onMonthChange:e=>a((0,Oe.default)(e)),disabled:{after:g},weekStartsOn:1,fixedWeeks:!0,components:{DayButton:({day:e,modifiers:t,className:a,style:s,children:n,...o})=>{const i=(0,Oe.default)(e.date).format("YYYY-MM-DD"),l=f.get(i),d=!!l&&!!l.color,c=l?r("dashboard.scannedFlights",{count:l.count,defaultValue:"{{count}} flights scanned"}):"",m=d&&!t.selected?{backgroundColor:l.color,color:"#fff"}:void 0,h=t.today&&!t.selected?" ring-2 ring-secondary ring-inset":"";return(0,Ie.jsx)("button",{...o,className:(a??"")+h,style:{...s,...m},title:c,children:n??e.date.getDate()})}}})}Oe.default.extend(Ke.default),Oe.default.updateLocale("en",{weekStart:1});function Je({isDesktop:e,scannedDevices:a,intrusionLogDate:s,setIntrusionLogDate:n,subscriber:o,todaysScannedDeviceAmount:r,dateRangeOptionStart:l,dateRangeOptionStop:d,selectedZones:m,getSeenCount:h}){const{t:u}=t(),[f,x]=(0,ze.useState)(!1),[b,y]=(0,ze.useState)(null),[j,w]=(0,ze.useState)(0),v=(0,ze.useCallback)((e,t)=>{y(e),w(t),x(!0),window.history.pushState(null,"",k(e))},[]),D=(0,ze.useCallback)(()=>{x(!1),window.history.back()},[]),M=(0,ze.useCallback)(()=>{y(null),w(0)},[]);(0,ze.useEffect)(()=>{if(!f)return;const e=()=>{x(!1)};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[f]);const Y=(0,ze.useMemo)(()=>a?a.length>0?(0,Ie.jsx)(Ie.Fragment,{children:a.map((e,t)=>(0,Ie.jsx)(Ce,{device:e,index:t,seenCount:h(e),mobile:!0,isSerialApproved:p(e).isApprovedDrone,isSerialWatchlisted:g(e).isWatchlisted,onOpen:v},`${S(e)}-mobile`))}):u("dashboard.noDevicesScanned",{date:s.format("DD/MM/YYYY"),defaultValue:"No devices scanned on {{date}}"}):(0,Ie.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,Ie.jsx)(i,{className:"h-8 w-8 animate-spin text-zinc-400","aria-hidden":"true"})}),[a,h,v,s,u]);return(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)("div",{className:"flex w-full justify-between gap-4 max-[850px]:flex-col",children:(0,Ie.jsxs)("div",{className:"bg-white rounded-2xl p-4 dark:bg-dark-backgroundBox dark:text-white flex-1 justify-center items-center grid grid-cols-12 items-start gap-4 max-w-full max-[850px]:grid-cols-1",children:[(0,Ie.jsx)("div",{className:"col-span-12 min-[851px]:col-span-6 flex flex-col gap-1 h-80 overflow-y-auto max-h-full max-w-full box-border max-[850px]:h-auto",children:e?(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsxs)("h4",{className:"mx-4 mb-2 mt-0 select-none",children:[u("nav.intrusionLog","Intrusion Log")," ",(0,Ie.jsx)(W,{to:"/intrusionlog",target:"_blank",className:"inline-flex align-text-bottom",children:(0,Ie.jsx)(c,{className:"h-4 w-4"})})]}),(0,Ie.jsx)("div",{className:"flex flex-col gap-2",style:{overflowY:"auto",maxHeight:"calc(100% - 40px)"},children:Y})]}):(0,Ie.jsx)(he,{alwaysOpen:!0,title:u("nav.intrusionLog","Intrusion Log"),children:(0,Ie.jsx)("div",{className:"flex flex-col gap-2 max-w-full [&>div]:h-auto [&>div]:rounded-[10px] [&>div]:max-w-full [&>p]:m-0 [&>p]:text-left",children:Y})})}),(0,Ie.jsx)("div",{className:"col-span-12 min-[851px]:col-span-6 box-border flex justify-center",children:void 0!==o?(0,Ie.jsx)(Qe,{subscriber:o,setDate:n,selectedDate:s,todaysScannedDeviceAmount:r??0,dateRangeOptionStart:l,dateRangeOptionStop:d,selectedZones:m}):(0,Ie.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,Ie.jsx)(i,{className:"h-8 w-8 animate-spin text-zinc-400","aria-hidden":"true"})})})]})}
1),(0,Ie.jsx)(ne,{open:f,close:D,onExited:M,preserveMapOnClose:!1,macAddress:b?.MAC_address??"",start:b?.start??"",stop:b?.stop??"",initialData:b,seenCount:j},b?`${b.MAC_address}|${b.start}`:"none")]})}var Ge=e(F(),1),et=400,tt=188,at=10,st=38,nt=et-st-14,ot=tt-at-80;function rt({dataCount:e,xAxisData:a,chartWidth:s,colors:n,dataType:o}){const r=U(),{t:i}=t(),l=(0,ze.useRef)(null),[d,c]=(0,ze.useState)(null),[m,h]=(0,ze.useState)(()=>"undefined"!=typeof window&&"dark"===localStorage.getItem("theme"));(0,ze.useEffect)(()=>{const e=()=>h("dark"===localStorage.getItem("theme"));return window.addEventListener("themeChange",e),()=>window.removeEventListener("themeChange",e)},[]);const u=m?"#ffffff":"#000000",f=m?"#374151":"#e5e7eb",x=a.filter(e=>""!==e),p=e.filter((e,t)=>""!==a[t]),{niceMax:g,step:b}=function(e){if(e<=0)return{niceMax:1,step:1};const t=e/5,a=10**Math.floor(Math.log10(t)),s=t/a;let n;n=s<=1?1:s<=2?2:s<=2.5?2.5:s<=5?5:10;const o=n*a;return{niceMax:Math.ceil(e/o)*o,step:o}}(Math.max(...p,1)),y=Math.round(g/b),j=Array.from({length:y+1},(e,t)=>t*b),w=p.length>0?nt/p.length:0,v=Math.min(.7*w,60),D=x.length<=1?0:Math.min(40,12*(x.length-1)+10),M=0===D?"middle":"end",Y=(e,t)=>{c({index:t,x:e.clientX,y:e.clientY})},N=p.map((e,t)=>({leftPct:(st+t*w+(w-v)/2)/et*100,widthPct:v/et*100})),S=at/tt*100,C=ot/tt*100;return(0,Ie.jsxs)("div",{className:"group relative w-full select-none px-4",style:s?{maxWidth:s}:void 0,children:[(0,Ie.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none absolute left-1/2 top-0 z-20 -translate-x-1/2 -translate-y-[calc(100%+4px)] whitespace-nowrap rounded-md bg-zinc-900 px-2.5 py-1 text-xs font-medium text-white opacity-0 shadow-md transition-opacity duration-150 group-hover:opacity-100 dark:bg-zinc-100 dark:text-zinc-900",children:i("dashboard.clickToViewIntrusions","Click to view intrusions")}),(0,Ie.jsxs)("div",{ref:l,className:"relative w-full",children:[(0,Ie.jsxs)("svg",{viewBox:"0 0 400 188",preserveAspectRatio:"xMidYMid meet",className:"pointer-events-none block h-auto w-full overflow-visible",role:"img","aria-label":i("dashboard.clickToViewIntrusions","Click to view intrusions"),children:[j.map(e=>{const t=at+ot-e/g*ot;return(0,Ie.jsxs)("g",{children:[(0,Ie.jsx)("line",{x1:st,y1:t,x2:st+nt,y2:t,stroke:f,strokeWidth:.5}),(0,Ie.jsx)("text",{x:st-4,y:t+3,fontSize:9,fontWeight:"bold",textAnchor:"end",fill:u,children:e})]},e)}),p.map((e,t)=>{const a=st+t*w+(w-v)/2,s=e/g*ot,o=at+ot-s;return(0,Ie.jsx)("rect",{x:a,y:o,width:v,height:s,fill:n[0],rx:2},x[t])}),x.map((e,t)=>{const a=st+t*w+w/2,s=at+ot+12;return(0,Ie.jsx)("text",{x:a,y:s,fontSize:8,fill:u,textAnchor:M,transform:`rotate(-${D} ${a} ${s})`,children:e},e)})]}),p.map((e,t)=>(0,Ie.jsx)("button",{type:"button","aria-label":`${x[t]}: ${e}`,onClick:()=>{return e=x[t],void r("/intrusionlog","serialNumber"===o?{state:{serialNumber:e}}:{state:{operatorId:e}});var e},onMouseEnter:e=>Y(e,t),onMouseMove:e=>Y(e,t),onMouseLeave:()=>c(null),onBlur:()=>c(null),className:"absolute cursor-pointer rounded-sm bg-transparent transition-colors hover:bg-zinc-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-secondary dark:hover:bg-zinc-700/40",style:{left:`${N[t].leftPct}%`,top:`${S}%`,width:`${N[t].widthPct}%`,height:`${C}%`}},`overlay-${x[t]}`))]}),d?(0,Ge.createPortal)((0,Ie.jsx)(it,{x:d.x,y:d.y,label:x[d.index],value:p[d.index],color:n[0]}),document.body):null]})}function it({x:e,y:t,label:a,value:s,color:n}){const o=(0,ze.useRef)(null),[r,i]=(0,ze.useState)({w:0,h:0});(0,ze.useEffect)(()=>{if(!o.current)return;const e=o.current.getBoundingClientRect();i({w:e.width,h:e.height})},[a,s]);const l=r.w/2,d=l+8,c="undefined"!=typeof window?window.innerWidth-l-8:e;return(0,Ie.jsx)("div",{ref:o,className:"pointer-events-none fixed z-[100] rounded-md border bg-popover px-3 py-2 text-sm text-popover-foreground shadow-md",style:{left:`${Math.min(Math.max(e,d),c)}px`,top:`${t}px`,transform:"translate(-50%, calc(-100% - 12px))"},children:(0,Ie.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Ie.jsx)("span",{className:"font-mono text-sm",children:a}),(0,Ie.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ie.jsx)("span",{"aria-hidden":"true",className:"h-2 w-2 rounded-full",style:{backgroundColor:n}}),(0,Ie.jsx)("span",{className:"text-sm font-medium",children:s})]})]})})}function lt(e,t){const a=document.documentElement.classList.contains("dark")?t:e,s=document.createElement("div");s.className=a,document.body.appendChild(s);const n=window.getComputedStyle(s).backgroundColor;return document.body.removeChild(s),n}function dt({dashboardLoading:e,topUasIds:a,topOperatorIds:s}){const{t:n}=t(),o=(0,ze.useRef)(null),r=function(e){const[t,a]=(0,ze.useState)(void 0);return(0,ze.useEffect)(()=>{const t=e.current;if(!t)return;const s=()=>a(t.offsetWidth);s();const n=new ResizeObserver(()=>s());return n.observe(t),()=>n.disconnect()},[e]),t}(o),l=(0,ze.useMemo)(()=>
1{if(!s)return null;const e=[],t=[];for(const a of s)a.operatorID&&(e.push(a.count),t.push(a.operatorID));return{counts:e,ids:t}},[s]),d=(0,Ie.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,Ie.jsx)(i,{className:"h-8 w-8 animate-spin text-zinc-400","aria-hidden":"true"})});return(0,Ie.jsx)("div",{className:"bg-white rounded-2xl p-4 dark:bg-dark-backgroundBox dark:text-white flex flex-col w-full min-w-0 h-full",children:(0,Ie.jsxs)("div",{ref:o,className:"min-w-0 overflow-hidden",children:[e?d:a?(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)("h4",{className:"mx-4 mb-2 mt-0 select-none",children:n("dashboard.topSerialNumbers","Top Serial Numbers")}),(0,Ie.jsx)(rt,{dataType:"serialNumber",dataCount:a.map(e=>e.count),xAxisData:a.map(e=>e.uas_id),chartWidth:r,colors:[lt("bg-tertiary","dark:bg-dark-tertiary")]})]}):null,e?d:l?(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)("h4",{className:"mx-4 mb-2 mt-0 select-none",children:n("dashboard.topKnownOperatorIds","Top Known Operator IDs")}),(0,Ie.jsx)(rt,{dataType:"operatorId",dataCount:l.counts,xAxisData:l.ids,chartWidth:r,colors:[lt("bg-secondary","dark:bg-dark-secondary")]})]}):null]})})}var ct=({visible:e})=>((0,ze.useEffect)(()=>{e&&function(){const e={startVelocity:45,spread:70,ticks:100,zIndex:1001,gravity:.8};s({...e,particleCount:80,origin:{x:0,y:.5},angle:60}),s({...e,particleCount:80,origin:{x:1,y:.5},angle:120}),setTimeout(()=>{s({...e,particleCount:60,origin:{x:0,y:.6},angle:55}),s({...e,particleCount:60,origin:{x:1,y:.6},angle:125})},300),setTimeout(()=>{s({...e,particleCount:40,origin:{x:0,y:.4},angle:65}),s({...e,particleCount:40,origin:{x:1,y:.4},angle:115})},550)}()},[e]),e?(0,Ie.jsx)("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center bg-black/20",children:(0,Ie.jsxs)("div",{className:"bg-white p-8 rounded-3xl shadow-xl max-w-sm w-full text-center animate-slide-up-simple mx-4",children:[(0,Ie.jsx)(ke,{}),(0,Ie.jsx)("h2",{className:"mt-4 text-xl font-semibold text-zinc-900",children:"Congratulations!"}),(0,Ie.jsx)("p",{className:"mt-2 text-zinc-600",children:"You have successfully added a Remote ID Pro to your account."})]})}):null);function mt(){const{data:e=[],isLoading:t}=N(),{data:a=[],isLoading:s}=be(),{data:n=[],isLoading:o}=w(),{data:r,isLoading:i}=C(),{data:l}=L(),d=U(),c=V(),m=ae("(min-width: 850px)"),[h,u]=(0,ze.useState)("All time"),[f,x]=(0,ze.useState)([]),[p,g]=(0,ze.useState)(!1),[b,y]=(0,ze.useState)(!1);(0,ze.useEffect)(()=>{if(c.state&&c.state.fromAddAirplate){y(!0),window.history.replaceState({},document.title);const e=setTimeout(()=>y(!1),8e3);return()=>clearTimeout(e)}},[c]);const{organizationId:j,subscriber:M,scanners:S,subscribedZones:k}=function({hasSubscriptionsData:e,hasSubscriptionsLoading:t,organizationScannersData:a,organizationScannersLoading:s,subscribedZonesData:n,subscribedZonesLoading:o,organizationIdData:r,organizationIdLoading:i}){const l=(0,ze.useMemo)(()=>{if(!i)return r??void 0},[i,r]),d=(0,ze.useMemo)(()=>Me(e,t),[t,e]);return{organizationId:l,subscriber:d,scanners:(0,ze.useMemo)(()=>{if(!s)return!1===d&&a&&a.length>0?ce(a.slice()):void 0},[s,a,d]),subscribedZones:(0,ze.useMemo)(()=>{if(!o)return d&&n?.length>0?n:void 0},[o,n,d])}}({hasSubscriptionsData:e,hasSubscriptionsLoading:t,organizationScannersData:a,organizationScannersLoading:s,subscribedZonesData:n,subscribedZonesLoading:o,organizationIdData:r,organizationIdLoading:i}),{data:O=[],isLoading:T}=z(),[A,B]=(0,ze.useState)(()=>(0,Oe.default)()),{scannedDevices:$,todaysScannedDevices:Z}=function(e,t,a){const{devices:s,isLoading:n}=D(e,t),{scannedDevices:o,todaysScannedDevices:r}=(0,ze.useMemo)(()=>{if(n)return{scannedDevices:null,todaysScannedDevices:void 0};const t=(Array.isArray(s)?s:[]).filter(e=>!v(e));if(e.isSame((0,Oe.default)(),"day")){const e=new Map,s=t=>{const a=`${t.MAC_address}-${t.start}-${t.stop}`;e.set(a,t)};t.forEach(s),(Array.isArray(a)?a:[]).forEach(s);const n=Array.from(e.values()).sort((e,t)=>new Date(t.start).getTime()-new Date(e.start).getTime());return{scannedDevices:n,todaysScannedDevices:n}}return{scannedDevices:t,todaysScannedDevices:void 0}},[s,n,e,a]);return{scannedDevices:o,todaysScannedDevices:r,isLoading:n}}(A,M??!1,O),[P,R]=(0,ze.useState)(null),[E,_]=(0,ze.useState)(null),F=Ye($),W=(0,ze.useCallback)((e,t,a)=>{d("/map",{replace:!0,state:{fromNewDashboard:!0,longitude:e,latitude:t,..."number"==typeof a?{zoom:a}:{}}})},[d]),q=(0,ze.useCallback)((e,t,a,s,n,o)=>{const r=o?.operator?.location,i=Number(o?.time?.deviceTime),l=Number.isFinite(i)&&i>0?1e3*i:void 0;
1Y.getState().setFocusDrone(a??null,s??null,n??null,o,e,t,void 0!==r?.longitude?Number(r.longitude):void 0,void 0!==r?.latitude?Number(r.latitude):void 0,r?.operator_location_type,l),d("/map",{state:{fromNewDashboard:!0,longitude:e,latitude:t,mac_address:a}})},[d]),H=(0,ze.useMemo)(()=>0===f.length||f.length===k?.length?M?void 0:S?.map(e=>e.IMEI.toString()):f.map(e=>e.id.toString()),[f,k,M,S]),{data:K,isPending:Q}=I(M,P,E,H),J=(0,ze.useCallback)(e=>{B(e)},[]),G=(0,ze.useCallback)((e,t,a)=>{R(e),_(t),u(a),B(!t||(0,Oe.default)(t).isAfter((0,Oe.default)())?(0,Oe.default)():(0,Oe.default)(t))},[]);return(0,ze.useEffect)(()=>{!1===M&&(s||a&&0===a.length&&d("/"))},[M,s,a,d]),function({subscribedZones:e,scanners:t,setSelectedZones:a}){(0,ze.useEffect)(()=>{if(!e&&!t)return;const s=new Set;if(e)for(const t of e)s.add(String(t.id));else if(t)for(const e of t)s.add(String(e.IMEI));a(e=>{const t=e.filter(e=>s.has(String(e.id)));return t.length===e.length?e:t})},[e,t,a])}({subscribedZones:k,scanners:S,setSelectedZones:x}),(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)(we,{}),(0,Ie.jsxs)("div",{className:"absolute top-0 left-0 w-full h-screen bg-backgroundNav dark:bg-dark-backgroundNav overflow-x-hidden",children:[(0,Ie.jsx)(X,{title:`${te.clientName} - Dashboard`}),(0,Ie.jsx)("div",{className:"ml-0 w-full max-lg:ml-0 max-lg:w-full lg:ml-64 lg:w-[calc(100vw-256px)] flex flex-col pl-3 max-md:pl-2 max-md:!pr-2 pr-8 py-4 pt-3 mt-12 min-h-screen font-primary font-semibold bg-background dark:bg-dark-background overflow-x-hidden overflow-y-auto",children:(0,Ie.jsx)("div",{className:"w-full",children:(0,Ie.jsxs)("div",{className:"grid grid-cols-12 gap-3 w-full font-primary font-semibold",children:[(0,Ie.jsx)("div",{className:"col-span-12",children:(0,Ie.jsx)(Ve,{handleDateRangeChanges:G,subscribedZones:k,scanners:S,selectedZones:f,setSelectedZones:x,dashboardLoading:Q,dashboardData:K,selectedOption:h,intrusionLogDate:A,dateRangeOptionStart:P,dateRangeOptionStop:E,setPdfLoading:g})}),f.length>0&&(0,Ie.jsx)("div",{className:"col-span-12",children:(0,Ie.jsx)(Ae,{selectedZones:f,setSelectedZones:x})}),(0,Ie.jsx)("div",{className:"col-span-12 min-[851px]:col-span-6",children:(0,Ie.jsx)(je,{pdfLoading:p,organizationId:j,onOpenMap:q,onLocateScanner:W,showCounter:!0})}),(0,Ie.jsx)("div",{className:"col-span-12 min-[851px]:col-span-6",children:(0,Ie.jsx)(Te,{isDesktop:m,subscribedZones:k,scanners:S,wolfpacks:l,batteryVoltageOffProcentive:3.1,onLocateScanner:W,onLocateZone:W})}),(0,Ie.jsx)("div",{className:"col-span-12",children:(0,Ie.jsx)(qe,{dashboardLoading:Q,dashboardData:K,selectedOption:h})}),(0,Ie.jsx)("div",{className:"col-span-12",children:(0,Ie.jsx)(Je,{isDesktop:m,scannedDevices:$,intrusionLogDate:A,setIntrusionLogDate:J,subscriber:M,todaysScannedDeviceAmount:Z?.length,dateRangeOptionStart:P,dateRangeOptionStop:E,selectedZones:f,getSeenCount:F})}),(0,Ie.jsx)("div",{className:"col-span-12 min-[851px]:col-span-6 h-full",children:(0,Ie.jsx)(dt,{dashboardLoading:Q,topUasIds:K?.topUasIds,topOperatorIds:K?.topOperatorIds})}),(0,Ie.jsx)("div",{className:"col-span-12 min-[851px]:col-span-6 h-full",children:(0,Ie.jsx)(He,{dashboardLoading:Q,heatmapData:K?.heatmapData,scanners:S,subscribedZones:k,dateRangeOptionStart:P,dateRangeOptionStop:E,containerClassName:"min-h-[420px] h-full relative overflow-hidden w-full !p-0 rounded-2xl",loadingWrapperClassName:"bg-white rounded-2xl dark:bg-dark-backgroundBox dark:text-white flex flex-col w-full min-w-0 h-full !p-0"})})]})})}),(0,Ie.jsx)(ue,{})]}),(0,Ie.jsx)(ct,{visible:b})]})}export{mt 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.