@rfkit/charts 1.18.1 → 1.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/index.d.ts +1 -1
- package/index.js +12 -8
- package/modules/Level/publish.d.ts +3 -0
- package/package.json +2 -2
- package/types/publish.d.ts +8 -1
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! LICENSE: index.js.LICENSE.txt */
|
|
2
|
-
let e;import{Fragment as t,jsx as r,jsxs as n}from"react/jsx-runtime";import a,{Children as i,createContext as o,createElement as l,forwardRef as s,memo as c,useCallback as u,useContext as d,useEffect as h,useImperativeHandle as p,useLayoutEffect as f,useMemo as m,useRef as g,useState as b,useSyncExternalStore as v}from"react";import{Dial as y,DialDirectionLabelMode as w,Fluorescence as x,FluorescenceRenderMode as k,Gauge as S,GraphicType as M,Heatmap as
|
|
2
|
+
let e;import{Fragment as t,jsx as r,jsxs as n}from"react/jsx-runtime";import a,{Children as i,createContext as o,createElement as l,forwardRef as s,memo as c,useCallback as u,useContext as d,useEffect as h,useImperativeHandle as p,useLayoutEffect as f,useMemo as m,useRef as g,useState as b,useSyncExternalStore as v}from"react";import{Dial as y,DialDirectionLabelMode as w,Fluorescence as x,FluorescenceRenderMode as k,Gauge as S,GraphicType as M,Heatmap as F,IQ as C,IQEye as D,OrientationType as z,Series as N,hexToRGBA as E}from"@rfkit/renderer";import T,{createPortal as R,flushSync as A}from"react-dom";import{ExtraDataMode as I,LevelStreamAnalyzer as P,SeriesManager as L,SpectrumAnalyzer as O,WaterfallAnalyzer as q}from"@rfkit/spectrum-analyzer";import*as $ from"react";import*as _ from"react-dom";var j,H,B={},W={};function G(e){var t=W[e];if(void 0!==t)return t.exports;var r=W[e]={id:e,exports:{}};return B[e](r,r.exports,G),r.exports}G.m=B,G.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return G.d(t,{a:t}),t},G.d=(e,t,r)=>{var n=(t,r)=>{for(var n in t)G.o(t,n)&&!G.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,[r]:t[n]})};n(t,"get"),n(r,"value")},G.add=function(e){Object.assign(G.m,e)},G.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),G.nc=void 0,G.add({75143(e,t,r){var n=r(6445),a=/*#__PURE__*/r.n(n),i=r(79134),o=(/*#__PURE__*/r.n(i))()(a());o.push([e.id,`/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
3
3
|
@layer properties {
|
|
4
4
|
@supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
|
|
5
5
|
[data-rfkit-charts-root], [data-rfkit-charts-root] {
|
|
@@ -397,6 +397,10 @@ let e;import{Fragment as t,jsx as r,jsxs as n}from"react/jsx-runtime";import a,{
|
|
|
397
397
|
top: -200%;
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
+
[data-rfkit-charts-root] .top-\\[4px\\] {
|
|
401
|
+
top: 4px;
|
|
402
|
+
}
|
|
403
|
+
|
|
400
404
|
[data-rfkit-charts-root] .top-\\[10px\\] {
|
|
401
405
|
top: 10px;
|
|
402
406
|
}
|
|
@@ -3716,12 +3720,12 @@ let e;import{Fragment as t,jsx as r,jsxs as n}from"react/jsx-runtime";import a,{
|
|
|
3716
3720
|
filter: blur(var(--tw-exit-blur, 0));
|
|
3717
3721
|
}
|
|
3718
3722
|
}
|
|
3719
|
-
`,""]),r.d(t,{},{A:o})},79134(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r}).join("")},t.i=function(e,r,n,a,i){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(n)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(o[s]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);n&&o[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),r&&(u[2]&&(u[1]="@media ".concat(u[2]," {").concat(u[1],"}")),u[2]=r),a&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=a):u[4]="".concat(a)),t.push(u))}},t}},6445(e){e.exports=function(e){return e[1]}},28557(e){var t=[];function r(e){for(var r=-1,n=0;n<t.length;n++)if(t[n].identifier===e){r=n;break}return r}function n(e,n){for(var a={},i=[],o=0;o<e.length;o++){var l=e[o],s=n.base?l[0]+n.base:l[0],c=a[s]||0,u="".concat(s," ").concat(c);a[s]=c+1;var d=r(u),h={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==d)t[d].references++,t[d].updater(h);else{var p=function(e,t){var r=t.domAPI(t);return r.update(e),function(t){t?(t.css!==e.css||t.media!==e.media||t.sourceMap!==e.sourceMap||t.supports!==e.supports||t.layer!==e.layer)&&r.update(e=t):r.remove()}}(h,n);n.byIndex=o,t.splice(o,0,{identifier:u,updater:p,references:1})}i.push(u)}return i}e.exports=function(e,a){var i=n(e=e||[],a=a||{});return function(e){e=e||[];for(var o=0;o<i.length;o++){var l=r(i[o]);t[l].references--}for(var s=n(e,a),c=0;c<i.length;c++){var u=r(i[c]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}i=s}}},61898(e){var t={};e.exports=function(e,r){var n=function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}(e);if(!n)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(r)}},20081(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},21669(e,t,r){e.exports=function(e){var t=r.nc;t&&e.setAttribute("nonce",t)}},27802(e){e.exports=function(e){if("u"<typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(r){var n,a,i;n="",r.supports&&(n+="@supports (".concat(r.supports,") {")),r.media&&(n+="@media ".concat(r.media," {")),(a=void 0!==r.layer)&&(n+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),n+=r.css,a&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}"),(i=r.sourceMap)&&"u">typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(n,t,e.options)},remove:function(){var e;null===(e=t).parentNode||e.parentNode.removeChild(e)}}}},55214(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}});let Y=G("75143"),U=G("55214");var X=/*#__PURE__*/G.n(U);let K=G("21669");var V=/*#__PURE__*/G.n(K);let Q=G("61898");var Z=/*#__PURE__*/G.n(Q);let J=G("27802");var ee=/*#__PURE__*/G.n(J);let et=G("20081");var er=/*#__PURE__*/G.n(et);let en=G("28557");var ea=/*#__PURE__*/G.n(en),ei={};ei.styleTagTransform=X(),ei.setAttributes=V(),ei.insert=Z().bind(null,"head"),ei.domAPI=ee(),ei.insertStyleElement=er();var eo=ea()(Y.A,ei);let el=Y.A&&Y.A.locals?Y.A.locals:void 0,es=(e,t,r)=>({name:e,base:t,weight:r,mode:"alpha"}),ec=(e,t,r,n,a="srgb",i=t)=>({name:e,base:t,second:r,weight:n,mode:"mix",space:a,fallback:i}),eu=[ec("--signal-level-unassigned","--success","--background",.35,"oklab"),ec("--signal-level-first","--success","--background",.55,"oklab"),ec("--signal-level-second","--success","--background",.75,"oklab"),ec("--mix-bg76-fg24","--background","--foreground",.76),ec("--mix-bg64-fg36","--background","--foreground",.64),es("--mix-border-40","--border",.4),es("--mix-border-60","--border",.6),es("--mix-border-70","--border",.7),es("--mix-border-72","--border",.72),es("--mix-border-80","--border",.8),es("--mix-background-60","--background",.6),es("--mix-background-70","--background",.7),es("--mix-background-72","--background",.72),es("--mix-background-75","--background",.75),es("--mix-background-80","--background",.8),es("--mix-background-82","--background",.82),es("--mix-background-86","--background",.86),es("--mix-background-90","--background",.9),es("--mix-background-95","--background",.95),es("--mix-background-98","--background",.98),es("--mix-secondary-15","--secondary",.15),es("--mix-secondary-20","--secondary",.2),es("--mix-secondary-40","--secondary",.4),es("--mix-secondary-50","--secondary",.5),es("--mix-secondary-60","--secondary",.6),es("--mix-secondary-70","--secondary",.7),es("--mix-secondary-80","--secondary",.8),es("--mix-secondary-82","--secondary",.82),es("--mix-secondary-92","--secondary",.92),es("--mix-foreground-18","--foreground",.18),es("--mix-foreground-20","--foreground",.2),es("--mix-foreground-24","--foreground",.24),es("--mix-foreground-28","--foreground",.28),es("--mix-foreground-32","--foreground",.32),es("--mix-foreground-42","--foreground",.42),es("--mix-foreground-80","--foreground",.8),es("--mix-foreground-85","--foreground",.85),es("--mix-foreground-90","--foreground",.9),es("--mix-accent-72","--accent",.72),es("--mix-accent-80","--accent",.8),es("--mix-primary-28","--primary",.28),es("--mix-primary-50","--primary",.5),es("--mix-primary-70","--primary",.7),es("--mix-primary-90","--primary",.9),es("--mix-warning-10","--warning",.1),es("--mix-warning-12","--warning",.12),es("--mix-warning-24","--warning",.24),es("--mix-destructive-10","--destructive",.1),es("--mix-destructive-12","--destructive",.12),es("--mix-destructive-24","--destructive",.24),es("--mix-destructive-90","--destructive",.9),es("--mix-chart-surface-12","--chart-surface",.12),es("--mix-chart-highlight-80","--chart-highlight",.8),es("--mix-chart-panel-95","--chart-panel",.95),es("--mix-popover-95","--popover",.95),es("--mix-ring-50","--ring",.5)],ed=e=>{let t=e.slice(1);if(![3,4,6,8].includes(t.length))return null;let r=t.length<=4?t.split("").map(e=>e+e).join(""):t,n=8===r.length,a=Number.parseInt(r.slice(0,2),16),i=Number.parseInt(r.slice(2,4),16),o=Number.parseInt(r.slice(4,6),16),l=n?Number.parseInt(r.slice(6,8),16)/255:1;return[a,i,o,l].every(Number.isFinite)?{r:a,g:i,b:o,a:l}:null},eh=e=>{let t=e.trim().match(/^rgba?\(\s*([^)]+)\s*\)$/i);if(!t)return null;let r=t[1].split(",").map(e=>Number.parseFloat(e.trim())),[n,a,i]=r,o=r.length>=4?r[3]:1;return r.length>=3&&[n,a,i,o].every(Number.isFinite)?{r:n,g:a,b:i,a:o}:null},ep=e=>{let t=e.trim();return t?t.startsWith("#")?ed(t):eh(t):null},ef=e=>Math.min(1,Math.max(0,e)),em=(e,t,r)=>{let n=ef(r);return{r:Math.round(e.r*n+t.r*(1-n)),g:Math.round(e.g*n+t.g*(1-n)),b:Math.round(e.b*n+t.b*(1-n)),a:e.a*n+t.a*(1-n)}},eg=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,eb=e=>Math.round(Math.min(255,Math.max(0,255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)))),ev=e=>{let t=eg(e.r/255),r=eg(e.g/255),n=eg(e.b/255),a=Math.cbrt(.4122214708*t+.5363325363*r+.0514459929*n),i=Math.cbrt(.2119034982*t+.6806995451*r+.1073969566*n),o=Math.cbrt(.0883024619*t+.2817188376*r+.6299787005*n);return{L:.2104542553*a+.793617785*i-.0040720468*o,a:1.9779984951*a-2.428592205*i+.4505937099*o,b:.0259040371*a+.7827717662*i-.808675766*o}},ey=e=>{let t=e.L+.3963377774*e.a+.2158037573*e.b,r=e.L-.1055613458*e.a-.0638541728*e.b,n=e.L-.0894841775*e.a-1.291485548*e.b,a=t**3,i=r**3,o=n**3;return{r:eb(4.0767416621*a-3.3077115913*i+.2309699292*o),g:eb(-1.2684380046*a+2.6097574011*i-.3413193965*o),b:eb(-.0041960863*a-.7034186147*i+1.707614701*o),a:1}},ew=(e,t,r)=>{let n=ef(r),a=ev(e),i=ev(t);return{...ey({L:a.L*n+i.L*(1-n),a:a.a*n+i.a*(1-n),b:a.b*n+i.b*(1-n)}),a:e.a*n+t.a*(1-n)}},ex=e=>`rgb(${e.r}, ${e.g}, ${e.b})`,ek=e=>Number(e.toFixed(4)),eS=e=>`rgba(${e.r}, ${e.g}, ${e.b}, ${ek(e.a)})`,eM=(e,t,r)=>{let n=(t,a)=>{if(a.has(t))return null;a.add(t);let i=e.find(e=>e.name===t);if(!i)return null;let o=i[r].trim(),l=o.match(/^var\((--[\w-]+)\)$/);return l?n(l[1],a):ep(o)?o:null};return n(t,new Set)},eC=e=>"mix"===e.mode?e.fallback??e.base:e.base,eF=(e,t,r)=>{if("mix"===e.mode){let n=eM(t,e.base,r),a=eM(t,e.second,r),i=n?ep(n):null,o=a?ep(a):null;if(i&&o){let t="oklab"===e.space?ew(i,o,e.weight):em(i,o,e.weight);return t.a>=1?ex(t):eS(t)}return`var(${eC(e)})`}let n=eM(t,e.base,r),a=n?ep(n):null;return a?eS({...a,a:a.a*e.weight}):`var(${eC(e)})`},eD=(e,t)=>eu.map(r=>` ${r.name}: ${eF(r,e,t)};`).join("\n"),ez="data-rfkit-charts-root",eN=`[${ez}]`,eE="true",eT="data-rfkit-charts-portal",eR={"cursor-follow":97,tooltip:98,popover:98,"dropdown-menu":98,dialog:99},eA={"--radius":"0px","--radius-sm":"0px","--radius-md":"0px","--radius-lg":"0px","--radius-xl":"0px","--radius-micro":"0px","--radius-control":"0px","--radius-group":"0px","--radius-surface":"0px","--radius-pill":"9999px","--size-border-radius-second":"var(--radius-control)"},eI=e=>{for(let[t,r]of(e.setAttribute(ez,"true"),Object.entries(eA)))e.style.setProperty(t,r)},eP=e=>{if("u"<typeof document)return null;let t=`div[${eT}="${e}"]`,r=document.body.querySelector(t);if(r)return r.style.position="relative",r.style.zIndex=String(eR[e]??98),r.style.isolation="isolate",r;let n=document.createElement("div");return n.setAttribute(eT,e),n.setAttribute("data-rfkit-charts-portal-users","0"),eI(n),n.style.position="relative",n.style.zIndex=String(eR[e]??98),n.style.isolation="isolate",document.body.appendChild(n),n},eL="theme",eO="theme-follow-OS",eq="size",e$={Dark:"dark",Light:"light"},e_={Middle:"middle",Small:"small"},ej=e$.Light,eH=!0,eB=e_.Middle,eW=()=>"u">typeof window&&"u">typeof document,eG=()=>{if(eW())return window.matchMedia("(prefers-color-scheme: dark)")},eY=e=>e===e$.Light||e===e$.Dark,eU=()=>{let e=eG();return e?.matches?e$.Dark:e$.Light},eX=()=>{if(!eW())return{followOS:!0,theme:ej};let e=document.documentElement.getAttribute(eL);return{followOS:"false"!==document.documentElement.getAttribute(eO),theme:eY(e)?e:ej}},eK=()=>eX().theme,eV=()=>eX().followOS,eQ=({followOS:e,theme:t})=>{eW()&&(document.documentElement.setAttribute(eL,t),document.documentElement.setAttribute(eO,JSON.stringify(e)))},eZ={accent:"--accent",accentForeground:"--accent-foreground",background:"--background",border:"--border",card:"--card",cardForeground:"--card-foreground",destructive:"--destructive",destructiveForeground:"--destructive-foreground",foreground:"--foreground",input:"--input",muted:"--muted",mutedForeground:"--muted-foreground",popover:"--popover",popoverForeground:"--popover-foreground",primary:"--primary",primaryForeground:"--primary-foreground",radius:"--radius",ring:"--ring",secondary:"--secondary",secondaryForeground:"--secondary-foreground",success:"--success",successForeground:"--success-foreground",warning:"--warning",warningForeground:"--warning-foreground"},eJ={grid:"--chart-grid",gridStrong:"--chart-grid-strong",highlight:"--chart-highlight",panel:"--chart-panel",panelForeground:"--chart-panel-foreground",surface:"--chart-surface"},e0={font:{base:"--size-font-base",max:"--size-font-max",second:"--size-font-second"},radius:{base:"--size-border-radius-base",second:"--size-border-radius-second"},spacing:{base:"--size-gap-base"}},e1={accent:{dark:"var(--secondary)",light:"var(--secondary)"},accentForeground:{dark:"var(--foreground)",light:"var(--foreground)"},background:{dark:"#202020",light:"#FFFFFF"},border:{dark:"#313131",light:"#F0F0F0"},card:{dark:"var(--background)",light:"var(--background)"},cardForeground:{dark:"var(--foreground)",light:"var(--foreground)"},destructive:{dark:"#F76965",light:"#F53F3F"},destructiveForeground:{dark:"#FFFFFF",light:"#FFFFFF"},foreground:{dark:"#FFFFFF",light:"#1D2129"},input:{dark:"var(--border)",light:"var(--border)"},muted:{dark:"#2F2F2F",light:"#E1E2E8"},mutedForeground:{dark:"rgba(255, 255, 255, 0.7)",light:"rgba(29, 33, 41, 0.7)"},popover:{dark:"var(--background)",light:"var(--background)"},popoverForeground:{dark:"var(--foreground)",light:"var(--foreground)"},primary:{dark:"#4371F8",light:"#2A51F7"},primaryForeground:{dark:"#FFFFFF",light:"#FFFFFF"},radius:{dark:"var(--size-border-radius-base)",light:"var(--size-border-radius-base)"},ring:{dark:"var(--primary)",light:"var(--primary)"},secondary:{dark:"#29292B",light:"#F0F1F3"},secondaryForeground:{dark:"var(--foreground)",light:"var(--foreground)"},success:{dark:"#23C343",light:"#00B42A"},successForeground:{dark:"#FFFFFF",light:"#FFFFFF"},warning:{dark:"#FF9626",light:"#FF7D00"},warningForeground:{dark:"#FFFFFF",light:"#FFFFFF"}},e2={grid:{dark:"rgba(255, 255, 255, 0.12)",light:"rgba(29, 33, 41, 0.12)"},gridStrong:{dark:"rgba(255, 255, 255, 0.28)",light:"rgba(29, 33, 41, 0.28)"},highlight:{dark:"var(--primary)",light:"var(--primary)"},panel:{dark:"rgba(32, 32, 32, 0.96)",light:"rgba(255, 255, 255, 0.96)"},panelForeground:{dark:"var(--foreground)",light:"var(--foreground)"},surface:{dark:"var(--secondary)",light:"var(--secondary)"}},e5={base:{middle:"14px",small:"12px"},max:{middle:"16px",small:"14px"},second:{middle:"12px",small:"10px"}},e4={base:{middle:"8px",small:"4px"},second:{middle:"4px",small:"2px"}},e3={base:{middle:"8px",small:"4px"}},e6=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,r])=>[e,{...r,...t?.[e]??{}}])),e8=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,r])=>[e,{...r,...t?.[e]??{}}])),e9=(e={})=>{let t=e6(e1,e.semantic),r=e6(e2,e.chart);return[...Object.entries(eZ).map(([e,r])=>({name:r,...t[e]})),...Object.entries(eJ).map(([e,t])=>({name:t,...r[e]}))]},e7=(e={})=>{let t=e8(e5,e.font),r=e8(e3,e.spacing),n=e8(e4,e.radius);return[...Object.entries(e0.font).map(([e,r])=>({name:r,...t[e]})),...Object.entries(e0.spacing).map(([e,t])=>({name:t,...r[e]})),...Object.entries(e0.radius).map(([e,t])=>({name:t,...n[e]}))]},te="rfkit-charts-root-theme-style-target",tt="rfkit-charts-theme-style-target",tr="rfkit-charts-size-style-target",tn=(e,t)=>e.map(e=>` ${e.name}: ${e[t]};`).join("\n"),ta=(e,t)=>`${e} {
|
|
3723
|
+
`,""]),r.d(t,{},{A:o})},79134(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r}).join("")},t.i=function(e,r,n,a,i){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(n)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(o[s]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);n&&o[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),r&&(u[2]&&(u[1]="@media ".concat(u[2]," {").concat(u[1],"}")),u[2]=r),a&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=a):u[4]="".concat(a)),t.push(u))}},t}},6445(e){e.exports=function(e){return e[1]}},28557(e){var t=[];function r(e){for(var r=-1,n=0;n<t.length;n++)if(t[n].identifier===e){r=n;break}return r}function n(e,n){for(var a={},i=[],o=0;o<e.length;o++){var l=e[o],s=n.base?l[0]+n.base:l[0],c=a[s]||0,u="".concat(s," ").concat(c);a[s]=c+1;var d=r(u),h={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==d)t[d].references++,t[d].updater(h);else{var p=function(e,t){var r=t.domAPI(t);return r.update(e),function(t){t?(t.css!==e.css||t.media!==e.media||t.sourceMap!==e.sourceMap||t.supports!==e.supports||t.layer!==e.layer)&&r.update(e=t):r.remove()}}(h,n);n.byIndex=o,t.splice(o,0,{identifier:u,updater:p,references:1})}i.push(u)}return i}e.exports=function(e,a){var i=n(e=e||[],a=a||{});return function(e){e=e||[];for(var o=0;o<i.length;o++){var l=r(i[o]);t[l].references--}for(var s=n(e,a),c=0;c<i.length;c++){var u=r(i[c]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}i=s}}},61898(e){var t={};e.exports=function(e,r){var n=function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}(e);if(!n)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(r)}},20081(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},21669(e,t,r){e.exports=function(e){var t=r.nc;t&&e.setAttribute("nonce",t)}},27802(e){e.exports=function(e){if("u"<typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(r){var n,a,i;n="",r.supports&&(n+="@supports (".concat(r.supports,") {")),r.media&&(n+="@media ".concat(r.media," {")),(a=void 0!==r.layer)&&(n+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),n+=r.css,a&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}"),(i=r.sourceMap)&&"u">typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(n,t,e.options)},remove:function(){var e;null===(e=t).parentNode||e.parentNode.removeChild(e)}}}},55214(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}});let Y=G("75143"),U=G("55214");var X=/*#__PURE__*/G.n(U);let K=G("21669");var V=/*#__PURE__*/G.n(K);let Q=G("61898");var Z=/*#__PURE__*/G.n(Q);let J=G("27802");var ee=/*#__PURE__*/G.n(J);let et=G("20081");var er=/*#__PURE__*/G.n(et);let en=G("28557");var ea=/*#__PURE__*/G.n(en),ei={};ei.styleTagTransform=X(),ei.setAttributes=V(),ei.insert=Z().bind(null,"head"),ei.domAPI=ee(),ei.insertStyleElement=er();var eo=ea()(Y.A,ei);let el=Y.A&&Y.A.locals?Y.A.locals:void 0,es=(e,t,r)=>({name:e,base:t,weight:r,mode:"alpha"}),ec=(e,t,r,n,a="srgb",i=t)=>({name:e,base:t,second:r,weight:n,mode:"mix",space:a,fallback:i}),eu=[ec("--signal-level-unassigned","--success","--background",.35,"oklab"),ec("--signal-level-first","--success","--background",.55,"oklab"),ec("--signal-level-second","--success","--background",.75,"oklab"),ec("--mix-bg76-fg24","--background","--foreground",.76),ec("--mix-bg64-fg36","--background","--foreground",.64),es("--mix-border-40","--border",.4),es("--mix-border-60","--border",.6),es("--mix-border-70","--border",.7),es("--mix-border-72","--border",.72),es("--mix-border-80","--border",.8),es("--mix-background-60","--background",.6),es("--mix-background-70","--background",.7),es("--mix-background-72","--background",.72),es("--mix-background-75","--background",.75),es("--mix-background-80","--background",.8),es("--mix-background-82","--background",.82),es("--mix-background-86","--background",.86),es("--mix-background-90","--background",.9),es("--mix-background-95","--background",.95),es("--mix-background-98","--background",.98),es("--mix-secondary-15","--secondary",.15),es("--mix-secondary-20","--secondary",.2),es("--mix-secondary-40","--secondary",.4),es("--mix-secondary-50","--secondary",.5),es("--mix-secondary-60","--secondary",.6),es("--mix-secondary-70","--secondary",.7),es("--mix-secondary-80","--secondary",.8),es("--mix-secondary-82","--secondary",.82),es("--mix-secondary-92","--secondary",.92),es("--mix-foreground-18","--foreground",.18),es("--mix-foreground-20","--foreground",.2),es("--mix-foreground-24","--foreground",.24),es("--mix-foreground-28","--foreground",.28),es("--mix-foreground-32","--foreground",.32),es("--mix-foreground-42","--foreground",.42),es("--mix-foreground-80","--foreground",.8),es("--mix-foreground-85","--foreground",.85),es("--mix-foreground-90","--foreground",.9),es("--mix-accent-72","--accent",.72),es("--mix-accent-80","--accent",.8),es("--mix-primary-28","--primary",.28),es("--mix-primary-50","--primary",.5),es("--mix-primary-70","--primary",.7),es("--mix-primary-90","--primary",.9),es("--mix-warning-10","--warning",.1),es("--mix-warning-12","--warning",.12),es("--mix-warning-24","--warning",.24),es("--mix-destructive-10","--destructive",.1),es("--mix-destructive-12","--destructive",.12),es("--mix-destructive-24","--destructive",.24),es("--mix-destructive-90","--destructive",.9),es("--mix-chart-surface-12","--chart-surface",.12),es("--mix-chart-highlight-80","--chart-highlight",.8),es("--mix-chart-panel-95","--chart-panel",.95),es("--mix-popover-95","--popover",.95),es("--mix-ring-50","--ring",.5)],ed=e=>{let t=e.slice(1);if(![3,4,6,8].includes(t.length))return null;let r=t.length<=4?t.split("").map(e=>e+e).join(""):t,n=8===r.length,a=Number.parseInt(r.slice(0,2),16),i=Number.parseInt(r.slice(2,4),16),o=Number.parseInt(r.slice(4,6),16),l=n?Number.parseInt(r.slice(6,8),16)/255:1;return[a,i,o,l].every(Number.isFinite)?{r:a,g:i,b:o,a:l}:null},eh=e=>{let t=e.trim().match(/^rgba?\(\s*([^)]+)\s*\)$/i);if(!t)return null;let r=t[1].split(",").map(e=>Number.parseFloat(e.trim())),[n,a,i]=r,o=r.length>=4?r[3]:1;return r.length>=3&&[n,a,i,o].every(Number.isFinite)?{r:n,g:a,b:i,a:o}:null},ep=e=>{let t=e.trim();return t?t.startsWith("#")?ed(t):eh(t):null},ef=e=>Math.min(1,Math.max(0,e)),em=(e,t,r)=>{let n=ef(r);return{r:Math.round(e.r*n+t.r*(1-n)),g:Math.round(e.g*n+t.g*(1-n)),b:Math.round(e.b*n+t.b*(1-n)),a:e.a*n+t.a*(1-n)}},eg=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,eb=e=>Math.round(Math.min(255,Math.max(0,255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)))),ev=e=>{let t=eg(e.r/255),r=eg(e.g/255),n=eg(e.b/255),a=Math.cbrt(.4122214708*t+.5363325363*r+.0514459929*n),i=Math.cbrt(.2119034982*t+.6806995451*r+.1073969566*n),o=Math.cbrt(.0883024619*t+.2817188376*r+.6299787005*n);return{L:.2104542553*a+.793617785*i-.0040720468*o,a:1.9779984951*a-2.428592205*i+.4505937099*o,b:.0259040371*a+.7827717662*i-.808675766*o}},ey=e=>{let t=e.L+.3963377774*e.a+.2158037573*e.b,r=e.L-.1055613458*e.a-.0638541728*e.b,n=e.L-.0894841775*e.a-1.291485548*e.b,a=t**3,i=r**3,o=n**3;return{r:eb(4.0767416621*a-3.3077115913*i+.2309699292*o),g:eb(-1.2684380046*a+2.6097574011*i-.3413193965*o),b:eb(-.0041960863*a-.7034186147*i+1.707614701*o),a:1}},ew=(e,t,r)=>{let n=ef(r),a=ev(e),i=ev(t);return{...ey({L:a.L*n+i.L*(1-n),a:a.a*n+i.a*(1-n),b:a.b*n+i.b*(1-n)}),a:e.a*n+t.a*(1-n)}},ex=e=>`rgb(${e.r}, ${e.g}, ${e.b})`,ek=e=>Number(e.toFixed(4)),eS=e=>`rgba(${e.r}, ${e.g}, ${e.b}, ${ek(e.a)})`,eM=(e,t,r)=>{let n=(t,a)=>{if(a.has(t))return null;a.add(t);let i=e.find(e=>e.name===t);if(!i)return null;let o=i[r].trim(),l=o.match(/^var\((--[\w-]+)\)$/);return l?n(l[1],a):ep(o)?o:null};return n(t,new Set)},eF=e=>"mix"===e.mode?e.fallback??e.base:e.base,eC=(e,t,r)=>{if("mix"===e.mode){let n=eM(t,e.base,r),a=eM(t,e.second,r),i=n?ep(n):null,o=a?ep(a):null;if(i&&o){let t="oklab"===e.space?ew(i,o,e.weight):em(i,o,e.weight);return t.a>=1?ex(t):eS(t)}return`var(${eF(e)})`}let n=eM(t,e.base,r),a=n?ep(n):null;return a?eS({...a,a:a.a*e.weight}):`var(${eF(e)})`},eD=(e,t)=>eu.map(r=>` ${r.name}: ${eC(r,e,t)};`).join("\n"),ez="data-rfkit-charts-root",eN=`[${ez}]`,eE="true",eT="data-rfkit-charts-portal",eR={"cursor-follow":97,tooltip:98,popover:98,"dropdown-menu":98,dialog:99},eA={"--radius":"0px","--radius-sm":"0px","--radius-md":"0px","--radius-lg":"0px","--radius-xl":"0px","--radius-micro":"0px","--radius-control":"0px","--radius-group":"0px","--radius-surface":"0px","--radius-pill":"9999px","--size-border-radius-second":"var(--radius-control)"},eI=e=>{for(let[t,r]of(e.setAttribute(ez,"true"),Object.entries(eA)))e.style.setProperty(t,r)},eP=e=>{if("u"<typeof document)return null;let t=`div[${eT}="${e}"]`,r=document.body.querySelector(t);if(r)return r.style.position="relative",r.style.zIndex=String(eR[e]??98),r.style.isolation="isolate",r;let n=document.createElement("div");return n.setAttribute(eT,e),n.setAttribute("data-rfkit-charts-portal-users","0"),eI(n),n.style.position="relative",n.style.zIndex=String(eR[e]??98),n.style.isolation="isolate",document.body.appendChild(n),n},eL="theme",eO="theme-follow-OS",eq="size",e$={Dark:"dark",Light:"light"},e_={Middle:"middle",Small:"small"},ej=e$.Light,eH=!0,eB=e_.Middle,eW=()=>"u">typeof window&&"u">typeof document,eG=()=>{if(eW())return window.matchMedia("(prefers-color-scheme: dark)")},eY=e=>e===e$.Light||e===e$.Dark,eU=()=>{let e=eG();return e?.matches?e$.Dark:e$.Light},eX=()=>{if(!eW())return{followOS:!0,theme:ej};let e=document.documentElement.getAttribute(eL);return{followOS:"false"!==document.documentElement.getAttribute(eO),theme:eY(e)?e:ej}},eK=()=>eX().theme,eV=()=>eX().followOS,eQ=({followOS:e,theme:t})=>{eW()&&(document.documentElement.setAttribute(eL,t),document.documentElement.setAttribute(eO,JSON.stringify(e)))},eZ={accent:"--accent",accentForeground:"--accent-foreground",background:"--background",border:"--border",card:"--card",cardForeground:"--card-foreground",destructive:"--destructive",destructiveForeground:"--destructive-foreground",foreground:"--foreground",input:"--input",muted:"--muted",mutedForeground:"--muted-foreground",popover:"--popover",popoverForeground:"--popover-foreground",primary:"--primary",primaryForeground:"--primary-foreground",radius:"--radius",ring:"--ring",secondary:"--secondary",secondaryForeground:"--secondary-foreground",success:"--success",successForeground:"--success-foreground",warning:"--warning",warningForeground:"--warning-foreground"},eJ={grid:"--chart-grid",gridStrong:"--chart-grid-strong",highlight:"--chart-highlight",panel:"--chart-panel",panelForeground:"--chart-panel-foreground",surface:"--chart-surface"},e0={font:{base:"--size-font-base",max:"--size-font-max",second:"--size-font-second"},radius:{base:"--size-border-radius-base",second:"--size-border-radius-second"},spacing:{base:"--size-gap-base"}},e1={accent:{dark:"var(--secondary)",light:"var(--secondary)"},accentForeground:{dark:"var(--foreground)",light:"var(--foreground)"},background:{dark:"#202020",light:"#FFFFFF"},border:{dark:"#313131",light:"#F0F0F0"},card:{dark:"var(--background)",light:"var(--background)"},cardForeground:{dark:"var(--foreground)",light:"var(--foreground)"},destructive:{dark:"#F76965",light:"#F53F3F"},destructiveForeground:{dark:"#FFFFFF",light:"#FFFFFF"},foreground:{dark:"#FFFFFF",light:"#1D2129"},input:{dark:"var(--border)",light:"var(--border)"},muted:{dark:"#2F2F2F",light:"#E1E2E8"},mutedForeground:{dark:"rgba(255, 255, 255, 0.7)",light:"rgba(29, 33, 41, 0.7)"},popover:{dark:"var(--background)",light:"var(--background)"},popoverForeground:{dark:"var(--foreground)",light:"var(--foreground)"},primary:{dark:"#4371F8",light:"#2A51F7"},primaryForeground:{dark:"#FFFFFF",light:"#FFFFFF"},radius:{dark:"var(--size-border-radius-base)",light:"var(--size-border-radius-base)"},ring:{dark:"var(--primary)",light:"var(--primary)"},secondary:{dark:"#29292B",light:"#F0F1F3"},secondaryForeground:{dark:"var(--foreground)",light:"var(--foreground)"},success:{dark:"#23C343",light:"#00B42A"},successForeground:{dark:"#FFFFFF",light:"#FFFFFF"},warning:{dark:"#FF9626",light:"#FF7D00"},warningForeground:{dark:"#FFFFFF",light:"#FFFFFF"}},e2={grid:{dark:"rgba(255, 255, 255, 0.12)",light:"rgba(29, 33, 41, 0.12)"},gridStrong:{dark:"rgba(255, 255, 255, 0.28)",light:"rgba(29, 33, 41, 0.28)"},highlight:{dark:"var(--primary)",light:"var(--primary)"},panel:{dark:"rgba(32, 32, 32, 0.96)",light:"rgba(255, 255, 255, 0.96)"},panelForeground:{dark:"var(--foreground)",light:"var(--foreground)"},surface:{dark:"var(--secondary)",light:"var(--secondary)"}},e5={base:{middle:"14px",small:"12px"},max:{middle:"16px",small:"14px"},second:{middle:"12px",small:"10px"}},e4={base:{middle:"8px",small:"4px"},second:{middle:"4px",small:"2px"}},e3={base:{middle:"8px",small:"4px"}},e6=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,r])=>[e,{...r,...t?.[e]??{}}])),e8=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,r])=>[e,{...r,...t?.[e]??{}}])),e9=(e={})=>{let t=e6(e1,e.semantic),r=e6(e2,e.chart);return[...Object.entries(eZ).map(([e,r])=>({name:r,...t[e]})),...Object.entries(eJ).map(([e,t])=>({name:t,...r[e]}))]},e7=(e={})=>{let t=e8(e5,e.font),r=e8(e3,e.spacing),n=e8(e4,e.radius);return[...Object.entries(e0.font).map(([e,r])=>({name:r,...t[e]})),...Object.entries(e0.spacing).map(([e,t])=>({name:t,...r[e]})),...Object.entries(e0.radius).map(([e,t])=>({name:t,...n[e]}))]},te="rfkit-charts-root-theme-style-target",tt="rfkit-charts-theme-style-target",tr="rfkit-charts-size-style-target",tn=(e,t)=>e.map(e=>` ${e.name}: ${e[t]};`).join("\n"),ta=(e,t)=>`${e} {
|
|
3720
3724
|
${t}
|
|
3721
3725
|
}`,ti=(e,t)=>{let r=[tn(e,e$.Light),eD(e,e$.Light)].join("\n"),n=[tn(e,e$.Dark),eD(e,e$.Dark)].join("\n");return[ta(t.default,r),ta(t.light,r),ta(t.dark,n),`@media (prefers-color-scheme: dark) {
|
|
3722
3726
|
${ta(` ${t.systemDark}`,n)}
|
|
3723
|
-
}`].join("\n\n")},to=e=>{let t=tn(e,"middle"),r=tn(e,"small");return[ta(":root",t),ta(`:root[size='${eB}']`,t),ta(":root[size='small']",r)].join("\n\n")},tl=(e,t)=>{if(!eW())return;let r=`style[${e}]`,n=document.head.querySelector(r);if(n){n.textContent!==t&&(n.textContent=t);return}let a=document.createElement("style");a.textContent=t,a.setAttribute(e,"true"),document.head.appendChild(a)},ts=({tokens:e}={})=>{tl("rfkit-charts-root-theme-style-target",ti(getCanonicalThemeVariableDefinitions(e),{default:":root",light:`:root[theme='${ThemeType.Light}'][${THEME_FOLLOW_OS_KEY}='false']`,dark:`:root[theme='${ThemeType.Dark}'][${THEME_FOLLOW_OS_KEY}='false']`,systemDark:`:root:not([${THEME_FOLLOW_OS_KEY}='false'])`}))},tc=({tokens:e}={})=>{tl("rfkit-charts-theme-style-target",ti(e9(e),{default:eN,light:`:root[theme='${e$.Light}'][${eO}='false'] ${eN}`,dark:`:root[theme='${e$.Dark}'][${eO}='false'] ${eN}`,systemDark:`:root:not([${eO}='false']) ${eN}`}))},tu=e=>{tl("rfkit-charts-size-style-target",to(e7(e)))},td=(e={})=>{let{sizes:t,tokens:r}=e;ts({tokens:r}),tu(t)},th=(e={})=>{let{sizes:t,tokens:r}=e;tc({tokens:r}),tu(t)},tp=Symbol.for("rfkit.charts.runtime"),tf=()=>({datas:new Set,subscriptions:new Set}),tm=e=>{let t=e?.datas??{},r=e?.subscriptions??{},n=e?.owners??{};for(let e of Object.keys(n)){let t=n[e];t.datas??=new Set,t.subscriptions??=new Set}return{datas:t,subscriptions:r,owners:n}},tg=()=>"u">typeof window?window:globalThis,tb=()=>{let e=tg();if("u">typeof window&&window.charts){let t=tm(window.charts);return window.charts=t,e[tp]=t,t}e[tp]||(e[tp]=tm(void 0));let t=tm(e[tp]);return e[tp]=t,"u">typeof window&&(window.charts=t),t},tv=tb();tv.datas||(tv.datas={});let ty=e=>(tv.owners[e]||(tv.owners[e]=tf()),tv.owners[e]),tw=(e,t,r)=>{e&&t&&ty(e)[r].add(t)},tx=e=>{let t=tv.owners[e];t&&0===t.datas.size&&0===t.subscriptions.size&&delete tv.owners[e]},tk=(e,t)=>{for(let r of Object.keys(tv.owners))tv.owners[r][t].delete(e),tx(r)};function tS(e,t,r,n){let a=tv.datas;return tw(n,e,"datas"),e in a?void 0!==t&&(a[e]=t):a[e]=t??r,a[e]??r}tv.subscriptions||(tv.subscriptions={});let tM=tv.subscriptions;function tC(e,t,r,n){if(!e)throw Error("createSubscriptionManager 订阅失效");return"function"==typeof r&&t?(tM[e]||(tM[e]={}),tM[e][t]=r,tw(n,e,"subscriptions"),()=>{tM[e]?.[t]===r&&delete tM[e][t],tM[e]&&0===Object.keys(tM[e]).length&&(delete tM[e],tk(e,"subscriptions"))}):(...t)=>{let r=tM[e];if(r)for(let e in r)r[e](...t)}}function tF(e,t,r,n,a){return"function"==typeof n&&r?tC(e,r,n,a):(...r)=>{let n=tM[e];if(!n)return!1;for(let e of Object.keys(n).sort((e,r)=>t(r)-t(e)))if(!0===n[e](...r))return!0;return!1}}let tD=e=>`PUB_SUB-${e}`,tz=(e,t)=>`passThrough-${e}-${t}`,tN=e=>`withDatabase-${e}`,tE=e=>`withSpectrumAnalyzerSYNC-${e}`,tT=e=>`withWaterfallAnalyzerSYNC-${e}`,tR=e=>`withUpdateData-${e}`,tA=(e,t,r="0")=>tC(tD(e),r,t,e),tI=(e,t,r,n="0")=>tC(tz(e,t),n,r,e);function tP(e){let t=e.filter(e=>"string"==typeof e&&e.length>0);if(0!==t.length)for(let e of t){let t=tv.owners[e];if(t){for(let e of Array.from(t.datas))delete tv.datas[e],tk(e,"datas");for(let e of Array.from(t.subscriptions))delete tM[e],tk(e,"subscriptions");delete tv.owners[e]}}}let tL=()=>({getAllRawData:()=>({realData:new Float32Array,maxData:new Float32Array,minData:new Float32Array,avgData:new Float32Array,thresholdData:new Float32Array,templateData:new Float32Array,backgroundNoiseData:new Float32Array,waterfallData:[],levelStreamData:{probabilityRangeData:new Float32Array,spectrumData:new Float32Array,timestampData:new Float32Array},occupancyData:new Float32Array,extraData:{},srcIndexCache:new Uint32Array})});function tO(e,t){return e?tS(tN(e),t,tL(),e):tL()}let tq=(e,t,r)=>tC(tR(e),t,r,e),t$=(e,t)=>tC(`setScanDF360Prob-${e}`,"0",t,e);function t_(e,t){return e?tS(tE(e),t,null,e):t??null}function tj(e,t){return e?tS(tT(e),t,null,e):t??null}function tH(){let e={current:null},t={current:[]},r={current:!1},n={current:!1},a={current:!1},i={current:[]},o=new Set,l=0,s=null,c=e=>{let t=!0,r=()=>{t&&(t=!1,o.delete(r),e())};return o.add(r),r},u=()=>{if(a.current)return;a.current=!0;let t=l,r=()=>{s=null,queueMicrotask(()=>{t===l&&e.current&&(()=>{let e=l;if(a.current=!1,n.current=!0,d(),e!==l)return;let t=i.current;for(let r of(i.current=[],t)){if(!r.active||e!==l)continue;let t=r.callback();"function"==typeof t&&(r.cleanup=c(t),r.active&&e===l||r.cleanup())}})()})};if("u">typeof window&&"function"==typeof window.requestAnimationFrame){let e=window.requestAnimationFrame(r);s=()=>window.cancelAnimationFrame(e);return}let o=setTimeout(r,0);s=()=>clearTimeout(o)},d=()=>{if(!e.current||0===t.current.length)return;let r=t.current;t.current=[];let n=l,a=e.current;for(let e of r){if(n!==l)return;a(e)}},h=a=>{e.current&&n.current?e.current(a):(t.current.push(a),r.current&&e.current&&u())};return{attachPublish:t=>{if(e.current=t,r.current){n.current=!1,u();return}r.current=!0,n.current=!1,u()},dispose:()=>{for(let e of(l+=1,s?.(),s=null,Array.from(o)))e();o.clear(),t.current=[],i.current=[],e.current=null,r.current=!1,n.current=!1,a.current=!1},enhancedPublish:Object.assign(h,{getSourceData:()=>e.current?.getSourceData?e.current.getSourceData():tL(),isReady:()=>r.current,onReady:t=>{if(r.current&&e.current&&n.current){let e=l,r=t();if("function"==typeof r){let t=c(r);return e!==l&&t(),t}return}let a={callback:t,active:!0};return i.current.push(a),r.current&&e.current&&u(),()=>{a.active&&(a.active=!1,i.current=i.current.filter(e=>e!==a),a.cleanup&&a.cleanup())}},resetViewport:()=>{e.current?.resetViewport?.()}}),publish:h}}function tB(e,t){let r=s((t,r)=>{let n=g(null);n.current||(n.current=tH());let i=n.current,o=u(e=>{i.attachPublish(e)},[i]);h(()=>()=>i.dispose(),[i]),p(r,()=>i.enhancedPublish,[i]);let l={...t,publish:o};return a.createElement(e,l)});return r.displayName=`withChartPublisher(${t})`,r}function tW(e){if(!e?.length)return{};let t=-1/0,r=0;for(let n=0;n<e.length;n+=1){let a=e[n];a>t&&(t=a,r=n)}return{max:t,maxIndex:r}}function tG(e){if(!e?.length)return 0;let t=1/0,r=0;for(let n=0;n<e.length;n+=1){let a=e[n];a<t&&(t=a,r=n)}return{min:t,minIndex:r}}let tY=e=>Number.isFinite(Number(e));function tU(e){if(!e)return{};let t=0,r=0,n=1/0,a=-1/0,i=0,o=0;for(let l of e)tY(l)&&(l<n&&(n=l,i=t),l>a&&(a=l,o=t),r+=l,t+=1);return 0===t?{}:{min:n,minIndex:i,max:a,maxIndex:o,avg:r/t}}function tX(e,t){if(e<0||t<0||e>t)throw Error("Invalid index range");return e+Math.floor((t-e)/2)}let tK="DCHARTS_CONFIG",tV={ZOOM_MIN_RANGE:10,POPOVER_MARGIN:16},tQ="#A855F7",tZ={line:{realData:{name:"realData",color:"#86c56a",thickness:1,label:"实时值",display:!0},maxData:{name:"maxData",color:"#eb5b5b",thickness:1,label:"最大值",display:!0},minData:{name:"minData",color:"#4a65bf",thickness:1,label:"最小值",display:!1},avgData:{name:"avgData",color:"#f9c14e",thickness:1,label:"平均值",display:!1},thresholdData:{name:"thresholdData",color:tQ,thickness:1,label:"门限值",display:!0},templateData:{name:"templateData",color:"#e38888",thickness:1,label:"模板",display:!0},backgroundNoiseData:{name:"backgroundNoiseData",color:"#2bb3cb",thickness:1,label:"背景噪声",display:!0}},gradient:{item:[["#FF0000","#FFEB3B","#2DB333","#00BCD4","#0000FF","#000000"],["#FF3636","#2DF16A","#3B4FFF"],["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],["#d73027","#f46d43","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],["#5e4fa2","#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],["#FFFFFF","#000000"]],index:0},levelStream:{line:"#4a65bf",statisticsTime:10},bar:"rgba(100, 211, 211, 211)",iq:{pointColor:"#ff0000",lineColor:"#00ff00"},marker:["#35E065","#F98116","#FF4325","#3CE5D3","#F64FA1","#AA74E8","#FFE184","#B1E3FF","#C8141F","#FFA3CC","#BACFFF","#45D2FF","#AEDF2F","#E7FF84","#B88AFF","#FF00B4","#FFD0E3","#EEAE94"]},tJ=(e={})=>{let t=JSON.parse(localStorage.getItem(tK)||"{}"),r={...tZ,...t,...e};localStorage.setItem(tK,JSON.stringify(r))};function t0(e){let t=tZ??JSON.parse(localStorage.getItem(tK)||"null");return t||(tJ(),t=tZ),e?t[e]:t}let t1=()=>t0("line"),t2=(e=0)=>{let{item:t,index:r}=t0("gradient");return t[void 0!==r?r:e]},t5=t0("line"),t4=Object.keys(t5),t3=t5.realData.name,t6=tV.ZOOM_MIN_RANGE,t8=tV.POPOVER_MARGIN;var t9=/*#__PURE__*/function(e){return e.Hz="Hz",e.kHz="kHz",e.MHz="MHz",e.GHz="GHz",e}({}),t7=/*#__PURE__*/function(e){return e.Outside="outside",e.Inside="inside",e}({}),re=/*#__PURE__*/function(e){return e.Auto="auto",e.Frequency="frequency",e.CenterBandwidth="center-bandwidth",e}({}),rt=/*#__PURE__*/function(e){return e.SingleFrequency="singleFrequency",e.Scan="scan",e.MScan="mscan",e.ScanDF360="scanDF360",e.DDC="ddc",e.Lite="lite",e.LiteNormalized="liteNormalized",e.LevelStream="levelStream",e.IQEye="iqEye",e.IQLine="iqLine",e.IQPlanisphere="iqPlanisphere",e.IQStream="iqStream",e.Heatmap="heatmap",e.Occupancy="occupancy",e.AudioWaveform="audioWaveform",e}({}),rr=/*#__PURE__*/function(e){return e.Spectrum="spectrum",e.Heatmap="heatmap",e.Fluorescence="fluorescence",e.Occupancy="occupancy",e.LevelStream="levelStream",e.Dial="dial",e.Gauge="gauge",e.IQStream="iqStream",e.IQPlanisphere="iqPlanisphere",e.IQEye="iqEye",e.IQLine="iqLine",e.SpatialSpectrum="spatialSpectrum",e.AudioWaveform="audioWaveform",e}({}),rn=/*#__PURE__*/function(e){return e.Spectrum="spectrum",e.AntennaFactor="antennaFactor",e.Signal="signal",e.Occupancy="occupancy",e.LevelStream="levelStream",e.Heatmap="heatmap",e.Fluorescence="fluorescence",e.IQ="iq",e.AudioWaveform="audioWaveform",e.Dial="dial",e.Gauge="gauge",e.Series="series",e.SpectrumBandwidth="spectrumBandwidth",e.Segments="segments",e.Channels="channels",e.Marker="marker",e.Reset="reset",e.Resize="resize",e.Clear="clear",e.Option="option",e.Render="render",e}({}),ra=/*#__PURE__*/function(e){return e.HeatmapCapture="heatmapCapture",e}({}),ri=/*#__PURE__*/function(e){return e.Cover="cover",e.Focus="focus",e}({}),ro=/*#__PURE__*/function(e){return e.Add="add",e.Del="del",e.Clear="clear",e.Update="update",e}({}),rl=/*#__PURE__*/function(e){return e.AxisX="axisX",e.AxisY="axisY",e.Band="band",e.Blaze="blaze",e.Cursor="cursor",e.DragFrame="dragFrame",e.Dropdown="dropdown",e.EventBus="eventBus",e.FrequencyAllocation="frequencyAllocation",e.FrequencyDataBoard="frequencyDataBoard",e.FrequencyTagLine="frequencyTagLine",e.GridLines="gridLines",e.GaugeBox="gaugeBox",e.HeatmapCapture="heatmapCapture",e.Legend="legend",e.Limit="limit",e.Markers="markers",e.Scope="scope",e.SegmentsZebra="segmentsZebra",e.Signal="signal",e.SignalAnalysis="signalAnalysis",e.Square="square",e.Stripe="stripe",e.Zoom="zoom",e.Frame="frame",e.Area="area",e}({}),rs=/*#__PURE__*/function(e){return e.AutorangingSwitch="AutorangingSwitch",e.UnitSwitch="UnitSwitch",e.StepSwitch="StepSwitch",e.GradientRibbon="GradientRibbon",e.HeatmapCaptureSwitch="HeatmapCaptureSwitch",e.TimeRangeSwitch="TimeRangeSwitch",e.SpacerLine="SpacerLine",e.Reset="Reset",e.StationAllocationSwitch="StationAllocationSwitch",e.SeriesControl="SeriesControl",e.FrequencyAllocationSwitch="FrequencyAllocationSwitch",e.ZoomSwitch="ZoomSwitch",e.LimitSwitch="LimitSwitch",e.MarkersSwitch="MarkersSwitch",e.FrequencyTagLineSwitch="FrequencyTagLineSwitch",e.SignalAnalysisSwitch="SignalAnalysisSwitch",e.StripeSwitch="StripeSwitch",e.CursorSwitch="CursorSwitch",e.CursorFindRowSwitch="CursorFindRowSwitch",e.SignalSwitch="SignalSwitch",e.SegmentsDisplayControl="SegmentsDisplayControl",e.SeriesDisplayControl="SeriesDisplayControl",e.FluorescenceSwitch="FluorescenceSwitch",e.DeltaMeasurementSwitch="DeltaMeasurementSwitch",e}({}),rc=/*#__PURE__*/function(e){return e.RealData="realData",e.MaxData="maxData",e.MinData="minData",e.AvgData="avgData",e.ThresholdData="thresholdData",e.TemplateData="templateData",e.BackgroundNoiseData="backgroundNoiseData",e}({});let ru=e=>!!(e.show&&e.active&&e.event?.sourceType===rr.Spectrum),rd=new Set(["auto","clip","hidden","overlay","scroll"]),rh=e=>e?.split(" ").some(e=>rd.has(e.trim()))??!1,rp=(e,t,r,n)=>({left:e,top:t,right:r,bottom:n,width:Math.max(0,r-e),height:Math.max(0,n-t)}),rf=e=>{let t=e.getBoundingClientRect(),r=t.left,n=t.top,a=t.right,i=t.bottom;"u">typeof window&&(r=Math.max(r,0),n=Math.max(n,0),a=Math.min(a,window.innerWidth),i=Math.min(i,window.innerHeight));let o=e.parentElement;for(;o&&o!==document.body;){let e=window.getComputedStyle(o),t=rh(e.overflowX)||rh(e.overflow),l=rh(e.overflowY)||rh(e.overflow);if(t||l){let e=o.getBoundingClientRect();e.width>0&&e.height>0&&(t&&(r=Math.max(r,e.left),a=Math.min(a,e.right)),l&&(n=Math.max(n,e.top),i=Math.min(i,e.bottom)))}o=o.parentElement}return rp(r,n,a,i)},rm=(e,t=6)=>{if(!e&&0!==e)return"";let r=Number.parseFloat(e.toFixed(t));return Number.isFinite(r)?String(r):""};function rg(e){return e?.slice(0,3)==="dBm"}let rb=(e,t)=>(Object.defineProperty(e,"totalPoints",{value:t,enumerable:!1,configurable:!0}),e),rv=e=>{let{totalPoints:t,startFrequency:r,stopFrequency:n,index:a=0}=e,i=n-r;return 1===t?[{frequency:rm(r),startLeft:100*a/t,endLeft:(a+1)*100/t}]:Array(t).fill(0).map((e,n)=>({frequency:rm(r+n/(t-1)*i),startLeft:(a+n)*100/t,endLeft:(a+n+1)*100/t}))},ry=e=>{if(!e?.length)return()=>"";let t=e.totalPoints,r=e.map((r,n)=>{let{point:a}=r;return{ll:100*a/t,frequencyCache:r.frequencyCache,startLeft:0===n?0:e.slice(0,n).reduce((e,r)=>e+100*r.point/t,0)}});return t=>{if(t<=0)return String(e[0]?.start);if(t>=100)return String(e[e.length-1]?.stop);let n=0,a=r.length-1;for(;n<=a;){let e=n+a>>>1,{startLeft:i,ll:o}=r[e];if(t>=i&&t<i+o){let{frequencyCache:n}=r[e],a=Math.min(Math.ceil((t-i)/o*n.length)-1,n.length-1);return n[a]?.frequency??""}t<i?a=e-1:n=e+1}return""}},rw=(e,t)=>t<=1?0:Math.max(0,Math.min(t-1,Math.ceil(Math.max(0,Math.min(100,e))*t/100)-1));function rx(e){let t=e.length;return r=>{if(0!==t)return e[rw(r,t)]}}let rk=e=>{if(!e)return 0;let{segments:t}=e;if(!t)return 0;let r=t.totalPoints,{endLeft:n,startLeft:a}=e,i=n-a,o=Math.abs(i);i<0&&(a=e.endLeft,n=e.startLeft);let l=0,s=!1;for(let e=0;e<t.length;e+=1){let{step:i,start:c,stop:u,point:d}=t[e],h=100*d/r,p=i/1e3,f=a-h<=0,m=n-h<=0;if(!s&&f&&m)return Math.round(o/h*d)*p;if(f&&!s&&(s=!0,l+=Math.round((1-a/h)*d)*p),m)return l+Math.round(n/h*d)*p;a<0&&!m&&(l+=u-c),a-=h,n-=h}return 0},rS=e=>{let{frequency:t,bandwidth:r,totalPoints:n}=e,a=t-r/2e3,i=t+r/2e3;if(a<=0||i<=0)return[];let o=rv({totalPoints:n,startFrequency:a,stopFrequency:i,stepFrequency:r/n});return rb([{frequency:t,bandwidth:r,step:i-a,start:a,stop:i,index:0,label:"",point:n,percentage:1,progress:[0,100],frequencyCache:o}],n)},rM=e=>rb([{frequency:0,bandwidth:0,step:1,start:0,stop:e,index:0,label:"Data",point:e,percentage:1,progress:[0,100],frequencyCache:[]}],e),rC=e=>{if(!e?.length)return[];let t=e.reduce((e,{startFrequency:t,stopFrequency:r,stepFrequency:n})=>e+Math.round((r-t)*1e3/n)+1,0),r=0;return rb(e.map(({startFrequency:e,stopFrequency:n,stepFrequency:a,label:i})=>{let o=Math.round((n-e)*1e3/a)+1,l=r,s=rv({totalPoints:o,startFrequency:e,stopFrequency:n,stepFrequency:a,index:l});return r+=o,{start:e,stop:n,step:a,index:l,label:i,point:o,percentage:o/t,progress:[100*l/t,100*r/t],frequencyCache:s}}),t)},rF=(e,t=3)=>{let r,n;if(!e&&0!==e)return{value:0,unit:t9.Hz,formatted:`0 ${t9.Hz}`};let a=Math.abs(e);a>=1e6?(r=e/1e6,n=t9.GHz):a>=1e3?(r=e/1e3,n=t9.MHz):a>=1?(r=e,n=t9.kHz):(r=1e3*e,n=t9.Hz);let i=Number.parseFloat(r.toFixed(t)).toString(),o=`${i} ${n}`;return{value:r,unit:n,formatted:o}},rD=(e,t=3)=>rF(1e3*e,t),rz=(e,t=3)=>rF(e/1e3,t),rN=5,rE=2;function rT(e){if(null!=e.frequency&&null!=e.bandwidth){let t=e.bandwidth/1e3/2;return{startFreq:e.frequency-t,stopFreq:e.frequency+t}}return null!=e.startFrequency&&null!=e.stopFrequency?{startFreq:Number(e.startFrequency),stopFreq:Number(e.stopFrequency)}:null}function rR(e,t){let r=t.stop-t.start,n=Math.ceil((e.startFreq-t.start)/r*t.point)-1,a=Math.floor((e.stopFreq-t.start)/r*t.point)-1;return{startIndex:n=Math.max(n,0),stopIndex:a=Math.min(a,t.point-1)}}function rA(e,t,r=5){let{startIndex:n,stopIndex:a}=rR(e,t),i=t.frequencyCache,o=n,l=a;for(let a=Math.max(0,n-r);a<=Math.min(t.point-1,n+r);a++)if(Number(i[a]?.frequency)>=e.startFreq){o=a;break}for(let n=Math.max(0,a-r);n<=Math.min(t.point-1,a+r);n++){let t=Number(i[n]?.frequency);if(t<=e.stopFreq&&(l=n),t>e.stopFreq)break}return{startIndex:n=Math.max(o,0),stopIndex:a=Math.min(l,t.point-1)}}function rI(e,t){let r=(e.stopIndex-e.startIndex+1)/t.point*100;return{left:e.startIndex/t.point*100,width:r}}function rP(e,t){let r=rA(e,t);return{...rI(r,t),...r}}function rL(e,t){if(!t?.length)return{segmentIndex:-1,pointIndex:-1};let r=t.reduce((e,t)=>e+t.point,0),n=0,a=e/100;for(let e=0;e<t.length;e++){let i=t[e].point/r;if(a>=n&&a<=n+i){let r=(a-n)/i,o=Math.max(0,Math.min(t[e].point-1,Math.ceil(r*t[e].point)-1));return{segmentIndex:e,pointIndex:o}}n+=i}return{segmentIndex:-1,pointIndex:-1}}function rO(e,t){let r=e[t.segmentIndex];if(!r?.frequencyCache?.length)return 0/0;let n=Math.max(0,Math.min(r.frequencyCache.length-1,t.pointIndex));return Number(r.frequencyCache[n]?.frequency)}function rq(e,t,r=2){return!(e+r<t.startIndex||e-r>t.stopIndex)}function r$(e,t){return e>=t.startFreq&&e<=t.stopFreq}function r_(e,t){return!(e.stopFreq<t.start||e.startFreq>t.stop)}let rj=e=>"[object Object]"===Object.prototype.toString.call(e)&&null!==e,rH=(e,t)=>{let r={...e};return Object.keys(r).forEach(e=>{let n=t[e];rj(n)&&rj(r[e])?r[e]={...r[e],...n}:void 0!==n&&(r[e]=n)}),r};function rB(e=()=>{},t=1e3/30){let r=0;return(...n)=>{let a=Date.now();a-r>=t&&(e(...n),r=a)}}function rW(e=()=>{}){let t=!1,r=null,n=null,a=a=>{a?.nativeEvent&&a.persist&&a.persist(),r=a?.currentTarget?{currentTarget:a.currentTarget,target:a.target??null,clientX:a.clientX,clientY:a.clientY,buttons:a.buttons,nativeEvent:a.nativeEvent,_originalEvent:a}:a,t||(t=!0,n=requestAnimationFrame(()=>{n=null,t=!1;let a=r;r=null,e(a)}))};return a.flush=()=>{if(!t)return;null!==n&&cancelAnimationFrame(n),n=null,t=!1;let a=r;r=null,e(a)},a.cancel=()=>{null!==n&&cancelAnimationFrame(n),n=null,t=!1,r=null},a}function rG(e=()=>{},t){let r=null;return n=>{r&&clearTimeout(r),r=setTimeout(()=>{e(n)},t||100)}}let rY=(e,t=1e3/30)=>{let r=null,n=(...n)=>{r&&clearTimeout(r),r=setTimeout(()=>{e(...n)},t)};return n.cancel=()=>{r&&(clearTimeout(r),r=null)},n};function rU(e=()=>{}){let t=!1;return(...r)=>{t||(t=!0,requestAnimationFrame(()=>{e(...r),t=!1}))}}let rX=(e=Date.now(),t)=>{if(null==e)return"";let r=0;"number"==typeof e?(r=e)>0&&r<1e10&&(r*=1e3):r=e.getTime();let n=new Date(r);if(!Number.isFinite(n.getTime()))return"";let{dateSeparator:a="-",timeSeparator:i=":",timeOnly:o=!1}=t??{},l=n.getFullYear(),s=`${n.getMonth()+1}`.padStart(2,"0"),c=`${n.getDate()}`.padStart(2,"0"),u=`${n.getHours()}`.padStart(2,"0"),d=`${n.getMinutes()}`.padStart(2,"0"),h=`${n.getSeconds()}`.padStart(2,"0"),p=`${u}${i}${d}${i}${h}`;if(o)return p;let f=`${l}${a}${s}${a}${c}`;return`${f} ${p}`},rK=(e,t="-",r=":",n=!1)=>{if("string"!=typeof e)return console.error("dateTimeToTimestamp: 输入必须是字符串"),-1;let a=0,i=0,o=0,l=0,s=0,c=0;if(n){let t=e.split(r);if(3!==t.length)return -1;l=parseInt(t[0],10)||0,s=parseInt(t[1],10)||0,c=parseInt(t[2],10)||0;let n=new Date;return new Date(n.getFullYear(),n.getMonth(),n.getDate(),l,s,c).getTime()}let u=e.split(" ");if(2!==u.length)return -1;let[d,h]=u,p=d.split(t);if(3!==p.length)return -1;a=parseInt(p[0],10)||0,i=parseInt(p[1],10)||0,o=parseInt(p[2],10)||0;let f=h.split(r);return 3!==f.length?-1:(l=parseInt(f[0],10)||0,new Date(a,i-1,o,l,s=parseInt(f[1],10)||0,c=parseInt(f[2],10)||0).getTime())},rV=()=>((1+Math.random())*65536|0).toString(16).substring(1),rQ=Symbol.for("rfkit.charts.id-counter"),rZ=()=>{if(globalThis.crypto?.randomUUID)return globalThis.crypto.randomUUID();let e=globalThis,t=(e[rQ]??0)+1;return e[rQ]=t,`rfkit-${t.toString(36)}`},rJ=(e,t)=>e&&Array.isArray(e)?Array.from({length:e.length},(r,n)=>{let a=e[n],i=new Float32Array(a.length);return i.set(a),i.timestamp=t?.[n],i}):[],r0={Position:"position",CenterBandwidth:"centerBandwidth",FrequencyRange:"frequencyRange"},r1={kind:r0.Position,show:!1,left:void 0,width:0,color:""},r2=(e,t)=>Object.hasOwn(e,t),r5=e=>"number"==typeof e&&Number.isFinite(e),r4=e=>void 0===e||"string"==typeof e,r3=e=>void 0===e||null!==e&&"object"==typeof e&&!Array.isArray(e)&&["name","organization","modulation","remark"].every(t=>{let r=e[t];return void 0===r||"string"==typeof r}),r6=e=>(!Object.hasOwn(e,"show")||"boolean"==typeof e.show)&&(!Object.hasOwn(e,"color")||void 0===e.color||"string"==typeof e.color)&&r4(e.label)&&r3(e.details),r8=(e,t,r)=>{let n=Object.hasOwn(e,"label")?e.label:"merge"===r?t.label:void 0,a=Object.hasOwn(e,"details")?e.details:"merge"===r?t.details:void 0;return{show:"boolean"==typeof e.show?e.show:"merge"!==r||t.show,color:Object.hasOwn(e,"color")?e.color:"merge"===r?t.color:void 0,...void 0!==n||void 0!==t.label?{label:n}:{},...void 0!==a||void 0!==t.details?{details:a}:{}}};function r9(e,t=r1,r="replace"){if(!r6(e))return t;let n=Object.hasOwn(e,"left")||Object.hasOwn(e,"width"),a=Object.hasOwn(e,"frequency")||Object.hasOwn(e,"bandwidth"),i=Object.hasOwn(e,"startFrequency")||Object.hasOwn(e,"stopFrequency");if(Number(n)+Number(a)+Number(i)>1)return t;let o=r8(e,t,r);if(a)return r5(e.frequency)&&r5(e.bandwidth)&&!(e.bandwidth<=0)?{kind:r0.CenterBandwidth,...o,frequency:e.frequency,bandwidth:e.bandwidth}:t;if(i)return r5(e.startFrequency)&&r5(e.stopFrequency)&&!(e.stopFrequency<=e.startFrequency)?{kind:r0.FrequencyRange,...o,startFrequency:e.startFrequency,stopFrequency:e.stopFrequency}:t;if(n){if(Object.hasOwn(e,"left")&&void 0!==e.left&&!r5(e.left)||Object.hasOwn(e,"width")&&void 0!==e.width&&!r5(e.width))return t;let n=t.kind===r0.Position?t:void 0;return{kind:r0.Position,...o,left:Object.hasOwn(e,"left")?e.left:"merge"===r?n?.left:void 0,width:Object.hasOwn(e,"width")?e.width??0:"merge"===r?n?.width??0:0}}return{...t,...o}}let r7=a.createContext(null),ne=r7;var nt=/*#__PURE__*/function(e){return e.Normal="normal",e.DDC="ddc",e}({}),nr=/*#__PURE__*/null,nn=/*#__PURE__*/function(e){return e.Area="area",e.Slider="slider",e.RowIndex="rowIndex",e}({});let na={dBm:[-300,300],dBμV:[-300,300]},ni=[5,10,20,30],no=20,nl=["dBμV","dBμV/m","dBm","dBm/m"],ns=[-20,100],nc=null,nu={lite:"lite",inside:"inside",default:""},nd=1001,nh={start:0,end:1001},np=1;function nf(){return{globalID:"",config:t0(),system:{width:0,height:0,padding:0,border:!0,borderRadius:!0,onChange:()=>{}},eventBus:{onDoubleClick:()=>{}},axisY:{show:!0,placement:t7.Outside,disabled:!1,gradientRibbon:!0,defaultRange:ns,realRange:ns,range:ns,renderRange:ns,restrict:na["dBμV"],autoranging:!1,step:no,unit:nl["0"],unitList:nl,fieldStrengthUnitAvailable:!1,unitDisabled:!1,type:nu.default,hidden:[],linkage:!0,onChange:()=>{}},axisX:{show:!0,labelMode:re.Auto,range:[],unit:"MHz",unitKHz:"kHz",ticks:!0,children:null,onChange:()=>{},frequencyFormat:()=>""},toolbar:{show:!0,hiddenTools:[]},series:{maxPoints:1001,zoomMinSimulateWave:!1,dataRate:1,forceDisplay:!1,legendExternal:[rc.ThresholdData,rc.TemplateData,rc.BackgroundNoiseData],enableMetrics:void 0,enableWaterfall:void 0,enableLengthSyncFastMode:!1},segments:[],points:[],marker:{fixed:!1,readonly:!1,enabled:!0,visible:!1,mode:nt.Normal,maxCount:5,fifo:!1,onChange:()=>{}},limit:{disabled:!1,show:!1,active:!0,value:[20],range:na["dBμV"],label:"",unified:!1,onChange:()=>{}},heatmapCapture:{type:nn.Area,show:!1,display:!1,sync:!1,interval:{startIndex:-1,endIndex:-1},dataNow:[],onChange:()=>{}},waterfallViewport:{range:{x:[0,0],y:[0,0]},sourceSize:{width:0,height:0}},cursor:{show:!0,active:!0,crosshair:!1,event:null,coord:{left:0,top:0},timeout:0,mode:void 0},zoom:{show:!0,xy:!1,overview:{show:!1},select:!1,interval:nh,style:null,isScanSegmentsUpdateMagnify:!1,onChange:()=>{},autoCloseTimeout:31536e6},signal:{show:!0,display:!1,templateDetection:!1,data:[],hiddenCategoryKeys:[],showCount:!0,onChange:()=>{}},signalAnalysis:{show:!0,display:!1,onChange:()=>{}},band:{kind:r0.Position,show:!1,left:void 0,width:0,color:""},scope:{show:!1,left:0,width:0,onChange:()=>{}},gridLines:!0,legend:{children:null},frequencyTagLine:{show:!0,display:!1,left:-100,onChange:()=>{}},stripe:{show:!0,display:!1,defaultLeft:40,defaultRight:60,left:40,right:60,onChange:()=>{}},blaze:{show:!1},frequencyAllocation:{show:!0,display:!0,data:[]},timeRange:0,levelStream:{cacheTime:2e4,granularity:1,maxPoints:500},fluorescence:{show:!1,display:!1,renderMode:k.Gaussian},deltaMeasurement:{show:!0,display:!1,onChange:()=>{}}}}let nm=50,ng=e=>e+10*Math.log10(50)+90,nb=e=>Math.sqrt(50*10**(e/10-3)),nv=e=>10**(e/10),ny=e=>e-90-10*Math.log10(50),nw=e=>10**(e/20-6),nx=e=>1e6*nw(e),nk=e=>10**(e/10-9)/50,nS=e=>e<=0?-200:30+20*Math.log10(e)-10*Math.log10(50),nM=e=>e<=0?-200:20*(Math.log10(e)+6),nC=e=>1e3*e**2/50,nF=e=>e<=0?-50:10*Math.log10(e),nD=e=>e<=0?-200:10*Math.log10(50*e)+90,nz=e=>(.001*e*50)**.5,nN=e=>e?e.map(e=>+e||0===e?ny(e):void 0):[],nE={flaw:0,offset:0,range:[0,0],renderRange:[0,0]},nT=(e,t)=>tS(`VIRTUAL_RANGE-${e}`,t,nE);function nR({unit:e,realRange:t=[0,0],step:r=1,globalID:n}){let{offset:a,flaw:i}=nE,o=[t[0]??0,t[1]??0],l=[t[0]??0,t[1]??0];if(e&&rg(e)){let e=ny(0);i=e%r,a=e-i,o=[t[0]+a,t[1]+a],l=[t[0]-i,t[1]-i]}let s={offset:a,range:o,renderRange:l,flaw:i};return nT(n,s),s}function nA({range:e,unit:t,step:r,globalID:n}){let a=e,i=e;if(t&&rg(t)){let t=nT(n),o=ny(0),l=o%(r??1),s=0!==t.offset||0!==t.flaw,c=void 0===r&&s?t.flaw:l,u=void 0===r&&s?t.offset:o-l;i=[(a=[e[0]-u,e[1]-u])[0]-c,a[1]-c],nT(n,{offset:u,flaw:c,range:e,renderRange:i})}return{realRange:a,renderRange:i}}function nI(e,t){return rg(e)?ny(t):t}function nP(e,t,r){return tC(`useKeyEvent-${e}`,t,r,e)}function nL(e){if(!e||!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}let nO=(e,t)=>r=>{if(!r||nL(r.target))return;let n=["a","d","w","s","m"].includes(r.key.toLowerCase()),a=r.ctrlKey||r.altKey;if(!n&&!a)return;let i=document.getElementById(t),o=document.activeElement;!i||!o||(o===i||i.contains(o))&&nP(e,t)(r)};function nq(e,t){h(()=>{if(e&&t){let r=nO(e,t);return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}}},[e,t])}let n$=e=>{let{min:t,max:r}=e,n=r-t,a=10;switch(!0){case n>=90:a=20;break;case n>=45:a=10;break;default:a=5}return{diff:n,step:a,middle:t+n/2}};class n_{state={axisY:{step:no,realRange:ns,restrict:na["dBμV"]},onChange:()=>{}};constructor(e){this.update(e)}update(e){let t={...this.state,...e};this.state={...t}}setAxisY(e){let{axisY:t}=this.state;this.update({axisY:{...t,...e}})}focus({isHand:e,step:t}={}){let{axisY:r,globalID:n}=this.state,{realRange:a}=r;if(!a||!n)return;let i=tO(n).getAllRawData?.(),o=i[t5.realData.name]||new Float32Array,l=i[t5.maxData.name]||new Float32Array,s=i[t5.minData.name]||new Float32Array,c=tU([...Array.from(o),...Array.from(l),...Array.from(s)]),{avg:u}=c;void 0===u&&(u=10);let d=t||r.step,h=n$(c),{min:p=0,max:f=0}=c,[m,g]=a,{middle:b}=h;!t&&(e||p<m||g<f)&&(d=h.step);let v=(Math.round(b/d)-5)*d;Number.isNaN(v)&&(v=-20);let y=v+10*d;this.setAxisY({step:d,realRange:[v,y]}),this.onChange()}move(e){let{axisY:{realRange:[t,r],restrict:n}}=this.state;if(r>=n[1]&&e>0||t<=n[0]&&e<0)return;let a=e*(r-t),[i,o]=[t+a,r+a];this.setAxisY({realRange:[i,o]}),this.onChange()}moveBoundary(e,t){let{axisY:{realRange:[r,n],step:a}}=this.state,[i,o]=[r,n];!e&&t&&(o+=a),e&&t&&(o-=a),e||t||(i+=a),e&&!t&&(i-=a),o<=i+1&&(t&&(o=i+1),t||(i=o-1));let l=20*a;o-i>=l&&(t&&(o=i+l),t||(i=o-l)),this.setAxisY({realRange:[i,o]}),this.onChange()}moveWheel(e){let{axisY:{realRange:[t,r]}}=this.state,n=e.currentTarget.getBoundingClientRect(),a=e.clientY-n.top,i=n.height,o=e.deltaY>0?1.1:.9;this.zoom(o,r-a/i*(r-t))}zoom(e,t){let{axisY:{realRange:[r,n],step:a,restrict:i}}=this.state,o={min:t-(t-r)*e,max:t+(n-t)*e},[l,s]=i,c=Math.abs(s-l),u=Math.max(l,o.min),d=Math.min(s,o.max),h=Math.max(Number.EPSILON,Math.min(a/100,c/100));if(d-u<h){let e=(u+d)/2;u=Math.max(l,e-h/2),d=Math.min(s,e+h/2)}this.setAxisY({realRange:[u,d]}),this.onChange()}moveStep(e){let{axisY:{realRange:[t,r],step:n,restrict:a}}=this.state,i=e?n:-n,[o,l]=[t+i,r+i];(e?l>a[1]:o<a[0])&&(o=t,l=r),this.setAxisY({realRange:[o,l]}),this.onChange()}onChange(){let{axisY:{realRange:[e,t],restrict:r,unit:n}}=this.state,a=nR({realRange:this.state.axisY.realRange,unit:this.state.axisY.unit,step:this.state.axisY.step,globalID:this.state.globalID}),i=rg(n)?a.offset:0,o=e<r[0]-i,l=t>r[1],s=e,c=t;o&&(c=(s=r[0]-i)+(t-e)),l&&([,c]=r),this.setAxisY({realRange:[s,c]}),this.state.onChange(this.state.axisY)}}let nj=(e,t)=>tC(`useRangeAutoFocus-${e}`,"0",t,e),nH=(e,t)=>tC(`useRangeMove-${e}`,"0",t,e),nB=(e,t)=>tC(`useRangeZoom-${e}`,"0",t,e),nW=(e,t)=>tC(`useRangeSet-${e}`,"0",t,e),nG=n_,nY=({chart:e})=>{let{state:{axisY:t,series:r,globalID:n},dispatch:a}=ae(),{realRange:i,renderRange:o,step:l,unit:s,onChange:c,autoranging:d,disabled:p}=t,f=m(()=>new n_({axisY:t}),[t]);h(()=>{n&&f.update?.({globalID:n})},[n,f]),h(()=>{f.update?.({axisY:t})},[f,JSON.stringify(t)]),h(()=>{f.update?.({series:r})},[f,JSON.stringify(r)]);let g=u(e=>{if(n){let t=nR({unit:s,...e,globalID:n});a({payload:r=>({axisY:{...r.axisY,realRange:e.realRange,step:e.step,range:t.range,renderRange:t.renderRange}})}),c?.({range:t.range,step:e.step})}},[s,c,n,a]);return h(()=>{f.state.onChange=e=>{g(e)}},[f,g]),h(()=>{g({realRange:i,step:l}),f?.update({unit:s})},[s]),h(()=>{o&&e?.setRange?.(o)},[e,o]),h(()=>{n&&nj(n,()=>{f?.focus()})},[n,f]),h(()=>{f?.focus({step:l})},[l]),h(()=>{e?.updateParams?.({autoranging:d})},[d]),h(()=>{n&&nH(n,e=>{p||f.move?.(e)})},[f,n,p]),h(()=>{if(n)return nB(n,(e,t)=>{p||f.zoom?.(e,t)})},[f,n,p]),h(()=>{n&&nP(n,"ticks",e=>{"ArrowUp"===e.code&&f.move?.(.1),"ArrowDown"===e.code&&f.move?.(-.1)})},[f,n]),f},nU=nY,nX=e=>[e[0],e[1]],nK=(e,t)=>void 0!==e&&void 0!==t&&e[0]===t[0]&&e[1]===t[1],nV=e=>{if(!e)return e;let t=e.range??e.defaultRange;return t?{...e,realRange:nX(t),range:nX(t),renderRange:nX(t)}:e};function nQ(e,t,r){let n=(r||nf())[e];return t?"object"!=typeof t||null===t?t:rH(n,t):n}function nZ(e){return e&&void 0!==e.unit&&void 0===e.unitDisabled?{...e,unitDisabled:!0}:e}let nJ=["axisX","legend","marker","limit","heatmapCapture","deltaMeasurement","zoom","cursor","signal","scope","eventBus","blaze","stripe","signalAnalysis","series","frequencyTagLine","frequencyAllocation","toolbar","gauge","band","levelStream","fluorescence","onChannelChange"],n0=e=>{let t=d(r7);if(!t)throw Error("Params must be used within a StoreProvider");let{dispatch:r,store:n}=t,a=v(n.subscribe,()=>n.getState().globalID,()=>n.getState().globalID),i=g({}),o=g(""),l=g(void 0),s=g(void 0);return h(()=>{let t={},a=!1,o=n.getState();for(let r of nJ){let n=e[r],l=i.current[r];if(void 0!==n&&n!==l){if("band"===r){let e=r9(n,o.band,"merge");e!==o.band&&(t.band=e,a=!0);continue}t[r]=nQ(r,n,o),a=!0}}i.current={...e},a&&r({payload:t})},[r,e.axisX,e.legend,e.marker,e.limit,e.heatmapCapture,e.zoom,e.cursor,e.signal,e.scope,e.eventBus,e.blaze,e.stripe,e.signalAnalysis,e.series,e.frequencyTagLine,e.frequencyAllocation,e.toolbar,e.gauge,e.band,e.levelStream,e.fluorescence,e.onChannelChange,n]),h(()=>{void 0!==e.gridLines&&r({payload:{gridLines:e.gridLines}})},[e.gridLines]),h(()=>{if(!a)return;let t=nZ(e.axisY),i=o.current!==a,c=l.current,u=s.current;if(o.current=a,l.current=t?.range?nX(t.range):void 0,s.current=t?.unit,!t)return;let{range:d,...h}=t,p=void 0!==d&&(i||!nK(d,c)||t.unit!==u)?d:i?t.defaultRange:void 0,f=n.getState(),m=void 0===p?h:{...h,range:p};if(p){let e=t.unit??f.axisY.unit;if(e&&rg(e)){let{realRange:r,renderRange:n}=nA({range:p,unit:e,step:t.step??f.axisY.step,globalID:a});m.realRange=r,m.renderRange=n}else m.realRange=nX(p),m.renderRange=nX(p)}r({payload:{axisY:nQ("axisY",m,f)}})},[r,a,e.axisY,n]),null},n1=n0,n2=(e,t)=>"function"==typeof t?t(e):t,n5=(e,t)=>{let r=n2(e,t.payload);if(!r)return e;if(t.replace)return r;let n=Object.keys(r);return n.length>0&&n.every(t=>Object.is(e[t],r[t]))?e:{...e,...r}};function n4(e){let t=e,r=new Set,n=e=>{if(Object.is(e,t))return t;for(let n of(t=e,Array.from(r)))n();return t},a=e=>n(e(t));return{dispatch:e=>a(t=>n5(t,e)),getState:()=>t,setState:n,subscribe:e=>(r.add(e),()=>{r.delete(e)}),updateState:a}}let n3=new Map,n6=e=>e?n3.get(e)??null:null;function n8(e){let t=n4(e),r=new Set,n=e.globalID,a=!1,i={destroy:()=>{if(!a){for(let e of(a=!0,o(),Array.from(r)))e();r.clear(),n&&n3.get(n)===i&&n3.delete(n)}},dispatch:e=>t.dispatch(e),getGlobalID:()=>n,getState:()=>t.getState(),registerCleanup:e=>{if(!e)return null;let t=!1,n=()=>{t||(t=!0,r.delete(n),e())};return r.add(n),n},setGlobalID:e=>{!a&&e!==n&&(n&&n3.get(n)===i&&n3.delete(n),(n=e)&&n3.set(n,i))},store:t,subscribe:t.subscribe};n&&n3.set(n,i);let o=t.subscribe(()=>{i.setGlobalID(t.getState().globalID)});return i}let n9=e=>{let t=!1;return queueMicrotask(()=>{t||e()}),()=>{t=!0}};function n7(){let e=d(r7);if(!e)throw Error("useStore must be used within a StoreProvider");return e}function ae(){let{dispatch:e,runtime:t,store:r}=n7();return{dispatch:e,runtime:t,state:v(r.subscribe,r.getState,r.getState),store:r}}function at(e){let{store:t}=n7();return v(t.subscribe,()=>e(t.getState()),()=>e(t.getState()))}function ar(){return n7()}function an(){return n7().dispatch}let aa=e=>{let{children:t}=e,a=g(null);if(!a.current){let t=nf(),r=rH(t,{...e,axisY:nV(nZ(e.axisY))});e.band&&(r.band=r9(e.band,t.band,"merge")),a.current=r}let i=g(null);if(!i.current&&a.current&&(i.current=n8(a.current)),!i.current)throw Error("Failed to initialize chart runtime");let o=i.current,{dispatch:l,store:s}=o,c=v(s.subscribe,()=>s.getState().globalID,()=>s.getState().globalID),u=g(c),d=g(null);h(()=>{u.current=c,o.setGlobalID(c)},[c,o]),h(()=>(d.current?.(),d.current=null,()=>{d.current=n9(()=>{o.destroy(),tP([u.current]),d.current=null})}),[o]);let p=m(()=>({dispatch:l,runtime:o,store:s}),[l,o,s]);return /*#__PURE__*/n(r7.Provider,{value:p,children:[/*#__PURE__*/r(n0,{...e}),t]})},ai=aa,ao=({children:e})=>{let{state:{system:{padding:t}}}=ae();return /*#__PURE__*/r("div",{className:"h-full w-full",style:{...eA},[ez]:"true",children:/*#__PURE__*/r("div",{className:"relative flex h-full w-full select-none flex-col overflow-hidden bg-background pt-0 text-foreground",style:{padding:t?"calc(var(--size-gap-base) * 2)":0},children:e})})},al=/*#__PURE__*/a.memo(ao),as=(e,t)=>tA(e,t),ac=({publish:e,resetViewport:t,subscribe:r=()=>{}})=>{let n=at(e=>e.globalID),a=an(),i=g(r),o=g(e),l=g(t);i.current=r,o.current=e,l.current=t;let s=u(()=>tO(n),[n]);h(()=>{if(n)return tA(n,(...e)=>i.current(...e))},[n]),h(()=>{if(n){let e=tA(n,void 0);e.getSourceData=s,e.resetViewport=()=>l.current?.(),a({payload:{publish:e}}),o.current?.(e)}},[n,s,a])},au=ac;function ad(){let e=g(null);e.current||(e.current=tH());let t=e.current,r=m(()=>({get current(){return t.enhancedPublish},set current(e){e&&"function"==typeof e&&t.attachPublish(e)}}),[t]);return h(()=>()=>t.dispose(),[t]),{publish:t.publish,chartRef:r}}let ah=e=>e?{height:e.offsetHeight,width:e.offsetWidth}:null,ap=(e,t)=>e&&t?e.width!==t.width||e.height!==t.height:e!==t,af=(e,t)=>({...e,height:t.height,width:t.width}),am=e=>{let{children:t,style:n}=e,a=an(),i=at(e=>e.system),o=m(()=>rZ(),[]),l=g(null),s=g(i),c=g(null),u=g(()=>{});s.current=i,u.current=()=>{o&&tA(o,void 0)({pstype:rn.Resize})},h(()=>{o&&a({payload:{globalID:o}})},[a,o]);let d=g(rW(()=>{u.current()}));return h(()=>{if(!o||!l.current)return;let e=e=>{let t=ah(l.current);if(!t||!ap(c.current,t))return;c.current=t;let r=af(s.current,t);a({payload:{system:r}}),r.onChange(r),e&&t.width>0&&t.height>0&&d.current()};if(e(!1),"u"<typeof ResizeObserver)return;let t=new ResizeObserver(()=>{e(!0)});return t.observe(l.current),()=>{t?.disconnect()}},[a,o]),/*#__PURE__*/r("div",{className:"relative h-full w-full select-none",style:n,[ez]:"true",ref:l,children:/*#__PURE__*/r(al,{children:t})})},ag=am;function ab(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=ab(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function av(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=ab(e))&&(n&&(n+=" "),n+=t);return n}let ay=null,aw=(e,t)=>{let r=Array(e.length+t.length);for(let t=0;t<e.length;t++)r[t]=e[t];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},ax=(e,t)=>({classGroupId:e,validator:t}),ak=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),aS="-",aM=[],aC="arbitrary..",aF=e=>{let t=aN(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return az(e);let r=e.split("-"),n=+(""===r[0]&&r.length>1);return aD(r,n,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=n[e],a=r[e];return t?a?aw(a,t):t:a||aM}return r[e]||aM}}},aD=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let n=e[t],a=r.nextPart.get(n);if(a){let r=aD(e,t+1,a);if(r)return r}let i=r.validators;if(null===i)return;let o=0===t?e.join("-"):e.slice(t).join("-"),l=i.length;for(let e=0;e<l;e++){let t=i[e];if(t.validator(o))return t.classGroupId}},az=e=>{let t,r,n;return -1===e.slice(1,-1).indexOf(":")?void 0:(r=(t=e.slice(1,-1)).indexOf(":"),(n=t.slice(0,r))?"arbitrary.."+n:void 0)},aN=e=>{let{theme:t,classGroups:r}=e;return aE(r,t)},aE=(e,t)=>{let r=ak();for(let n in e)aT(e[n],r,n,t);return r},aT=(e,t,r,n)=>{let a=e.length;for(let i=0;i<a;i++)aR(e[i],t,r,n)},aR=(e,t,r,n)=>{"string"==typeof e?aA(e,t,r):"function"==typeof e?aI(e,t,r,n):aP(e,t,r,n)},aA=(e,t,r)=>{(""===e?t:aL(t,e)).classGroupId=r},aI=(e,t,r,n)=>{aO(e)?aT(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(ax(r,e)))},aP=(e,t,r,n)=>{let a=Object.entries(e),i=a.length;for(let e=0;e<i;e++){let[i,o]=a[e];aT(o,aL(t,i),r,n)}},aL=(e,t)=>{let r=e,n=t.split("-"),a=n.length;for(let e=0;e<a;e++){let t=n[e],a=r.nextPart.get(t);a||(a=ak(),r.nextPart.set(t,a)),r=a}return r},aO=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,aq=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null),a=(a,i)=>{r[a]=i,++t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(a(e,t),t):void 0},set(e,t){e in r?r[e]=t:a(e,t)}}},a$="!",a_=":",aj=[],aH=(e,t,r,n,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),aB=e=>{let{prefix:t,experimentalParseClassName:r}=e,n=e=>{let t,r=[],n=0,a=0,i=0,o=e.length;for(let l=0;l<o;l++){let o=e[l];if(0===n&&0===a){if(":"===o){r.push(e.slice(i,l)),i=l+1;continue}if("/"===o){t=l;continue}}"["===o?n++:"]"===o?n--:"("===o?a++:")"===o&&a--}let l=0===r.length?e:e.slice(i),s=l,c=!1;return l.endsWith("!")?(s=l.slice(0,-1),c=!0):l.startsWith("!")&&(s=l.slice(1),c=!0),aH(r,c,s,t&&t>i?t-i:void 0)};if(t){let e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):aH(aj,!1,t,void 0,!0)}if(r){let e=n;n=t=>r({className:t,parseClassName:e})}return n},aW=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{let r=[],n=[];for(let a=0;a<e.length;a++){let i=e[a],o="["===i[0],l=t.has(i);o||l?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(i)):n.push(i)}return n.length>0&&(n.sort(),r.push(...n)),r}},aG=e=>({cache:aq(e.cacheSize),parseClassName:aB(e),sortModifiers:aW(e),postfixLookupClassGroupIds:aY(e),...aF(e)}),aY=e=>{let t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let e=0;e<r.length;e++)t[r[e]]=!0;return t},aU=/\s+/,aX=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i,postfixLookupClassGroupIds:o}=t,l=[],s=e.trim().split(aU),c="";for(let e=s.length-1;e>=0;e-=1){let t,u=s[e],{isExternal:d,modifiers:h,hasImportantModifier:p,baseClassName:f,maybePostfixModifierPosition:m}=r(u);if(d){c=u+(c.length>0?" "+c:c);continue}let g=!!m;if(g){let e=(t=n(f.substring(0,m)))&&o[t]?n(f):void 0;e&&e!==t&&(t=e,g=!1)}else t=n(f);if(!t){if(!g||!(t=n(f))){c=u+(c.length>0?" "+c:c);continue}g=!1}let b=0===h.length?"":1===h.length?h[0]:i(h).join(":"),v=p?b+"!":b,y=v+t;if(l.indexOf(y)>-1)continue;l.push(y);let w=a(t,g);for(let e=0;e<w.length;++e){let t=w[e];l.push(v+t)}c=u+(c.length>0?" "+c:c)}return c},aK=(...e)=>{let t,r,n=0,a="";for(;n<e.length;)(t=e[n++])&&(r=aV(t))&&(a&&(a+=" "),a+=r);return a},aV=e=>{let t;if("string"==typeof e)return e;let r="";for(let n=0;n<e.length;n++)e[n]&&(t=aV(e[n]))&&(r&&(r+=" "),r+=t);return r},aQ=(e,...t)=>{let r,n,a,i,o=e=>{let t=n(e);if(t)return t;let i=aX(e,r);return a(e,i),i};return i=l=>(n=(r=aG(t.reduce((e,t)=>t(e),e()))).cache.get,a=r.cache.set,i=o,o(l)),(...e)=>i(aK(...e))},aZ=[],aJ=e=>{let t=t=>t[e]||aZ;return t.isThemeGetter=!0,t.themeKey=e,t},a0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,a1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,a2=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,a5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,a4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,a3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,a6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a8=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,a9=e=>a2.test(e),a7=e=>!!e&&!Number.isNaN(Number(e)),ie=e=>!!e&&Number.isInteger(Number(e)),it=e=>e.endsWith("%")&&a7(e.slice(0,-1)),ir=e=>a5.test(e),ia=()=>!0,ii=e=>a4.test(e)&&!a3.test(e),io=()=>!1,il=e=>a6.test(e),is=e=>a8.test(e),ic=e=>!ih(e)&&!ix(e),iu=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),id=e=>iN(e,iA,io),ih=e=>a0.test(e),ip=e=>iN(e,iI,ii),im=e=>iN(e,iP,a7),ig=e=>iN(e,iO,ia),ib=e=>iN(e,iL,io),iv=e=>iN(e,iT,io),iy=e=>iN(e,iR,is),iw=e=>iN(e,iq,il),ix=e=>a1.test(e),ik=e=>iE(e,iI),iS=e=>iE(e,iL),iM=e=>iE(e,iT),iC=e=>iE(e,iA),iF=e=>iE(e,iR),iD=e=>iE(e,iq,!0),iz=e=>iE(e,iO,!0),iN=(e,t,r)=>{let n=a0.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},iE=(e,t,r=!1)=>{let n=a1.exec(e);return!!n&&(n[1]?t(n[1]):r)},iT=e=>"position"===e||"percentage"===e,iR=e=>"image"===e||"url"===e,iA=e=>"length"===e||"size"===e||"bg-size"===e,iI=e=>"length"===e,iP=e=>"number"===e,iL=e=>"family-name"===e,iO=e=>"number"===e||"weight"===e,iq=e=>"shadow"===e,i$=/*#__PURE__*/Object.defineProperty({__proto__:null,isAny:ia,isAnyNonArbitrary:ic,isArbitraryFamilyName:ib,isArbitraryImage:iy,isArbitraryLength:ip,isArbitraryNumber:im,isArbitraryPosition:iv,isArbitraryShadow:iw,isArbitrarySize:id,isArbitraryValue:ih,isArbitraryVariable:ix,isArbitraryVariableFamilyName:iS,isArbitraryVariableImage:iF,isArbitraryVariableLength:ik,isArbitraryVariablePosition:iM,isArbitraryVariableShadow:iD,isArbitraryVariableSize:iC,isArbitraryVariableWeight:iz,isArbitraryWeight:ig,isFraction:a9,isInteger:ie,isNamedContainerQuery:iu,isNumber:a7,isPercent:it,isTshirtSize:ir},Symbol.toStringTag,{value:"Module"}),i_=()=>{let e=aJ("color"),t=aJ("font"),r=aJ("text"),n=aJ("font-weight"),a=aJ("tracking"),i=aJ("leading"),o=aJ("breakpoint"),l=aJ("container"),s=aJ("spacing"),c=aJ("radius"),u=aJ("shadow"),d=aJ("inset-shadow"),h=aJ("text-shadow"),p=aJ("drop-shadow"),f=aJ("blur"),m=aJ("perspective"),g=aJ("aspect"),b=aJ("ease"),v=aJ("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...w(),ix,ih],k=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto","contain","none"],M=()=>[ix,ih,s],C=()=>[a9,"full","auto",...M()],F=()=>[ie,"none","subgrid",ix,ih],D=()=>["auto",{span:["full",ie,ix,ih]},ie,ix,ih],z=()=>[ie,"auto",ix,ih],N=()=>["auto","min","max","fr",ix,ih],E=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],T=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...M()],A=()=>[a9,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],I=()=>[l,a9,"screen","full","dvw","lvw","svw","min","max","fit",...M()],P=()=>[a9,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],L=()=>[e,ix,ih],O=()=>[...w(),iM,iv,{position:[ix,ih]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",iC,id,{size:[ix,ih]}],_=()=>[it,ik,ip],j=()=>["","none","full",c,ix,ih],H=()=>["",a7,ik,ip],B=()=>["solid","dashed","dotted","double"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>[a7,it,iM,iv],Y=()=>["","none",f,ix,ih],U=()=>["none",a7,ix,ih],X=()=>["none",a7,ix,ih],K=()=>[a7,ix,ih],V=()=>[a9,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ir],breakpoint:[ir],color:[ia],container:[ir],"drop-shadow":[ir],ease:["in","out","in-out"],font:[ic],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ir],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ir],shadow:[ir],spacing:["px",a7],text:[ir],"text-shadow":[ir],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",a9,ih,ix,g]}],container:["container"],"container-type":[{"@container":["","normal","size",ix,ih]}],"container-named":[iu],columns:[{columns:[a7,"auto",ih,ix,l]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{"inset-s":C(),start:C()}],end:[{"inset-e":C(),end:C()}],"inset-bs":[{"inset-bs":C()}],"inset-be":[{"inset-be":C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[ie,"auto",ix,ih]}],basis:[{basis:[a9,"full","auto",l,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[a7,a9,"auto","initial","none",ih]}],grow:[{grow:["",a7,ix,ih]}],shrink:[{shrink:["",a7,ix,ih]}],order:[{order:[ie,"first","last","none",ix,ih]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...E(),"normal"]}],"justify-items":[{"justify-items":[...T(),"normal"]}],"justify-self":[{"justify-self":["auto",...T()]}],"align-content":[{content:["normal",...E()]}],"align-items":[{items:[...T(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...T(),{baseline:["","last"]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...T(),"baseline"]}],"place-self":[{"place-self":["auto",...T()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mbs:[{mbs:R()}],mbe:[{mbe:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],"inline-size":[{inline:["auto",...I()]}],"min-inline-size":[{"min-inline":["auto",...I()]}],"max-inline-size":[{"max-inline":["none",...I()]}],"block-size":[{block:["auto",...P()]}],"min-block-size":[{"min-block":["auto",...P()]}],"max-block-size":[{"max-block":["none",...P()]}],w:[{w:[l,"screen",...A()]}],"min-w":[{"min-w":[l,"screen","none",...A()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh","none",...A()]}],"font-size":[{text:["base",r,ik,ip]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,iz,ig]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",it,ih]}],"font-family":[{font:[iS,ib,t]}],"font-features":[{"font-features":[ih]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ix,ih]}],"line-clamp":[{"line-clamp":[a7,"none",ix,im]}],leading:[{leading:["none",i,...M()]}],"list-image":[{"list-image":["none",ix,ih]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ix,ih]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[a7,"from-font","auto",ix,ip]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[a7,"auto",ix,ih]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"tab-size":[{tab:[ie,ix,ih]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ix,ih]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ix,ih]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ie,ix,ih],radial:["",ix,ih],conic:["",ie,ix,ih]},iF,iy]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:_()}],"gradient-via-pos":[{via:_()}],"gradient-to-pos":[{to:_()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:j()}],"rounded-s":[{"rounded-s":j()}],"rounded-e":[{"rounded-e":j()}],"rounded-t":[{"rounded-t":j()}],"rounded-r":[{"rounded-r":j()}],"rounded-b":[{"rounded-b":j()}],"rounded-l":[{"rounded-l":j()}],"rounded-ss":[{"rounded-ss":j()}],"rounded-se":[{"rounded-se":j()}],"rounded-ee":[{"rounded-ee":j()}],"rounded-es":[{"rounded-es":j()}],"rounded-tl":[{"rounded-tl":j()}],"rounded-tr":[{"rounded-tr":j()}],"rounded-br":[{"rounded-br":j()}],"rounded-bl":[{"rounded-bl":j()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[a7,ix,ih]}],"outline-w":[{outline:["",a7,ik,ip]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","inner","none",u,iD,iw]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,iD,iw]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[a7,ip]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,iD,iw]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[a7,ix,ih]}],"mix-blend":[{"mix-blend":[...W(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":W()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[a7]}],"mask-image-linear-from-pos":[{"mask-linear-from":G()}],"mask-image-linear-to-pos":[{"mask-linear-to":G()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":G()}],"mask-image-t-to-pos":[{"mask-t-to":G()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":G()}],"mask-image-r-to-pos":[{"mask-r-to":G()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":G()}],"mask-image-b-to-pos":[{"mask-b-to":G()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":G()}],"mask-image-l-to-pos":[{"mask-l-to":G()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":G()}],"mask-image-x-to-pos":[{"mask-x-to":G()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":G()}],"mask-image-y-to-pos":[{"mask-y-to":G()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[ix,ih]}],"mask-image-radial-from-pos":[{"mask-radial-from":G()}],"mask-image-radial-to-pos":[{"mask-radial-to":G()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[a7]}],"mask-image-conic-from-pos":[{"mask-conic-from":G()}],"mask-image-conic-to-pos":[{"mask-conic-to":G()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ix,ih]}],filter:[{filter:["","none",ix,ih]}],blur:[{blur:Y()}],brightness:[{brightness:[a7,ix,ih]}],contrast:[{contrast:[a7,ix,ih]}],"drop-shadow":[{"drop-shadow":["","none",p,iD,iw]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",a7,ix,ih]}],"hue-rotate":[{"hue-rotate":[a7,ix,ih]}],invert:[{invert:["",a7,ix,ih]}],saturate:[{saturate:[a7,ix,ih]}],sepia:[{sepia:["",a7,ix,ih]}],"backdrop-filter":[{"backdrop-filter":["","none",ix,ih]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[a7,ix,ih]}],"backdrop-contrast":[{"backdrop-contrast":[a7,ix,ih]}],"backdrop-grayscale":[{"backdrop-grayscale":["",a7,ix,ih]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[a7,ix,ih]}],"backdrop-invert":[{"backdrop-invert":["",a7,ix,ih]}],"backdrop-opacity":[{"backdrop-opacity":[a7,ix,ih]}],"backdrop-saturate":[{"backdrop-saturate":[a7,ix,ih]}],"backdrop-sepia":[{"backdrop-sepia":["",a7,ix,ih]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ix,ih]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[a7,"initial",ix,ih]}],ease:[{ease:["linear","initial",b,ix,ih]}],delay:[{delay:[a7,ix,ih]}],animate:[{animate:["none",v,ix,ih]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ix,ih]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:K()}],"skew-x":[{"skew-x":K()}],"skew-y":[{"skew-y":K()}],transform:[{transform:[ix,ih,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":["translate-none"],zoom:[{zoom:[ie,ix,ih]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ix,ih]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ix,ih]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[a7,ik,ip,im]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ij=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:a={},override:i={}})=>(iH(e,"cacheSize",t),iH(e,"prefix",r),iH(e,"experimentalParseClassName",n),iB(e.theme,i.theme),iB(e.classGroups,i.classGroups),iB(e.conflictingClassGroups,i.conflictingClassGroups),iB(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),iH(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),iH(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),iW(e.theme,a.theme),iW(e.classGroups,a.classGroups),iW(e.conflictingClassGroups,a.conflictingClassGroups),iW(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),iG(e,a,"postfixLookupClassGroups"),iG(e,a,"orderSensitiveModifiers"),e),iH=(e,t,r)=>{void 0!==r&&(e[t]=r)},iB=(e,t)=>{if(t)for(let r in t)iH(e,r,t[r])},iW=(e,t)=>{if(t)for(let r in t)iG(e,t,r)},iG=(e,t,r)=>{let n=t[r];void 0!==n&&(e[r]=e[r]?e[r].concat(n):n)},iY=(e,...t)=>"function"==typeof e?aQ(i_,e,...t):aQ(()=>ij(i_(),e),...t),iU=/*#__PURE__*/aQ(i_);function iX(...e){return iU(av(e))}let iK=(e,t)=>{let r=e??{},n=Object.keys(r),a=Object.keys(t);return n.length===a.length&&n.every(e=>Object.is(r[e],t[e]))},iV=e=>{let t=at(e=>e.globalID),{Render:n,params:a,onIDChange:i}=e,o=m(()=>rZ(),[]),[l,s]=b(null),[c,d]=b(null),p=g(i),f=g(null),v=g(a),y=g(null);p.current=i,h(()=>{if(!o||!t||!c)return void s(null);let e=new n({id:o,globalID:t,...a});return s(e),p.current?.(o),()=>{e.dispose?.()}},[n,c,t,o]);let w=u(e=>{d(t=>t===e?t:e)},[]),x=u(e=>/*#__PURE__*/r("div",{id:o,...e,ref:w,className:iX("absolute right-0 top-0 z-[2] flex h-full w-full [&>canvas]:h-full [&>canvas]:w-full [&>canvas]:bg-transparent",e.className)}),[w,o]);return h(()=>(y.current?.(),y.current=null,()=>{y.current=n9(()=>{tP([o]),y.current=null})}),[o]),h(()=>{if(l){let e=a??{};if(f.current!==l){f.current=l,v.current=e;return}iK(v.current??{},e)||(v.current=e,l.updateParams(e))}},[a,l]),{id:o,chart:l,Chart:x}},iQ=iV,iZ=(e,t,r,n="0")=>tI(e,t,r,n),iJ="render",i0="reset",i1="resize",i2=["render"],i5=(e,t,r)=>void 0===e.pstype?r:t.includes(e.pstype),i4=(e,{chart:t,eventHandlers:r,extractData:n,handleRender:a,renderPSTypes:i=i2,treatMissingPSTypeAsRender:o=!1})=>{let{pstype:l}=e;if(l&&r?.[l])return void r[l]?.(e,t);if("reset"===l)return void t.reset();if("clear"===l)return void t.clear?.();if("resize"===l)return void t.resize();if(!i5(e,i,o))return;if(a)return void a(e,t);let s=n?n(e):e;t.updateSeries?.(s)};function i3({moduleType:e,chart:t,extractData:r,renderPSTypes:n,treatMissingPSTypeAsRender:a,handleRender:i,eventHandlers:o}){let l=at(e=>e.globalID),s=g(r),c=g(i),u=g(o),d=g(n),p=n?.join("|")??"__default_render__",f=t?.state?.id??`${e}-${p}`;s.current=r,c.current=i,u.current=o,d.current=n,h(()=>{if(t&&l)return((e,t,r,n="0")=>tI(e,t,r,n))(l,e,e=>{i4(e,{chart:t,eventHandlers:u.current,extractData:s.current,handleRender:c.current,renderPSTypes:d.current,treatMissingPSTypeAsRender:a})},f)},[t,l,e,p,f,a])}let i6=null,i8=()=>"u">typeof window&&"u">typeof document,i9=e=>i8()?e instanceof Element?e.closest(eN)??e??document.documentElement:document.querySelector(eN)??document.documentElement:null,i7=e=>{let t=i9(e);return t?getComputedStyle(t):null},oe=(e,t,r=[])=>{let n=i7(t);if(!n)return"";let a=n.getPropertyValue(e).trim();if(a)return a;for(let e of r){let t=n.getPropertyValue(e).trim();if(t)return t}return""},ot=e=>Math.min(1,Math.max(0,e)),or=e=>{let t=e.replace("#","").trim();if(![3,4,6,8].includes(t.length))return null;let r=t.length<=4?t.split("").map(e=>e+e).join(""):t,n=8===r.length,a=Number.parseInt(r.slice(0,2),16),i=Number.parseInt(r.slice(2,4),16),o=Number.parseInt(r.slice(4,6),16),l=n?Number.parseInt(r.slice(6,8),16)/255:1;return[a,i,o,l].some(e=>Number.isNaN(e))?null:{r:a,g:i,b:o,alpha:l}},on=e=>{let t=e.trim().match(/^rgba?\(\s*([^)]+)\s*\)$/i);if(!t)return null;let[r,n,a,i="1"]=t[1].split(",").map(e=>e.trim()),o={r:Number.parseFloat(r),g:Number.parseFloat(n),b:Number.parseFloat(a),alpha:Number.parseFloat(i)};return Object.values(o).some(e=>Number.isNaN(e))?null:o},oa=(e,t)=>{let r=ot(t),n=e.startsWith("#")?or(e):null,a=n?null:on(e),i=n??a;return i?`rgba(${i.r}, ${i.g}, ${i.b}, ${Number((i.alpha*r).toFixed(4))})`:e},oi=e=>{let t=e.startsWith("#")?or(e):null,r=t?null:on(e),n=t??r;return n?`rgb(${n.r}, ${n.g}, ${n.b})`:e};function oo(e){let t=oe("--foreground",e),r=oe("--primary",e);return{fillStyle:oa(t,176/255),fillStylePrimary:r,fillStyleTransparentBase:oa(t,16/255)}}let ol=(e,t,r)=>{let n=oe(e,r);return void 0!==t?oa(n,t):n},os=()=>{let e=eX(),t=e.followOS?eU():e.theme;return{contractTheme:e.theme,followOS:e.followOS,preference:e.followOS?"system":e.theme,theme:t}};class oc{listeners=new Set;mediaCleanup=null;rootAttributeObserver=null;lastStateKey=null;getStateKey=e=>[e.followOS,e.preference,e.theme,e.contractTheme].join(":");emit=e=>{for(let t of(this.lastStateKey=this.getStateKey(e),Array.from(this.listeners)))t(e)};emitIfChanged=e=>{this.getStateKey(e)!==this.lastStateKey&&this.emit(e)};teardownIfIdle=()=>{this.listeners.size>0||(this.mediaCleanup?.(),this.mediaCleanup=null,this.rootAttributeObserver?.disconnect(),this.rootAttributeObserver=null,this.lastStateKey=null)};ensureMediaSubscription=()=>{if(this.mediaCleanup||!eW())return;let e=eG();if(!e)return;let t=()=>{eX().followOS&&this.emitIfChanged(os())};e.addEventListener("change",t),this.mediaCleanup=()=>{e.removeEventListener("change",t)}};ensureRootAttributeSubscription=()=>{!this.rootAttributeObserver&&eW()&&(this.rootAttributeObserver=new MutationObserver(e=>{for(let t of e)if("attributes"===t.type&&("theme"===t.attributeName||t.attributeName===eO)){this.emitIfChanged(os());break}}),this.rootAttributeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["theme",eO]}))};getState=()=>os();subscribe=e=>{this.listeners.add(e),this.ensureMediaSubscription(),this.ensureRootAttributeSubscription();let t=this.getState();return this.lastStateKey=this.getStateKey(t),e(t),()=>{this.listeners.delete(e),this.teardownIfIdle()}};resetForTests=()=>{this.listeners.clear(),this.teardownIfIdle()}}let ou=new oc,od=()=>ou.getState(),oh=e=>ou.subscribe(e),op=()=>{ou.resetForTests()};class of{state;resizeTimer=null;resizeObserver=null;destroyed=!1;cleanupTasks=new Set;constructor(e){this.state=e,this.init(),this.observeContainerResize()}updateParams(e){this.state={...this.state,...e},this.onParamsUpdated(e)}onParamsUpdated(e){}reset(){this.resize(),this.clear()}resize(){this.state.chart?this.hasRenderableContainerSize()&&this.state.chart?.resize?.():this.initializeChartWhenReady()}clear(){this.state.chart?.clear?.()}destroy(){this.destroyed||(this.beforeDestroy(),this.clearResizeObserver(),this.clearResizeTimer(),this.disposeChartInstance(),this.destroyed=!0)}dispose(){this.destroy()}scheduleResize(e=0){this.clearResizeTimer(),this.resizeTimer=setTimeout(()=>{this.resize(),this.resizeTimer=null},e)}clearResizeTimer(){this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=null)}trackCleanup(e){if(!e)return null;let t=!1,r=()=>{t||(t=!0,this.cleanupTasks.delete(r),e())};return this.cleanupTasks.add(r),r}getContainerElement(){return"u"<typeof document?null:document.getElementById(this.state.id)}getContainerSize(){let e=this.getContainerElement();return e?{width:e.clientWidth,height:e.clientHeight}:null}getMinimumContainerSize(){return{width:1,height:1}}hasRenderableContainerSize(){let e=this.getContainerSize();if(!e)return!1;let t=this.getMinimumContainerSize();return e.width>=t.width&&e.height>=t.height}observeContainerResize(){if("u"<typeof ResizeObserver)return;let e=this.getContainerElement();e&&(this.resizeObserver=new ResizeObserver(()=>{this.state.chart?this.scheduleResize():this.initializeChartWhenReady()}),this.resizeObserver.observe(e))}clearResizeObserver(){this.resizeObserver?.disconnect(),this.resizeObserver=null}runCleanupTasks(){let e=Array.from(this.cleanupTasks);for(let t of(this.cleanupTasks.clear(),e))t()}beforeDestroy(){this.runCleanupTasks()}disposeChartInstance(){this.state.chart?.dispose?.(),this.state.chart=null}initializeChartWhenReady(){!this.state.chart&&this.hasRenderableContainerSize()&&this.init()}}let om=e=>e?.samples instanceof Float32Array?!Number.isFinite(e.sampleRate)||e.sampleRate<=0?{valid:!1,reason:"sampleRate must be a positive finite number",sampleFrames:0}:!Number.isInteger(e.channels)||e.channels<=0?{valid:!1,reason:"channels must be a positive integer",sampleFrames:0}:e.samples.length%e.channels!=0?{valid:!1,reason:"samples length must be divisible by channels",sampleFrames:0}:void 0!==e.startSample&&(!Number.isInteger(e.startSample)||e.startSample<0)?{valid:!1,reason:"startSample must be a non-negative integer",sampleFrames:0}:{valid:!0,sampleFrames:e.samples.length/e.channels}:{valid:!1,reason:"samples must be a Float32Array",sampleFrames:0};class og{storage;head=0;size=0;capacity;constructor(e){if(this.capacity=e,!Number.isInteger(e)||e<=0)throw Error("capacity must be a positive integer");this.storage=new Float32Array(e)}get length(){return this.size}clear(){this.storage.fill(0),this.head=0,this.size=0}resize(e){if(!Number.isInteger(e)||e<=0)throw Error("capacity must be a positive integer");if(e===this.capacity)return;let t=new Float32Array(e),r=Math.min(this.size,e),n=this.size-r;for(let e=0;e<r;e+=1)t[e]=this.at(n+e);this.storage=t,this.capacity=e,this.head=0,this.size=r}append(e){for(let t=0;t<e.length;t+=1)this.size<this.capacity?(this.storage[(this.head+this.size)%this.capacity]=e[t],this.size+=1):(this.storage[this.head]=e[t],this.head=(this.head+1)%this.capacity)}at(e){return e<0||e>=this.size?0/0:this.storage[(this.head+e)%this.capacity]}}let ob=(e,t,r=e.length,n=e.length)=>{let a=Math.max(1,Math.floor(t));if(!e.length){let e=new Float32Array(a),t=new Float32Array(a);return e.fill(0/0),t.fill(0/0),{minData:e,maxData:t,xOffset:0}}let i=Math.max(1,Math.floor(r))/a,o=Math.max(e.length,n),l=o/i,s=Math.floor(l),c=l-s,u=s-1,d=0===c?0:-(t/a*c),h=o-e.length,p=new Float32Array(a),f=new Float32Array(a);p.fill(0/0),f.fill(0/0);for(let t=0;t<a;t+=1){let r=u-(a-1-t);if(r<0)continue;let n=Math.floor(r*i),o=Math.max(n+1,Math.floor((r+1)*i)),l=n-h,s=o-h;if(s<=0||l>=e.length)continue;let c=Math.max(0,Math.floor(l)),d=Math.min(e.length,Math.ceil(s)),m=1/0,g=-1/0;for(let t=c;t<d;t+=1){let r=e.at(t);Number.isFinite(r)&&(m=Math.min(m,r),g=Math.max(g,r))}1/0!==m&&(p[t]=m,f[t]=g)}return{minData:p,maxData:f,xOffset:d}},ov=1048576,oy=10,ow=[-1,1],ox="audio",ok=(e,t)=>Number.isInteger(e)&&void 0!==e&&e>0?e:t,oS=e=>Number.isInteger(e)&&void 0!==e&&e>=0?e:0,oM=(e,t)=>Number.isFinite(e)&&void 0!==e&&e>0?e:t;class oC extends of{samples;sampleRate;channels;totalSamplesReceived=0;drawHandle=null;drawHandleIsAnimationFrame=!1;dirty=!1;paletteConfig;constructor(e){let t=ok(e.maxSamples,1048576);super({id:e.id,globalID:e.globalID,chart:null,maxSamples:t,visibleSeconds:oM(e.visibleSeconds,10),channel:oS(e.channel),palette:e.palette??"level"}),this.samples=new og(t),this.paletteConfig=this.resolvePaletteConfig()}init(){if(this.state.chart)return;let{id:e}=this.state;e&&this.hasRenderableContainerSize()&&(this.paletteConfig=this.resolvePaletteConfig(),this.state.chart=new N({id:e,range:ow,series:[{name:ox,type:M.Envelope,color:this.paletteConfig.color,gradientStops:this.paletteConfig.gradientStops,zeroBaseline:this.paletteConfig.zeroBaseline,display:!0,minData:new Float32Array,maxData:new Float32Array}]}),this.trackCleanup(oh(()=>{this.paletteConfig=this.resolvePaletteConfig(),this.dirty=!0,this.scheduleDraw()})))}updateSeries(e){let t=om(e);if(!t.valid||this.state.channel>=e.channels)return;(void 0!==this.sampleRate&&this.sampleRate!==e.sampleRate||void 0!==this.channels&&this.channels!==e.channels)&&this.clear(),this.sampleRate=e.sampleRate,this.channels=e.channels;let r=this.state.channel,n=new Float32Array(t.sampleFrames);for(let a=0;a<t.sampleFrames;a+=1){let t=e.samples[a*e.channels+r];n[a]=Number.isFinite(t)?Math.max(-1,Math.min(1,t)):0/0}this.samples.append(n),this.totalSamplesReceived+=t.sampleFrames,this.dirty=!0,this.scheduleDraw()}resolvePaletteConfig(){let e=this.getContainerElement(),t=ol("--primary",void 0,e)||"#4371F8",r=ol("--chart-highlight",void 0,e)||t;if("monochrome"===this.state.palette)return{color:t,gradientStops:void 0,zeroBaseline:!1};let n=[{offset:0,color:oa(r,.95)},{offset:.05,color:oa(r,.9)},{offset:.15,color:oa(r,.8)},{offset:.35,color:oa(t,.5)},{offset:.5,color:oa(t,.18)},{offset:.65,color:oa(t,.5)},{offset:.85,color:oa(r,.8)},{offset:.95,color:oa(r,.9)},{offset:1,color:oa(r,.95)}];return{color:t,gradientStops:n,zeroBaseline:{color:t,thickness:1,alpha:.35}}}scheduleDraw(){if(null===this.drawHandle){if("u">typeof window&&"function"==typeof window.requestAnimationFrame){this.drawHandleIsAnimationFrame=!0,this.drawHandle=window.requestAnimationFrame(()=>{this.drawHandle=null,this.drawHandleIsAnimationFrame=!1,this.drawIfNeeded()});return}this.drawHandleIsAnimationFrame=!1,this.drawHandle=setTimeout(()=>{this.drawHandle=null,this.drawIfNeeded()},0)}}cancelScheduledDraw(){null!==this.drawHandle&&(this.drawHandleIsAnimationFrame&&"u">typeof window&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame(this.drawHandle):clearTimeout(this.drawHandle),this.drawHandle=null,this.drawHandleIsAnimationFrame=!1)}drawIfNeeded(){if(!this.dirty||!this.state.chart||!this.hasRenderableContainerSize())return;this.dirty=!1;let e=Math.max(1,this.getContainerSize()?.width??1),t=this.sampleRate?Math.max(1,Math.floor(this.sampleRate*this.state.visibleSeconds)):this.samples.length,r=ob(this.samples,e,t,this.totalSamplesReceived),n=this.paletteConfig??this.resolvePaletteConfig();this.state.chart.render({name:ox,type:M.Envelope,color:n.color,gradientStops:n.gradientStops,zeroBaseline:n.zeroBaseline,display:!0,minData:r.minData,maxData:r.maxData,xOffset:r.xOffset})}clear(){this.cancelScheduledDraw(),this.samples.clear(),this.sampleRate=void 0,this.channels=void 0,this.totalSamplesReceived=0,this.dirty=!1,this.state.chart?.clear()}initializeChartWhenReady(){super.initializeChartWhenReady(),this.state.chart&&this.samples.length>0&&(this.dirty=!0,this.scheduleDraw())}reset(){this.clear(),this.resize()}resize(){super.resize(),this.samples.length>0&&(this.dirty=!0,this.scheduleDraw())}updateParams(e){let t=this.state.channel,r=this.state.maxSamples,n=this.state.palette,a=this.state.visibleSeconds,i={};void 0!==e.maxSamples&&(i.maxSamples=ok(e.maxSamples,1048576)),void 0!==e.visibleSeconds&&(i.visibleSeconds=oM(e.visibleSeconds,10)),void 0!==e.channel&&(i.channel=oS(e.channel)),void 0!==e.palette&&(i.palette=e.palette),super.updateParams(i),this.state.channel!==t&&this.clear(),this.state.maxSamples!==r&&(this.samples.resize(ok(this.state.maxSamples,1048576)),this.dirty=!0,this.scheduleDraw()),this.state.visibleSeconds!==a&&(this.dirty=!0,this.scheduleDraw()),this.state.palette!==n&&(this.paletteConfig=this.resolvePaletteConfig(),this.dirty=!0,this.scheduleDraw())}beforeDestroy(){this.cancelScheduledDraw(),super.beforeDestroy()}}let oF=e=>{let{maxSamples:t,visibleSeconds:n,channel:a,palette:i}=e,{chart:o,Chart:l}=iV({Render:oC,params:m(()=>({maxSamples:t,visibleSeconds:n,channel:a,palette:i}),[a,t,i,n])});return i3({moduleType:rr.AudioWaveform,chart:o,renderPSTypes:[rn.AudioWaveform],extractData:e=>e.data}),/*#__PURE__*/r(l,{})},oD=oF,oz=e=>{let{publish:t,maxSamples:n,visibleSeconds:a,channel:i,palette:o}=e,{state:{globalID:l}}=ae();return ac({publish:t,subscribe:e=>{((e,t,r="0")=>tI(e,t,void 0,r))(l,rr.AudioWaveform)(e)}}),/*#__PURE__*/r(am,{children:/*#__PURE__*/r(oF,{maxSamples:n,visibleSeconds:a,channel:i,palette:o})})},oN=oz,oE=e=>/*#__PURE__*/r(aa,{...e,system:{padding:!1,border:!1},axisY:{show:!1},axisX:{show:!1},toolbar:{show:!1},cursor:{show:!1},zoom:{show:!1},children:/*#__PURE__*/r(oz,{...e})}),oT=tB(oE,"AudioWaveform"),oR=oT,oA="render",oI=(e,t={})=>{let{allowImplicitRender:r=!1,renderPSTypes:n=[]}=t;return e.pstype===oA?e:void 0===e.pstype?r?{...e,pstype:oA}:e:n.includes(e.pstype)?{...e,pstype:oA}:e},oP="u">typeof window?f:h,oL=({children:e})=>{let t=g(null),n=g(null),a=g(null),i=u(()=>{if(n.current&&t.current){let e=Math.min(t.current.clientWidth,t.current.clientHeight);a.current!==e&&(a.current=e,n.current.style.width=`${e}px`,n.current.style.height=`${e}px`)}},[]);return oP(()=>{if(!t.current)return;i();let e=new ResizeObserver(()=>{t.current&&i()});return e.observe(t.current),()=>{e.disconnect()}},[i]),/*#__PURE__*/r("div",{className:"relative h-full min-h-0 w-full min-w-0 overflow-hidden",ref:t,children:/*#__PURE__*/r("div",{className:"absolute inset-0 m-auto flex box-border items-center justify-center",ref:n,children:/*#__PURE__*/r(al,{children:e})})})},oO=oL;class oq extends of{getMinimumContainerSize(){return{width:120,height:120}}subscribeToTheme(){this.trackCleanup(oh(()=>{let e=this.getContainerElement();if(!e)return;let t=oo(e);this.state.chart?.updateProps?.(t),this.resize()}))}updateSeries(e){this.state.chart?.render?.(e)}}let o$="relative flex h-10 min-w-0 w-full items-center justify-between pl-[var(--size-gap-base)] text-xs text-foreground",o_={background:"linear-gradient(to bottom, var(--background), var(--mix-background-86))",boxShadow:"0 1px 4px var(--mix-border-72)"},oj="flex h-full w-max min-w-full items-center gap-[var(--size-gap-base)]",oH="min-w-0 flex-1 overflow-x-auto overflow-y-hidden",oB="self-center",oW=`${oB} h-[18px]`,oG=`${oB} h-3.5`,oY="pointer-events-auto box-border rounded-[var(--radius-group)] bg-secondary text-inherit transition-[background-color,color,opacity] select-none",oU="cursor-pointer appearance-none border-0 hover:bg-accent/72 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/70 focus-visible:ring-offset-1 focus-visible:ring-offset-background",oX="cursor-not-allowed opacity-45 hover:bg-secondary",oK=null,oV={default:"data-[active=true]:bg-accent/72 data-[active=true]:text-foreground data-[active=true]:shadow-[inset_0_0_0_1px_var(--mix-border-72)] data-[active=true]:hover:bg-accent/72",primary:"data-[active=true]:bg-accent/72 data-[active=true]:text-primary data-[active=true]:shadow-[inset_0_0_0_1px_var(--mix-border-72)] data-[active=true]:hover:bg-accent/72",warning:"data-[active=true]:bg-warning/10 data-[active=true]:text-warning data-[active=true]:shadow-[inset_0_0_0_1px_var(--mix-warning-24)] data-[active=true]:hover:bg-warning/12",destructive:"data-[active=true]:bg-destructive/10 data-[active=true]:text-destructive data-[active=true]:shadow-[inset_0_0_0_1px_var(--mix-destructive-24)] data-[active=true]:hover:bg-destructive/12"},oQ="inline-flex h-[26px] min-w-[26px] shrink-0 items-center justify-center",oZ=`${oY} inline-flex h-[26px] min-w-[26px] shrink-0 items-center justify-center px-1 [&_svg]:size-4 [&_svg]:shrink-0 [&>span]:flex [&>span]:items-center [&>span]:justify-center`,oJ="inline-flex h-[26px] shrink-0 items-stretch overflow-hidden rounded-[var(--radius-group)] border border-solid border-border/60 transition-colors",o0=`${oJ} min-w-10 items-center justify-between gap-1 px-[calc(var(--size-gap-base)/2)] hover:bg-accent/72 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/70 focus-visible:ring-offset-1 focus-visible:ring-offset-background`,o1="data-[state=open]:bg-accent/72 data-[state=open]:text-foreground data-[state=open]:shadow-[inset_0_0_0_1px_var(--mix-border-72)] data-[state=open]:hover:bg-accent/72",o2="inline-flex h-full min-h-0 min-w-0 items-center gap-1 p-0 text-inherit focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/70 focus-visible:ring-offset-1 focus-visible:ring-offset-background",o5="inline-flex h-full items-center px-[calc(var(--size-gap-base)/2)] text-primary hover:bg-accent/72 data-[state=open]:bg-accent/72 data-[state=open]:hover:bg-accent/72",o4="h-full rounded-none border-0 bg-transparent shadow-none",o3=`${oY} inline-flex h-[26px] min-w-[26px] shrink-0 items-center px-1`,o6="inline-flex h-[14px] min-w-0 items-center justify-center text-xs leading-none",o8="w-4 justify-center",o9="min-w-8 justify-center text-center",o7="w-[60px] justify-stretch",le="inline-flex h-full min-w-4 shrink-0 items-center justify-center text-primary",lt="inline-flex size-4 shrink-0 items-center justify-center [&_svg]:size-full [&_svg]:shrink-0",lr="border-border/80 bg-secondary/92 text-foreground shadow-[0_10px_28px_var(--mix-background-60)] backdrop-blur-xl";var ln=Object.defineProperty,la=(e,t)=>ln(e,"name",{value:t,configurable:!0}),li=!!("u">typeof window&&window.document&&window.document.createElement);function lo(e,t,{checkForDefaultPrevented:r=!0}={}){return /* @__PURE__ */la(function(n){if(e?.(n),!1===r||!n||!n.defaultPrevented)return t?.(n)},"handleEvent")}function ll(e){if(!li)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}function ls(e){if(!li)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function lc(e,t=!1){let{activeElement:r}=ls(e);if(!r?.nodeName)return null;if(lu(r)&&r.contentDocument)return lc(r.contentDocument.body,t);if(t){let e=r.getAttribute("aria-activedescendant");if(e){let t=ls(r).getElementById(e);if(t)return t}}return r}function lu(e){return"IFRAME"===e.tagName}la(lo,"composeEventHandlers"),la(ll,"getOwnerWindow"),la(ls,"getOwnerDocument"),la(lc,"getActiveElement"),la(lu,"isFrame");var ld=Object.defineProperty,lh=(e,t)=>ld(e,"name",{value:t,configurable:!0});function lp(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function lf(...e){return t=>{let r=!1,n=e.map(e=>{let n=lp(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():lp(e[t],null)}}}}function lm(...e){return $.useCallback(lf(...e),e)}lh(lp,"setRef"),lh(lf,"composeRefs"),lh(lm,"useComposedRefs");var lg=Object.defineProperty,lb=(e,t)=>lg(e,"name",{value:t,configurable:!0});function lv(e,t){let n=$.createContext(t);n.displayName=e+"Context";let a=/* @__PURE__ */lb(e=>{let{children:t,...a}=e,i=$.useMemo(()=>a,Object.values(a));return /* @__PURE__ */r(n.Provider,{value:i,children:t})},"Provider");function i(r,a={}){let{optional:o=!1}=a,l=$.useContext(n);if(l)return l;if(void 0!==t)return t;if(!o)throw Error(`\`${r}\` must be used within \`${e}\``)}return a.displayName=e+"Provider",lb(i,"useContext"),[a,i]}function ly(e,t=[]){let n=[];function a(t,a){let i=$.createContext(a);i.displayName=t+"Context";let o=n.length;n=[...n,a];let l=/* @__PURE__ */lb(t=>{let{scope:n,children:a,...l}=t,s=n?.[e]?.[o]||i,c=$.useMemo(()=>l,Object.values(l));return /* @__PURE__ */r(s.Provider,{value:c,children:a})},"Provider");function s(r,n,l={}){let{optional:c=!1}=l,u=n?.[e]?.[o]||i,d=$.useContext(u);if(d)return d;if(void 0!==a)return a;if(!c)throw Error(`\`${r}\` must be used within \`${t}\``)}return l.displayName=t+"Provider",lb(s,"useContext"),[l,s]}lb(a,"createContext");let i=/* @__PURE__ */lb(()=>{let t=n.map(e=>$.createContext(e));return /* @__PURE__ */lb(function(r){let n=r?.[e]||t;return $.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])},"useScope")},"createScope");return i.scopeName=e,[a,lw(i,...t)]}function lw(...e){let t=e[0];if(1===e.length)return t;let r=/* @__PURE__ */lb(()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return /* @__PURE__ */lb(function(e){let n=r.reduce((t,{useScope:r,scopeName:n})=>{let a=r(e)[`__scope${n}`];return{...t,...a}},{});return $.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])},"useComposedScopes")},"createScope");return r.scopeName=t.scopeName,r}lb(lv,"createContext"),lb(ly,"createContextScope"),lb(lw,"composeContextScopes");var lx=!1,lk=globalThis?.document?$.useLayoutEffect:()=>{},lS=Object.defineProperty,lM=(e,t)=>lS(e,"name",{value:t,configurable:!0}),lC=$[" useEffectEvent ".trim().toString()],lF=$[" useInsertionEffect ".trim().toString()];function lD(e){if("function"==typeof lC)return lC(e);let t=$.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof lF?lF(()=>{t.current=e}):lk(()=>{t.current=e}),$.useMemo(()=>(...e)=>t.current?.(...e),[])}lM(lD,"useEffectEvent");var lz=Object.defineProperty,lN=(e,t)=>lz(e,"name",{value:t,configurable:!0}),lE=$[" useInsertionEffect ".trim().toString()]||lk;function lT({prop:e,defaultProp:t,onChange:r=/* @__PURE__ */lN(()=>{},"onChange"),caller:n}){let[a,i,o]=lR({defaultProp:t,onChange:r}),l=void 0!==e,s=l?e:a;if(lx){let t=$.useRef(void 0!==e);$.useEffect(()=>{let e=t.current;if(e!==l){let t=l?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,n])}return[s,$.useCallback(t=>{if(l){let r=lA(t)?t(e):t;r!==e&&o.current?.(r)}else i(t)},[l,e,i,o])]}function lR({defaultProp:e,onChange:t}){let[r,n]=$.useState(e),a=$.useRef(r),i=$.useRef(t);return lE(()=>{i.current=t},[t]),$.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,n,i]}function lA(e){return"function"==typeof e}lN(lT,"useControllableState"),lN(lR,"useUncontrolledState"),lN(lA,"isFunction");var lI=Symbol("RADIX:SYNC_STATE");function lP(e,t,r,n){let{prop:a,defaultProp:i,onChange:o,caller:l}=t,s=void 0!==a,c=lD(o);if(lx){let e=$.useRef(void 0!==a);$.useEffect(()=>{let t=e.current;if(t!==s){let e=s?"controlled":"uncontrolled";console.warn(`${l} is changing from ${t?"controlled":"uncontrolled"} to ${e}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}e.current=s},[s,l])}let u=[{...r,state:i}];n&&u.push(n);let[d,h]=$.useReducer((t,r)=>{if(r.type===lI)return{...t,state:r.state};let n=e(t,r);return s&&!Object.is(n.state,t.state)&&c(n.state),n},...u),p=d.state,f=$.useRef(p);$.useEffect(()=>{f.current!==p&&(f.current=p,s||c(p))},[p,f,s]);let m=$.useMemo(()=>void 0!==a?{...d,state:a}:d,[d,a]);return $.useEffect(()=>{s&&!Object.is(a,d.state)&&h({type:lI,state:a})},[a,d.state,s]),[m,h]}lN(lP,"useControllableStateReducer");var lL=Object.defineProperty,lO=(e,t)=>lL(e,"name",{value:t,configurable:!0});function lq(e){let t=$.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,l=[];lX(n)&&"function"==typeof lZ&&(n=lZ(n._payload)),$.Children.forEach(n,e=>{if(lY(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;lX(t)&&"function"==typeof lZ&&(t=lZ(t._payload)),i=lB(e,t),l.push(i?.props?.children)}else l.push(e)}),i?i=$.cloneElement(i,void 0,l):!o&&1===$.Children.count(n)&&$.isValidElement(n)&&(i=n);let s=i?lG(i):void 0,c=lm(r,s);if(!i){if(n||0===n)throw Error(o?lQ(e):lV(e));return n}let u=lW(a,i.props??{});return i.type!==$.Fragment&&(u.ref=r?c:s),$.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}lO(lq,"createSlot");var l$=/* @__PURE__ */null,l_=Symbol.for("radix.slottable");function lj(e){let t=/* @__PURE__ */lO(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=l_,t}lO(lj,"createSlottable");var lH=/* @__PURE__ */null,lB=/* @__PURE__ */lO((e,t)=>{if("child"in e.props){let t=e.props.child;return $.isValidElement(t)?$.cloneElement(t,void 0,e.props.children(t.props.children)):null}return $.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function lW(e,t){let r={...t};for(let n in t){let a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{let t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function lG(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function lY(e){return $.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===l_}lO(lW,"mergeProps"),lO(lG,"getElementRef"),lO(lY,"isSlottable");var lU=Symbol.for("react.lazy");function lX(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===lU&&"_payload"in e&&lK(e._payload)}function lK(e){return"object"==typeof e&&null!==e&&"then"in e}lO(lX,"isLazyComponent"),lO(lK,"isPromiseLike");var lV=/* @__PURE__ */lO(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),lQ=/* @__PURE__ */lO(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),lZ=$[" use ".trim().toString()],lJ=Object.defineProperty,l0=(e,t)=>lJ(e,"name",{value:t,configurable:!0}),l1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],l2=l1.reduce((e,t)=>{let n=lq(`Primitive.${t}`),a=$.forwardRef((e,a)=>{let{asChild:i,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),/* @__PURE__ */r(i?n:t,{...o,ref:a})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function l5(e,t){e&&_.flushSync(()=>e.dispatchEvent(t))}l0(l5,"dispatchDiscreteCustomEvent");var l4=null,l3=Object.defineProperty,l6=(e,t)=>l3(e,"name",{value:t,configurable:!0});function l8(e){let t=e+"CollectionProvider",[n,a]=ly(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:/* @__PURE__ */new Map}),l=/* @__PURE__ */l6(e=>{let{scope:t,children:n}=e,a=$.useRef(null);return /* @__PURE__ */r(i,{scope:t,itemMap:$.useRef(/* @__PURE__ */new Map).current,collectionRef:a,children:n})},"CollectionProvider");l.displayName=t;let s=e+"CollectionSlot",c=lq(s),u=$.forwardRef((e,t)=>{let{scope:n,children:a}=e;return /* @__PURE__ */r(c,{ref:lm(t,o(s,n).collectionRef),children:a})});u.displayName=s;let d=e+"CollectionItemSlot",h="data-radix-collection-item",p=lq(d),f=$.forwardRef((e,t)=>{let{scope:n,children:a,...i}=e,l=$.useRef(null),s=lm(t,l),c=o(d,n);return $.useEffect(()=>(c.itemMap.set(l,{ref:l,...i}),()=>void c.itemMap.delete(l))),/* @__PURE__ */r(p,{...{[h]:""},ref:s,children:a})});function m(t){let r=o(e+"CollectionConsumer",t);return $.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])}return f.displayName=d,l6(m,"useCollection"),[{Provider:l,Slot:u,ItemSlot:f},m,a]}l6(l8,"createCollection");var l9=/* @__PURE__ */new WeakMap,l7=class e extends Map{static{l6(this,"OrderedDict")}#e;constructor(e){super(e),this.#e=[...super.keys()],l9.set(this,!0)}set(e,t){return l9.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let n,a=this.has(t),i=this.#e.length,o=sr(e),l=o>=0?o:i+o,s=l<0||l>=i?-1:l;if(s===this.size||a&&s===this.size-1||-1===s)return this.set(t,r),this;let c=this.size+ +!a;o<0&&l++;let u=[...this.#e],d=!1;for(let e=l;e<c;e++)if(l===e){let i=u[e];u[e]===t&&(i=u[e+1]),a&&this.delete(t),n=this.get(i),this.set(t,r)}else{d||u[e-1]!==t||(d=!0);let r=u[d?e:e-1],a=n;n=this.get(r),this.delete(r),this.set(r,a)}return this}with(t,r,n){let a=new e(this);return a.insert(t,r,n),a}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=se(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=se(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return se(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],a=0;for(let e of this)Reflect.apply(t,r,[e,a,this])&&n.push(e),a++;return new e(n)}map(t,r){let n=[],a=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,a,this])]),a++;return new e(n)}reduce(...e){let[t,r]=e,n=0,a=r??this.at(0);for(let r of this)a=0===n&&1===e.length?r:Reflect.apply(t,this,[a,r,n,this]),n++;return a}reduceRight(...e){let[t,r]=e,n=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let a=this.at(r);n=r===this.size-1&&1===e.length?a:Reflect.apply(t,this,[n,a,r,this])}return n}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let n=new e,a=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(a=r-1);for(let e=t;e<=a;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}};function se(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let r=st(e,t);return -1===r?void 0:e[r]}function st(e,t){let r=e.length,n=sr(t),a=n>=0?n:r+n;return a<0||a>=r?-1:a}function sr(e){return e!=e||0===e?0:Math.trunc(e)}function sn(e){let t=e+"CollectionProvider",[n,a]=ly(t),[i,o]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new l7,setItemMap:/* @__PURE__ */l6(()=>void 0,"setItemMap")}),l=/* @__PURE__ */l6(({state:e,...t})=>e?/* @__PURE__ */r(c,{...t,state:e}):/* @__PURE__ */r(s,{...t}),"CollectionProvider");l.displayName=t;let s=/* @__PURE__ */l6(e=>{let t=g();return /* @__PURE__ */r(c,{...e,state:t})},"CollectionInit");s.displayName=t+"Init";let c=/* @__PURE__ */l6(e=>{let{scope:t,children:n,state:a}=e,o=$.useRef(null),[l,s]=$.useState(null),c=lm(o,s),[u,d]=a;return $.useEffect(()=>{if(!l)return;let e=sl(()=>{});return e.observe(l,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[l]),/* @__PURE__ */r(i,{scope:t,itemMap:u,setItemMap:d,collectionRef:c,collectionRefObject:o,collectionElement:l,children:n})},"CollectionProviderImpl");c.displayName=t+"Impl";let u=e+"CollectionSlot",d=lq(u),h=$.forwardRef((e,t)=>{let{scope:n,children:a}=e;return /* @__PURE__ */r(d,{ref:lm(t,o(u,n).collectionRef),children:a})});h.displayName=u;let p=e+"CollectionItemSlot",f=lq(p),m=$.forwardRef((e,t)=>{let{scope:n,children:a,...i}=e,l=$.useRef(null),[s,c]=$.useState(null),u=lm(t,l,c),{setItemMap:d}=o(p,n),h=$.useRef(i);sa(h.current,i)||(h.current=i);let m=h.current;return $.useEffect(()=>(d(e=>s?e.has(s)?e.set(s,{...m,element:s}).toSorted(so):(e.set(s,{...m,element:s}),e.toSorted(so)):e),()=>{d(e=>s&&e.has(s)?(e.delete(s),new l7(e)):e)}),[s,m,d]),/* @__PURE__ */r(f,{"data-radix-collection-item":"",ref:u,children:a})});function g(){return $.useState(new l7)}function b(t){let{itemMap:r}=o(e+"CollectionConsumer",t);return r}return m.displayName=p,l6(g,"useInitCollection"),l6(b,"useCollection"),[{Provider:l,Slot:h,ItemSlot:m},{createCollectionScope:a,useCollection:b,useInitCollection:g}]}function sa(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(!Object.prototype.hasOwnProperty.call(t,n)||e[n]!==t[n])return!1;return!0}function si(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function so(e,t){return e[1].element&&t[1].element?si(e[1].element,t[1].element)?-1:1:0}function sl(e){return new MutationObserver(t=>{for(let r of t)if("childList"===r.type)return void e()})}l6(se,"at"),l6(st,"toSafeIndex"),l6(sr,"toSafeInteger"),l6(sn,"createCollection"),l6(sa,"shallowEqual"),l6(si,"isElementPreceding"),l6(so,"sortByDocumentPosition"),l6(sl,"getChildListObserver");var ss=Object.defineProperty,sc=(e,t)=>ss(e,"name",{value:t,configurable:!0}),su=$.createContext(void 0),sd=/* @__PURE__ */null;function sh(e){let t=$.useContext(su);return e||t||"ltr"}sc(sh,"useDirection");var sp=null,sf=Object.defineProperty,sm=(e,t)=>sf(e,"name",{value:t,configurable:!0});function sg(e){let t=$.useRef(e);return $.useEffect(()=>{t.current=e}),$.useMemo(()=>(...e)=>t.current?.(...e),[])}sm(sg,"useCallbackRef");var sb=Object.defineProperty,sv=(e,t)=>sb(e,"name",{value:t,configurable:!0}),sy="dismissableLayer.update",sw="dismissableLayer.pointerDownOutside",sx="dismissableLayer.focusOutside",sk=$.createContext({layers:/* @__PURE__ */new Set,layersWithOutsidePointerEventsDisabled:/* @__PURE__ */new Set,branches:/* @__PURE__ */new Set,dismissableSurfaces:/* @__PURE__ */new Set}),sS=/* @__PURE__ */$.forwardRef(/* @__PURE__ */sv(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:s,onDismiss:c,...u}=e,d=$.useContext(sk),[h,p]=$.useState(null),f=h?.ownerDocument??globalThis?.document,[,m]=$.useState({}),g=lm(t,p),b=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?b.indexOf(v):-1,w=h?b.indexOf(h):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,k=w>=y,S=$.useRef(!1),M=sD(e=>{o?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:f,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:$.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return k&&!t},[d.branches,k])}),C=sz(e=>{if(a&&S.current)return;let t=e.target;![...d.branches].some(e=>e.contains(t))&&(l?.(e),s?.(e),e.defaultPrevented||c?.())},f),F=!!h&&w===b.length-1,D=sg(e=>{"Escape"===e.key&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return $.useEffect(()=>{if(F)return f.addEventListener("keydown",D,{capture:!0}),()=>f.removeEventListener("keydown",D,{capture:!0})},[f,F,D]),$.useEffect(()=>{if(h)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(j=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),sN(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(h),0===d.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=j))}},[h,f,n,d]),$.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),sN())},[h,d]),$.useEffect(()=>{let e=/* @__PURE__ */sv(()=>m({}),"handleUpdate");return document.addEventListener(sy,e),()=>document.removeEventListener(sy,e)},[]),/* @__PURE__ */r(l2.div,{...u,ref:g,style:{pointerEvents:x?k?"auto":"none":void 0,...e.style},onFocusCapture:lo(e.onFocusCapture,C.onFocusCapture),onBlurCapture:lo(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:lo(e.onPointerDownCapture,M.onPointerDownCapture)})},"DismissableLayer")),sM=/* @__PURE__ */null;function sC(){let e=$.useContext(sk),[t,r]=$.useState(null);return $.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}sv(sC,"useDismissableLayerSurface");var sF=/* @__PURE__ */sv(()=>!0,"IS_TRUE");function sD(e,t){let{ownerDocument:r=globalThis?.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=sF}=t,l=sg(e),s=$.useRef(!1),c=$.useRef(!1),u=$.useRef(/* @__PURE__ */new Map),d=$.useRef(()=>{});return $.useEffect(()=>{function e(){c.current=!1,a.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}function h(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...i].some(e=>e.contains(t))||u.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{c.current&&d.current()},0)}function p(e){c.current&&u.current.set(e.type,!1)}sv(e,"resetOutsideInteraction"),sv(t,"isOutsideInteractionIntercepted"),sv(h,"handleInteractionCapture"),sv(p,"handleInteractionBubble");let f=/* @__PURE__ */sv(i=>{if(i.target&&!s.current){let h=function(){r.removeEventListener("click",d.current);let n=t();e(),n||sE(sw,l,p,{discrete:!0})};if(sv(h,"handleAndDispatchPointerDownOutsideEvent"),!o(i.target)){r.removeEventListener("click",d.current),e(),s.current=!1;return}let p={originalEvent:i};c.current=!0,a.current=n&&0===i.button,u.current.clear(),n&&0===i.button?(r.removeEventListener("click",d.current),d.current=h,r.addEventListener("click",d.current,{once:!0})):h()}else r.removeEventListener("click",d.current),e();s.current=!1},"handlePointerDown"),m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of m)r.addEventListener(e,h,!0),r.addEventListener(e,p);let g=window.setTimeout(()=>{r.addEventListener("pointerdown",f)},0);return()=>{for(let e of(window.clearTimeout(g),r.removeEventListener("pointerdown",f),r.removeEventListener("click",d.current),m))r.removeEventListener(e,h,!0),r.removeEventListener(e,p)}},[r,l,n,a,i,o]),{onPointerDownCapture:/* @__PURE__ */sv(()=>s.current=!0,"onPointerDownCapture")}}function sz(e,t=globalThis?.document){let r=sg(e),n=$.useRef(!1);return $.useEffect(()=>{let e=/* @__PURE__ */sv(e=>{e.target&&!n.current&&sE(sx,r,{originalEvent:e},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:/* @__PURE__ */sv(()=>n.current=!0,"onFocusCapture"),onBlurCapture:/* @__PURE__ */sv(()=>n.current=!1,"onBlurCapture")}}function sN(){let e=new CustomEvent(sy);document.dispatchEvent(e)}function sE(e,t,r,{discrete:n}){let a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?l5(a,i):a.dispatchEvent(i)}sv(sD,"usePointerDownOutside"),sv(sz,"useFocusOutside"),sv(sN,"dispatchUpdate"),sv(sE,"handleAndDispatchCustomEvent");var sT=null,sR=null,sA=Object.defineProperty,sI=(e,t)=>sA(e,"name",{value:t,configurable:!0}),sP=0,sL=null;function sO(e){return sq(),e.children}function sq(){$.useEffect(()=>{sL||(sL={start:s$(),end:s$()});let{start:e,end:t}=sL;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),sP++,()=>{1===sP&&(sL?.start.remove(),sL?.end.remove(),sL=null),sP=Math.max(0,sP-1)}},[])}function s$(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}sI(sO,"FocusGuards"),sI(sq,"useFocusGuards"),sI(s$,"createFocusGuard");var s_=Object.defineProperty,sj=(e,t)=>s_(e,"name",{value:t,configurable:!0}),sH="focusScope.autoFocusOnMount",sB="focusScope.autoFocusOnUnmount",sW={bubbles:!1,cancelable:!0},sG=/* @__PURE__ */$.forwardRef(/* @__PURE__ */sj(function(e,t){let{loop:n=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[s,c]=$.useState(null),u=sg(i),d=sg(o),h=$.useRef(null),p=lm(t,c),f=$.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;$.useEffect(()=>{if(a){let e=function(e){if(f.paused||!s)return;let t=e.target;s.contains(t)?h.current=t:sZ(h.current,{select:!0})},t=function(e){if(f.paused||!s)return;let t=e.relatedTarget;null!==t&&(s.contains(t)||sZ(h.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&sZ(s)};sj(e,"handleFocusIn"),sj(t,"handleFocusOut"),sj(r,"handleMutations"),document.addEventListener("focusin",e),document.addEventListener("focusout",t);let n=new MutationObserver(r);return s&&n.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[a,s,f.paused]),$.useEffect(()=>{if(s){sJ.add(f);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(sH,sW);s.addEventListener(sH,u),s.dispatchEvent(t),t.defaultPrevented||(sY(s2(sX(s)),{select:!0}),document.activeElement===e&&sZ(s))}return()=>{s.removeEventListener(sH,u),setTimeout(()=>{let t=new CustomEvent(sB,sW);s.addEventListener(sB,d),s.dispatchEvent(t),t.defaultPrevented||sZ(e??document.body,{select:!0}),s.removeEventListener(sB,d),sJ.remove(f)},0)}}},[s,u,d,f]);let m=$.useCallback(e=>{if(!n&&!a||f.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){let t=e.currentTarget,[a,i]=sU(t);a&&i?e.shiftKey||r!==i?e.shiftKey&&r===a&&(e.preventDefault(),n&&sZ(i,{select:!0})):(e.preventDefault(),n&&sZ(a,{select:!0})):r===t&&e.preventDefault()}},[n,a,f.paused]);return /* @__PURE__ */r(l2.div,{tabIndex:-1,...l,ref:p,onKeyDown:m})},"FocusScope"));function sY(e,{select:t=!1}={}){let r=document.activeElement;for(let n of e)if(sZ(n,{select:t}),document.activeElement!==r)return}function sU(e){let t=sX(e);return[sK(t,e),sK(t.reverse(),e)]}function sX(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:/* @__PURE__ */sj(e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}function sK(e,t){let r="function"==typeof t.checkVisibility&&t.checkVisibility({checkVisibilityCSS:!0});for(let n of e)if(!(r?!n.checkVisibility({checkVisibilityCSS:!0}):sV(n,{upTo:t})))return n}function sV(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function sQ(e){return e instanceof HTMLInputElement&&"select"in e}function sZ(e,{select:t=!1}={}){if(e&&e.focus){let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&sQ(e)&&t&&e.select()}}sj(sY,"focusFirst"),sj(sU,"getTabbableEdges"),sj(sX,"getTabbableCandidates"),sj(sK,"findVisible"),sj(sV,"isHidden"),sj(sQ,"isSelectableInput"),sj(sZ,"focus");var sJ=s0();function s0(){let e=[];return{add(t){let r=e[0];t!==r&&r?.pause(),(e=s1(e,t)).unshift(t)},remove(t){e=s1(e,t),e[0]?.resume()}}}function s1(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}function s2(e){return e.filter(e=>"A"!==e.tagName)}sj(s0,"createFocusScopesStack"),sj(s1,"arrayRemove"),sj(s2,"removeLinks");var s5=null;let s4=["top","right","bottom","left"],s3=null,s6=/*#__PURE__*/null,s8=Math.min,s9=Math.max,s7=Math.round,ce=Math.floor,ct=e=>({x:e,y:e}),cr={left:"right",right:"left",bottom:"top",top:"bottom"};function ca(e,t,r){return s9(e,s8(t,r))}function ci(e,t){return"function"==typeof e?e(t):e}function co(e){return e.split("-")[0]}function cl(e){return e.split("-")[1]}function cs(e){return"x"===e?"y":"x"}function cc(e){return"y"===e?"height":"width"}function cu(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function cd(e){return cs(cu(e))}function ch(e,t,r){void 0===r&&(r=!1);let n=cl(e),a=cd(e),i=cc(a),o="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=cx(o)),[o,cx(o)]}function cp(e){let t=cx(e);return[cf(e),t,cf(t)]}function cf(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let cm=["left","right"],cg=["right","left"],cb=["top","bottom"],cv=["bottom","top"];function cy(e,t,r){switch(e){case"top":case"bottom":if(r)return t?cg:cm;return t?cm:cg;case"left":case"right":return t?cb:cv;default:return[]}}function cw(e,t,r,n){let a=cl(e),i=cy(co(e),"start"===r,n);return a&&(i=i.map(e=>e+"-"+a),t&&(i=i.concat(i.map(cf)))),i}function cx(e){let t=co(e);return cr[t]+e.slice(t.length)}function ck(e){var t,r,n,a;return{top:null!=(t=e.top)?t:0,right:null!=(r=e.right)?r:0,bottom:null!=(n=e.bottom)?n:0,left:null!=(a=e.left)?a:0}}function cS(e){return"number"!=typeof e?ck(e):{top:e,right:e,bottom:e,left:e}}function cM(e){let{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function cC(e,t,r){let n,{reference:a,floating:i}=e,o=cu(t),l=cd(t),s=cc(l),c=co(t),u=a.x+a.width/2-i.width/2,d=a.y+a.height/2-i.height/2,h=a[s]/2-i[s]/2;switch(c){case"top":n={x:u,y:a.y-i.height};break;case"bottom":n={x:u,y:a.y+a.height};break;case"right":n={x:a.x+a.width,y:d};break;case"left":n={x:a.x-i.width,y:d};break;default:n={x:a.x,y:a.y}}let p=cl(t);return p&&(n[l]+=h*("end"===p?1:-1)*(r&&"y"===o?-1:1)),n}async function cF(e,t){var r;void 0===t&&(t={});let{x:n,y:a,platform:i,rects:o,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=ci(t,e),f=cS(p),m=l[h?"floating"===d?"reference":"floating":d],g=cM(await i.getClippingRect({element:null==(r=await (null==i.isElement?void 0:i.isElement(m)))||r?m:m.contextElement||await (null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),b="floating"===d?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,v=await (null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),y=await (null==i.isElement?void 0:i.isElement(v))&&await (null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},w=cM(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:v,strategy:s}):b);return{top:(g.top-w.top+f.top)/y.y,bottom:(w.bottom-g.bottom+f.bottom)/y.y,left:(g.left-w.left+f.left)/y.x,right:(w.right-g.right+f.right)/y.x}}let cD=50,cz=async(e,t,r)=>{let{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,l=o.detectOverflow?o:{...o,detectOverflow:cF},s=await (null==o.isRTL?void 0:o.isRTL(t)),c=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=cC(c,n,s),h=n,p=0,f={};for(let r=0;r<i.length;r++){let m=i[r];if(!m)continue;let{name:g,fn:b}=m,{x:v,y:y,data:w,reset:x}=await b({x:u,y:d,initialPlacement:n,placement:h,strategy:a,middlewareData:f,rects:c,platform:l,elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=y?y:d,f[g]={...f[g],...w},x&&p<50&&(p++,"object"==typeof x&&(x.placement&&(h=x.placement),x.rects&&(c=!0===x.rects?await o.getElementRects({reference:e,floating:t,strategy:a}):x.rects),{x:u,y:d}=cC(c,h,s)),r=-1)}return{x:u,y:d,placement:h,strategy:a,middlewareData:f}},cN=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:a,rects:i,platform:o,elements:l,middlewareData:s}=t,{element:c,padding:u=0}=ci(e,t)||{};if(null==c)return{};let d=cS(u),h={x:r,y:n},p=cd(a),f=cc(p),m=await o.getDimensions(c),g="y"===p,b=g?"clientHeight":"clientWidth",v=i.reference[f]+i.reference[p]-h[p]-i.floating[f],y=h[p]-i.reference[p],w=await (null==o.getOffsetParent?void 0:o.getOffsetParent(c)),x=w?w[b]:0;x&&await (null==o.isElement?void 0:o.isElement(w))||(x=l.floating[b]||i.floating[f]);let k=x/2-m[f]/2-1,S=s8(d[g?"top":"left"],k),M=s8(d[g?"bottom":"right"],k),C=x-m[f]-M,F=x/2-m[f]/2+(v/2-y/2),D=ca(S,F,C),z=!s.arrow&&null!=cl(a)&&F!==D&&i.reference[f]/2-(F<S?S:M)-m[f]/2<0,N=z?F<S?F-S:F-C:0;return{[p]:h[p]+N,data:{[p]:D,centerOffset:F-D-N,...z&&{alignmentOffset:N}},reset:z}}});function cE(e,t,r){return(e?[...r.filter(t=>getAlignment(t)===e),...r.filter(t=>getAlignment(t)!==e)]:r.filter(e=>getSide(e)===e)).filter(r=>!e||getAlignment(r)===e||!!t&&getOppositeAlignmentPlacement(r)!==r)}let cT=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,n,a;let{rects:i,middlewareData:o,placement:l,platform:s,elements:c}=t,{crossAxis:u=!1,alignment:d,allowedPlacements:h=placements,autoAlignment:p=!0,...f}=evaluate(e,t),m=void 0!==d||h===placements?cE(d||null,p,h):h,g=(null==(r=o.autoPlacement)?void 0:r.index)||0,b=m[g];if(null==b)return{};if(l!==b)return{reset:{placement:m[0]}};let v=await s.detectOverflow(t,f),y=getAlignmentSides(b,i,await (null==s.isRTL?void 0:s.isRTL(c.floating))),w=[v[getSide(b)],v[y[0]],v[y[1]]],x=[...(null==(n=o.autoPlacement)?void 0:n.overflows)||[],{placement:b,overflows:w}],k=m[g+1];if(k)return{data:{index:g+1,overflows:x},reset:{placement:k}};let S=x.map(e=>{let t=getAlignment(e.placement);return[e.placement,t&&u?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),M=(null==(a=S.filter(e=>e[2].slice(0,getAlignment(e[0])?2:3).every(e=>e<=0))[0])?void 0:a[0])||S[0][0];return M!==l?{data:{index:g+1,overflows:x},reset:{placement:M}}:{}}}},cR=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n,a,i,o;let{placement:l,middlewareData:s,rects:c,initialPlacement:u,platform:d,elements:h}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:v=!0,...y}=ci(e,t);if(null!=(r=s.arrow)&&r.alignmentOffset)return{};let w=co(l),x=cu(u),k=co(u)===u,S=await (null==d.isRTL?void 0:d.isRTL(h.floating)),M=m||(k||!v?[cx(u)]:cp(u)),C="none"!==b;!m&&C&&M.push(...cw(u,v,b,S));let F=[u,...M],D=await d.detectOverflow(t,y),z=[],N=(null==(n=s.flip)?void 0:n.overflows)||[];if(p&&z.push(D[w]),f){let e=ch(l,c,S);z.push(D[e[0]],D[e[1]])}if(N=[...N,{placement:l,overflows:z}],!z.every(e=>e<=0)){let e=((null==(a=s.flip)?void 0:a.index)||0)+1,t=F[e];if(t&&("alignment"!==f||x===cu(t)||N.every(e=>cu(e.placement)!==x||e.overflows[0]>0)))return{data:{index:e,overflows:N},reset:{placement:t}};let r=null==(i=N.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!r)switch(g){case"bestFit":{let e=null==(o=N.filter(e=>{if(C){let t=cu(e.placement);return t===x||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(r=e);break}case"initialPlacement":r=u}if(l!==r)return{reset:{placement:r}}}return{}}}};function cA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cI(e){return s4.some(t=>e[t]>=0)}let cP=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r,platform:n}=t,{strategy:a="referenceHidden",...i}=ci(e,t);switch(a){case"referenceHidden":{let e=cA(await n.detectOverflow(t,{...i,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:cI(e)}}}case"escaped":{let e=cA(await n.detectOverflow(t,{...i,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:cI(e)}}}default:return{}}}}};function cL(e){let t=min(...e.map(e=>e.left)),r=min(...e.map(e=>e.top));return{x:t,y:r,width:max(...e.map(e=>e.right))-t,height:max(...e.map(e=>e.bottom))-r}}function cO(e){let t=e.slice().sort((e,t)=>e.y-t.y),r=[],n=null;for(let e=0;e<t.length;e++){let a=t[e];!n||a.y-n.y>n.height/2?r.push([a]):r[r.length-1].push(a),n=a}return r.map(e=>rectToClientRect(cL(e)))}let cq=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){let{placement:r,elements:n,rects:a,platform:i,strategy:o}=t,{padding:l=2,x:s,y:c}=evaluate(e,t),u=Array.from(await (null==i.getClientRects?void 0:i.getClientRects(n.reference))||[]);if(!u.length)return{};let d=cO(u),h=rectToClientRect(cL(u)),p=getPaddingObject(l),f=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&(d[0].left>d[1].right||d[1].left>d[0].right)&&null!=s&&null!=c)return d.find(e=>s>e.left-p.left&&s<e.right+p.right&&c>e.top-p.top&&c<e.bottom+p.bottom)||h;if(d.length>=2){if("y"===getSideAxis(r)){let e=d[0],t=d[d.length-1],n="top"===getSide(r),a=e.top,i=t.bottom,o=n?e.left:t.left;return rectToClientRect({x:o,y:a,width:(n?e.right:t.right)-o,height:i-a})}let e="left"===getSide(r),t=max(...d.map(e=>e.right)),n=min(...d.map(e=>e.left)),a=d.filter(r=>e?r.left===n:r.right===t),i=a[0].top;return rectToClientRect({x:n,y:i,width:t-n,height:a[a.length-1].bottom-i})}return h}},floating:n.floating,strategy:o});return a.reference.x!==f.reference.x||a.reference.y!==f.reference.y||a.reference.width!==f.reference.width||a.reference.height!==f.reference.height?{reset:{rects:f}}:{}}}},c$=/*#__PURE__*/new Set(["left","top"]);async function c_(e,t){let{placement:r,platform:n,elements:a}=e,i=await (null==n.isRTL?void 0:n.isRTL(a.floating)),o=co(r),l=cl(r),s="y"===cu(r),c=c$.has(o)?-1:1,u=i&&s?-1:1,d=ci(t,e),{mainAxis:h,crossAxis:p,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&"number"==typeof f&&(p="end"===l?-1*f:f),s?{x:p*u,y:h*c}:{x:h*c,y:p*u}}let cj=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:a,y:i,placement:o,middlewareData:l}=t,s=await c_(t,e);return o===(null==(r=l.offset)?void 0:r.placement)&&null!=(n=l.arrow)&&n.alignmentOffset?{}:{x:a+s.x,y:i+s.y,data:{...s,placement:o}}}}},cH=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:a,platform:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...c}=ci(e,t),u={x:r,y:n},d=await i.detectOverflow(t,c),h=cu(a),p=cs(h),f=u[p],m=u[h],g=(e,t)=>ca(t+d["y"===e?"top":"left"],t,t-d["y"===e?"bottom":"right"]);o&&(f=g(p,f)),l&&(m=g(h,m));let b=s.fn({...t,[p]:f,[h]:m});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[p]:o,[h]:l}}}}}},cB=function(e){return void 0===e&&(e={}),{options:e,fn(t){var r,n,a,i;let{x:o,y:l,placement:s,rects:c,middlewareData:u}=t,{offset:d=0,mainAxis:h=!0,crossAxis:p=!0}=ci(e,t),f={x:o,y:l},m=cu(s),g=cs(m),b=f[g],v=f[m],y=ci(d,t),w="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:null!=(r=y.mainAxis)?r:0,crossAxis:null!=(n=y.crossAxis)?n:0};if(h){let e="y"===g?"height":"width",t=c.reference[g]-c.floating[e]+w.mainAxis,r=c.reference[g]+c.reference[e]-w.mainAxis;b<t?b=t:b>r&&(b=r)}if(p){let e="y"===g?"width":"height",t=c$.has(co(s)),r=c.reference[m]-c.floating[e]+(t&&(null==(a=u.offset)?void 0:a[m])||0)+(t?0:w.crossAxis),n=c.reference[m]+c.reference[e]+(t?0:(null==(i=u.offset)?void 0:i[m])||0)-(t?w.crossAxis:0);v<r?v=r:v>n&&(v=n)}return{[g]:b,[m]:v}}}},cW=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){let r,n,{placement:a,rects:i,platform:o,elements:l}=t,{apply:s=()=>{},...c}=ci(e,t),u=await o.detectOverflow(t,c),d=co(a),h=cl(a),p="y"===cu(a),{width:f,height:m}=i.floating;"top"===d||"bottom"===d?(r=d,n=h===(await (null==o.isRTL?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(n=d,r="end"===h?"top":"bottom");let g=m-u.top-u.bottom,b=f-u.left-u.right,v=s8(m-u[r],g),y=s8(f-u[n],b),w=t.middlewareData.shift,x=!w,k=v,S=y;null!=w&&w.enabled.x&&(S=b),null!=w&&w.enabled.y&&(k=g),x&&!h&&(p?S=f-2*s9(u.left,u.right):k=m-2*s9(u.top,u.bottom)),await s({...t,availableWidth:S,availableHeight:k});let M=await o.getDimensions(l.floating);return f!==M.width||m!==M.height?{reset:{rects:!0}}:{}}}};function cG(){return"u">typeof window}function cY(e){return cK(e)?(e.nodeName||"").toLowerCase():"#document"}function cU(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function cX(e){var t;return null==(t=(cK(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function cK(e){return!!cG()&&(e instanceof Node||e instanceof cU(e).Node)}function cV(e){return!!cG()&&(e instanceof Element||e instanceof cU(e).Element)}function cQ(e){return!!cG()&&(e instanceof HTMLElement||e instanceof cU(e).HTMLElement)}function cZ(e){return!(!cG()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof cU(e).ShadowRoot)}function cJ(e){let{overflow:t,overflowX:r,overflowY:n,display:a}=c7(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&"inline"!==a&&"contents"!==a}function c0(e){return/^(table|td|th)$/.test(cY(e))}function c1(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let c2=/transform|translate|scale|rotate|perspective|filter/,c5=/paint|layout|strict|content/,c4=e=>!!e&&"none"!==e;function c3(e){let t=cV(e)?c7(e):e;return c4(t.transform)||c4(t.translate)||c4(t.scale)||c4(t.rotate)||c4(t.perspective)||!c8()&&(c4(t.backdropFilter)||c4(t.filter))||c2.test(t.willChange||"")||c5.test(t.contain||"")}function c6(e){let t=ut(e);for(;cQ(t)&&!c9(t);){if(c3(t))return t;if(c1(t))break;t=ut(t)}return null}function c8(){return null==e&&(e="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),e}function c9(e){return/^(html|body|#document)$/.test(cY(e))}function c7(e){return cU(e).getComputedStyle(e)}function ue(e){return cV(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ut(e){if("html"===cY(e))return e;let t=e.assignedSlot||e.parentNode||cZ(e)&&e.host||cX(e);return cZ(t)?t.host:t}function ur(e){let t=ut(e);return c9(t)?(e.ownerDocument||e).body:cQ(t)&&cJ(t)?t:ur(t)}function un(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let a=ur(e),i=a===(null==(n=e.ownerDocument)?void 0:n.body),o=cU(a);if(!i)return t.concat(a,un(a,[],r));{let e=ua(o);return t.concat(o,o.visualViewport||[],cJ(a)?a:[],e&&r?un(e):[])}}function ua(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ui(e){let t=c7(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,a=cQ(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:n,l=s7(r)!==i||s7(n)!==o;return l&&(r=i,n=o),{width:r,height:n,$:l}}function uo(e){return cV(e)?e:e.contextElement}function ul(e){let t=uo(e);if(!cQ(t))return ct(1);let r=t.getBoundingClientRect(),{width:n,height:a,$:i}=ui(t),o=(i?s7(r.width):r.width)/n,l=(i?s7(r.height):r.height)/a;return o&&Number.isFinite(o)||(o=1),l&&Number.isFinite(l)||(l=1),{x:o,y:l}}let us=/*#__PURE__*/ct(0);function uc(e){let t=cU(e);return c8()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:us}function uu(e,t,r){return void 0===t&&(t=!1),!!r&&t&&r===cU(e)}function ud(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);let a=e.getBoundingClientRect(),i=uo(e),o=ct(1);t&&(n?cV(n)&&(o=ul(n)):o=ul(e));let l=uu(i,r,n)?uc(i):ct(0),s=(a.left+l.x)/o.x,c=(a.top+l.y)/o.y,u=a.width/o.x,d=a.height/o.y;if(i&&n){let e=cU(i),t=cV(n)?cU(n):n,r=e,a=ua(r);for(;a&&t!==r;){let e=ul(a),t=a.getBoundingClientRect(),n=c7(a),i=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,o=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,d*=e.y,s+=i,c+=o,a=ua(r=cU(a))}}return cM({width:u,height:d,x:s,y:c})}function uh(e,t){let r=ue(e).scrollLeft;return t?t.left+r:ud(cX(e)).left+r}function up(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-uh(e,r),y:r.top+t.scrollTop}}function uf(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e,i="fixed"===a,o=cX(n),l=!!t&&c1(t.floating);if(n===o||l&&i)return r;let s={scrollLeft:0,scrollTop:0},c=ct(1),u=ct(0),d=cQ(n);if((d||!i)&&(("body"!==cY(n)||cJ(o))&&(s=ue(n)),d)){let e=ud(n);c=ul(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}let h=!o||d||i?ct(0):up(o,s);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-s.scrollLeft*c.x+u.x+h.x,y:r.y*c.y-s.scrollTop*c.y+u.y+h.y}}function um(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ug(e){let t=ue(e),r=e.ownerDocument.body,n=s9(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=s9(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),i=-t.scrollLeft+uh(e),o=-t.scrollTop;return"rtl"===c7(r).direction&&(i+=s9(e.clientWidth,r.clientWidth)-n),{width:n,height:a,x:i,y:o}}let ub=25;function uv(e,t,r){void 0===r&&(r="viewport");let n="layoutViewport"===r,a=cU(e),i=cX(e),o=a.visualViewport,l=i.clientWidth,s=i.clientHeight,c=0,u=0;if(o){let e=!c8()||"fixed"===t;n?e||(c=-o.offsetLeft,u=-o.offsetTop):(l=o.width,s=o.height,e&&(c=o.offsetLeft,u=o.offsetTop))}if(0>=uh(i)){let e=i.ownerDocument,t=e.body,r=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,a=Math.abs(i.clientWidth-t.clientWidth-n),o="stable both-edges"===getComputedStyle(i).scrollbarGutter?a/2:a;o<=25&&(l-=o)}return{width:l,height:s,x:c,y:u}}function uy(e,t){let r=ud(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=ul(e),o=e.clientWidth*i.x,l=e.clientHeight*i.y;return{width:o,height:l,x:a*i.x,y:n*i.y}}function uw(e,t,r){let n;if("viewport"===t||"layoutViewport"===t)n=uv(e,r,t);else if("document"===t)n=ug(cX(e));else if(cV(t))n=uy(t,r);else{let r=uc(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return cM(n)}function ux(e,t){let r=t.get(e);if(r)return r;let n=un(e,[],!1).filter(e=>cV(e)&&"body"!==cY(e)),a=null,i="fixed"===c7(e).position,o=i?ut(e):e;for(;cV(o)&&!c9(o);){let e=c7(o),t=c3(o),r=a?a.position:i?"fixed":"";t||"fixed"!==r&&("absolute"!==r||"static"!==e.position)?a=e:n=n.filter(e=>e!==o),o=ut(o)}return t.set(e,n),n}function uk(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e,i=[..."clippingAncestors"===r?c1(t)?[]:ux(t,this._c):[].concat(r),n],o=uw(t,i[0],a),l=o.top,s=o.right,c=o.bottom,u=o.left;for(let e=1;e<i.length;e++){let r=uw(t,i[e],a);l=s9(r.top,l),s=s8(r.right,s),c=s8(r.bottom,c),u=s9(r.left,u)}return{width:s-u,height:c-l,x:u,y:l}}function uS(e){let{width:t,height:r}=ui(e);return{width:t,height:r}}function uM(e,t,r){let n=cQ(t),a=cX(t),i="fixed"===r,o=ud(e,!0,i,t),l={scrollLeft:0,scrollTop:0},s=ct(0);if((n||!i)&&(("body"!==cY(t)||cJ(a))&&(l=ue(t)),n)){let e=ud(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}!n&&a&&(s.x=uh(a));let c=!a||n||i?ct(0):up(a,l);return{x:o.left+l.scrollLeft-s.x-c.x,y:o.top+l.scrollTop-s.y-c.y,width:o.width,height:o.height}}function uC(e){return"static"===c7(e).position}function uF(e,t){if(!cQ(e)||"fixed"===c7(e).position)return null;if(t)return t(e);let r=e.offsetParent;return cX(e)===r&&(r=r.ownerDocument.body),r}function uD(e,t){let r=cU(e);if(c1(e))return r;if(!cQ(e)){let t=ut(e);for(;t&&!c9(t);){if(cV(t)&&!uC(t))return t;t=ut(t)}return r}let n=uF(e,t);for(;n&&c0(n)&&uC(n);)n=uF(n,t);return n&&c9(n)&&uC(n)&&!c3(n)?r:n||c6(e)||r}let uz=async function(e){let t=this.getOffsetParent||uD,r=this.getDimensions,n=await r(e.floating);return{reference:uM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function uN(e){return"rtl"===c7(e).direction}let uE={convertOffsetParentRelativeRectToViewportRelativeRect:uf,getDocumentElement:cX,getClippingRect:uk,getOffsetParent:uD,getElementRects:uz,getClientRects:um,getDimensions:uS,getScale:ul,isElement:cV,isRTL:uN};function uT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uR(e,t,r){let n,a=null,i=cX(e);function o(){var e;clearTimeout(n),null==(e=a)||e.disconnect(),a=null}function l(r,s){void 0===r&&(r=!1),void 0===s&&(s=1),o();let c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:p}=c;if(r||t(),!h||!p)return;let f={rootMargin:-ce(d)+"px "+-ce(i.clientWidth-(u+h))+"px "+-ce(i.clientHeight-(d+p))+"px "+-ce(u)+"px",threshold:s9(0,s8(1,s))||1},m=!0;function g(t){let r=t[0].intersectionRatio;if(!uT(c,e.getBoundingClientRect()))return l();if(r!==s){if(!m)return l();r?l(!1,r):n=setTimeout(()=>{l(!1,1e-7)},1e3)}m=!1}try{a=new IntersectionObserver(g,{...f,root:i.ownerDocument})}catch(e){a=new IntersectionObserver(g,f)}a.observe(e)}let s=cU(e),c=()=>l(r);return s.addEventListener("resize",c),l(!0),()=>{s.removeEventListener("resize",c),o()}}function uA(e,t,r,n){let a;void 0===n&&(n={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,u=uo(e),d=i||o?[...u?un(u):[],...t?un(t):[]]:[];d.forEach(e=>{i&&e.addEventListener("scroll",r),o&&e.addEventListener("resize",r)});let h=u&&s?uR(u,r,o):null,p=-1,f=null;l&&(f=new ResizeObserver(e=>{let[n]=e;n&&n.target===u&&f&&t&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),r()}),u&&!c&&f.observe(u),t&&f.observe(t));let m=c?ud(e):null;return c&&function t(){let n=ud(e);m&&!uT(m,n)&&r(),m=n,a=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{i&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==h||h(),null==(e=f)||e.disconnect(),f=null,c&&cancelAnimationFrame(a)}}let uI=null,uP=cj,uL=null,uO=cH,uq=cR,u$=cW,u_=cP,uj=cN,uH=null,uB=cB,uW=(e,t,r)=>{let n=new Map,a=null!=r?r:{},i={...uE,...a.platform,_c:n};return cz(e,t,{...a,platform:i})};var uG="u">typeof document,uY=function(){},uU=uG?$.useLayoutEffect:uY;function uX(e,t){let r,n,a;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!uX(e[n],t[n]))return!1;return!0}if((r=(a=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!=n--;){let r=a[n];if(("_owner"!==r||!e.$$typeof)&&!uX(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function uK(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function uV(e,t){let r=uK(e);return Math.round(t*r)/r}function uQ(e){let t=$.useRef(e);return uU(()=>{t.current=e}),t}function uZ(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:s,open:c}=e,[u,d]=$.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=$.useState(n);uX(h,n)||p(n);let[f,m]=$.useState(null),[g,b]=$.useState(null),v=$.useCallback(e=>{e!==k.current&&(k.current=e,m(e))},[]),y=$.useCallback(e=>{e!==S.current&&(S.current=e,b(e))},[]),w=i||f,x=o||g,k=$.useRef(null),S=$.useRef(null),M=$.useRef(u),C=null!=s,F=uQ(s),D=uQ(a),z=uQ(c),N=$.useCallback(()=>{if(!k.current||!S.current)return;let e={placement:t,strategy:r,middleware:h};D.current&&(e.platform=D.current),uW(k.current,S.current,e).then(e=>{let t={...e,isPositioned:!1!==z.current};E.current&&!uX(M.current,t)&&(M.current=t,_.flushSync(()=>{d(t)}))})},[h,t,r,D,z]);uU(()=>{!1===c&&M.current.isPositioned&&(M.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);let E=$.useRef(!1);uU(()=>(E.current=!0,()=>{E.current=!1}),[]),uU(()=>{if(w&&(k.current=w),x&&(S.current=x),w&&x){if(F.current)return F.current(w,x,N);N()}},[w,x,N,F,C]);let T=$.useMemo(()=>({reference:k,floating:S,setReference:v,setFloating:y}),[v,y]),R=$.useMemo(()=>({reference:w,floating:x}),[w,x]),A=$.useMemo(()=>{let e={position:r,left:0,top:0};if(!R.floating)return e;let t=uV(R.floating,u.x),n=uV(R.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...uK(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,R.floating,u.x,u.y]);return $.useMemo(()=>({...u,update:N,refs:T,elements:R,floatingStyles:A}),[u,N,T,R,A])}let uJ=e=>({name:"arrow",options:e,fn(t){let{element:r,padding:n}="function"==typeof e?e(t):e;return r&&({}).hasOwnProperty.call(r,"current")?null!=r.current?cN({element:r.current,padding:n}).fn(t):{}:r?cN({element:r,padding:n}).fn(t):{}}}),u0=(e,t)=>{let r=cj(e);return{name:r.name,fn:r.fn,options:[e,t]}},u1=(e,t)=>{let r=cH(e);return{name:r.name,fn:r.fn,options:[e,t]}},u2=(e,t)=>({fn:cB(e).fn,options:[e,t]}),u5=(e,t)=>{let r=cR(e);return{name:r.name,fn:r.fn,options:[e,t]}},u4=(e,t)=>{let r=cW(e);return{name:r.name,fn:r.fn,options:[e,t]}},u3=(e,t)=>{let r=autoPlacement$1(e);return{name:r.name,fn:r.fn,options:[e,t]}},u6=(e,t)=>{let r=cP(e);return{name:r.name,fn:r.fn,options:[e,t]}},u8=(e,t)=>{let r=inline$1(e);return{name:r.name,fn:r.fn,options:[e,t]}},u9=(e,t)=>{let r=uJ(e);return{name:r.name,fn:r.fn,options:[e,t]}};var u7=Object.defineProperty,de=(e,t)=>u7(e,"name",{value:t,configurable:!0}),dt=/* @__PURE__ */$.forwardRef(/* @__PURE__ */de(function(e,t){let{children:n,width:a=10,height:i=5,...o}=e;return /* @__PURE__ */r(l2.svg,{...o,ref:t,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:/* @__PURE__ */r("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),dr=dt,dn=Object.defineProperty,da=(e,t)=>dn(e,"name",{value:t,configurable:!0});function di(e){let[t,r]=$.useState(void 0);return lk(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,a;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,a=t.blockSize}else n=e.offsetWidth,a=e.offsetHeight;r({width:n,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}da(di,"useSize");var dl=Object.defineProperty,ds=(e,t)=>dl(e,"name",{value:t,configurable:!0}),dc=null,du=null,dd="Popper",[dh,dp]=ly(dd),[df,dm]=dh(dd),dg=/* @__PURE__ */ds(e=>{let{__scopePopper:t,children:n}=e,[a,i]=$.useState(null),[o,l]=$.useState(void 0);return /* @__PURE__ */r(df,{scope:t,anchor:a,onAnchorChange:i,placementState:o,setPlacementState:l,children:n})},"Popper"),db="PopperAnchor",dv=/* @__PURE__ */$.forwardRef(/* @__PURE__ */ds(function(e,t){let{__scopePopper:n,virtualRef:a,...i}=e,o=dm(db,n),l=$.useRef(null),s=o.onAnchorChange,c=lm(t,$.useCallback(e=>{l.current=e,e&&s(e)},[s])),u=$.useRef(null);$.useEffect(()=>{if(!a)return;let e=u.current;u.current=a.current,e!==u.current&&s(u.current)});let d=o.placementState&&dz(o.placementState),h=d?.[0],p=d?.[1];return a?null:/* @__PURE__ */r(l2.div,{"data-radix-popper-side":h,"data-radix-popper-align":p,...i,ref:c})},"PopperAnchor")),dy="PopperContent",[dw,dx]=dh(dy),dk=/* @__PURE__ */$.forwardRef(/* @__PURE__ */ds(function(e,t){let{__scopePopper:n,side:a="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:f="optimized",onPlaced:m,...g}=e,b=dm(dy,n),[v,y]=$.useState(null),w=lm(t,y),[x,k]=$.useState(null),S=di(x),M=S?.width??0,C=S?.height??0,F="number"==typeof d?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(u)?u:[u],z=D.length>0,N={padding:F,boundary:D.filter(dF),altBoundary:z},{refs:E,floatingStyles:T,placement:R,isPositioned:A,middlewareData:I}=uZ({strategy:"fixed",placement:a+("center"!==o?"-"+o:""),whileElementsMounted:/* @__PURE__ */ds((...e)=>uA(...e,{animationFrame:"always"===f}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[u0({mainAxis:i+C,alignmentAxis:l}),c&&u1({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?u2():void 0,...N}),c&&u5({...N}),u4({...N,apply:/* @__PURE__ */ds(({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{let{width:a,height:i}=t.reference,o=e.floating.style;o.setProperty("--radix-popper-available-width",`${r}px`),o.setProperty("--radix-popper-available-height",`${n}px`),o.setProperty("--radix-popper-anchor-width",`${a}px`),o.setProperty("--radix-popper-anchor-height",`${i}px`)},"apply")}),x&&u9({element:x,padding:s}),dD({arrowWidth:M,arrowHeight:C}),p&&u6({strategy:"referenceHidden",...N,boundary:z?N.boundary:void 0})]}),P=b.setPlacementState;lk(()=>(P(R),()=>{P(void 0)}),[R,P]);let[L,O]=dz(R),q=sg(m);lk(()=>{A&&q?.()},[A,q]);let _=I.arrow?.x,j=I.arrow?.y,H=I.arrow?.centerOffset!==0,[B,W]=$.useState();return lk(()=>{v&&W(window.getComputedStyle(v).zIndex)},[v]),/* @__PURE__ */r("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:A?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:/* @__PURE__ */r(dw,{scope:n,placedSide:L,placedAlign:O,onArrowChange:k,arrowX:_,arrowY:j,shouldHideArrow:H,children:/* @__PURE__ */r(l2.div,{"data-side":L,"data-align":O,...g,ref:w,style:{...g.style,animation:A?g.style?.animation:"none"}})})})},"PopperContent")),dS="PopperArrow",dM={top:"bottom",right:"left",bottom:"top",left:"right"},dC=/* @__PURE__ */$.forwardRef(/* @__PURE__ */ds(function(e,t){let{__scopePopper:n,...a}=e,i=dx(dS,n),o=dM[i.placedSide];return /* @__PURE__ */r("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:/* @__PURE__ */r(dr,{...a,ref:t,style:{...a.style,display:"block"}})})},"PopperArrow"));function dF(e){return null!==e}ds(dF,"isNotNull");var dD=/* @__PURE__ */ds(e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:n,middlewareData:a}=t,i=a.arrow?.centerOffset!==0,o=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[s,c]=dz(r),u={start:"0%",center:"50%",end:"100%"}[c],d=(a.arrow?.x??0)+o/2,h=(a.arrow?.y??0)+l/2,p="",f="";return"bottom"===s?(p=i?u:`${d}px`,f=`${-l}px`):"top"===s?(p=i?u:`${d}px`,f=`${n.floating.height+l}px`):"right"===s?(p=`${-l}px`,f=i?u:`${h}px`):"left"===s&&(p=`${n.floating.width+l}px`,f=i?u:`${h}px`),{data:{x:p,y:f}}}}),"transformOrigin");function dz(e){let[t,r="center"]=e.split("-");return[t,r]}ds(dz,"getSideAndAlignFromPlacement");var dN=dg,dE=dv,dT=dk,dR=dC,dA=Object.defineProperty,dI=(e,t)=>dA(e,"name",{value:t,configurable:!0}),dP=/* @__PURE__ */$.forwardRef(/* @__PURE__ */dI(function(e,t){let{container:n,...a}=e,[i,o]=$.useState(!1);lk(()=>o(!0),[]);let l=n||i&&globalThis?.document?.body;return l?_.createPortal(/* @__PURE__ */r(l2.div,{...a,ref:t}),l):null},"Portal")),dL=null,dO=Object.defineProperty,dq=(e,t)=>dO(e,"name",{value:t,configurable:!0});function d$(e,t){return $.useReducer((e,r)=>t[e][r]??e,e)}dq(d$,"useStateMachine");var d_=/* @__PURE__ */dq(e=>{let{present:t,children:r}=e,n=dj(t),a="function"==typeof r?r({present:n.isPresent}):$.Children.only(r),i=dB(n.ref,dG(a));return"function"==typeof r||n.isPresent?$.cloneElement(a,{ref:i}):null},"Presence");function dj(e){let[t,r]=$.useState(),n=$.useRef(null),a=$.useRef(e),i=$.useRef("none"),o=$.useRef(void 0),[l,s]=d$(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return $.useEffect(()=>{"mounted"===l?(i.current=o.current??dW(n.current),o.current=void 0):i.current="none"},[l]),lk(()=>{let t=n.current,r=a.current;if(r!==e){let n=i.current,l=dW(t);e?(o.current=l,s("MOUNT")):"none"===l||t?.display==="none"?s("UNMOUNT"):r&&n!==l?s("ANIMATION_OUT"):s("UNMOUNT"),a.current=e}},[e,s]),lk(()=>{if(t){let e,r=t.ownerDocument.defaultView??window,o=/* @__PURE__ */dq(i=>{let o=dW(n.current).includes(CSS.escape(i.animationName));if(i.target===t&&o&&(s("ANIMATION_END"),!a.current)){let n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},"handleAnimationEnd"),l=/* @__PURE__ */dq(e=>{e.target===t&&(i.current=dW(n.current))},"handleAnimationStart");return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",o),t.addEventListener("animationend",o),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",o),t.removeEventListener("animationend",o)}}s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:$.useCallback(e=>{if(e){let t=getComputedStyle(e);n.current=t,o.current=dW(t)}else n.current=null;r(e)},[])}}function dH(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function dB(...e){let t=$.useRef(e);return t.current=e,$.useCallback(e=>{let r=t.current,n=!1,a=r.map(t=>{let r=dH(t,e);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let e=0;e<a.length;e++){let t=a[e];"function"==typeof t?t():dH(r[e],null)}}},[])}function dW(e){return e?.animationName||"none"}function dG(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}dq(dj,"usePresence"),dq(dH,"setRef"),dq(dB,"useStableComposedRefs"),dq(dW,"getAnimationName"),dq(dG,"getElementRef");var dY=null,dU=Object.defineProperty,dX=(e,t)=>dU(e,"name",{value:t,configurable:!0}),dK=$[" useId ".trim().toString()]||(()=>void 0),dV=0;function dQ(e){let[t,r]=$.useState(dK());return lk(()=>{e||r(e=>e??String(dV++))},[e]),e||(t?`radix-${t}`:"")}dX(dQ,"useId");var dZ=Object.defineProperty,dJ=(e,t)=>dZ(e,"name",{value:t,configurable:!0}),d0=!1;function d1(){let[e,t]=$.useState(d0);return $.useEffect(()=>{d0||(d0=!0,t(!0))},[]),e}dJ(d1,"useIsHydrated");var d2=$[" useSyncExternalStore ".trim().toString()];function d5(){return()=>{}}function d4(){return d2(d5,()=>!0,()=>!1)}dJ(d5,"subscribe"),dJ(d4,"useIsHydratedModern");var d3="function"==typeof d2?d4:d1,d6=Object.defineProperty,d8=(e,t)=>d6(e,"name",{value:t,configurable:!0}),d9="rovingFocusGroup.onEntryFocus",d7={bubbles:!1,cancelable:!0},he="RovingFocusGroup",[ht,hr,hn]=l8(he),[ha,hi]=ly(he,[hn]),[ho,hl]=ha(he),hs=/* @__PURE__ */$.forwardRef(/* @__PURE__ */d8(function(e,t){return /* @__PURE__ */r(ht.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */r(ht.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */r(hc,{...e,ref:t})})})},"RovingFocusGroup")),hc=/* @__PURE__ */$.forwardRef(/* @__PURE__ */d8(function(e,t){let{__scopeRovingFocusGroup:n,orientation:a,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,p=$.useRef(null),f=lm(t,p),m=sh(o),[g,b]=lT({prop:l,defaultProp:s??null,onChange:c,caller:he}),[v,y]=$.useState(!1),w=sg(u),x=hr(n),k=$.useRef(!1),[S,M]=$.useState(0);return $.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(d9,w),()=>e.removeEventListener(d9,w)},[w]),/* @__PURE__ */r(ho,{scope:n,orientation:a,dir:m,loop:i,currentTabStopId:g,onItemFocus:$.useCallback(e=>b(e),[b]),onItemShiftTab:$.useCallback(()=>y(!0),[]),onFocusableItemAdd:$.useCallback(()=>M(e=>e+1),[]),onFocusableItemRemove:$.useCallback(()=>M(e=>e-1),[]),children:/* @__PURE__ */r(l2.div,{tabIndex:v||0===S?-1:0,"data-orientation":a,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:lo(e.onMouseDown,()=>{k.current=!0}),onFocus:lo(e.onFocus,e=>{let t=!k.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(d9,d7);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);hm([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),d)}}k.current=!1}),onBlur:lo(e.onBlur,()=>y(!1))})})},"RovingFocusGroupImpl")),hu="RovingFocusGroupItem",hd=/* @__PURE__ */$.forwardRef(/* @__PURE__ */d8(function(e,t){let{__scopeRovingFocusGroup:n,focusable:a=!0,active:i=!1,tabStopId:o,children:l,...s}=e,c=dQ(),u=o||c,d=hl(hu,n),h=d.currentTabStopId===u,p=hr(n),{onFocusableItemAdd:f,onFocusableItemRemove:m,currentTabStopId:g}=d,b=d3();return lk(()=>{if(b&&a)return f(),()=>m()},[b,a,f,m]),$.useEffect(()=>{if(!b&&a)return f(),()=>m()},[b,a,f,m]),/* @__PURE__ */r(ht.ItemSlot,{scope:n,id:u,focusable:a,active:i,children:/* @__PURE__ */r(l2.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:lo(e.onMouseDown,e=>{a?d.onItemFocus(u):e.preventDefault()}),onFocus:lo(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:lo(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=hf(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=p().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=d.loop?hg(r,n+1):r.slice(n+1)}setTimeout(()=>hm(r))}}),children:"function"==typeof l?l({isCurrentTabStop:h,hasTabStop:null!=g}):l})})},"RovingFocusGroupItem")),hh={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hp(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function hf(e,t,r){let n=hp(e.key,r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return hh[n]}function hm(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function hg(e,t){return e.map((r,n)=>e[(t+n)%e.length])}d8(hp,"getDirectionAwareKey"),d8(hf,"getFocusIntent"),d8(hm,"focusFirst"),d8(hg,"wrapArray");var hb=hs,hv=hd,hy=function(e){return"u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},hw=new WeakMap,hx=new WeakMap,hk={},hS=0,hM=function(e){return e&&(e.host||hM(e.parentNode))},hC=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=hM(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return!!e})},hF=function(e,t,r,n){var a=hC(t,Array.isArray(e)?e:[e]);hk[r]||(hk[r]=new WeakMap);var i=hk[r],o=[],l=new Set,s=new Set(a),c=function(e){!e||l.has(e)||(l.add(e),c(e.parentNode))};a.forEach(c);var u=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(l.has(e))u(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,s=(hw.get(e)||0)+1,c=(i.get(e)||0)+1;hw.set(e,s),i.set(e,c),o.push(e),1===s&&a&&hx.set(e,!0),1===c&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),l.clear(),hS++,function(){o.forEach(function(e){var t=hw.get(e)-1,a=i.get(e)-1;hw.set(e,t),i.set(e,a),t||(hx.has(e)||e.removeAttribute(n),hx.delete(e)),a||e.removeAttribute(r)}),--hS||(hw=new WeakMap,hw=new WeakMap,hx=new WeakMap,hk={})}},hD=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=t||hy(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),hF(n,a,r,"aria-hidden")):function(){return null}},hz=function(e,t,r){void 0===r&&(r="data-inert-ed");var n=t||hy(e);return n?hF(e,n,r,"inert"):function(){return null}},hN=function(){return"u">typeof HTMLElement&&HTMLElement.prototype.hasOwnProperty("inert")},hE=function(e,t,r){return void 0===r&&(r="data-suppressed"),(hN()?hz:hD)(e,t,r)},hT=function(e,t){return(hT=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function hR(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}hT(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var hA=function(){return(hA=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function hI(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>t.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function hP(e,t,r,n){var a,i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function hL(e,t){return function(r,n){t(r,n,e)}}function hO(e,t,r,n,a,i){function o(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var l,s=n.kind,c="getter"===s?"get":"setter"===s?"set":"value",u=!t&&e?n.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),h=!1,p=r.length-1;p>=0;p--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(h)throw TypeError("Cannot add initializers after decoration has completed");i.push(o(e||null))};var g=(0,r[p])("accessor"===s?{get:d.get,set:d.set}:d[c],f);if("accessor"===s){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw TypeError("Object expected");(l=o(g.get))&&(d.get=l),(l=o(g.set))&&(d.set=l),(l=o(g.init))&&a.unshift(l)}else(l=o(g))&&("field"===s?a.unshift(l):d[c]=l)}u&&Object.defineProperty(u,n.name,d),h=!0}function hq(e,t,r){for(var n=arguments.length>2,a=0;a<t.length;a++)r=n?t[a].call(e,r):t[a].call(e);return n?r:void 0}function h$(e){return"symbol"==typeof e?e:"".concat(e)}function h_(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function hj(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function hH(e,t,r,n){return new(r||(r=Promise))(function(r,a){step((n=n.apply(e,t||[])).next())})}function hB(e,t){var r,n,a,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(s){var c=[l,s];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){i.label=c[1];break}if(6===c[0]&&i.label<a[1]){i.label=a[1],a=c;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(c);break}a[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var hW=Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function hG(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||hW(t,e,r)}function hY(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function hU(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o}function hX(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(hU(arguments[t]));return e}function hK(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),a=0,t=0;t<r;t++)for(var i=arguments[t],o=0,l=i.length;o<l;o++,a++)n[a]=i[o];return n}function hV(e,t,r){if(r||2==arguments.length)for(var n,a=0,i=t.length;a<i;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}function hQ(e){return this instanceof hQ?(this.v=e,this):new hQ(e)}function hZ(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,a=r.apply(e,t||[]),i=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),n[Symbol.asyncIterator]=function(){return this},n;function o(e,t){a[e]&&(n[e]=function(t){return new Promise(function(r,n){i.push([e,t,r,n])>1||l(e,t)})},t&&(n[e]=t(n[e])))}function l(e,t){try{var r;(r=a[e](t)).value instanceof hQ?Promise.resolve(r.value.v).then(s,c):u(i[0][2],r)}catch(e){u(i[0][3],e)}}function s(e){l("next",e)}function c(e){l("throw",e)}function u(e,t){e(t),i.shift(),i.length&&l(i[0][0],i[0][1])}}function hJ(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,a){t[n]=e[n]?function(t){return(r=!r)?{value:hQ(e[n](t)),done:!1}:a?a(t):t}:a}}function h0(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=hY(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,a){var i,o,l;i=n,o=a,l=(t=e[r](t)).done,Promise.resolve(t.value).then(function(e){i({value:e,done:l})},o)})}}}function h1(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var h2=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},h5=function(e){return(h5=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)};function h4(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=h5(e),n=0;n<r.length;n++)"default"!==r[n]&&hW(t,e,r[n]);return h2(t,e),t}function h3(e){return e&&e.__esModule?e:{default:e}}function h6(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function h8(e,t,r,n,a){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!a)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(e,r):a?a.value=r:t.set(e,r),r}function h9(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function h7(e,t,r){if(null!=t){var n,a;if("object"!=typeof t&&"function"!=typeof t)throw TypeError("Object expected.");if(r){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(a=n)}if("function"!=typeof n)throw TypeError("Object not disposable.");a&&(n=function(){try{a.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var pe=null;function pt(e){function t(t){e.error=e.hasError?new pe(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function a(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(a);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(a,function(e){return t(e),a()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function pr(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,r,n,a,i){return r?t?".jsx":".js":!n||a&&i?n+a+"."+i.toLowerCase()+"js":e}):e}let pn=null;var pa="right-scroll-bar-position",pi="width-before-scroll-bar",po="with-scroll-bars-hidden",pl="--removed-body-scroll-bar-size";function ps(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}function pc(e,t){var r=b(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}})[0];return r.callback=t,r.facade}var pu="u">typeof window?$.useLayoutEffect:$.useEffect,pd=new WeakMap;function ph(e,t){var r=pc(t||null,function(t){return e.forEach(function(e){return ps(e,t)})});return pu(function(){var t=pd.get(r);if(t){var n=new Set(t),a=new Set(e),i=r.current;n.forEach(function(e){a.has(e)||ps(e,null)}),a.forEach(function(e){n.has(e)||ps(e,i)})}pd.set(r,e)},[e]),r}function pp(e){return e}function pf(e,t){void 0===t&&(t=pp);var r=[],n=!1;return{read:function(){if(n)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var a=t(e,n);return r.push(a),function(){r=r.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var a=r;r=[],a.forEach(e),t=r}var i=function(){var r=t;t=[],r.forEach(e)},o=function(){return Promise.resolve().then(i)};o(),r={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),r}}}}}function pm(e,t){return void 0===t&&(t=pp),pf(e,t)}function pg(e){void 0===e&&(e={});var t=pf(null);return t.options=hA({async:!0,ssr:!1},e),t}var pb=pg(),pv=function(){},py=$.forwardRef(function(e,t){var r=$.useRef(null),n=$.useState({onScrollCapture:pv,onWheelCapture:pv,onTouchMoveCapture:pv}),a=n[0],i=n[1],o=e.forwardProps,l=e.children,s=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,p=e.noRelative,f=e.noIsolation,m=e.inert,g=e.allowPinchZoom,b=e.as,v=e.gapMode,y=hI(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=ph([r,t]),x=hA(hA({},y),a);return $.createElement($.Fragment,null,u&&$.createElement(h,{sideCar:pb,removeScrollBar:c,shards:d,noRelative:p,noIsolation:f,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:v}),o?$.cloneElement($.Children.only(l),hA(hA({},x),{ref:w})):$.createElement(void 0===b?"div":b,hA({},x,{className:s,ref:w}),l))});py.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},py.classNames={fullWidth:pi,zeroRight:pa};var pw=function(e){var t=e.sideCar,r=hI(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return $.createElement(n,hA({},r))};function px(e,t){return e.useMedium(t),pw}pw.isSideCarExport=!0;var pk=function(e){H=e},pS=function(){return H||G.nc};function pM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pS();return t&&e.setAttribute("nonce",t),e}function pC(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pF(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}var pD=function(){var e=0,t=null;return{add:function(r){0==e&&(t=pM())&&(pC(t,r),pF(t)),e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pz=function(){var e=pD();return function(t,r){$.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},pN=function(){var e=pz();return function(t){return e(t.styles,t.dynamic),null}},pE={left:0,top:0,right:0,gap:0},pT=function(e){return parseInt(e||"",10)||0},pR=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[pT(r),pT(n),pT(a)]},pA=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return pE;var t=pR(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},pI=pN(),pP="data-scroll-locked",pL=function(e,t,r,n){var a=e.left,i=e.top,o=e.right,l=e.gap;return void 0===r&&(r="margin"),"\n .".concat(po," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(l,"px ").concat(n,";\n }\n body[").concat(pP,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(o,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(pa," {\n right: ").concat(l,"px ").concat(n,";\n }\n \n .").concat(pi," {\n margin-right: ").concat(l,"px ").concat(n,";\n }\n \n .").concat(pa," .").concat(pa," {\n right: 0 ").concat(n,";\n }\n \n .").concat(pi," .").concat(pi," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(pP,"] {\n ").concat(pl,": ").concat(l,"px;\n }\n")},pO=function(){var e=parseInt(document.body.getAttribute(pP)||"0",10);return isFinite(e)?e:0},pq=function(){$.useEffect(function(){return document.body.setAttribute(pP,(pO()+1).toString()),function(){var e=pO()-1;e<=0?document.body.removeAttribute(pP):document.body.setAttribute(pP,e.toString())}},[])},p$=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=void 0===n?"margin":n;pq();var i=$.useMemo(function(){return pA(a)},[a]);return $.createElement(pI,{styles:pL(i,!t,a,r?"":"!important")})},p_=!1;if("u">typeof window)try{var pj=Object.defineProperty({},"passive",{get:function(){return p_=!0,!0}});window.addEventListener("test",pj,pj),window.removeEventListener("test",pj,pj)}catch(e){p_=!1}var pH=!!p_&&{passive:!1},pB=function(e){return"TEXTAREA"===e.tagName},pW=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!pB(e)&&"visible"===r[t])},pG=function(e){return pW(e,"overflowY")},pY=function(e){return pW(e,"overflowX")},pU=function(e,t){var r=t.ownerDocument,n=t;do{if("u">typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),pV(e,n)){var a=pQ(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body)return!1},pX=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},pK=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},pV=function(e,t){return"v"===e?pG(t):pY(t)},pQ=function(e,t){return"v"===e?pX(t):pK(t)},pZ=function(e,t){return"h"===e&&"rtl"===t?-1:1},pJ=function(e,t,r,n,a){var i=pZ(e,window.getComputedStyle(t).direction),o=i*n,l=r.target,s=t.contains(l),c=!1,u=o>0,d=0,h=0;do{if(!l)break;var p=pQ(e,l),f=p[0],m=p[1]-p[2]-i*f;(f||m)&&pV(e,l)&&(d+=m,h+=f);var g=l.parentNode;l=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!s&&l!==document.body||s&&(t.contains(l)||t===l))return u&&(a&&1>Math.abs(d)||!a&&o>d)?c=!0:!u&&(a&&1>Math.abs(h)||!a&&-o>h)&&(c=!0),c},p0=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},p1=function(e){return[e.deltaX,e.deltaY]},p2=function(e){return e&&"current"in e?e.current:e},p5=function(e,t){return e[0]===t[0]&&e[1]===t[1]},p4=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},p3=0,p6=[];function p8(e){var t=$.useRef([]),r=$.useRef([0,0]),n=$.useRef(),a=$.useState(p3++)[0],i=$.useState(pN)[0],o=$.useRef(e);$.useEffect(function(){o.current=e},[e]),$.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=hV([e.lockRef.current],(e.shards||[]).map(p2),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=$.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var a,i=p0(e),l=r.current,s="deltaX"in e?e.deltaX:l[0]-i[0],c="deltaY"in e?e.deltaY:l[1]-i[1],u=e.target,d=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var h=window.getSelection(),p=h&&h.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var f=pU(d,u);if(!f)return!0;if(f?a=d:(a="v"===d?"h":"v",f=pU(d,u)),!f)return!1;if(!n.current&&"changedTouches"in e&&(s||c)&&(n.current=a),!a)return!0;var m=n.current||a;return pJ(m,t,e,"h"===m?s:c,!0)},[]),s=$.useCallback(function(e){if(p6.length&&p6[p6.length-1]===i){var r="deltaY"in e?p1(e):p0(e),n=t.current.filter(function(t){return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&p5(t.delta,r)})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var a=(o.current.shards||[]).map(p2).filter(Boolean).filter(function(t){return t.contains(e.target)});(a.length>0?l(e,a[0]):!o.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=$.useCallback(function(e,r,n,a){var i={name:e,delta:r,target:n,should:a,shadowParent:p9(n)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),u=$.useCallback(function(e){r.current=p0(e),n.current=void 0},[]),d=$.useCallback(function(t){c(t.type,p1(t),t.target,l(t,e.lockRef.current))},[]),h=$.useCallback(function(t){c(t.type,p0(t),t.target,l(t,e.lockRef.current))},[]);$.useEffect(function(){return p6.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",s,pH),document.addEventListener("touchmove",s,pH),document.addEventListener("touchstart",u,pH),function(){p6=p6.filter(function(e){return e!==i}),document.removeEventListener("wheel",s,pH),document.removeEventListener("touchmove",s,pH),document.removeEventListener("touchstart",u,pH)}},[]);var p=e.removeScrollBar,f=e.inert;return $.createElement($.Fragment,null,f?$.createElement(i,{styles:p4(a)}):null,p?$.createElement(p$,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function p9(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}let p7=px(pb,p8);var fe=$.forwardRef(function(e,t){return $.createElement(py,hA({},e,{ref:t,sideCar:p7}))});fe.classNames=py.classNames;let ft=fe;var fr=Object.defineProperty,fn=(e,t)=>fr(e,"name",{value:t,configurable:!0}),fa=["Enter"," "],fi=["ArrowDown","PageUp","Home"],fo=["ArrowUp","PageDown","End"],fl=[...fi,...fo],fs={ltr:[...fa,"ArrowRight"],rtl:[...fa,"ArrowLeft"]},fc=null,fu="Menu",[fd,fh,fp]=l8(fu),[ff,fm]=ly(fu,[fp,dp,hi]),fg=dp(),fb=hi(),[fv,fy]=ff(fu),[fw,fx]=ff(fu),fk=/* @__PURE__ */fn(e=>{let{__scopeMenu:t,open:n=!1,children:a,dir:i,onOpenChange:o,modal:l=!0}=e,s=fg(t),[c,u]=$.useState(null),d=$.useRef(!1),h=sg(o),p=sh(i);return $.useEffect(()=>{let e=/* @__PURE__ */fn(()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},"handleKeyDown"),t=/* @__PURE__ */fn(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),$.useEffect(()=>{if(!n)return;let e=/* @__PURE__ */fn(()=>h(!1),"handleBlur");return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[n,h]),/* @__PURE__ */r(dN,{...s,children:/* @__PURE__ */r(fv,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:u,children:/* @__PURE__ */r(fw,{scope:t,onClose:$.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:p,modal:l,children:a})})})},"Menu"),fS=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let{__scopeMenu:n,...a}=e;return /* @__PURE__ */r(dE,{...fg(n),...a,ref:t})},"MenuAnchor")),fM="MenuPortal",[fC,fF]=ff(fM,{forceMount:void 0}),fD=/* @__PURE__ */fn(e=>{let{__scopeMenu:t,forceMount:n,children:a,container:i}=e,o=fy(fM,t);return /* @__PURE__ */r(fC,{scope:t,forceMount:n,children:/* @__PURE__ */r(d_,{present:n||o.open,children:/* @__PURE__ */r(dP,{asChild:!0,container:i,children:a})})})},"MenuPortal"),fz="MenuContent",[fN,fE]=ff(fz),fT=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let n=fF(fz,e.__scopeMenu),{forceMount:a=n.forceMount,...i}=e,o=fy(fz,e.__scopeMenu),l=fx(fz,e.__scopeMenu);return /* @__PURE__ */r(fd.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */r(d_,{present:a||o.open,children:/* @__PURE__ */r(fd.Slot,{scope:e.__scopeMenu,children:l.modal?/* @__PURE__ */r(fR,{...i,ref:t}):/* @__PURE__ */r(fA,{...i,ref:t})})})})},"MenuContent")),fR=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let n=fy(fz,e.__scopeMenu),a=$.useRef(null),i=lm(t,a);return $.useEffect(()=>{let e=a.current;if(e)return hD(e)},[]),/* @__PURE__ */r(fP,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:lo(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentModal")),fA=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let n=fy(fz,e.__scopeMenu);return /* @__PURE__ */r(fP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentNonModal")),fI=lq("MenuContent.ScrollLock"),fP=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let{__scopeMenu:n,loop:a=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,onDismiss:f,disableOutsideScroll:m,...g}=e,b=fy(fz,n),v=fx(fz,n),y=fg(n),w=fb(n),x=fh(n),[k,S]=$.useState(null),M=$.useRef(null),C=lm(t,M,b.onContentChange),F=$.useRef(0),D=$.useRef(""),z=$.useRef(0),N=$.useRef(null),E=$.useRef("right"),T=$.useRef(0),R=m?fe:$.Fragment,A=/* @__PURE__ */fn(e=>{let t=D.current+e,r=x().filter(e=>!e.disabled),n=document.activeElement,a=r.find(e=>e.ref.current===n)?.textValue,i=ma(r.map(e=>e.textValue),t,a),o=r.find(e=>e.textValue===i)?.ref.current;(/* @__PURE__ */fn(function e(t){D.current=t,window.clearTimeout(F.current),""!==t&&(F.current=window.setTimeout(()=>e(""),1e3))},"updateSearch"))(t),o&&setTimeout(()=>o.focus())},"handleTypeaheadSearch");$.useEffect(()=>()=>window.clearTimeout(F.current),[]),sq();let I=$.useCallback(e=>E.current===N.current?.side&&mo(e,N.current?.area),[]);return /* @__PURE__ */r(fN,{scope:n,searchRef:D,onItemEnter:$.useCallback(e=>{I(e)&&e.preventDefault()},[I]),onItemLeave:$.useCallback(e=>{I(e)||(M.current?.focus(),S(null))},[I]),onTriggerLeave:$.useCallback(e=>{I(e)&&e.preventDefault()},[I]),pointerGraceTimerRef:z,onPointerGraceIntentChange:$.useCallback(e=>{N.current=e},[]),children:/* @__PURE__ */r(R,{...m?{as:fI,allowPinchZoom:!0}:void 0,children:/* @__PURE__ */r(sG,{asChild:!0,trapped:i,onMountAutoFocus:lo(o,e=>{e.preventDefault(),M.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:/* @__PURE__ */r(sS,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,onDismiss:f,children:/* @__PURE__ */r(hb,{asChild:!0,...w,dir:v.dir,orientation:"vertical",loop:a,currentTabStopId:k,onCurrentTabStopIdChange:S,onEntryFocus:lo(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:/* @__PURE__ */r(dT,{role:"menu","aria-orientation":"vertical","data-state":f7(b.open),"data-radix-menu-content":"",dir:v.dir,...y,...g,ref:C,style:{outline:"none",...g.style},onKeyDown:lo(g.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&A(e.key));let a=M.current;if(e.target!==a||!fl.includes(e.key))return;e.preventDefault();let i=x().filter(e=>!e.disabled).map(e=>e.ref.current);fo.includes(e.key)&&i.reverse(),mr(i)}),onBlur:lo(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(F.current),D.current="")}),onPointerMove:lo(e.onPointerMove,ml(e=>{let t=e.target,r=T.current!==e.clientX;e.currentTarget.contains(t)&&r&&(E.current=e.clientX>T.current?"right":"left",T.current=e.clientX)}))})})})})})})},"MenuContentImpl")),fL=/* @__PURE__ */null,fO=/* @__PURE__ */null,fq="MenuItem",f$="menu.itemSelect",f_=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let{disabled:n=!1,onSelect:a,...i}=e,o=$.useRef(null),l=fx(fq,e.__scopeMenu),s=fE(fq,e.__scopeMenu),c=lm(t,o),u=$.useRef(!1),d=/* @__PURE__ */fn(()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(f$,{bubbles:!0,cancelable:!0});e.addEventListener(f$,e=>a?.(e),{once:!0}),l5(e,t),t.defaultPrevented?u.current=!1:l.onClose()}},"handleSelect");return /* @__PURE__ */r(fj,{...i,ref:c,disabled:n,onClick:lo(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:lo(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:lo(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(""===s.searchRef.current||" "!==e.key)&&fa.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},"MenuItem")),fj=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let{__scopeMenu:n,disabled:a=!1,textValue:i,...o}=e,l=fE(fq,n),s=fb(n),c=$.useRef(null),u=lm(t,c),[d,h]=$.useState(!1),[p,f]=$.useState("");return $.useEffect(()=>{let e=c.current;e&&f((e.textContent??"").trim())},[o.children]),/* @__PURE__ */r(fd.ItemSlot,{scope:n,disabled:a,textValue:i??p,children:/* @__PURE__ */r(hv,{asChild:!0,...s,focusable:!a,children:/* @__PURE__ */r(l2.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...o,ref:u,onPointerMove:lo(e.onPointerMove,ml(e=>{a?l.onItemLeave(e):(l.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:lo(e.onPointerLeave,ml(e=>l.onItemLeave(e))),onFocus:lo(e.onFocus,()=>h(!0)),onBlur:lo(e.onBlur,()=>h(!1))})})})},"MenuItemImpl")),fH=/* @__PURE__ */null,fB="MenuRadioGroup",[fW,fG]=ff(fB,{value:void 0,onValueChange:/* @__PURE__ */fn(()=>{},"onValueChange")}),fY=/* @__PURE__ */null,fU="MenuRadioItem",fX=/* @__PURE__ */null,fK="MenuItemIndicator",[fV,fQ]=ff(fK,{checked:!1}),fZ=/* @__PURE__ */null,fJ=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let{__scopeMenu:n,...a}=e;return /* @__PURE__ */r(l2.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})},"MenuSeparator")),f0=/* @__PURE__ */null,f1="MenuSub",[f2,f5]=ff(f1),f4=/* @__PURE__ */null,f3="MenuSubTrigger",f6=/* @__PURE__ */null,f8="MenuSubContent",f9=/* @__PURE__ */null;function f7(e){return e?"open":"closed"}function me(e){return"indeterminate"===e}function mt(e){return me(e)?"indeterminate":e?"checked":"unchecked"}function mr(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function mn(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function ma(e,t,r){let n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1,i=mn(e,Math.max(a,0));1===n.length&&(i=i.filter(e=>e!==r));let o=i.find(e=>e.toLowerCase().startsWith(n.toLowerCase()));return o!==r?o:void 0}function mi(e,t){let{x:r,y:n}=e,a=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){let o=t[e],l=t[i],s=o.x,c=o.y,u=l.x,d=l.y;c>n!=d>n&&r<(u-s)*(n-c)/(d-c)+s&&(a=!a)}return a}function mo(e,t){return!!t&&mi({x:e.clientX,y:e.clientY},t)}function ml(e){return t=>"mouse"===t.pointerType?e(t):void 0}fn(f7,"getOpenState"),fn(me,"isIndeterminate"),fn(mt,"getCheckedState"),fn(mr,"focusFirst"),fn(mn,"wrapArray"),fn(ma,"getNextMatch"),fn(mi,"isPointInPolygon"),fn(mo,"isPointerInGraceArea"),fn(ml,"whenMouse");var ms=fk,mc=fS,mu=fD,md=fT,mh=null,mp=null,mf=f_,mm=null,mg=null,mb=null,mv=null,my=fJ,mw=null,mx=null,mk=null,mS=null,mM=Object.defineProperty,mC=(e,t)=>mM(e,"name",{value:t,configurable:!0}),mF="DropdownMenu",[mD,mz]=ly(mF,[fm]),mN=fm(),[mE,mT]=mD(mF),mR=/* @__PURE__ */mC(e=>{let{__scopeDropdownMenu:t,children:n,dir:a,open:i,defaultOpen:o,onOpenChange:l,modal:s=!0}=e,c=mN(t),u=$.useRef(null),[d,h]=lT({prop:i,defaultProp:o??!1,onChange:l,caller:mF});return /* @__PURE__ */r(mE,{scope:t,triggerId:dQ(),triggerRef:u,contentId:dQ(),open:d,onOpenChange:h,onOpenToggle:$.useCallback(()=>h(e=>!e),[h]),modal:s,children:/* @__PURE__ */r(ms,{...c,open:d,onOpenChange:h,dir:a,modal:s,children:n})})},"DropdownMenu"),mA="DropdownMenuTrigger",mI=/* @__PURE__ */$.forwardRef(/* @__PURE__ */mC(function(e,t){let{__scopeDropdownMenu:n,disabled:a=!1,...i}=e,o=mT(mA,n),l=mN(n),s=lm(t,o.triggerRef);return /* @__PURE__ */r(mc,{asChild:!0,...l,children:/* @__PURE__ */r(l2.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...i,ref:s,onPointerDown:lo(e.onPointerDown,e=>{!a&&0===e.button&&!1===e.ctrlKey&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:lo(e.onKeyDown,e=>{!a&&(["Enter"," "].includes(e.key)&&o.onOpenToggle(),"ArrowDown"===e.key&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})},"DropdownMenuTrigger")),mP=/* @__PURE__ */mC(e=>{let{__scopeDropdownMenu:t,...n}=e;return /* @__PURE__ */r(mu,{...mN(t),...n})},"DropdownMenuPortal"),mL="DropdownMenuContent",mO=/* @__PURE__ */$.forwardRef(/* @__PURE__ */mC(function(e,t){let{__scopeDropdownMenu:n,...a}=e,i=mT(mL,n),o=mN(n),l=$.useRef(!1);return /* @__PURE__ */r(md,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...a,ref:t,onCloseAutoFocus:lo(e.onCloseAutoFocus,e=>{l.current||i.triggerRef.current?.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:lo(e.onInteractOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!i.modal||n)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),mq=/* @__PURE__ */null,m$=/* @__PURE__ */null,m_=/* @__PURE__ */$.forwardRef(/* @__PURE__ */mC(function(e,t){let{__scopeDropdownMenu:n,...a}=e;return /* @__PURE__ */r(mf,{...mN(n),...a,ref:t})},"DropdownMenuItem")),mj=/* @__PURE__ */null,mH=/* @__PURE__ */null,mB=/* @__PURE__ */null,mW=/* @__PURE__ */null,mG=/* @__PURE__ */$.forwardRef(/* @__PURE__ */mC(function(e,t){let{__scopeDropdownMenu:n,...a}=e;return /* @__PURE__ */r(my,{...mN(n),...a,ref:t})},"DropdownMenuSeparator")),mY=/* @__PURE__ */null,mU=/* @__PURE__ */null,mX=/* @__PURE__ */null,mK=/* @__PURE__ */null,mV=mR,mQ=mI,mZ=mP,mJ=mO,m0=null,m1=null,m2=m_,m5=null,m4=null,m3=null,m6=null,m8=mG,m9=null,m7=null,ge=null,gt=null;let gr="u"<typeof window?h:f,gn=e=>{let t=Number.parseInt(e.getAttribute("data-rfkit-charts-portal-users")??"0",10);e.setAttribute("data-rfkit-charts-portal-users",String(t+1))},ga=e=>{let t=Number.parseInt(e.getAttribute("data-rfkit-charts-portal-users")??"0",10)-1;t<=0?e.remove():e.setAttribute("data-rfkit-charts-portal-users",String(t))},gi=e=>{let[t,r]=b(null);return gr(()=>{let t=eP(e);if(t)return gn(t),r(t),()=>{ga(t)}},[e]),t};function go({...e}){return /*#__PURE__*/r(mV,{"data-slot":"dropdown-menu",...e})}let gl=/*#__PURE__*/$.forwardRef(({...e},t)=>/*#__PURE__*/r(mQ,{ref:t,"data-slot":"dropdown-menu-trigger",...e}));function gs({...e}){let t=gi("dropdown-menu");return t?/*#__PURE__*/r(mZ,{"data-slot":"dropdown-menu-portal",container:t,...e}):null}function gc({className:e,sideOffset:t=8,...n}){return /*#__PURE__*/r(gs,{children:/*#__PURE__*/r(mJ,{"data-slot":"dropdown-menu-content",sideOffset:t,className:iX("z-50 min-w-[8.75rem] overflow-hidden rounded-[var(--radius-surface)] border border-border/70 bg-background/98 p-[calc(var(--size-gap-base)/2)] text-foreground shadow-lg backdrop-blur-md","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",e),...n})})}gl.displayName=mQ.displayName;let gu=/*#__PURE__*/$.forwardRef(({className:e,...t},n)=>/*#__PURE__*/r(m2,{ref:n,"data-slot":"dropdown-menu-item",className:iX("relative flex w-full cursor-default select-none items-center gap-2 px-[var(--size-gap-base)] py-[calc(var(--size-gap-base)/2)] text-xs outline-none transition-colors","rounded-[var(--radius-control)] focus:bg-accent/80 focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground data-[disabled]:opacity-40",e),...t}));gu.displayName=m2.displayName;let gd=/*#__PURE__*/$.forwardRef(({className:e,...t},n)=>/*#__PURE__*/r(m8,{ref:n,"data-slot":"dropdown-menu-separator",className:iX("my-[calc(var(--size-gap-base)/2)] h-px bg-border/60",e),...t}));gd.displayName=m8.displayName;var gh=Object.defineProperty,gp=(e,t)=>gh(e,"name",{value:t,configurable:!0});function gf(e,[t,r]){return Math.min(r,Math.max(t,e))}gp(gf,"clamp");var gm=Object.defineProperty,gg=(e,t)=>gm(e,"name",{value:t,configurable:!0});function gb(e,t){return $.useReducer((e,r)=>t[e][r]??e,e)}gg(gb,"useStateMachine");var gv="ScrollArea",[gy,gw]=ly(gv),[gx,gk]=gy(gv),gS=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{__scopeScrollArea:n,type:a="hover",dir:i,scrollHideDelay:o=600,...l}=e,[s,c]=$.useState(null),[u,d]=$.useState(null),[h,p]=$.useState(null),[f,m]=$.useState(null),[g,b]=$.useState(null),[v,y]=$.useState(0),[w,x]=$.useState(0),[k,S]=$.useState(!1),[M,C]=$.useState(!1),F=lm(t,c),D=sh(i);return /* @__PURE__ */r(gx,{scope:n,type:a,dir:D,scrollHideDelay:o,scrollArea:s,viewport:u,onViewportChange:d,content:h,onContentChange:p,scrollbarX:f,onScrollbarXChange:m,scrollbarXEnabled:k,onScrollbarXEnabledChange:S,scrollbarY:g,onScrollbarYChange:b,scrollbarYEnabled:M,onScrollbarYEnabledChange:C,onCornerWidthChange:y,onCornerHeightChange:x,children:/* @__PURE__ */r(l2.div,{dir:D,...l,ref:F,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})},"ScrollArea")),gM="ScrollAreaViewport",gC=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,a){let{__scopeScrollArea:i,children:o,nonce:l,...s}=e,c=gk(gM,i),u=lm(a,$.useRef(null),c.onViewportChange);return /* @__PURE__ */n(t,{children:[/* @__PURE__ */r(gF,{nonce:l}),/* @__PURE__ */r(l2.div,{"data-radix-scroll-area-viewport":"",...s,ref:u,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:/* @__PURE__ */r("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})},"ScrollAreaViewport")),gF=/* @__PURE__ */$.memo(/* @__PURE__ */gg(function({nonce:e}){return /* @__PURE__ */r("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:e})},"ScrollAreaViewportStyle"),(e,t)=>e.nonce===t.nonce),gD="ScrollAreaScrollbar",gz=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{forceMount:n,...a}=e,i=gk(gD,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:l}=i,s="horizontal"===e.orientation;return $.useEffect(()=>(s?o(!0):l(!0),()=>{s?o(!1):l(!1)}),[s,o,l]),"hover"===i.type?/* @__PURE__ */r(gN,{...a,ref:t,forceMount:n}):"scroll"===i.type?/* @__PURE__ */r(gE,{...a,ref:t,forceMount:n}):"auto"===i.type?/* @__PURE__ */r(gT,{...a,ref:t,forceMount:n}):"always"===i.type?/* @__PURE__ */r(gR,{...a,ref:t,"data-state":"visible"}):null},"ScrollAreaScrollbar")),gN=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{forceMount:n,...a}=e,i=gk(gD,e.__scopeScrollArea),[o,l]=$.useState(!1);return $.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let r=/* @__PURE__ */gg(()=>{window.clearTimeout(t),l(!0)},"handlePointerEnter"),n=/* @__PURE__ */gg(()=>{t=window.setTimeout(()=>l(!1),i.scrollHideDelay)},"handlePointerLeave");return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[i.scrollArea,i.scrollHideDelay]),/* @__PURE__ */r(d_,{present:n||o,children:/* @__PURE__ */r(gT,{"data-state":o?"visible":"hidden",...a,ref:t})})},"ScrollAreaScrollbarHover")),gE=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{forceMount:n,...a}=e,i=gk(gD,e.__scopeScrollArea),o="horizontal"===e.orientation,l=gZ(()=>c("SCROLL_END"),100),[s,c]=gb("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return $.useEffect(()=>{if("idle"===s){let e=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),$.useEffect(()=>{let e=i.viewport,t=o?"scrollLeft":"scrollTop";if(e){let r=e[t],n=/* @__PURE__ */gg(()=>{let n=e[t];r!==n&&(c("SCROLL"),l()),r=n},"handleScroll");return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[i.viewport,o,c,l]),/* @__PURE__ */r(d_,{present:n||"hidden"!==s,children:/* @__PURE__ */r(gR,{"data-state":"hidden"===s?"hidden":"visible",...a,ref:t,onPointerEnter:lo(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:lo(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),gT=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let n=gk(gD,e.__scopeScrollArea),{forceMount:a,...i}=e,[o,l]=$.useState(!1),s="horizontal"===e.orientation,c=gZ(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;l(s?e:t)}},10);return gJ(n.viewport,c),gJ(n.content,c),/* @__PURE__ */r(d_,{present:a||o,children:/* @__PURE__ */r(gR,{"data-state":o?"visible":"hidden",...i,ref:t})})},"ScrollAreaScrollbarAuto")),gR=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{orientation:n="vertical",...a}=e,i=gk(gD,e.__scopeScrollArea),o=$.useRef(null),l=$.useRef(0),[s,c]=$.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=gG(s.viewport,s.content),d={...a,sizes:s,onSizesChange:c,hasThumb:!!(u>0&&u<1),onThumbChange:/* @__PURE__ */gg(e=>o.current=e,"onThumbChange"),onThumbPointerUp:/* @__PURE__ */gg(()=>l.current=0,"onThumbPointerUp"),onThumbPointerDown:/* @__PURE__ */gg(e=>l.current=e,"onThumbPointerDown")};function h(e,t){return gU(e,l.current,s,t)}return(gg(h,"getScrollPosition"),"horizontal"===n)?/* @__PURE__ */r(gA,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){let e=gX(i.viewport.scrollLeft,s,i.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=h(e,i.dir))}}):"vertical"===n?/* @__PURE__ */r(gI,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){let e=gX(i.viewport.scrollTop,s);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=h(e))}}):null},"ScrollAreaScrollbarVisible")),gA=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{sizes:n,onSizesChange:a,...i}=e,o=gk(gD,e.__scopeScrollArea),[l,s]=$.useState(),c=$.useRef(null),u=lm(t,c,o.onScrollbarXChange);return $.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),/* @__PURE__ */r(gO,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":gY(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(o.viewport){let n=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),gV(n,r)&&t.preventDefault()}},onResize:()=>{c.current&&o.viewport&&l&&a({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:gW(l.paddingLeft),paddingEnd:gW(l.paddingRight)}})}})},"ScrollAreaScrollbarX")),gI=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{sizes:n,onSizesChange:a,...i}=e,o=gk(gD,e.__scopeScrollArea),[l,s]=$.useState(),c=$.useRef(null),u=lm(t,c,o.onScrollbarYChange);return $.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),/* @__PURE__ */r(gO,{"data-orientation":"vertical",...i,ref:u,sizes:n,style:{top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":gY(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(o.viewport){let n=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),gV(n,r)&&t.preventDefault()}},onResize:()=>{c.current&&o.viewport&&l&&a({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:gW(l.paddingTop),paddingEnd:gW(l.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[gP,gL]=gy(gD),gO=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{__scopeScrollArea:n,sizes:a,hasThumb:i,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:h,...p}=e,f=gk(gD,n),[m,g]=$.useState(null),b=lm(t,g),v=$.useRef(null),y=$.useRef(""),w=f.viewport,x=a.content-a.viewport,k=sg(d),S=sg(c),M=gZ(h,10);function C(e){v.current&&u({x:e.clientX-v.current.left,y:e.clientY-v.current.top})}return gg(C,"handleDragScroll"),$.useEffect(()=>{let e=/* @__PURE__ */gg(e=>{let t=e.target;m?.contains(t)&&k(e,x)},"handleWheel");return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[w,m,x,k]),$.useEffect(S,[a,S]),gJ(m,M),gJ(f.content,M),/* @__PURE__ */r(gP,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:sg(o),onThumbPointerUp:sg(l),onThumbPositionChange:S,onThumbPointerDown:sg(s),children:/* @__PURE__ */r(l2.div,{...p,ref:b,style:{position:"absolute",...p.style},onPointerDown:lo(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),v.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),C(e))}),onPointerMove:lo(e.onPointerMove,C),onPointerUp:lo(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,f.viewport&&(f.viewport.style.scrollBehavior=""),v.current=null})})})},"ScrollAreaScrollbarImpl")),gq="ScrollAreaThumb",g$=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{forceMount:n,...a}=e,i=gL(gq,e.__scopeScrollArea);return /* @__PURE__ */r(d_,{present:n||i.hasThumb,children:/* @__PURE__ */r(g_,{ref:t,...a})})},"ScrollAreaThumb")),g_=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{__scopeScrollArea:n,style:a,...i}=e,o=gk(gq,n),l=gL(gq,n),{onThumbPositionChange:s}=l,c=lm(t,l.onThumbChange),u=$.useRef(void 0),d=gZ(()=>{u.current&&(u.current(),u.current=void 0)},100);return $.useEffect(()=>{let e=o.viewport;if(e){let t=/* @__PURE__ */gg(()=>{d(),u.current||(u.current=gQ(e,s),s())},"handleScroll");return s(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,d,s]),/* @__PURE__ */r(l2.div,{"data-state":l.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:lo(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;l.onThumbPointerDown({x:r,y:n})}),onPointerUp:lo(e.onPointerUp,l.onThumbPointerUp)})},"ScrollAreaThumbImpl")),gj="ScrollAreaCorner",gH=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let n=gk(gj,e.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?/* @__PURE__ */r(gB,{...e,ref:t}):null},"ScrollAreaCorner")),gB=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{__scopeScrollArea:n,...a}=e,i=gk(gj,n),[o,l]=$.useState(0),[s,c]=$.useState(0),u=!!(o&&s),{onCornerWidthChange:d,onCornerHeightChange:h}=i;return gJ(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),gJ(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),l(e)}),$.useEffect(()=>()=>{d(0),h(0)},[d,h]),u?/* @__PURE__ */r(l2.div,{...a,ref:t,style:{width:o,height:s,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...e.style}}):null},"ScrollAreaCornerImpl"));function gW(e){return e?parseInt(e,10):0}function gG(e,t){let r=e/t;return isNaN(r)?0:r}function gY(e){let t=gG(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-r)*t,18)}function gU(e,t,r,n="ltr"){let a=gY(r),i=t||a/2,o=r.scrollbar.paddingStart+i,l=r.scrollbar.size-r.scrollbar.paddingEnd-(a-i),s=r.content-r.viewport;return gK([o,l],"ltr"===n?[0,s]:[-1*s,0])(e)}function gX(e,t,r="ltr"){let n=gY(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,l=gf(e,"ltr"===r?[0,o]:[-1*o,0]);return gK([0,o],[0,i-n])(l)}function gK(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function gV(e,t){return e>0&&e<t}gg(gW,"toInt"),gg(gG,"getThumbRatio"),gg(gY,"getThumbSize"),gg(gU,"getScrollPositionFromPointer"),gg(gX,"getThumbOffsetFromScroll"),gg(gK,"linearScale"),gg(gV,"isScrollingWithinScrollbarBounds");var gQ=/* @__PURE__ */gg((e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(/* @__PURE__ */gg(function a(){let i={left:e.scrollLeft,top:e.scrollTop},o=r.left!==i.left,l=r.top!==i.top;(o||l)&&t(),r=i,n=window.requestAnimationFrame(a)},"loop"))(),()=>window.cancelAnimationFrame(n)},"addUnlinkedScrollListener");function gZ(e,t){let r=sg(e),n=$.useRef(0);return $.useEffect(()=>()=>window.clearTimeout(n.current),[]),$.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function gJ(e,t){let r=sg(t);lk(()=>{let t=0;if(e){let n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}gg(gZ,"useDebounceCallback"),gg(gJ,"useResizeObserver");var g0=gS,g1=gC,g2=null,g5=null,g4=gH;let g3=/*#__PURE__*/$.forwardRef(({className:e,orientation:t="vertical",...n},a)=>/*#__PURE__*/r(gz,{ref:a,orientation:t,className:iX("flex touch-none select-none p-0.5 transition-colors","vertical"===t?"h-full w-2.5 border-l border-l-transparent":"h-2.5 flex-col border-t border-t-transparent",e),...n,children:/*#__PURE__*/r(g$,{className:"relative flex-1 rounded-full bg-border/80"})}));g3.displayName=gz.displayName;let g6=/*#__PURE__*/$.forwardRef(({className:e,viewportClassName:t,children:a,...i},o)=>/*#__PURE__*/n(g0,{ref:o,"data-slot":"scroll-area",className:iX("relative overflow-hidden",e),...i,children:[/*#__PURE__*/r(g1,{"data-slot":"scroll-area-viewport",className:iX("h-full w-full rounded-[inherit]",t),children:a}),/*#__PURE__*/r(g3,{}),/*#__PURE__*/r(g4,{})]}));g6.displayName=g0.displayName;let g8=/*#__PURE__*/s(({children:e,className:t,style:a},i)=>/*#__PURE__*/n("div",{className:iX("relative z-[8] flex flex-col items-start p-2 text-popover-foreground",t),style:a,ref:i,children:[/*#__PURE__*/r("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-[7] rounded-[var(--radius-surface)] border border-border/70 bg-chart-panel/95 shadow-lg [backdrop-filter:saturate(2)_blur(20px)]"}),/*#__PURE__*/r("div",{className:"relative z-[8] h-full w-full",children:e})]})),g9=/*#__PURE__*/a.memo(g8);var g7=Object.defineProperty,be=(e,t)=>g7(e,"name",{value:t,configurable:!0}),bt=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),br=/* @__PURE__ */$.forwardRef(/* @__PURE__ */be(function(e,t){return /* @__PURE__ */r(l2.span,{...e,ref:t,style:{...bt,...e.style}})},"VisuallyHidden")),bn=br,ba=Object.defineProperty,bi=(e,t)=>ba(e,"name",{value:t,configurable:!0}),[bo,bl]=ly("Tooltip",[dp]),bs=dp(),bc="TooltipProvider",bu=700,bd="tooltip.open",[bh,bp]=bo(bc),bf=/* @__PURE__ */bi(e=>{let{__scopeTooltip:t,delayDuration:n=bu,skipDelayDuration:a=300,disableHoverableContent:i=!1,children:o}=e,l=$.useRef(!0),s=$.useRef(!1),c=$.useRef(0);return $.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),/* @__PURE__ */r(bh,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:$.useCallback(()=>{a<=0||(window.clearTimeout(c.current),l.current=!1)},[a]),onClose:$.useCallback(()=>{a<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>l.current=!0,a))},[a]),isPointerInTransitRef:s,onPointerInTransitChange:$.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:o})},"TooltipProvider"),bm="Tooltip",[bg,bb]=bo(bm),bv=/* @__PURE__ */bi(e=>{let{__scopeTooltip:t,children:n,open:a,defaultOpen:i,onOpenChange:o,disableHoverableContent:l,delayDuration:s}=e,c=bp(bm,e.__scopeTooltip),u=bs(t),[d,h]=$.useState(null),[p,f]=$.useState(void 0),m=dQ(),g=$.useRef(0),b=l??c.disableHoverableContent,v=s??c.delayDuration,y=$.useRef(!1),[w,x]=lT({prop:a,defaultProp:i??!1,onChange:/* @__PURE__ */bi(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(bd))):c.onClose(),o?.(e)},"onChange"),caller:bm}),k=$.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),S=$.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),M=$.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),C=$.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);return $.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),/* @__PURE__ */r(dN,{...u,children:/* @__PURE__ */r(bg,{scope:t,contentId:p??m,setContentId:f,open:w,stateAttribute:k,trigger:d,onTriggerChange:h,onTriggerEnter:$.useCallback(()=>{c.isOpenDelayedRef.current?C():S()},[c.isOpenDelayedRef,C,S]),onTriggerLeave:$.useCallback(()=>{b?M():(window.clearTimeout(g.current),g.current=0)},[M,b]),onOpen:S,onClose:M,disableHoverableContent:b,children:n})})},"Tooltip"),by="TooltipTrigger",bw=/* @__PURE__ */$.forwardRef(/* @__PURE__ */bi(function(e,t){let{__scopeTooltip:n,...a}=e,i=bb(by,n),o=bp(by,n),l=bs(n),s=lm(t,$.useRef(null),i.onTriggerChange),c=$.useRef(!1),u=$.useRef(!1),d=$.useCallback(()=>c.current=!1,[]);return $.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),/* @__PURE__ */r(dE,{asChild:!0,...l,children:/* @__PURE__ */r(l2.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...a,ref:s,onPointerMove:lo(e.onPointerMove,e=>{"touch"!==e.pointerType&&(u.current||o.isPointerInTransitRef.current||(i.onTriggerEnter(),u.current=!0))}),onPointerLeave:lo(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:lo(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:lo(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:lo(e.onBlur,i.onClose),onClick:lo(e.onClick,i.onClose)})})},"TooltipTrigger")),bx="TooltipPortal",[bk,bS]=bo(bx,{forceMount:void 0}),bM=/* @__PURE__ */bi(e=>{let{__scopeTooltip:t,forceMount:n,children:a,container:i}=e,o=bb(bx,t);return /* @__PURE__ */r(bk,{scope:t,forceMount:n,children:/* @__PURE__ */r(d_,{present:n||o.open,children:/* @__PURE__ */r(dP,{asChild:!0,container:i,children:a})})})},"TooltipPortal"),bC="TooltipContent",bF=/* @__PURE__ */$.forwardRef(/* @__PURE__ */bi(function(e,t){let n=bS(bC,e.__scopeTooltip),{forceMount:a=n.forceMount,side:i="top",...o}=e,l=bb(bC,e.__scopeTooltip);return /* @__PURE__ */r(d_,{present:a||l.open,children:l.disableHoverableContent?/* @__PURE__ */r(bN,{side:i,...o,ref:t}):/* @__PURE__ */r(bD,{side:i,...o,ref:t})})},"TooltipContent")),bD=/* @__PURE__ */$.forwardRef(/* @__PURE__ */bi(function(e,t){let n=bb(bC,e.__scopeTooltip),a=bp(bC,e.__scopeTooltip),i=$.useRef(null),o=lm(t,i),[l,s]=$.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:h}=a,p=$.useCallback(()=>{s(null),h(!1)},[h]),f=$.useCallback((e,t)=>{let r=e.currentTarget,n={x:e.clientX,y:e.clientY},a=bT(n,r.getBoundingClientRect());s(bP([...bR(n,a),...bA(t.getBoundingClientRect())])),h(!0)},[h]);return $.useEffect(()=>()=>p(),[p]),$.useEffect(()=>{if(c&&d){let e=/* @__PURE__ */bi(e=>f(e,d),"handleTriggerLeave"),t=/* @__PURE__ */bi(e=>f(e,c),"handleContentLeave");return c.addEventListener("pointerleave",e),d.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),d.removeEventListener("pointerleave",t)}}},[c,d,f,p]),$.useEffect(()=>{if(l){let e=/* @__PURE__ */bi(e=>{let t=e.target,r={x:e.clientX,y:e.clientY},n=c?.contains(t)||d?.contains(t),a=!bI(r,l);n?p():a&&(p(),u())},"handleTrackPointerGrace");return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[c,d,l,u,p]),/* @__PURE__ */r(bN,{...e,ref:o})},"TooltipContentHoverable")),bz=lj("TooltipContent"),bN=/* @__PURE__ */$.forwardRef(/* @__PURE__ */bi(function(e,t){let{__scopeTooltip:a,children:i,"aria-label":o,id:l,onEscapeKeyDown:s,onPointerDownOutside:c,...u}=e,d=bb(bC,a),h=bs(a),{onClose:p}=d;$.useEffect(()=>(document.addEventListener(bd,p),()=>document.removeEventListener(bd,p)),[p]),$.useEffect(()=>{if(d.trigger){let e=/* @__PURE__ */bi(e=>{e.target instanceof Node&&e.target.contains(d.trigger)&&p()},"handleScroll");return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[d.trigger,p]);let{setContentId:f}=d;return lk(()=>(f(l),()=>{f(void 0)}),[l,f]),/* @__PURE__ */r(sS,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:/* @__PURE__ */n(dT,{"data-state":d.stateAttribute,role:o?void 0:"tooltip",id:o?void 0:d.contentId,...h,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[/* @__PURE__ */r(bz,{children:i}),o?/* @__PURE__ */r(bn,{id:d.contentId,role:"tooltip",children:o}):null]})})},"TooltipContentImpl")),bE=/* @__PURE__ */$.forwardRef(/* @__PURE__ */bi(function(e,t){let{__scopeTooltip:n,...a}=e;return /* @__PURE__ */r(dR,{...bs(n),...a,ref:t})},"TooltipArrow"));function bT(e,t){let r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,a,i)){case i:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw Error("unreachable")}}function bR(e,t,r=5){let n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}function bA(e){let{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function bI(e,t){let{x:r,y:n}=e,a=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){let o=t[e],l=t[i],s=o.x,c=o.y,u=l.x,d=l.y;c>n!=d>n&&r<(u-s)*(n-c)/(d-c)+s&&(a=!a)}return a}function bP(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),bL(t)}function bL(e){if(e.length<=1)return e.slice();let t=[];for(let r=0;r<e.length;r++){let n=e[r];for(;t.length>=2;){let e=t[t.length-1],r=t[t.length-2];if((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x))t.pop();else break}t.push(n)}t.pop();let r=[];for(let t=e.length-1;t>=0;t--){let n=e[t];for(;r.length>=2;){let e=r[r.length-1],t=r[r.length-2];if((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x))r.pop();else break}r.push(n)}return(r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y)?t:t.concat(r)}bi(bT,"getExitSideFromRect"),bi(bR,"getPaddedExitPoints"),bi(bA,"getPointsFromRect"),bi(bI,"isPointInPolygon"),bi(bP,"getHull"),bi(bL,"getHullPresorted");var bO=bf,bq=bv,b$=bw,b_=bM,bj=bF,bH=bE;function bB({delayDuration:e=0,...t}){return /*#__PURE__*/r(bO,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function bW({...e}){return /*#__PURE__*/r(bq,{"data-slot":"tooltip",...e})}function bG({...e}){return /*#__PURE__*/r(b$,{"data-slot":"tooltip-trigger",...e})}function bY({className:e,sideOffset:t=6,children:a,...i}){let o=gi("tooltip");return o?/*#__PURE__*/r(b_,{container:o,children:/*#__PURE__*/n(bj,{"data-slot":"tooltip-content",sideOffset:t,className:iX("z-50 max-w-52 overflow-hidden rounded-[var(--radius-control)] border border-border/70 bg-popover/95 px-2.5 py-1.5 text-[11px] leading-4 text-popover-foreground shadow-lg backdrop-blur-md","pointer-events-none whitespace-pre-line","origin-[--radix-tooltip-content-transform-origin] data-[state=closed]:animate-out data-[state=open]:animate-in","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",e),...i,children:[a,/*#__PURE__*/r(bH,{className:"fill-popover stroke-border/70 stroke-[0.5px]"})]})}):null}let bU=200,bX=6,bK=8,bV=({children:e,content:t,delay:a=200,duration:i=3e3,offset:o={x:0,y:0}})=>{let[l,s]=b(!1),c=g(null),d=u(()=>{c.current&&(clearTimeout(c.current),c.current=null)},[]),p=u(()=>{d(),i<=0||(c.current=setTimeout(()=>{s(!1),c.current=null},i))},[d,i]),f=u(e=>{(s(e),e)?p():d()},[d,p]);return(h(()=>()=>{d()},[d]),null==t||""===t)?e:/*#__PURE__*/r(bB,{delayDuration:a,children:/*#__PURE__*/n(bW,{open:l,onOpenChange:f,children:[/*#__PURE__*/r(bG,{asChild:!0,children:e}),/*#__PURE__*/r(bY,{side:"top",align:"center",sideOffset:6,collisionPadding:8,avoidCollisions:!0,className:"border-0 bg-transparent p-0 text-xs shadow-none",style:{marginLeft:o.x??0,marginTop:o.y??0,maxWidth:200},children:/*#__PURE__*/r(g9,{className:"max-w-[200px] whitespace-pre-line",children:t})})]})})},bQ=bV,bZ=({value:e,options:t,onChange:a,placeholder:i="请选择",triggerContent:o,triggerTitle:l,closeOnSelect:s=!0,triggerVariant:c="default",showChevron:d=!0,triggerClassName:h,contentClassName:p,contentAlignOffset:f,customContent:g,triggerTestId:v})=>{let[y,w]=b(!1),x=u(e=>{let t=e.value??null;e.onSelect?.(t),a?.(t),s&&w(!1)},[a,s]),k=m(()=>t.find(t=>"separator"!==t.type&&t.value===e),[t,e]),S=iX("inline-flex h-full min-w-0 items-center truncate text-xs leading-none text-foreground","default"===c&&"flex-1"),M=o??(k?.label?/*#__PURE__*/r("span",{className:S,children:k.label}):"string"==typeof i?/*#__PURE__*/r("span",{className:S,children:i}):/*#__PURE__*/r("span",{className:iX("inline-flex h-full min-w-0 items-center","default"===c&&"flex-1"),children:i})),C=/*#__PURE__*/r(gl,{asChild:!0,children:/*#__PURE__*/n("button",{type:"button","data-testid":v,className:iX("cursor-pointer appearance-none select-none border-0 bg-transparent text-left","default"===c&&o0,"default"===c&&"data-[state=open]:bg-accent/72 data-[state=open]:text-foreground data-[state=open]:shadow-[inset_0_0_0_1px_var(--mix-border-72)] data-[state=open]:hover:bg-accent/72","plain"===c&&"inline-flex h-full min-h-0 min-w-0 items-center gap-1 p-0 text-inherit focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/70 focus-visible:ring-offset-1 focus-visible:ring-offset-background",h),children:[M,d?/*#__PURE__*/r("span",{"aria-hidden":"true",className:iX("ml-[calc(var(--size-gap-base)/2)] inline-flex h-full shrink-0 items-center justify-center text-[10px] text-muted-foreground transition-transform",y&&"rotate-180"),children:"▼"}):null]})});return /*#__PURE__*/n(go,{open:y,onOpenChange:w,modal:!1,children:[l?/*#__PURE__*/r(bV,{content:l,children:C}):C,/*#__PURE__*/r(gc,{align:"start",alignOffset:f,collisionPadding:8,className:iX("min-w-[140px] [min-width:var(--radix-dropdown-menu-trigger-width)]",p),children:g??/*#__PURE__*/r(g6,{viewportClassName:"h-auto max-h-64",children:/*#__PURE__*/r("div",{children:t.map((t,n)=>"separator"===t.type?/*#__PURE__*/r(gd,{style:t.style},`separator-${t.label??n}`):/*#__PURE__*/r(gu,{disabled:t.disabled,className:iX(e===t.value&&"bg-accent text-primary",t.disabled&&"data-[disabled]:text-muted-foreground"),style:t.style,onSelect:e=>{s||e.preventDefault(),x(t)},children:t.render?t.render():t.label},null!==t.value&&void 0!==t.value?t.value:`null-option-${n}`))})})})]})},bJ=bZ,b0=80,b1=80,b2=(e,t,r,n)=>({left:e,top:t,right:r,bottom:n,width:Math.max(0,r-e),height:Math.max(0,n-t)}),b5=e=>({sourceId:e.sourceId,sourceType:e.sourceType,clientX:e.clientX,clientY:e.clientY,bounds:e.bounds}),b4=(e,t)=>e?.sourceId===t.sourceId&&e?.sourceType===t.sourceType&&e?.coord.left===t.coord.left&&e?.coord.top===t.coord.top&&e?.clientX===t.clientX&&e?.clientY===t.clientY&&e?.bounds.left===t.bounds.left&&e?.bounds.top===t.bounds.top&&e?.bounds.right===t.bounds.right&&e?.bounds.bottom===t.bounds.bottom&&e?.sampledIndex===t.sampledIndex&&e?.globalIndex===t.globalIndex&&e?.rowIndex===t.rowIndex;class b3{entries=new Map;sampleIntervalMs;sampleIdleDelayMs;now;requestFrame;cancelFrame;setTimer;clearTimer;constructor(e={}){this.sampleIntervalMs=e.sampleIntervalMs??80,this.sampleIdleDelayMs=e.sampleIdleDelayMs??80,this.now=e.now??(()=>Date.now()),this.requestFrame=e.requestFrame??(e=>"u">typeof window?window.requestAnimationFrame(e):Number(setTimeout(e,16))),this.cancelFrame=e.cancelFrame??(e=>{"u">typeof window?window.cancelAnimationFrame(e):clearTimeout(e)}),this.setTimer=e.setTimer??((e,t)=>"u">typeof window?window.setTimeout(e,t):setTimeout(e,t)),this.clearTimer=e.clearTimer??(e=>{"u">typeof window?window.clearTimeout(e):clearTimeout(e)})}updatePointer(e,t){let r=this.ensureEntry(e);r.version+=1,r.pointer={...t,version:r.version,timestamp:this.now()},this.schedulePointerFrame(r),this.scheduleSample(r)}refreshBounds(e,t){let r=this.ensureEntry(e);r.pointer&&(r.version+=1,r.pointer={...r.pointer,bounds:t,version:r.version,timestamp:this.now()},this.schedulePointerFrame(r))}clearPointer(e,t="manual"){let r=this.entries.get(e);r&&(r.pointer=null,r.sample=null,r.lastSampleTimestamp=0,r.hasSampleTimestamp=!1,this.clearEntryTimers(r),this.notifyPointer(r,null),this.notifySample(r,null))}subscribePointer(e,t){let r=this.ensureEntry(e);return r.pointerListeners.add(t),t(r.pointer),()=>{r.pointerListeners.delete(t),this.cleanupEntryIfEmpty(e,r)}}subscribeSample(e,t){let r=this.ensureEntry(e);return r.sampleListeners.add(t),t(r.sample),()=>{r.sampleListeners.delete(t),this.cleanupEntryIfEmpty(e,r)}}getPointer(e){return this.entries.get(e)?.pointer??null}getSample(e){return this.entries.get(e)?.sample??null}dispose(e){if(e){let t=this.entries.get(e);if(!t)return;this.clearPointer(e,"dispose"),t.pointerListeners.clear(),t.sampleListeners.clear(),this.entries.delete(e);return}for(let e of Array.from(this.entries.keys()))this.dispose(e)}ensureEntry(e){let t=this.entries.get(e);if(t)return t;let r={pointer:null,sample:null,pointerListeners:new Set,sampleListeners:new Set,pointerFrame:null,sampleTimer:null,idleTimer:null,lastSampleTimestamp:0,hasSampleTimestamp:!1,version:0};return this.entries.set(e,r),r}schedulePointerFrame(e){null===e.pointerFrame&&(e.pointerFrame=this.requestFrame(()=>{e.pointerFrame=null,this.notifyPointer(e,e.pointer)}))}scheduleSample(e){if(!e.pointer)return;let t=this.now()-e.lastSampleTimestamp;!e.hasSampleTimestamp||t>=this.sampleIntervalMs?this.flushSample(e):e.sampleTimer||(e.sampleTimer=this.setTimer(()=>{e.sampleTimer=null,this.flushSample(e)},this.sampleIntervalMs-t)),e.idleTimer&&this.clearTimer(e.idleTimer),e.idleTimer=this.setTimer(()=>{e.idleTimer=null,this.flushSample(e)},this.sampleIdleDelayMs)}flushSample(e){if(!e.pointer)return;let t={...e.pointer};e.lastSampleTimestamp=this.now(),e.hasSampleTimestamp=!0,b4(e.sample,t)||(e.sample=t,this.notifySample(e,t))}notifyPointer(e,t){for(let r of Array.from(e.pointerListeners))r(t)}notifySample(e,t){for(let r of Array.from(e.sampleListeners))r(t)}clearEntryTimers(e){null!==e.pointerFrame&&(this.cancelFrame(e.pointerFrame),e.pointerFrame=null),e.sampleTimer&&(this.clearTimer(e.sampleTimer),e.sampleTimer=null),e.idleTimer&&(this.clearTimer(e.idleTimer),e.idleTimer=null)}cleanupEntryIfEmpty(e,t){t.pointerListeners.size>0||t.sampleListeners.size>0||t.pointer||t.sample||(this.clearEntryTimers(t),this.entries.delete(e))}}let b6=new b3,b8=null,b9=b5,b7="u"<typeof window?h:f,ve=e=>Number.isFinite(e.left)&&Number.isFinite(e.top)&&Number.isFinite(e.right)&&Number.isFinite(e.bottom)&&Number.isFinite(e.width)&&Number.isFinite(e.height)&&e.width>0&&e.height>0&&e.right>e.left&&e.bottom>e.top,vt=(e,t,r)=>e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom,vr=({children:e,interactionId:t,margin:n=8,className:a})=>{let o=g(null),l=gi("cursor-follow"),s=m(()=>i.toArray(e),[e]),c=s.length>0,d=u(()=>{o.current&&(o.current.style.visibility="hidden",o.current.style.transform="translate3d(-100vw, -100vh, 0)")},[]),h=g(null),p=u((e=h.current)=>{if(!e||!o.current||!c)return void d();h.current=e;let t=o.current,{clientX:r,clientY:a,bounds:i}=e;if(!Number.isFinite(r)||!Number.isFinite(a)||!ve(i))return void d();let{width:l,height:s}=t.getBoundingClientRect(),u=window.innerWidth,p=window.innerHeight;if(r<0||a<0||r>u||a>p||!vt(r,a,i))return void d();let f=i.left+n,m=i.top+n,g=i.right-n,b=i.bottom-n,v=Math.max(n,u-l-n),y=Math.max(n,p-s-n),w=Math.max(f,g-l),x=Math.max(m,b-s),k=Math.max(0,i.width-2*n),S=Math.max(0,i.height-2*n),M=a+n,C=r+n;C+l>g&&(C=r-l-n),M+s>b&&(M=a-s-n),C=l<=k?Math.min(Math.max(C,f),w):Math.min(Math.max(C,n),v),M=s<=S?Math.min(Math.max(M,m),x):Math.min(Math.max(M,n),y),t.style.visibility="visible",t.style.transform=`translate3d(${C}px, ${M}px, 0)`},[c,d,n]);return(b7(()=>c&&t?b6.subscribePointer(t,e=>{if(!e){h.current=null,d();return}p(e)}):void d(),[c,d,t,p]),b7(()=>{if(l)return l.setAttribute("data-rfkit-cursor-layer","true"),()=>{l.removeAttribute("data-rfkit-cursor-layer")}},[l]),b7(()=>{c?p():d()}),b7(()=>{if(!o.current||!c)return;let e=()=>{p()},t=new ResizeObserver(()=>{p()});return t.observe(o.current),window.addEventListener("resize",e),()=>{t.disconnect(),window.removeEventListener("resize",e)}},[c,p]),c&&l)?/*#__PURE__*/R(/*#__PURE__*/r("div",{ref:o,className:iX("pointer-events-none fixed left-0 top-0 z-10 will-change-transform",a),style:{transform:"translate3d(-100vw, -100vh, 0)",visibility:"hidden"},children:s}),l):null},vn=vr,va=({children:e,id:t})=>/*#__PURE__*/r(vr,{interactionId:t,margin:tV.POPOVER_MARGIN,children:e}),vi=va,vo=({id:e,children:t})=>{let[r,n]=b(null);return(h(()=>{let t;if(e&&((t=document.getElementById(e))&&n(t),!document.getElementById(e))){let t=new MutationObserver(()=>{let r=document.getElementById(e);r&&(n(r),t.disconnect())});return t.observe(document.body,{childList:!0,subtree:!0}),()=>t.disconnect()}},[e]),r)?/*#__PURE__*/T.createPortal(t,r):null},vl=vo,vs=e=>"string"==typeof e||"number"==typeof e?String(e).trim()||void 0:Array.isArray(e)?e.map(e=>vs(e)).filter(Boolean).join(" ").trim()||void 0:/*#__PURE__*/a.isValidElement(e)?vs(e.props.children):void 0,vc=({style:e,className:t,title:n,active:a=!1,disabled:i=!1,onClick:o,onDoubleClick:l,onWheel:s,children:c})=>{let u=vs(n),d=o&&(e=>{if(i){e.preventDefault(),e.stopPropagation();return}o(e)}),h=l&&(e=>{if(i){e.preventDefault(),e.stopPropagation();return}l(e)}),p=s&&(e=>{i?e.preventDefault():s(e)}),f=o||l?/*#__PURE__*/r("button",{type:"button",style:e,"aria-label":u,"aria-pressed":a||void 0,"aria-disabled":i||void 0,"data-active":a?"true":void 0,tabIndex:i?-1:void 0,onClick:d,onDoubleClick:h,onWheel:p,className:t,children:c}):s?/*#__PURE__*/r("div",{style:e,"aria-disabled":i||void 0,"data-active":a?"true":void 0,onWheel:p,className:t,children:c}):/*#__PURE__*/r("span",{style:e,"aria-disabled":i||void 0,"data-active":a?"true":void 0,className:t,children:c});return n?/*#__PURE__*/r(bV,{content:n,children:f}):f},vu=vc,vd=({style:e,className:t,title:n,children:a,active:i=!1,tone:o="default",disabled:l=!1,onClick:s,onDoubleClick:c})=>{let u=oV[o];return /*#__PURE__*/r(vc,{style:e,className:iX(oZ,!!(s||c)&&oU,l&&oX,i&&u,t),title:n,active:i,disabled:l,onClick:s,onDoubleClick:c,children:a})},vh=vd,vp=({style:e,className:t,contentClassName:n,title:a,active:i=!1,tone:o="default",disabled:l=!1,onClick:s,onDoubleClick:c,onWheel:u,children:d})=>{let h=oV[o],p=iX(o3,!!(s||c||u)&&oU,l&&oX,i&&h,t),f=/*#__PURE__*/r("div",{className:iX("inline-flex h-[14px] min-w-0 items-center justify-center text-xs leading-none",n),children:d});return /*#__PURE__*/r(vc,{style:e,className:p,title:a,active:i,disabled:l,onClick:s,onDoubleClick:c,onWheel:u,children:f})},vf=vp,vm=({children:e,className:t,opticalOffsetX:n=0,opticalOffsetY:a=0,opticalScale:i=1})=>{let o=[];return(0!==n||0!==a)&&o.push(`translate(${n}px, ${a}px)`),1!==i&&o.push(`scale(${i})`),/*#__PURE__*/r("span",{className:iX("inline-flex size-4 shrink-0 items-center justify-center [&_svg]:size-full [&_svg]:shrink-0",t),style:o.length>0?{transform:o.join(" ")}:void 0,children:e})},vg=vm;var vb=Object.defineProperty,vv=(e,t)=>vb(e,"name",{value:t,configurable:!0}),vy="horizontal",vw=["horizontal","vertical"],vx=/* @__PURE__ */$.forwardRef(/* @__PURE__ */vv(function(e,t){let{decorative:n,orientation:a=vy,...i}=e,o=vk(a)?a:vy;return /* @__PURE__ */r(l2.div,{"data-orientation":o,...n?{role:"none"}:{"aria-orientation":"vertical"===o?o:void 0,role:"separator"},...i,ref:t})},"Separator"));function vk(e){return vw.includes(e)}vv(vk,"isValidOrientation");var vS=vx;function vM({className:e,orientation:t="horizontal",decorative:n=!0,...a}){return /*#__PURE__*/r(vS,{"data-slot":"separator",decorative:n,orientation:t,className:iX("shrink-0 bg-border/70","horizontal"===t?"h-px w-full":"h-full w-px",e),...a})}let vC=({children:e,className:t,...n})=>/*#__PURE__*/r("div",{className:iX(oJ,"[&>*]:h-full [&>*]:shrink-0",t),...n,children:e}),vF=({className:e})=>/*#__PURE__*/r(vM,{className:iX(oG,e),orientation:"vertical"}),vD=-27,vz=e=>/*#__PURE__*/r(bZ,{...e,triggerVariant:"default",contentClassName:iX(lr,e.contentClassName)}),vN=({icon:e,title:t,triggerClassName:n,...a})=>{let i=/*#__PURE__*/r("span",{className:"inline-flex h-full min-w-4 shrink-0 items-center justify-center text-primary",children:/*#__PURE__*/r(vm,{children:e})});return /*#__PURE__*/r(bZ,{...a,triggerVariant:"default",triggerTitle:t,contentClassName:iX(lr,a.contentClassName),triggerClassName:iX("min-w-0 justify-center gap-0.5 px-1",n),triggerContent:i})},vE=({leading:e,triggerClassName:t,contentAlignOffset:a=vD,...i})=>/*#__PURE__*/n(vC,{children:[e,/*#__PURE__*/r(bZ,{...i,triggerVariant:"plain",contentClassName:iX(lr,i.contentClassName),contentAlignOffset:a,triggerClassName:iX("inline-flex h-full items-center px-[calc(var(--size-gap-base)/2)] text-primary hover:bg-accent/72 data-[state=open]:bg-accent/72 data-[state=open]:hover:bg-accent/72",t)})]}),vT=({className:e,...t})=>/*#__PURE__*/r(vd,{...t,className:iX("h-full rounded-none border-0 bg-transparent shadow-none",e)}),vR=vT,vA=(e,t,r)=>tC(`handleColor-${e}`,t,r,e),vI=t0(),vP=vI.gradient,vL=vP.index,vO=[...vP.item],vq=()=>{let{state:{axisY:{range:e},globalID:t}}=ae(),[a,i]=e??[0,0],[o,l]=b(vL),s=m(()=>[...vO[o]].reverse().map(E),[o]),c=u(()=>{let e=(o+1)%vO.length;l(e);let r=[...vO[e]].reverse().map(E);t&&vA(t)(r)},[o,t]);h(()=>{if(t)return vA(t,"setGradientColors",e=>{let t=vO.findIndex(t=>JSON.stringify([...t].reverse().map(E))===JSON.stringify(e));-1!==t&&l(t)})},[t]);let d=m(()=>s.map((e,t,n)=>{if(t===n.length-1)return null;let a=n[t+1];return /*#__PURE__*/r("span",{className:"flex-1",style:{background:`linear-gradient(to right, rgba(${e.r},${e.g},${e.b},${e.a}), rgba(${a.r},${a.g},${a.b},${a.a}))`}},`${e.r}-${e.g}-${e.b}-${e.a}-${a.r}-${a.g}-${a.b}-${a.a}`)}),[s]);return /*#__PURE__*/r(vp,{onClick:c,title:"点击切换瀑布图色阶",contentClassName:"w-[60px] justify-stretch",children:/*#__PURE__*/n("div",{className:"relative flex h-full w-full select-none",children:[/*#__PURE__*/n("div",{className:"absolute inset-0 flex h-full w-full justify-between text-[9px] text-white",children:[/*#__PURE__*/r("div",{className:"flex w-full items-center justify-center",children:Math.round(a)}),/*#__PURE__*/r("div",{className:"flex w-full items-center justify-center",children:Math.round(i)})]}),d]})})},v$=/*#__PURE__*/a.memo(vq),v_=()=>/*#__PURE__*/r(vM,{className:oW,orientation:"vertical"}),vj=v_;class vH extends of{getInitialColors(){return[...t2()].reverse().map(e=>E(e))}subscribeToColor(e){this.trackCleanup(vA(this.state.globalID,e,e=>{this.state.chart?.updateProps?.({colors:e})}))}updateParams(e){super.updateParams(e)}}let vB={iqEye:{Engine:D},iqLine:{Engine:F},iqPlanisphere:{Engine:F,lineColor:"#ffffff00"},iqStream:{Engine:F}};class vW extends of{constructor(e){super({id:e.id,chart:null,type:e.type})}init(){let{id:e,type:t}=this.state;if(!e)return;let r=vB[t],n=t0("iq");this.state.chart=new r.Engine({id:e,...n,...r.lineColor&&{lineColor:r.lineColor}}),this.scheduleResize()}updateSeries(e){this.state.chart?.render(e)}}class vG extends oq{constructor(e){super({id:e.id,chart:null,directionLabelMode:e.directionLabelMode??w.Cardinal})}init(){let{id:e,directionLabelMode:t}=this.state;e&&this.hasRenderableContainerSize()&&(this.state.chart=new y({id:e,directionLabelMode:t,...oo(document.getElementById(e))}),this.scheduleResize(),this.subscribeToTheme())}onParamsUpdated(e){void 0!==e.directionLabelMode&&this.state.chart?.updateProps({directionLabelMode:e.directionLabelMode})}}let vY=({directionLabelMode:e=w.Cardinal})=>{let{chart:t,Chart:n}=iV({Render:vG,params:{directionLabelMode:e}});return i3({moduleType:rr.Dial,chart:t}),/*#__PURE__*/r(oL,{children:/*#__PURE__*/r(n,{})})},vU=vY,vX=e=>{let{publish:t,directionLabelMode:n}=e,{state:{globalID:a}}=ae();return ac({publish:t,subscribe:e=>{((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Dial)(oI(e,{allowImplicitRender:!0,renderPSTypes:[rn.Dial]}))}}),/*#__PURE__*/r(am,{children:/*#__PURE__*/r(vY,{directionLabelMode:n})})},vK=vX,vV=e=>/*#__PURE__*/r(aa,{...e,system:{padding:!1,border:!1},children:/*#__PURE__*/r(vX,{...e})}),vQ=tB(vV,"Dial"),vZ=vQ,vJ=({children:e,padding:t,limit:a,step:i,setLimit:o,onChange:l})=>{let{state:{axisY:{range:s=ns}}}=ae(),[c,d]=s,h=g(null),[p,f]=b(!1),m=u(e=>{if(!h.current)return;let t=Math.round((d-c)*((h.current.offsetHeight-(e.clientY-h.current.getBoundingClientRect().top))/h.current.offsetHeight)+c);o(t=Math.max(c,Math.min(d,t)))},[c,d,o]),v=u(e=>{m(e),f(!0)},[m]),y=u(()=>{p&&l?.(a),f(!1)},[p,a,l]);return /*#__PURE__*/n("div",{className:"relative h-full w-full",children:[/*#__PURE__*/r("div",{ref:h,onMouseDown:v,onMouseUp:y,onMouseLeave:y,onMouseMove:u(e=>{p&&m(e)},[p,m]),onWheel:u(e=>{let t=a+(e.deltaY>0?-i:i);o(t=Math.max(c,Math.min(d,t))),l?.(t)},[i,a,c,d,o,l]),style:{top:`${t}px`,height:`calc(100% - ${2*t}px)`},className:"absolute left-0 z-[5] w-full"}),e]})},v0=/*#__PURE__*/a.memo(vJ);class v1 extends of{constructor(e){super({id:e.id,chart:null,props:e})}init(){let{id:e,props:t}=this.state;e&&(this.state.chart=new S({...oo(document.getElementById(e)),...t}),this.scheduleResize(),this.trackCleanup(oh(()=>{let e=this.getContainerElement();if(!e)return;let t=oo(e);this.state.chart?.updateProps(t),this.resize()})))}updateProps(e){this.state.chart?.updateProps(e)}updateSeries(e){this.state.chart?.render(e)}}let v2=20,v5=2,v4=({onChange:e})=>{let{state:{globalID:t,axisY:{range:n}}}=ae(),{chart:a,Chart:i}=iV({Render:v1,params:{padding:20,step:2,range:n}});i3({moduleType:rr.Gauge,chart:a,renderPSTypes:[rn.Gauge],handleRender:(e,t)=>{t.updateSeries?.(e)}});let[o,l]=b(0);return h(()=>{((e,t,r="0")=>tI(e,t,void 0,r))(t,rr.Gauge)({pstype:rn.Gauge,limit:o})},[o,t]),h(()=>{n&&a?.updateProps({range:n})},[n]),/*#__PURE__*/r(v0,{padding:20,limit:o,step:2,setLimit:e=>l(e),onChange:e,children:/*#__PURE__*/r(i,{})})},v3=v4,v6=e=>{let{publish:t,onChange:n}=e,{state:{globalID:a}}=ae();return ac({publish:t,subscribe:e=>{((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Gauge)(e)}}),/*#__PURE__*/r(am,{children:/*#__PURE__*/r(v4,{onChange:n})})},v8=v6,v9=e=>/*#__PURE__*/r(aa,{...e,system:{padding:!1,border:!1},children:/*#__PURE__*/r(v6,{...e})}),v7=tB(v9,"Gauge"),ye=v7,yt=40,yr=({padding:e,placement:t,show:r})=>{let n="inside"===t,a=40*(!1!==r),i=n?0:a;return{axisYWidth:`${a+e/2}px`,inside:n,marginLeft:`${0-e/2}px`,pluginBoxWidth:0===i?"100%":`calc(100% - ${i}px)`,width:`${i}px`}};function yn(){let e=at(e=>e.system.padding);return yr({padding:e,placement:at(e=>e.axisY.placement),show:at(e=>e.axisY.show)})}let ya=(e,t)=>({...e,interval:{start:0,end:Math.max(t-1,0)},isScanSegmentsUpdateMagnify:!1}),yi=/*#__PURE__*/s(({children:e,className:t,style:n},a)=>{let{state:{zoom:{style:i}}}=ae();return /*#__PURE__*/r("div",{ref:a,className:iX("pointer-events-none absolute right-0 top-0 z-[1] h-full w-full select-none overflow-hidden bg-transparent",t),style:n,children:/*#__PURE__*/r("div",{className:"absolute right-0 top-0 flex h-full w-full self-center",style:i??void 0,children:e})})}),yo=yi,yl=({length:e=10,tickColor:t="var(--chart-grid-strong)",tickHeight:a=8,strokeWidth:i=1,orientation:o="horizontal",split:l=2})=>{let s=u(n=>{let s=100/e*n,c="horizontal"===o&&n%l==0||"vertical"===o&&n%l!=0?1.68*a:a;return("horizontal"===o&&(c/=.5),s)?"horizontal"===o?/*#__PURE__*/r("line",{x1:s,y1:"0",x2:s,y2:c,stroke:t,strokeWidth:i,vectorEffect:"non-scaling-stroke"},`tick-${n}`):/*#__PURE__*/r("line",{x1:"100",y1:s,x2:100-c,y2:s,stroke:t,strokeWidth:i,vectorEffect:"non-scaling-stroke"},`tick-${n}`):null},[e,t,i,o]);return /*#__PURE__*/n("svg",{className:"absolute left-0 top-0 h-full w-full opacity-50",width:"100%",height:"100%",preserveAspectRatio:"none",viewBox:"0 0 100 100",children:["horizontal"===o?/*#__PURE__*/r("line",{x1:"0",y1:"0",x2:"100",y2:"0",stroke:t,strokeWidth:i,vectorEffect:"non-scaling-stroke"}):/*#__PURE__*/r("line",{x1:"100",y1:"0",x2:"100",y2:"100",stroke:t,strokeWidth:i,vectorEffect:"non-scaling-stroke"}),Array.from({length:e+1}).map((e,t)=>s(t))]})},ys=yl,yc="absolute right-0 top-0 flex h-full w-full items-center justify-between text-xs opacity-50",yu="relative h-6 w-full select-none overflow-hidden text-xs leading-6",yd=/*#__PURE__*/c(({value:e,unit:t,prefix:r=""})=>/*#__PURE__*/n("div",{className:"pl-[5px]",children:[r,e,t]})),yh=/*#__PURE__*/c(({value:e,index:t,total:n})=>/*#__PURE__*/r("div",{className:iX("absolute flex -translate-x-1/2 items-center justify-center text-center",0===t&&"left-0 translate-x-0",t===n&&"left-full -translate-x-full"),style:{left:`${t/n*100}%`},children:/*#__PURE__*/r("span",{children:e})}));function yp(e,t,r){let n=e[0],a=e.totalPoints??0;if(1!==e.length||!n||!Number.isInteger(a)||a<2||n.point!==a||0===n.bandwidth||!Number.isFinite(n.start)||!Number.isFinite(n.stop)||n.stop<=n.start||!Number.isFinite(t)||!Number.isFinite(r)||t<0||r<t||r>=a)return;let i=(n.stop-n.start)/(a-1),o=(r-t)*i/2,l=n.start+t*i;return{startMHz:l,centerMHz:l+o,endMHz:n.start+r*i,halfSpanKHz:1e3*o}}let yf=5,ym=(e,t)=>t?`${rm(e)}\xa0${t}`:rm(e),yg=({type:e,allowCenterBandwidth:t})=>{let{state:{segments:a,points:i,zoom:o,waterfallViewport:l,axisX:{frequencyFormat:s,labelMode:c,unit:d="",unitKHz:h=""}}}=ae(),p=e===rt.Heatmap?l.sourceSize.width:0,f=p||a.totalPoints||0,g=e===rt.Heatmap&&p>0?l.range.x[0]:o.interval.start,b=e===rt.Heatmap&&p>0?l.range.x[1]-1:o.interval.end,v=u(e=>{if(!f)return 0;let t=Math.min(100*e/f,100);return s?.(t)??""},[f,s]),y=t&&c===re.CenterBandwidth&&0===i.length,w=o.isScanSegmentsUpdateMagnify&&b===f?b-1:b,x=m(()=>{if(y){let e=yp(a,g,w);if(e){let t=ym(e.halfSpanKHz,h);return[{key:"band-start",value:`−${t}`},{key:"band-center",value:ym(e.centerMHz,d)},{key:"band-end",value:`+${t}`}]}}let e=(b-g+1)/5;return Array.from({length:6},(t,r)=>{let n=g+e*r;return{key:`tick-${n.toFixed(6)}`,value:v(n)}})},[w,v,b,g,a,y,d,h]);return /*#__PURE__*/n("div",{className:yc,children:[x.map((e,t)=>/*#__PURE__*/r(yh,{value:e.value,index:t,total:x.length-1},e.key)),/*#__PURE__*/r(yl,{length:10,split:2})]})},yb=yg,yv="@container flex h-full min-w-0 flex-1 items-center justify-center overflow-hidden",yy=48,yw=()=>{let{state:{segments:e,zoom:{interval:{start:t,end:a}}}}=ae(),i=g(null),[o,l]=b(0);f(()=>{let e=i.current;if(!e||(l(e.clientWidth),"u"<typeof ResizeObserver))return;let t=new ResizeObserver(()=>l(e.clientWidth));return t.observe(e),()=>t.disconnect()},[]);let s=e.totalPoints??0,c=m(()=>{if(!o||!s||e.length<=1)return 1;let r=Math.max(1,a-t+1),n=o/Math.max(1,Math.round(e.length*r/s));return n>=48?1:Math.ceil(48/n)},[o,s,e.length,t,a]),u=c>1;return /*#__PURE__*/n("div",{ref:i,className:yc,children:[m(()=>e.map((e,t)=>/*#__PURE__*/r("div",{className:iX("@container flex h-full min-w-0 flex-1 items-center justify-center overflow-hidden",u&&"overflow-visible",u&&0===t&&"justify-start"),children:/*#__PURE__*/r("span",{className:u?t%c==0?"block whitespace-nowrap":"hidden":"hidden max-w-full truncate @min-[48px]:block",children:e.label})},e.index)),[e,u,c]),/*#__PURE__*/r(yl,{length:2*e.length,split:2})]})},yx=yw,yk=({type:e})=>{let{state:{zoom:{interval:{start:t,end:a}},axisX:{labelMode:i=re.Auto,unit:o="",unitKHz:l=""},segments:s,points:c}}=ae(),u=s.totalPoints??0,d=Math.max(u-1,0),{start:h,bandwidth:p=0}=s[0]??{},f=m(()=>d&&p&&void 0!==h?rm(h+Math.max(0,Math.min(tX(t,a),d))*p/(1e3*d)):0,[t,a,h,d,p]),g=m(()=>u&&p?rm((a-t+1)*p/(2*u)):0,[t,a,u,p]),b=(i===re.Frequency||i===re.CenterBandwidth)&&(e===rt.SingleFrequency||e===rt.Lite||e===rt.DDC)&&0===c.length?yp(s,t,a):void 0,v=i===re.Frequency?b:void 0,y=b?rm(b.halfSpanKHz):g;return /*#__PURE__*/n("div",{className:yc,children:[/*#__PURE__*/r(yd,{value:v?rm(v.startMHz):y,unit:v?o:l,prefix:v?void 0:"-"}),/*#__PURE__*/r(yd,{value:b?rm(b.centerMHz):f,unit:o}),/*#__PURE__*/r(yd,{value:v?rm(v.endMHz):y,unit:v?o:l,prefix:v?void 0:"+"}),/*#__PURE__*/r(yl,{length:10,split:5})]})},yS=yk,yM=({type:e,allowScanCenterBandwidth:t=!0})=>{let{state:{axisX:{show:n}}}=ae();return n?/*#__PURE__*/r("div",{className:"relative h-6 w-full select-none overflow-hidden text-xs leading-6",children:e===rt.Scan||e===rt.ScanDF360||e===rt.Heatmap?/*#__PURE__*/r(yg,{type:e,allowCenterBandwidth:e===rt.Scan&&t}):e===rt.MScan?/*#__PURE__*/r(yi,{children:/*#__PURE__*/r(yw,{})}):/*#__PURE__*/r(yk,{type:e})}):null},yC=/*#__PURE__*/c(yM),yF=300,yD=20,yz=e=>{let{type:a}=e,{state:{axisX:i,zoom:o,segments:l},dispatch:s}=ae(),{children:c,unit:d,ticks:h}=i,{width:p,pluginBoxWidth:f}=yn(),b=g(null),v=m(()=>({marginLeft:p,width:f}),[p,f]),y=a!==rt.Heatmap,w=l.totalPoints??0,x=u(()=>{s({payload:{zoom:ya(o,w)}})},[s,o,w]),k=g({x:0,y:0,time:0}),S=u(e=>{let t=e.changedTouches[0];if(!t)return;let{clientX:r,clientY:n}=t,a=Date.now(),i=k.current;if(a-i.time<=300&&20>=Math.abs(r-i.x)&&20>=Math.abs(n-i.y)){k.current={x:0,y:0,time:0},x();return}k.current={x:r,y:n,time:a}},[x]);return i?/*#__PURE__*/r(bV,{content:`单位${d}`,children:/*#__PURE__*/n("div",{ref:b,className:"relative flex w-full flex-col box-border",style:v,onDoubleClick:y?x:void 0,onTouchEnd:y?S:void 0,children:[h&&/*#__PURE__*/n(t,{children:[/*#__PURE__*/r("div",{className:"absolute bottom-[-12px] right-0 z-[3] flex items-center justify-end text-[10px] opacity-50",children:d}),/*#__PURE__*/r(yC,{...e})]}),/*#__PURE__*/r("div",{children:c})]})}):null},yN=/*#__PURE__*/c(yz),yE=e=>{let{children:t,className:n,style:a}=e;return /*#__PURE__*/r("div",{className:iX("relative flex min-h-0 flex-1 box-border",n),style:a,children:t})},yT=yE;function yR(e,t=ns){let[r,n]=e??na["dBμV"],[a,i]=t,o=Math.max(a,r),l=Math.min(i,n);return o<l?[o,l]:[r,n]}let yA=({ranging:e})=>{let{state:{axisY:t,globalID:r,system:{height:n}}}=useStore(),{defaultRange:a=RANGE_DEFAULT,range:i=a,autoranging:o,step:l=stepDefault,restrict:s=restrictList.dBμV,unit:c}=t,u=useRef(null),[d,h]=s,p=h-d,[f,m]=i,g=p/l+1,b=m-f,v=useMemo(()=>Array.from({length:g},(e,t)=>{let r=(h-t*l).toFixed(0);return isNumberAlias(r)?/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("span",{children:r})},r):null}),[h,l,g]),y=useMemo(()=>{let e=u.current?.offsetHeight??0,t=(p+l)/b*e,r=l/(p+l)*t/2,n=(h-m)/b*e;return{height:`${t}px`,transform:`translateY(-${r+n}px)`}},[s,i,l,n,p,b,m,h]),[w,x]=useState(!1),[k,S]=useState(0),M=useCallback(e=>{x(!0),S(e.clientY)},[]),C=useCallback(()=>{x(!1)},[]),F=useCallback(t=>{if(!w||!u.current)return;let r=(t.clientY-k)/u.current.offsetHeight;Math.abs(r)>.01&&(e.move?.(r),S(t.clientY))},[w,k,e]),D=useCallback((t,r)=>{w||(t.stopPropagation(),e.moveBoundary?.(t.deltaY>0,r))},[w,e]);return /*#__PURE__*/_jsxs("div",{ref:u,className:"relative z-[2] h-full w-full box-border pr-0.5 text-xs text-foreground opacity-50",style:{cursor:w?"ns-resize":"auto",pointerEvents:o?"none":"auto"},onMouseDown:M,onMouseUp:C,onMouseLeave:C,onMouseMove:F,onDoubleClick:()=>{let{realRange:t}=range2realRange({range:a,unit:c,step:l,globalID:r}),n=getAxisYDoubleClickResetRange(s,t);e.setAxisY?.({realRange:n}),e.onChange?.()},children:[/*#__PURE__*/_jsx(Tooltip,{content:"滑动鼠标滚轮以改变边界范围",duration:1500,children:/*#__PURE__*/_jsx("div",{className:cn("absolute left-0 top-0 z-[3] max-h-20 min-h-[30%] w-full cursor-pointer opacity-0 transition-opacity hover:opacity-30"),style:{pointerEvents:w?"none":"auto",background:"linear-gradient(to bottom, var(--chart-highlight), transparent)"},onWheel:e=>D(e,!0)})}),/*#__PURE__*/_jsx(Tooltip,{content:"滑动鼠标滚轮以改变边界范围",duration:1500,children:/*#__PURE__*/_jsx("div",{className:cn("absolute bottom-0 left-0 z-[3] max-h-20 min-h-[30%] w-full cursor-pointer opacity-0 transition-opacity hover:opacity-30"),style:{pointerEvents:w?"none":"auto",background:"linear-gradient(to top, var(--chart-highlight), transparent)"},onWheel:e=>D(e,!1)})}),/*#__PURE__*/_jsxs("div",{className:"absolute z-[2] flex w-full flex-col justify-center box-border pr-2 [&>div]:flex [&>div]:flex-1 [&>div]:items-center [&>div]:justify-center [&>div]:overflow-hidden [&>div>span]:w-full [&>div>span]:text-right",style:y,title:`${o?"范围控制已全自动":"按住鼠标左键上下拖动\n在边界滚动鼠标滚轮以改变视觉范围"}
|
|
3724
|
-
双击回到默认范围${a}`,children:[v,/*#__PURE__*/_jsx(RulerTicks,{orientation:"vertical",length:2*g,split:2})]})]})},yI=null,yP=()=>{let{state:{axisY:e,globalID:t},dispatch:n}=ae(),{autoranging:a,onChange:i}=e,o=u(()=>{let t=!a;i?.({autoranging:t}),n({payload:{axisY:{...e,autoranging:t}}})},[e,a,i,n]);return /*#__PURE__*/r(vd,{active:a,tone:"primary",title:"自动范围",onClick:()=>{nj(t)()},onDoubleClick:()=>{o()},children:/*#__PURE__*/r("span",{children:"A"})})},yL=/*#__PURE__*/a.memo(yP),yO=()=>{let{state:{axisY:e,globalID:t},dispatch:r}=useStore(),{step:n,onChange:a}=e,i=useCallback(()=>{let t=nextItem(n,stepList);a?.({step:t}),r({payload:{axisY:{...e,step:t}}})},[n,e,a,r]);return useEffect(()=>{t&&subscriptionKeyBus(t,"step",e=>{e?.code==="KeyS"&&i()})},[i,t]),/*#__PURE__*/_jsxs(IconBox,{onClick:i,title:"步进",children:[n,"/div"]})},yq=/*#__PURE__*/null,y$=(e,t)=>{if(void 0===e||void 0===t||0===t.length)return e;let r=e,n=t.indexOf(r);return -1===n||n===t.length-1?[r]=t:r=t[n+1],r},y_=(e,t)=>e?t?e:e.filter(e=>!e.includes("/m")):[];function yj(e,t,r){let n=t.indexOf(e);if(-1===n)return null;let a=n>0?t[n-1]:t.at(0),i=n<t.length-1?t[n+1]:t.at(-1);return r<0?a:i}let yH=()=>{let e=at(e=>e.axisY),t=at(e=>e.globalID),n=an(),{unit:a,unitList:i,unitDisabled:o,autoranging:l,fieldStrengthUnitAvailable:s,onChange:c}=e,d=l||o,p=u(()=>{if(d)return;let t=y$(a,y_(i,s));t!==a&&(c?.({unit:t}),n({payload:{axisY:{...e,unit:t}}}))},[e,a,d,i,s,c,n]);return h(()=>{t&&nP(t,"unit",e=>{e?.code==="KeyU"&&p()})},[p,t]),/*#__PURE__*/r(vd,{onClick:p,title:"单位",disabled:d,children:a})},yB=/*#__PURE__*/a.memo(yH),yW=e=>{let{chart:t}=e,{state:{axisY:r}}=useStore(),{show:n}=r,a=useRanging({chart:t}),{axisYWidth:i,marginLeft:o}=useAxisYWidth();return!1===n?null:/*#__PURE__*/_jsx("div",{className:"relative flex h-full justify-end",style:{width:i,marginLeft:o},children:/*#__PURE__*/_jsx(TicksPanel,{ranging:a})})},yG=null,yY={UPDATED:"series:updated",ADDED:"series:added",REMOVED:"series:removed",MODE_CHANGED:"series:mode-changed",TYPE_OVERRIDE_CHANGED:"series:type-override-changed",BATCH_UPDATED:"series:batch-updated",RESET:"series:reset"};class yU{listeners=new Map;on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set);let r=this.listeners.get(e);if(!r)throw Error(`Failed to get event listeners for ${e}`);return r.add(t),()=>{r.delete(t),0===r.size&&this.listeners.delete(e)}}emit(e,t){let r=this.listeners.get(e);r&&r.forEach(r=>{try{r(t)}catch(t){console.error(`Error in event listener for ${e}:`,t)}})}removeAllListeners(e){e?this.listeners.delete(e):this.listeners.clear()}getListenerCount(e){return this.listeners.get(e)?.size||0}}let yX=new yU,yK={on:yX.on.bind(yX),emit:yX.emit.bind(yX),removeAllListeners:yX.removeAllListeners.bind(yX),getListenerCount:yX.getListenerCount.bind(yX)};function yV(e,t,r){return yK.on(t,t=>{t.globalID===e&&r(t)})}function yQ(e,t){yK.emit(e,t)}var yZ=/*#__PURE__*/function(e){return e.Line="line",e.StepLine="stepline",e.Bar="bar",e.Area="area",e}({});let yJ={line:{name:"line",label:"线图",icon:"line",realData:M.Line,minData:M.Line,maxData:M.Line,avgData:M.Line},stepline:{name:"stepline",label:"阶梯线图",icon:"stepline",realData:M.Stepline,minData:M.Stepline,maxData:M.Stepline,avgData:M.Stepline},bar:{name:"bar",label:"柱状图",icon:"bar",realData:M.Bar,minData:M.Line,maxData:M.Line,avgData:M.Line},area:{name:"area",label:"面积图",icon:"area",realData:M.Area,minData:M.Stepline,maxData:M.Stepline,avgData:M.Stepline}},y0=new Map;function y1(e){return y0.get(e)||"line"}function y2(e){let t=Object.values(yZ),r=(t.indexOf(e)+1)%t.length;return t[r]}function y5(e,t){y0.set(e,t);let r=yJ[t];yQ(yY.MODE_CHANGED,{globalID:e,mode:t,config:r})}function y4(e,t){let r=y2(t||y1(e));y5(e,r)}function y3(e){y0.delete(e)}function y6(e){let{globalID:t}=e.state;if(!t)return console.warn("[Series] globalID is required for series subscription"),null;let r=[];return r.push(yV(t,yY.UPDATED,r=>{let n=wt(t,r.seriesName),a={...r.config,type:n};e.setSeries(a,!0),e.state.chart?.draw()})),r.push(yV(t,yY.MODE_CHANGED,()=>{e.initSeries()})),r.push(yV(t,yY.TYPE_OVERRIDE_CHANGED,()=>{e.initSeries()})),r.push(yV(t,yY.BATCH_UPDATED,r=>{r.configs.forEach(r=>{let n=wt(t,r.name),a={...r,type:n};e.setSeries(a,!0)}),e.state.chart?.draw()})),r.push(yV(t,yY.RESET,()=>{e.state.series&&(e.state.series={}),e.initSeries()})),()=>{for(let e of r)e()}}let y8=new Map;function y9(e,t,r){y8.has(e)||y8.set(e,new Map),y8.get(e)?.set(t,r),yQ(yY.TYPE_OVERRIDE_CHANGED,{globalID:e,seriesName:t,type:r})}function y7(e){let t=y8.has(e);y8.delete(e),t&&yQ(yY.TYPE_OVERRIDE_CHANGED,{globalID:e})}function we(e,t){return y8.get(e)?.get(t)}function wt(e,t){let r=y8.get(e)?.get(t);if(r)return r;if("templateData"===t)return M.Area;let n=yJ[y1(e)][t];return n&&"string"==typeof n?n:M.Line}let wr=new Map;function wn(){return Object.values(t0("line")).map(e=>({name:e.name,label:e.label,color:e.color,thickness:e.thickness,display:e.display,type:M.Line}))}function wa(e){return{name:e.name,label:e.label,color:e.color,display:e.display,type:e.type,thickness:e.thickness}}function wi(e){if(!e)throw Error("globalID 不能为空");if(!wr.has(e)){let t=new L([]);wn().forEach(e=>{t.addSeries(wa(e))}),wr.set(e,t),n6(e)?.registerCleanup(()=>{wo(e)})}let t=wr.get(e);if(!t)throw Error(`SeriesManager for globalID "${e}" not found`);return t}function wo(e){let t=wr.get(e);t&&(t.clear(),wr.delete(e)),y3(e),y8.delete(e)}function wl(e){return wr.has(e)}function ws(e){let t=wi(e).getAllSeries(),r=new Map;return Array.isArray(t)&&t.forEach(e=>{r.set(e.name,{name:e.name,label:e.label||"",color:e.color,display:void 0===e.display||e.display,type:e.type||M.Line,thickness:e.thickness||1})}),r}function wc(e,t){let r=t0("line")[e.name],n={label:r?.label??"",color:r?.color,display:r?.display??!0,type:M.Line,thickness:r?.thickness??1};return{name:e.name,label:e.label??t?.label??n.label,color:e.color??t?.color??n.color??(()=>{throw Error(`Series "${e.name}" does not exist and must have a color defined`)})(),display:e.display??t?.display??n.display,type:e.type??t?.type??n.type,thickness:e.thickness??t?.thickness??n.thickness}}function wu(e,t,r){r?(e.setSeriesProperty(t.name,"label",t.label),e.setSeriesProperty(t.name,"color",t.color),e.setSeriesProperty(t.name,"thickness",t.thickness),e.setSeriesProperty(t.name,"display",t.display),e.setSeriesProperty(t.name,"type",t.type)):e.addSeries(wa(t))}function wd(e,t){if(!t?.name)return;let r=wi(e),n=r.getSeries(t.name),a=wc(t,n);wu(r,a,n),yQ(yY.UPDATED,{globalID:e,seriesName:t.name,config:{name:a.name,label:a.label,color:a.color,thickness:a.thickness,display:a.display,type:a.type}})}function wh(e){let t=wi(e);t.clear(),wn().forEach(e=>{t.addSeries(wa(e))}),yQ(yY.RESET,{globalID:e})}function wp(e,t){let r=wi(e),n=[];t.forEach(e=>{if(!e?.name)return;let t=r.getSeries(e.name),a=wc(e,t);wu(r,a,t),n.push({name:a.name,label:a.label,color:a.color,thickness:a.thickness,display:a.display,type:a.type})}),n.length>0&&yQ(yY.BATCH_UPDATED,{globalID:e,configs:n})}function wf(e){let t=ws(e),r=new Map;return t.forEach(t=>{let n={...t,type:wt(e,t.name)};r.set(t.name,n)}),r}let wm="singleFrequency",wg=new Set([wm,"scan","mscan"]),wb=({heatmapElementID:e,type:t})=>!!e&&wg.has(t??wm),wv=(e,t)=>{let[r,n]=t,a=e.range??ns,i=e.realRange??ns,o=e.renderRange??ns,l=a[0]!==r||a[1]!==n,s=i[0]!==r||i[1]!==n,c=o[0]!==r||o[1]!==n;return l||s||c?{...e,range:t,realRange:t,renderRange:t}:e};function wy({type:e,heatmapElementID:t}){let{state:{axisY:r,limit:n,signal:a,marker:i,cursor:o,frequencyAllocation:l,zoom:s,globalID:c},dispatch:u}=ae();return h(()=>{c&&(y7(c),e===rt.MScan&&y9(c,t3,M.Bar),e===rt.ScanDF360&&(y9(c,t3,M.Rect),t$(c)(!0)))},[e,c]),h(()=>{let t=r,c=n,d=a,h=i,p=o,f=l,m=s;if(e===rt.DDC&&(!1!==c.show&&(c={...c,show:!1}),!0!==h.visible&&(h={...h,visible:!0})),e===rt.Lite&&(!1!==c.show&&(c={...c,show:!1}),!1!==h.enabled&&(h={...h,enabled:!1})),e===rt.LiteNormalized){let e=t.restrict??[0,1];!1!==c.show&&(c={...c,show:!1}),!1!==d.show&&(d={...d,show:!1}),(0!==e[0]||1!==e[1])&&(t={...t,restrict:[0,1]}),!1!==f.show&&(f={...f,show:!1})}if(e===rt.MScan&&(!1!==h.enabled&&(h={...h,enabled:!1}),!1!==f.show&&(f={...f,show:!1})),e===rt.ScanDF360){let e=t.restrict??[0,360];!1!==c.show&&(c={...c,show:!1}),!1!==d.show&&(d={...d,show:!1}),!1!==h.enabled&&(h={...h,enabled:!1}),!1!==m.show&&(m={...m,show:!1}),!1!==p.show&&(p={...p,show:!1}),!1!==f.show&&(f={...f,show:!1}),t="°"!==t.unit||36!==t.step||0!==e[0]||360!==e[1]?{...wv(t,[0,360]),unit:"°",restrict:[0,360],step:36}:wv(t,[0,360])}let g={};c!==n&&(g.limit=c),d!==a&&(g.signal=d),h!==i&&(g.marker=h),p!==o&&(g.cursor=p),f!==l&&(g.frequencyAllocation=f),m!==s&&(g.zoom=m),t!==r&&(g.axisY=t),Object.keys(g).length>0&&u({payload:g})},[r,o,u,l,n,i,a,e,s]),h(()=>{if(e===rt.LiteNormalized&&c){let e=r.range??ns;if(e[0]<0||e[1]>1){let e=wv(r,[0,1]);u({payload:{axisY:e}}),nW(c)(e.range??[0,1])}}},[r,u,c,e]),m(()=>{let r=!1,n=wb({heatmapElementID:t,type:e});return(e===rt.SingleFrequency||e===rt.Scan||e===rt.MScan)&&(r=!0),{enableMetrics:r,enableWaterfall:n}},[e,t])}function ww(){let{state:{marker:e,globalID:t},dispatch:r}=ae();return h(()=>{e?.mode===nt.DDC&&r({payload:{marker:{...e,enabled:!0,visible:!0}}})},[e?.mode]),u(()=>{},[t])}function wx(){let e=an();return u(t=>{if(t?.length){let r=rx(t);e({payload:e=>({points:t,axisX:{...e.axisX,frequencyFormat:e=>String(r(e)??"")}})})}},[e])}function wk(){let e=at(e=>e.segments),t=an();return[e,u(e=>{if(e.totalPoints){let r=e.totalPoints-1;t({payload:t=>({segments:e,zoom:{...t.zoom,interval:{start:0,end:r}},axisX:0===t.points.length?{...t.axisX,frequencyFormat:ry(e)}:t.axisX})})}},[t])]}let wS=(e,t)=>tC(`SET_SEGMENTS_DISPLAY-${e}`,"0",t,e);function wM(e){let t=at(e=>e.globalID),r=an(),[,n]=wk(),a=u(e=>{let{event:t=ri.Cover,index:a}=e;r({payload:e=>{let{segments:r,zoom:n}=e,{totalPoints:i}=r,o=0,l=0,s=!1;if(t===ri.Focus&&i)if("number"==typeof a&&a<r.length){for(let e=0;e<a;e+=1)o+=r[e].point+1;let{point:e}=r[a];l=o+e,s=!0}else void 0===a&&(o=0,l=i-1,s=!1);return n.interval.start===o&&n.interval.end===l&&n.isScanSegmentsUpdateMagnify===s?null:{zoom:{...n,interval:{start:o,end:l},isScanSegmentsUpdateMagnify:s}}}}),t===ri.Cover&&e.data&&n(rC(e.data))},[r,n]);h(()=>{if(t)return wS(t,e=>{a?.({pstype:rn.Segments,event:ri.Focus,index:e})})},[t,a]);let i=g(3),o=g({frequency:0,bandwidth:0}),l=u((e,t=o.current)=>{if(t.bandwidth&&t.frequency&&e){let r=rS({frequency:t?.frequency,bandwidth:t?.bandwidth,totalPoints:e});"function"==typeof n&&n(r)}},[n]),s=u(e=>{let{frequency:t,bandwidth:r}=e;if(!t||!r)return;let n=o.current;(n.frequency!==t||n.bandwidth!==r)&&(o.current={frequency:t,bandwidth:r},l(i.current,e))},[l]),c=u(t=>{if(!t)return;let r=t?.length;r&&r!==i.current&&(i.current=r,l(r),e===rt.LiteNormalized&&n(rM(r)))},[l,n,e]);return ww(),u(e=>{switch(e.pstype){case rn.Spectrum:e.data&&c(e.data);break;case rn.SpectrumBandwidth:s(e);break;case rn.Segments:a?.(e)}},[c,s,a])}function wC(e){let{dispatch:t}=ae(),r=g(!1);h(()=>{if(!e){r.current=!1;return}r.current||(r.current=!0,t({payload:e=>({limit:{...e.limit,show:!1},marker:{...e.marker,enabled:!1,visible:!1},frequencyAllocation:{...e.frequencyAllocation,show:!1},toolbar:{...e.toolbar,show:!1}})}))},[e,t])}let wF="AxisYHeatmapTicks",wD=e=>"string"==typeof e?e.slice(-8):"",wz=10,wN=e=>{let{id:t}=e,{state:{globalID:n}}=ae(),[a,i]=b(Array(10).fill("")),o=m(()=>{let e=[];for(let t=0;t<10;t++)e.push(`${100-t/9*100}%`);return e},[]);return h(()=>{t&&n&&tq(t,"AxisYHeatmapTicks",()=>{let e=tj(n)?.getSnapshot().data,t=e?void 0:t_(n)?.getWaterfallTimestamps(10),r=[];if(t?.length===10)for(let e of t)r.push(wD(e));else{let t=e??tO(n).getAllRawData().waterfallData??[],a=t.length;for(let e=0;e<10;e++){let n=Math.floor((a-1)*e/9);r.push(wD(t[n]?.timestamp))}}i(e=>e.length===r.length&&r.every((t,r)=>t===e[r])?e:r)})},[t,n]),/*#__PURE__*/r("div",{className:"relative z-[2] flex h-full w-full flex-col items-end justify-between pr-1 text-xs text-foreground opacity-50",children:o.map((e,t)=>/*#__PURE__*/r("div",{className:iX("absolute right-0 flex max-w-full origin-right scale-x-[0.85] items-center justify-end whitespace-nowrap text-right text-[9px] leading-none [font-variant-numeric:tabular-nums]",0===t&&"-translate-y-full",t===o.length-1&&"translate-y-0",t>0&&t<o.length-1&&"-translate-y-1/2"),style:{top:e},children:a[t]},`tick-${e}`))})},wE=/*#__PURE__*/a.memo(wN),wT=e=>{let{axisYWidth:t,marginLeft:n}=yn();return /*#__PURE__*/r("div",{className:"relative flex h-full w-auto justify-between overflow-hidden",style:{width:t,marginLeft:n},children:/*#__PURE__*/r(wE,{...e})})},wR=wT,wA=t2(),wI=()=>{let{state:{axisY:{range:e}}}=useStore(),[t,r]=e;return /*#__PURE__*/_jsxs("div",{className:"relative flex h-full w-4 select-none flex-col",children:[/*#__PURE__*/_jsxs("div",{className:"absolute top-0 flex h-full w-full flex-col justify-between",children:[/*#__PURE__*/_jsx("div",{className:"flex w-full items-center justify-center text-[9px] text-white",children:r.toFixed()}),/*#__PURE__*/_jsx("div",{className:"flex w-full items-center justify-center text-[9px] text-white",children:t.toFixed()})]}),wA.map((e,t)=>t===wA.length-1?null:/*#__PURE__*/_jsx("span",{className:"w-full flex-1",style:{background:`linear-gradient(to bottom,${e},${wA[t+1]})`}},e))]})},wP=null,wL=e=>{let{chart:t}=e,{state:{axisY:n}}=ae(),{linkage:a,renderRange:i,show:o}=n;return(h(()=>{a&&i&&t?.setRange?.(i)},[i]),!1===o)?null:/*#__PURE__*/r(wT,{...e})},wO=wL,wq=(e,t)=>openData(`CURSOR_TIMEOUT-${e}`,t,null,e),w$=(e,t)=>tC(`CURSOR_SETACTIVE-${e}`,"0",t,e);function w_({coord:e,zoom:t,segments:r}){let{left:n}=e,{start:a,end:i}=t.interval,{totalPoints:o}=r;return(Math.min(Math.round(Math.max(0,Math.min(100,n))/100*(o-1)),o-1)-a)*100/(i-a+1)}function wj({visualLeft:e,zoom:t,segments:r}){let{start:n,end:a}=t.interval,{totalPoints:i}=r,o=Math.round((a-n+1)*Math.max(0,Math.min(100,e))/100);return 100*Math.min(n+o,i-1)/(i-1)}let wH=e=>"function"==typeof e?.getBoundingClientRect,wB=e=>{let{clientX:t=0,clientY:r=0}=e,n=e.currentTarget??e.target,{left:a,top:i,width:o,height:l}=wH(n)?n.getBoundingClientRect():{height:0,left:0,top:0,width:0};return o<=0||l<=0?{left:0,top:0}:{left:(t-a)/o*100,top:(r-i)/l*100}};function wW(e){return`EVENTBUS-${e}`}function wG(e,t){let r=e;return t&&(r=wW(e)),r}let wY=(e,t,r)=>tC(`${wG(e,r)}-createMoveEventManager`,t,r,e),wU=(e,t,r)=>tC(`${wG(e,r)}-createMouseDownEventManager`,t,r,e),wX=(e,t,r)=>tF(`${wG(e,r)}-createDoubleClickEventManager`,w3,t,r,e),wK=(e,t,r)=>tC(`${wG(e,r)}-mouse-up`,t,r,e),wV=(e,t,r)=>tC(`${wG(e,r)}-mouse-leave`,t,r,e),wQ=(e,t,r)=>tC(`${wG(e,r)}-mouse-enter`,t,r,e),wZ=(e,t,r)=>tC(`${wG(e,r)}-wheel`,t,r,e),wJ=(e,t,r)=>tC(`${wG(e,r)}-drag`,t,r,e),w0=(e,t,r)=>createSubscriptionManager(`${wG(e,r)}-zoom`,t,r,e),w1=(e,t,r)=>tC(`${wG(e,r)}-long-press`,t,r,e),w2=e=>wB(e),w5="void",w4={[w5]:0,[rl.EventBus]:1,[rl.Signal]:1,[rl.Zoom]:2,[rl.DragFrame]:2,[rl.HeatmapCapture]:3,[rl.Markers]:3,[rl.Limit]:3,[rl.Stripe]:4,[rl.FrequencyTagLine]:5},w3=e=>w4[e]??0,w6={[rl.Markers]:"all-scroll",[rl.Stripe]:"col-resize",[rl.FrequencyTagLine]:"col-resize",[rl.Limit]:"n-resize",[rl.Frame]:"w-resize",[rl.Zoom]:"all-scroll",[rl.Area]:"crosshair"},w8=(e,t)=>tS(`event-level-${e}`,t,w5,e),w9=(e,t)=>tS(`event-type-${e}`,t,"",e);function w7(e,t,r){w9(e,r);let n=w4[w8(e)];return w4[t]>=n&&(w8(e,t),!0)}function xe(e){return w6[w8(e)]??"default"}function xt(e,t){let r=w8(e);t&&r===t&&w8(e,w5)}let xr="mt-1 flex items-center justify-between gap-1 text-xs text-popover-foreground",xn="inline-flex min-w-9 justify-end",xa=(e,t)=>{let[r,n]=b(0);return h(()=>{if(!t)return;let r=tq(t,`CursorPopover-${e}`,()=>{n(e=>e+1)});return()=>{"function"==typeof r&&r()}},[t,e]),r},xi=({frequency:e,unit:t})=>e?/*#__PURE__*/n("div",{className:"text-[14px] font-medium text-popover-foreground",children:[e,t]}):null,xo=e=>{let t=u(t=>e?b6.subscribeSample(e,()=>{t()}):()=>{},[e]),r=u(()=>e?b6.getSample(e):null,[e]);return v(t,r,r)};function xl(e,t={}){let{subscribeToMode:r=!0,subscribeToData:n=!0,watchSeries:a}=t,[i,o]=b(0),[l,s]=b(()=>e?y1(e):"line"),c=u(()=>{o(e=>e+1)},[]),d=m(()=>e?ws(e):new Map,[e,i]),p=u(t=>{e&&wd(e,t)},[e]),f=u(e=>d.get(e),[d]);return h(()=>{if(!e)return;let t=[];if(r){s(y1(e));let r=yV(e,yY.MODE_CHANGED,e=>{s(e.mode)});t.push(r)}if(n){let r=yV(e,yY.UPDATED,e=>{(!a||a.includes(e.seriesName))&&c()});t.push(r);let n=yV(e,yY.ADDED,e=>{(!a||a.includes(e.seriesName))&&c()});t.push(n);let i=yV(e,yY.REMOVED,e=>{(!a||a.includes(e.seriesName))&&c()});t.push(i);let o=yV(e,yY.BATCH_UPDATED,()=>{c()});t.push(o);let l=yV(e,yY.RESET,()=>{c()});t.push(l)}return()=>{for(let e of t)e()}},[e,r,n,a,c]),{series:d,mode:l,updateSeries:p,forceUpdate:c,getSeries:f}}function xs(e){return xl(e,{subscribeToMode:!0,subscribeToData:!0})}let xc=Object.values(t0("line")).map(e=>e.name);function xu(e){return[...xc.filter(t=>e.includes(t)),...e.filter(e=>!xc.includes(e))]}function xd(e,t){let{series:r}=xl(e),n=at(e=>e.series.legendExternal);return m(()=>{let e=Array.from(r.values()).filter(e=>!n.includes(e.name)&&e.name!==rc.TemplateData&&(!t||t(e))),a=new Map(xu(e.map(e=>e.name)).map((e,t)=>[e,t]));return e.sort((e,t)=>(a.get(e.name)??Number.MAX_SAFE_INTEGER)-(a.get(t.name)??Number.MAX_SAFE_INTEGER)).map((e,t)=>({...e,originalIndex:t}))},[r,n,t])}let xh=null,xp=(e,t,r)=>Math.min(r,Math.max(t,e)),xf=e=>xp(e,0,100),xm=e=>{let t=0,r=!1;for(let r of e)t=Math.max(t,r.length);if(0===t)return[];for(let n of e)if(n.length!==t){r=!0;break}return r?e.map(e=>{if(e.length===t)return e;let r=new Float32Array(t);return r.fill(0/0),r.set(e),r.timestamp=e.timestamp,r}):e},xg=(e,t)=>{if(t<=0)return -1;if(1===t)return 0;let r=xp(e,0,100);return xp(Math.ceil((100-r)*t/100)-1,0,t-1)},xb=(e,t)=>{if(t<=0)return -1;if(1===t)return 0;let r=xp(e,0,100);return xp(Math.ceil(r*t/100)-1,0,t-1)},xv=(e,t)=>{let{width:r}=t.sourceSize;if(r<=0)return 0;let[n,a]=t.range.x,i=n+(a-n)*xp(e,0,100)/100;return xp(100*i/r,0,100)},xy=(e,t)=>{let r=xg(t.top,e.rowIndices.length),n=xb(t.left,e.columnIndices.length);return r<0||n<0?null:{columnIndex:e.columnIndices[n],rowIndex:e.rowIndices[r],sourceLeft:xv(t.left,e),visibleColumnIndex:n,visibleRowIndex:r}},xw=(e,t)=>{let r=xy(e,{left:t.startLeft,top:t.startTop}),n=xy(e,{left:t.endLeft,top:t.endTop});return r&&n?{endCol:Math.max(r.columnIndex,n.columnIndex),endIndex:Math.max(r.rowIndex,n.rowIndex),startCol:Math.min(r.columnIndex,n.columnIndex),startIndex:Math.min(r.rowIndex,n.rowIndex)}:null},xx=(e,t)=>e.rawData.slice(t.startIndex,t.endIndex+1).map(e=>Array.from(e.slice(t.startCol,t.endCol+1))),xk=(e,t)=>xS(e,{x:[Math.min(t.startCol,t.endCol),Math.max(t.startCol,t.endCol)+1],y:[Math.min(t.startIndex,t.endIndex),Math.max(t.startIndex,t.endIndex)+1]}),xS=(e,t)=>{let[r,n]=e.range.x,[a,i]=e.range.y,o=n-r,l=i-a;if(o<=0||l<=0)return null;let s=Math.min(t.x[0],t.x[1]),c=Math.max(t.x[0],t.x[1]),u=Math.min(t.y[0],t.y[1]),d=Math.max(t.y[0],t.y[1]);return{leftPosition:(s-r)*100/o,width:(c-s)*100/o,position:100-(d-a)*100/l,height:(d-u)*100/l}},xM=1e-7,xC=(e,t)=>{let{sourceSize:r}=e,[n,a]=e.range.x,[i,o]=e.range.y,l=a-n,s=o-i;if(r.width<=0||r.height<=0||l<=0||s<=0)return null;let c=xp(n+Math.min(t.startLeft,t.endLeft)*l/100,0,r.width),u=xp(n+Math.max(t.startLeft,t.endLeft)*l/100,0,r.width),d=i+(100-t.startTop)*s/100,h=i+(100-t.endTop)*s/100;return{x:[c,u],y:[xp(Math.min(d,h),0,r.height),xp(Math.max(d,h),0,r.height)]}},xF=(e,t)=>{let r=xC(e,t);return r?xD(e,r):null},xD=(e,t)=>{let{sourceSize:r}=e;if(r.width<=0||r.height<=0)return null;let[n,a]=t.x,[i,o]=t.y,l=xp(Math.floor(n+1e-7),0,r.width-1),s=xp(Math.max(l,Math.ceil(a-1e-7)-1),l,r.width-1),c=xp(Math.floor(i+1e-7),0,r.height-1);return{endCol:s,endIndex:xp(Math.max(c,Math.ceil(o-1e-7)-1),c,r.height-1),startCol:l,startIndex:c}},xz=(e,t,r,n)=>{let a=xp(Math.round(e[0]+(e[1]-e[0])*n-r*n),0,t-r);return[a,a+r]},xN=(e,t,r)=>{let{sourceSize:n}=e,a=e.range.x[1]-e.range.x[0],i=e.range.y[1]-e.range.y[0],o=t>0?.5:2,l=Math.min(10,n.width),s=Math.min(2,n.height),c=xp(Math.round(a*o),l,n.width),u=xp(Math.round(i*o),s,n.height);return{x:xz(e.range.x,n.width,c,xp(r.left,0,100)/100),y:xz(e.range.y,n.height,u,(100-xp(r.top,0,100))/100)}},xE=(e,t,r)=>{let n=e[1]-e[0],a=xp(e[0]+r,0,t-n);return[a,a+n]},xT=(e,t,r)=>{let n=e[1]-e[0],a=xp(Math.round(r-n/2),0,t-n);return[a,a+n]},xR=(e,t)=>({x:xp(t.left,0,1)*e.sourceSize.width,y:(1-xp(t.top,0,1))*e.sourceSize.height}),xA=e=>{let{range:t,sourceSize:r}=e;return r.width<=0||r.height<=0?{height:0,left:0,top:0,width:0}:{left:t.x[0]/r.width,top:1-t.y[1]/r.height,width:(t.x[1]-t.x[0])/r.width,height:(t.y[1]-t.y[0])/r.height}},xI=e=>({x:[Math.min(e.startCol,e.endCol),Math.max(e.startCol,e.endCol)+1],y:[Math.min(e.startIndex,e.endIndex),Math.max(e.startIndex,e.endIndex)+1]}),xP=(e,t)=>{let{sourceSize:r}=e;if(r.width<=0||r.height<=0)return{height:0,left:0,top:0,width:0};let n=xp(Math.min(t.x[0],t.x[1]),0,r.width),a=xp(Math.max(t.x[0],t.x[1]),n,r.width),i=xp(Math.min(t.y[0],t.y[1]),0,r.height),o=xp(Math.max(t.y[0],t.y[1]),i,r.height);return{left:n/r.width,top:1-o/r.height,width:(a-n)/r.width,height:(o-i)/r.height}},xL=(e,t)=>xP(e,xI(t)),xO=(e,t)=>Math.min(t.x[0],t.x[1])<e.range.x[1]&&Math.max(t.x[0],t.x[1])>e.range.x[0]&&Math.min(t.y[0],t.y[1])<e.range.y[1]&&Math.max(t.y[0],t.y[1])>e.range.y[0],xq=(e,t)=>xO(e,xI(t)),x$=(e,t,r={x:0,y:0})=>t.x>=Math.min(e.x[0],e.x[1])-r.x&&t.x<=Math.max(e.x[0],e.x[1])+r.x&&t.y>=Math.min(e.y[0],e.y[1])-r.y&&t.y<=Math.max(e.y[0],e.y[1])+r.y,x_=(e,t,r={x:0,y:0})=>x$(xI(e),t,r),xj=e=>{let{range:t,sourceSize:r}=e;return r.width<=0||r.height<=0||0===t.x[0]&&t.x[1]===r.width&&0===t.y[0]&&t.y[1]===r.height},xH=(e,t)=>{let r=xR(e,t);return{x:xT(e.range.x,e.sourceSize.width,r.x),y:xT(e.range.y,e.sourceSize.height,r.y)}},xB=(e,t)=>({x:xT(e.range.x,e.sourceSize.width,(Math.min(t.x[0],t.x[1])+Math.max(t.x[0],t.x[1]))/2),y:xT(e.range.y,e.sourceSize.height,(Math.min(t.y[0],t.y[1])+Math.max(t.y[0],t.y[1]))/2)}),xW=(e,t)=>xB(e,xI(t)),xG=(e,t,r)=>{let n=xR(e,t),a=e.range.x[1]-e.range.x[0],i=e.range.y[1]-e.range.y[0],o=xp(Math.round(n.x-r.x),0,e.sourceSize.width-a),l=xp(Math.round(n.y-r.y),0,e.sourceSize.height-i);return{x:[o,o+a],y:[l,l+i]}},xY=(e,t)=>t.x>=e.range.x[0]&&t.x<=e.range.x[1]&&t.y>=e.range.y[0]&&t.y<=e.range.y[1],xU=(e,t)=>{let r=e.range.x[1]-e.range.x[0],n=e.range.y[1]-e.range.y[0];return{x:xE(e.range.x,e.sourceSize.width,-Math.round(t.left*r)),y:xE(e.range.y,e.sourceSize.height,Math.round(t.top*n))}},xX=(e,t,r)=>xU(e,{left:(r.left-t.left)/100,top:(r.top-t.top)/100}),xK=e=>({x:e.x,y:e.y,outputWidth:e.x[1]-e.x[0],outputHeight:e.y[1]-e.y[0]}),xV=(e,t)=>e.range.x[0]===t.x[0]&&e.range.x[1]===t.x[1]&&e.range.y[0]===t.y[0]&&e.range.y[1]===t.y[1],xQ=(e,t,r)=>{let[n,a]=e.range.y,i=a-n;if(i<=0||r<n||t>=a)return null;let o=xp(t,n,a-1),l=100-(xp(r,n,a-1)+1-n)*100/i;return{height:100-(o-n)*100/i-l,top:l}},xZ=e=>Math.max(0,Math.min(100,e)),xJ=(e,t)=>({end:Math.max(e,t),start:Math.min(e,t)}),x0=e=>e.reduce((e,t)=>Math.max(e,t?.length??0),0),x1=e=>({columnCount:x0(e),rowCount:e.length}),x2=(e,t)=>t<=0?-1:1===t?0:Math.max(0,Math.min(t-1,Math.ceil((100-xZ(e))*t/100)-1)),x5=(e,t)=>t<=0?-1:1===t?0:Math.max(0,Math.min(t-1,Math.ceil(xZ(e)*t/100)-1)),x4=(e,t,r)=>{let n=x2(e,r),a=x2(t,r);if(n<0||a<0)return null;let{end:i,start:o}=xJ(n,a);return{endIndex:i,startIndex:o}},x3=(e,t,r)=>{let n=x5(e,r),a=x5(t,r);if(n<0||a<0)return null;let{end:i,start:o}=xJ(n,a);return{endCol:i,startCol:o}},x6=(e,t)=>{let{columnCount:r,rowCount:n}=x1(e);if(0===n||0===r)return null;let a=x4(t.startTop,t.endTop,n),i=x3(t.startLeft,t.endLeft,r);return a&&i?{...a,...i}:null},x8=(e,t)=>{let{columnCount:r,rowCount:n}=x1(e);if(0===n||0===r)return[];let a=Math.max(0,Math.min(n-1,t.startIndex)),i=Math.max(a,Math.min(n-1,t.endIndex)),o=Math.max(0,Math.min(r-1,t.startCol)),l=Math.max(o,Math.min(r-1,t.endCol));return e.slice(a,i+1).map(e=>{let t=[];for(let r=o;r<=l;r+=1){let n=e?.[r];t.push("number"==typeof n&&Number.isFinite(n)?n:0/0)}return t})},x9=(e,t)=>{let{columnCount:r,rowCount:n}=x1(e);if(0===n||0===r)return null;let a=x2(t.top,n),i=x5(t.left,r);if(a<0||i<0)return null;let o=e[a],l=o?.[i],s="number"==typeof l&&Number.isFinite(l)?l:null;return{columnIndex:i,rowIndex:a,timestamp:o?.timestamp?String(o.timestamp):"",value:s}},x7=(e,t)=>{let r=xy(e,t);if(!r)return null;let n=e.data[r.visibleRowIndex],a=n?.[r.visibleColumnIndex],i="number"==typeof a&&Number.isFinite(a)?a:null;return{columnIndex:r.columnIndex,rowIndex:r.rowIndex,timestamp:n?.timestamp?String(n.timestamp):"",value:i}},ke=(e,t)=>xw(e,t),kt=(e,t)=>xx(e,t),kr=(e,t)=>{let r=xm(t),n=e.getSnapshot(),a=n.sourceSize.width,i=r[0]?.length??0;return a>0&&i>0&&a!==i&&(0!==n.range.x[0]||n.range.x[1]!==a)&&e.updateSamplingRange(xK({x:[0,a],y:n.range.y})),e.setData(r)},kn=e=>{let t=tj(e)?.getSnapshot();return t?.sourceSize.width&&t.sourceSize.height?t:null},ka=e=>{let t=tj(e),r=t?.getSnapshot();if(!t||!r?.sourceSize.width||!r.sourceSize.height)return!1;let n={x:[0,r.sourceSize.width],y:[0,r.sourceSize.height]};return xV(r,n)||t.updateSamplingRange(xK(n)),!0},ki=({id:e})=>{let t=at(e=>e.axisX.frequencyFormat),a=at(e=>e.axisX.unit??""),i=at(e=>e.globalID),o=at(e=>e.axisY.unit),l=xo(e),s=l?.coord.left,c=l?.coord.top,u=xa("HeatmapPopover",e),[d,p]=b(""),[f,g]=b(""),{getSeries:v}=xs(i);h(()=>{if(!i||"number"!=typeof s||"number"!=typeof c||!Number.isFinite(s)||!Number.isFinite(c)){p(""),g("");return}let e=tO(i).getAllRawData(s).waterfallData;if(!e||0===e.length){p(""),g("");return}let t=kn(i),r=t?x7(t,{left:s,top:c}):x9(e,{left:s,top:c});if(!r){p(""),g("");return}p(null!==r.value&&Number.isFinite(r.value)?r.value.toFixed(1):""),g(r.timestamp)},[i,s,c,l?.version,u]);let y=m(()=>{if("number"!=typeof s)return"";let e=kn(i),r=e?xv(s,e):s;return t?.(r)??""},[i,s,t,l?.version,u]),w=m(()=>v(t3),[v]);return /*#__PURE__*/n(g9,{children:[/*#__PURE__*/r(xi,{frequency:y,unit:a}),/*#__PURE__*/r("div",{className:xr,children:/*#__PURE__*/r("span",{children:f})}),d&&w&&!1!==w.display&&/*#__PURE__*/n("div",{className:xr,style:{color:w.color},children:[/*#__PURE__*/r("span",{children:w.label}),/*#__PURE__*/n("div",{children:[/*#__PURE__*/r("span",{className:xn,children:d}),/*#__PURE__*/r("span",{children:o})]})]})]})},ko=ki,kl=({id:e})=>{let t=at(e=>e.globalID),a=at(e=>e.axisY.unit),i=xo(e),o=i?.coord.left,l=xa("LevelStreamPopover",e),[s,c]=b(""),[u,d]=b("");return h(()=>{if(!t||"number"!=typeof o||!Number.isFinite(o)){c(""),d("");return}let{levelStreamData:e}=tO(t).getAllRawData();if(!e?.spectrumData||0===e.spectrumData.length){c(""),d("");return}let r=rw(o,e.spectrumData.length),n=e.spectrumData[r];if(c("number"==typeof n&&Number.isFinite(n)?n.toFixed(1):""),e.timestampData.length>r){let t=Number(e.timestampData[r]);if(Number.isFinite(t))return void d(rX(t))}d("")},[t,o,i?.version,l]),/*#__PURE__*/n(g9,{children:[u&&/*#__PURE__*/r("div",{className:xr,children:/*#__PURE__*/r("span",{children:u})}),s&&/*#__PURE__*/n("div",{className:xr,children:[/*#__PURE__*/r("span",{children:"电平值:"}),/*#__PURE__*/n("div",{children:[/*#__PURE__*/r("span",{className:xn,children:s}),/*#__PURE__*/r("span",{children:a})]})]})]})},ks=kl,kc=({id:e})=>{let t=at(e=>e.axisX.frequencyFormat),a=at(e=>e.axisX.unit??""),i=at(e=>e.globalID),o=xo(e),l=o?.coord.left,s=m(()=>{if(!i||"number"!=typeof l||!Number.isFinite(l))return"";let e=tO(i).getAllRawData(l),{occupancyData:t}=e;if(t&&t.length>0){let r=e.cursorIndex?.globalIndex,n=e.rawData?.occupancyData,a="number"==typeof r&&Number.isFinite(r)&&n&&n.length>0?n[Math.max(0,Math.min(n.length-1,Math.floor(r)))]:void 0,i=t[rw(l,t.length)];return Number.parseFloat(Number(Number.isFinite(a)?a:i).toFixed(1))}return""},[i,l,o?.version]);return /*#__PURE__*/n(g9,{children:[/*#__PURE__*/r(xi,{frequency:m(()=>"number"==typeof l?t?.(l)??"":"",[l,t]),unit:a}),/*#__PURE__*/n("div",{className:xr,children:[/*#__PURE__*/r("span",{children:"占用度"}),/*#__PURE__*/n("div",{children:[/*#__PURE__*/r("span",{className:xn,children:s}),/*#__PURE__*/r("span",{children:"%"})]})]})]})},ku=kc;function kd(e,t){if(e.kind!==r0.Position)return rT(e);if(!t)return null;let r=e.left??50-e.width/2,n=t(Math.max(0,Math.min(100,r))),a=t(Math.max(0,Math.min(100,r+e.width))),i=Number(n),o=Number(a);return n&&a&&Number.isFinite(i)&&Number.isFinite(o)?{startFreq:i,stopFreq:o}:null}let kh=(e,t)=>{let r=t.frequencyCache,n=Math.min(t.point,r?.length??0);if(n<=0)return null;let a=Number(r?.[0]?.frequency),i=Number(r?.[n-1]?.frequency);if(!Number.isFinite(a)||!Number.isFinite(i))return null;let o=Math.min(a,i),l=Math.max(a,i),s=l-o;if(s<=0)return null;let c=Math.max(e.startFreq,o),u=Math.min(e.stopFreq,l);return u<=c?null:{left:(c-o)/s*100,width:(u-c)/s*100}};function kp(e,t){if(!e.show)return[];if(e.kind===r0.Position)return[{key:r0.Position,left:e.left??50-e.width/2,width:e.width}];let r=rT(e);if(!r||!t.length)return[];let n=t.reduce((e,t)=>e+Math.max(0,t.point),0);if(n<=0)return[];let a=[],i=0;return t.forEach((e,t)=>{let o=Math.max(0,e.point)/n*100;if(e.point>0&&e.frequencyCache?.length&&r_(r,e)){let n=kh(r,e);n&&a.push({key:`frequency-${t}`,left:i+n.left/100*o,width:n.width/100*o})}i+=o}),a}function kf(e,t,r){if(Number.isFinite(r)&&!(r<0)&&!(r>100))return kp(e,t).some(e=>e.width>0&&r>=e.left&&r<=e.left+e.width)?e:void 0}let km=({band:e,frequencyFormat:t})=>{if(!e)return null;let a=e.label?.trim(),i=[["名称",e.details?.name],["单位",e.details?.organization]];if(e.kind===r0.CenterBandwidth)i.push(["中心频率",`${rm(e.frequency)} MHz`],["带宽",`${rm(e.bandwidth,3)} kHz`]);else{let r=kd(e,t);r&&i.push(["起始频率",`${rm(r.startFreq)} MHz`],["结束频率",`${rm(r.stopFreq)} MHz`],["带宽",`${rm(1e3*Math.abs(r.stopFreq-r.startFreq),3)} kHz`])}i.push(["调制",e.details?.modulation],["备注",e.details?.remark]);let o=i.filter(([,e])=>!!e);return a||0!==o.length?/*#__PURE__*/n("div",{className:"mt-2 border-t border-border/60 pt-2 text-xs leading-5 text-foreground","data-testid":"band-info-panel",children:[a?/*#__PURE__*/r("div",{className:"mb-1 whitespace-pre-line break-words font-medium text-foreground","data-testid":"band-info-label",children:a}):null,o.length>0?/*#__PURE__*/r("div",{className:"space-y-0.5",children:o.map(([e,t])=>/*#__PURE__*/n("div",{className:"flex gap-2",children:[/*#__PURE__*/r("span",{className:"w-12 shrink-0 text-muted-foreground",children:e}),/*#__PURE__*/r("span",{className:"min-w-0 break-words",children:t})]},e))}):null]}):null},kg=/*#__PURE__*/a.memo(km),kb={LEGITIMATE:"Legitimate",UNKNOWN:"UnKnown",KNOWN:"Know",VIOLATION:"Violation",ILLEGAL:"Illegal"},kv={Legitimate:{name:"合法",color:"var(--success)",isLegitimate:!0},UnKnown:{name:"未知",color:"var(--muted-foreground)",isLegitimate:!1},Know:{name:"已知",color:"var(--primary)",isLegitimate:!0},Violation:{name:"违规",color:"var(--warning)",isLegitimate:!1},Illegal:{name:"非法",color:"var(--destructive)",isLegitimate:!1}},ky=[kb.LEGITIMATE,kb.UNKNOWN,kb.KNOWN,kb.VIOLATION,kb.ILLEGAL],kw=e=>"string"==typeof e&&ky.includes(e)?e:kb.UNKNOWN,kx=null,kk=-1,kS=0,kM=1,kC=2,kF=[-1,0,1,2],kD={[-1]:{name:"未分配",color:"var(--signal-level-unassigned)"},0:{name:"一级",color:"var(--signal-level-first)"},1:{name:"二级",color:"var(--signal-level-second)"},2:{name:"三级",color:"var(--success)"}},kz=e=>"number"==typeof e&&Number.isInteger(e)&&(-1===e||0===e||1===e||2===e)?e:-1,kN=e=>{if(e.color)return e.color;let t=kw(e.signalType);return"simple"===e.source&&t===kb.LEGITIMATE?kD[kz(e.level)].color:kv[t].color},kE=["station","simple"],kT={station:"台站库",simple:"信号库"};function kR(e){return"signalName"in e&&"orgName"in e}let kA=e=>kR(e)?"station":"simple",kI=e=>`${kA(e)}:${kw(e.signalType)}:${kz(e.level)}`;function kP(e){let t=kA(e);return e.id?`${t}:${e.id}`:kR(e)?`${t}:${e.signalName}-${e.frequency}`:null!=e.startFrequency&&null!=e.stopFrequency?`${t}:${e.startFrequency}-${e.stopFrequency}`:`${t}:${e.frequency}-${e.bandwidth}`}let kL=e=>{let t=new Set,r=new Map,n=new Map;for(let a of e){let e=kI(a),i=kA(a);t.add(e),r.set(e,(r.get(e)??0)+1);let o=n.get(e)??new Set;o.add(kN({...a,source:i})),n.set(e,o)}let a=e=>e.reduce((e,t)=>e+(r.get(t)??0),0),i=e=>{let t=n.get(e);return t?.size===1?[...t][0]:void 0},o=e=>{let t=e.map(i);if(t.some(e=>null==e))return;let r=new Set(t);return 1===r.size?[...r][0]:void 0},l=[];for(let e of kE){let n=[...t].filter(t=>t.startsWith(`${e}:`));if(0===n.length)continue;if("station"===e){l.push({source:e,label:kT[e],leafKeys:n,dataLeafKeys:n,hasData:!0,count:a(n),types:[]});continue}let s=ky.flatMap(n=>{let l=kF.map(a=>{let o=`${e}:${n}:${a}`;return{level:a,label:kD[a].name,leafKey:o,hasData:t.has(o),count:r.get(o)??0,color:i(o)}}),s=l.map(e=>e.leafKey),c=s.filter(e=>t.has(e));return 0===c.length?[]:{signalType:n,label:kv[n].name,leafKeys:s,dataLeafKeys:c,hasData:c.length>0,count:a(c),color:o(c),levels:n===kb.LEGITIMATE?l.filter(e=>e.hasData):[]}});if(0===s.length)continue;let c=s.flatMap(e=>e.leafKeys),u=c.filter(e=>t.has(e));l.push({source:e,label:kT[e],leafKeys:c,dataLeafKeys:u,hasData:!0,count:a(u),types:s})}return{sources:l}},kO=(e,t,r)=>{let n=r.filter(t=>e.has(t));if(0===n.length)return"disabled";let a=n.filter(e=>t.has(e)).length;return 0===a?"checked":a===n.length?"unchecked":"indeterminate"},kq=(e,t,r)=>{let n=new Set(e),a=t.filter(e=>r.has(e)),i=a.filter(e=>n.has(e)).length;if(a.length>0&&0===i){for(let e of t)n.add(e);return[...n]}for(let e of t)n.delete(e);return[...n]},k$=(e,t)=>{if(!t.length)return e;let r=new Set(t);return e.filter(e=>!r.has(kI(e)))},k_=1,kj=e=>(e.startFreq+e.stopFreq)/2,kH=e=>Math.abs(e.stopFreq-e.startFreq),kB=(e,t,r)=>e<t?t-e:e>r?e-r:0,kW=(e,t)=>r$(e,t)?0:Math.min(Math.abs(e-t.startFreq),Math.abs(e-t.stopFreq)),kG=(e,t,r)=>{let n=kH(t.range)-kH(r.range);if(0!==n)return n;let a=Math.abs(kj(t.range)-e)-Math.abs(kj(r.range)-e);if(0!==a)return a;let i=Number(kR(r.item))-Number(kR(t.item));return 0!==i?i:kP(t.item).localeCompare(kP(r.item))},kY=(e,t,r,n)=>{let a=kB(t,r.startIndex,r.stopIndex)-kB(t,n.startIndex,n.stopIndex);if(0!==a)return a;let i=kH(r.range)-kH(n.range);if(0!==i)return i;let o=kW(e,r.range)-kW(e,n.range);if(0!==o)return o;let l=Number(kR(n.item))-Number(kR(r.item));return 0!==l?l:kP(r.item).localeCompare(kP(n.item))};function kU(e){return{frequency:null!=e.frequency?Number(e.frequency):void 0,bandwidth:null!=e.bandwidth?Number(e.bandwidth):void 0,startFrequency:null!=e.startFrequency?Number(e.startFrequency):void 0,stopFrequency:null!=e.stopFrequency?Number(e.stopFrequency):void 0}}function kX(e,t){let{currentFrequency:r,currentPointIndex:n}=t,a=t.indexTolerance??1;if(!Number.isFinite(r)||!Number.isFinite(n)||!e.length)return;let i=e.filter(({range:e})=>r$(r,e)).sort((e,t)=>kG(r,e,t));return i.length>0?i[0]:e.filter(({startIndex:e,stopIndex:t})=>rq(n,{startIndex:e,stopIndex:t},a)).sort((e,t)=>kY(r,n,e,t))[0]}let kK=e=>null!=e.frequency?`${e.frequency}MHz`:null!=e.startFrequency&&null!=e.stopFrequency?`${e.startFrequency}-${e.stopFrequency}MHz`:void 0,kV=e=>{let t=kA(e),r=kw(e.signalType),n=kv[r].name,a=kD[kz(e.level)].name,i=kN({...e,source:t}),o=kK(e),l=null!=e.bandwidth?`带宽: ${e.bandwidth}kHz`:void 0,s=kR(e)?{name:e.signalName,organization:e.orgName,modulation:e.modulation}:e.details;return kR(e)?{color:i,tooltip:[e.signalName,o,e.orgName&&`单位: ${e.orgName}`,n&&`类型: ${n}`].filter(Boolean).join(" | ")}:{color:i,tooltip:[s?.name,kT[t],o,s?.organization&&`单位: ${s.organization}`,l,s?.modulation&&`调制: ${s.modulation}`,n&&`类型: ${n}`,r===kb.LEGITIMATE&&a&&`等级: ${a}`].filter(Boolean).join(" | ")}},kQ=(e,t)=>e.flatMap(e=>{let r=rT(kU(e));if(!r||!r_(r,t))return[];let{startIndex:n,stopIndex:a}=rP(r,t);return[{item:e,range:r,startIndex:n,stopIndex:a}]}),kZ=(e,t,r)=>{let n=t.get(e)??0,a=0===n?e:`${e}#${n+1}`;for(;r.has(a);)n+=1,a=`${e}#${n+1}`;return t.set(e,n+1),r.add(a),a},kJ=(e,t)=>{let r=new Map,n=new Set;return kQ(e,t).map(({item:e,range:a,startIndex:i,stopIndex:o})=>{let{left:l,width:s}=rP(a,t),{color:c,tooltip:u}=kV(e);return{item:e,range:a,startIndex:i,stopIndex:o,key:kZ(kP(e),r,n),position:{left:`${l}%`,width:`${s}%`},color:c,tooltip:u}})},k0=({segments:e,signalItems:t,isCursorActive:r,currentFrequency:n,currentPosition:a})=>{if(!e.length)return[];let i=e.reduce((e,t)=>e+t.point,0);return e.map((o,l)=>{let s=kJ(t,o),c=r&&a.segmentIndex===l&&Number.isFinite(n)?resolveBestSignalMatch(s,{currentFrequency:n,currentPointIndex:a.pointIndex}):void 0,u=o.point/i*100,d=e.slice(0,l).reduce((e,t)=>e+t.point/i*100,0);return{segment:o,segmentIndex:l,signalPositions:s,activeSignalKey:c?.key,style:{left:`${d}%`,width:`${u}%`}}})},k1=({segments:e,signalItems:t})=>{if(!e.length)return[];let r=e.reduce((e,t)=>e+t.point,0),n=0;return e.map((e,a)=>{let i=e.point/r*100,o={segment:e,segmentIndex:a,signalPositions:kJ(t,e),style:{left:`${n}%`,width:`${i}%`}};return n+=i,o})},k2=({segmentData:e,isCursorActive:t,currentFrequency:r,currentPosition:n})=>{if(!t||!Number.isFinite(r)||n.segmentIndex<0)return;let a=e[n.segmentIndex];if(a)return kX(a.signalPositions,{currentFrequency:r,currentPointIndex:n.pointIndex})?.key},k5=({frequency:e,signalItems:t,segments:r,currentPosition:n})=>{if(!Number.isFinite(e))return;let a=r[n.segmentIndex];if(!a)return;let i=t.filter(isStationInfo);if(!i.length)return;let o=resolveBestSignalMatch(kQ(i,a),{currentFrequency:e,currentPointIndex:n.pointIndex});return o&&isStationInfo(o.item)?o.item:void 0},k4=({frequency:e,signalItems:t,segments:r,currentPosition:n})=>{if(!Number.isFinite(e))return;let a=r[n.segmentIndex];if(a)return resolveBestSignalMatch(kQ(t,a),{currentFrequency:e,currentPointIndex:n.pointIndex})?.item},k3=({signalItems:e,segments:t})=>e.length&&t.length?t.map(t=>kQ(e,t)):[],k6=({signalItems:e,segments:t})=>{if(!e.length||!t.length)return[];let r=e.filter(isStationInfo);return r.length?t.map(e=>kQ(r,e)):[]},k8=({frequency:e,stationRangeIndex:t,currentPosition:r})=>{if(!Number.isFinite(e))return;let n=t[r.segmentIndex];if(!n?.length)return;let a=resolveBestSignalMatch(n,{currentFrequency:e,currentPointIndex:r.pointIndex});return a&&isStationInfo(a.item)?a.item:void 0},k9=({frequency:e,signalRangeIndex:t,currentPosition:r})=>{if(!Number.isFinite(e))return;let n=t[r.segmentIndex];if(n?.length)return kX(n,{currentFrequency:e,currentPointIndex:r.pointIndex})?.item},k7=(e,t,r)=>{let n=`stationData-update-${e}`;return t&&r?tC(n,t,r,e):tC(n)},Se=(e,t)=>{if(!e)return[];let r=tS(`stationData-${e}`,t,[],e);return void 0!==t&&k7(e)(r),r};function St({respectVisibility:e=!1,filterHidden:t=!0}={}){let r=at(e=>e.globalID),n=at(e=>e.signal.data),a=at(e=>e.signal.display),i=at(e=>e.signal.show),o=at(e=>e.signal.hiddenCategoryKeys),[l,s]=b(0);return h(()=>{let e=`useUnifiedSignals-${r}-${Date.now()}`,t=k7(r,e,()=>{s(e=>e+1)}),n=Se(r);return n&&n.length>0&&s(e=>e+1),()=>{"function"==typeof t&&t()}},[r]),m(()=>{if(e&&(!i||!a))return[];let l=[...Se(r),...n||[]];return t&&o?.length?k$(l,o):l},[r,n,a,i,e,t,o,l])}let Sr=({frequency:e,enabled:t=!0,cursorSample:r},n)=>{let a=at(e=>e.cursor),i=at(e=>e.segments),o=r?.coord.left??a.coord.left,l=St({respectVisibility:t}),s=m(()=>t?"station"===n?l.filter(kR):l:[],[t,l,n]),c=m(()=>k3({signalItems:s,segments:i}),[s,i]),u=m(()=>t&&(!!r||ru(a)),[a,r,t]),d=m(()=>u&&"number"==typeof o?rL(o,i):{segmentIndex:-1,pointIndex:-1},[u,o,i]);return m(()=>{if(!t||"number"!=typeof o||!Number.isFinite(o)||o<0||!c.length||!i?.length||!u)return;let r=rO(i,d);if(!Number.isFinite(r)){let t=Number(e);if(!Number.isFinite(t))return;return k9({frequency:t,signalRangeIndex:c,currentPosition:d})}return k9({frequency:r,signalRangeIndex:c,currentPosition:d})},[t,e,c,i,d,o,u])};function Sn(e){return Sr(e,"all")}function Sa(e){let t=Sr(e,"station");return t&&isStationInfo(t)?t:void 0}let Si=null,So=null,Sl=({label:e,value:t,tabular:a=!1})=>/*#__PURE__*/n("div",{className:`flex gap-2${a?" tabular-nums":""}`,children:[/*#__PURE__*/r("span",{className:"w-10 shrink-0 text-muted-foreground",children:e}),/*#__PURE__*/r("span",{className:"min-w-0 break-words",children:t})]}),Ss=({color:e,label:t,testId:n})=>/*#__PURE__*/r("span",{className:"font-medium text-foreground","data-testid":n,style:e?{color:oi(e)}:void 0,children:t}),Sc=({signalInfo:e})=>{if(!e)return null;let t=kA(e),a=kR(e)?{name:e.signalName,organization:e.orgName,modulation:e.modulation,remark:e.remark}:e.details,i=kw(e.signalType),o=kv[i],l=kD[kz(e.level)],s="simple"===t&&i===kb.LEGITIMATE,c=kN({...e,source:t}),u=s?void 0:c,d=null!=e.startFrequency&&null!=e.stopFrequency;return /*#__PURE__*/r("div",{className:"mt-2 border-t border-border/60 pt-2 text-xs leading-5 text-foreground","data-signal-source":t,"data-testid":"signal-info-panel",children:/*#__PURE__*/n("div",{className:"space-y-0.5",children:[/*#__PURE__*/r(Sl,{label:"来源",value:kT[t]}),a?.name?/*#__PURE__*/r(Sl,{label:"名称",value:a.name}):null,a?.organization?/*#__PURE__*/r(Sl,{label:"单位",value:a.organization}):null,null!=e.frequency?/*#__PURE__*/r(Sl,{label:"频率",value:`${e.frequency}MHz`,tabular:!0}):d?/*#__PURE__*/r(Sl,{label:"范围",value:`${e.startFrequency}-${e.stopFrequency}MHz`,tabular:!0}):null,null!=e.bandwidth?/*#__PURE__*/r(Sl,{label:"带宽",value:`${e.bandwidth}kHz`,tabular:!0}):null,a?.modulation?/*#__PURE__*/r(Sl,{label:"调制",value:a.modulation}):null,/*#__PURE__*/r(Sl,{label:"类型",value:/*#__PURE__*/r(Ss,{color:u,label:o.name,testId:"signal-info-type-color"})}),s?/*#__PURE__*/r(Sl,{label:"等级",value:/*#__PURE__*/r(Ss,{color:c,label:l.name,testId:"signal-info-level-color"})}):null,a?.remark?/*#__PURE__*/r(Sl,{label:"备注",value:a.remark}):null]})})},Su=/*#__PURE__*/a.memo(Sc),Sd=({left:e,updateKey:t,onChange:a,showSignalInfo:i=!0,showBandInfo:o=!1,cursorSample:l})=>{let s=at(e=>e.axisY.unit),c=at(e=>e.axisX.frequencyFormat),d=at(e=>e.axisX.unit),p=at(e=>e.globalID),f=at(e=>e.band),b=at(e=>e.segments),v=g(null),y=xd(p,u(e=>!1!==e.display,[])),w=u((e,t,a,i)=>{if(!e||0===e.length)return null;let o=Math.max(0,Math.min(e.length-1,Math.floor(a))),l=Number.isFinite(i)?i:e[o];if("number"!=typeof l)return null;let c=s??"",u=nI(c,l)?.toFixed(1);return tY(u)?/*#__PURE__*/n("div",{className:"grid max-w-[220px] grid-cols-[minmax(0,1fr)_auto] items-center gap-x-1 text-xs",style:{color:t?.color},children:[/*#__PURE__*/r("span",{className:"min-w-0 truncate",children:t?.label||t.name}),/*#__PURE__*/n("div",{className:"text-right",children:[/*#__PURE__*/r("span",{className:"inline-flex min-w-9 justify-end",children:u}),/*#__PURE__*/r("span",{children:c})]})]},t.name):null},[s]),{value:x,currentIndex:k}=m(()=>{if(!p)return{value:null,currentIndex:0/0};let r=tO(p);if(!r)return{value:null,currentIndex:0/0};let n=l?.version,a=v.current,i=a&&a.globalID===p&&a.left===e&&a.sampleVersion===n&&a.updateKey===t?a.snapshot:r.getAllRawData(e);v.current={globalID:p,left:e,sampleVersion:n,updateKey:t,snapshot:i};let o=i.cursorIndex?.globalIndex,s=i.cursorIndex?.sampledIndex,c={realData:i.realData,maxData:i.maxData,minData:i.minData,avgData:i.avgData,thresholdData:i.thresholdData,templateData:i.templateData,occupancyData:i.occupancyData,backgroundNoiseData:i.backgroundNoiseData,...i.extraData},u={realData:i.rawData?.realData,maxData:i.rawData?.maxData,minData:i.rawData?.minData,avgData:i.rawData?.avgData,thresholdData:i.rawData?.thresholdData,templateData:i.rawData?.templateData,occupancyData:i.rawData?.occupancyData,backgroundNoiseData:i.rawData?.backgroundNoiseData,...i.rawData?.extraData},d=Object.values(c).find(e=>!!e&&e.length>0),h=d?.length??0;if(h<=0)return{value:null,currentIndex:0/0};let f="number"==typeof s&&Number.isFinite(s)?Math.max(0,Math.min(h-1,Math.floor(s))):rw(e,h),m=Number.isFinite(i.cursorIndex?.globalIndex)?Math.floor(i.cursorIndex?.globalIndex??0):void 0,g=i.rawData?.realData,b=void 0!==m&&g&&g.length>0&&m>=0&&m<g.length?g[m]:void 0;return{value:y.map(e=>{let t=c[e.name];if(!t||0===t.length)return null;let r="realData"===e.name?b:(e=>{if("number"!=typeof o||!Number.isFinite(o))return;let t=u[e];if(!t||0===t.length)return;let r=Math.max(0,Math.min(t.length-1,Math.floor(o)));return t[r]})(e.name);return w(t,e,f,r)}).filter(e=>null!==e),currentIndex:f}},[w,p,y,t,e,l?.version]),S=m(()=>c?.(e)??"",[e,c]);h(()=>{a?.({index:k,frequency:S})},[k,S,a]);let M=Sn({frequency:S,enabled:i,cursorSample:l}),C=i&&!!M,F=m(()=>o&&l?kf(f,b,e):void 0,[f,b,e,o,l]),D=m(()=>x&&(!Array.isArray(x)||x.length>0),[x]);return!(e<0)&&(D||C||F)?/*#__PURE__*/n(g9,{children:[S&&/*#__PURE__*/n("div",{className:"text-[14px] font-medium text-popover-foreground",children:[S,d]}),x?/*#__PURE__*/r("div",{className:"mt-2 space-y-1",children:x}):null,i?/*#__PURE__*/r(Su,{signalInfo:M}):null,/*#__PURE__*/r(kg,{band:F,frequencyFormat:c})]}):null},Sh=/*#__PURE__*/a.memo(Sd),Sp=({id:e})=>{let t=at(e=>e.signal.show),n=at(e=>e.signal.display),a=xo(e),i=a?.coord.left;return /*#__PURE__*/r(Sh,{left:"number"==typeof i?i:-1,updateKey:xa("SpectrumPopover",e),showSignalInfo:t&&n,showBandInfo:!0,cursorSample:a})},Sf=Sp,Sm=({id:e,mode:t,type:n})=>t===rr.LevelStream?/*#__PURE__*/r(kl,{id:e}):n===rr.Spectrum?/*#__PURE__*/r(Sp,{id:e}):n===rr.Heatmap?/*#__PURE__*/r(ki,{id:e}):n===rr.Occupancy?/*#__PURE__*/r(kc,{id:e}):null,Sg="Cursor",Sb=1,Sv=(e,t,r,n=Sb)=>e>=r.left-n&&e<=r.right+n&&t>=r.top-n&&t<=r.bottom+n,Sy=(e,t,r,n,a)=>{let i=e.currentTarget;if(!(i instanceof HTMLElement))return null;let o=a??rf(i);return{sourceId:r,sourceType:n,clientX:e.clientX,clientY:e.clientY,coord:t,bounds:o}},Sw=e=>{let t=e.currentTarget;return t instanceof HTMLElement?t:null},Sx=(e,t,r)=>{let n=e.event;return e.coord.left===t.left&&e.coord.top===t.top&&n?.sourceId===r?.sourceId&&n?.sourceType===r?.sourceType&&n?.clientX===r?.clientX&&n?.clientY===r?.clientY&&n?.bounds.left===r?.bounds.left&&n?.bounds.top===r?.bounds.top&&n?.bounds.right===r?.bounds.right&&n?.bounds.bottom===r?.bounds.bottom},Sk=({id:e,type:t})=>{let{state:{cursor:a,globalID:i},dispatch:o}=ae(),{active:l,show:s,mode:c,crosshair:u}=a,[d,p]=b(!1),f=g(a),v=g(l),y=g(d),w=g(null),x=g(null),k=g(null),S=g(null);h(()=>{f.current=a,v.current=l,y.current=d},[a,l,d]);let M=m(()=>(t="leave")=>{p(!1);let r=b6.getPointer(e);if(f.current.event?.sourceId!==e&&r?.sourceId!==e){y.current=!1,w.current=null,x.current=null,b6.clearPointer(e,t);return}let n={...f.current,event:null,coord:{left:0,top:0}};f.current=n,y.current=!1,w.current=null,x.current=null,b6.clearPointer(e,t),A(()=>{p(!1),o({payload:{cursor:n}})})},[o,e]);h(()=>{s||(p(!1),y.current=!1,w.current=null,x.current=null,b6.clearPointer(e,"manual"))},[e,s]),h(()=>()=>{b6.dispose(e)},[e]),h(()=>{if(i&&s)return b6.subscribeSample(e,t=>{if(!t||t.sourceId!==e)return;let r=b5(t);if(Sx(f.current,t.coord,r))return;let n={...f.current,event:r,coord:t.coord};f.current=n,o({payload:{cursor:n}}),v.current&&w$(i)()})},[o,i,e,s]),h(()=>{if(s&&l)return b6.subscribePointer(e,t=>{let r=k.current,n=S.current;if(!t||t.sourceId!==e){r&&(r.style.left="-200%"),n&&(n.style.top="-200%");return}r&&(r.style.left=`${t.coord.left}%`),n&&(n.style.top=`${t.coord.top}%`)})},[l,e,s]),h(()=>{if(!i||!s)return;let r=wQ(e,Sg,()=>{y.current=!0,p(!0)}),n=wY(e,Sg,(r,n)=>{if(!y.current)return;let a=Sw(r);if(!a)return;if(x.current!==a||!w.current){let t=rf(a);x.current=a,w.current=t,b6.refreshBounds(e,t)}let i=Sy(r,n,e,t,w.current);if(i){if(!Sv(i.clientX,i.clientY,i.bounds))return void M("bounds");b6.updatePointer(e,i)}}),a=wV(e,Sg,M);return()=>{r?.(),n?.(),a?.()}},[e,i,s,t,M]),h(()=>{if(!s)return;let t=()=>{let t=x.current;if(!t)return;let r=rf(t);w.current=r,b6.refreshBounds(e,r)};return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[e,s]),h(()=>{if(!s)return;let t=t=>{if(!y.current)return;let r=b6.getPointer(e),n=r?.bounds??f.current.event?.bounds;r&&r.sourceId===e&&n&&(n.width<=0||n.height<=0||!Sv(t.clientX,t.clientY,n))&&M("bounds")};return window.addEventListener("pointermove",t,!0),()=>{window.removeEventListener("pointermove",t,!0)}},[s,e,M]),h(()=>{if(!s)return;let e=()=>{M("blur")},t=()=>{"hidden"===document.visibilityState&&M("visibility")},r=e=>{null===e.relatedTarget&&M("mouseout")};return window.addEventListener("blur",e),document.addEventListener("visibilitychange",t),document.addEventListener("mouseout",r),()=>{window.removeEventListener("blur",e),document.removeEventListener("visibilitychange",t),document.removeEventListener("mouseout",r)}},[M,s]);let C=m(()=>Sm({id:e,mode:c,type:t}),[e,c,t]);return s&&d&&l?/*#__PURE__*/n(yi,{className:"z-[6]",children:[/*#__PURE__*/r("div",{ref:k,"data-testid":"cursor-line-x",className:"pointer-events-none absolute left-[-200%] top-0 h-full border-l border-dashed border-chart-highlight/80 opacity-50"}),(t===rr.Heatmap||t===rr.Spectrum&&u)&&/*#__PURE__*/r("div",{ref:S,"data-testid":"cursor-line-y",className:"absolute left-0 top-[-200%] w-full border-t border-dashed border-chart-highlight/80 opacity-50"}),C&&/*#__PURE__*/r(va,{id:e,children:C},`${c??t}-${e}`)]}):null},SS=Sk,SM=rl.EventBus;function SC(e){let{state:{segments:t,axisX:{frequencyFormat:r},eventBus:{onDoubleClick:n}}}=ae();h(()=>{let t=wX(e,SM,(t,a)=>{if(!w7(e,SM))return!1;let{left:i}=a;return n(r?.(i)??"",a),!0}),a=wK(e,SM,()=>{xt(e,SM)}),i=wV(e,SM,()=>{xt(e,SM)});return()=>{t?.(),a?.(),i?.()}},[e,t,r,n])}let SF=({id:e})=>{let t=at(e=>e.globalID),n=m(()=>wW(e),[e]),[a,i]=b(),o=g(null),l=g(null),s=g({isDragging:!1,startPoint:{x:0,y:0,event:null},lastPoint:{x:0,y:0}}),c=g({timerId:null,startPoint:null,fired:!1});SC(e),nq(t,n);let d=u(()=>{i(xe(e))},[e]),p=u(()=>{s.current.isDragging=!1,s.current.startPoint.event=null,c.current.timerId&&window.clearTimeout(c.current.timerId),c.current.timerId=null,c.current.startPoint=null,c.current.fired=!1},[]);h(()=>wK(e,"EventBusInteraction",p),[e,p]);let f=u(e=>{e.preventDefault()},[]),v=u(e=>{if(!e.defaultPrevented){l.current?.cancel();try{o.current?.setPointerCapture(e.pointerId)}catch{}if(wU(n)(wB(e)),o.current?.focus?.(),s.current={isDragging:!0,startPoint:{x:e.clientX,y:e.clientY,event:e},lastPoint:{x:e.clientX,y:e.clientY}},0===e.button){c.current.timerId&&window.clearTimeout(c.current.timerId),c.current.startPoint={x:e.clientX,y:e.clientY},c.current.fired=!1;let t=window.setTimeout(()=>{s.current.isDragging&&!c.current.fired&&(c.current.fired=!0,w1(n)(e,wB(e)))},500);c.current.timerId=t}}},[n,e,p]),y=u(rW(e=>{if(!e.currentTarget)return;wY(n)(e,wB(e)),d();let t=c.current.startPoint;if(t&&c.current.timerId&&!c.current.fired){let r=e.clientX-t.x,n=e.clientY-t.y;r*r+n*n>25&&(window.clearTimeout(c.current.timerId),c.current.timerId=null)}if(s.current.isDragging&&s.current.startPoint.event){let{height:t,width:r}=e.currentTarget.getBoundingClientRect(),a=s.current.startPoint.event,i=(e.clientX-s.current.lastPoint.x)/r,o=(e.clientY-s.current.lastPoint.y)/t;wJ(n)(wB(a),wB(e),{left:i,top:o},2===e.buttons),s.current.lastPoint={x:e.clientX,y:e.clientY}}}),[n,e,p,d]);l.current=y;let w=u(()=>{l.current?.flush(),wK(n)(),s.current.isDragging=!1,s.current.startPoint.event=null,c.current.timerId&&window.clearTimeout(c.current.timerId),c.current.timerId=null,c.current.startPoint=null,c.current.fired=!1},[n]),x=u(()=>{l.current?.flush(),wV(n)(),p()},[n,p]),k=u(()=>{wQ(n)()},[n]),S=u(e=>{wX(n)(e,wB(e))},[n]),M=u(rB(e=>{wZ(n)(-1*e.deltaY,wB(e))}),[n]);return h(()=>{o.current&&(o.current.id=n)},[n]),h(()=>{let e=()=>{x()},t=()=>{"hidden"===document.visibilityState&&x()},r=e=>{null===e.relatedTarget&&x()};return window.addEventListener("blur",e),document.addEventListener("visibilitychange",t),document.addEventListener("mouseout",r),()=>{window.removeEventListener("blur",e),document.removeEventListener("visibilitychange",t),document.removeEventListener("mouseout",r)}},[x]),h(()=>()=>l.current?.cancel(),[]),/*#__PURE__*/r(yi,{className:"z-[5] pointer-events-auto",children:/*#__PURE__*/r("button",{ref:o,type:"button",className:iX("absolute right-0 top-0 h-full w-full appearance-none border-0 bg-transparent p-0 outline-none"),style:{cursor:a},"aria-label":"Event bus",onContextMenu:f,onPointerDown:v,onPointerMove:y,onPointerUp:w,onBlur:x,onFocus:k,onPointerLeave:x,onPointerOver:k,onDoubleClick:S,onWheel:M})})},SD=SF,Sz=()=>{let{state:{gridLines:e}}=ae();return e&&/*#__PURE__*/r("div",{className:"pointer-events-none absolute right-0 top-0 z-[1] flex h-full w-full select-none flex-col border [border-color:var(--chart-grid)] bg-transparent"})},SN=Sz,SE=e=>{let{children:t,onWheelCapture:n}=e,{pluginBoxWidth:a}=yn();return /*#__PURE__*/r("div",{className:"absolute right-0 top-0 m-0 h-full overflow-hidden p-0",style:{width:a},onWheelCapture:n,children:t})},ST=/*#__PURE__*/a.memo(SE),SR=(e,t,r)=>Math.min(r,Math.max(t,e)),SA=e=>Number.isFinite(e)?Math.max(0,Math.floor(e)):0,SI=(e,t)=>{let r=SA(t);if(0===r)return{start:0,end:0};let n=Math.min(e.start,e.end),a=Math.max(e.start,e.end),i=SR(Math.floor(n),0,r-1),o=SR(Math.ceil(a),i,r-1);return{start:i,end:o}},SP=({anchorPercent:e,interval:t,scale:r,totalPoints:n})=>{let a=SA(n);if(0===a)return{start:0,end:0};let i=SI(t,a),o=i.end+1,l=o-i.start,s=Math.min(tV.ZOOM_MIN_RANGE,a),c=SR(Math.round(l*(Number.isFinite(r)&&r>0?r:1)),s,a),u=SR(SR(e,0,100)*a/100,i.start,o),d=(u-i.start)/l,h=SR(Math.round(u-c*d),0,a-c);return{start:h,end:h+c-1}},SL=(e,t,r)=>{let n=SA(t);if(0===n)return{start:0,end:0};let a=SI(e,n),i=a.end-a.start+1,o=Number.isFinite(r)?Math.round(r):0,l=SR(a.start+o,0,n-i);return{start:l,end:l+i-1}},SO=({endPercent:e,startPercent:t,totalPoints:r})=>{let n=SA(r);if(0===n)return null;let a=SR(Math.min(t,e),0,100),i=SR(Math.max(t,e),0,100),o=SR(Math.floor(a*n/100),0,n-1),l=SR(Math.ceil(i*n/100),o+1,n);return{start:o,end:l-1}},Sq=rl.Zoom;function S$(e,t,r=!0){let{state:{zoom:n,segments:a,globalID:i},dispatch:o}=ae(),{show:l,interval:{start:s,end:c}}=n,{totalPoints:d}=a,p=m(()=>t===rr.Spectrum,[t]),f=g(0),b=u((e,t)=>r&&l&&d?SP({anchorPercent:t,interval:{start:s,end:c},scale:e>0?.5:2,totalPoints:d}):null,[r,l,d,s,c]);h(()=>{if(r&&d)return wZ(e,t,(e,t)=>{let r=b(e,t.left);r&&(r.start!==n.interval.start||r.end!==n.interval.end)&&o({payload:{zoom:{...n,interval:r,isScanSegmentsUpdateMagnify:!1}}})})},[r,e,t,d,n,b,o]);let v=u((t,a,l,u)=>{if(!r||!w7(e,Sq)||!t||!a||!l||u||!i||!d)return;let h=SL({start:s,end:c},d,-l.left*d);(h.start!==s||h.end!==c)&&o({payload:{zoom:{...n,interval:h,isScanSegmentsUpdateMagnify:!1}}});let m=l.top;m&&p&&(f.current+=m,Math.abs(f.current)&&(nH(i)?.(f.current),f.current=0))},[r,e,p,s,c,d,n,i,o]);h(()=>{if(!r||!l||!e)return;let t=()=>{xt(e,Sq),f.current=0},n=wK(e,Sq,t),a=wV(e,Sq,t),i=wJ(e,Sq,v);return()=>{n?.(),a?.(),i?.(),t()}},[r,l,e,v])}let S_=1e4,Sj={startIndex:0,endIndex:0,startCol:0,endCol:0,startTimestamp:"",endTimestamp:"",startFrequency:0,startFrequencyFormat:"",endFrequency:0,endFrequencyFormat:"",bandwidth:0,bandwidthFormat:"",data:[]};function SH({endLeft:e,startLeft:t,startTop:r,endTop:n,frequencyFormat:a,globalID:i}){let{waterfallData:o}=tO(i).getAllRawData();if(!o?.length)return Sj;let l=kn(i),s={endLeft:e,endTop:n,startLeft:t,startTop:r},c=l?xw(l,s):x6(o,s);if(!c)return Sj;let u=l?xv(Math.min(t,e),l):Math.min(t,e),d=l?xv(Math.max(t,e),l):Math.max(t,e),h={start:Math.round(1e4*Number(a(u)))/1e4,end:Math.round(1e4*Number(a(d)))/1e4},p=Math.abs(h.end-h.start),f=l?.rawData??o,m=f[c.startIndex]?.timestamp||"",g=f[c.endIndex]?.timestamp||"";return{startIndex:c.startIndex,endIndex:c.endIndex,startCol:c.startCol,endCol:c.endCol,startTimestamp:m,endTimestamp:g,startFrequency:h.start,startFrequencyFormat:String(h.start),endFrequency:h.end,endFrequencyFormat:String(h.end),bandwidth:p,bandwidthFormat:rm(p),data:l?xx(l,c):x8(o,c)}}let SB=(e,t)=>tC(`heatmapCaptureUpdate-${e}`,"0",t,e),SW=e=>`heatmapCaptureSelection-${e}`,SG=e=>`${SW(e)}-update`,SY=(e,t)=>e===t||null!==e&&null!==t&&1e-7>=Math.abs(e.x[0]-t.x[0])&&1e-7>=Math.abs(e.x[1]-t.x[1])&&1e-7>=Math.abs(e.y[0]-t.y[0])&&1e-7>=Math.abs(e.y[1]-t.y[1]),SU=e=>tS(SW(e),void 0,null,e),SX=(e,t)=>{!e||SY(SU(e),t)||(tS(SW(e),t,null,e),tC(SG(e))(t))},SK=(e,t)=>tC(SG(e),"HeatmapOverview",t,e),SV=rl.HeatmapCapture,SQ=e=>{let{state:{heatmapCapture:t,axisX:{frequencyFormat:a,unit:i},system:o,globalID:l}}=ae(),{id:s}=e,{type:c,show:u,display:d,onChange:p}=t,f=m(()=>c===nn.Area&&u&&d,[c,u,d]),[g,v]=b(Sj),[y,w]=b();return(h(()=>{if(f){let e=wK(s,SV,()=>{p(g)}),t=wV(s,SV,()=>{p(g)}),r=wJ(s,SV,(e,t)=>{if(w7(s,SV)&&e&&t){let{left:r,top:n}=e,{left:i,top:s}=t;if(void 0===r||void 0===n||void 0===i||void 0===s)return;let c=i-r,u=s-n,d=Math.abs(c),h=Math.abs(u);d*o.width/100<=10||h*o.height/100<=10||(w({width:d,height:h,left:c>0?r:i,top:u>0?n:s,endLeft:i,startLeft:r}),v(SH({startTop:n,endTop:s,endLeft:i,startLeft:r,frequencyFormat:a,globalID:l})))}});return()=>{e?.(),t?.(),r?.()}}},[s,f,g,a,l,p]),h(()=>{f||(xt(s,SV),v(Sj),p(Sj))},[f]),f&&g?.bandwidth!==0)?/*#__PURE__*/n("div",{className:"pointer-events-none absolute inset-0 left-0 top-0 z-[5] h-full w-full overflow-hidden",children:[/*#__PURE__*/r("div",{className:"absolute bottom-5 right-5 h-auto w-auto",children:/*#__PURE__*/r(g9,{className:"p-1 text-xs text-popover-foreground",children:/*#__PURE__*/n("div",{className:"grid grid-cols-[auto_1fr] gap-x-[6px] gap-y-0.5",children:[/*#__PURE__*/r("div",{className:"min-w-0 opacity-60",children:"起始频率"}),/*#__PURE__*/n("div",{children:[g?.startFrequencyFormat,i]}),/*#__PURE__*/r("div",{className:"min-w-0 opacity-60",children:"结束频率"}),/*#__PURE__*/n("div",{children:[g?.endFrequencyFormat,i]}),/*#__PURE__*/r("div",{className:"min-w-0 opacity-60",children:"带宽"}),/*#__PURE__*/r("div",{children:rD(g.bandwidth).formatted}),/*#__PURE__*/r("div",{className:"min-w-0 opacity-60",children:"起始时间"}),/*#__PURE__*/r("div",{children:g?.startTimestamp}),/*#__PURE__*/r("div",{className:"min-w-0 opacity-60",children:"结束时间"}),/*#__PURE__*/r("div",{children:g?.endTimestamp})]})})}),/*#__PURE__*/r(yi,{children:/*#__PURE__*/r("div",{style:{left:`${y?.left}%`,top:`${y?.top}%`,width:`${y?.width}%`,height:`${y?.height}%`},className:"absolute z-[3] border-[2px] border-dashed border-foreground opacity-50"})})]}):null},SZ=SQ,SJ=rl.HeatmapCapture,S0=({id:e})=>{let{state:{heatmapCapture:t,globalID:a,publish:i}}=ae(),{onChange:o,show:l,type:s,display:c}=t,d=m(()=>s===nn.RowIndex&&l&&c,[s,l,c]),[p,f]=b(null),[v,y]=b(null),[w,x]=b(!1),k=u((e,t)=>Math.max(0,Math.min(t-1,Math.ceil((100-e)*t/100)-1)),[]),S=g(null),M=u(e=>{if(!o||!a)return;let{waterfallData:t}=tO(a).getAllRawData();if(t?.length){let r=kn(a),n=r?xy(r,{left:0,top:e.top}):null,i=n?n.rowIndex:k(e.top,t.length),l=t_(a)?.getAllRawData()?.rawData?.waterfallData,s=l?.[i];if(!s)return;let c=s.timestamp,u={data:s,timestamp:c,rowIndex:i};f(u),o(u),t_(a)?.setRealData(u.data)}},[a,o,k,i]);return(h(()=>{if(a&&d)return wU(e,SJ,()=>{x(!0)}),wK(e,SJ,()=>{x(!1),xt(e,SJ)}),wJ(e,SJ,(t,r)=>{w7(e,SJ)&&(y(r),M(r))}),()=>{wU(e,SJ,()=>{}),wK(e,SJ,()=>{}),wJ(e,SJ,()=>{})}},[e,a,d,M]),d)?/*#__PURE__*/r("div",{className:"pointer-events-none absolute left-0 top-0 z-[5] h-full w-full",ref:S,children:v&&p&&/*#__PURE__*/r("div",{className:iX("absolute left-0 h-0 w-full -translate-y-1/2 border-b-2 border-dashed text-xs text-foreground opacity-80",w&&"border-b-[3px] opacity-100"),"data-testid":"heatmap-row-index-line",style:{borderColor:tQ,top:`${v.top}%`},children:/*#__PURE__*/r("div",{className:"absolute left-2 w-max",style:{...(()=>{if(!v)return{};let e=v.top;return e<=10?{top:"0",transform:"translateY(0)"}:e>=90?{bottom:"0",top:"auto",transform:"translateY(0)"}:{top:"50%",transform:"translateY(-50%)"}})()},children:/*#__PURE__*/n(g9,{className:"gap-1 px-2 py-1.5 text-xs",children:[/*#__PURE__*/n("div",{className:"flex items-center justify-between gap-3",children:[/*#__PURE__*/r("span",{className:"text-muted-foreground",children:"行"}),/*#__PURE__*/r("span",{className:"font-medium tabular-nums",children:p.rowIndex})]}),/*#__PURE__*/n("div",{className:"flex items-center justify-between gap-3",children:[/*#__PURE__*/r("span",{className:"text-muted-foreground",children:"时间"}),/*#__PURE__*/r("span",{className:"tabular-nums",children:p.timestamp})]})]})})})}):null},S1=S0,S2=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
3727
|
+
}`].join("\n\n")},to=e=>{let t=tn(e,"middle"),r=tn(e,"small");return[ta(":root",t),ta(`:root[size='${eB}']`,t),ta(":root[size='small']",r)].join("\n\n")},tl=(e,t)=>{if(!eW())return;let r=`style[${e}]`,n=document.head.querySelector(r);if(n){n.textContent!==t&&(n.textContent=t);return}let a=document.createElement("style");a.textContent=t,a.setAttribute(e,"true"),document.head.appendChild(a)},ts=({tokens:e}={})=>{tl("rfkit-charts-root-theme-style-target",ti(getCanonicalThemeVariableDefinitions(e),{default:":root",light:`:root[theme='${ThemeType.Light}'][${THEME_FOLLOW_OS_KEY}='false']`,dark:`:root[theme='${ThemeType.Dark}'][${THEME_FOLLOW_OS_KEY}='false']`,systemDark:`:root:not([${THEME_FOLLOW_OS_KEY}='false'])`}))},tc=({tokens:e}={})=>{tl("rfkit-charts-theme-style-target",ti(e9(e),{default:eN,light:`:root[theme='${e$.Light}'][${eO}='false'] ${eN}`,dark:`:root[theme='${e$.Dark}'][${eO}='false'] ${eN}`,systemDark:`:root:not([${eO}='false']) ${eN}`}))},tu=e=>{tl("rfkit-charts-size-style-target",to(e7(e)))},td=(e={})=>{let{sizes:t,tokens:r}=e;ts({tokens:r}),tu(t)},th=(e={})=>{let{sizes:t,tokens:r}=e;tc({tokens:r}),tu(t)},tp=Symbol.for("rfkit.charts.runtime"),tf=()=>({datas:new Set,subscriptions:new Set}),tm=e=>{let t=e?.datas??{},r=e?.subscriptions??{},n=e?.owners??{};for(let e of Object.keys(n)){let t=n[e];t.datas??=new Set,t.subscriptions??=new Set}return{datas:t,subscriptions:r,owners:n}},tg=()=>"u">typeof window?window:globalThis,tb=()=>{let e=tg();if("u">typeof window&&window.charts){let t=tm(window.charts);return window.charts=t,e[tp]=t,t}e[tp]||(e[tp]=tm(void 0));let t=tm(e[tp]);return e[tp]=t,"u">typeof window&&(window.charts=t),t},tv=tb();tv.datas||(tv.datas={});let ty=e=>(tv.owners[e]||(tv.owners[e]=tf()),tv.owners[e]),tw=(e,t,r)=>{e&&t&&ty(e)[r].add(t)},tx=e=>{let t=tv.owners[e];t&&0===t.datas.size&&0===t.subscriptions.size&&delete tv.owners[e]},tk=(e,t)=>{for(let r of Object.keys(tv.owners))tv.owners[r][t].delete(e),tx(r)};function tS(e,t,r,n){let a=tv.datas;return tw(n,e,"datas"),e in a?void 0!==t&&(a[e]=t):a[e]=t??r,a[e]??r}tv.subscriptions||(tv.subscriptions={});let tM=tv.subscriptions;function tF(e,t,r,n){if(!e)throw Error("createSubscriptionManager 订阅失效");return"function"==typeof r&&t?(tM[e]||(tM[e]={}),tM[e][t]=r,tw(n,e,"subscriptions"),()=>{tM[e]?.[t]===r&&delete tM[e][t],tM[e]&&0===Object.keys(tM[e]).length&&(delete tM[e],tk(e,"subscriptions"))}):(...t)=>{let r=tM[e];if(r)for(let e in r)r[e](...t)}}function tC(e,t,r,n,a){return"function"==typeof n&&r?tF(e,r,n,a):(...r)=>{let n=tM[e];if(!n)return!1;for(let e of Object.keys(n).sort((e,r)=>t(r)-t(e)))if(!0===n[e](...r))return!0;return!1}}let tD=e=>`PUB_SUB-${e}`,tz=(e,t)=>`passThrough-${e}-${t}`,tN=e=>`withDatabase-${e}`,tE=e=>`withSpectrumAnalyzerSYNC-${e}`,tT=e=>`withWaterfallAnalyzerSYNC-${e}`,tR=e=>`withUpdateData-${e}`,tA=(e,t,r="0")=>tF(tD(e),r,t,e),tI=(e,t,r,n="0")=>tF(tz(e,t),n,r,e);function tP(e){let t=e.filter(e=>"string"==typeof e&&e.length>0);if(0!==t.length)for(let e of t){let t=tv.owners[e];if(t){for(let e of Array.from(t.datas))delete tv.datas[e],tk(e,"datas");for(let e of Array.from(t.subscriptions))delete tM[e],tk(e,"subscriptions");delete tv.owners[e]}}}let tL=()=>({getAllRawData:()=>({realData:new Float32Array,maxData:new Float32Array,minData:new Float32Array,avgData:new Float32Array,thresholdData:new Float32Array,templateData:new Float32Array,backgroundNoiseData:new Float32Array,waterfallData:[],levelStreamData:{probabilityRangeData:new Float32Array,spectrumData:new Float32Array,timestampData:new Float32Array},occupancyData:new Float32Array,extraData:{},srcIndexCache:new Uint32Array})});function tO(e,t){return e?tS(tN(e),t,tL(),e):tL()}let tq=(e,t,r)=>tF(tR(e),t,r,e),t$=(e,t)=>tF(`setScanDF360Prob-${e}`,"0",t,e);function t_(e,t){return e?tS(tE(e),t,null,e):t??null}function tj(e,t){return e?tS(tT(e),t,null,e):t??null}function tH(){let e={current:null},t={current:[]},r={current:!1},n={current:!1},a={current:!1},i={current:[]},o=new Set,l=0,s=null,c=e=>{let t=!0,r=()=>{t&&(t=!1,o.delete(r),e())};return o.add(r),r},u=()=>{if(a.current)return;a.current=!0;let t=l,r=()=>{s=null,queueMicrotask(()=>{t===l&&e.current&&(()=>{let e=l;if(a.current=!1,n.current=!0,d(),e!==l)return;let t=i.current;for(let r of(i.current=[],t)){if(!r.active||e!==l)continue;let t=r.callback();"function"==typeof t&&(r.cleanup=c(t),r.active&&e===l||r.cleanup())}})()})};if("u">typeof window&&"function"==typeof window.requestAnimationFrame){let e=window.requestAnimationFrame(r);s=()=>window.cancelAnimationFrame(e);return}let o=setTimeout(r,0);s=()=>clearTimeout(o)},d=()=>{if(!e.current||0===t.current.length)return;let r=t.current;t.current=[];let n=l,a=e.current;for(let e of r){if(n!==l)return;a(e)}},h=a=>{e.current&&n.current?e.current(a):(t.current.push(a),r.current&&e.current&&u())};return{attachPublish:t=>{if(e.current=t,r.current){n.current=!1,u();return}r.current=!0,n.current=!1,u()},dispose:()=>{for(let e of(l+=1,s?.(),s=null,Array.from(o)))e();o.clear(),t.current=[],i.current=[],e.current=null,r.current=!1,n.current=!1,a.current=!1},enhancedPublish:Object.assign(h,{getSourceData:()=>e.current?.getSourceData?e.current.getSourceData():tL(),isReady:()=>r.current,onReady:t=>{if(r.current&&e.current&&n.current){let e=l,r=t();if("function"==typeof r){let t=c(r);return e!==l&&t(),t}return}let a={callback:t,active:!0};return i.current.push(a),r.current&&e.current&&u(),()=>{a.active&&(a.active=!1,i.current=i.current.filter(e=>e!==a),a.cleanup&&a.cleanup())}},resetViewport:()=>{e.current?.resetViewport?.()}}),publish:h}}function tB(e,t){let r=s((t,r)=>{let n=g(null);n.current||(n.current=tH());let i=n.current,o=u(e=>{i.attachPublish(e)},[i]);h(()=>()=>i.dispose(),[i]),p(r,()=>i.enhancedPublish,[i]);let l={...t,publish:o};return a.createElement(e,l)});return r.displayName=`withChartPublisher(${t})`,r}function tW(e){if(!e?.length)return{};let t=-1/0,r=0;for(let n=0;n<e.length;n+=1){let a=e[n];a>t&&(t=a,r=n)}return{max:t,maxIndex:r}}function tG(e){if(!e?.length)return 0;let t=1/0,r=0;for(let n=0;n<e.length;n+=1){let a=e[n];a<t&&(t=a,r=n)}return{min:t,minIndex:r}}let tY=e=>Number.isFinite(Number(e));function tU(e){if(!e)return{};let t=0,r=0,n=1/0,a=-1/0,i=0,o=0;for(let l of e)tY(l)&&(l<n&&(n=l,i=t),l>a&&(a=l,o=t),r+=l,t+=1);return 0===t?{}:{min:n,minIndex:i,max:a,maxIndex:o,avg:r/t}}function tX(e,t){if(e<0||t<0||e>t)throw Error("Invalid index range");return e+Math.floor((t-e)/2)}let tK="DCHARTS_CONFIG",tV={ZOOM_MIN_RANGE:10,POPOVER_MARGIN:16},tQ="#A855F7",tZ={line:{realData:{name:"realData",color:"#86c56a",thickness:1,label:"实时值",display:!0},maxData:{name:"maxData",color:"#eb5b5b",thickness:1,label:"最大值",display:!0},minData:{name:"minData",color:"#4a65bf",thickness:1,label:"最小值",display:!1},avgData:{name:"avgData",color:"#f9c14e",thickness:1,label:"平均值",display:!1},thresholdData:{name:"thresholdData",color:tQ,thickness:1,label:"门限值",display:!0},templateData:{name:"templateData",color:"#e38888",thickness:1,label:"模板",display:!0},backgroundNoiseData:{name:"backgroundNoiseData",color:"#2bb3cb",thickness:1,label:"背景噪声",display:!0}},gradient:{item:[["#FF0000","#FFEB3B","#2DB333","#00BCD4","#0000FF","#000000"],["#FF3636","#2DF16A","#3B4FFF"],["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],["#d73027","#f46d43","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],["#5e4fa2","#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],["#FFFFFF","#000000"]],index:0},levelStream:{line:"#4a65bf",statisticsTime:10},bar:"rgba(100, 211, 211, 211)",iq:{pointColor:"#ff0000",lineColor:"#00ff00"},marker:["#35E065","#F98116","#FF4325","#3CE5D3","#F64FA1","#AA74E8","#FFE184","#B1E3FF","#C8141F","#FFA3CC","#BACFFF","#45D2FF","#AEDF2F","#E7FF84","#B88AFF","#FF00B4","#FFD0E3","#EEAE94"]},tJ=(e={})=>{let t=JSON.parse(localStorage.getItem(tK)||"{}"),r={...tZ,...t,...e};localStorage.setItem(tK,JSON.stringify(r))};function t0(e){let t=tZ??JSON.parse(localStorage.getItem(tK)||"null");return t||(tJ(),t=tZ),e?t[e]:t}let t1=()=>t0("line"),t2=(e=0)=>{let{item:t,index:r}=t0("gradient");return t[void 0!==r?r:e]},t5=t0("line"),t4=Object.keys(t5),t3=t5.realData.name,t6=tV.ZOOM_MIN_RANGE,t8=tV.POPOVER_MARGIN;var t9=/*#__PURE__*/function(e){return e.Hz="Hz",e.kHz="kHz",e.MHz="MHz",e.GHz="GHz",e}({}),t7=/*#__PURE__*/function(e){return e.Outside="outside",e.Inside="inside",e}({}),re=/*#__PURE__*/function(e){return e.Auto="auto",e.Frequency="frequency",e.CenterBandwidth="center-bandwidth",e}({}),rt=/*#__PURE__*/function(e){return e.SingleFrequency="singleFrequency",e.Scan="scan",e.MScan="mscan",e.ScanDF360="scanDF360",e.DDC="ddc",e.Lite="lite",e.LiteNormalized="liteNormalized",e.LevelStream="levelStream",e.IQEye="iqEye",e.IQLine="iqLine",e.IQPlanisphere="iqPlanisphere",e.IQStream="iqStream",e.Heatmap="heatmap",e.Occupancy="occupancy",e.AudioWaveform="audioWaveform",e}({}),rr=/*#__PURE__*/function(e){return e.Spectrum="spectrum",e.Heatmap="heatmap",e.Fluorescence="fluorescence",e.Occupancy="occupancy",e.LevelStream="levelStream",e.Dial="dial",e.Gauge="gauge",e.IQStream="iqStream",e.IQPlanisphere="iqPlanisphere",e.IQEye="iqEye",e.IQLine="iqLine",e.SpatialSpectrum="spatialSpectrum",e.AudioWaveform="audioWaveform",e}({}),rn=/*#__PURE__*/function(e){return e.Spectrum="spectrum",e.AntennaFactor="antennaFactor",e.Signal="signal",e.Occupancy="occupancy",e.LevelStream="levelStream",e.Heatmap="heatmap",e.Fluorescence="fluorescence",e.IQ="iq",e.AudioWaveform="audioWaveform",e.Dial="dial",e.Gauge="gauge",e.Series="series",e.SpectrumBandwidth="spectrumBandwidth",e.Segments="segments",e.Channels="channels",e.Marker="marker",e.Reset="reset",e.Resize="resize",e.Clear="clear",e.Option="option",e.Render="render",e}({}),ra=/*#__PURE__*/function(e){return e.HeatmapCapture="heatmapCapture",e}({}),ri=/*#__PURE__*/function(e){return e.Cover="cover",e.Focus="focus",e}({}),ro=/*#__PURE__*/function(e){return e.Add="add",e.Del="del",e.Clear="clear",e.Update="update",e}({}),rl=/*#__PURE__*/function(e){return e.AxisX="axisX",e.AxisY="axisY",e.Band="band",e.Blaze="blaze",e.Cursor="cursor",e.DragFrame="dragFrame",e.Dropdown="dropdown",e.EventBus="eventBus",e.FrequencyAllocation="frequencyAllocation",e.FrequencyDataBoard="frequencyDataBoard",e.FrequencyTagLine="frequencyTagLine",e.GridLines="gridLines",e.GaugeBox="gaugeBox",e.HeatmapCapture="heatmapCapture",e.Legend="legend",e.Limit="limit",e.Markers="markers",e.Scope="scope",e.SegmentsZebra="segmentsZebra",e.Signal="signal",e.SignalAnalysis="signalAnalysis",e.Square="square",e.Stripe="stripe",e.Zoom="zoom",e.Frame="frame",e.Area="area",e}({}),rs=/*#__PURE__*/function(e){return e.AutorangingSwitch="AutorangingSwitch",e.UnitSwitch="UnitSwitch",e.StepSwitch="StepSwitch",e.GradientRibbon="GradientRibbon",e.HeatmapCaptureSwitch="HeatmapCaptureSwitch",e.TimeRangeSwitch="TimeRangeSwitch",e.SpacerLine="SpacerLine",e.Reset="Reset",e.StationAllocationSwitch="StationAllocationSwitch",e.SeriesControl="SeriesControl",e.FrequencyAllocationSwitch="FrequencyAllocationSwitch",e.ZoomSwitch="ZoomSwitch",e.LimitSwitch="LimitSwitch",e.MarkersSwitch="MarkersSwitch",e.FrequencyTagLineSwitch="FrequencyTagLineSwitch",e.SignalAnalysisSwitch="SignalAnalysisSwitch",e.StripeSwitch="StripeSwitch",e.CursorSwitch="CursorSwitch",e.CursorFindRowSwitch="CursorFindRowSwitch",e.SignalSwitch="SignalSwitch",e.SegmentsDisplayControl="SegmentsDisplayControl",e.SeriesDisplayControl="SeriesDisplayControl",e.FluorescenceSwitch="FluorescenceSwitch",e.DeltaMeasurementSwitch="DeltaMeasurementSwitch",e}({}),rc=/*#__PURE__*/function(e){return e.RealData="realData",e.MaxData="maxData",e.MinData="minData",e.AvgData="avgData",e.ThresholdData="thresholdData",e.TemplateData="templateData",e.BackgroundNoiseData="backgroundNoiseData",e}({});let ru=e=>!!(e.show&&e.active&&e.event?.sourceType===rr.Spectrum),rd=new Set(["auto","clip","hidden","overlay","scroll"]),rh=e=>e?.split(" ").some(e=>rd.has(e.trim()))??!1,rp=(e,t,r,n)=>({left:e,top:t,right:r,bottom:n,width:Math.max(0,r-e),height:Math.max(0,n-t)}),rf=e=>{let t=e.getBoundingClientRect(),r=t.left,n=t.top,a=t.right,i=t.bottom;"u">typeof window&&(r=Math.max(r,0),n=Math.max(n,0),a=Math.min(a,window.innerWidth),i=Math.min(i,window.innerHeight));let o=e.parentElement;for(;o&&o!==document.body;){let e=window.getComputedStyle(o),t=rh(e.overflowX)||rh(e.overflow),l=rh(e.overflowY)||rh(e.overflow);if(t||l){let e=o.getBoundingClientRect();e.width>0&&e.height>0&&(t&&(r=Math.max(r,e.left),a=Math.min(a,e.right)),l&&(n=Math.max(n,e.top),i=Math.min(i,e.bottom)))}o=o.parentElement}return rp(r,n,a,i)},rm=(e,t=6)=>{if(!e&&0!==e)return"";let r=Number.parseFloat(e.toFixed(t));return Number.isFinite(r)?String(r):""};function rg(e){return e?.slice(0,3)==="dBm"}let rb=(e,t)=>(Object.defineProperty(e,"totalPoints",{value:t,enumerable:!1,configurable:!0}),e),rv=e=>{let{totalPoints:t,startFrequency:r,stopFrequency:n,index:a=0}=e,i=n-r;return 1===t?[{frequency:rm(r),startLeft:100*a/t,endLeft:(a+1)*100/t}]:Array(t).fill(0).map((e,n)=>({frequency:rm(r+n/(t-1)*i),startLeft:(a+n)*100/t,endLeft:(a+n+1)*100/t}))},ry=e=>{if(!e?.length)return()=>"";let t=e.totalPoints,r=e.map((r,n)=>{let{point:a}=r;return{ll:100*a/t,frequencyCache:r.frequencyCache,startLeft:0===n?0:e.slice(0,n).reduce((e,r)=>e+100*r.point/t,0)}});return t=>{if(t<=0)return String(e[0]?.start);if(t>=100)return String(e[e.length-1]?.stop);let n=0,a=r.length-1;for(;n<=a;){let e=n+a>>>1,{startLeft:i,ll:o}=r[e];if(t>=i&&t<i+o){let{frequencyCache:n}=r[e],a=Math.min(Math.ceil((t-i)/o*n.length)-1,n.length-1);return n[a]?.frequency??""}t<i?a=e-1:n=e+1}return""}},rw=(e,t)=>t<=1?0:Math.max(0,Math.min(t-1,Math.ceil(Math.max(0,Math.min(100,e))*t/100)-1));function rx(e){let t=e.length;return r=>{if(0!==t)return e[rw(r,t)]}}let rk=e=>{if(!e)return 0;let{segments:t}=e;if(!t)return 0;let r=t.totalPoints,{endLeft:n,startLeft:a}=e,i=n-a,o=Math.abs(i);i<0&&(a=e.endLeft,n=e.startLeft);let l=0,s=!1;for(let e=0;e<t.length;e+=1){let{step:i,start:c,stop:u,point:d}=t[e],h=100*d/r,p=i/1e3,f=a-h<=0,m=n-h<=0;if(!s&&f&&m)return Math.round(o/h*d)*p;if(f&&!s&&(s=!0,l+=Math.round((1-a/h)*d)*p),m)return l+Math.round(n/h*d)*p;a<0&&!m&&(l+=u-c),a-=h,n-=h}return 0},rS=e=>{let{frequency:t,bandwidth:r,totalPoints:n}=e,a=t-r/2e3,i=t+r/2e3;if(a<=0||i<=0)return[];let o=rv({totalPoints:n,startFrequency:a,stopFrequency:i,stepFrequency:r/n});return rb([{frequency:t,bandwidth:r,step:i-a,start:a,stop:i,index:0,label:"",point:n,percentage:1,progress:[0,100],frequencyCache:o}],n)},rM=e=>rb([{frequency:0,bandwidth:0,step:1,start:0,stop:e,index:0,label:"Data",point:e,percentage:1,progress:[0,100],frequencyCache:[]}],e),rF=e=>{if(!e?.length)return[];let t=e.reduce((e,{startFrequency:t,stopFrequency:r,stepFrequency:n})=>e+Math.round((r-t)*1e3/n)+1,0),r=0;return rb(e.map(({startFrequency:e,stopFrequency:n,stepFrequency:a,label:i})=>{let o=Math.round((n-e)*1e3/a)+1,l=r,s=rv({totalPoints:o,startFrequency:e,stopFrequency:n,stepFrequency:a,index:l});return r+=o,{start:e,stop:n,step:a,index:l,label:i,point:o,percentage:o/t,progress:[100*l/t,100*r/t],frequencyCache:s}}),t)},rC=(e,t=3)=>{let r,n;if(!e&&0!==e)return{value:0,unit:t9.Hz,formatted:`0 ${t9.Hz}`};let a=Math.abs(e);a>=1e6?(r=e/1e6,n=t9.GHz):a>=1e3?(r=e/1e3,n=t9.MHz):a>=1?(r=e,n=t9.kHz):(r=1e3*e,n=t9.Hz);let i=Number.parseFloat(r.toFixed(t)).toString(),o=`${i} ${n}`;return{value:r,unit:n,formatted:o}},rD=(e,t=3)=>rC(1e3*e,t),rz=(e,t=3)=>rC(e/1e3,t),rN=5,rE=2;function rT(e){if(null!=e.frequency&&null!=e.bandwidth){let t=e.bandwidth/1e3/2;return{startFreq:e.frequency-t,stopFreq:e.frequency+t}}return null!=e.startFrequency&&null!=e.stopFrequency?{startFreq:Number(e.startFrequency),stopFreq:Number(e.stopFrequency)}:null}function rR(e,t){let r=t.stop-t.start,n=Math.ceil((e.startFreq-t.start)/r*t.point)-1,a=Math.floor((e.stopFreq-t.start)/r*t.point)-1;return{startIndex:n=Math.max(n,0),stopIndex:a=Math.min(a,t.point-1)}}function rA(e,t,r=5){let{startIndex:n,stopIndex:a}=rR(e,t),i=t.frequencyCache,o=n,l=a;for(let a=Math.max(0,n-r);a<=Math.min(t.point-1,n+r);a++)if(Number(i[a]?.frequency)>=e.startFreq){o=a;break}for(let n=Math.max(0,a-r);n<=Math.min(t.point-1,a+r);n++){let t=Number(i[n]?.frequency);if(t<=e.stopFreq&&(l=n),t>e.stopFreq)break}return{startIndex:n=Math.max(o,0),stopIndex:a=Math.min(l,t.point-1)}}function rI(e,t){let r=(e.stopIndex-e.startIndex+1)/t.point*100;return{left:e.startIndex/t.point*100,width:r}}function rP(e,t){let r=rA(e,t);return{...rI(r,t),...r}}function rL(e,t){if(!t?.length)return{segmentIndex:-1,pointIndex:-1};let r=t.reduce((e,t)=>e+t.point,0),n=0,a=e/100;for(let e=0;e<t.length;e++){let i=t[e].point/r;if(a>=n&&a<=n+i){let r=(a-n)/i,o=Math.max(0,Math.min(t[e].point-1,Math.ceil(r*t[e].point)-1));return{segmentIndex:e,pointIndex:o}}n+=i}return{segmentIndex:-1,pointIndex:-1}}function rO(e,t){let r=e[t.segmentIndex];if(!r?.frequencyCache?.length)return 0/0;let n=Math.max(0,Math.min(r.frequencyCache.length-1,t.pointIndex));return Number(r.frequencyCache[n]?.frequency)}function rq(e,t,r=2){return!(e+r<t.startIndex||e-r>t.stopIndex)}function r$(e,t){return e>=t.startFreq&&e<=t.stopFreq}function r_(e,t){return!(e.stopFreq<t.start||e.startFreq>t.stop)}let rj=e=>"[object Object]"===Object.prototype.toString.call(e)&&null!==e,rH=(e,t)=>{let r={...e};return Object.keys(r).forEach(e=>{let n=t[e];rj(n)&&rj(r[e])?r[e]={...r[e],...n}:void 0!==n&&(r[e]=n)}),r};function rB(e=()=>{},t=1e3/30){let r=0;return(...n)=>{let a=Date.now();a-r>=t&&(e(...n),r=a)}}function rW(e=()=>{}){let t=!1,r=null,n=null,a=a=>{a?.nativeEvent&&a.persist&&a.persist(),r=a?.currentTarget?{currentTarget:a.currentTarget,target:a.target??null,clientX:a.clientX,clientY:a.clientY,buttons:a.buttons,nativeEvent:a.nativeEvent,_originalEvent:a}:a,t||(t=!0,n=requestAnimationFrame(()=>{n=null,t=!1;let a=r;r=null,e(a)}))};return a.flush=()=>{if(!t)return;null!==n&&cancelAnimationFrame(n),n=null,t=!1;let a=r;r=null,e(a)},a.cancel=()=>{null!==n&&cancelAnimationFrame(n),n=null,t=!1,r=null},a}function rG(e=()=>{},t){let r=null;return n=>{r&&clearTimeout(r),r=setTimeout(()=>{e(n)},t||100)}}let rY=(e,t=1e3/30)=>{let r=null,n=(...n)=>{r&&clearTimeout(r),r=setTimeout(()=>{e(...n)},t)};return n.cancel=()=>{r&&(clearTimeout(r),r=null)},n};function rU(e=()=>{}){let t=!1;return(...r)=>{t||(t=!0,requestAnimationFrame(()=>{e(...r),t=!1}))}}let rX=(e=Date.now(),t)=>{if(null==e)return"";let r=0;"number"==typeof e?(r=e)>0&&r<1e10&&(r*=1e3):r=e.getTime();let n=new Date(r);if(!Number.isFinite(n.getTime()))return"";let{dateSeparator:a="-",timeSeparator:i=":",timeOnly:o=!1}=t??{},l=n.getFullYear(),s=`${n.getMonth()+1}`.padStart(2,"0"),c=`${n.getDate()}`.padStart(2,"0"),u=`${n.getHours()}`.padStart(2,"0"),d=`${n.getMinutes()}`.padStart(2,"0"),h=`${n.getSeconds()}`.padStart(2,"0"),p=`${u}${i}${d}${i}${h}`;if(o)return p;let f=`${l}${a}${s}${a}${c}`;return`${f} ${p}`},rK=(e,t="-",r=":",n=!1)=>{if("string"!=typeof e)return console.error("dateTimeToTimestamp: 输入必须是字符串"),-1;let a=0,i=0,o=0,l=0,s=0,c=0;if(n){let t=e.split(r);if(3!==t.length)return -1;l=parseInt(t[0],10)||0,s=parseInt(t[1],10)||0,c=parseInt(t[2],10)||0;let n=new Date;return new Date(n.getFullYear(),n.getMonth(),n.getDate(),l,s,c).getTime()}let u=e.split(" ");if(2!==u.length)return -1;let[d,h]=u,p=d.split(t);if(3!==p.length)return -1;a=parseInt(p[0],10)||0,i=parseInt(p[1],10)||0,o=parseInt(p[2],10)||0;let f=h.split(r);return 3!==f.length?-1:(l=parseInt(f[0],10)||0,new Date(a,i-1,o,l,s=parseInt(f[1],10)||0,c=parseInt(f[2],10)||0).getTime())},rV=()=>((1+Math.random())*65536|0).toString(16).substring(1),rQ=Symbol.for("rfkit.charts.id-counter"),rZ=()=>{if(globalThis.crypto?.randomUUID)return globalThis.crypto.randomUUID();let e=globalThis,t=(e[rQ]??0)+1;return e[rQ]=t,`rfkit-${t.toString(36)}`},rJ=(e,t)=>e&&Array.isArray(e)?Array.from({length:e.length},(r,n)=>{let a=e[n],i=new Float32Array(a.length);return i.set(a),i.timestamp=t?.[n],i}):[],r0={Position:"position",CenterBandwidth:"centerBandwidth",FrequencyRange:"frequencyRange"},r1={kind:r0.Position,show:!1,left:void 0,width:0,color:""},r2=(e,t)=>Object.hasOwn(e,t),r5=e=>"number"==typeof e&&Number.isFinite(e),r4=e=>void 0===e||"string"==typeof e,r3=e=>void 0===e||null!==e&&"object"==typeof e&&!Array.isArray(e)&&["name","organization","modulation","remark"].every(t=>{let r=e[t];return void 0===r||"string"==typeof r}),r6=e=>(!Object.hasOwn(e,"show")||"boolean"==typeof e.show)&&(!Object.hasOwn(e,"color")||void 0===e.color||"string"==typeof e.color)&&r4(e.label)&&r3(e.details),r8=(e,t,r)=>{let n=Object.hasOwn(e,"label")?e.label:"merge"===r?t.label:void 0,a=Object.hasOwn(e,"details")?e.details:"merge"===r?t.details:void 0;return{show:"boolean"==typeof e.show?e.show:"merge"!==r||t.show,color:Object.hasOwn(e,"color")?e.color:"merge"===r?t.color:void 0,...void 0!==n||void 0!==t.label?{label:n}:{},...void 0!==a||void 0!==t.details?{details:a}:{}}};function r9(e,t=r1,r="replace"){if(!r6(e))return t;let n=Object.hasOwn(e,"left")||Object.hasOwn(e,"width"),a=Object.hasOwn(e,"frequency")||Object.hasOwn(e,"bandwidth"),i=Object.hasOwn(e,"startFrequency")||Object.hasOwn(e,"stopFrequency");if(Number(n)+Number(a)+Number(i)>1)return t;let o=r8(e,t,r);if(a)return r5(e.frequency)&&r5(e.bandwidth)&&!(e.bandwidth<=0)?{kind:r0.CenterBandwidth,...o,frequency:e.frequency,bandwidth:e.bandwidth}:t;if(i)return r5(e.startFrequency)&&r5(e.stopFrequency)&&!(e.stopFrequency<=e.startFrequency)?{kind:r0.FrequencyRange,...o,startFrequency:e.startFrequency,stopFrequency:e.stopFrequency}:t;if(n){if(Object.hasOwn(e,"left")&&void 0!==e.left&&!r5(e.left)||Object.hasOwn(e,"width")&&void 0!==e.width&&!r5(e.width))return t;let n=t.kind===r0.Position?t:void 0;return{kind:r0.Position,...o,left:Object.hasOwn(e,"left")?e.left:"merge"===r?n?.left:void 0,width:Object.hasOwn(e,"width")?e.width??0:"merge"===r?n?.width??0:0}}return{...t,...o}}let r7=a.createContext(null),ne=r7;var nt=/*#__PURE__*/function(e){return e.Normal="normal",e.DDC="ddc",e}({}),nr=/*#__PURE__*/null,nn=/*#__PURE__*/function(e){return e.Area="area",e.Slider="slider",e.RowIndex="rowIndex",e}({});let na={dBm:[-300,300],dBμV:[-300,300]},ni=[5,10,20,30],no=20,nl=["dBμV","dBμV/m","dBm","dBm/m"],ns=[-20,100],nc=null,nu={lite:"lite",inside:"inside",default:""},nd=1001,nh={start:0,end:1001},np=1;function nf(){return{globalID:"",config:t0(),system:{width:0,height:0,padding:0,border:!0,borderRadius:!0,onChange:()=>{}},eventBus:{onDoubleClick:()=>{}},axisY:{show:!0,placement:t7.Outside,disabled:!1,gradientRibbon:!0,defaultRange:ns,realRange:ns,range:ns,renderRange:ns,restrict:na["dBμV"],autoranging:!1,step:no,unit:nl["0"],unitList:nl,fieldStrengthUnitAvailable:!1,unitDisabled:!1,type:nu.default,hidden:[],linkage:!0,onChange:()=>{}},axisX:{show:!0,labelMode:re.Auto,range:[],unit:"MHz",unitKHz:"kHz",ticks:!0,children:null,onChange:()=>{},frequencyFormat:()=>""},toolbar:{show:!0,hiddenTools:[]},series:{maxPoints:1001,zoomMinSimulateWave:!1,dataRate:1,forceDisplay:!1,legendExternal:[rc.ThresholdData,rc.TemplateData,rc.BackgroundNoiseData],enableMetrics:void 0,enableWaterfall:void 0,enableLengthSyncFastMode:!1},segments:[],points:[],marker:{fixed:!1,readonly:!1,enabled:!0,visible:!1,mode:nt.Normal,maxCount:5,fifo:!1,onChange:()=>{}},limit:{disabled:!1,show:!1,active:!0,value:[20],range:na["dBμV"],label:"",unified:!1,onChange:()=>{}},heatmapCapture:{type:nn.Area,show:!1,display:!1,sync:!1,interval:{startIndex:-1,endIndex:-1},dataNow:[],onChange:()=>{}},waterfallViewport:{range:{x:[0,0],y:[0,0]},sourceSize:{width:0,height:0}},cursor:{show:!0,active:!0,crosshair:!1,event:null,coord:{left:0,top:0},timeout:0,mode:void 0},zoom:{show:!0,xy:!1,overview:{show:!1},select:!1,interval:nh,style:null,isScanSegmentsUpdateMagnify:!1,onChange:()=>{},autoCloseTimeout:31536e6},signal:{show:!0,display:!1,templateDetection:!1,data:[],hiddenCategoryKeys:[],showCount:!0,onChange:()=>{}},signalAnalysis:{show:!0,display:!1,onChange:()=>{}},band:{kind:r0.Position,show:!1,left:void 0,width:0,color:""},scope:{show:!1,left:0,width:0,onChange:()=>{}},gridLines:!0,legend:{children:null},frequencyTagLine:{show:!0,display:!1,left:-100,onChange:()=>{}},stripe:{show:!0,display:!1,defaultLeft:40,defaultRight:60,left:40,right:60,onChange:()=>{}},blaze:{show:!1},frequencyAllocation:{show:!0,display:!0,data:[]},timeRange:0,levelStream:{cacheTime:2e4,granularity:1,maxPoints:500},fluorescence:{show:!1,display:!1,renderMode:k.Gaussian},deltaMeasurement:{show:!0,display:!1,onChange:()=>{}}}}let nm=50,ng=e=>e+10*Math.log10(50)+90,nb=e=>Math.sqrt(50*10**(e/10-3)),nv=e=>10**(e/10),ny=e=>e-90-10*Math.log10(50),nw=e=>10**(e/20-6),nx=e=>1e6*nw(e),nk=e=>10**(e/10-9)/50,nS=e=>e<=0?-200:30+20*Math.log10(e)-10*Math.log10(50),nM=e=>e<=0?-200:20*(Math.log10(e)+6),nF=e=>1e3*e**2/50,nC=e=>e<=0?-50:10*Math.log10(e),nD=e=>e<=0?-200:10*Math.log10(50*e)+90,nz=e=>(.001*e*50)**.5,nN=e=>e?e.map(e=>+e||0===e?ny(e):void 0):[],nE={flaw:0,offset:0,range:[0,0],renderRange:[0,0]},nT=(e,t)=>tS(`VIRTUAL_RANGE-${e}`,t,nE);function nR({unit:e,realRange:t=[0,0],step:r=1,globalID:n}){let{offset:a,flaw:i}=nE,o=[t[0]??0,t[1]??0],l=[t[0]??0,t[1]??0];if(e&&rg(e)){let e=ny(0);i=e%r,a=e-i,o=[t[0]+a,t[1]+a],l=[t[0]-i,t[1]-i]}let s={offset:a,range:o,renderRange:l,flaw:i};return nT(n,s),s}function nA({range:e,unit:t,step:r,globalID:n}){let a=e,i=e;if(t&&rg(t)){let t=nT(n),o=ny(0),l=o%(r??1),s=0!==t.offset||0!==t.flaw,c=void 0===r&&s?t.flaw:l,u=void 0===r&&s?t.offset:o-l;i=[(a=[e[0]-u,e[1]-u])[0]-c,a[1]-c],nT(n,{offset:u,flaw:c,range:e,renderRange:i})}return{realRange:a,renderRange:i}}function nI(e,t){return rg(e)?ny(t):t}function nP(e,t,r){return tF(`useKeyEvent-${e}`,t,r,e)}function nL(e){if(!e||!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}let nO=(e,t)=>r=>{if(!r||nL(r.target))return;let n=["a","d","w","s","m"].includes(r.key.toLowerCase()),a=r.ctrlKey||r.altKey;if(!n&&!a)return;let i=document.getElementById(t),o=document.activeElement;!i||!o||(o===i||i.contains(o))&&nP(e,t)(r)};function nq(e,t){h(()=>{if(e&&t){let r=nO(e,t);return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}}},[e,t])}let n$=e=>{let{min:t,max:r}=e,n=r-t,a=10;switch(!0){case n>=90:a=20;break;case n>=45:a=10;break;default:a=5}return{diff:n,step:a,middle:t+n/2}};class n_{state={axisY:{step:no,realRange:ns,restrict:na["dBμV"]},onChange:()=>{}};constructor(e){this.update(e)}update(e){let t={...this.state,...e};this.state={...t}}setAxisY(e){let{axisY:t}=this.state;this.update({axisY:{...t,...e}})}focus({isHand:e,step:t}={}){let{axisY:r,globalID:n}=this.state,{realRange:a}=r;if(!a||!n)return;let i=tO(n).getAllRawData?.(),o=i[t5.realData.name]||new Float32Array,l=i[t5.maxData.name]||new Float32Array,s=i[t5.minData.name]||new Float32Array,c=tU([...Array.from(o),...Array.from(l),...Array.from(s)]),{avg:u}=c;void 0===u&&(u=10);let d=t||r.step,h=n$(c),{min:p=0,max:f=0}=c,[m,g]=a,{middle:b}=h;!t&&(e||p<m||g<f)&&(d=h.step);let v=(Math.round(b/d)-5)*d;Number.isNaN(v)&&(v=-20);let y=v+10*d;this.setAxisY({step:d,realRange:[v,y]}),this.onChange()}move(e){let{axisY:{realRange:[t,r],restrict:n}}=this.state;if(r>=n[1]&&e>0||t<=n[0]&&e<0)return;let a=e*(r-t),[i,o]=[t+a,r+a];this.setAxisY({realRange:[i,o]}),this.onChange()}moveBoundary(e,t){let{axisY:{realRange:[r,n],step:a}}=this.state,[i,o]=[r,n];!e&&t&&(o+=a),e&&t&&(o-=a),e||t||(i+=a),e&&!t&&(i-=a),o<=i+1&&(t&&(o=i+1),t||(i=o-1));let l=20*a;o-i>=l&&(t&&(o=i+l),t||(i=o-l)),this.setAxisY({realRange:[i,o]}),this.onChange()}moveWheel(e){let{axisY:{realRange:[t,r]}}=this.state,n=e.currentTarget.getBoundingClientRect(),a=e.clientY-n.top,i=n.height,o=e.deltaY>0?1.1:.9;this.zoom(o,r-a/i*(r-t))}zoom(e,t){let{axisY:{realRange:[r,n],step:a,restrict:i}}=this.state,o={min:t-(t-r)*e,max:t+(n-t)*e},[l,s]=i,c=Math.abs(s-l),u=Math.max(l,o.min),d=Math.min(s,o.max),h=Math.max(Number.EPSILON,Math.min(a/100,c/100));if(d-u<h){let e=(u+d)/2;u=Math.max(l,e-h/2),d=Math.min(s,e+h/2)}this.setAxisY({realRange:[u,d]}),this.onChange()}moveStep(e){let{axisY:{realRange:[t,r],step:n,restrict:a}}=this.state,i=e?n:-n,[o,l]=[t+i,r+i];(e?l>a[1]:o<a[0])&&(o=t,l=r),this.setAxisY({realRange:[o,l]}),this.onChange()}onChange(){let{axisY:{realRange:[e,t],restrict:r,unit:n}}=this.state,a=nR({realRange:this.state.axisY.realRange,unit:this.state.axisY.unit,step:this.state.axisY.step,globalID:this.state.globalID}),i=rg(n)?a.offset:0,o=e<r[0]-i,l=t>r[1],s=e,c=t;o&&(c=(s=r[0]-i)+(t-e)),l&&([,c]=r),this.setAxisY({realRange:[s,c]}),this.state.onChange(this.state.axisY)}}let nj=(e,t)=>tF(`useRangeAutoFocus-${e}`,"0",t,e),nH=(e,t)=>tF(`useRangeMove-${e}`,"0",t,e),nB=(e,t)=>tF(`useRangeZoom-${e}`,"0",t,e),nW=(e,t)=>tF(`useRangeSet-${e}`,"0",t,e),nG=n_,nY=({chart:e})=>{let{state:{axisY:t,series:r,globalID:n},dispatch:a}=ae(),{realRange:i,renderRange:o,step:l,unit:s,onChange:c,autoranging:d,disabled:p}=t,f=m(()=>new n_({axisY:t}),[t]);h(()=>{n&&f.update?.({globalID:n})},[n,f]),h(()=>{f.update?.({axisY:t})},[f,JSON.stringify(t)]),h(()=>{f.update?.({series:r})},[f,JSON.stringify(r)]);let g=u(e=>{if(n){let t=nR({unit:s,...e,globalID:n});a({payload:r=>({axisY:{...r.axisY,realRange:e.realRange,step:e.step,range:t.range,renderRange:t.renderRange}})}),c?.({range:t.range,step:e.step})}},[s,c,n,a]);return h(()=>{f.state.onChange=e=>{g(e)}},[f,g]),h(()=>{g({realRange:i,step:l}),f?.update({unit:s})},[s]),h(()=>{o&&e?.setRange?.(o)},[e,o]),h(()=>{n&&nj(n,()=>{f?.focus()})},[n,f]),h(()=>{f?.focus({step:l})},[l]),h(()=>{e?.updateParams?.({autoranging:d})},[d]),h(()=>{n&&nH(n,e=>{p||f.move?.(e)})},[f,n,p]),h(()=>{if(n)return nB(n,(e,t)=>{p||f.zoom?.(e,t)})},[f,n,p]),h(()=>{n&&nP(n,"ticks",e=>{"ArrowUp"===e.code&&f.move?.(.1),"ArrowDown"===e.code&&f.move?.(-.1)})},[f,n]),f},nU=nY,nX=e=>[e[0],e[1]],nK=(e,t)=>void 0!==e&&void 0!==t&&e[0]===t[0]&&e[1]===t[1],nV=e=>{if(!e)return e;let t=e.range??e.defaultRange;return t?{...e,realRange:nX(t),range:nX(t),renderRange:nX(t)}:e};function nQ(e,t,r){let n=(r||nf())[e];return t?"object"!=typeof t||null===t?t:rH(n,t):n}function nZ(e){return e&&void 0!==e.unit&&void 0===e.unitDisabled?{...e,unitDisabled:!0}:e}let nJ=["axisX","legend","marker","limit","heatmapCapture","deltaMeasurement","zoom","cursor","signal","scope","eventBus","blaze","stripe","signalAnalysis","series","frequencyTagLine","frequencyAllocation","toolbar","gauge","band","levelStream","fluorescence","onChannelChange"],n0=e=>{let t=d(r7);if(!t)throw Error("Params must be used within a StoreProvider");let{dispatch:r,store:n}=t,a=v(n.subscribe,()=>n.getState().globalID,()=>n.getState().globalID),i=g({}),o=g(""),l=g(void 0),s=g(void 0);return h(()=>{let t={},a=!1,o=n.getState();for(let r of nJ){let n=e[r],l=i.current[r];if(void 0!==n&&n!==l){if("band"===r){let e=r9(n,o.band,"merge");e!==o.band&&(t.band=e,a=!0);continue}t[r]=nQ(r,n,o),a=!0}}i.current={...e},a&&r({payload:t})},[r,e.axisX,e.legend,e.marker,e.limit,e.heatmapCapture,e.zoom,e.cursor,e.signal,e.scope,e.eventBus,e.blaze,e.stripe,e.signalAnalysis,e.series,e.frequencyTagLine,e.frequencyAllocation,e.toolbar,e.gauge,e.band,e.levelStream,e.fluorescence,e.onChannelChange,n]),h(()=>{void 0!==e.gridLines&&r({payload:{gridLines:e.gridLines}})},[e.gridLines]),h(()=>{if(!a)return;let t=nZ(e.axisY),i=o.current!==a,c=l.current,u=s.current;if(o.current=a,l.current=t?.range?nX(t.range):void 0,s.current=t?.unit,!t)return;let{range:d,...h}=t,p=void 0!==d&&(i||!nK(d,c)||t.unit!==u)?d:i?t.defaultRange:void 0,f=n.getState(),m=void 0===p?h:{...h,range:p};if(p){let e=t.unit??f.axisY.unit;if(e&&rg(e)){let{realRange:r,renderRange:n}=nA({range:p,unit:e,step:t.step??f.axisY.step,globalID:a});m.realRange=r,m.renderRange=n}else m.realRange=nX(p),m.renderRange=nX(p)}r({payload:{axisY:nQ("axisY",m,f)}})},[r,a,e.axisY,n]),null},n1=n0,n2=(e,t)=>"function"==typeof t?t(e):t,n5=(e,t)=>{let r=n2(e,t.payload);if(!r)return e;if(t.replace)return r;let n=Object.keys(r);return n.length>0&&n.every(t=>Object.is(e[t],r[t]))?e:{...e,...r}};function n4(e){let t=e,r=new Set,n=e=>{if(Object.is(e,t))return t;for(let n of(t=e,Array.from(r)))n();return t},a=e=>n(e(t));return{dispatch:e=>a(t=>n5(t,e)),getState:()=>t,setState:n,subscribe:e=>(r.add(e),()=>{r.delete(e)}),updateState:a}}let n3=new Map,n6=e=>e?n3.get(e)??null:null;function n8(e){let t=n4(e),r=new Set,n=e.globalID,a=!1,i={destroy:()=>{if(!a){for(let e of(a=!0,o(),Array.from(r)))e();r.clear(),n&&n3.get(n)===i&&n3.delete(n)}},dispatch:e=>t.dispatch(e),getGlobalID:()=>n,getState:()=>t.getState(),registerCleanup:e=>{if(!e)return null;let t=!1,n=()=>{t||(t=!0,r.delete(n),e())};return r.add(n),n},setGlobalID:e=>{!a&&e!==n&&(n&&n3.get(n)===i&&n3.delete(n),(n=e)&&n3.set(n,i))},store:t,subscribe:t.subscribe};n&&n3.set(n,i);let o=t.subscribe(()=>{i.setGlobalID(t.getState().globalID)});return i}let n9=e=>{let t=!1;return queueMicrotask(()=>{t||e()}),()=>{t=!0}};function n7(){let e=d(r7);if(!e)throw Error("useStore must be used within a StoreProvider");return e}function ae(){let{dispatch:e,runtime:t,store:r}=n7();return{dispatch:e,runtime:t,state:v(r.subscribe,r.getState,r.getState),store:r}}function at(e){let{store:t}=n7();return v(t.subscribe,()=>e(t.getState()),()=>e(t.getState()))}function ar(){return n7()}function an(){return n7().dispatch}let aa=e=>{let{children:t}=e,a=g(null);if(!a.current){let t=nf(),r=rH(t,{...e,axisY:nV(nZ(e.axisY))});e.band&&(r.band=r9(e.band,t.band,"merge")),a.current=r}let i=g(null);if(!i.current&&a.current&&(i.current=n8(a.current)),!i.current)throw Error("Failed to initialize chart runtime");let o=i.current,{dispatch:l,store:s}=o,c=v(s.subscribe,()=>s.getState().globalID,()=>s.getState().globalID),u=g(c),d=g(null);h(()=>{u.current=c,o.setGlobalID(c)},[c,o]),h(()=>(d.current?.(),d.current=null,()=>{d.current=n9(()=>{o.destroy(),tP([u.current]),d.current=null})}),[o]);let p=m(()=>({dispatch:l,runtime:o,store:s}),[l,o,s]);return /*#__PURE__*/n(r7.Provider,{value:p,children:[/*#__PURE__*/r(n0,{...e}),t]})},ai=aa,ao=({children:e})=>{let{state:{system:{padding:t}}}=ae();return /*#__PURE__*/r("div",{className:"h-full w-full",style:{...eA},[ez]:"true",children:/*#__PURE__*/r("div",{className:"relative flex h-full w-full select-none flex-col overflow-hidden bg-background pt-0 text-foreground",style:{padding:t?"calc(var(--size-gap-base) * 2)":0},children:e})})},al=/*#__PURE__*/a.memo(ao),as=(e,t)=>tA(e,t),ac=({publish:e,resetViewport:t,subscribe:r=()=>{}})=>{let n=at(e=>e.globalID),a=an(),i=g(r),o=g(e),l=g(t);i.current=r,o.current=e,l.current=t;let s=u(()=>tO(n),[n]);h(()=>{if(n)return tA(n,(...e)=>i.current(...e))},[n]),h(()=>{if(n){let e=tA(n,void 0);e.getSourceData=s,e.resetViewport=()=>l.current?.(),a({payload:{publish:e}}),o.current?.(e)}},[n,s,a])},au=ac;function ad(){let e=g(null);e.current||(e.current=tH());let t=e.current,r=m(()=>({get current(){return t.enhancedPublish},set current(e){e&&"function"==typeof e&&t.attachPublish(e)}}),[t]);return h(()=>()=>t.dispose(),[t]),{publish:t.publish,chartRef:r}}let ah=e=>e?{height:e.offsetHeight,width:e.offsetWidth}:null,ap=(e,t)=>e&&t?e.width!==t.width||e.height!==t.height:e!==t,af=(e,t)=>({...e,height:t.height,width:t.width}),am=e=>{let{children:t,style:n}=e,a=an(),i=at(e=>e.system),o=m(()=>rZ(),[]),l=g(null),s=g(i),c=g(null),u=g(()=>{});s.current=i,u.current=()=>{o&&tA(o,void 0)({pstype:rn.Resize})},h(()=>{o&&a({payload:{globalID:o}})},[a,o]);let d=g(rW(()=>{u.current()}));return h(()=>{if(!o||!l.current)return;let e=e=>{let t=ah(l.current);if(!t||!ap(c.current,t))return;c.current=t;let r=af(s.current,t);a({payload:{system:r}}),r.onChange(r),e&&t.width>0&&t.height>0&&d.current()};if(e(!1),"u"<typeof ResizeObserver)return;let t=new ResizeObserver(()=>{e(!0)});return t.observe(l.current),()=>{t?.disconnect()}},[a,o]),/*#__PURE__*/r("div",{className:"relative h-full w-full select-none",style:n,[ez]:"true",ref:l,children:/*#__PURE__*/r(al,{children:t})})},ag=am;function ab(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=ab(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function av(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=ab(e))&&(n&&(n+=" "),n+=t);return n}let ay=null,aw=(e,t)=>{let r=Array(e.length+t.length);for(let t=0;t<e.length;t++)r[t]=e[t];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},ax=(e,t)=>({classGroupId:e,validator:t}),ak=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),aS="-",aM=[],aF="arbitrary..",aC=e=>{let t=aN(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return az(e);let r=e.split("-"),n=+(""===r[0]&&r.length>1);return aD(r,n,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=n[e],a=r[e];return t?a?aw(a,t):t:a||aM}return r[e]||aM}}},aD=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let n=e[t],a=r.nextPart.get(n);if(a){let r=aD(e,t+1,a);if(r)return r}let i=r.validators;if(null===i)return;let o=0===t?e.join("-"):e.slice(t).join("-"),l=i.length;for(let e=0;e<l;e++){let t=i[e];if(t.validator(o))return t.classGroupId}},az=e=>{let t,r,n;return -1===e.slice(1,-1).indexOf(":")?void 0:(r=(t=e.slice(1,-1)).indexOf(":"),(n=t.slice(0,r))?"arbitrary.."+n:void 0)},aN=e=>{let{theme:t,classGroups:r}=e;return aE(r,t)},aE=(e,t)=>{let r=ak();for(let n in e)aT(e[n],r,n,t);return r},aT=(e,t,r,n)=>{let a=e.length;for(let i=0;i<a;i++)aR(e[i],t,r,n)},aR=(e,t,r,n)=>{"string"==typeof e?aA(e,t,r):"function"==typeof e?aI(e,t,r,n):aP(e,t,r,n)},aA=(e,t,r)=>{(""===e?t:aL(t,e)).classGroupId=r},aI=(e,t,r,n)=>{aO(e)?aT(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(ax(r,e)))},aP=(e,t,r,n)=>{let a=Object.entries(e),i=a.length;for(let e=0;e<i;e++){let[i,o]=a[e];aT(o,aL(t,i),r,n)}},aL=(e,t)=>{let r=e,n=t.split("-"),a=n.length;for(let e=0;e<a;e++){let t=n[e],a=r.nextPart.get(t);a||(a=ak(),r.nextPart.set(t,a)),r=a}return r},aO=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,aq=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null),a=(a,i)=>{r[a]=i,++t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(a(e,t),t):void 0},set(e,t){e in r?r[e]=t:a(e,t)}}},a$="!",a_=":",aj=[],aH=(e,t,r,n,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),aB=e=>{let{prefix:t,experimentalParseClassName:r}=e,n=e=>{let t,r=[],n=0,a=0,i=0,o=e.length;for(let l=0;l<o;l++){let o=e[l];if(0===n&&0===a){if(":"===o){r.push(e.slice(i,l)),i=l+1;continue}if("/"===o){t=l;continue}}"["===o?n++:"]"===o?n--:"("===o?a++:")"===o&&a--}let l=0===r.length?e:e.slice(i),s=l,c=!1;return l.endsWith("!")?(s=l.slice(0,-1),c=!0):l.startsWith("!")&&(s=l.slice(1),c=!0),aH(r,c,s,t&&t>i?t-i:void 0)};if(t){let e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):aH(aj,!1,t,void 0,!0)}if(r){let e=n;n=t=>r({className:t,parseClassName:e})}return n},aW=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{let r=[],n=[];for(let a=0;a<e.length;a++){let i=e[a],o="["===i[0],l=t.has(i);o||l?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(i)):n.push(i)}return n.length>0&&(n.sort(),r.push(...n)),r}},aG=e=>({cache:aq(e.cacheSize),parseClassName:aB(e),sortModifiers:aW(e),postfixLookupClassGroupIds:aY(e),...aC(e)}),aY=e=>{let t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let e=0;e<r.length;e++)t[r[e]]=!0;return t},aU=/\s+/,aX=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i,postfixLookupClassGroupIds:o}=t,l=[],s=e.trim().split(aU),c="";for(let e=s.length-1;e>=0;e-=1){let t,u=s[e],{isExternal:d,modifiers:h,hasImportantModifier:p,baseClassName:f,maybePostfixModifierPosition:m}=r(u);if(d){c=u+(c.length>0?" "+c:c);continue}let g=!!m;if(g){let e=(t=n(f.substring(0,m)))&&o[t]?n(f):void 0;e&&e!==t&&(t=e,g=!1)}else t=n(f);if(!t){if(!g||!(t=n(f))){c=u+(c.length>0?" "+c:c);continue}g=!1}let b=0===h.length?"":1===h.length?h[0]:i(h).join(":"),v=p?b+"!":b,y=v+t;if(l.indexOf(y)>-1)continue;l.push(y);let w=a(t,g);for(let e=0;e<w.length;++e){let t=w[e];l.push(v+t)}c=u+(c.length>0?" "+c:c)}return c},aK=(...e)=>{let t,r,n=0,a="";for(;n<e.length;)(t=e[n++])&&(r=aV(t))&&(a&&(a+=" "),a+=r);return a},aV=e=>{let t;if("string"==typeof e)return e;let r="";for(let n=0;n<e.length;n++)e[n]&&(t=aV(e[n]))&&(r&&(r+=" "),r+=t);return r},aQ=(e,...t)=>{let r,n,a,i,o=e=>{let t=n(e);if(t)return t;let i=aX(e,r);return a(e,i),i};return i=l=>(n=(r=aG(t.reduce((e,t)=>t(e),e()))).cache.get,a=r.cache.set,i=o,o(l)),(...e)=>i(aK(...e))},aZ=[],aJ=e=>{let t=t=>t[e]||aZ;return t.isThemeGetter=!0,t.themeKey=e,t},a0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,a1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,a2=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,a5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,a4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,a3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,a6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a8=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,a9=e=>a2.test(e),a7=e=>!!e&&!Number.isNaN(Number(e)),ie=e=>!!e&&Number.isInteger(Number(e)),it=e=>e.endsWith("%")&&a7(e.slice(0,-1)),ir=e=>a5.test(e),ia=()=>!0,ii=e=>a4.test(e)&&!a3.test(e),io=()=>!1,il=e=>a6.test(e),is=e=>a8.test(e),ic=e=>!ih(e)&&!ix(e),iu=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),id=e=>iN(e,iA,io),ih=e=>a0.test(e),ip=e=>iN(e,iI,ii),im=e=>iN(e,iP,a7),ig=e=>iN(e,iO,ia),ib=e=>iN(e,iL,io),iv=e=>iN(e,iT,io),iy=e=>iN(e,iR,is),iw=e=>iN(e,iq,il),ix=e=>a1.test(e),ik=e=>iE(e,iI),iS=e=>iE(e,iL),iM=e=>iE(e,iT),iF=e=>iE(e,iA),iC=e=>iE(e,iR),iD=e=>iE(e,iq,!0),iz=e=>iE(e,iO,!0),iN=(e,t,r)=>{let n=a0.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},iE=(e,t,r=!1)=>{let n=a1.exec(e);return!!n&&(n[1]?t(n[1]):r)},iT=e=>"position"===e||"percentage"===e,iR=e=>"image"===e||"url"===e,iA=e=>"length"===e||"size"===e||"bg-size"===e,iI=e=>"length"===e,iP=e=>"number"===e,iL=e=>"family-name"===e,iO=e=>"number"===e||"weight"===e,iq=e=>"shadow"===e,i$=/*#__PURE__*/Object.defineProperty({__proto__:null,isAny:ia,isAnyNonArbitrary:ic,isArbitraryFamilyName:ib,isArbitraryImage:iy,isArbitraryLength:ip,isArbitraryNumber:im,isArbitraryPosition:iv,isArbitraryShadow:iw,isArbitrarySize:id,isArbitraryValue:ih,isArbitraryVariable:ix,isArbitraryVariableFamilyName:iS,isArbitraryVariableImage:iC,isArbitraryVariableLength:ik,isArbitraryVariablePosition:iM,isArbitraryVariableShadow:iD,isArbitraryVariableSize:iF,isArbitraryVariableWeight:iz,isArbitraryWeight:ig,isFraction:a9,isInteger:ie,isNamedContainerQuery:iu,isNumber:a7,isPercent:it,isTshirtSize:ir},Symbol.toStringTag,{value:"Module"}),i_=()=>{let e=aJ("color"),t=aJ("font"),r=aJ("text"),n=aJ("font-weight"),a=aJ("tracking"),i=aJ("leading"),o=aJ("breakpoint"),l=aJ("container"),s=aJ("spacing"),c=aJ("radius"),u=aJ("shadow"),d=aJ("inset-shadow"),h=aJ("text-shadow"),p=aJ("drop-shadow"),f=aJ("blur"),m=aJ("perspective"),g=aJ("aspect"),b=aJ("ease"),v=aJ("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...w(),ix,ih],k=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto","contain","none"],M=()=>[ix,ih,s],F=()=>[a9,"full","auto",...M()],C=()=>[ie,"none","subgrid",ix,ih],D=()=>["auto",{span:["full",ie,ix,ih]},ie,ix,ih],z=()=>[ie,"auto",ix,ih],N=()=>["auto","min","max","fr",ix,ih],E=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],T=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...M()],A=()=>[a9,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],I=()=>[l,a9,"screen","full","dvw","lvw","svw","min","max","fit",...M()],P=()=>[a9,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],L=()=>[e,ix,ih],O=()=>[...w(),iM,iv,{position:[ix,ih]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",iF,id,{size:[ix,ih]}],_=()=>[it,ik,ip],j=()=>["","none","full",c,ix,ih],H=()=>["",a7,ik,ip],B=()=>["solid","dashed","dotted","double"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>[a7,it,iM,iv],Y=()=>["","none",f,ix,ih],U=()=>["none",a7,ix,ih],X=()=>["none",a7,ix,ih],K=()=>[a7,ix,ih],V=()=>[a9,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ir],breakpoint:[ir],color:[ia],container:[ir],"drop-shadow":[ir],ease:["in","out","in-out"],font:[ic],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ir],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ir],shadow:[ir],spacing:["px",a7],text:[ir],"text-shadow":[ir],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",a9,ih,ix,g]}],container:["container"],"container-type":[{"@container":["","normal","size",ix,ih]}],"container-named":[iu],columns:[{columns:[a7,"auto",ih,ix,l]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{"inset-s":F(),start:F()}],end:[{"inset-e":F(),end:F()}],"inset-bs":[{"inset-bs":F()}],"inset-be":[{"inset-be":F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[ie,"auto",ix,ih]}],basis:[{basis:[a9,"full","auto",l,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[a7,a9,"auto","initial","none",ih]}],grow:[{grow:["",a7,ix,ih]}],shrink:[{shrink:["",a7,ix,ih]}],order:[{order:[ie,"first","last","none",ix,ih]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...E(),"normal"]}],"justify-items":[{"justify-items":[...T(),"normal"]}],"justify-self":[{"justify-self":["auto",...T()]}],"align-content":[{content:["normal",...E()]}],"align-items":[{items:[...T(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...T(),{baseline:["","last"]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...T(),"baseline"]}],"place-self":[{"place-self":["auto",...T()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mbs:[{mbs:R()}],mbe:[{mbe:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],"inline-size":[{inline:["auto",...I()]}],"min-inline-size":[{"min-inline":["auto",...I()]}],"max-inline-size":[{"max-inline":["none",...I()]}],"block-size":[{block:["auto",...P()]}],"min-block-size":[{"min-block":["auto",...P()]}],"max-block-size":[{"max-block":["none",...P()]}],w:[{w:[l,"screen",...A()]}],"min-w":[{"min-w":[l,"screen","none",...A()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh","none",...A()]}],"font-size":[{text:["base",r,ik,ip]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,iz,ig]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",it,ih]}],"font-family":[{font:[iS,ib,t]}],"font-features":[{"font-features":[ih]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ix,ih]}],"line-clamp":[{"line-clamp":[a7,"none",ix,im]}],leading:[{leading:["none",i,...M()]}],"list-image":[{"list-image":["none",ix,ih]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ix,ih]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[a7,"from-font","auto",ix,ip]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[a7,"auto",ix,ih]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"tab-size":[{tab:[ie,ix,ih]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ix,ih]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ix,ih]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ie,ix,ih],radial:["",ix,ih],conic:["",ie,ix,ih]},iC,iy]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:_()}],"gradient-via-pos":[{via:_()}],"gradient-to-pos":[{to:_()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:j()}],"rounded-s":[{"rounded-s":j()}],"rounded-e":[{"rounded-e":j()}],"rounded-t":[{"rounded-t":j()}],"rounded-r":[{"rounded-r":j()}],"rounded-b":[{"rounded-b":j()}],"rounded-l":[{"rounded-l":j()}],"rounded-ss":[{"rounded-ss":j()}],"rounded-se":[{"rounded-se":j()}],"rounded-ee":[{"rounded-ee":j()}],"rounded-es":[{"rounded-es":j()}],"rounded-tl":[{"rounded-tl":j()}],"rounded-tr":[{"rounded-tr":j()}],"rounded-br":[{"rounded-br":j()}],"rounded-bl":[{"rounded-bl":j()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[a7,ix,ih]}],"outline-w":[{outline:["",a7,ik,ip]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","inner","none",u,iD,iw]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,iD,iw]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[a7,ip]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,iD,iw]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[a7,ix,ih]}],"mix-blend":[{"mix-blend":[...W(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":W()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[a7]}],"mask-image-linear-from-pos":[{"mask-linear-from":G()}],"mask-image-linear-to-pos":[{"mask-linear-to":G()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":G()}],"mask-image-t-to-pos":[{"mask-t-to":G()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":G()}],"mask-image-r-to-pos":[{"mask-r-to":G()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":G()}],"mask-image-b-to-pos":[{"mask-b-to":G()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":G()}],"mask-image-l-to-pos":[{"mask-l-to":G()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":G()}],"mask-image-x-to-pos":[{"mask-x-to":G()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":G()}],"mask-image-y-to-pos":[{"mask-y-to":G()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[ix,ih]}],"mask-image-radial-from-pos":[{"mask-radial-from":G()}],"mask-image-radial-to-pos":[{"mask-radial-to":G()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[a7]}],"mask-image-conic-from-pos":[{"mask-conic-from":G()}],"mask-image-conic-to-pos":[{"mask-conic-to":G()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ix,ih]}],filter:[{filter:["","none",ix,ih]}],blur:[{blur:Y()}],brightness:[{brightness:[a7,ix,ih]}],contrast:[{contrast:[a7,ix,ih]}],"drop-shadow":[{"drop-shadow":["","none",p,iD,iw]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",a7,ix,ih]}],"hue-rotate":[{"hue-rotate":[a7,ix,ih]}],invert:[{invert:["",a7,ix,ih]}],saturate:[{saturate:[a7,ix,ih]}],sepia:[{sepia:["",a7,ix,ih]}],"backdrop-filter":[{"backdrop-filter":["","none",ix,ih]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[a7,ix,ih]}],"backdrop-contrast":[{"backdrop-contrast":[a7,ix,ih]}],"backdrop-grayscale":[{"backdrop-grayscale":["",a7,ix,ih]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[a7,ix,ih]}],"backdrop-invert":[{"backdrop-invert":["",a7,ix,ih]}],"backdrop-opacity":[{"backdrop-opacity":[a7,ix,ih]}],"backdrop-saturate":[{"backdrop-saturate":[a7,ix,ih]}],"backdrop-sepia":[{"backdrop-sepia":["",a7,ix,ih]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ix,ih]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[a7,"initial",ix,ih]}],ease:[{ease:["linear","initial",b,ix,ih]}],delay:[{delay:[a7,ix,ih]}],animate:[{animate:["none",v,ix,ih]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ix,ih]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:K()}],"skew-x":[{"skew-x":K()}],"skew-y":[{"skew-y":K()}],transform:[{transform:[ix,ih,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":["translate-none"],zoom:[{zoom:[ie,ix,ih]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ix,ih]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ix,ih]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[a7,ik,ip,im]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ij=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:a={},override:i={}})=>(iH(e,"cacheSize",t),iH(e,"prefix",r),iH(e,"experimentalParseClassName",n),iB(e.theme,i.theme),iB(e.classGroups,i.classGroups),iB(e.conflictingClassGroups,i.conflictingClassGroups),iB(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),iH(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),iH(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),iW(e.theme,a.theme),iW(e.classGroups,a.classGroups),iW(e.conflictingClassGroups,a.conflictingClassGroups),iW(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),iG(e,a,"postfixLookupClassGroups"),iG(e,a,"orderSensitiveModifiers"),e),iH=(e,t,r)=>{void 0!==r&&(e[t]=r)},iB=(e,t)=>{if(t)for(let r in t)iH(e,r,t[r])},iW=(e,t)=>{if(t)for(let r in t)iG(e,t,r)},iG=(e,t,r)=>{let n=t[r];void 0!==n&&(e[r]=e[r]?e[r].concat(n):n)},iY=(e,...t)=>"function"==typeof e?aQ(i_,e,...t):aQ(()=>ij(i_(),e),...t),iU=/*#__PURE__*/aQ(i_);function iX(...e){return iU(av(e))}let iK=(e,t)=>{let r=e??{},n=Object.keys(r),a=Object.keys(t);return n.length===a.length&&n.every(e=>Object.is(r[e],t[e]))},iV=e=>{let t=at(e=>e.globalID),{Render:n,params:a,onIDChange:i}=e,o=m(()=>rZ(),[]),[l,s]=b(null),[c,d]=b(null),p=g(i),f=g(null),v=g(a),y=g(null);p.current=i,h(()=>{if(!o||!t||!c)return void s(null);let e=new n({id:o,globalID:t,...a});return s(e),p.current?.(o),()=>{e.dispose?.()}},[n,c,t,o]);let w=u(e=>{d(t=>t===e?t:e)},[]),x=u(e=>/*#__PURE__*/r("div",{id:o,...e,ref:w,className:iX("absolute right-0 top-0 z-[2] flex h-full w-full [&>canvas]:h-full [&>canvas]:w-full [&>canvas]:bg-transparent",e.className)}),[w,o]);return h(()=>(y.current?.(),y.current=null,()=>{y.current=n9(()=>{tP([o]),y.current=null})}),[o]),h(()=>{if(l){let e=a??{};if(f.current!==l){f.current=l,v.current=e;return}iK(v.current??{},e)||(v.current=e,l.updateParams(e))}},[a,l]),{id:o,chart:l,Chart:x}},iQ=iV,iZ=(e,t,r,n="0")=>tI(e,t,r,n),iJ="render",i0="reset",i1="resize",i2=["render"],i5=(e,t,r)=>void 0===e.pstype?r:t.includes(e.pstype),i4=(e,{chart:t,eventHandlers:r,extractData:n,handleRender:a,renderPSTypes:i=i2,treatMissingPSTypeAsRender:o=!1})=>{let{pstype:l}=e;if(l&&r?.[l])return void r[l]?.(e,t);if("reset"===l)return void t.reset();if("clear"===l)return void t.clear?.();if("resize"===l)return void t.resize();if(!i5(e,i,o))return;if(a)return void a(e,t);let s=n?n(e):e;t.updateSeries?.(s)};function i3({moduleType:e,chart:t,extractData:r,renderPSTypes:n,treatMissingPSTypeAsRender:a,handleRender:i,eventHandlers:o}){let l=at(e=>e.globalID),s=g(r),c=g(i),u=g(o),d=g(n),p=n?.join("|")??"__default_render__",f=t?.state?.id??`${e}-${p}`;s.current=r,c.current=i,u.current=o,d.current=n,h(()=>{if(t&&l)return((e,t,r,n="0")=>tI(e,t,r,n))(l,e,e=>{i4(e,{chart:t,eventHandlers:u.current,extractData:s.current,handleRender:c.current,renderPSTypes:d.current,treatMissingPSTypeAsRender:a})},f)},[t,l,e,p,f,a])}let i6=null,i8=()=>"u">typeof window&&"u">typeof document,i9=e=>i8()?e instanceof Element?e.closest(eN)??e??document.documentElement:document.querySelector(eN)??document.documentElement:null,i7=e=>{let t=i9(e);return t?getComputedStyle(t):null},oe=(e,t,r=[])=>{let n=i7(t);if(!n)return"";let a=n.getPropertyValue(e).trim();if(a)return a;for(let e of r){let t=n.getPropertyValue(e).trim();if(t)return t}return""},ot=e=>Math.min(1,Math.max(0,e)),or=e=>{let t=e.replace("#","").trim();if(![3,4,6,8].includes(t.length))return null;let r=t.length<=4?t.split("").map(e=>e+e).join(""):t,n=8===r.length,a=Number.parseInt(r.slice(0,2),16),i=Number.parseInt(r.slice(2,4),16),o=Number.parseInt(r.slice(4,6),16),l=n?Number.parseInt(r.slice(6,8),16)/255:1;return[a,i,o,l].some(e=>Number.isNaN(e))?null:{r:a,g:i,b:o,alpha:l}},on=e=>{let t=e.trim().match(/^rgba?\(\s*([^)]+)\s*\)$/i);if(!t)return null;let[r,n,a,i="1"]=t[1].split(",").map(e=>e.trim()),o={r:Number.parseFloat(r),g:Number.parseFloat(n),b:Number.parseFloat(a),alpha:Number.parseFloat(i)};return Object.values(o).some(e=>Number.isNaN(e))?null:o},oa=(e,t)=>{let r=ot(t),n=e.startsWith("#")?or(e):null,a=n?null:on(e),i=n??a;return i?`rgba(${i.r}, ${i.g}, ${i.b}, ${Number((i.alpha*r).toFixed(4))})`:e},oi=e=>{let t=e.startsWith("#")?or(e):null,r=t?null:on(e),n=t??r;return n?`rgb(${n.r}, ${n.g}, ${n.b})`:e};function oo(e){let t=oe("--foreground",e),r=oe("--primary",e);return{fillStyle:oa(t,176/255),fillStylePrimary:r,fillStyleTransparentBase:oa(t,16/255)}}let ol=(e,t,r)=>{let n=oe(e,r);return void 0!==t?oa(n,t):n},os=()=>{let e=eX(),t=e.followOS?eU():e.theme;return{contractTheme:e.theme,followOS:e.followOS,preference:e.followOS?"system":e.theme,theme:t}};class oc{listeners=new Set;mediaCleanup=null;rootAttributeObserver=null;lastStateKey=null;getStateKey=e=>[e.followOS,e.preference,e.theme,e.contractTheme].join(":");emit=e=>{for(let t of(this.lastStateKey=this.getStateKey(e),Array.from(this.listeners)))t(e)};emitIfChanged=e=>{this.getStateKey(e)!==this.lastStateKey&&this.emit(e)};teardownIfIdle=()=>{this.listeners.size>0||(this.mediaCleanup?.(),this.mediaCleanup=null,this.rootAttributeObserver?.disconnect(),this.rootAttributeObserver=null,this.lastStateKey=null)};ensureMediaSubscription=()=>{if(this.mediaCleanup||!eW())return;let e=eG();if(!e)return;let t=()=>{eX().followOS&&this.emitIfChanged(os())};e.addEventListener("change",t),this.mediaCleanup=()=>{e.removeEventListener("change",t)}};ensureRootAttributeSubscription=()=>{!this.rootAttributeObserver&&eW()&&(this.rootAttributeObserver=new MutationObserver(e=>{for(let t of e)if("attributes"===t.type&&("theme"===t.attributeName||t.attributeName===eO)){this.emitIfChanged(os());break}}),this.rootAttributeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["theme",eO]}))};getState=()=>os();subscribe=e=>{this.listeners.add(e),this.ensureMediaSubscription(),this.ensureRootAttributeSubscription();let t=this.getState();return this.lastStateKey=this.getStateKey(t),e(t),()=>{this.listeners.delete(e),this.teardownIfIdle()}};resetForTests=()=>{this.listeners.clear(),this.teardownIfIdle()}}let ou=new oc,od=()=>ou.getState(),oh=e=>ou.subscribe(e),op=()=>{ou.resetForTests()};class of{state;resizeTimer=null;resizeObserver=null;destroyed=!1;cleanupTasks=new Set;constructor(e){this.state=e,this.init(),this.observeContainerResize()}updateParams(e){this.state={...this.state,...e},this.onParamsUpdated(e)}onParamsUpdated(e){}reset(){this.resize(),this.clear()}resize(){this.state.chart?this.hasRenderableContainerSize()&&this.state.chart?.resize?.():this.initializeChartWhenReady()}clear(){this.state.chart?.clear?.()}destroy(){this.destroyed||(this.beforeDestroy(),this.clearResizeObserver(),this.clearResizeTimer(),this.disposeChartInstance(),this.destroyed=!0)}dispose(){this.destroy()}scheduleResize(e=0){this.clearResizeTimer(),this.resizeTimer=setTimeout(()=>{this.resize(),this.resizeTimer=null},e)}clearResizeTimer(){this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=null)}trackCleanup(e){if(!e)return null;let t=!1,r=()=>{t||(t=!0,this.cleanupTasks.delete(r),e())};return this.cleanupTasks.add(r),r}getContainerElement(){return"u"<typeof document?null:document.getElementById(this.state.id)}getContainerSize(){let e=this.getContainerElement();return e?{width:e.clientWidth,height:e.clientHeight}:null}getMinimumContainerSize(){return{width:1,height:1}}hasRenderableContainerSize(){let e=this.getContainerSize();if(!e)return!1;let t=this.getMinimumContainerSize();return e.width>=t.width&&e.height>=t.height}observeContainerResize(){if("u"<typeof ResizeObserver)return;let e=this.getContainerElement();e&&(this.resizeObserver=new ResizeObserver(()=>{this.state.chart?this.scheduleResize():this.initializeChartWhenReady()}),this.resizeObserver.observe(e))}clearResizeObserver(){this.resizeObserver?.disconnect(),this.resizeObserver=null}runCleanupTasks(){let e=Array.from(this.cleanupTasks);for(let t of(this.cleanupTasks.clear(),e))t()}beforeDestroy(){this.runCleanupTasks()}disposeChartInstance(){this.state.chart?.dispose?.(),this.state.chart=null}initializeChartWhenReady(){!this.state.chart&&this.hasRenderableContainerSize()&&this.init()}}let om=e=>e?.samples instanceof Float32Array?!Number.isFinite(e.sampleRate)||e.sampleRate<=0?{valid:!1,reason:"sampleRate must be a positive finite number",sampleFrames:0}:!Number.isInteger(e.channels)||e.channels<=0?{valid:!1,reason:"channels must be a positive integer",sampleFrames:0}:e.samples.length%e.channels!=0?{valid:!1,reason:"samples length must be divisible by channels",sampleFrames:0}:void 0!==e.startSample&&(!Number.isInteger(e.startSample)||e.startSample<0)?{valid:!1,reason:"startSample must be a non-negative integer",sampleFrames:0}:{valid:!0,sampleFrames:e.samples.length/e.channels}:{valid:!1,reason:"samples must be a Float32Array",sampleFrames:0};class og{storage;head=0;size=0;capacity;constructor(e){if(this.capacity=e,!Number.isInteger(e)||e<=0)throw Error("capacity must be a positive integer");this.storage=new Float32Array(e)}get length(){return this.size}clear(){this.storage.fill(0),this.head=0,this.size=0}resize(e){if(!Number.isInteger(e)||e<=0)throw Error("capacity must be a positive integer");if(e===this.capacity)return;let t=new Float32Array(e),r=Math.min(this.size,e),n=this.size-r;for(let e=0;e<r;e+=1)t[e]=this.at(n+e);this.storage=t,this.capacity=e,this.head=0,this.size=r}append(e){for(let t=0;t<e.length;t+=1)this.size<this.capacity?(this.storage[(this.head+this.size)%this.capacity]=e[t],this.size+=1):(this.storage[this.head]=e[t],this.head=(this.head+1)%this.capacity)}at(e){return e<0||e>=this.size?0/0:this.storage[(this.head+e)%this.capacity]}}let ob=(e,t,r=e.length,n=e.length)=>{let a=Math.max(1,Math.floor(t));if(!e.length){let e=new Float32Array(a),t=new Float32Array(a);return e.fill(0/0),t.fill(0/0),{minData:e,maxData:t,xOffset:0}}let i=Math.max(1,Math.floor(r))/a,o=Math.max(e.length,n),l=o/i,s=Math.floor(l),c=l-s,u=s-1,d=0===c?0:-(t/a*c),h=o-e.length,p=new Float32Array(a),f=new Float32Array(a);p.fill(0/0),f.fill(0/0);for(let t=0;t<a;t+=1){let r=u-(a-1-t);if(r<0)continue;let n=Math.floor(r*i),o=Math.max(n+1,Math.floor((r+1)*i)),l=n-h,s=o-h;if(s<=0||l>=e.length)continue;let c=Math.max(0,Math.floor(l)),d=Math.min(e.length,Math.ceil(s)),m=1/0,g=-1/0;for(let t=c;t<d;t+=1){let r=e.at(t);Number.isFinite(r)&&(m=Math.min(m,r),g=Math.max(g,r))}1/0!==m&&(p[t]=m,f[t]=g)}return{minData:p,maxData:f,xOffset:d}},ov=1048576,oy=10,ow=[-1,1],ox="audio",ok=(e,t)=>Number.isInteger(e)&&void 0!==e&&e>0?e:t,oS=e=>Number.isInteger(e)&&void 0!==e&&e>=0?e:0,oM=(e,t)=>Number.isFinite(e)&&void 0!==e&&e>0?e:t;class oF extends of{samples;sampleRate;channels;totalSamplesReceived=0;drawHandle=null;drawHandleIsAnimationFrame=!1;dirty=!1;paletteConfig;constructor(e){let t=ok(e.maxSamples,1048576);super({id:e.id,globalID:e.globalID,chart:null,maxSamples:t,visibleSeconds:oM(e.visibleSeconds,10),channel:oS(e.channel),palette:e.palette??"level"}),this.samples=new og(t),this.paletteConfig=this.resolvePaletteConfig()}init(){if(this.state.chart)return;let{id:e}=this.state;e&&this.hasRenderableContainerSize()&&(this.paletteConfig=this.resolvePaletteConfig(),this.state.chart=new N({id:e,range:ow,series:[{name:ox,type:M.Envelope,color:this.paletteConfig.color,gradientStops:this.paletteConfig.gradientStops,zeroBaseline:this.paletteConfig.zeroBaseline,display:!0,minData:new Float32Array,maxData:new Float32Array}]}),this.trackCleanup(oh(()=>{this.paletteConfig=this.resolvePaletteConfig(),this.dirty=!0,this.scheduleDraw()})))}updateSeries(e){let t=om(e);if(!t.valid||this.state.channel>=e.channels)return;(void 0!==this.sampleRate&&this.sampleRate!==e.sampleRate||void 0!==this.channels&&this.channels!==e.channels)&&this.clear(),this.sampleRate=e.sampleRate,this.channels=e.channels;let r=this.state.channel,n=new Float32Array(t.sampleFrames);for(let a=0;a<t.sampleFrames;a+=1){let t=e.samples[a*e.channels+r];n[a]=Number.isFinite(t)?Math.max(-1,Math.min(1,t)):0/0}this.samples.append(n),this.totalSamplesReceived+=t.sampleFrames,this.dirty=!0,this.scheduleDraw()}resolvePaletteConfig(){let e=this.getContainerElement(),t=ol("--primary",void 0,e)||"#4371F8",r=ol("--chart-highlight",void 0,e)||t;if("monochrome"===this.state.palette)return{color:t,gradientStops:void 0,zeroBaseline:!1};let n=[{offset:0,color:oa(r,.95)},{offset:.05,color:oa(r,.9)},{offset:.15,color:oa(r,.8)},{offset:.35,color:oa(t,.5)},{offset:.5,color:oa(t,.18)},{offset:.65,color:oa(t,.5)},{offset:.85,color:oa(r,.8)},{offset:.95,color:oa(r,.9)},{offset:1,color:oa(r,.95)}];return{color:t,gradientStops:n,zeroBaseline:{color:t,thickness:1,alpha:.35}}}scheduleDraw(){if(null===this.drawHandle){if("u">typeof window&&"function"==typeof window.requestAnimationFrame){this.drawHandleIsAnimationFrame=!0,this.drawHandle=window.requestAnimationFrame(()=>{this.drawHandle=null,this.drawHandleIsAnimationFrame=!1,this.drawIfNeeded()});return}this.drawHandleIsAnimationFrame=!1,this.drawHandle=setTimeout(()=>{this.drawHandle=null,this.drawIfNeeded()},0)}}cancelScheduledDraw(){null!==this.drawHandle&&(this.drawHandleIsAnimationFrame&&"u">typeof window&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame(this.drawHandle):clearTimeout(this.drawHandle),this.drawHandle=null,this.drawHandleIsAnimationFrame=!1)}drawIfNeeded(){if(!this.dirty||!this.state.chart||!this.hasRenderableContainerSize())return;this.dirty=!1;let e=Math.max(1,this.getContainerSize()?.width??1),t=this.sampleRate?Math.max(1,Math.floor(this.sampleRate*this.state.visibleSeconds)):this.samples.length,r=ob(this.samples,e,t,this.totalSamplesReceived),n=this.paletteConfig??this.resolvePaletteConfig();this.state.chart.render({name:ox,type:M.Envelope,color:n.color,gradientStops:n.gradientStops,zeroBaseline:n.zeroBaseline,display:!0,minData:r.minData,maxData:r.maxData,xOffset:r.xOffset})}clear(){this.cancelScheduledDraw(),this.samples.clear(),this.sampleRate=void 0,this.channels=void 0,this.totalSamplesReceived=0,this.dirty=!1,this.state.chart?.clear()}initializeChartWhenReady(){super.initializeChartWhenReady(),this.state.chart&&this.samples.length>0&&(this.dirty=!0,this.scheduleDraw())}reset(){this.clear(),this.resize()}resize(){super.resize(),this.samples.length>0&&(this.dirty=!0,this.scheduleDraw())}updateParams(e){let t=this.state.channel,r=this.state.maxSamples,n=this.state.palette,a=this.state.visibleSeconds,i={};void 0!==e.maxSamples&&(i.maxSamples=ok(e.maxSamples,1048576)),void 0!==e.visibleSeconds&&(i.visibleSeconds=oM(e.visibleSeconds,10)),void 0!==e.channel&&(i.channel=oS(e.channel)),void 0!==e.palette&&(i.palette=e.palette),super.updateParams(i),this.state.channel!==t&&this.clear(),this.state.maxSamples!==r&&(this.samples.resize(ok(this.state.maxSamples,1048576)),this.dirty=!0,this.scheduleDraw()),this.state.visibleSeconds!==a&&(this.dirty=!0,this.scheduleDraw()),this.state.palette!==n&&(this.paletteConfig=this.resolvePaletteConfig(),this.dirty=!0,this.scheduleDraw())}beforeDestroy(){this.cancelScheduledDraw(),super.beforeDestroy()}}let oC=e=>{let{maxSamples:t,visibleSeconds:n,channel:a,palette:i}=e,{chart:o,Chart:l}=iV({Render:oF,params:m(()=>({maxSamples:t,visibleSeconds:n,channel:a,palette:i}),[a,t,i,n])});return i3({moduleType:rr.AudioWaveform,chart:o,renderPSTypes:[rn.AudioWaveform],extractData:e=>e.data}),/*#__PURE__*/r(l,{})},oD=oC,oz=e=>{let{publish:t,maxSamples:n,visibleSeconds:a,channel:i,palette:o}=e,{state:{globalID:l}}=ae();return ac({publish:t,subscribe:e=>{((e,t,r="0")=>tI(e,t,void 0,r))(l,rr.AudioWaveform)(e)}}),/*#__PURE__*/r(am,{children:/*#__PURE__*/r(oC,{maxSamples:n,visibleSeconds:a,channel:i,palette:o})})},oN=oz,oE=e=>/*#__PURE__*/r(aa,{...e,system:{padding:!1,border:!1},axisY:{show:!1},axisX:{show:!1},toolbar:{show:!1},cursor:{show:!1},zoom:{show:!1},children:/*#__PURE__*/r(oz,{...e})}),oT=tB(oE,"AudioWaveform"),oR=oT,oA="render",oI=(e,t={})=>{let{allowImplicitRender:r=!1,renderPSTypes:n=[]}=t;return e.pstype===oA?e:void 0===e.pstype?r?{...e,pstype:oA}:e:n.includes(e.pstype)?{...e,pstype:oA}:e},oP="u">typeof window?f:h,oL=({children:e})=>{let t=g(null),n=g(null),a=g(null),i=u(()=>{if(n.current&&t.current){let e=Math.min(t.current.clientWidth,t.current.clientHeight);a.current!==e&&(a.current=e,n.current.style.width=`${e}px`,n.current.style.height=`${e}px`)}},[]);return oP(()=>{if(!t.current)return;i();let e=new ResizeObserver(()=>{t.current&&i()});return e.observe(t.current),()=>{e.disconnect()}},[i]),/*#__PURE__*/r("div",{className:"relative h-full min-h-0 w-full min-w-0 overflow-hidden",ref:t,children:/*#__PURE__*/r("div",{className:"absolute inset-0 m-auto flex box-border items-center justify-center",ref:n,children:/*#__PURE__*/r(al,{children:e})})})},oO=oL;class oq extends of{getMinimumContainerSize(){return{width:120,height:120}}subscribeToTheme(){this.trackCleanup(oh(()=>{let e=this.getContainerElement();if(!e)return;let t=oo(e);this.state.chart?.updateProps?.(t),this.resize()}))}updateSeries(e){this.state.chart?.render?.(e)}}let o$="relative flex h-10 min-w-0 w-full items-center justify-between pl-[var(--size-gap-base)] text-xs text-foreground",o_={background:"linear-gradient(to bottom, var(--background), var(--mix-background-86))",boxShadow:"0 1px 4px var(--mix-border-72)"},oj="flex h-full w-max min-w-full items-center gap-[var(--size-gap-base)]",oH="min-w-0 flex-1 overflow-x-auto overflow-y-hidden",oB="self-center",oW=`${oB} h-[18px]`,oG=`${oB} h-3.5`,oY="pointer-events-auto box-border rounded-[var(--radius-group)] bg-secondary text-inherit transition-[background-color,color,opacity] select-none",oU="cursor-pointer appearance-none border-0 hover:bg-accent/72 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/70 focus-visible:ring-offset-1 focus-visible:ring-offset-background",oX="cursor-not-allowed opacity-45 hover:bg-secondary",oK=null,oV={default:"data-[active=true]:bg-accent/72 data-[active=true]:text-foreground data-[active=true]:shadow-[inset_0_0_0_1px_var(--mix-border-72)] data-[active=true]:hover:bg-accent/72",primary:"data-[active=true]:bg-accent/72 data-[active=true]:text-primary data-[active=true]:shadow-[inset_0_0_0_1px_var(--mix-border-72)] data-[active=true]:hover:bg-accent/72",warning:"data-[active=true]:bg-warning/10 data-[active=true]:text-warning data-[active=true]:shadow-[inset_0_0_0_1px_var(--mix-warning-24)] data-[active=true]:hover:bg-warning/12",destructive:"data-[active=true]:bg-destructive/10 data-[active=true]:text-destructive data-[active=true]:shadow-[inset_0_0_0_1px_var(--mix-destructive-24)] data-[active=true]:hover:bg-destructive/12"},oQ="inline-flex h-[26px] min-w-[26px] shrink-0 items-center justify-center",oZ=`${oY} inline-flex h-[26px] min-w-[26px] shrink-0 items-center justify-center px-1 [&_svg]:size-4 [&_svg]:shrink-0 [&>span]:flex [&>span]:items-center [&>span]:justify-center`,oJ="inline-flex h-[26px] shrink-0 items-stretch overflow-hidden rounded-[var(--radius-group)] border border-solid border-border/60 transition-colors",o0=`${oJ} min-w-10 items-center justify-between gap-1 px-[calc(var(--size-gap-base)/2)] hover:bg-accent/72 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/70 focus-visible:ring-offset-1 focus-visible:ring-offset-background`,o1="data-[state=open]:bg-accent/72 data-[state=open]:text-foreground data-[state=open]:shadow-[inset_0_0_0_1px_var(--mix-border-72)] data-[state=open]:hover:bg-accent/72",o2="inline-flex h-full min-h-0 min-w-0 items-center gap-1 p-0 text-inherit focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/70 focus-visible:ring-offset-1 focus-visible:ring-offset-background",o5="inline-flex h-full items-center px-[calc(var(--size-gap-base)/2)] text-primary hover:bg-accent/72 data-[state=open]:bg-accent/72 data-[state=open]:hover:bg-accent/72",o4="h-full rounded-none border-0 bg-transparent shadow-none",o3=`${oY} inline-flex h-[26px] min-w-[26px] shrink-0 items-center px-1`,o6="inline-flex h-[14px] min-w-0 items-center justify-center text-xs leading-none",o8="w-4 justify-center",o9="min-w-8 justify-center text-center",o7="w-[60px] justify-stretch",le="inline-flex h-full min-w-4 shrink-0 items-center justify-center text-primary",lt="inline-flex size-4 shrink-0 items-center justify-center [&_svg]:size-full [&_svg]:shrink-0",lr="border-border/80 bg-secondary/92 text-foreground shadow-[0_10px_28px_var(--mix-background-60)] backdrop-blur-xl";var ln=Object.defineProperty,la=(e,t)=>ln(e,"name",{value:t,configurable:!0}),li=!!("u">typeof window&&window.document&&window.document.createElement);function lo(e,t,{checkForDefaultPrevented:r=!0}={}){return /* @__PURE__ */la(function(n){if(e?.(n),!1===r||!n||!n.defaultPrevented)return t?.(n)},"handleEvent")}function ll(e){if(!li)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}function ls(e){if(!li)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function lc(e,t=!1){let{activeElement:r}=ls(e);if(!r?.nodeName)return null;if(lu(r)&&r.contentDocument)return lc(r.contentDocument.body,t);if(t){let e=r.getAttribute("aria-activedescendant");if(e){let t=ls(r).getElementById(e);if(t)return t}}return r}function lu(e){return"IFRAME"===e.tagName}la(lo,"composeEventHandlers"),la(ll,"getOwnerWindow"),la(ls,"getOwnerDocument"),la(lc,"getActiveElement"),la(lu,"isFrame");var ld=Object.defineProperty,lh=(e,t)=>ld(e,"name",{value:t,configurable:!0});function lp(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function lf(...e){return t=>{let r=!1,n=e.map(e=>{let n=lp(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():lp(e[t],null)}}}}function lm(...e){return $.useCallback(lf(...e),e)}lh(lp,"setRef"),lh(lf,"composeRefs"),lh(lm,"useComposedRefs");var lg=Object.defineProperty,lb=(e,t)=>lg(e,"name",{value:t,configurable:!0});function lv(e,t){let n=$.createContext(t);n.displayName=e+"Context";let a=/* @__PURE__ */lb(e=>{let{children:t,...a}=e,i=$.useMemo(()=>a,Object.values(a));return /* @__PURE__ */r(n.Provider,{value:i,children:t})},"Provider");function i(r,a={}){let{optional:o=!1}=a,l=$.useContext(n);if(l)return l;if(void 0!==t)return t;if(!o)throw Error(`\`${r}\` must be used within \`${e}\``)}return a.displayName=e+"Provider",lb(i,"useContext"),[a,i]}function ly(e,t=[]){let n=[];function a(t,a){let i=$.createContext(a);i.displayName=t+"Context";let o=n.length;n=[...n,a];let l=/* @__PURE__ */lb(t=>{let{scope:n,children:a,...l}=t,s=n?.[e]?.[o]||i,c=$.useMemo(()=>l,Object.values(l));return /* @__PURE__ */r(s.Provider,{value:c,children:a})},"Provider");function s(r,n,l={}){let{optional:c=!1}=l,u=n?.[e]?.[o]||i,d=$.useContext(u);if(d)return d;if(void 0!==a)return a;if(!c)throw Error(`\`${r}\` must be used within \`${t}\``)}return l.displayName=t+"Provider",lb(s,"useContext"),[l,s]}lb(a,"createContext");let i=/* @__PURE__ */lb(()=>{let t=n.map(e=>$.createContext(e));return /* @__PURE__ */lb(function(r){let n=r?.[e]||t;return $.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])},"useScope")},"createScope");return i.scopeName=e,[a,lw(i,...t)]}function lw(...e){let t=e[0];if(1===e.length)return t;let r=/* @__PURE__ */lb(()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return /* @__PURE__ */lb(function(e){let n=r.reduce((t,{useScope:r,scopeName:n})=>{let a=r(e)[`__scope${n}`];return{...t,...a}},{});return $.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])},"useComposedScopes")},"createScope");return r.scopeName=t.scopeName,r}lb(lv,"createContext"),lb(ly,"createContextScope"),lb(lw,"composeContextScopes");var lx=!1,lk=globalThis?.document?$.useLayoutEffect:()=>{},lS=Object.defineProperty,lM=(e,t)=>lS(e,"name",{value:t,configurable:!0}),lF=$[" useEffectEvent ".trim().toString()],lC=$[" useInsertionEffect ".trim().toString()];function lD(e){if("function"==typeof lF)return lF(e);let t=$.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof lC?lC(()=>{t.current=e}):lk(()=>{t.current=e}),$.useMemo(()=>(...e)=>t.current?.(...e),[])}lM(lD,"useEffectEvent");var lz=Object.defineProperty,lN=(e,t)=>lz(e,"name",{value:t,configurable:!0}),lE=$[" useInsertionEffect ".trim().toString()]||lk;function lT({prop:e,defaultProp:t,onChange:r=/* @__PURE__ */lN(()=>{},"onChange"),caller:n}){let[a,i,o]=lR({defaultProp:t,onChange:r}),l=void 0!==e,s=l?e:a;if(lx){let t=$.useRef(void 0!==e);$.useEffect(()=>{let e=t.current;if(e!==l){let t=l?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,n])}return[s,$.useCallback(t=>{if(l){let r=lA(t)?t(e):t;r!==e&&o.current?.(r)}else i(t)},[l,e,i,o])]}function lR({defaultProp:e,onChange:t}){let[r,n]=$.useState(e),a=$.useRef(r),i=$.useRef(t);return lE(()=>{i.current=t},[t]),$.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,n,i]}function lA(e){return"function"==typeof e}lN(lT,"useControllableState"),lN(lR,"useUncontrolledState"),lN(lA,"isFunction");var lI=Symbol("RADIX:SYNC_STATE");function lP(e,t,r,n){let{prop:a,defaultProp:i,onChange:o,caller:l}=t,s=void 0!==a,c=lD(o);if(lx){let e=$.useRef(void 0!==a);$.useEffect(()=>{let t=e.current;if(t!==s){let e=s?"controlled":"uncontrolled";console.warn(`${l} is changing from ${t?"controlled":"uncontrolled"} to ${e}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}e.current=s},[s,l])}let u=[{...r,state:i}];n&&u.push(n);let[d,h]=$.useReducer((t,r)=>{if(r.type===lI)return{...t,state:r.state};let n=e(t,r);return s&&!Object.is(n.state,t.state)&&c(n.state),n},...u),p=d.state,f=$.useRef(p);$.useEffect(()=>{f.current!==p&&(f.current=p,s||c(p))},[p,f,s]);let m=$.useMemo(()=>void 0!==a?{...d,state:a}:d,[d,a]);return $.useEffect(()=>{s&&!Object.is(a,d.state)&&h({type:lI,state:a})},[a,d.state,s]),[m,h]}lN(lP,"useControllableStateReducer");var lL=Object.defineProperty,lO=(e,t)=>lL(e,"name",{value:t,configurable:!0});function lq(e){let t=$.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,l=[];lX(n)&&"function"==typeof lZ&&(n=lZ(n._payload)),$.Children.forEach(n,e=>{if(lY(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;lX(t)&&"function"==typeof lZ&&(t=lZ(t._payload)),i=lB(e,t),l.push(i?.props?.children)}else l.push(e)}),i?i=$.cloneElement(i,void 0,l):!o&&1===$.Children.count(n)&&$.isValidElement(n)&&(i=n);let s=i?lG(i):void 0,c=lm(r,s);if(!i){if(n||0===n)throw Error(o?lQ(e):lV(e));return n}let u=lW(a,i.props??{});return i.type!==$.Fragment&&(u.ref=r?c:s),$.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}lO(lq,"createSlot");var l$=/* @__PURE__ */null,l_=Symbol.for("radix.slottable");function lj(e){let t=/* @__PURE__ */lO(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=l_,t}lO(lj,"createSlottable");var lH=/* @__PURE__ */null,lB=/* @__PURE__ */lO((e,t)=>{if("child"in e.props){let t=e.props.child;return $.isValidElement(t)?$.cloneElement(t,void 0,e.props.children(t.props.children)):null}return $.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function lW(e,t){let r={...t};for(let n in t){let a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{let t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function lG(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function lY(e){return $.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===l_}lO(lW,"mergeProps"),lO(lG,"getElementRef"),lO(lY,"isSlottable");var lU=Symbol.for("react.lazy");function lX(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===lU&&"_payload"in e&&lK(e._payload)}function lK(e){return"object"==typeof e&&null!==e&&"then"in e}lO(lX,"isLazyComponent"),lO(lK,"isPromiseLike");var lV=/* @__PURE__ */lO(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),lQ=/* @__PURE__ */lO(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),lZ=$[" use ".trim().toString()],lJ=Object.defineProperty,l0=(e,t)=>lJ(e,"name",{value:t,configurable:!0}),l1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],l2=l1.reduce((e,t)=>{let n=lq(`Primitive.${t}`),a=$.forwardRef((e,a)=>{let{asChild:i,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),/* @__PURE__ */r(i?n:t,{...o,ref:a})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function l5(e,t){e&&_.flushSync(()=>e.dispatchEvent(t))}l0(l5,"dispatchDiscreteCustomEvent");var l4=null,l3=Object.defineProperty,l6=(e,t)=>l3(e,"name",{value:t,configurable:!0});function l8(e){let t=e+"CollectionProvider",[n,a]=ly(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:/* @__PURE__ */new Map}),l=/* @__PURE__ */l6(e=>{let{scope:t,children:n}=e,a=$.useRef(null);return /* @__PURE__ */r(i,{scope:t,itemMap:$.useRef(/* @__PURE__ */new Map).current,collectionRef:a,children:n})},"CollectionProvider");l.displayName=t;let s=e+"CollectionSlot",c=lq(s),u=$.forwardRef((e,t)=>{let{scope:n,children:a}=e;return /* @__PURE__ */r(c,{ref:lm(t,o(s,n).collectionRef),children:a})});u.displayName=s;let d=e+"CollectionItemSlot",h="data-radix-collection-item",p=lq(d),f=$.forwardRef((e,t)=>{let{scope:n,children:a,...i}=e,l=$.useRef(null),s=lm(t,l),c=o(d,n);return $.useEffect(()=>(c.itemMap.set(l,{ref:l,...i}),()=>void c.itemMap.delete(l))),/* @__PURE__ */r(p,{...{[h]:""},ref:s,children:a})});function m(t){let r=o(e+"CollectionConsumer",t);return $.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])}return f.displayName=d,l6(m,"useCollection"),[{Provider:l,Slot:u,ItemSlot:f},m,a]}l6(l8,"createCollection");var l9=/* @__PURE__ */new WeakMap,l7=class e extends Map{static{l6(this,"OrderedDict")}#e;constructor(e){super(e),this.#e=[...super.keys()],l9.set(this,!0)}set(e,t){return l9.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let n,a=this.has(t),i=this.#e.length,o=sr(e),l=o>=0?o:i+o,s=l<0||l>=i?-1:l;if(s===this.size||a&&s===this.size-1||-1===s)return this.set(t,r),this;let c=this.size+ +!a;o<0&&l++;let u=[...this.#e],d=!1;for(let e=l;e<c;e++)if(l===e){let i=u[e];u[e]===t&&(i=u[e+1]),a&&this.delete(t),n=this.get(i),this.set(t,r)}else{d||u[e-1]!==t||(d=!0);let r=u[d?e:e-1],a=n;n=this.get(r),this.delete(r),this.set(r,a)}return this}with(t,r,n){let a=new e(this);return a.insert(t,r,n),a}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=se(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=se(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return se(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],a=0;for(let e of this)Reflect.apply(t,r,[e,a,this])&&n.push(e),a++;return new e(n)}map(t,r){let n=[],a=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,a,this])]),a++;return new e(n)}reduce(...e){let[t,r]=e,n=0,a=r??this.at(0);for(let r of this)a=0===n&&1===e.length?r:Reflect.apply(t,this,[a,r,n,this]),n++;return a}reduceRight(...e){let[t,r]=e,n=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let a=this.at(r);n=r===this.size-1&&1===e.length?a:Reflect.apply(t,this,[n,a,r,this])}return n}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let n=new e,a=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(a=r-1);for(let e=t;e<=a;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}};function se(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let r=st(e,t);return -1===r?void 0:e[r]}function st(e,t){let r=e.length,n=sr(t),a=n>=0?n:r+n;return a<0||a>=r?-1:a}function sr(e){return e!=e||0===e?0:Math.trunc(e)}function sn(e){let t=e+"CollectionProvider",[n,a]=ly(t),[i,o]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new l7,setItemMap:/* @__PURE__ */l6(()=>void 0,"setItemMap")}),l=/* @__PURE__ */l6(({state:e,...t})=>e?/* @__PURE__ */r(c,{...t,state:e}):/* @__PURE__ */r(s,{...t}),"CollectionProvider");l.displayName=t;let s=/* @__PURE__ */l6(e=>{let t=g();return /* @__PURE__ */r(c,{...e,state:t})},"CollectionInit");s.displayName=t+"Init";let c=/* @__PURE__ */l6(e=>{let{scope:t,children:n,state:a}=e,o=$.useRef(null),[l,s]=$.useState(null),c=lm(o,s),[u,d]=a;return $.useEffect(()=>{if(!l)return;let e=sl(()=>{});return e.observe(l,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[l]),/* @__PURE__ */r(i,{scope:t,itemMap:u,setItemMap:d,collectionRef:c,collectionRefObject:o,collectionElement:l,children:n})},"CollectionProviderImpl");c.displayName=t+"Impl";let u=e+"CollectionSlot",d=lq(u),h=$.forwardRef((e,t)=>{let{scope:n,children:a}=e;return /* @__PURE__ */r(d,{ref:lm(t,o(u,n).collectionRef),children:a})});h.displayName=u;let p=e+"CollectionItemSlot",f=lq(p),m=$.forwardRef((e,t)=>{let{scope:n,children:a,...i}=e,l=$.useRef(null),[s,c]=$.useState(null),u=lm(t,l,c),{setItemMap:d}=o(p,n),h=$.useRef(i);sa(h.current,i)||(h.current=i);let m=h.current;return $.useEffect(()=>(d(e=>s?e.has(s)?e.set(s,{...m,element:s}).toSorted(so):(e.set(s,{...m,element:s}),e.toSorted(so)):e),()=>{d(e=>s&&e.has(s)?(e.delete(s),new l7(e)):e)}),[s,m,d]),/* @__PURE__ */r(f,{"data-radix-collection-item":"",ref:u,children:a})});function g(){return $.useState(new l7)}function b(t){let{itemMap:r}=o(e+"CollectionConsumer",t);return r}return m.displayName=p,l6(g,"useInitCollection"),l6(b,"useCollection"),[{Provider:l,Slot:h,ItemSlot:m},{createCollectionScope:a,useCollection:b,useInitCollection:g}]}function sa(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(!Object.prototype.hasOwnProperty.call(t,n)||e[n]!==t[n])return!1;return!0}function si(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function so(e,t){return e[1].element&&t[1].element?si(e[1].element,t[1].element)?-1:1:0}function sl(e){return new MutationObserver(t=>{for(let r of t)if("childList"===r.type)return void e()})}l6(se,"at"),l6(st,"toSafeIndex"),l6(sr,"toSafeInteger"),l6(sn,"createCollection"),l6(sa,"shallowEqual"),l6(si,"isElementPreceding"),l6(so,"sortByDocumentPosition"),l6(sl,"getChildListObserver");var ss=Object.defineProperty,sc=(e,t)=>ss(e,"name",{value:t,configurable:!0}),su=$.createContext(void 0),sd=/* @__PURE__ */null;function sh(e){let t=$.useContext(su);return e||t||"ltr"}sc(sh,"useDirection");var sp=null,sf=Object.defineProperty,sm=(e,t)=>sf(e,"name",{value:t,configurable:!0});function sg(e){let t=$.useRef(e);return $.useEffect(()=>{t.current=e}),$.useMemo(()=>(...e)=>t.current?.(...e),[])}sm(sg,"useCallbackRef");var sb=Object.defineProperty,sv=(e,t)=>sb(e,"name",{value:t,configurable:!0}),sy="dismissableLayer.update",sw="dismissableLayer.pointerDownOutside",sx="dismissableLayer.focusOutside",sk=$.createContext({layers:/* @__PURE__ */new Set,layersWithOutsidePointerEventsDisabled:/* @__PURE__ */new Set,branches:/* @__PURE__ */new Set,dismissableSurfaces:/* @__PURE__ */new Set}),sS=/* @__PURE__ */$.forwardRef(/* @__PURE__ */sv(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:s,onDismiss:c,...u}=e,d=$.useContext(sk),[h,p]=$.useState(null),f=h?.ownerDocument??globalThis?.document,[,m]=$.useState({}),g=lm(t,p),b=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?b.indexOf(v):-1,w=h?b.indexOf(h):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,k=w>=y,S=$.useRef(!1),M=sD(e=>{o?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:f,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:$.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return k&&!t},[d.branches,k])}),F=sz(e=>{if(a&&S.current)return;let t=e.target;![...d.branches].some(e=>e.contains(t))&&(l?.(e),s?.(e),e.defaultPrevented||c?.())},f),C=!!h&&w===b.length-1,D=sg(e=>{"Escape"===e.key&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return $.useEffect(()=>{if(C)return f.addEventListener("keydown",D,{capture:!0}),()=>f.removeEventListener("keydown",D,{capture:!0})},[f,C,D]),$.useEffect(()=>{if(h)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(j=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),sN(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(h),0===d.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=j))}},[h,f,n,d]),$.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),sN())},[h,d]),$.useEffect(()=>{let e=/* @__PURE__ */sv(()=>m({}),"handleUpdate");return document.addEventListener(sy,e),()=>document.removeEventListener(sy,e)},[]),/* @__PURE__ */r(l2.div,{...u,ref:g,style:{pointerEvents:x?k?"auto":"none":void 0,...e.style},onFocusCapture:lo(e.onFocusCapture,F.onFocusCapture),onBlurCapture:lo(e.onBlurCapture,F.onBlurCapture),onPointerDownCapture:lo(e.onPointerDownCapture,M.onPointerDownCapture)})},"DismissableLayer")),sM=/* @__PURE__ */null;function sF(){let e=$.useContext(sk),[t,r]=$.useState(null);return $.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}sv(sF,"useDismissableLayerSurface");var sC=/* @__PURE__ */sv(()=>!0,"IS_TRUE");function sD(e,t){let{ownerDocument:r=globalThis?.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=sC}=t,l=sg(e),s=$.useRef(!1),c=$.useRef(!1),u=$.useRef(/* @__PURE__ */new Map),d=$.useRef(()=>{});return $.useEffect(()=>{function e(){c.current=!1,a.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}function h(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...i].some(e=>e.contains(t))||u.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{c.current&&d.current()},0)}function p(e){c.current&&u.current.set(e.type,!1)}sv(e,"resetOutsideInteraction"),sv(t,"isOutsideInteractionIntercepted"),sv(h,"handleInteractionCapture"),sv(p,"handleInteractionBubble");let f=/* @__PURE__ */sv(i=>{if(i.target&&!s.current){let h=function(){r.removeEventListener("click",d.current);let n=t();e(),n||sE(sw,l,p,{discrete:!0})};if(sv(h,"handleAndDispatchPointerDownOutsideEvent"),!o(i.target)){r.removeEventListener("click",d.current),e(),s.current=!1;return}let p={originalEvent:i};c.current=!0,a.current=n&&0===i.button,u.current.clear(),n&&0===i.button?(r.removeEventListener("click",d.current),d.current=h,r.addEventListener("click",d.current,{once:!0})):h()}else r.removeEventListener("click",d.current),e();s.current=!1},"handlePointerDown"),m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of m)r.addEventListener(e,h,!0),r.addEventListener(e,p);let g=window.setTimeout(()=>{r.addEventListener("pointerdown",f)},0);return()=>{for(let e of(window.clearTimeout(g),r.removeEventListener("pointerdown",f),r.removeEventListener("click",d.current),m))r.removeEventListener(e,h,!0),r.removeEventListener(e,p)}},[r,l,n,a,i,o]),{onPointerDownCapture:/* @__PURE__ */sv(()=>s.current=!0,"onPointerDownCapture")}}function sz(e,t=globalThis?.document){let r=sg(e),n=$.useRef(!1);return $.useEffect(()=>{let e=/* @__PURE__ */sv(e=>{e.target&&!n.current&&sE(sx,r,{originalEvent:e},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:/* @__PURE__ */sv(()=>n.current=!0,"onFocusCapture"),onBlurCapture:/* @__PURE__ */sv(()=>n.current=!1,"onBlurCapture")}}function sN(){let e=new CustomEvent(sy);document.dispatchEvent(e)}function sE(e,t,r,{discrete:n}){let a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?l5(a,i):a.dispatchEvent(i)}sv(sD,"usePointerDownOutside"),sv(sz,"useFocusOutside"),sv(sN,"dispatchUpdate"),sv(sE,"handleAndDispatchCustomEvent");var sT=null,sR=null,sA=Object.defineProperty,sI=(e,t)=>sA(e,"name",{value:t,configurable:!0}),sP=0,sL=null;function sO(e){return sq(),e.children}function sq(){$.useEffect(()=>{sL||(sL={start:s$(),end:s$()});let{start:e,end:t}=sL;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),sP++,()=>{1===sP&&(sL?.start.remove(),sL?.end.remove(),sL=null),sP=Math.max(0,sP-1)}},[])}function s$(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}sI(sO,"FocusGuards"),sI(sq,"useFocusGuards"),sI(s$,"createFocusGuard");var s_=Object.defineProperty,sj=(e,t)=>s_(e,"name",{value:t,configurable:!0}),sH="focusScope.autoFocusOnMount",sB="focusScope.autoFocusOnUnmount",sW={bubbles:!1,cancelable:!0},sG=/* @__PURE__ */$.forwardRef(/* @__PURE__ */sj(function(e,t){let{loop:n=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[s,c]=$.useState(null),u=sg(i),d=sg(o),h=$.useRef(null),p=lm(t,c),f=$.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;$.useEffect(()=>{if(a){let e=function(e){if(f.paused||!s)return;let t=e.target;s.contains(t)?h.current=t:sZ(h.current,{select:!0})},t=function(e){if(f.paused||!s)return;let t=e.relatedTarget;null!==t&&(s.contains(t)||sZ(h.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&sZ(s)};sj(e,"handleFocusIn"),sj(t,"handleFocusOut"),sj(r,"handleMutations"),document.addEventListener("focusin",e),document.addEventListener("focusout",t);let n=new MutationObserver(r);return s&&n.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[a,s,f.paused]),$.useEffect(()=>{if(s){sJ.add(f);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(sH,sW);s.addEventListener(sH,u),s.dispatchEvent(t),t.defaultPrevented||(sY(s2(sX(s)),{select:!0}),document.activeElement===e&&sZ(s))}return()=>{s.removeEventListener(sH,u),setTimeout(()=>{let t=new CustomEvent(sB,sW);s.addEventListener(sB,d),s.dispatchEvent(t),t.defaultPrevented||sZ(e??document.body,{select:!0}),s.removeEventListener(sB,d),sJ.remove(f)},0)}}},[s,u,d,f]);let m=$.useCallback(e=>{if(!n&&!a||f.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){let t=e.currentTarget,[a,i]=sU(t);a&&i?e.shiftKey||r!==i?e.shiftKey&&r===a&&(e.preventDefault(),n&&sZ(i,{select:!0})):(e.preventDefault(),n&&sZ(a,{select:!0})):r===t&&e.preventDefault()}},[n,a,f.paused]);return /* @__PURE__ */r(l2.div,{tabIndex:-1,...l,ref:p,onKeyDown:m})},"FocusScope"));function sY(e,{select:t=!1}={}){let r=document.activeElement;for(let n of e)if(sZ(n,{select:t}),document.activeElement!==r)return}function sU(e){let t=sX(e);return[sK(t,e),sK(t.reverse(),e)]}function sX(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:/* @__PURE__ */sj(e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}function sK(e,t){let r="function"==typeof t.checkVisibility&&t.checkVisibility({checkVisibilityCSS:!0});for(let n of e)if(!(r?!n.checkVisibility({checkVisibilityCSS:!0}):sV(n,{upTo:t})))return n}function sV(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function sQ(e){return e instanceof HTMLInputElement&&"select"in e}function sZ(e,{select:t=!1}={}){if(e&&e.focus){let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&sQ(e)&&t&&e.select()}}sj(sY,"focusFirst"),sj(sU,"getTabbableEdges"),sj(sX,"getTabbableCandidates"),sj(sK,"findVisible"),sj(sV,"isHidden"),sj(sQ,"isSelectableInput"),sj(sZ,"focus");var sJ=s0();function s0(){let e=[];return{add(t){let r=e[0];t!==r&&r?.pause(),(e=s1(e,t)).unshift(t)},remove(t){e=s1(e,t),e[0]?.resume()}}}function s1(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}function s2(e){return e.filter(e=>"A"!==e.tagName)}sj(s0,"createFocusScopesStack"),sj(s1,"arrayRemove"),sj(s2,"removeLinks");var s5=null;let s4=["top","right","bottom","left"],s3=null,s6=/*#__PURE__*/null,s8=Math.min,s9=Math.max,s7=Math.round,ce=Math.floor,ct=e=>({x:e,y:e}),cr={left:"right",right:"left",bottom:"top",top:"bottom"};function ca(e,t,r){return s9(e,s8(t,r))}function ci(e,t){return"function"==typeof e?e(t):e}function co(e){return e.split("-")[0]}function cl(e){return e.split("-")[1]}function cs(e){return"x"===e?"y":"x"}function cc(e){return"y"===e?"height":"width"}function cu(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function cd(e){return cs(cu(e))}function ch(e,t,r){void 0===r&&(r=!1);let n=cl(e),a=cd(e),i=cc(a),o="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=cx(o)),[o,cx(o)]}function cp(e){let t=cx(e);return[cf(e),t,cf(t)]}function cf(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let cm=["left","right"],cg=["right","left"],cb=["top","bottom"],cv=["bottom","top"];function cy(e,t,r){switch(e){case"top":case"bottom":if(r)return t?cg:cm;return t?cm:cg;case"left":case"right":return t?cb:cv;default:return[]}}function cw(e,t,r,n){let a=cl(e),i=cy(co(e),"start"===r,n);return a&&(i=i.map(e=>e+"-"+a),t&&(i=i.concat(i.map(cf)))),i}function cx(e){let t=co(e);return cr[t]+e.slice(t.length)}function ck(e){var t,r,n,a;return{top:null!=(t=e.top)?t:0,right:null!=(r=e.right)?r:0,bottom:null!=(n=e.bottom)?n:0,left:null!=(a=e.left)?a:0}}function cS(e){return"number"!=typeof e?ck(e):{top:e,right:e,bottom:e,left:e}}function cM(e){let{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function cF(e,t,r){let n,{reference:a,floating:i}=e,o=cu(t),l=cd(t),s=cc(l),c=co(t),u=a.x+a.width/2-i.width/2,d=a.y+a.height/2-i.height/2,h=a[s]/2-i[s]/2;switch(c){case"top":n={x:u,y:a.y-i.height};break;case"bottom":n={x:u,y:a.y+a.height};break;case"right":n={x:a.x+a.width,y:d};break;case"left":n={x:a.x-i.width,y:d};break;default:n={x:a.x,y:a.y}}let p=cl(t);return p&&(n[l]+=h*("end"===p?1:-1)*(r&&"y"===o?-1:1)),n}async function cC(e,t){var r;void 0===t&&(t={});let{x:n,y:a,platform:i,rects:o,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=ci(t,e),f=cS(p),m=l[h?"floating"===d?"reference":"floating":d],g=cM(await i.getClippingRect({element:null==(r=await (null==i.isElement?void 0:i.isElement(m)))||r?m:m.contextElement||await (null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),b="floating"===d?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,v=await (null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),y=await (null==i.isElement?void 0:i.isElement(v))&&await (null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},w=cM(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:v,strategy:s}):b);return{top:(g.top-w.top+f.top)/y.y,bottom:(w.bottom-g.bottom+f.bottom)/y.y,left:(g.left-w.left+f.left)/y.x,right:(w.right-g.right+f.right)/y.x}}let cD=50,cz=async(e,t,r)=>{let{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,l=o.detectOverflow?o:{...o,detectOverflow:cC},s=await (null==o.isRTL?void 0:o.isRTL(t)),c=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=cF(c,n,s),h=n,p=0,f={};for(let r=0;r<i.length;r++){let m=i[r];if(!m)continue;let{name:g,fn:b}=m,{x:v,y:y,data:w,reset:x}=await b({x:u,y:d,initialPlacement:n,placement:h,strategy:a,middlewareData:f,rects:c,platform:l,elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=y?y:d,f[g]={...f[g],...w},x&&p<50&&(p++,"object"==typeof x&&(x.placement&&(h=x.placement),x.rects&&(c=!0===x.rects?await o.getElementRects({reference:e,floating:t,strategy:a}):x.rects),{x:u,y:d}=cF(c,h,s)),r=-1)}return{x:u,y:d,placement:h,strategy:a,middlewareData:f}},cN=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:a,rects:i,platform:o,elements:l,middlewareData:s}=t,{element:c,padding:u=0}=ci(e,t)||{};if(null==c)return{};let d=cS(u),h={x:r,y:n},p=cd(a),f=cc(p),m=await o.getDimensions(c),g="y"===p,b=g?"clientHeight":"clientWidth",v=i.reference[f]+i.reference[p]-h[p]-i.floating[f],y=h[p]-i.reference[p],w=await (null==o.getOffsetParent?void 0:o.getOffsetParent(c)),x=w?w[b]:0;x&&await (null==o.isElement?void 0:o.isElement(w))||(x=l.floating[b]||i.floating[f]);let k=x/2-m[f]/2-1,S=s8(d[g?"top":"left"],k),M=s8(d[g?"bottom":"right"],k),F=x-m[f]-M,C=x/2-m[f]/2+(v/2-y/2),D=ca(S,C,F),z=!s.arrow&&null!=cl(a)&&C!==D&&i.reference[f]/2-(C<S?S:M)-m[f]/2<0,N=z?C<S?C-S:C-F:0;return{[p]:h[p]+N,data:{[p]:D,centerOffset:C-D-N,...z&&{alignmentOffset:N}},reset:z}}});function cE(e,t,r){return(e?[...r.filter(t=>getAlignment(t)===e),...r.filter(t=>getAlignment(t)!==e)]:r.filter(e=>getSide(e)===e)).filter(r=>!e||getAlignment(r)===e||!!t&&getOppositeAlignmentPlacement(r)!==r)}let cT=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,n,a;let{rects:i,middlewareData:o,placement:l,platform:s,elements:c}=t,{crossAxis:u=!1,alignment:d,allowedPlacements:h=placements,autoAlignment:p=!0,...f}=evaluate(e,t),m=void 0!==d||h===placements?cE(d||null,p,h):h,g=(null==(r=o.autoPlacement)?void 0:r.index)||0,b=m[g];if(null==b)return{};if(l!==b)return{reset:{placement:m[0]}};let v=await s.detectOverflow(t,f),y=getAlignmentSides(b,i,await (null==s.isRTL?void 0:s.isRTL(c.floating))),w=[v[getSide(b)],v[y[0]],v[y[1]]],x=[...(null==(n=o.autoPlacement)?void 0:n.overflows)||[],{placement:b,overflows:w}],k=m[g+1];if(k)return{data:{index:g+1,overflows:x},reset:{placement:k}};let S=x.map(e=>{let t=getAlignment(e.placement);return[e.placement,t&&u?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),M=(null==(a=S.filter(e=>e[2].slice(0,getAlignment(e[0])?2:3).every(e=>e<=0))[0])?void 0:a[0])||S[0][0];return M!==l?{data:{index:g+1,overflows:x},reset:{placement:M}}:{}}}},cR=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n,a,i,o;let{placement:l,middlewareData:s,rects:c,initialPlacement:u,platform:d,elements:h}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:v=!0,...y}=ci(e,t);if(null!=(r=s.arrow)&&r.alignmentOffset)return{};let w=co(l),x=cu(u),k=co(u)===u,S=await (null==d.isRTL?void 0:d.isRTL(h.floating)),M=m||(k||!v?[cx(u)]:cp(u)),F="none"!==b;!m&&F&&M.push(...cw(u,v,b,S));let C=[u,...M],D=await d.detectOverflow(t,y),z=[],N=(null==(n=s.flip)?void 0:n.overflows)||[];if(p&&z.push(D[w]),f){let e=ch(l,c,S);z.push(D[e[0]],D[e[1]])}if(N=[...N,{placement:l,overflows:z}],!z.every(e=>e<=0)){let e=((null==(a=s.flip)?void 0:a.index)||0)+1,t=C[e];if(t&&("alignment"!==f||x===cu(t)||N.every(e=>cu(e.placement)!==x||e.overflows[0]>0)))return{data:{index:e,overflows:N},reset:{placement:t}};let r=null==(i=N.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!r)switch(g){case"bestFit":{let e=null==(o=N.filter(e=>{if(F){let t=cu(e.placement);return t===x||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(r=e);break}case"initialPlacement":r=u}if(l!==r)return{reset:{placement:r}}}return{}}}};function cA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cI(e){return s4.some(t=>e[t]>=0)}let cP=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r,platform:n}=t,{strategy:a="referenceHidden",...i}=ci(e,t);switch(a){case"referenceHidden":{let e=cA(await n.detectOverflow(t,{...i,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:cI(e)}}}case"escaped":{let e=cA(await n.detectOverflow(t,{...i,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:cI(e)}}}default:return{}}}}};function cL(e){let t=min(...e.map(e=>e.left)),r=min(...e.map(e=>e.top));return{x:t,y:r,width:max(...e.map(e=>e.right))-t,height:max(...e.map(e=>e.bottom))-r}}function cO(e){let t=e.slice().sort((e,t)=>e.y-t.y),r=[],n=null;for(let e=0;e<t.length;e++){let a=t[e];!n||a.y-n.y>n.height/2?r.push([a]):r[r.length-1].push(a),n=a}return r.map(e=>rectToClientRect(cL(e)))}let cq=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){let{placement:r,elements:n,rects:a,platform:i,strategy:o}=t,{padding:l=2,x:s,y:c}=evaluate(e,t),u=Array.from(await (null==i.getClientRects?void 0:i.getClientRects(n.reference))||[]);if(!u.length)return{};let d=cO(u),h=rectToClientRect(cL(u)),p=getPaddingObject(l),f=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&(d[0].left>d[1].right||d[1].left>d[0].right)&&null!=s&&null!=c)return d.find(e=>s>e.left-p.left&&s<e.right+p.right&&c>e.top-p.top&&c<e.bottom+p.bottom)||h;if(d.length>=2){if("y"===getSideAxis(r)){let e=d[0],t=d[d.length-1],n="top"===getSide(r),a=e.top,i=t.bottom,o=n?e.left:t.left;return rectToClientRect({x:o,y:a,width:(n?e.right:t.right)-o,height:i-a})}let e="left"===getSide(r),t=max(...d.map(e=>e.right)),n=min(...d.map(e=>e.left)),a=d.filter(r=>e?r.left===n:r.right===t),i=a[0].top;return rectToClientRect({x:n,y:i,width:t-n,height:a[a.length-1].bottom-i})}return h}},floating:n.floating,strategy:o});return a.reference.x!==f.reference.x||a.reference.y!==f.reference.y||a.reference.width!==f.reference.width||a.reference.height!==f.reference.height?{reset:{rects:f}}:{}}}},c$=/*#__PURE__*/new Set(["left","top"]);async function c_(e,t){let{placement:r,platform:n,elements:a}=e,i=await (null==n.isRTL?void 0:n.isRTL(a.floating)),o=co(r),l=cl(r),s="y"===cu(r),c=c$.has(o)?-1:1,u=i&&s?-1:1,d=ci(t,e),{mainAxis:h,crossAxis:p,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&"number"==typeof f&&(p="end"===l?-1*f:f),s?{x:p*u,y:h*c}:{x:h*c,y:p*u}}let cj=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:a,y:i,placement:o,middlewareData:l}=t,s=await c_(t,e);return o===(null==(r=l.offset)?void 0:r.placement)&&null!=(n=l.arrow)&&n.alignmentOffset?{}:{x:a+s.x,y:i+s.y,data:{...s,placement:o}}}}},cH=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:a,platform:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...c}=ci(e,t),u={x:r,y:n},d=await i.detectOverflow(t,c),h=cu(a),p=cs(h),f=u[p],m=u[h],g=(e,t)=>ca(t+d["y"===e?"top":"left"],t,t-d["y"===e?"bottom":"right"]);o&&(f=g(p,f)),l&&(m=g(h,m));let b=s.fn({...t,[p]:f,[h]:m});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[p]:o,[h]:l}}}}}},cB=function(e){return void 0===e&&(e={}),{options:e,fn(t){var r,n,a,i;let{x:o,y:l,placement:s,rects:c,middlewareData:u}=t,{offset:d=0,mainAxis:h=!0,crossAxis:p=!0}=ci(e,t),f={x:o,y:l},m=cu(s),g=cs(m),b=f[g],v=f[m],y=ci(d,t),w="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:null!=(r=y.mainAxis)?r:0,crossAxis:null!=(n=y.crossAxis)?n:0};if(h){let e="y"===g?"height":"width",t=c.reference[g]-c.floating[e]+w.mainAxis,r=c.reference[g]+c.reference[e]-w.mainAxis;b<t?b=t:b>r&&(b=r)}if(p){let e="y"===g?"width":"height",t=c$.has(co(s)),r=c.reference[m]-c.floating[e]+(t&&(null==(a=u.offset)?void 0:a[m])||0)+(t?0:w.crossAxis),n=c.reference[m]+c.reference[e]+(t?0:(null==(i=u.offset)?void 0:i[m])||0)-(t?w.crossAxis:0);v<r?v=r:v>n&&(v=n)}return{[g]:b,[m]:v}}}},cW=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){let r,n,{placement:a,rects:i,platform:o,elements:l}=t,{apply:s=()=>{},...c}=ci(e,t),u=await o.detectOverflow(t,c),d=co(a),h=cl(a),p="y"===cu(a),{width:f,height:m}=i.floating;"top"===d||"bottom"===d?(r=d,n=h===(await (null==o.isRTL?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(n=d,r="end"===h?"top":"bottom");let g=m-u.top-u.bottom,b=f-u.left-u.right,v=s8(m-u[r],g),y=s8(f-u[n],b),w=t.middlewareData.shift,x=!w,k=v,S=y;null!=w&&w.enabled.x&&(S=b),null!=w&&w.enabled.y&&(k=g),x&&!h&&(p?S=f-2*s9(u.left,u.right):k=m-2*s9(u.top,u.bottom)),await s({...t,availableWidth:S,availableHeight:k});let M=await o.getDimensions(l.floating);return f!==M.width||m!==M.height?{reset:{rects:!0}}:{}}}};function cG(){return"u">typeof window}function cY(e){return cK(e)?(e.nodeName||"").toLowerCase():"#document"}function cU(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function cX(e){var t;return null==(t=(cK(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function cK(e){return!!cG()&&(e instanceof Node||e instanceof cU(e).Node)}function cV(e){return!!cG()&&(e instanceof Element||e instanceof cU(e).Element)}function cQ(e){return!!cG()&&(e instanceof HTMLElement||e instanceof cU(e).HTMLElement)}function cZ(e){return!(!cG()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof cU(e).ShadowRoot)}function cJ(e){let{overflow:t,overflowX:r,overflowY:n,display:a}=c7(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&"inline"!==a&&"contents"!==a}function c0(e){return/^(table|td|th)$/.test(cY(e))}function c1(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let c2=/transform|translate|scale|rotate|perspective|filter/,c5=/paint|layout|strict|content/,c4=e=>!!e&&"none"!==e;function c3(e){let t=cV(e)?c7(e):e;return c4(t.transform)||c4(t.translate)||c4(t.scale)||c4(t.rotate)||c4(t.perspective)||!c8()&&(c4(t.backdropFilter)||c4(t.filter))||c2.test(t.willChange||"")||c5.test(t.contain||"")}function c6(e){let t=ut(e);for(;cQ(t)&&!c9(t);){if(c3(t))return t;if(c1(t))break;t=ut(t)}return null}function c8(){return null==e&&(e="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),e}function c9(e){return/^(html|body|#document)$/.test(cY(e))}function c7(e){return cU(e).getComputedStyle(e)}function ue(e){return cV(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ut(e){if("html"===cY(e))return e;let t=e.assignedSlot||e.parentNode||cZ(e)&&e.host||cX(e);return cZ(t)?t.host:t}function ur(e){let t=ut(e);return c9(t)?(e.ownerDocument||e).body:cQ(t)&&cJ(t)?t:ur(t)}function un(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let a=ur(e),i=a===(null==(n=e.ownerDocument)?void 0:n.body),o=cU(a);if(!i)return t.concat(a,un(a,[],r));{let e=ua(o);return t.concat(o,o.visualViewport||[],cJ(a)?a:[],e&&r?un(e):[])}}function ua(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ui(e){let t=c7(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,a=cQ(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:n,l=s7(r)!==i||s7(n)!==o;return l&&(r=i,n=o),{width:r,height:n,$:l}}function uo(e){return cV(e)?e:e.contextElement}function ul(e){let t=uo(e);if(!cQ(t))return ct(1);let r=t.getBoundingClientRect(),{width:n,height:a,$:i}=ui(t),o=(i?s7(r.width):r.width)/n,l=(i?s7(r.height):r.height)/a;return o&&Number.isFinite(o)||(o=1),l&&Number.isFinite(l)||(l=1),{x:o,y:l}}let us=/*#__PURE__*/ct(0);function uc(e){let t=cU(e);return c8()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:us}function uu(e,t,r){return void 0===t&&(t=!1),!!r&&t&&r===cU(e)}function ud(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);let a=e.getBoundingClientRect(),i=uo(e),o=ct(1);t&&(n?cV(n)&&(o=ul(n)):o=ul(e));let l=uu(i,r,n)?uc(i):ct(0),s=(a.left+l.x)/o.x,c=(a.top+l.y)/o.y,u=a.width/o.x,d=a.height/o.y;if(i&&n){let e=cU(i),t=cV(n)?cU(n):n,r=e,a=ua(r);for(;a&&t!==r;){let e=ul(a),t=a.getBoundingClientRect(),n=c7(a),i=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,o=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,d*=e.y,s+=i,c+=o,a=ua(r=cU(a))}}return cM({width:u,height:d,x:s,y:c})}function uh(e,t){let r=ue(e).scrollLeft;return t?t.left+r:ud(cX(e)).left+r}function up(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-uh(e,r),y:r.top+t.scrollTop}}function uf(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e,i="fixed"===a,o=cX(n),l=!!t&&c1(t.floating);if(n===o||l&&i)return r;let s={scrollLeft:0,scrollTop:0},c=ct(1),u=ct(0),d=cQ(n);if((d||!i)&&(("body"!==cY(n)||cJ(o))&&(s=ue(n)),d)){let e=ud(n);c=ul(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}let h=!o||d||i?ct(0):up(o,s);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-s.scrollLeft*c.x+u.x+h.x,y:r.y*c.y-s.scrollTop*c.y+u.y+h.y}}function um(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ug(e){let t=ue(e),r=e.ownerDocument.body,n=s9(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=s9(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),i=-t.scrollLeft+uh(e),o=-t.scrollTop;return"rtl"===c7(r).direction&&(i+=s9(e.clientWidth,r.clientWidth)-n),{width:n,height:a,x:i,y:o}}let ub=25;function uv(e,t,r){void 0===r&&(r="viewport");let n="layoutViewport"===r,a=cU(e),i=cX(e),o=a.visualViewport,l=i.clientWidth,s=i.clientHeight,c=0,u=0;if(o){let e=!c8()||"fixed"===t;n?e||(c=-o.offsetLeft,u=-o.offsetTop):(l=o.width,s=o.height,e&&(c=o.offsetLeft,u=o.offsetTop))}if(0>=uh(i)){let e=i.ownerDocument,t=e.body,r=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,a=Math.abs(i.clientWidth-t.clientWidth-n),o="stable both-edges"===getComputedStyle(i).scrollbarGutter?a/2:a;o<=25&&(l-=o)}return{width:l,height:s,x:c,y:u}}function uy(e,t){let r=ud(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=ul(e),o=e.clientWidth*i.x,l=e.clientHeight*i.y;return{width:o,height:l,x:a*i.x,y:n*i.y}}function uw(e,t,r){let n;if("viewport"===t||"layoutViewport"===t)n=uv(e,r,t);else if("document"===t)n=ug(cX(e));else if(cV(t))n=uy(t,r);else{let r=uc(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return cM(n)}function ux(e,t){let r=t.get(e);if(r)return r;let n=un(e,[],!1).filter(e=>cV(e)&&"body"!==cY(e)),a=null,i="fixed"===c7(e).position,o=i?ut(e):e;for(;cV(o)&&!c9(o);){let e=c7(o),t=c3(o),r=a?a.position:i?"fixed":"";t||"fixed"!==r&&("absolute"!==r||"static"!==e.position)?a=e:n=n.filter(e=>e!==o),o=ut(o)}return t.set(e,n),n}function uk(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e,i=[..."clippingAncestors"===r?c1(t)?[]:ux(t,this._c):[].concat(r),n],o=uw(t,i[0],a),l=o.top,s=o.right,c=o.bottom,u=o.left;for(let e=1;e<i.length;e++){let r=uw(t,i[e],a);l=s9(r.top,l),s=s8(r.right,s),c=s8(r.bottom,c),u=s9(r.left,u)}return{width:s-u,height:c-l,x:u,y:l}}function uS(e){let{width:t,height:r}=ui(e);return{width:t,height:r}}function uM(e,t,r){let n=cQ(t),a=cX(t),i="fixed"===r,o=ud(e,!0,i,t),l={scrollLeft:0,scrollTop:0},s=ct(0);if((n||!i)&&(("body"!==cY(t)||cJ(a))&&(l=ue(t)),n)){let e=ud(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}!n&&a&&(s.x=uh(a));let c=!a||n||i?ct(0):up(a,l);return{x:o.left+l.scrollLeft-s.x-c.x,y:o.top+l.scrollTop-s.y-c.y,width:o.width,height:o.height}}function uF(e){return"static"===c7(e).position}function uC(e,t){if(!cQ(e)||"fixed"===c7(e).position)return null;if(t)return t(e);let r=e.offsetParent;return cX(e)===r&&(r=r.ownerDocument.body),r}function uD(e,t){let r=cU(e);if(c1(e))return r;if(!cQ(e)){let t=ut(e);for(;t&&!c9(t);){if(cV(t)&&!uF(t))return t;t=ut(t)}return r}let n=uC(e,t);for(;n&&c0(n)&&uF(n);)n=uC(n,t);return n&&c9(n)&&uF(n)&&!c3(n)?r:n||c6(e)||r}let uz=async function(e){let t=this.getOffsetParent||uD,r=this.getDimensions,n=await r(e.floating);return{reference:uM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function uN(e){return"rtl"===c7(e).direction}let uE={convertOffsetParentRelativeRectToViewportRelativeRect:uf,getDocumentElement:cX,getClippingRect:uk,getOffsetParent:uD,getElementRects:uz,getClientRects:um,getDimensions:uS,getScale:ul,isElement:cV,isRTL:uN};function uT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uR(e,t,r){let n,a=null,i=cX(e);function o(){var e;clearTimeout(n),null==(e=a)||e.disconnect(),a=null}function l(r,s){void 0===r&&(r=!1),void 0===s&&(s=1),o();let c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:p}=c;if(r||t(),!h||!p)return;let f={rootMargin:-ce(d)+"px "+-ce(i.clientWidth-(u+h))+"px "+-ce(i.clientHeight-(d+p))+"px "+-ce(u)+"px",threshold:s9(0,s8(1,s))||1},m=!0;function g(t){let r=t[0].intersectionRatio;if(!uT(c,e.getBoundingClientRect()))return l();if(r!==s){if(!m)return l();r?l(!1,r):n=setTimeout(()=>{l(!1,1e-7)},1e3)}m=!1}try{a=new IntersectionObserver(g,{...f,root:i.ownerDocument})}catch(e){a=new IntersectionObserver(g,f)}a.observe(e)}let s=cU(e),c=()=>l(r);return s.addEventListener("resize",c),l(!0),()=>{s.removeEventListener("resize",c),o()}}function uA(e,t,r,n){let a;void 0===n&&(n={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,u=uo(e),d=i||o?[...u?un(u):[],...t?un(t):[]]:[];d.forEach(e=>{i&&e.addEventListener("scroll",r),o&&e.addEventListener("resize",r)});let h=u&&s?uR(u,r,o):null,p=-1,f=null;l&&(f=new ResizeObserver(e=>{let[n]=e;n&&n.target===u&&f&&t&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),r()}),u&&!c&&f.observe(u),t&&f.observe(t));let m=c?ud(e):null;return c&&function t(){let n=ud(e);m&&!uT(m,n)&&r(),m=n,a=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{i&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==h||h(),null==(e=f)||e.disconnect(),f=null,c&&cancelAnimationFrame(a)}}let uI=null,uP=cj,uL=null,uO=cH,uq=cR,u$=cW,u_=cP,uj=cN,uH=null,uB=cB,uW=(e,t,r)=>{let n=new Map,a=null!=r?r:{},i={...uE,...a.platform,_c:n};return cz(e,t,{...a,platform:i})};var uG="u">typeof document,uY=function(){},uU=uG?$.useLayoutEffect:uY;function uX(e,t){let r,n,a;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!uX(e[n],t[n]))return!1;return!0}if((r=(a=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!=n--;){let r=a[n];if(("_owner"!==r||!e.$$typeof)&&!uX(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function uK(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function uV(e,t){let r=uK(e);return Math.round(t*r)/r}function uQ(e){let t=$.useRef(e);return uU(()=>{t.current=e}),t}function uZ(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:s,open:c}=e,[u,d]=$.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=$.useState(n);uX(h,n)||p(n);let[f,m]=$.useState(null),[g,b]=$.useState(null),v=$.useCallback(e=>{e!==k.current&&(k.current=e,m(e))},[]),y=$.useCallback(e=>{e!==S.current&&(S.current=e,b(e))},[]),w=i||f,x=o||g,k=$.useRef(null),S=$.useRef(null),M=$.useRef(u),F=null!=s,C=uQ(s),D=uQ(a),z=uQ(c),N=$.useCallback(()=>{if(!k.current||!S.current)return;let e={placement:t,strategy:r,middleware:h};D.current&&(e.platform=D.current),uW(k.current,S.current,e).then(e=>{let t={...e,isPositioned:!1!==z.current};E.current&&!uX(M.current,t)&&(M.current=t,_.flushSync(()=>{d(t)}))})},[h,t,r,D,z]);uU(()=>{!1===c&&M.current.isPositioned&&(M.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);let E=$.useRef(!1);uU(()=>(E.current=!0,()=>{E.current=!1}),[]),uU(()=>{if(w&&(k.current=w),x&&(S.current=x),w&&x){if(C.current)return C.current(w,x,N);N()}},[w,x,N,C,F]);let T=$.useMemo(()=>({reference:k,floating:S,setReference:v,setFloating:y}),[v,y]),R=$.useMemo(()=>({reference:w,floating:x}),[w,x]),A=$.useMemo(()=>{let e={position:r,left:0,top:0};if(!R.floating)return e;let t=uV(R.floating,u.x),n=uV(R.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...uK(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,R.floating,u.x,u.y]);return $.useMemo(()=>({...u,update:N,refs:T,elements:R,floatingStyles:A}),[u,N,T,R,A])}let uJ=e=>({name:"arrow",options:e,fn(t){let{element:r,padding:n}="function"==typeof e?e(t):e;return r&&({}).hasOwnProperty.call(r,"current")?null!=r.current?cN({element:r.current,padding:n}).fn(t):{}:r?cN({element:r,padding:n}).fn(t):{}}}),u0=(e,t)=>{let r=cj(e);return{name:r.name,fn:r.fn,options:[e,t]}},u1=(e,t)=>{let r=cH(e);return{name:r.name,fn:r.fn,options:[e,t]}},u2=(e,t)=>({fn:cB(e).fn,options:[e,t]}),u5=(e,t)=>{let r=cR(e);return{name:r.name,fn:r.fn,options:[e,t]}},u4=(e,t)=>{let r=cW(e);return{name:r.name,fn:r.fn,options:[e,t]}},u3=(e,t)=>{let r=autoPlacement$1(e);return{name:r.name,fn:r.fn,options:[e,t]}},u6=(e,t)=>{let r=cP(e);return{name:r.name,fn:r.fn,options:[e,t]}},u8=(e,t)=>{let r=inline$1(e);return{name:r.name,fn:r.fn,options:[e,t]}},u9=(e,t)=>{let r=uJ(e);return{name:r.name,fn:r.fn,options:[e,t]}};var u7=Object.defineProperty,de=(e,t)=>u7(e,"name",{value:t,configurable:!0}),dt=/* @__PURE__ */$.forwardRef(/* @__PURE__ */de(function(e,t){let{children:n,width:a=10,height:i=5,...o}=e;return /* @__PURE__ */r(l2.svg,{...o,ref:t,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:/* @__PURE__ */r("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),dr=dt,dn=Object.defineProperty,da=(e,t)=>dn(e,"name",{value:t,configurable:!0});function di(e){let[t,r]=$.useState(void 0);return lk(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,a;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,a=t.blockSize}else n=e.offsetWidth,a=e.offsetHeight;r({width:n,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}da(di,"useSize");var dl=Object.defineProperty,ds=(e,t)=>dl(e,"name",{value:t,configurable:!0}),dc=null,du=null,dd="Popper",[dh,dp]=ly(dd),[df,dm]=dh(dd),dg=/* @__PURE__ */ds(e=>{let{__scopePopper:t,children:n}=e,[a,i]=$.useState(null),[o,l]=$.useState(void 0);return /* @__PURE__ */r(df,{scope:t,anchor:a,onAnchorChange:i,placementState:o,setPlacementState:l,children:n})},"Popper"),db="PopperAnchor",dv=/* @__PURE__ */$.forwardRef(/* @__PURE__ */ds(function(e,t){let{__scopePopper:n,virtualRef:a,...i}=e,o=dm(db,n),l=$.useRef(null),s=o.onAnchorChange,c=lm(t,$.useCallback(e=>{l.current=e,e&&s(e)},[s])),u=$.useRef(null);$.useEffect(()=>{if(!a)return;let e=u.current;u.current=a.current,e!==u.current&&s(u.current)});let d=o.placementState&&dz(o.placementState),h=d?.[0],p=d?.[1];return a?null:/* @__PURE__ */r(l2.div,{"data-radix-popper-side":h,"data-radix-popper-align":p,...i,ref:c})},"PopperAnchor")),dy="PopperContent",[dw,dx]=dh(dy),dk=/* @__PURE__ */$.forwardRef(/* @__PURE__ */ds(function(e,t){let{__scopePopper:n,side:a="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:f="optimized",onPlaced:m,...g}=e,b=dm(dy,n),[v,y]=$.useState(null),w=lm(t,y),[x,k]=$.useState(null),S=di(x),M=S?.width??0,F=S?.height??0,C="number"==typeof d?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(u)?u:[u],z=D.length>0,N={padding:C,boundary:D.filter(dC),altBoundary:z},{refs:E,floatingStyles:T,placement:R,isPositioned:A,middlewareData:I}=uZ({strategy:"fixed",placement:a+("center"!==o?"-"+o:""),whileElementsMounted:/* @__PURE__ */ds((...e)=>uA(...e,{animationFrame:"always"===f}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[u0({mainAxis:i+F,alignmentAxis:l}),c&&u1({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?u2():void 0,...N}),c&&u5({...N}),u4({...N,apply:/* @__PURE__ */ds(({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{let{width:a,height:i}=t.reference,o=e.floating.style;o.setProperty("--radix-popper-available-width",`${r}px`),o.setProperty("--radix-popper-available-height",`${n}px`),o.setProperty("--radix-popper-anchor-width",`${a}px`),o.setProperty("--radix-popper-anchor-height",`${i}px`)},"apply")}),x&&u9({element:x,padding:s}),dD({arrowWidth:M,arrowHeight:F}),p&&u6({strategy:"referenceHidden",...N,boundary:z?N.boundary:void 0})]}),P=b.setPlacementState;lk(()=>(P(R),()=>{P(void 0)}),[R,P]);let[L,O]=dz(R),q=sg(m);lk(()=>{A&&q?.()},[A,q]);let _=I.arrow?.x,j=I.arrow?.y,H=I.arrow?.centerOffset!==0,[B,W]=$.useState();return lk(()=>{v&&W(window.getComputedStyle(v).zIndex)},[v]),/* @__PURE__ */r("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:A?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:/* @__PURE__ */r(dw,{scope:n,placedSide:L,placedAlign:O,onArrowChange:k,arrowX:_,arrowY:j,shouldHideArrow:H,children:/* @__PURE__ */r(l2.div,{"data-side":L,"data-align":O,...g,ref:w,style:{...g.style,animation:A?g.style?.animation:"none"}})})})},"PopperContent")),dS="PopperArrow",dM={top:"bottom",right:"left",bottom:"top",left:"right"},dF=/* @__PURE__ */$.forwardRef(/* @__PURE__ */ds(function(e,t){let{__scopePopper:n,...a}=e,i=dx(dS,n),o=dM[i.placedSide];return /* @__PURE__ */r("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:/* @__PURE__ */r(dr,{...a,ref:t,style:{...a.style,display:"block"}})})},"PopperArrow"));function dC(e){return null!==e}ds(dC,"isNotNull");var dD=/* @__PURE__ */ds(e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:n,middlewareData:a}=t,i=a.arrow?.centerOffset!==0,o=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[s,c]=dz(r),u={start:"0%",center:"50%",end:"100%"}[c],d=(a.arrow?.x??0)+o/2,h=(a.arrow?.y??0)+l/2,p="",f="";return"bottom"===s?(p=i?u:`${d}px`,f=`${-l}px`):"top"===s?(p=i?u:`${d}px`,f=`${n.floating.height+l}px`):"right"===s?(p=`${-l}px`,f=i?u:`${h}px`):"left"===s&&(p=`${n.floating.width+l}px`,f=i?u:`${h}px`),{data:{x:p,y:f}}}}),"transformOrigin");function dz(e){let[t,r="center"]=e.split("-");return[t,r]}ds(dz,"getSideAndAlignFromPlacement");var dN=dg,dE=dv,dT=dk,dR=dF,dA=Object.defineProperty,dI=(e,t)=>dA(e,"name",{value:t,configurable:!0}),dP=/* @__PURE__ */$.forwardRef(/* @__PURE__ */dI(function(e,t){let{container:n,...a}=e,[i,o]=$.useState(!1);lk(()=>o(!0),[]);let l=n||i&&globalThis?.document?.body;return l?_.createPortal(/* @__PURE__ */r(l2.div,{...a,ref:t}),l):null},"Portal")),dL=null,dO=Object.defineProperty,dq=(e,t)=>dO(e,"name",{value:t,configurable:!0});function d$(e,t){return $.useReducer((e,r)=>t[e][r]??e,e)}dq(d$,"useStateMachine");var d_=/* @__PURE__ */dq(e=>{let{present:t,children:r}=e,n=dj(t),a="function"==typeof r?r({present:n.isPresent}):$.Children.only(r),i=dB(n.ref,dG(a));return"function"==typeof r||n.isPresent?$.cloneElement(a,{ref:i}):null},"Presence");function dj(e){let[t,r]=$.useState(),n=$.useRef(null),a=$.useRef(e),i=$.useRef("none"),o=$.useRef(void 0),[l,s]=d$(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return $.useEffect(()=>{"mounted"===l?(i.current=o.current??dW(n.current),o.current=void 0):i.current="none"},[l]),lk(()=>{let t=n.current,r=a.current;if(r!==e){let n=i.current,l=dW(t);e?(o.current=l,s("MOUNT")):"none"===l||t?.display==="none"?s("UNMOUNT"):r&&n!==l?s("ANIMATION_OUT"):s("UNMOUNT"),a.current=e}},[e,s]),lk(()=>{if(t){let e,r=t.ownerDocument.defaultView??window,o=/* @__PURE__ */dq(i=>{let o=dW(n.current).includes(CSS.escape(i.animationName));if(i.target===t&&o&&(s("ANIMATION_END"),!a.current)){let n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},"handleAnimationEnd"),l=/* @__PURE__ */dq(e=>{e.target===t&&(i.current=dW(n.current))},"handleAnimationStart");return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",o),t.addEventListener("animationend",o),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",o),t.removeEventListener("animationend",o)}}s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:$.useCallback(e=>{if(e){let t=getComputedStyle(e);n.current=t,o.current=dW(t)}else n.current=null;r(e)},[])}}function dH(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function dB(...e){let t=$.useRef(e);return t.current=e,$.useCallback(e=>{let r=t.current,n=!1,a=r.map(t=>{let r=dH(t,e);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let e=0;e<a.length;e++){let t=a[e];"function"==typeof t?t():dH(r[e],null)}}},[])}function dW(e){return e?.animationName||"none"}function dG(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}dq(dj,"usePresence"),dq(dH,"setRef"),dq(dB,"useStableComposedRefs"),dq(dW,"getAnimationName"),dq(dG,"getElementRef");var dY=null,dU=Object.defineProperty,dX=(e,t)=>dU(e,"name",{value:t,configurable:!0}),dK=$[" useId ".trim().toString()]||(()=>void 0),dV=0;function dQ(e){let[t,r]=$.useState(dK());return lk(()=>{e||r(e=>e??String(dV++))},[e]),e||(t?`radix-${t}`:"")}dX(dQ,"useId");var dZ=Object.defineProperty,dJ=(e,t)=>dZ(e,"name",{value:t,configurable:!0}),d0=!1;function d1(){let[e,t]=$.useState(d0);return $.useEffect(()=>{d0||(d0=!0,t(!0))},[]),e}dJ(d1,"useIsHydrated");var d2=$[" useSyncExternalStore ".trim().toString()];function d5(){return()=>{}}function d4(){return d2(d5,()=>!0,()=>!1)}dJ(d5,"subscribe"),dJ(d4,"useIsHydratedModern");var d3="function"==typeof d2?d4:d1,d6=Object.defineProperty,d8=(e,t)=>d6(e,"name",{value:t,configurable:!0}),d9="rovingFocusGroup.onEntryFocus",d7={bubbles:!1,cancelable:!0},he="RovingFocusGroup",[ht,hr,hn]=l8(he),[ha,hi]=ly(he,[hn]),[ho,hl]=ha(he),hs=/* @__PURE__ */$.forwardRef(/* @__PURE__ */d8(function(e,t){return /* @__PURE__ */r(ht.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */r(ht.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */r(hc,{...e,ref:t})})})},"RovingFocusGroup")),hc=/* @__PURE__ */$.forwardRef(/* @__PURE__ */d8(function(e,t){let{__scopeRovingFocusGroup:n,orientation:a,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,p=$.useRef(null),f=lm(t,p),m=sh(o),[g,b]=lT({prop:l,defaultProp:s??null,onChange:c,caller:he}),[v,y]=$.useState(!1),w=sg(u),x=hr(n),k=$.useRef(!1),[S,M]=$.useState(0);return $.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(d9,w),()=>e.removeEventListener(d9,w)},[w]),/* @__PURE__ */r(ho,{scope:n,orientation:a,dir:m,loop:i,currentTabStopId:g,onItemFocus:$.useCallback(e=>b(e),[b]),onItemShiftTab:$.useCallback(()=>y(!0),[]),onFocusableItemAdd:$.useCallback(()=>M(e=>e+1),[]),onFocusableItemRemove:$.useCallback(()=>M(e=>e-1),[]),children:/* @__PURE__ */r(l2.div,{tabIndex:v||0===S?-1:0,"data-orientation":a,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:lo(e.onMouseDown,()=>{k.current=!0}),onFocus:lo(e.onFocus,e=>{let t=!k.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(d9,d7);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);hm([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),d)}}k.current=!1}),onBlur:lo(e.onBlur,()=>y(!1))})})},"RovingFocusGroupImpl")),hu="RovingFocusGroupItem",hd=/* @__PURE__ */$.forwardRef(/* @__PURE__ */d8(function(e,t){let{__scopeRovingFocusGroup:n,focusable:a=!0,active:i=!1,tabStopId:o,children:l,...s}=e,c=dQ(),u=o||c,d=hl(hu,n),h=d.currentTabStopId===u,p=hr(n),{onFocusableItemAdd:f,onFocusableItemRemove:m,currentTabStopId:g}=d,b=d3();return lk(()=>{if(b&&a)return f(),()=>m()},[b,a,f,m]),$.useEffect(()=>{if(!b&&a)return f(),()=>m()},[b,a,f,m]),/* @__PURE__ */r(ht.ItemSlot,{scope:n,id:u,focusable:a,active:i,children:/* @__PURE__ */r(l2.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:lo(e.onMouseDown,e=>{a?d.onItemFocus(u):e.preventDefault()}),onFocus:lo(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:lo(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=hf(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=p().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=d.loop?hg(r,n+1):r.slice(n+1)}setTimeout(()=>hm(r))}}),children:"function"==typeof l?l({isCurrentTabStop:h,hasTabStop:null!=g}):l})})},"RovingFocusGroupItem")),hh={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hp(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function hf(e,t,r){let n=hp(e.key,r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return hh[n]}function hm(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function hg(e,t){return e.map((r,n)=>e[(t+n)%e.length])}d8(hp,"getDirectionAwareKey"),d8(hf,"getFocusIntent"),d8(hm,"focusFirst"),d8(hg,"wrapArray");var hb=hs,hv=hd,hy=function(e){return"u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},hw=new WeakMap,hx=new WeakMap,hk={},hS=0,hM=function(e){return e&&(e.host||hM(e.parentNode))},hF=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=hM(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return!!e})},hC=function(e,t,r,n){var a=hF(t,Array.isArray(e)?e:[e]);hk[r]||(hk[r]=new WeakMap);var i=hk[r],o=[],l=new Set,s=new Set(a),c=function(e){!e||l.has(e)||(l.add(e),c(e.parentNode))};a.forEach(c);var u=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(l.has(e))u(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,s=(hw.get(e)||0)+1,c=(i.get(e)||0)+1;hw.set(e,s),i.set(e,c),o.push(e),1===s&&a&&hx.set(e,!0),1===c&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),l.clear(),hS++,function(){o.forEach(function(e){var t=hw.get(e)-1,a=i.get(e)-1;hw.set(e,t),i.set(e,a),t||(hx.has(e)||e.removeAttribute(n),hx.delete(e)),a||e.removeAttribute(r)}),--hS||(hw=new WeakMap,hw=new WeakMap,hx=new WeakMap,hk={})}},hD=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=t||hy(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),hC(n,a,r,"aria-hidden")):function(){return null}},hz=function(e,t,r){void 0===r&&(r="data-inert-ed");var n=t||hy(e);return n?hC(e,n,r,"inert"):function(){return null}},hN=function(){return"u">typeof HTMLElement&&HTMLElement.prototype.hasOwnProperty("inert")},hE=function(e,t,r){return void 0===r&&(r="data-suppressed"),(hN()?hz:hD)(e,t,r)},hT=function(e,t){return(hT=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function hR(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}hT(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var hA=function(){return(hA=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function hI(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>t.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function hP(e,t,r,n){var a,i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function hL(e,t){return function(r,n){t(r,n,e)}}function hO(e,t,r,n,a,i){function o(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var l,s=n.kind,c="getter"===s?"get":"setter"===s?"set":"value",u=!t&&e?n.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),h=!1,p=r.length-1;p>=0;p--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(h)throw TypeError("Cannot add initializers after decoration has completed");i.push(o(e||null))};var g=(0,r[p])("accessor"===s?{get:d.get,set:d.set}:d[c],f);if("accessor"===s){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw TypeError("Object expected");(l=o(g.get))&&(d.get=l),(l=o(g.set))&&(d.set=l),(l=o(g.init))&&a.unshift(l)}else(l=o(g))&&("field"===s?a.unshift(l):d[c]=l)}u&&Object.defineProperty(u,n.name,d),h=!0}function hq(e,t,r){for(var n=arguments.length>2,a=0;a<t.length;a++)r=n?t[a].call(e,r):t[a].call(e);return n?r:void 0}function h$(e){return"symbol"==typeof e?e:"".concat(e)}function h_(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function hj(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function hH(e,t,r,n){return new(r||(r=Promise))(function(r,a){step((n=n.apply(e,t||[])).next())})}function hB(e,t){var r,n,a,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(s){var c=[l,s];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){i.label=c[1];break}if(6===c[0]&&i.label<a[1]){i.label=a[1],a=c;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(c);break}a[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var hW=Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function hG(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||hW(t,e,r)}function hY(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function hU(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o}function hX(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(hU(arguments[t]));return e}function hK(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),a=0,t=0;t<r;t++)for(var i=arguments[t],o=0,l=i.length;o<l;o++,a++)n[a]=i[o];return n}function hV(e,t,r){if(r||2==arguments.length)for(var n,a=0,i=t.length;a<i;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}function hQ(e){return this instanceof hQ?(this.v=e,this):new hQ(e)}function hZ(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,a=r.apply(e,t||[]),i=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),n[Symbol.asyncIterator]=function(){return this},n;function o(e,t){a[e]&&(n[e]=function(t){return new Promise(function(r,n){i.push([e,t,r,n])>1||l(e,t)})},t&&(n[e]=t(n[e])))}function l(e,t){try{var r;(r=a[e](t)).value instanceof hQ?Promise.resolve(r.value.v).then(s,c):u(i[0][2],r)}catch(e){u(i[0][3],e)}}function s(e){l("next",e)}function c(e){l("throw",e)}function u(e,t){e(t),i.shift(),i.length&&l(i[0][0],i[0][1])}}function hJ(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,a){t[n]=e[n]?function(t){return(r=!r)?{value:hQ(e[n](t)),done:!1}:a?a(t):t}:a}}function h0(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=hY(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,a){var i,o,l;i=n,o=a,l=(t=e[r](t)).done,Promise.resolve(t.value).then(function(e){i({value:e,done:l})},o)})}}}function h1(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var h2=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},h5=function(e){return(h5=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)};function h4(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=h5(e),n=0;n<r.length;n++)"default"!==r[n]&&hW(t,e,r[n]);return h2(t,e),t}function h3(e){return e&&e.__esModule?e:{default:e}}function h6(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function h8(e,t,r,n,a){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!a)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(e,r):a?a.value=r:t.set(e,r),r}function h9(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function h7(e,t,r){if(null!=t){var n,a;if("object"!=typeof t&&"function"!=typeof t)throw TypeError("Object expected.");if(r){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(a=n)}if("function"!=typeof n)throw TypeError("Object not disposable.");a&&(n=function(){try{a.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var pe=null;function pt(e){function t(t){e.error=e.hasError?new pe(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function a(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(a);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(a,function(e){return t(e),a()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function pr(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,r,n,a,i){return r?t?".jsx":".js":!n||a&&i?n+a+"."+i.toLowerCase()+"js":e}):e}let pn=null;var pa="right-scroll-bar-position",pi="width-before-scroll-bar",po="with-scroll-bars-hidden",pl="--removed-body-scroll-bar-size";function ps(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}function pc(e,t){var r=b(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}})[0];return r.callback=t,r.facade}var pu="u">typeof window?$.useLayoutEffect:$.useEffect,pd=new WeakMap;function ph(e,t){var r=pc(t||null,function(t){return e.forEach(function(e){return ps(e,t)})});return pu(function(){var t=pd.get(r);if(t){var n=new Set(t),a=new Set(e),i=r.current;n.forEach(function(e){a.has(e)||ps(e,null)}),a.forEach(function(e){n.has(e)||ps(e,i)})}pd.set(r,e)},[e]),r}function pp(e){return e}function pf(e,t){void 0===t&&(t=pp);var r=[],n=!1;return{read:function(){if(n)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var a=t(e,n);return r.push(a),function(){r=r.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var a=r;r=[],a.forEach(e),t=r}var i=function(){var r=t;t=[],r.forEach(e)},o=function(){return Promise.resolve().then(i)};o(),r={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),r}}}}}function pm(e,t){return void 0===t&&(t=pp),pf(e,t)}function pg(e){void 0===e&&(e={});var t=pf(null);return t.options=hA({async:!0,ssr:!1},e),t}var pb=pg(),pv=function(){},py=$.forwardRef(function(e,t){var r=$.useRef(null),n=$.useState({onScrollCapture:pv,onWheelCapture:pv,onTouchMoveCapture:pv}),a=n[0],i=n[1],o=e.forwardProps,l=e.children,s=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,p=e.noRelative,f=e.noIsolation,m=e.inert,g=e.allowPinchZoom,b=e.as,v=e.gapMode,y=hI(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=ph([r,t]),x=hA(hA({},y),a);return $.createElement($.Fragment,null,u&&$.createElement(h,{sideCar:pb,removeScrollBar:c,shards:d,noRelative:p,noIsolation:f,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:v}),o?$.cloneElement($.Children.only(l),hA(hA({},x),{ref:w})):$.createElement(void 0===b?"div":b,hA({},x,{className:s,ref:w}),l))});py.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},py.classNames={fullWidth:pi,zeroRight:pa};var pw=function(e){var t=e.sideCar,r=hI(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return $.createElement(n,hA({},r))};function px(e,t){return e.useMedium(t),pw}pw.isSideCarExport=!0;var pk=function(e){H=e},pS=function(){return H||G.nc};function pM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pS();return t&&e.setAttribute("nonce",t),e}function pF(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pC(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}var pD=function(){var e=0,t=null;return{add:function(r){0==e&&(t=pM())&&(pF(t,r),pC(t)),e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pz=function(){var e=pD();return function(t,r){$.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},pN=function(){var e=pz();return function(t){return e(t.styles,t.dynamic),null}},pE={left:0,top:0,right:0,gap:0},pT=function(e){return parseInt(e||"",10)||0},pR=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[pT(r),pT(n),pT(a)]},pA=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return pE;var t=pR(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},pI=pN(),pP="data-scroll-locked",pL=function(e,t,r,n){var a=e.left,i=e.top,o=e.right,l=e.gap;return void 0===r&&(r="margin"),"\n .".concat(po," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(l,"px ").concat(n,";\n }\n body[").concat(pP,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(o,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(pa," {\n right: ").concat(l,"px ").concat(n,";\n }\n \n .").concat(pi," {\n margin-right: ").concat(l,"px ").concat(n,";\n }\n \n .").concat(pa," .").concat(pa," {\n right: 0 ").concat(n,";\n }\n \n .").concat(pi," .").concat(pi," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(pP,"] {\n ").concat(pl,": ").concat(l,"px;\n }\n")},pO=function(){var e=parseInt(document.body.getAttribute(pP)||"0",10);return isFinite(e)?e:0},pq=function(){$.useEffect(function(){return document.body.setAttribute(pP,(pO()+1).toString()),function(){var e=pO()-1;e<=0?document.body.removeAttribute(pP):document.body.setAttribute(pP,e.toString())}},[])},p$=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=void 0===n?"margin":n;pq();var i=$.useMemo(function(){return pA(a)},[a]);return $.createElement(pI,{styles:pL(i,!t,a,r?"":"!important")})},p_=!1;if("u">typeof window)try{var pj=Object.defineProperty({},"passive",{get:function(){return p_=!0,!0}});window.addEventListener("test",pj,pj),window.removeEventListener("test",pj,pj)}catch(e){p_=!1}var pH=!!p_&&{passive:!1},pB=function(e){return"TEXTAREA"===e.tagName},pW=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!pB(e)&&"visible"===r[t])},pG=function(e){return pW(e,"overflowY")},pY=function(e){return pW(e,"overflowX")},pU=function(e,t){var r=t.ownerDocument,n=t;do{if("u">typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),pV(e,n)){var a=pQ(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body)return!1},pX=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},pK=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},pV=function(e,t){return"v"===e?pG(t):pY(t)},pQ=function(e,t){return"v"===e?pX(t):pK(t)},pZ=function(e,t){return"h"===e&&"rtl"===t?-1:1},pJ=function(e,t,r,n,a){var i=pZ(e,window.getComputedStyle(t).direction),o=i*n,l=r.target,s=t.contains(l),c=!1,u=o>0,d=0,h=0;do{if(!l)break;var p=pQ(e,l),f=p[0],m=p[1]-p[2]-i*f;(f||m)&&pV(e,l)&&(d+=m,h+=f);var g=l.parentNode;l=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!s&&l!==document.body||s&&(t.contains(l)||t===l))return u&&(a&&1>Math.abs(d)||!a&&o>d)?c=!0:!u&&(a&&1>Math.abs(h)||!a&&-o>h)&&(c=!0),c},p0=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},p1=function(e){return[e.deltaX,e.deltaY]},p2=function(e){return e&&"current"in e?e.current:e},p5=function(e,t){return e[0]===t[0]&&e[1]===t[1]},p4=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},p3=0,p6=[];function p8(e){var t=$.useRef([]),r=$.useRef([0,0]),n=$.useRef(),a=$.useState(p3++)[0],i=$.useState(pN)[0],o=$.useRef(e);$.useEffect(function(){o.current=e},[e]),$.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=hV([e.lockRef.current],(e.shards||[]).map(p2),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=$.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var a,i=p0(e),l=r.current,s="deltaX"in e?e.deltaX:l[0]-i[0],c="deltaY"in e?e.deltaY:l[1]-i[1],u=e.target,d=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var h=window.getSelection(),p=h&&h.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var f=pU(d,u);if(!f)return!0;if(f?a=d:(a="v"===d?"h":"v",f=pU(d,u)),!f)return!1;if(!n.current&&"changedTouches"in e&&(s||c)&&(n.current=a),!a)return!0;var m=n.current||a;return pJ(m,t,e,"h"===m?s:c,!0)},[]),s=$.useCallback(function(e){if(p6.length&&p6[p6.length-1]===i){var r="deltaY"in e?p1(e):p0(e),n=t.current.filter(function(t){return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&p5(t.delta,r)})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var a=(o.current.shards||[]).map(p2).filter(Boolean).filter(function(t){return t.contains(e.target)});(a.length>0?l(e,a[0]):!o.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=$.useCallback(function(e,r,n,a){var i={name:e,delta:r,target:n,should:a,shadowParent:p9(n)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),u=$.useCallback(function(e){r.current=p0(e),n.current=void 0},[]),d=$.useCallback(function(t){c(t.type,p1(t),t.target,l(t,e.lockRef.current))},[]),h=$.useCallback(function(t){c(t.type,p0(t),t.target,l(t,e.lockRef.current))},[]);$.useEffect(function(){return p6.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",s,pH),document.addEventListener("touchmove",s,pH),document.addEventListener("touchstart",u,pH),function(){p6=p6.filter(function(e){return e!==i}),document.removeEventListener("wheel",s,pH),document.removeEventListener("touchmove",s,pH),document.removeEventListener("touchstart",u,pH)}},[]);var p=e.removeScrollBar,f=e.inert;return $.createElement($.Fragment,null,f?$.createElement(i,{styles:p4(a)}):null,p?$.createElement(p$,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function p9(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}let p7=px(pb,p8);var fe=$.forwardRef(function(e,t){return $.createElement(py,hA({},e,{ref:t,sideCar:p7}))});fe.classNames=py.classNames;let ft=fe;var fr=Object.defineProperty,fn=(e,t)=>fr(e,"name",{value:t,configurable:!0}),fa=["Enter"," "],fi=["ArrowDown","PageUp","Home"],fo=["ArrowUp","PageDown","End"],fl=[...fi,...fo],fs={ltr:[...fa,"ArrowRight"],rtl:[...fa,"ArrowLeft"]},fc=null,fu="Menu",[fd,fh,fp]=l8(fu),[ff,fm]=ly(fu,[fp,dp,hi]),fg=dp(),fb=hi(),[fv,fy]=ff(fu),[fw,fx]=ff(fu),fk=/* @__PURE__ */fn(e=>{let{__scopeMenu:t,open:n=!1,children:a,dir:i,onOpenChange:o,modal:l=!0}=e,s=fg(t),[c,u]=$.useState(null),d=$.useRef(!1),h=sg(o),p=sh(i);return $.useEffect(()=>{let e=/* @__PURE__ */fn(()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},"handleKeyDown"),t=/* @__PURE__ */fn(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),$.useEffect(()=>{if(!n)return;let e=/* @__PURE__ */fn(()=>h(!1),"handleBlur");return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[n,h]),/* @__PURE__ */r(dN,{...s,children:/* @__PURE__ */r(fv,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:u,children:/* @__PURE__ */r(fw,{scope:t,onClose:$.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:p,modal:l,children:a})})})},"Menu"),fS=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let{__scopeMenu:n,...a}=e;return /* @__PURE__ */r(dE,{...fg(n),...a,ref:t})},"MenuAnchor")),fM="MenuPortal",[fF,fC]=ff(fM,{forceMount:void 0}),fD=/* @__PURE__ */fn(e=>{let{__scopeMenu:t,forceMount:n,children:a,container:i}=e,o=fy(fM,t);return /* @__PURE__ */r(fF,{scope:t,forceMount:n,children:/* @__PURE__ */r(d_,{present:n||o.open,children:/* @__PURE__ */r(dP,{asChild:!0,container:i,children:a})})})},"MenuPortal"),fz="MenuContent",[fN,fE]=ff(fz),fT=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let n=fC(fz,e.__scopeMenu),{forceMount:a=n.forceMount,...i}=e,o=fy(fz,e.__scopeMenu),l=fx(fz,e.__scopeMenu);return /* @__PURE__ */r(fd.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */r(d_,{present:a||o.open,children:/* @__PURE__ */r(fd.Slot,{scope:e.__scopeMenu,children:l.modal?/* @__PURE__ */r(fR,{...i,ref:t}):/* @__PURE__ */r(fA,{...i,ref:t})})})})},"MenuContent")),fR=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let n=fy(fz,e.__scopeMenu),a=$.useRef(null),i=lm(t,a);return $.useEffect(()=>{let e=a.current;if(e)return hD(e)},[]),/* @__PURE__ */r(fP,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:lo(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentModal")),fA=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let n=fy(fz,e.__scopeMenu);return /* @__PURE__ */r(fP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentNonModal")),fI=lq("MenuContent.ScrollLock"),fP=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let{__scopeMenu:n,loop:a=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,onDismiss:f,disableOutsideScroll:m,...g}=e,b=fy(fz,n),v=fx(fz,n),y=fg(n),w=fb(n),x=fh(n),[k,S]=$.useState(null),M=$.useRef(null),F=lm(t,M,b.onContentChange),C=$.useRef(0),D=$.useRef(""),z=$.useRef(0),N=$.useRef(null),E=$.useRef("right"),T=$.useRef(0),R=m?fe:$.Fragment,A=/* @__PURE__ */fn(e=>{let t=D.current+e,r=x().filter(e=>!e.disabled),n=document.activeElement,a=r.find(e=>e.ref.current===n)?.textValue,i=ma(r.map(e=>e.textValue),t,a),o=r.find(e=>e.textValue===i)?.ref.current;(/* @__PURE__ */fn(function e(t){D.current=t,window.clearTimeout(C.current),""!==t&&(C.current=window.setTimeout(()=>e(""),1e3))},"updateSearch"))(t),o&&setTimeout(()=>o.focus())},"handleTypeaheadSearch");$.useEffect(()=>()=>window.clearTimeout(C.current),[]),sq();let I=$.useCallback(e=>E.current===N.current?.side&&mo(e,N.current?.area),[]);return /* @__PURE__ */r(fN,{scope:n,searchRef:D,onItemEnter:$.useCallback(e=>{I(e)&&e.preventDefault()},[I]),onItemLeave:$.useCallback(e=>{I(e)||(M.current?.focus(),S(null))},[I]),onTriggerLeave:$.useCallback(e=>{I(e)&&e.preventDefault()},[I]),pointerGraceTimerRef:z,onPointerGraceIntentChange:$.useCallback(e=>{N.current=e},[]),children:/* @__PURE__ */r(R,{...m?{as:fI,allowPinchZoom:!0}:void 0,children:/* @__PURE__ */r(sG,{asChild:!0,trapped:i,onMountAutoFocus:lo(o,e=>{e.preventDefault(),M.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:/* @__PURE__ */r(sS,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,onDismiss:f,children:/* @__PURE__ */r(hb,{asChild:!0,...w,dir:v.dir,orientation:"vertical",loop:a,currentTabStopId:k,onCurrentTabStopIdChange:S,onEntryFocus:lo(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:/* @__PURE__ */r(dT,{role:"menu","aria-orientation":"vertical","data-state":f7(b.open),"data-radix-menu-content":"",dir:v.dir,...y,...g,ref:F,style:{outline:"none",...g.style},onKeyDown:lo(g.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&A(e.key));let a=M.current;if(e.target!==a||!fl.includes(e.key))return;e.preventDefault();let i=x().filter(e=>!e.disabled).map(e=>e.ref.current);fo.includes(e.key)&&i.reverse(),mr(i)}),onBlur:lo(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(C.current),D.current="")}),onPointerMove:lo(e.onPointerMove,ml(e=>{let t=e.target,r=T.current!==e.clientX;e.currentTarget.contains(t)&&r&&(E.current=e.clientX>T.current?"right":"left",T.current=e.clientX)}))})})})})})})},"MenuContentImpl")),fL=/* @__PURE__ */null,fO=/* @__PURE__ */null,fq="MenuItem",f$="menu.itemSelect",f_=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let{disabled:n=!1,onSelect:a,...i}=e,o=$.useRef(null),l=fx(fq,e.__scopeMenu),s=fE(fq,e.__scopeMenu),c=lm(t,o),u=$.useRef(!1),d=/* @__PURE__ */fn(()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(f$,{bubbles:!0,cancelable:!0});e.addEventListener(f$,e=>a?.(e),{once:!0}),l5(e,t),t.defaultPrevented?u.current=!1:l.onClose()}},"handleSelect");return /* @__PURE__ */r(fj,{...i,ref:c,disabled:n,onClick:lo(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:lo(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:lo(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(""===s.searchRef.current||" "!==e.key)&&fa.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},"MenuItem")),fj=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let{__scopeMenu:n,disabled:a=!1,textValue:i,...o}=e,l=fE(fq,n),s=fb(n),c=$.useRef(null),u=lm(t,c),[d,h]=$.useState(!1),[p,f]=$.useState("");return $.useEffect(()=>{let e=c.current;e&&f((e.textContent??"").trim())},[o.children]),/* @__PURE__ */r(fd.ItemSlot,{scope:n,disabled:a,textValue:i??p,children:/* @__PURE__ */r(hv,{asChild:!0,...s,focusable:!a,children:/* @__PURE__ */r(l2.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...o,ref:u,onPointerMove:lo(e.onPointerMove,ml(e=>{a?l.onItemLeave(e):(l.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:lo(e.onPointerLeave,ml(e=>l.onItemLeave(e))),onFocus:lo(e.onFocus,()=>h(!0)),onBlur:lo(e.onBlur,()=>h(!1))})})})},"MenuItemImpl")),fH=/* @__PURE__ */null,fB="MenuRadioGroup",[fW,fG]=ff(fB,{value:void 0,onValueChange:/* @__PURE__ */fn(()=>{},"onValueChange")}),fY=/* @__PURE__ */null,fU="MenuRadioItem",fX=/* @__PURE__ */null,fK="MenuItemIndicator",[fV,fQ]=ff(fK,{checked:!1}),fZ=/* @__PURE__ */null,fJ=/* @__PURE__ */$.forwardRef(/* @__PURE__ */fn(function(e,t){let{__scopeMenu:n,...a}=e;return /* @__PURE__ */r(l2.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})},"MenuSeparator")),f0=/* @__PURE__ */null,f1="MenuSub",[f2,f5]=ff(f1),f4=/* @__PURE__ */null,f3="MenuSubTrigger",f6=/* @__PURE__ */null,f8="MenuSubContent",f9=/* @__PURE__ */null;function f7(e){return e?"open":"closed"}function me(e){return"indeterminate"===e}function mt(e){return me(e)?"indeterminate":e?"checked":"unchecked"}function mr(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function mn(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function ma(e,t,r){let n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1,i=mn(e,Math.max(a,0));1===n.length&&(i=i.filter(e=>e!==r));let o=i.find(e=>e.toLowerCase().startsWith(n.toLowerCase()));return o!==r?o:void 0}function mi(e,t){let{x:r,y:n}=e,a=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){let o=t[e],l=t[i],s=o.x,c=o.y,u=l.x,d=l.y;c>n!=d>n&&r<(u-s)*(n-c)/(d-c)+s&&(a=!a)}return a}function mo(e,t){return!!t&&mi({x:e.clientX,y:e.clientY},t)}function ml(e){return t=>"mouse"===t.pointerType?e(t):void 0}fn(f7,"getOpenState"),fn(me,"isIndeterminate"),fn(mt,"getCheckedState"),fn(mr,"focusFirst"),fn(mn,"wrapArray"),fn(ma,"getNextMatch"),fn(mi,"isPointInPolygon"),fn(mo,"isPointerInGraceArea"),fn(ml,"whenMouse");var ms=fk,mc=fS,mu=fD,md=fT,mh=null,mp=null,mf=f_,mm=null,mg=null,mb=null,mv=null,my=fJ,mw=null,mx=null,mk=null,mS=null,mM=Object.defineProperty,mF=(e,t)=>mM(e,"name",{value:t,configurable:!0}),mC="DropdownMenu",[mD,mz]=ly(mC,[fm]),mN=fm(),[mE,mT]=mD(mC),mR=/* @__PURE__ */mF(e=>{let{__scopeDropdownMenu:t,children:n,dir:a,open:i,defaultOpen:o,onOpenChange:l,modal:s=!0}=e,c=mN(t),u=$.useRef(null),[d,h]=lT({prop:i,defaultProp:o??!1,onChange:l,caller:mC});return /* @__PURE__ */r(mE,{scope:t,triggerId:dQ(),triggerRef:u,contentId:dQ(),open:d,onOpenChange:h,onOpenToggle:$.useCallback(()=>h(e=>!e),[h]),modal:s,children:/* @__PURE__ */r(ms,{...c,open:d,onOpenChange:h,dir:a,modal:s,children:n})})},"DropdownMenu"),mA="DropdownMenuTrigger",mI=/* @__PURE__ */$.forwardRef(/* @__PURE__ */mF(function(e,t){let{__scopeDropdownMenu:n,disabled:a=!1,...i}=e,o=mT(mA,n),l=mN(n),s=lm(t,o.triggerRef);return /* @__PURE__ */r(mc,{asChild:!0,...l,children:/* @__PURE__ */r(l2.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...i,ref:s,onPointerDown:lo(e.onPointerDown,e=>{!a&&0===e.button&&!1===e.ctrlKey&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:lo(e.onKeyDown,e=>{!a&&(["Enter"," "].includes(e.key)&&o.onOpenToggle(),"ArrowDown"===e.key&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})},"DropdownMenuTrigger")),mP=/* @__PURE__ */mF(e=>{let{__scopeDropdownMenu:t,...n}=e;return /* @__PURE__ */r(mu,{...mN(t),...n})},"DropdownMenuPortal"),mL="DropdownMenuContent",mO=/* @__PURE__ */$.forwardRef(/* @__PURE__ */mF(function(e,t){let{__scopeDropdownMenu:n,...a}=e,i=mT(mL,n),o=mN(n),l=$.useRef(!1);return /* @__PURE__ */r(md,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...a,ref:t,onCloseAutoFocus:lo(e.onCloseAutoFocus,e=>{l.current||i.triggerRef.current?.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:lo(e.onInteractOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!i.modal||n)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),mq=/* @__PURE__ */null,m$=/* @__PURE__ */null,m_=/* @__PURE__ */$.forwardRef(/* @__PURE__ */mF(function(e,t){let{__scopeDropdownMenu:n,...a}=e;return /* @__PURE__ */r(mf,{...mN(n),...a,ref:t})},"DropdownMenuItem")),mj=/* @__PURE__ */null,mH=/* @__PURE__ */null,mB=/* @__PURE__ */null,mW=/* @__PURE__ */null,mG=/* @__PURE__ */$.forwardRef(/* @__PURE__ */mF(function(e,t){let{__scopeDropdownMenu:n,...a}=e;return /* @__PURE__ */r(my,{...mN(n),...a,ref:t})},"DropdownMenuSeparator")),mY=/* @__PURE__ */null,mU=/* @__PURE__ */null,mX=/* @__PURE__ */null,mK=/* @__PURE__ */null,mV=mR,mQ=mI,mZ=mP,mJ=mO,m0=null,m1=null,m2=m_,m5=null,m4=null,m3=null,m6=null,m8=mG,m9=null,m7=null,ge=null,gt=null;let gr="u"<typeof window?h:f,gn=e=>{let t=Number.parseInt(e.getAttribute("data-rfkit-charts-portal-users")??"0",10);e.setAttribute("data-rfkit-charts-portal-users",String(t+1))},ga=e=>{let t=Number.parseInt(e.getAttribute("data-rfkit-charts-portal-users")??"0",10)-1;t<=0?e.remove():e.setAttribute("data-rfkit-charts-portal-users",String(t))},gi=e=>{let[t,r]=b(null);return gr(()=>{let t=eP(e);if(t)return gn(t),r(t),()=>{ga(t)}},[e]),t};function go({...e}){return /*#__PURE__*/r(mV,{"data-slot":"dropdown-menu",...e})}let gl=/*#__PURE__*/$.forwardRef(({...e},t)=>/*#__PURE__*/r(mQ,{ref:t,"data-slot":"dropdown-menu-trigger",...e}));function gs({...e}){let t=gi("dropdown-menu");return t?/*#__PURE__*/r(mZ,{"data-slot":"dropdown-menu-portal",container:t,...e}):null}function gc({className:e,sideOffset:t=8,...n}){return /*#__PURE__*/r(gs,{children:/*#__PURE__*/r(mJ,{"data-slot":"dropdown-menu-content",sideOffset:t,className:iX("z-50 min-w-[8.75rem] overflow-hidden rounded-[var(--radius-surface)] border border-border/70 bg-background/98 p-[calc(var(--size-gap-base)/2)] text-foreground shadow-lg backdrop-blur-md","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",e),...n})})}gl.displayName=mQ.displayName;let gu=/*#__PURE__*/$.forwardRef(({className:e,...t},n)=>/*#__PURE__*/r(m2,{ref:n,"data-slot":"dropdown-menu-item",className:iX("relative flex w-full cursor-default select-none items-center gap-2 px-[var(--size-gap-base)] py-[calc(var(--size-gap-base)/2)] text-xs outline-none transition-colors","rounded-[var(--radius-control)] focus:bg-accent/80 focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground data-[disabled]:opacity-40",e),...t}));gu.displayName=m2.displayName;let gd=/*#__PURE__*/$.forwardRef(({className:e,...t},n)=>/*#__PURE__*/r(m8,{ref:n,"data-slot":"dropdown-menu-separator",className:iX("my-[calc(var(--size-gap-base)/2)] h-px bg-border/60",e),...t}));gd.displayName=m8.displayName;var gh=Object.defineProperty,gp=(e,t)=>gh(e,"name",{value:t,configurable:!0});function gf(e,[t,r]){return Math.min(r,Math.max(t,e))}gp(gf,"clamp");var gm=Object.defineProperty,gg=(e,t)=>gm(e,"name",{value:t,configurable:!0});function gb(e,t){return $.useReducer((e,r)=>t[e][r]??e,e)}gg(gb,"useStateMachine");var gv="ScrollArea",[gy,gw]=ly(gv),[gx,gk]=gy(gv),gS=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{__scopeScrollArea:n,type:a="hover",dir:i,scrollHideDelay:o=600,...l}=e,[s,c]=$.useState(null),[u,d]=$.useState(null),[h,p]=$.useState(null),[f,m]=$.useState(null),[g,b]=$.useState(null),[v,y]=$.useState(0),[w,x]=$.useState(0),[k,S]=$.useState(!1),[M,F]=$.useState(!1),C=lm(t,c),D=sh(i);return /* @__PURE__ */r(gx,{scope:n,type:a,dir:D,scrollHideDelay:o,scrollArea:s,viewport:u,onViewportChange:d,content:h,onContentChange:p,scrollbarX:f,onScrollbarXChange:m,scrollbarXEnabled:k,onScrollbarXEnabledChange:S,scrollbarY:g,onScrollbarYChange:b,scrollbarYEnabled:M,onScrollbarYEnabledChange:F,onCornerWidthChange:y,onCornerHeightChange:x,children:/* @__PURE__ */r(l2.div,{dir:D,...l,ref:C,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})},"ScrollArea")),gM="ScrollAreaViewport",gF=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,a){let{__scopeScrollArea:i,children:o,nonce:l,...s}=e,c=gk(gM,i),u=lm(a,$.useRef(null),c.onViewportChange);return /* @__PURE__ */n(t,{children:[/* @__PURE__ */r(gC,{nonce:l}),/* @__PURE__ */r(l2.div,{"data-radix-scroll-area-viewport":"",...s,ref:u,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:/* @__PURE__ */r("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})},"ScrollAreaViewport")),gC=/* @__PURE__ */$.memo(/* @__PURE__ */gg(function({nonce:e}){return /* @__PURE__ */r("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:e})},"ScrollAreaViewportStyle"),(e,t)=>e.nonce===t.nonce),gD="ScrollAreaScrollbar",gz=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{forceMount:n,...a}=e,i=gk(gD,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:l}=i,s="horizontal"===e.orientation;return $.useEffect(()=>(s?o(!0):l(!0),()=>{s?o(!1):l(!1)}),[s,o,l]),"hover"===i.type?/* @__PURE__ */r(gN,{...a,ref:t,forceMount:n}):"scroll"===i.type?/* @__PURE__ */r(gE,{...a,ref:t,forceMount:n}):"auto"===i.type?/* @__PURE__ */r(gT,{...a,ref:t,forceMount:n}):"always"===i.type?/* @__PURE__ */r(gR,{...a,ref:t,"data-state":"visible"}):null},"ScrollAreaScrollbar")),gN=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{forceMount:n,...a}=e,i=gk(gD,e.__scopeScrollArea),[o,l]=$.useState(!1);return $.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let r=/* @__PURE__ */gg(()=>{window.clearTimeout(t),l(!0)},"handlePointerEnter"),n=/* @__PURE__ */gg(()=>{t=window.setTimeout(()=>l(!1),i.scrollHideDelay)},"handlePointerLeave");return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[i.scrollArea,i.scrollHideDelay]),/* @__PURE__ */r(d_,{present:n||o,children:/* @__PURE__ */r(gT,{"data-state":o?"visible":"hidden",...a,ref:t})})},"ScrollAreaScrollbarHover")),gE=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{forceMount:n,...a}=e,i=gk(gD,e.__scopeScrollArea),o="horizontal"===e.orientation,l=gZ(()=>c("SCROLL_END"),100),[s,c]=gb("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return $.useEffect(()=>{if("idle"===s){let e=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),$.useEffect(()=>{let e=i.viewport,t=o?"scrollLeft":"scrollTop";if(e){let r=e[t],n=/* @__PURE__ */gg(()=>{let n=e[t];r!==n&&(c("SCROLL"),l()),r=n},"handleScroll");return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[i.viewport,o,c,l]),/* @__PURE__ */r(d_,{present:n||"hidden"!==s,children:/* @__PURE__ */r(gR,{"data-state":"hidden"===s?"hidden":"visible",...a,ref:t,onPointerEnter:lo(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:lo(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),gT=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let n=gk(gD,e.__scopeScrollArea),{forceMount:a,...i}=e,[o,l]=$.useState(!1),s="horizontal"===e.orientation,c=gZ(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;l(s?e:t)}},10);return gJ(n.viewport,c),gJ(n.content,c),/* @__PURE__ */r(d_,{present:a||o,children:/* @__PURE__ */r(gR,{"data-state":o?"visible":"hidden",...i,ref:t})})},"ScrollAreaScrollbarAuto")),gR=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{orientation:n="vertical",...a}=e,i=gk(gD,e.__scopeScrollArea),o=$.useRef(null),l=$.useRef(0),[s,c]=$.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=gG(s.viewport,s.content),d={...a,sizes:s,onSizesChange:c,hasThumb:!!(u>0&&u<1),onThumbChange:/* @__PURE__ */gg(e=>o.current=e,"onThumbChange"),onThumbPointerUp:/* @__PURE__ */gg(()=>l.current=0,"onThumbPointerUp"),onThumbPointerDown:/* @__PURE__ */gg(e=>l.current=e,"onThumbPointerDown")};function h(e,t){return gU(e,l.current,s,t)}return(gg(h,"getScrollPosition"),"horizontal"===n)?/* @__PURE__ */r(gA,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){let e=gX(i.viewport.scrollLeft,s,i.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=h(e,i.dir))}}):"vertical"===n?/* @__PURE__ */r(gI,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){let e=gX(i.viewport.scrollTop,s);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=h(e))}}):null},"ScrollAreaScrollbarVisible")),gA=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{sizes:n,onSizesChange:a,...i}=e,o=gk(gD,e.__scopeScrollArea),[l,s]=$.useState(),c=$.useRef(null),u=lm(t,c,o.onScrollbarXChange);return $.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),/* @__PURE__ */r(gO,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":gY(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(o.viewport){let n=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),gV(n,r)&&t.preventDefault()}},onResize:()=>{c.current&&o.viewport&&l&&a({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:gW(l.paddingLeft),paddingEnd:gW(l.paddingRight)}})}})},"ScrollAreaScrollbarX")),gI=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{sizes:n,onSizesChange:a,...i}=e,o=gk(gD,e.__scopeScrollArea),[l,s]=$.useState(),c=$.useRef(null),u=lm(t,c,o.onScrollbarYChange);return $.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),/* @__PURE__ */r(gO,{"data-orientation":"vertical",...i,ref:u,sizes:n,style:{top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":gY(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(o.viewport){let n=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),gV(n,r)&&t.preventDefault()}},onResize:()=>{c.current&&o.viewport&&l&&a({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:gW(l.paddingTop),paddingEnd:gW(l.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[gP,gL]=gy(gD),gO=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{__scopeScrollArea:n,sizes:a,hasThumb:i,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:h,...p}=e,f=gk(gD,n),[m,g]=$.useState(null),b=lm(t,g),v=$.useRef(null),y=$.useRef(""),w=f.viewport,x=a.content-a.viewport,k=sg(d),S=sg(c),M=gZ(h,10);function F(e){v.current&&u({x:e.clientX-v.current.left,y:e.clientY-v.current.top})}return gg(F,"handleDragScroll"),$.useEffect(()=>{let e=/* @__PURE__ */gg(e=>{let t=e.target;m?.contains(t)&&k(e,x)},"handleWheel");return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[w,m,x,k]),$.useEffect(S,[a,S]),gJ(m,M),gJ(f.content,M),/* @__PURE__ */r(gP,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:sg(o),onThumbPointerUp:sg(l),onThumbPositionChange:S,onThumbPointerDown:sg(s),children:/* @__PURE__ */r(l2.div,{...p,ref:b,style:{position:"absolute",...p.style},onPointerDown:lo(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),v.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),F(e))}),onPointerMove:lo(e.onPointerMove,F),onPointerUp:lo(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,f.viewport&&(f.viewport.style.scrollBehavior=""),v.current=null})})})},"ScrollAreaScrollbarImpl")),gq="ScrollAreaThumb",g$=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{forceMount:n,...a}=e,i=gL(gq,e.__scopeScrollArea);return /* @__PURE__ */r(d_,{present:n||i.hasThumb,children:/* @__PURE__ */r(g_,{ref:t,...a})})},"ScrollAreaThumb")),g_=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{__scopeScrollArea:n,style:a,...i}=e,o=gk(gq,n),l=gL(gq,n),{onThumbPositionChange:s}=l,c=lm(t,l.onThumbChange),u=$.useRef(void 0),d=gZ(()=>{u.current&&(u.current(),u.current=void 0)},100);return $.useEffect(()=>{let e=o.viewport;if(e){let t=/* @__PURE__ */gg(()=>{d(),u.current||(u.current=gQ(e,s),s())},"handleScroll");return s(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,d,s]),/* @__PURE__ */r(l2.div,{"data-state":l.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:lo(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;l.onThumbPointerDown({x:r,y:n})}),onPointerUp:lo(e.onPointerUp,l.onThumbPointerUp)})},"ScrollAreaThumbImpl")),gj="ScrollAreaCorner",gH=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let n=gk(gj,e.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?/* @__PURE__ */r(gB,{...e,ref:t}):null},"ScrollAreaCorner")),gB=/* @__PURE__ */$.forwardRef(/* @__PURE__ */gg(function(e,t){let{__scopeScrollArea:n,...a}=e,i=gk(gj,n),[o,l]=$.useState(0),[s,c]=$.useState(0),u=!!(o&&s),{onCornerWidthChange:d,onCornerHeightChange:h}=i;return gJ(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),gJ(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),l(e)}),$.useEffect(()=>()=>{d(0),h(0)},[d,h]),u?/* @__PURE__ */r(l2.div,{...a,ref:t,style:{width:o,height:s,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...e.style}}):null},"ScrollAreaCornerImpl"));function gW(e){return e?parseInt(e,10):0}function gG(e,t){let r=e/t;return isNaN(r)?0:r}function gY(e){let t=gG(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-r)*t,18)}function gU(e,t,r,n="ltr"){let a=gY(r),i=t||a/2,o=r.scrollbar.paddingStart+i,l=r.scrollbar.size-r.scrollbar.paddingEnd-(a-i),s=r.content-r.viewport;return gK([o,l],"ltr"===n?[0,s]:[-1*s,0])(e)}function gX(e,t,r="ltr"){let n=gY(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,l=gf(e,"ltr"===r?[0,o]:[-1*o,0]);return gK([0,o],[0,i-n])(l)}function gK(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function gV(e,t){return e>0&&e<t}gg(gW,"toInt"),gg(gG,"getThumbRatio"),gg(gY,"getThumbSize"),gg(gU,"getScrollPositionFromPointer"),gg(gX,"getThumbOffsetFromScroll"),gg(gK,"linearScale"),gg(gV,"isScrollingWithinScrollbarBounds");var gQ=/* @__PURE__ */gg((e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(/* @__PURE__ */gg(function a(){let i={left:e.scrollLeft,top:e.scrollTop},o=r.left!==i.left,l=r.top!==i.top;(o||l)&&t(),r=i,n=window.requestAnimationFrame(a)},"loop"))(),()=>window.cancelAnimationFrame(n)},"addUnlinkedScrollListener");function gZ(e,t){let r=sg(e),n=$.useRef(0);return $.useEffect(()=>()=>window.clearTimeout(n.current),[]),$.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function gJ(e,t){let r=sg(t);lk(()=>{let t=0;if(e){let n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}gg(gZ,"useDebounceCallback"),gg(gJ,"useResizeObserver");var g0=gS,g1=gF,g2=null,g5=null,g4=gH;let g3=/*#__PURE__*/$.forwardRef(({className:e,orientation:t="vertical",...n},a)=>/*#__PURE__*/r(gz,{ref:a,orientation:t,className:iX("flex touch-none select-none p-0.5 transition-colors","vertical"===t?"h-full w-2.5 border-l border-l-transparent":"h-2.5 flex-col border-t border-t-transparent",e),...n,children:/*#__PURE__*/r(g$,{className:"relative flex-1 rounded-full bg-border/80"})}));g3.displayName=gz.displayName;let g6=/*#__PURE__*/$.forwardRef(({className:e,viewportClassName:t,children:a,...i},o)=>/*#__PURE__*/n(g0,{ref:o,"data-slot":"scroll-area",className:iX("relative overflow-hidden",e),...i,children:[/*#__PURE__*/r(g1,{"data-slot":"scroll-area-viewport",className:iX("h-full w-full rounded-[inherit]",t),children:a}),/*#__PURE__*/r(g3,{}),/*#__PURE__*/r(g4,{})]}));g6.displayName=g0.displayName;let g8=/*#__PURE__*/s(({children:e,className:t,style:a},i)=>/*#__PURE__*/n("div",{className:iX("relative z-[8] flex flex-col items-start p-2 text-popover-foreground",t),style:a,ref:i,children:[/*#__PURE__*/r("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-[7] rounded-[var(--radius-surface)] border border-border/70 bg-chart-panel/95 shadow-lg [backdrop-filter:saturate(2)_blur(20px)]"}),/*#__PURE__*/r("div",{className:"relative z-[8] h-full w-full",children:e})]})),g9=/*#__PURE__*/a.memo(g8);var g7=Object.defineProperty,be=(e,t)=>g7(e,"name",{value:t,configurable:!0}),bt=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),br=/* @__PURE__ */$.forwardRef(/* @__PURE__ */be(function(e,t){return /* @__PURE__ */r(l2.span,{...e,ref:t,style:{...bt,...e.style}})},"VisuallyHidden")),bn=br,ba=Object.defineProperty,bi=(e,t)=>ba(e,"name",{value:t,configurable:!0}),[bo,bl]=ly("Tooltip",[dp]),bs=dp(),bc="TooltipProvider",bu=700,bd="tooltip.open",[bh,bp]=bo(bc),bf=/* @__PURE__ */bi(e=>{let{__scopeTooltip:t,delayDuration:n=bu,skipDelayDuration:a=300,disableHoverableContent:i=!1,children:o}=e,l=$.useRef(!0),s=$.useRef(!1),c=$.useRef(0);return $.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),/* @__PURE__ */r(bh,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:$.useCallback(()=>{a<=0||(window.clearTimeout(c.current),l.current=!1)},[a]),onClose:$.useCallback(()=>{a<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>l.current=!0,a))},[a]),isPointerInTransitRef:s,onPointerInTransitChange:$.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:o})},"TooltipProvider"),bm="Tooltip",[bg,bb]=bo(bm),bv=/* @__PURE__ */bi(e=>{let{__scopeTooltip:t,children:n,open:a,defaultOpen:i,onOpenChange:o,disableHoverableContent:l,delayDuration:s}=e,c=bp(bm,e.__scopeTooltip),u=bs(t),[d,h]=$.useState(null),[p,f]=$.useState(void 0),m=dQ(),g=$.useRef(0),b=l??c.disableHoverableContent,v=s??c.delayDuration,y=$.useRef(!1),[w,x]=lT({prop:a,defaultProp:i??!1,onChange:/* @__PURE__ */bi(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(bd))):c.onClose(),o?.(e)},"onChange"),caller:bm}),k=$.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),S=$.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),M=$.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),F=$.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);return $.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),/* @__PURE__ */r(dN,{...u,children:/* @__PURE__ */r(bg,{scope:t,contentId:p??m,setContentId:f,open:w,stateAttribute:k,trigger:d,onTriggerChange:h,onTriggerEnter:$.useCallback(()=>{c.isOpenDelayedRef.current?F():S()},[c.isOpenDelayedRef,F,S]),onTriggerLeave:$.useCallback(()=>{b?M():(window.clearTimeout(g.current),g.current=0)},[M,b]),onOpen:S,onClose:M,disableHoverableContent:b,children:n})})},"Tooltip"),by="TooltipTrigger",bw=/* @__PURE__ */$.forwardRef(/* @__PURE__ */bi(function(e,t){let{__scopeTooltip:n,...a}=e,i=bb(by,n),o=bp(by,n),l=bs(n),s=lm(t,$.useRef(null),i.onTriggerChange),c=$.useRef(!1),u=$.useRef(!1),d=$.useCallback(()=>c.current=!1,[]);return $.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),/* @__PURE__ */r(dE,{asChild:!0,...l,children:/* @__PURE__ */r(l2.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...a,ref:s,onPointerMove:lo(e.onPointerMove,e=>{"touch"!==e.pointerType&&(u.current||o.isPointerInTransitRef.current||(i.onTriggerEnter(),u.current=!0))}),onPointerLeave:lo(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:lo(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:lo(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:lo(e.onBlur,i.onClose),onClick:lo(e.onClick,i.onClose)})})},"TooltipTrigger")),bx="TooltipPortal",[bk,bS]=bo(bx,{forceMount:void 0}),bM=/* @__PURE__ */bi(e=>{let{__scopeTooltip:t,forceMount:n,children:a,container:i}=e,o=bb(bx,t);return /* @__PURE__ */r(bk,{scope:t,forceMount:n,children:/* @__PURE__ */r(d_,{present:n||o.open,children:/* @__PURE__ */r(dP,{asChild:!0,container:i,children:a})})})},"TooltipPortal"),bF="TooltipContent",bC=/* @__PURE__ */$.forwardRef(/* @__PURE__ */bi(function(e,t){let n=bS(bF,e.__scopeTooltip),{forceMount:a=n.forceMount,side:i="top",...o}=e,l=bb(bF,e.__scopeTooltip);return /* @__PURE__ */r(d_,{present:a||l.open,children:l.disableHoverableContent?/* @__PURE__ */r(bN,{side:i,...o,ref:t}):/* @__PURE__ */r(bD,{side:i,...o,ref:t})})},"TooltipContent")),bD=/* @__PURE__ */$.forwardRef(/* @__PURE__ */bi(function(e,t){let n=bb(bF,e.__scopeTooltip),a=bp(bF,e.__scopeTooltip),i=$.useRef(null),o=lm(t,i),[l,s]=$.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:h}=a,p=$.useCallback(()=>{s(null),h(!1)},[h]),f=$.useCallback((e,t)=>{let r=e.currentTarget,n={x:e.clientX,y:e.clientY},a=bT(n,r.getBoundingClientRect());s(bP([...bR(n,a),...bA(t.getBoundingClientRect())])),h(!0)},[h]);return $.useEffect(()=>()=>p(),[p]),$.useEffect(()=>{if(c&&d){let e=/* @__PURE__ */bi(e=>f(e,d),"handleTriggerLeave"),t=/* @__PURE__ */bi(e=>f(e,c),"handleContentLeave");return c.addEventListener("pointerleave",e),d.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),d.removeEventListener("pointerleave",t)}}},[c,d,f,p]),$.useEffect(()=>{if(l){let e=/* @__PURE__ */bi(e=>{let t=e.target,r={x:e.clientX,y:e.clientY},n=c?.contains(t)||d?.contains(t),a=!bI(r,l);n?p():a&&(p(),u())},"handleTrackPointerGrace");return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[c,d,l,u,p]),/* @__PURE__ */r(bN,{...e,ref:o})},"TooltipContentHoverable")),bz=lj("TooltipContent"),bN=/* @__PURE__ */$.forwardRef(/* @__PURE__ */bi(function(e,t){let{__scopeTooltip:a,children:i,"aria-label":o,id:l,onEscapeKeyDown:s,onPointerDownOutside:c,...u}=e,d=bb(bF,a),h=bs(a),{onClose:p}=d;$.useEffect(()=>(document.addEventListener(bd,p),()=>document.removeEventListener(bd,p)),[p]),$.useEffect(()=>{if(d.trigger){let e=/* @__PURE__ */bi(e=>{e.target instanceof Node&&e.target.contains(d.trigger)&&p()},"handleScroll");return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[d.trigger,p]);let{setContentId:f}=d;return lk(()=>(f(l),()=>{f(void 0)}),[l,f]),/* @__PURE__ */r(sS,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:/* @__PURE__ */n(dT,{"data-state":d.stateAttribute,role:o?void 0:"tooltip",id:o?void 0:d.contentId,...h,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[/* @__PURE__ */r(bz,{children:i}),o?/* @__PURE__ */r(bn,{id:d.contentId,role:"tooltip",children:o}):null]})})},"TooltipContentImpl")),bE=/* @__PURE__ */$.forwardRef(/* @__PURE__ */bi(function(e,t){let{__scopeTooltip:n,...a}=e;return /* @__PURE__ */r(dR,{...bs(n),...a,ref:t})},"TooltipArrow"));function bT(e,t){let r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,a,i)){case i:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw Error("unreachable")}}function bR(e,t,r=5){let n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}function bA(e){let{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function bI(e,t){let{x:r,y:n}=e,a=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){let o=t[e],l=t[i],s=o.x,c=o.y,u=l.x,d=l.y;c>n!=d>n&&r<(u-s)*(n-c)/(d-c)+s&&(a=!a)}return a}function bP(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),bL(t)}function bL(e){if(e.length<=1)return e.slice();let t=[];for(let r=0;r<e.length;r++){let n=e[r];for(;t.length>=2;){let e=t[t.length-1],r=t[t.length-2];if((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x))t.pop();else break}t.push(n)}t.pop();let r=[];for(let t=e.length-1;t>=0;t--){let n=e[t];for(;r.length>=2;){let e=r[r.length-1],t=r[r.length-2];if((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x))r.pop();else break}r.push(n)}return(r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y)?t:t.concat(r)}bi(bT,"getExitSideFromRect"),bi(bR,"getPaddedExitPoints"),bi(bA,"getPointsFromRect"),bi(bI,"isPointInPolygon"),bi(bP,"getHull"),bi(bL,"getHullPresorted");var bO=bf,bq=bv,b$=bw,b_=bM,bj=bC,bH=bE;function bB({delayDuration:e=0,...t}){return /*#__PURE__*/r(bO,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function bW({...e}){return /*#__PURE__*/r(bq,{"data-slot":"tooltip",...e})}function bG({...e}){return /*#__PURE__*/r(b$,{"data-slot":"tooltip-trigger",...e})}function bY({className:e,sideOffset:t=6,children:a,...i}){let o=gi("tooltip");return o?/*#__PURE__*/r(b_,{container:o,children:/*#__PURE__*/n(bj,{"data-slot":"tooltip-content",sideOffset:t,className:iX("z-50 max-w-52 overflow-hidden rounded-[var(--radius-control)] border border-border/70 bg-popover/95 px-2.5 py-1.5 text-[11px] leading-4 text-popover-foreground shadow-lg backdrop-blur-md","pointer-events-none whitespace-pre-line","origin-[--radix-tooltip-content-transform-origin] data-[state=closed]:animate-out data-[state=open]:animate-in","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",e),...i,children:[a,/*#__PURE__*/r(bH,{className:"fill-popover stroke-border/70 stroke-[0.5px]"})]})}):null}let bU=200,bX=6,bK=8,bV=({children:e,content:t,delay:a=200,duration:i=3e3,offset:o={x:0,y:0}})=>{let[l,s]=b(!1),c=g(null),d=u(()=>{c.current&&(clearTimeout(c.current),c.current=null)},[]),p=u(()=>{d(),i<=0||(c.current=setTimeout(()=>{s(!1),c.current=null},i))},[d,i]),f=u(e=>{(s(e),e)?p():d()},[d,p]);return(h(()=>()=>{d()},[d]),null==t||""===t)?e:/*#__PURE__*/r(bB,{delayDuration:a,children:/*#__PURE__*/n(bW,{open:l,onOpenChange:f,children:[/*#__PURE__*/r(bG,{asChild:!0,children:e}),/*#__PURE__*/r(bY,{side:"top",align:"center",sideOffset:6,collisionPadding:8,avoidCollisions:!0,className:"border-0 bg-transparent p-0 text-xs shadow-none",style:{marginLeft:o.x??0,marginTop:o.y??0,maxWidth:200},children:/*#__PURE__*/r(g9,{className:"max-w-[200px] whitespace-pre-line",children:t})})]})})},bQ=bV,bZ=({value:e,options:t,onChange:a,placeholder:i="请选择",triggerContent:o,triggerTitle:l,closeOnSelect:s=!0,triggerVariant:c="default",showChevron:d=!0,triggerClassName:h,contentClassName:p,contentAlignOffset:f,customContent:g,triggerTestId:v})=>{let[y,w]=b(!1),x=u(e=>{let t=e.value??null;e.onSelect?.(t),a?.(t),s&&w(!1)},[a,s]),k=m(()=>t.find(t=>"separator"!==t.type&&t.value===e),[t,e]),S=iX("inline-flex h-full min-w-0 items-center truncate text-xs leading-none text-foreground","default"===c&&"flex-1"),M=o??(k?.label?/*#__PURE__*/r("span",{className:S,children:k.label}):"string"==typeof i?/*#__PURE__*/r("span",{className:S,children:i}):/*#__PURE__*/r("span",{className:iX("inline-flex h-full min-w-0 items-center","default"===c&&"flex-1"),children:i})),F=/*#__PURE__*/r(gl,{asChild:!0,children:/*#__PURE__*/n("button",{type:"button","data-testid":v,className:iX("cursor-pointer appearance-none select-none border-0 bg-transparent text-left","default"===c&&o0,"default"===c&&"data-[state=open]:bg-accent/72 data-[state=open]:text-foreground data-[state=open]:shadow-[inset_0_0_0_1px_var(--mix-border-72)] data-[state=open]:hover:bg-accent/72","plain"===c&&"inline-flex h-full min-h-0 min-w-0 items-center gap-1 p-0 text-inherit focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/70 focus-visible:ring-offset-1 focus-visible:ring-offset-background",h),children:[M,d?/*#__PURE__*/r("span",{"aria-hidden":"true",className:iX("ml-[calc(var(--size-gap-base)/2)] inline-flex h-full shrink-0 items-center justify-center text-[10px] text-muted-foreground transition-transform",y&&"rotate-180"),children:"▼"}):null]})});return /*#__PURE__*/n(go,{open:y,onOpenChange:w,modal:!1,children:[l?/*#__PURE__*/r(bV,{content:l,children:F}):F,/*#__PURE__*/r(gc,{align:"start",alignOffset:f,collisionPadding:8,className:iX("min-w-[140px] [min-width:var(--radix-dropdown-menu-trigger-width)]",p),children:g??/*#__PURE__*/r(g6,{viewportClassName:"h-auto max-h-64",children:/*#__PURE__*/r("div",{children:t.map((t,n)=>"separator"===t.type?/*#__PURE__*/r(gd,{style:t.style},`separator-${t.label??n}`):/*#__PURE__*/r(gu,{disabled:t.disabled,className:iX(e===t.value&&"bg-accent text-primary",t.disabled&&"data-[disabled]:text-muted-foreground"),style:t.style,onSelect:e=>{s||e.preventDefault(),x(t)},children:t.render?t.render():t.label},null!==t.value&&void 0!==t.value?t.value:`null-option-${n}`))})})})]})},bJ=bZ,b0=80,b1=80,b2=(e,t,r,n)=>({left:e,top:t,right:r,bottom:n,width:Math.max(0,r-e),height:Math.max(0,n-t)}),b5=e=>({sourceId:e.sourceId,sourceType:e.sourceType,clientX:e.clientX,clientY:e.clientY,bounds:e.bounds}),b4=(e,t)=>e?.sourceId===t.sourceId&&e?.sourceType===t.sourceType&&e?.coord.left===t.coord.left&&e?.coord.top===t.coord.top&&e?.clientX===t.clientX&&e?.clientY===t.clientY&&e?.bounds.left===t.bounds.left&&e?.bounds.top===t.bounds.top&&e?.bounds.right===t.bounds.right&&e?.bounds.bottom===t.bounds.bottom&&e?.sampledIndex===t.sampledIndex&&e?.globalIndex===t.globalIndex&&e?.rowIndex===t.rowIndex;class b3{entries=new Map;sampleIntervalMs;sampleIdleDelayMs;now;requestFrame;cancelFrame;setTimer;clearTimer;constructor(e={}){this.sampleIntervalMs=e.sampleIntervalMs??80,this.sampleIdleDelayMs=e.sampleIdleDelayMs??80,this.now=e.now??(()=>Date.now()),this.requestFrame=e.requestFrame??(e=>"u">typeof window?window.requestAnimationFrame(e):Number(setTimeout(e,16))),this.cancelFrame=e.cancelFrame??(e=>{"u">typeof window?window.cancelAnimationFrame(e):clearTimeout(e)}),this.setTimer=e.setTimer??((e,t)=>"u">typeof window?window.setTimeout(e,t):setTimeout(e,t)),this.clearTimer=e.clearTimer??(e=>{"u">typeof window?window.clearTimeout(e):clearTimeout(e)})}updatePointer(e,t){let r=this.ensureEntry(e);r.version+=1,r.pointer={...t,version:r.version,timestamp:this.now()},this.schedulePointerFrame(r),this.scheduleSample(r)}refreshBounds(e,t){let r=this.ensureEntry(e);r.pointer&&(r.version+=1,r.pointer={...r.pointer,bounds:t,version:r.version,timestamp:this.now()},this.schedulePointerFrame(r))}clearPointer(e,t="manual"){let r=this.entries.get(e);r&&(r.pointer=null,r.sample=null,r.lastSampleTimestamp=0,r.hasSampleTimestamp=!1,this.clearEntryTimers(r),this.notifyPointer(r,null),this.notifySample(r,null))}subscribePointer(e,t){let r=this.ensureEntry(e);return r.pointerListeners.add(t),t(r.pointer),()=>{r.pointerListeners.delete(t),this.cleanupEntryIfEmpty(e,r)}}subscribeSample(e,t){let r=this.ensureEntry(e);return r.sampleListeners.add(t),t(r.sample),()=>{r.sampleListeners.delete(t),this.cleanupEntryIfEmpty(e,r)}}getPointer(e){return this.entries.get(e)?.pointer??null}getSample(e){return this.entries.get(e)?.sample??null}dispose(e){if(e){let t=this.entries.get(e);if(!t)return;this.clearPointer(e,"dispose"),t.pointerListeners.clear(),t.sampleListeners.clear(),this.entries.delete(e);return}for(let e of Array.from(this.entries.keys()))this.dispose(e)}ensureEntry(e){let t=this.entries.get(e);if(t)return t;let r={pointer:null,sample:null,pointerListeners:new Set,sampleListeners:new Set,pointerFrame:null,sampleTimer:null,idleTimer:null,lastSampleTimestamp:0,hasSampleTimestamp:!1,version:0};return this.entries.set(e,r),r}schedulePointerFrame(e){null===e.pointerFrame&&(e.pointerFrame=this.requestFrame(()=>{e.pointerFrame=null,this.notifyPointer(e,e.pointer)}))}scheduleSample(e){if(!e.pointer)return;let t=this.now()-e.lastSampleTimestamp;!e.hasSampleTimestamp||t>=this.sampleIntervalMs?this.flushSample(e):e.sampleTimer||(e.sampleTimer=this.setTimer(()=>{e.sampleTimer=null,this.flushSample(e)},this.sampleIntervalMs-t)),e.idleTimer&&this.clearTimer(e.idleTimer),e.idleTimer=this.setTimer(()=>{e.idleTimer=null,this.flushSample(e)},this.sampleIdleDelayMs)}flushSample(e){if(!e.pointer)return;let t={...e.pointer};e.lastSampleTimestamp=this.now(),e.hasSampleTimestamp=!0,b4(e.sample,t)||(e.sample=t,this.notifySample(e,t))}notifyPointer(e,t){for(let r of Array.from(e.pointerListeners))r(t)}notifySample(e,t){for(let r of Array.from(e.sampleListeners))r(t)}clearEntryTimers(e){null!==e.pointerFrame&&(this.cancelFrame(e.pointerFrame),e.pointerFrame=null),e.sampleTimer&&(this.clearTimer(e.sampleTimer),e.sampleTimer=null),e.idleTimer&&(this.clearTimer(e.idleTimer),e.idleTimer=null)}cleanupEntryIfEmpty(e,t){t.pointerListeners.size>0||t.sampleListeners.size>0||t.pointer||t.sample||(this.clearEntryTimers(t),this.entries.delete(e))}}let b6=new b3,b8=null,b9=b5,b7="u"<typeof window?h:f,ve=e=>Number.isFinite(e.left)&&Number.isFinite(e.top)&&Number.isFinite(e.right)&&Number.isFinite(e.bottom)&&Number.isFinite(e.width)&&Number.isFinite(e.height)&&e.width>0&&e.height>0&&e.right>e.left&&e.bottom>e.top,vt=(e,t,r)=>e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom,vr=({children:e,interactionId:t,margin:n=8,className:a})=>{let o=g(null),l=gi("cursor-follow"),s=m(()=>i.toArray(e),[e]),c=s.length>0,d=u(()=>{o.current&&(o.current.style.visibility="hidden",o.current.style.transform="translate3d(-100vw, -100vh, 0)")},[]),h=g(null),p=u((e=h.current)=>{if(!e||!o.current||!c)return void d();h.current=e;let t=o.current,{clientX:r,clientY:a,bounds:i}=e;if(!Number.isFinite(r)||!Number.isFinite(a)||!ve(i))return void d();let{width:l,height:s}=t.getBoundingClientRect(),u=window.innerWidth,p=window.innerHeight;if(r<0||a<0||r>u||a>p||!vt(r,a,i))return void d();let f=i.left+n,m=i.top+n,g=i.right-n,b=i.bottom-n,v=Math.max(n,u-l-n),y=Math.max(n,p-s-n),w=Math.max(f,g-l),x=Math.max(m,b-s),k=Math.max(0,i.width-2*n),S=Math.max(0,i.height-2*n),M=a+n,F=r+n;F+l>g&&(F=r-l-n),M+s>b&&(M=a-s-n),F=l<=k?Math.min(Math.max(F,f),w):Math.min(Math.max(F,n),v),M=s<=S?Math.min(Math.max(M,m),x):Math.min(Math.max(M,n),y),t.style.visibility="visible",t.style.transform=`translate3d(${F}px, ${M}px, 0)`},[c,d,n]);return(b7(()=>c&&t?b6.subscribePointer(t,e=>{if(!e){h.current=null,d();return}p(e)}):void d(),[c,d,t,p]),b7(()=>{if(l)return l.setAttribute("data-rfkit-cursor-layer","true"),()=>{l.removeAttribute("data-rfkit-cursor-layer")}},[l]),b7(()=>{c?p():d()}),b7(()=>{if(!o.current||!c)return;let e=()=>{p()},t=new ResizeObserver(()=>{p()});return t.observe(o.current),window.addEventListener("resize",e),()=>{t.disconnect(),window.removeEventListener("resize",e)}},[c,p]),c&&l)?/*#__PURE__*/R(/*#__PURE__*/r("div",{ref:o,className:iX("pointer-events-none fixed left-0 top-0 z-10 will-change-transform",a),style:{transform:"translate3d(-100vw, -100vh, 0)",visibility:"hidden"},children:s}),l):null},vn=vr,va=({children:e,id:t})=>/*#__PURE__*/r(vr,{interactionId:t,margin:tV.POPOVER_MARGIN,children:e}),vi=va,vo=({id:e,children:t})=>{let[r,n]=b(null);return(h(()=>{let t;if(e&&((t=document.getElementById(e))&&n(t),!document.getElementById(e))){let t=new MutationObserver(()=>{let r=document.getElementById(e);r&&(n(r),t.disconnect())});return t.observe(document.body,{childList:!0,subtree:!0}),()=>t.disconnect()}},[e]),r)?/*#__PURE__*/T.createPortal(t,r):null},vl=vo,vs=e=>"string"==typeof e||"number"==typeof e?String(e).trim()||void 0:Array.isArray(e)?e.map(e=>vs(e)).filter(Boolean).join(" ").trim()||void 0:/*#__PURE__*/a.isValidElement(e)?vs(e.props.children):void 0,vc=({style:e,className:t,title:n,active:a=!1,disabled:i=!1,onClick:o,onDoubleClick:l,onWheel:s,children:c})=>{let u=vs(n),d=o&&(e=>{if(i){e.preventDefault(),e.stopPropagation();return}o(e)}),h=l&&(e=>{if(i){e.preventDefault(),e.stopPropagation();return}l(e)}),p=s&&(e=>{i?e.preventDefault():s(e)}),f=o||l?/*#__PURE__*/r("button",{type:"button",style:e,"aria-label":u,"aria-pressed":a||void 0,"aria-disabled":i||void 0,"data-active":a?"true":void 0,tabIndex:i?-1:void 0,onClick:d,onDoubleClick:h,onWheel:p,className:t,children:c}):s?/*#__PURE__*/r("div",{style:e,"aria-disabled":i||void 0,"data-active":a?"true":void 0,onWheel:p,className:t,children:c}):/*#__PURE__*/r("span",{style:e,"aria-disabled":i||void 0,"data-active":a?"true":void 0,className:t,children:c});return n?/*#__PURE__*/r(bV,{content:n,children:f}):f},vu=vc,vd=({style:e,className:t,title:n,children:a,active:i=!1,tone:o="default",disabled:l=!1,onClick:s,onDoubleClick:c})=>{let u=oV[o];return /*#__PURE__*/r(vc,{style:e,className:iX(oZ,!!(s||c)&&oU,l&&oX,i&&u,t),title:n,active:i,disabled:l,onClick:s,onDoubleClick:c,children:a})},vh=vd,vp=({style:e,className:t,contentClassName:n,title:a,active:i=!1,tone:o="default",disabled:l=!1,onClick:s,onDoubleClick:c,onWheel:u,children:d})=>{let h=oV[o],p=iX(o3,!!(s||c||u)&&oU,l&&oX,i&&h,t),f=/*#__PURE__*/r("div",{className:iX("inline-flex h-[14px] min-w-0 items-center justify-center text-xs leading-none",n),children:d});return /*#__PURE__*/r(vc,{style:e,className:p,title:a,active:i,disabled:l,onClick:s,onDoubleClick:c,onWheel:u,children:f})},vf=vp,vm=({children:e,className:t,opticalOffsetX:n=0,opticalOffsetY:a=0,opticalScale:i=1})=>{let o=[];return(0!==n||0!==a)&&o.push(`translate(${n}px, ${a}px)`),1!==i&&o.push(`scale(${i})`),/*#__PURE__*/r("span",{className:iX("inline-flex size-4 shrink-0 items-center justify-center [&_svg]:size-full [&_svg]:shrink-0",t),style:o.length>0?{transform:o.join(" ")}:void 0,children:e})},vg=vm;var vb=Object.defineProperty,vv=(e,t)=>vb(e,"name",{value:t,configurable:!0}),vy="horizontal",vw=["horizontal","vertical"],vx=/* @__PURE__ */$.forwardRef(/* @__PURE__ */vv(function(e,t){let{decorative:n,orientation:a=vy,...i}=e,o=vk(a)?a:vy;return /* @__PURE__ */r(l2.div,{"data-orientation":o,...n?{role:"none"}:{"aria-orientation":"vertical"===o?o:void 0,role:"separator"},...i,ref:t})},"Separator"));function vk(e){return vw.includes(e)}vv(vk,"isValidOrientation");var vS=vx;function vM({className:e,orientation:t="horizontal",decorative:n=!0,...a}){return /*#__PURE__*/r(vS,{"data-slot":"separator",decorative:n,orientation:t,className:iX("shrink-0 bg-border/70","horizontal"===t?"h-px w-full":"h-full w-px",e),...a})}let vF=({children:e,className:t,...n})=>/*#__PURE__*/r("div",{className:iX(oJ,"[&>*]:h-full [&>*]:shrink-0",t),...n,children:e}),vC=({className:e})=>/*#__PURE__*/r(vM,{className:iX(oG,e),orientation:"vertical"}),vD=-27,vz=e=>/*#__PURE__*/r(bZ,{...e,triggerVariant:"default",contentClassName:iX(lr,e.contentClassName)}),vN=({icon:e,title:t,triggerClassName:n,...a})=>{let i=/*#__PURE__*/r("span",{className:"inline-flex h-full min-w-4 shrink-0 items-center justify-center text-primary",children:/*#__PURE__*/r(vm,{children:e})});return /*#__PURE__*/r(bZ,{...a,triggerVariant:"default",triggerTitle:t,contentClassName:iX(lr,a.contentClassName),triggerClassName:iX("min-w-0 justify-center gap-0.5 px-1",n),triggerContent:i})},vE=({leading:e,triggerClassName:t,contentAlignOffset:a=vD,...i})=>/*#__PURE__*/n(vF,{children:[e,/*#__PURE__*/r(bZ,{...i,triggerVariant:"plain",contentClassName:iX(lr,i.contentClassName),contentAlignOffset:a,triggerClassName:iX("inline-flex h-full items-center px-[calc(var(--size-gap-base)/2)] text-primary hover:bg-accent/72 data-[state=open]:bg-accent/72 data-[state=open]:hover:bg-accent/72",t)})]}),vT=({className:e,...t})=>/*#__PURE__*/r(vd,{...t,className:iX("h-full rounded-none border-0 bg-transparent shadow-none",e)}),vR=vT,vA=(e,t,r)=>tF(`handleColor-${e}`,t,r,e),vI=t0(),vP=vI.gradient,vL=vP.index,vO=[...vP.item],vq=()=>{let{state:{axisY:{range:e},globalID:t}}=ae(),[a,i]=e??[0,0],[o,l]=b(vL),s=m(()=>[...vO[o]].reverse().map(E),[o]),c=u(()=>{let e=(o+1)%vO.length;l(e);let r=[...vO[e]].reverse().map(E);t&&vA(t)(r)},[o,t]);h(()=>{if(t)return vA(t,"setGradientColors",e=>{let t=vO.findIndex(t=>JSON.stringify([...t].reverse().map(E))===JSON.stringify(e));-1!==t&&l(t)})},[t]);let d=m(()=>s.map((e,t,n)=>{if(t===n.length-1)return null;let a=n[t+1];return /*#__PURE__*/r("span",{className:"flex-1",style:{background:`linear-gradient(to right, rgba(${e.r},${e.g},${e.b},${e.a}), rgba(${a.r},${a.g},${a.b},${a.a}))`}},`${e.r}-${e.g}-${e.b}-${e.a}-${a.r}-${a.g}-${a.b}-${a.a}`)}),[s]);return /*#__PURE__*/r(vp,{onClick:c,title:"点击切换瀑布图色阶",contentClassName:"w-[60px] justify-stretch",children:/*#__PURE__*/n("div",{className:"relative flex h-full w-full select-none",children:[/*#__PURE__*/n("div",{className:"absolute inset-0 flex h-full w-full justify-between text-[9px] text-white",children:[/*#__PURE__*/r("div",{className:"flex w-full items-center justify-center",children:Math.round(a)}),/*#__PURE__*/r("div",{className:"flex w-full items-center justify-center",children:Math.round(i)})]}),d]})})},v$=/*#__PURE__*/a.memo(vq),v_=()=>/*#__PURE__*/r(vM,{className:oW,orientation:"vertical"}),vj=v_;class vH extends of{getInitialColors(){return[...t2()].reverse().map(e=>E(e))}subscribeToColor(e){this.trackCleanup(vA(this.state.globalID,e,e=>{this.state.chart?.updateProps?.({colors:e})}))}updateParams(e){super.updateParams(e)}}let vB={iqEye:{Engine:D},iqLine:{Engine:C},iqPlanisphere:{Engine:C,lineColor:"#ffffff00"},iqStream:{Engine:C}};class vW extends of{constructor(e){super({id:e.id,chart:null,type:e.type})}init(){let{id:e,type:t}=this.state;if(!e)return;let r=vB[t],n=t0("iq");this.state.chart=new r.Engine({id:e,...n,...r.lineColor&&{lineColor:r.lineColor}}),this.scheduleResize()}updateSeries(e){this.state.chart?.render(e)}}class vG extends oq{constructor(e){super({id:e.id,chart:null,directionLabelMode:e.directionLabelMode??w.Cardinal})}init(){let{id:e,directionLabelMode:t}=this.state;e&&this.hasRenderableContainerSize()&&(this.state.chart=new y({id:e,directionLabelMode:t,...oo(document.getElementById(e))}),this.scheduleResize(),this.subscribeToTheme())}onParamsUpdated(e){void 0!==e.directionLabelMode&&this.state.chart?.updateProps({directionLabelMode:e.directionLabelMode})}}let vY=({directionLabelMode:e=w.Cardinal})=>{let{chart:t,Chart:n}=iV({Render:vG,params:{directionLabelMode:e}});return i3({moduleType:rr.Dial,chart:t}),/*#__PURE__*/r(oL,{children:/*#__PURE__*/r(n,{})})},vU=vY,vX=e=>{let{publish:t,directionLabelMode:n}=e,{state:{globalID:a}}=ae();return ac({publish:t,subscribe:e=>{((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Dial)(oI(e,{allowImplicitRender:!0,renderPSTypes:[rn.Dial]}))}}),/*#__PURE__*/r(am,{children:/*#__PURE__*/r(vY,{directionLabelMode:n})})},vK=vX,vV=e=>/*#__PURE__*/r(aa,{...e,system:{padding:!1,border:!1},children:/*#__PURE__*/r(vX,{...e})}),vQ=tB(vV,"Dial"),vZ=vQ,vJ=({children:e,padding:t,limit:a,step:i,setLimit:o,onChange:l})=>{let{state:{axisY:{range:s=ns}}}=ae(),[c,d]=s,h=g(null),[p,f]=b(!1),m=u(e=>{if(!h.current)return;let t=Math.round((d-c)*((h.current.offsetHeight-(e.clientY-h.current.getBoundingClientRect().top))/h.current.offsetHeight)+c);o(t=Math.max(c,Math.min(d,t)))},[c,d,o]),v=u(e=>{m(e),f(!0)},[m]),y=u(()=>{p&&l?.(a),f(!1)},[p,a,l]);return /*#__PURE__*/n("div",{className:"relative h-full w-full",children:[/*#__PURE__*/r("div",{ref:h,onMouseDown:v,onMouseUp:y,onMouseLeave:y,onMouseMove:u(e=>{p&&m(e)},[p,m]),onWheel:u(e=>{let t=a+(e.deltaY>0?-i:i);o(t=Math.max(c,Math.min(d,t))),l?.(t)},[i,a,c,d,o,l]),style:{top:`${t}px`,height:`calc(100% - ${2*t}px)`},className:"absolute left-0 z-[5] w-full"}),e]})},v0=/*#__PURE__*/a.memo(vJ);class v1 extends of{constructor(e){super({id:e.id,chart:null,props:e})}init(){let{id:e,props:t}=this.state;e&&(this.state.chart=new S({...oo(document.getElementById(e)),...t}),this.scheduleResize(),this.trackCleanup(oh(()=>{let e=this.getContainerElement();if(!e)return;let t=oo(e);this.state.chart?.updateProps(t),this.resize()})))}updateProps(e){this.state.chart?.updateProps(e)}updateSeries(e){this.state.chart?.render(e)}}let v2=20,v5=2,v4=({onChange:e})=>{let{state:{globalID:t,axisY:{range:n}}}=ae(),{chart:a,Chart:i}=iV({Render:v1,params:{padding:20,step:2,range:n}});i3({moduleType:rr.Gauge,chart:a,renderPSTypes:[rn.Gauge],handleRender:(e,t)=>{t.updateSeries?.(e)}});let[o,l]=b(0);return h(()=>{((e,t,r="0")=>tI(e,t,void 0,r))(t,rr.Gauge)({pstype:rn.Gauge,limit:o})},[o,t]),h(()=>{n&&a?.updateProps({range:n})},[n]),/*#__PURE__*/r(v0,{padding:20,limit:o,step:2,setLimit:e=>l(e),onChange:e,children:/*#__PURE__*/r(i,{})})},v3=v4,v6=e=>{let{publish:t,onChange:n}=e,{state:{globalID:a}}=ae();return ac({publish:t,subscribe:e=>{((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Gauge)(e)}}),/*#__PURE__*/r(am,{children:/*#__PURE__*/r(v4,{onChange:n})})},v8=v6,v9=e=>/*#__PURE__*/r(aa,{...e,system:{padding:!1,border:!1},children:/*#__PURE__*/r(v6,{...e})}),v7=tB(v9,"Gauge"),ye=v7,yt=40,yr=({padding:e,placement:t,show:r})=>{let n="inside"===t,a=40*(!1!==r),i=n?0:a;return{axisYWidth:`${a+e/2}px`,inside:n,marginLeft:`${0-e/2}px`,pluginBoxWidth:0===i?"100%":`calc(100% - ${i}px)`,width:`${i}px`}};function yn(){let e=at(e=>e.system.padding);return yr({padding:e,placement:at(e=>e.axisY.placement),show:at(e=>e.axisY.show)})}let ya=(e,t)=>({...e,interval:{start:0,end:Math.max(t-1,0)},isScanSegmentsUpdateMagnify:!1}),yi=/*#__PURE__*/s(({children:e,className:t,style:n},a)=>{let{state:{zoom:{style:i}}}=ae();return /*#__PURE__*/r("div",{ref:a,className:iX("pointer-events-none absolute right-0 top-0 z-[1] h-full w-full select-none overflow-hidden bg-transparent",t),style:n,children:/*#__PURE__*/r("div",{className:"absolute right-0 top-0 flex h-full w-full self-center",style:i??void 0,children:e})})}),yo=yi,yl=({length:e=10,tickColor:t="var(--chart-grid-strong)",tickHeight:a=8,strokeWidth:i=1,orientation:o="horizontal",split:l=2})=>{let s=u(n=>{let s=100/e*n,c="horizontal"===o&&n%l==0||"vertical"===o&&n%l!=0?1.68*a:a;return("horizontal"===o&&(c/=.5),s)?"horizontal"===o?/*#__PURE__*/r("line",{x1:s,y1:"0",x2:s,y2:c,stroke:t,strokeWidth:i,vectorEffect:"non-scaling-stroke"},`tick-${n}`):/*#__PURE__*/r("line",{x1:"100",y1:s,x2:100-c,y2:s,stroke:t,strokeWidth:i,vectorEffect:"non-scaling-stroke"},`tick-${n}`):null},[e,t,i,o]);return /*#__PURE__*/n("svg",{className:"absolute left-0 top-0 h-full w-full opacity-50",width:"100%",height:"100%",preserveAspectRatio:"none",viewBox:"0 0 100 100",children:["horizontal"===o?/*#__PURE__*/r("line",{x1:"0",y1:"0",x2:"100",y2:"0",stroke:t,strokeWidth:i,vectorEffect:"non-scaling-stroke"}):/*#__PURE__*/r("line",{x1:"100",y1:"0",x2:"100",y2:"100",stroke:t,strokeWidth:i,vectorEffect:"non-scaling-stroke"}),Array.from({length:e+1}).map((e,t)=>s(t))]})},ys=yl,yc="absolute right-0 top-0 flex h-full w-full items-center justify-between text-xs opacity-50",yu="relative h-6 w-full select-none overflow-hidden text-xs leading-6",yd=/*#__PURE__*/c(({value:e,unit:t,prefix:r=""})=>/*#__PURE__*/n("div",{className:"pl-[5px]",children:[r,e,t]})),yh=/*#__PURE__*/c(({value:e,index:t,total:n})=>/*#__PURE__*/r("div",{className:iX("absolute flex -translate-x-1/2 items-center justify-center text-center",0===t&&"left-0 translate-x-0",t===n&&"left-full -translate-x-full"),style:{left:`${t/n*100}%`},children:/*#__PURE__*/r("span",{children:e})}));function yp(e,t,r){let n=e[0],a=e.totalPoints??0;if(1!==e.length||!n||!Number.isInteger(a)||a<2||n.point!==a||0===n.bandwidth||!Number.isFinite(n.start)||!Number.isFinite(n.stop)||n.stop<=n.start||!Number.isFinite(t)||!Number.isFinite(r)||t<0||r<t||r>=a)return;let i=(n.stop-n.start)/(a-1),o=(r-t)*i/2,l=n.start+t*i;return{startMHz:l,centerMHz:l+o,endMHz:n.start+r*i,halfSpanKHz:1e3*o}}let yf=5,ym=(e,t)=>t?`${rm(e)}\xa0${t}`:rm(e),yg=({type:e,allowCenterBandwidth:t})=>{let{state:{segments:a,points:i,zoom:o,waterfallViewport:l,axisX:{frequencyFormat:s,labelMode:c,unit:d="",unitKHz:h=""}}}=ae(),p=e===rt.Heatmap?l.sourceSize.width:0,f=p||a.totalPoints||0,g=e===rt.Heatmap&&p>0?l.range.x[0]:o.interval.start,b=e===rt.Heatmap&&p>0?l.range.x[1]-1:o.interval.end,v=u(e=>{if(!f)return 0;let t=Math.min(100*e/f,100);return s?.(t)??""},[f,s]),y=t&&c===re.CenterBandwidth&&0===i.length,w=o.isScanSegmentsUpdateMagnify&&b===f?b-1:b,x=m(()=>{if(y){let e=yp(a,g,w);if(e){let t=ym(e.halfSpanKHz,h);return[{key:"band-start",value:`−${t}`},{key:"band-center",value:ym(e.centerMHz,d)},{key:"band-end",value:`+${t}`}]}}let e=(b-g+1)/5;return Array.from({length:6},(t,r)=>{let n=g+e*r;return{key:`tick-${n.toFixed(6)}`,value:v(n)}})},[w,v,b,g,a,y,d,h]);return /*#__PURE__*/n("div",{className:yc,children:[x.map((e,t)=>/*#__PURE__*/r(yh,{value:e.value,index:t,total:x.length-1},e.key)),/*#__PURE__*/r(yl,{length:10,split:2})]})},yb=yg,yv="@container flex h-full min-w-0 flex-1 items-center justify-center overflow-hidden",yy=48,yw=()=>{let{state:{segments:e,zoom:{interval:{start:t,end:a}}}}=ae(),i=g(null),[o,l]=b(0);f(()=>{let e=i.current;if(!e||(l(e.clientWidth),"u"<typeof ResizeObserver))return;let t=new ResizeObserver(()=>l(e.clientWidth));return t.observe(e),()=>t.disconnect()},[]);let s=e.totalPoints??0,c=m(()=>{if(!o||!s||e.length<=1)return 1;let r=Math.max(1,a-t+1),n=o/Math.max(1,Math.round(e.length*r/s));return n>=48?1:Math.ceil(48/n)},[o,s,e.length,t,a]),u=c>1;return /*#__PURE__*/n("div",{ref:i,className:yc,children:[m(()=>e.map((e,t)=>/*#__PURE__*/r("div",{className:iX("@container flex h-full min-w-0 flex-1 items-center justify-center overflow-hidden",u&&"overflow-visible",u&&0===t&&"justify-start"),children:/*#__PURE__*/r("span",{className:u?t%c==0?"block whitespace-nowrap":"hidden":"hidden max-w-full truncate @min-[48px]:block",children:e.label})},e.index)),[e,u,c]),/*#__PURE__*/r(yl,{length:2*e.length,split:2})]})},yx=yw,yk=({type:e})=>{let{state:{zoom:{interval:{start:t,end:a}},axisX:{labelMode:i=re.Auto,unit:o="",unitKHz:l=""},segments:s,points:c}}=ae(),u=s.totalPoints??0,d=Math.max(u-1,0),{start:h,bandwidth:p=0}=s[0]??{},f=m(()=>d&&p&&void 0!==h?rm(h+Math.max(0,Math.min(tX(t,a),d))*p/(1e3*d)):0,[t,a,h,d,p]),g=m(()=>u&&p?rm((a-t+1)*p/(2*u)):0,[t,a,u,p]),b=(i===re.Frequency||i===re.CenterBandwidth)&&(e===rt.SingleFrequency||e===rt.Lite||e===rt.DDC)&&0===c.length?yp(s,t,a):void 0,v=i===re.Frequency?b:void 0,y=b?rm(b.halfSpanKHz):g;return /*#__PURE__*/n("div",{className:yc,children:[/*#__PURE__*/r(yd,{value:v?rm(v.startMHz):y,unit:v?o:l,prefix:v?void 0:"-"}),/*#__PURE__*/r(yd,{value:b?rm(b.centerMHz):f,unit:o}),/*#__PURE__*/r(yd,{value:v?rm(v.endMHz):y,unit:v?o:l,prefix:v?void 0:"+"}),/*#__PURE__*/r(yl,{length:10,split:5})]})},yS=yk,yM=({type:e,allowScanCenterBandwidth:t=!0})=>{let{state:{axisX:{show:n}}}=ae();return n?/*#__PURE__*/r("div",{className:"relative h-6 w-full select-none overflow-hidden text-xs leading-6",children:e===rt.Scan||e===rt.ScanDF360||e===rt.Heatmap?/*#__PURE__*/r(yg,{type:e,allowCenterBandwidth:e===rt.Scan&&t}):e===rt.MScan?/*#__PURE__*/r(yi,{children:/*#__PURE__*/r(yw,{})}):/*#__PURE__*/r(yk,{type:e})}):null},yF=/*#__PURE__*/c(yM),yC=300,yD=20,yz=e=>{let{type:a}=e,{state:{axisX:i,zoom:o,segments:l},dispatch:s}=ae(),{children:c,unit:d,ticks:h}=i,{width:p,pluginBoxWidth:f}=yn(),b=g(null),v=m(()=>({marginLeft:p,width:f}),[p,f]),y=a!==rt.Heatmap,w=l.totalPoints??0,x=u(()=>{s({payload:{zoom:ya(o,w)}})},[s,o,w]),k=g({x:0,y:0,time:0}),S=u(e=>{let t=e.changedTouches[0];if(!t)return;let{clientX:r,clientY:n}=t,a=Date.now(),i=k.current;if(a-i.time<=300&&20>=Math.abs(r-i.x)&&20>=Math.abs(n-i.y)){k.current={x:0,y:0,time:0},x();return}k.current={x:r,y:n,time:a}},[x]);return i?/*#__PURE__*/r(bV,{content:`单位${d}`,children:/*#__PURE__*/n("div",{ref:b,className:"relative flex w-full flex-col box-border",style:v,onDoubleClick:y?x:void 0,onTouchEnd:y?S:void 0,children:[h&&/*#__PURE__*/n(t,{children:[/*#__PURE__*/r("div",{className:"absolute bottom-[-12px] right-0 z-[3] flex items-center justify-end text-[10px] opacity-50",children:d}),/*#__PURE__*/r(yF,{...e})]}),/*#__PURE__*/r("div",{children:c})]})}):null},yN=/*#__PURE__*/c(yz),yE=e=>{let{children:t,className:n,style:a}=e;return /*#__PURE__*/r("div",{className:iX("relative flex min-h-0 flex-1 box-border",n),style:a,children:t})},yT=yE;function yR(e,t=ns){let[r,n]=e??na["dBμV"],[a,i]=t,o=Math.max(a,r),l=Math.min(i,n);return o<l?[o,l]:[r,n]}let yA=({ranging:e})=>{let{state:{axisY:t,globalID:r,system:{height:n}}}=useStore(),{defaultRange:a=RANGE_DEFAULT,range:i=a,autoranging:o,step:l=stepDefault,restrict:s=restrictList.dBμV,unit:c}=t,u=useRef(null),[d,h]=s,p=h-d,[f,m]=i,g=p/l+1,b=m-f,v=useMemo(()=>Array.from({length:g},(e,t)=>{let r=(h-t*l).toFixed(0);return isNumberAlias(r)?/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("span",{children:r})},r):null}),[h,l,g]),y=useMemo(()=>{let e=u.current?.offsetHeight??0,t=(p+l)/b*e,r=l/(p+l)*t/2,n=(h-m)/b*e;return{height:`${t}px`,transform:`translateY(-${r+n}px)`}},[s,i,l,n,p,b,m,h]),[w,x]=useState(!1),[k,S]=useState(0),M=useCallback(e=>{x(!0),S(e.clientY)},[]),F=useCallback(()=>{x(!1)},[]),C=useCallback(t=>{if(!w||!u.current)return;let r=(t.clientY-k)/u.current.offsetHeight;Math.abs(r)>.01&&(e.move?.(r),S(t.clientY))},[w,k,e]),D=useCallback((t,r)=>{w||(t.stopPropagation(),e.moveBoundary?.(t.deltaY>0,r))},[w,e]);return /*#__PURE__*/_jsxs("div",{ref:u,className:"relative z-[2] h-full w-full box-border pr-0.5 text-xs text-foreground opacity-50",style:{cursor:w?"ns-resize":"auto",pointerEvents:o?"none":"auto"},onMouseDown:M,onMouseUp:F,onMouseLeave:F,onMouseMove:C,onDoubleClick:()=>{let{realRange:t}=range2realRange({range:a,unit:c,step:l,globalID:r}),n=getAxisYDoubleClickResetRange(s,t);e.setAxisY?.({realRange:n}),e.onChange?.()},children:[/*#__PURE__*/_jsx(Tooltip,{content:"滑动鼠标滚轮以改变边界范围",duration:1500,children:/*#__PURE__*/_jsx("div",{className:cn("absolute left-0 top-0 z-[3] max-h-20 min-h-[30%] w-full cursor-pointer opacity-0 transition-opacity hover:opacity-30"),style:{pointerEvents:w?"none":"auto",background:"linear-gradient(to bottom, var(--chart-highlight), transparent)"},onWheel:e=>D(e,!0)})}),/*#__PURE__*/_jsx(Tooltip,{content:"滑动鼠标滚轮以改变边界范围",duration:1500,children:/*#__PURE__*/_jsx("div",{className:cn("absolute bottom-0 left-0 z-[3] max-h-20 min-h-[30%] w-full cursor-pointer opacity-0 transition-opacity hover:opacity-30"),style:{pointerEvents:w?"none":"auto",background:"linear-gradient(to top, var(--chart-highlight), transparent)"},onWheel:e=>D(e,!1)})}),/*#__PURE__*/_jsxs("div",{className:"absolute z-[2] flex w-full flex-col justify-center box-border pr-2 [&>div]:flex [&>div]:flex-1 [&>div]:items-center [&>div]:justify-center [&>div]:overflow-hidden [&>div>span]:w-full [&>div>span]:text-right",style:y,title:`${o?"范围控制已全自动":"按住鼠标左键上下拖动\n在边界滚动鼠标滚轮以改变视觉范围"}
|
|
3728
|
+
双击回到默认范围${a}`,children:[v,/*#__PURE__*/_jsx(RulerTicks,{orientation:"vertical",length:2*g,split:2})]})]})},yI=null,yP=()=>{let{state:{axisY:e,globalID:t},dispatch:n}=ae(),{autoranging:a,onChange:i}=e,o=u(()=>{let t=!a;i?.({autoranging:t}),n({payload:{axisY:{...e,autoranging:t}}})},[e,a,i,n]);return /*#__PURE__*/r(vd,{active:a,tone:"primary",title:"自动范围",onClick:()=>{nj(t)()},onDoubleClick:()=>{o()},children:/*#__PURE__*/r("span",{children:"A"})})},yL=/*#__PURE__*/a.memo(yP),yO=()=>{let{state:{axisY:e,globalID:t},dispatch:r}=useStore(),{step:n,onChange:a}=e,i=useCallback(()=>{let t=nextItem(n,stepList);a?.({step:t}),r({payload:{axisY:{...e,step:t}}})},[n,e,a,r]);return useEffect(()=>{t&&subscriptionKeyBus(t,"step",e=>{e?.code==="KeyS"&&i()})},[i,t]),/*#__PURE__*/_jsxs(IconBox,{onClick:i,title:"步进",children:[n,"/div"]})},yq=/*#__PURE__*/null,y$=(e,t)=>{if(void 0===e||void 0===t||0===t.length)return e;let r=e,n=t.indexOf(r);return -1===n||n===t.length-1?[r]=t:r=t[n+1],r},y_=(e,t)=>e?t?e:e.filter(e=>!e.includes("/m")):[];function yj(e,t,r){let n=t.indexOf(e);if(-1===n)return null;let a=n>0?t[n-1]:t.at(0),i=n<t.length-1?t[n+1]:t.at(-1);return r<0?a:i}let yH=()=>{let e=at(e=>e.axisY),t=at(e=>e.globalID),n=an(),{unit:a,unitList:i,unitDisabled:o,autoranging:l,fieldStrengthUnitAvailable:s,onChange:c}=e,d=l||o,p=u(()=>{if(d)return;let t=y$(a,y_(i,s));t!==a&&(c?.({unit:t}),n({payload:{axisY:{...e,unit:t}}}))},[e,a,d,i,s,c,n]);return h(()=>{t&&nP(t,"unit",e=>{e?.code==="KeyU"&&p()})},[p,t]),/*#__PURE__*/r(vd,{onClick:p,title:"单位",disabled:d,children:a})},yB=/*#__PURE__*/a.memo(yH),yW=e=>{let{chart:t}=e,{state:{axisY:r}}=useStore(),{show:n}=r,a=useRanging({chart:t}),{axisYWidth:i,marginLeft:o}=useAxisYWidth();return!1===n?null:/*#__PURE__*/_jsx("div",{className:"relative flex h-full justify-end",style:{width:i,marginLeft:o},children:/*#__PURE__*/_jsx(TicksPanel,{ranging:a})})},yG=null,yY={UPDATED:"series:updated",ADDED:"series:added",REMOVED:"series:removed",MODE_CHANGED:"series:mode-changed",TYPE_OVERRIDE_CHANGED:"series:type-override-changed",BATCH_UPDATED:"series:batch-updated",RESET:"series:reset"};class yU{listeners=new Map;on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set);let r=this.listeners.get(e);if(!r)throw Error(`Failed to get event listeners for ${e}`);return r.add(t),()=>{r.delete(t),0===r.size&&this.listeners.delete(e)}}emit(e,t){let r=this.listeners.get(e);r&&r.forEach(r=>{try{r(t)}catch(t){console.error(`Error in event listener for ${e}:`,t)}})}removeAllListeners(e){e?this.listeners.delete(e):this.listeners.clear()}getListenerCount(e){return this.listeners.get(e)?.size||0}}let yX=new yU,yK={on:yX.on.bind(yX),emit:yX.emit.bind(yX),removeAllListeners:yX.removeAllListeners.bind(yX),getListenerCount:yX.getListenerCount.bind(yX)};function yV(e,t,r){return yK.on(t,t=>{t.globalID===e&&r(t)})}function yQ(e,t){yK.emit(e,t)}var yZ=/*#__PURE__*/function(e){return e.Line="line",e.StepLine="stepline",e.Bar="bar",e.Area="area",e}({});let yJ={line:{name:"line",label:"线图",icon:"line",realData:M.Line,minData:M.Line,maxData:M.Line,avgData:M.Line},stepline:{name:"stepline",label:"阶梯线图",icon:"stepline",realData:M.Stepline,minData:M.Stepline,maxData:M.Stepline,avgData:M.Stepline},bar:{name:"bar",label:"柱状图",icon:"bar",realData:M.Bar,minData:M.Line,maxData:M.Line,avgData:M.Line},area:{name:"area",label:"面积图",icon:"area",realData:M.Area,minData:M.Stepline,maxData:M.Stepline,avgData:M.Stepline}},y0=new Map;function y1(e){return y0.get(e)||"line"}function y2(e){let t=Object.values(yZ),r=(t.indexOf(e)+1)%t.length;return t[r]}function y5(e,t){y0.set(e,t);let r=yJ[t];yQ(yY.MODE_CHANGED,{globalID:e,mode:t,config:r})}function y4(e,t){let r=y2(t||y1(e));y5(e,r)}function y3(e){y0.delete(e)}function y6(e){let{globalID:t}=e.state;if(!t)return console.warn("[Series] globalID is required for series subscription"),null;let r=[];return r.push(yV(t,yY.UPDATED,r=>{let n=wt(t,r.seriesName),a={...r.config,type:n};e.setSeries(a,!0),e.state.chart?.draw()})),r.push(yV(t,yY.MODE_CHANGED,()=>{e.initSeries()})),r.push(yV(t,yY.TYPE_OVERRIDE_CHANGED,()=>{e.initSeries()})),r.push(yV(t,yY.BATCH_UPDATED,r=>{r.configs.forEach(r=>{let n=wt(t,r.name),a={...r,type:n};e.setSeries(a,!0)}),e.state.chart?.draw()})),r.push(yV(t,yY.RESET,()=>{e.state.series&&(e.state.series={}),e.initSeries()})),()=>{for(let e of r)e()}}let y8=new Map;function y9(e,t,r){y8.has(e)||y8.set(e,new Map),y8.get(e)?.set(t,r),yQ(yY.TYPE_OVERRIDE_CHANGED,{globalID:e,seriesName:t,type:r})}function y7(e){let t=y8.has(e);y8.delete(e),t&&yQ(yY.TYPE_OVERRIDE_CHANGED,{globalID:e})}function we(e,t){return y8.get(e)?.get(t)}function wt(e,t){let r=y8.get(e)?.get(t);if(r)return r;if("templateData"===t)return M.Area;let n=yJ[y1(e)][t];return n&&"string"==typeof n?n:M.Line}let wr=new Map;function wn(){return Object.values(t0("line")).map(e=>({name:e.name,label:e.label,color:e.color,thickness:e.thickness,display:e.display,type:M.Line}))}function wa(e){return{name:e.name,label:e.label,color:e.color,display:e.display,type:e.type,thickness:e.thickness}}function wi(e){if(!e)throw Error("globalID 不能为空");if(!wr.has(e)){let t=new L([]);wn().forEach(e=>{t.addSeries(wa(e))}),wr.set(e,t),n6(e)?.registerCleanup(()=>{wo(e)})}let t=wr.get(e);if(!t)throw Error(`SeriesManager for globalID "${e}" not found`);return t}function wo(e){let t=wr.get(e);t&&(t.clear(),wr.delete(e)),y3(e),y8.delete(e)}function wl(e){return wr.has(e)}function ws(e){let t=wi(e).getAllSeries(),r=new Map;return Array.isArray(t)&&t.forEach(e=>{r.set(e.name,{name:e.name,label:e.label||"",color:e.color,display:void 0===e.display||e.display,type:e.type||M.Line,thickness:e.thickness||1})}),r}function wc(e,t){let r=t0("line")[e.name],n={label:r?.label??"",color:r?.color,display:r?.display??!0,type:M.Line,thickness:r?.thickness??1};return{name:e.name,label:e.label??t?.label??n.label,color:e.color??t?.color??n.color??(()=>{throw Error(`Series "${e.name}" does not exist and must have a color defined`)})(),display:e.display??t?.display??n.display,type:e.type??t?.type??n.type,thickness:e.thickness??t?.thickness??n.thickness}}function wu(e,t,r){r?(e.setSeriesProperty(t.name,"label",t.label),e.setSeriesProperty(t.name,"color",t.color),e.setSeriesProperty(t.name,"thickness",t.thickness),e.setSeriesProperty(t.name,"display",t.display),e.setSeriesProperty(t.name,"type",t.type)):e.addSeries(wa(t))}function wd(e,t){if(!t?.name)return;let r=wi(e),n=r.getSeries(t.name),a=wc(t,n);wu(r,a,n),yQ(yY.UPDATED,{globalID:e,seriesName:t.name,config:{name:a.name,label:a.label,color:a.color,thickness:a.thickness,display:a.display,type:a.type}})}function wh(e){let t=wi(e);t.clear(),wn().forEach(e=>{t.addSeries(wa(e))}),yQ(yY.RESET,{globalID:e})}function wp(e,t){let r=wi(e),n=[];t.forEach(e=>{if(!e?.name)return;let t=r.getSeries(e.name),a=wc(e,t);wu(r,a,t),n.push({name:a.name,label:a.label,color:a.color,thickness:a.thickness,display:a.display,type:a.type})}),n.length>0&&yQ(yY.BATCH_UPDATED,{globalID:e,configs:n})}function wf(e){let t=ws(e),r=new Map;return t.forEach(t=>{let n={...t,type:wt(e,t.name)};r.set(t.name,n)}),r}let wm="singleFrequency",wg=new Set([wm,"scan","mscan"]),wb=({heatmapElementID:e,type:t})=>!!e&&wg.has(t??wm),wv=(e,t)=>{let[r,n]=t,a=e.range??ns,i=e.realRange??ns,o=e.renderRange??ns,l=a[0]!==r||a[1]!==n,s=i[0]!==r||i[1]!==n,c=o[0]!==r||o[1]!==n;return l||s||c?{...e,range:t,realRange:t,renderRange:t}:e};function wy({type:e,heatmapElementID:t}){let{state:{axisY:r,limit:n,signal:a,marker:i,cursor:o,frequencyAllocation:l,zoom:s,globalID:c},dispatch:u}=ae();return h(()=>{c&&(y7(c),e===rt.MScan&&y9(c,t3,M.Bar),e===rt.ScanDF360&&(y9(c,t3,M.Rect),t$(c)(!0)))},[e,c]),h(()=>{let t=r,c=n,d=a,h=i,p=o,f=l,m=s;if(e===rt.DDC&&(!1!==c.show&&(c={...c,show:!1}),!0!==h.visible&&(h={...h,visible:!0})),e===rt.Lite&&(!1!==c.show&&(c={...c,show:!1}),!1!==h.enabled&&(h={...h,enabled:!1})),e===rt.LiteNormalized){let e=t.restrict??[0,1];!1!==c.show&&(c={...c,show:!1}),!1!==d.show&&(d={...d,show:!1}),(0!==e[0]||1!==e[1])&&(t={...t,restrict:[0,1]}),!1!==f.show&&(f={...f,show:!1})}if(e===rt.MScan&&(!1!==h.enabled&&(h={...h,enabled:!1}),!1!==f.show&&(f={...f,show:!1})),e===rt.ScanDF360){let e=t.restrict??[0,360];!1!==c.show&&(c={...c,show:!1}),!1!==d.show&&(d={...d,show:!1}),!1!==h.enabled&&(h={...h,enabled:!1}),!1!==m.show&&(m={...m,show:!1}),!1!==p.show&&(p={...p,show:!1}),!1!==f.show&&(f={...f,show:!1}),t="°"!==t.unit||36!==t.step||0!==e[0]||360!==e[1]?{...wv(t,[0,360]),unit:"°",restrict:[0,360],step:36}:wv(t,[0,360])}let g={};c!==n&&(g.limit=c),d!==a&&(g.signal=d),h!==i&&(g.marker=h),p!==o&&(g.cursor=p),f!==l&&(g.frequencyAllocation=f),m!==s&&(g.zoom=m),t!==r&&(g.axisY=t),Object.keys(g).length>0&&u({payload:g})},[r,o,u,l,n,i,a,e,s]),h(()=>{if(e===rt.LiteNormalized&&c){let e=r.range??ns;if(e[0]<0||e[1]>1){let e=wv(r,[0,1]);u({payload:{axisY:e}}),nW(c)(e.range??[0,1])}}},[r,u,c,e]),m(()=>{let r=!1,n=wb({heatmapElementID:t,type:e});return(e===rt.SingleFrequency||e===rt.Scan||e===rt.MScan)&&(r=!0),{enableMetrics:r,enableWaterfall:n}},[e,t])}function ww(){let{state:{marker:e,globalID:t},dispatch:r}=ae();return h(()=>{e?.mode===nt.DDC&&r({payload:{marker:{...e,enabled:!0,visible:!0}}})},[e?.mode]),u(()=>{},[t])}function wx(){let e=an();return u(t=>{if(t?.length){let r=rx(t);e({payload:e=>({points:t,axisX:{...e.axisX,frequencyFormat:e=>String(r(e)??"")}})})}},[e])}function wk(){let e=at(e=>e.segments),t=an();return[e,u(e=>{if(e.totalPoints){let r=e.totalPoints-1;t({payload:t=>({segments:e,zoom:{...t.zoom,interval:{start:0,end:r}},axisX:0===t.points.length?{...t.axisX,frequencyFormat:ry(e)}:t.axisX})})}},[t])]}let wS=(e,t)=>tF(`SET_SEGMENTS_DISPLAY-${e}`,"0",t,e);function wM(e){let t=at(e=>e.globalID),r=an(),[,n]=wk(),a=u(e=>{let{event:t=ri.Cover,index:a}=e;r({payload:e=>{let{segments:r,zoom:n}=e,{totalPoints:i}=r,o=0,l=0,s=!1;if(t===ri.Focus&&i)if("number"==typeof a&&a<r.length){for(let e=0;e<a;e+=1)o+=r[e].point+1;let{point:e}=r[a];l=o+e,s=!0}else void 0===a&&(o=0,l=i-1,s=!1);return n.interval.start===o&&n.interval.end===l&&n.isScanSegmentsUpdateMagnify===s?null:{zoom:{...n,interval:{start:o,end:l},isScanSegmentsUpdateMagnify:s}}}}),t===ri.Cover&&e.data&&n(rF(e.data))},[r,n]);h(()=>{if(t)return wS(t,e=>{a?.({pstype:rn.Segments,event:ri.Focus,index:e})})},[t,a]);let i=g(3),o=g({frequency:0,bandwidth:0}),l=u((e,t=o.current)=>{if(t.bandwidth&&t.frequency&&e){let r=rS({frequency:t?.frequency,bandwidth:t?.bandwidth,totalPoints:e});"function"==typeof n&&n(r)}},[n]),s=u(e=>{let{frequency:t,bandwidth:r}=e;if(!t||!r)return;let n=o.current;(n.frequency!==t||n.bandwidth!==r)&&(o.current={frequency:t,bandwidth:r},l(i.current,e))},[l]),c=u(t=>{if(!t)return;let r=t?.length;r&&r!==i.current&&(i.current=r,l(r),e===rt.LiteNormalized&&n(rM(r)))},[l,n,e]);return ww(),u(e=>{switch(e.pstype){case rn.Spectrum:e.data&&c(e.data);break;case rn.SpectrumBandwidth:s(e);break;case rn.Segments:a?.(e)}},[c,s,a])}function wF(e){let{dispatch:t}=ae(),r=g(!1);h(()=>{if(!e){r.current=!1;return}r.current||(r.current=!0,t({payload:e=>({limit:{...e.limit,show:!1},marker:{...e.marker,enabled:!1,visible:!1},frequencyAllocation:{...e.frequencyAllocation,show:!1},toolbar:{...e.toolbar,show:!1}})}))},[e,t])}let wC="AxisYHeatmapTicks",wD=e=>"string"==typeof e?e.slice(-8):"",wz=10,wN=e=>{let{id:t}=e,{state:{globalID:n}}=ae(),[a,i]=b(Array(10).fill("")),o=m(()=>{let e=[];for(let t=0;t<10;t++)e.push(`${100-t/9*100}%`);return e},[]);return h(()=>{t&&n&&tq(t,"AxisYHeatmapTicks",()=>{let e=tj(n)?.getSnapshot().data,t=e?void 0:t_(n)?.getWaterfallTimestamps(10),r=[];if(t?.length===10)for(let e of t)r.push(wD(e));else{let t=e??tO(n).getAllRawData().waterfallData??[],a=t.length;for(let e=0;e<10;e++){let n=Math.floor((a-1)*e/9);r.push(wD(t[n]?.timestamp))}}i(e=>e.length===r.length&&r.every((t,r)=>t===e[r])?e:r)})},[t,n]),/*#__PURE__*/r("div",{className:"relative z-[2] flex h-full w-full flex-col items-end justify-between pr-1 text-xs text-foreground opacity-50",children:o.map((e,t)=>/*#__PURE__*/r("div",{className:iX("absolute right-0 flex max-w-full origin-right scale-x-[0.85] items-center justify-end whitespace-nowrap text-right text-[9px] leading-none [font-variant-numeric:tabular-nums]",0===t&&"-translate-y-full",t===o.length-1&&"translate-y-0",t>0&&t<o.length-1&&"-translate-y-1/2"),style:{top:e},children:a[t]},`tick-${e}`))})},wE=/*#__PURE__*/a.memo(wN),wT=e=>{let{axisYWidth:t,marginLeft:n}=yn();return /*#__PURE__*/r("div",{className:"relative flex h-full w-auto justify-between overflow-hidden",style:{width:t,marginLeft:n},children:/*#__PURE__*/r(wE,{...e})})},wR=wT,wA=t2(),wI=()=>{let{state:{axisY:{range:e}}}=useStore(),[t,r]=e;return /*#__PURE__*/_jsxs("div",{className:"relative flex h-full w-4 select-none flex-col",children:[/*#__PURE__*/_jsxs("div",{className:"absolute top-0 flex h-full w-full flex-col justify-between",children:[/*#__PURE__*/_jsx("div",{className:"flex w-full items-center justify-center text-[9px] text-white",children:r.toFixed()}),/*#__PURE__*/_jsx("div",{className:"flex w-full items-center justify-center text-[9px] text-white",children:t.toFixed()})]}),wA.map((e,t)=>t===wA.length-1?null:/*#__PURE__*/_jsx("span",{className:"w-full flex-1",style:{background:`linear-gradient(to bottom,${e},${wA[t+1]})`}},e))]})},wP=null,wL=e=>{let{chart:t}=e,{state:{axisY:n}}=ae(),{linkage:a,renderRange:i,show:o}=n;return(h(()=>{a&&i&&t?.setRange?.(i)},[i]),!1===o)?null:/*#__PURE__*/r(wT,{...e})},wO=wL,wq=(e,t)=>openData(`CURSOR_TIMEOUT-${e}`,t,null,e),w$=(e,t)=>tF(`CURSOR_SETACTIVE-${e}`,"0",t,e);function w_({coord:e,zoom:t,segments:r}){let{left:n}=e,{start:a,end:i}=t.interval,{totalPoints:o}=r;return(Math.min(Math.round(Math.max(0,Math.min(100,n))/100*(o-1)),o-1)-a)*100/(i-a+1)}function wj({visualLeft:e,zoom:t,segments:r}){let{start:n,end:a}=t.interval,{totalPoints:i}=r,o=Math.round((a-n+1)*Math.max(0,Math.min(100,e))/100);return 100*Math.min(n+o,i-1)/(i-1)}let wH=e=>"function"==typeof e?.getBoundingClientRect,wB=e=>{let{clientX:t=0,clientY:r=0}=e,n=e.currentTarget??e.target,{left:a,top:i,width:o,height:l}=wH(n)?n.getBoundingClientRect():{height:0,left:0,top:0,width:0};return o<=0||l<=0?{left:0,top:0}:{left:(t-a)/o*100,top:(r-i)/l*100}};function wW(e){return`EVENTBUS-${e}`}function wG(e,t){let r=e;return t&&(r=wW(e)),r}let wY=(e,t,r)=>tF(`${wG(e,r)}-createMoveEventManager`,t,r,e),wU=(e,t,r)=>tF(`${wG(e,r)}-createMouseDownEventManager`,t,r,e),wX=(e,t,r)=>tC(`${wG(e,r)}-createDoubleClickEventManager`,w3,t,r,e),wK=(e,t,r)=>tF(`${wG(e,r)}-mouse-up`,t,r,e),wV=(e,t,r)=>tF(`${wG(e,r)}-mouse-leave`,t,r,e),wQ=(e,t,r)=>tF(`${wG(e,r)}-mouse-enter`,t,r,e),wZ=(e,t,r)=>tF(`${wG(e,r)}-wheel`,t,r,e),wJ=(e,t,r)=>tF(`${wG(e,r)}-drag`,t,r,e),w0=(e,t,r)=>createSubscriptionManager(`${wG(e,r)}-zoom`,t,r,e),w1=(e,t,r)=>tF(`${wG(e,r)}-long-press`,t,r,e),w2=e=>wB(e),w5="void",w4={[w5]:0,[rl.EventBus]:1,[rl.Signal]:1,[rl.Zoom]:2,[rl.DragFrame]:2,[rl.HeatmapCapture]:3,[rl.Markers]:3,[rl.Limit]:3,[rl.Stripe]:4,[rl.FrequencyTagLine]:5},w3=e=>w4[e]??0,w6={[rl.Markers]:"all-scroll",[rl.Stripe]:"col-resize",[rl.FrequencyTagLine]:"col-resize",[rl.Limit]:"n-resize",[rl.Frame]:"w-resize",[rl.Zoom]:"all-scroll",[rl.Area]:"crosshair"},w8=(e,t)=>tS(`event-level-${e}`,t,w5,e),w9=(e,t)=>tS(`event-type-${e}`,t,"",e);function w7(e,t,r){w9(e,r);let n=w4[w8(e)];return w4[t]>=n&&(w8(e,t),!0)}function xe(e){return w6[w8(e)]??"default"}function xt(e,t){let r=w8(e);t&&r===t&&w8(e,w5)}let xr="mt-1 flex items-center justify-between gap-1 text-xs text-popover-foreground",xn="inline-flex min-w-9 justify-end",xa=(e,t)=>{let[r,n]=b(0);return h(()=>{if(!t)return;let r=tq(t,`CursorPopover-${e}`,()=>{n(e=>e+1)});return()=>{"function"==typeof r&&r()}},[t,e]),r},xi=({frequency:e,unit:t})=>e?/*#__PURE__*/n("div",{className:"text-[14px] font-medium text-popover-foreground",children:[e,t]}):null,xo=e=>{let t=u(t=>e?b6.subscribeSample(e,()=>{t()}):()=>{},[e]),r=u(()=>e?b6.getSample(e):null,[e]);return v(t,r,r)};function xl(e,t={}){let{subscribeToMode:r=!0,subscribeToData:n=!0,watchSeries:a}=t,[i,o]=b(0),[l,s]=b(()=>e?y1(e):"line"),c=u(()=>{o(e=>e+1)},[]),d=m(()=>e?ws(e):new Map,[e,i]),p=u(t=>{e&&wd(e,t)},[e]),f=u(e=>d.get(e),[d]);return h(()=>{if(!e)return;let t=[];if(r){s(y1(e));let r=yV(e,yY.MODE_CHANGED,e=>{s(e.mode)});t.push(r)}if(n){let r=yV(e,yY.UPDATED,e=>{(!a||a.includes(e.seriesName))&&c()});t.push(r);let n=yV(e,yY.ADDED,e=>{(!a||a.includes(e.seriesName))&&c()});t.push(n);let i=yV(e,yY.REMOVED,e=>{(!a||a.includes(e.seriesName))&&c()});t.push(i);let o=yV(e,yY.BATCH_UPDATED,()=>{c()});t.push(o);let l=yV(e,yY.RESET,()=>{c()});t.push(l)}return()=>{for(let e of t)e()}},[e,r,n,a,c]),{series:d,mode:l,updateSeries:p,forceUpdate:c,getSeries:f}}function xs(e){return xl(e,{subscribeToMode:!0,subscribeToData:!0})}let xc=Object.values(t0("line")).map(e=>e.name);function xu(e){return[...xc.filter(t=>e.includes(t)),...e.filter(e=>!xc.includes(e))]}function xd(e,t){let{series:r}=xl(e),n=at(e=>e.series.legendExternal);return m(()=>{let e=Array.from(r.values()).filter(e=>!n.includes(e.name)&&e.name!==rc.TemplateData&&(!t||t(e))),a=new Map(xu(e.map(e=>e.name)).map((e,t)=>[e,t]));return e.sort((e,t)=>(a.get(e.name)??Number.MAX_SAFE_INTEGER)-(a.get(t.name)??Number.MAX_SAFE_INTEGER)).map((e,t)=>({...e,originalIndex:t}))},[r,n,t])}let xh=null,xp=(e,t,r)=>Math.min(r,Math.max(t,e)),xf=e=>xp(e,0,100),xm=e=>{let t=0,r=!1;for(let r of e)t=Math.max(t,r.length);if(0===t)return[];for(let n of e)if(n.length!==t){r=!0;break}return r?e.map(e=>{if(e.length===t)return e;let r=new Float32Array(t);return r.fill(0/0),r.set(e),r.timestamp=e.timestamp,r}):e},xg=(e,t)=>{if(t<=0)return -1;if(1===t)return 0;let r=xp(e,0,100);return xp(Math.ceil((100-r)*t/100)-1,0,t-1)},xb=(e,t)=>{if(t<=0)return -1;if(1===t)return 0;let r=xp(e,0,100);return xp(Math.ceil(r*t/100)-1,0,t-1)},xv=(e,t)=>{let{width:r}=t.sourceSize;if(r<=0)return 0;let[n,a]=t.range.x,i=n+(a-n)*xp(e,0,100)/100;return xp(100*i/r,0,100)},xy=(e,t)=>{let r=xg(t.top,e.rowIndices.length),n=xb(t.left,e.columnIndices.length);return r<0||n<0?null:{columnIndex:e.columnIndices[n],rowIndex:e.rowIndices[r],sourceLeft:xv(t.left,e),visibleColumnIndex:n,visibleRowIndex:r}},xw=(e,t)=>{let r=xy(e,{left:t.startLeft,top:t.startTop}),n=xy(e,{left:t.endLeft,top:t.endTop});return r&&n?{endCol:Math.max(r.columnIndex,n.columnIndex),endIndex:Math.max(r.rowIndex,n.rowIndex),startCol:Math.min(r.columnIndex,n.columnIndex),startIndex:Math.min(r.rowIndex,n.rowIndex)}:null},xx=(e,t)=>e.rawData.slice(t.startIndex,t.endIndex+1).map(e=>Array.from(e.slice(t.startCol,t.endCol+1))),xk=(e,t)=>xS(e,{x:[Math.min(t.startCol,t.endCol),Math.max(t.startCol,t.endCol)+1],y:[Math.min(t.startIndex,t.endIndex),Math.max(t.startIndex,t.endIndex)+1]}),xS=(e,t)=>{let[r,n]=e.range.x,[a,i]=e.range.y,o=n-r,l=i-a;if(o<=0||l<=0)return null;let s=Math.min(t.x[0],t.x[1]),c=Math.max(t.x[0],t.x[1]),u=Math.min(t.y[0],t.y[1]),d=Math.max(t.y[0],t.y[1]);return{leftPosition:(s-r)*100/o,width:(c-s)*100/o,position:100-(d-a)*100/l,height:(d-u)*100/l}},xM=1e-7,xF=(e,t)=>{let{sourceSize:r}=e,[n,a]=e.range.x,[i,o]=e.range.y,l=a-n,s=o-i;if(r.width<=0||r.height<=0||l<=0||s<=0)return null;let c=xp(n+Math.min(t.startLeft,t.endLeft)*l/100,0,r.width),u=xp(n+Math.max(t.startLeft,t.endLeft)*l/100,0,r.width),d=i+(100-t.startTop)*s/100,h=i+(100-t.endTop)*s/100;return{x:[c,u],y:[xp(Math.min(d,h),0,r.height),xp(Math.max(d,h),0,r.height)]}},xC=(e,t)=>{let r=xF(e,t);return r?xD(e,r):null},xD=(e,t)=>{let{sourceSize:r}=e;if(r.width<=0||r.height<=0)return null;let[n,a]=t.x,[i,o]=t.y,l=xp(Math.floor(n+1e-7),0,r.width-1),s=xp(Math.max(l,Math.ceil(a-1e-7)-1),l,r.width-1),c=xp(Math.floor(i+1e-7),0,r.height-1);return{endCol:s,endIndex:xp(Math.max(c,Math.ceil(o-1e-7)-1),c,r.height-1),startCol:l,startIndex:c}},xz=(e,t,r,n)=>{let a=xp(Math.round(e[0]+(e[1]-e[0])*n-r*n),0,t-r);return[a,a+r]},xN=(e,t,r)=>{let{sourceSize:n}=e,a=e.range.x[1]-e.range.x[0],i=e.range.y[1]-e.range.y[0],o=t>0?.5:2,l=Math.min(10,n.width),s=Math.min(2,n.height),c=xp(Math.round(a*o),l,n.width),u=xp(Math.round(i*o),s,n.height);return{x:xz(e.range.x,n.width,c,xp(r.left,0,100)/100),y:xz(e.range.y,n.height,u,(100-xp(r.top,0,100))/100)}},xE=(e,t,r)=>{let n=e[1]-e[0],a=xp(e[0]+r,0,t-n);return[a,a+n]},xT=(e,t,r)=>{let n=e[1]-e[0],a=xp(Math.round(r-n/2),0,t-n);return[a,a+n]},xR=(e,t)=>({x:xp(t.left,0,1)*e.sourceSize.width,y:(1-xp(t.top,0,1))*e.sourceSize.height}),xA=e=>{let{range:t,sourceSize:r}=e;return r.width<=0||r.height<=0?{height:0,left:0,top:0,width:0}:{left:t.x[0]/r.width,top:1-t.y[1]/r.height,width:(t.x[1]-t.x[0])/r.width,height:(t.y[1]-t.y[0])/r.height}},xI=e=>({x:[Math.min(e.startCol,e.endCol),Math.max(e.startCol,e.endCol)+1],y:[Math.min(e.startIndex,e.endIndex),Math.max(e.startIndex,e.endIndex)+1]}),xP=(e,t)=>{let{sourceSize:r}=e;if(r.width<=0||r.height<=0)return{height:0,left:0,top:0,width:0};let n=xp(Math.min(t.x[0],t.x[1]),0,r.width),a=xp(Math.max(t.x[0],t.x[1]),n,r.width),i=xp(Math.min(t.y[0],t.y[1]),0,r.height),o=xp(Math.max(t.y[0],t.y[1]),i,r.height);return{left:n/r.width,top:1-o/r.height,width:(a-n)/r.width,height:(o-i)/r.height}},xL=(e,t)=>xP(e,xI(t)),xO=(e,t)=>Math.min(t.x[0],t.x[1])<e.range.x[1]&&Math.max(t.x[0],t.x[1])>e.range.x[0]&&Math.min(t.y[0],t.y[1])<e.range.y[1]&&Math.max(t.y[0],t.y[1])>e.range.y[0],xq=(e,t)=>xO(e,xI(t)),x$=(e,t,r={x:0,y:0})=>t.x>=Math.min(e.x[0],e.x[1])-r.x&&t.x<=Math.max(e.x[0],e.x[1])+r.x&&t.y>=Math.min(e.y[0],e.y[1])-r.y&&t.y<=Math.max(e.y[0],e.y[1])+r.y,x_=(e,t,r={x:0,y:0})=>x$(xI(e),t,r),xj=e=>{let{range:t,sourceSize:r}=e;return r.width<=0||r.height<=0||0===t.x[0]&&t.x[1]===r.width&&0===t.y[0]&&t.y[1]===r.height},xH=(e,t)=>{let r=xR(e,t);return{x:xT(e.range.x,e.sourceSize.width,r.x),y:xT(e.range.y,e.sourceSize.height,r.y)}},xB=(e,t)=>({x:xT(e.range.x,e.sourceSize.width,(Math.min(t.x[0],t.x[1])+Math.max(t.x[0],t.x[1]))/2),y:xT(e.range.y,e.sourceSize.height,(Math.min(t.y[0],t.y[1])+Math.max(t.y[0],t.y[1]))/2)}),xW=(e,t)=>xB(e,xI(t)),xG=(e,t,r)=>{let n=xR(e,t),a=e.range.x[1]-e.range.x[0],i=e.range.y[1]-e.range.y[0],o=xp(Math.round(n.x-r.x),0,e.sourceSize.width-a),l=xp(Math.round(n.y-r.y),0,e.sourceSize.height-i);return{x:[o,o+a],y:[l,l+i]}},xY=(e,t)=>t.x>=e.range.x[0]&&t.x<=e.range.x[1]&&t.y>=e.range.y[0]&&t.y<=e.range.y[1],xU=(e,t)=>{let r=e.range.x[1]-e.range.x[0],n=e.range.y[1]-e.range.y[0];return{x:xE(e.range.x,e.sourceSize.width,-Math.round(t.left*r)),y:xE(e.range.y,e.sourceSize.height,Math.round(t.top*n))}},xX=(e,t,r)=>xU(e,{left:(r.left-t.left)/100,top:(r.top-t.top)/100}),xK=e=>({x:e.x,y:e.y,outputWidth:e.x[1]-e.x[0],outputHeight:e.y[1]-e.y[0]}),xV=(e,t)=>e.range.x[0]===t.x[0]&&e.range.x[1]===t.x[1]&&e.range.y[0]===t.y[0]&&e.range.y[1]===t.y[1],xQ=(e,t,r)=>{let[n,a]=e.range.y,i=a-n;if(i<=0||r<n||t>=a)return null;let o=xp(t,n,a-1),l=100-(xp(r,n,a-1)+1-n)*100/i;return{height:100-(o-n)*100/i-l,top:l}},xZ=e=>Math.max(0,Math.min(100,e)),xJ=(e,t)=>({end:Math.max(e,t),start:Math.min(e,t)}),x0=e=>e.reduce((e,t)=>Math.max(e,t?.length??0),0),x1=e=>({columnCount:x0(e),rowCount:e.length}),x2=(e,t)=>t<=0?-1:1===t?0:Math.max(0,Math.min(t-1,Math.ceil((100-xZ(e))*t/100)-1)),x5=(e,t)=>t<=0?-1:1===t?0:Math.max(0,Math.min(t-1,Math.ceil(xZ(e)*t/100)-1)),x4=(e,t,r)=>{let n=x2(e,r),a=x2(t,r);if(n<0||a<0)return null;let{end:i,start:o}=xJ(n,a);return{endIndex:i,startIndex:o}},x3=(e,t,r)=>{let n=x5(e,r),a=x5(t,r);if(n<0||a<0)return null;let{end:i,start:o}=xJ(n,a);return{endCol:i,startCol:o}},x6=(e,t)=>{let{columnCount:r,rowCount:n}=x1(e);if(0===n||0===r)return null;let a=x4(t.startTop,t.endTop,n),i=x3(t.startLeft,t.endLeft,r);return a&&i?{...a,...i}:null},x8=(e,t)=>{let{columnCount:r,rowCount:n}=x1(e);if(0===n||0===r)return[];let a=Math.max(0,Math.min(n-1,t.startIndex)),i=Math.max(a,Math.min(n-1,t.endIndex)),o=Math.max(0,Math.min(r-1,t.startCol)),l=Math.max(o,Math.min(r-1,t.endCol));return e.slice(a,i+1).map(e=>{let t=[];for(let r=o;r<=l;r+=1){let n=e?.[r];t.push("number"==typeof n&&Number.isFinite(n)?n:0/0)}return t})},x9=(e,t)=>{let{columnCount:r,rowCount:n}=x1(e);if(0===n||0===r)return null;let a=x2(t.top,n),i=x5(t.left,r);if(a<0||i<0)return null;let o=e[a],l=o?.[i],s="number"==typeof l&&Number.isFinite(l)?l:null;return{columnIndex:i,rowIndex:a,timestamp:o?.timestamp?String(o.timestamp):"",value:s}},x7=(e,t)=>{let r=xy(e,t);if(!r)return null;let n=e.data[r.visibleRowIndex],a=n?.[r.visibleColumnIndex],i="number"==typeof a&&Number.isFinite(a)?a:null;return{columnIndex:r.columnIndex,rowIndex:r.rowIndex,timestamp:n?.timestamp?String(n.timestamp):"",value:i}},ke=(e,t)=>xw(e,t),kt=(e,t)=>xx(e,t),kr=(e,t)=>{let r=xm(t),n=e.getSnapshot(),a=n.sourceSize.width,i=r[0]?.length??0;return a>0&&i>0&&a!==i&&(0!==n.range.x[0]||n.range.x[1]!==a)&&e.updateSamplingRange(xK({x:[0,a],y:n.range.y})),e.setData(r)},kn=e=>{let t=tj(e)?.getSnapshot();return t?.sourceSize.width&&t.sourceSize.height?t:null},ka=e=>{let t=tj(e),r=t?.getSnapshot();if(!t||!r?.sourceSize.width||!r.sourceSize.height)return!1;let n={x:[0,r.sourceSize.width],y:[0,r.sourceSize.height]};return xV(r,n)||t.updateSamplingRange(xK(n)),!0},ki=({id:e})=>{let t=at(e=>e.axisX.frequencyFormat),a=at(e=>e.axisX.unit??""),i=at(e=>e.globalID),o=at(e=>e.axisY.unit),l=xo(e),s=l?.coord.left,c=l?.coord.top,u=xa("HeatmapPopover",e),[d,p]=b(""),[f,g]=b(""),{getSeries:v}=xs(i);h(()=>{if(!i||"number"!=typeof s||"number"!=typeof c||!Number.isFinite(s)||!Number.isFinite(c)){p(""),g("");return}let e=tO(i).getAllRawData(s).waterfallData;if(!e||0===e.length){p(""),g("");return}let t=kn(i),r=t?x7(t,{left:s,top:c}):x9(e,{left:s,top:c});if(!r){p(""),g("");return}p(null!==r.value&&Number.isFinite(r.value)?r.value.toFixed(1):""),g(r.timestamp)},[i,s,c,l?.version,u]);let y=m(()=>{if("number"!=typeof s)return"";let e=kn(i),r=e?xv(s,e):s;return t?.(r)??""},[i,s,t,l?.version,u]),w=m(()=>v(t3),[v]);return /*#__PURE__*/n(g9,{children:[/*#__PURE__*/r(xi,{frequency:y,unit:a}),/*#__PURE__*/r("div",{className:xr,children:/*#__PURE__*/r("span",{children:f})}),d&&w&&!1!==w.display&&/*#__PURE__*/n("div",{className:xr,style:{color:w.color},children:[/*#__PURE__*/r("span",{children:w.label}),/*#__PURE__*/n("div",{children:[/*#__PURE__*/r("span",{className:xn,children:d}),/*#__PURE__*/r("span",{children:o})]})]})]})},ko=ki,kl=({id:e})=>{let t=at(e=>e.globalID),a=at(e=>e.axisY.unit),i=xo(e),o=i?.coord.left,l=xa("LevelStreamPopover",e),[s,c]=b(""),[u,d]=b("");return h(()=>{if(!t||"number"!=typeof o||!Number.isFinite(o)){c(""),d("");return}let{levelStreamData:e}=tO(t).getAllRawData();if(!e?.spectrumData||0===e.spectrumData.length){c(""),d("");return}let r=rw(o,e.spectrumData.length),n=e.spectrumData[r];if(c("number"==typeof n&&Number.isFinite(n)?n.toFixed(1):""),e.timestampData.length>r){let t=Number(e.timestampData[r]);if(Number.isFinite(t))return void d(rX(t))}d("")},[t,o,i?.version,l]),/*#__PURE__*/n(g9,{children:[u&&/*#__PURE__*/r("div",{className:xr,children:/*#__PURE__*/r("span",{children:u})}),s&&/*#__PURE__*/n("div",{className:xr,children:[/*#__PURE__*/r("span",{children:"电平值:"}),/*#__PURE__*/n("div",{children:[/*#__PURE__*/r("span",{className:xn,children:s}),/*#__PURE__*/r("span",{children:a})]})]})]})},ks=kl,kc=({id:e})=>{let t=at(e=>e.axisX.frequencyFormat),a=at(e=>e.axisX.unit??""),i=at(e=>e.globalID),o=xo(e),l=o?.coord.left,s=m(()=>{if(!i||"number"!=typeof l||!Number.isFinite(l))return"";let e=tO(i).getAllRawData(l),{occupancyData:t}=e;if(t&&t.length>0){let r=e.cursorIndex?.globalIndex,n=e.rawData?.occupancyData,a="number"==typeof r&&Number.isFinite(r)&&n&&n.length>0?n[Math.max(0,Math.min(n.length-1,Math.floor(r)))]:void 0,i=t[rw(l,t.length)];return Number.parseFloat(Number(Number.isFinite(a)?a:i).toFixed(1))}return""},[i,l,o?.version]);return /*#__PURE__*/n(g9,{children:[/*#__PURE__*/r(xi,{frequency:m(()=>"number"==typeof l?t?.(l)??"":"",[l,t]),unit:a}),/*#__PURE__*/n("div",{className:xr,children:[/*#__PURE__*/r("span",{children:"占用度"}),/*#__PURE__*/n("div",{children:[/*#__PURE__*/r("span",{className:xn,children:s}),/*#__PURE__*/r("span",{children:"%"})]})]})]})},ku=kc;function kd(e,t){if(e.kind!==r0.Position)return rT(e);if(!t)return null;let r=e.left??50-e.width/2,n=t(Math.max(0,Math.min(100,r))),a=t(Math.max(0,Math.min(100,r+e.width))),i=Number(n),o=Number(a);return n&&a&&Number.isFinite(i)&&Number.isFinite(o)?{startFreq:i,stopFreq:o}:null}let kh=(e,t)=>{let r=t.frequencyCache,n=Math.min(t.point,r?.length??0);if(n<=0)return null;let a=Number(r?.[0]?.frequency),i=Number(r?.[n-1]?.frequency);if(!Number.isFinite(a)||!Number.isFinite(i))return null;let o=Math.min(a,i),l=Math.max(a,i),s=l-o;if(s<=0)return null;let c=Math.max(e.startFreq,o),u=Math.min(e.stopFreq,l);return u<=c?null:{left:(c-o)/s*100,width:(u-c)/s*100}};function kp(e,t){if(!e.show)return[];if(e.kind===r0.Position)return[{key:r0.Position,left:e.left??50-e.width/2,width:e.width}];let r=rT(e);if(!r||!t.length)return[];let n=t.reduce((e,t)=>e+Math.max(0,t.point),0);if(n<=0)return[];let a=[],i=0;return t.forEach((e,t)=>{let o=Math.max(0,e.point)/n*100;if(e.point>0&&e.frequencyCache?.length&&r_(r,e)){let n=kh(r,e);n&&a.push({key:`frequency-${t}`,left:i+n.left/100*o,width:n.width/100*o})}i+=o}),a}function kf(e,t,r){if(Number.isFinite(r)&&!(r<0)&&!(r>100))return kp(e,t).some(e=>e.width>0&&r>=e.left&&r<=e.left+e.width)?e:void 0}let km=({band:e,frequencyFormat:t})=>{if(!e)return null;let a=e.label?.trim(),i=[["名称",e.details?.name],["单位",e.details?.organization]];if(e.kind===r0.CenterBandwidth)i.push(["中心频率",`${rm(e.frequency)} MHz`],["带宽",`${rm(e.bandwidth,3)} kHz`]);else{let r=kd(e,t);r&&i.push(["起始频率",`${rm(r.startFreq)} MHz`],["结束频率",`${rm(r.stopFreq)} MHz`],["带宽",`${rm(1e3*Math.abs(r.stopFreq-r.startFreq),3)} kHz`])}i.push(["调制",e.details?.modulation],["备注",e.details?.remark]);let o=i.filter(([,e])=>!!e);return a||0!==o.length?/*#__PURE__*/n("div",{className:"mt-2 border-t border-border/60 pt-2 text-xs leading-5 text-foreground","data-testid":"band-info-panel",children:[a?/*#__PURE__*/r("div",{className:"mb-1 whitespace-pre-line break-words font-medium text-foreground","data-testid":"band-info-label",children:a}):null,o.length>0?/*#__PURE__*/r("div",{className:"space-y-0.5",children:o.map(([e,t])=>/*#__PURE__*/n("div",{className:"flex gap-2",children:[/*#__PURE__*/r("span",{className:"w-12 shrink-0 text-muted-foreground",children:e}),/*#__PURE__*/r("span",{className:"min-w-0 break-words",children:t})]},e))}):null]}):null},kg=/*#__PURE__*/a.memo(km),kb={LEGITIMATE:"Legitimate",UNKNOWN:"UnKnown",KNOWN:"Know",VIOLATION:"Violation",ILLEGAL:"Illegal"},kv={Legitimate:{name:"合法",color:"var(--success)",isLegitimate:!0},UnKnown:{name:"未知",color:"var(--muted-foreground)",isLegitimate:!1},Know:{name:"已知",color:"var(--primary)",isLegitimate:!0},Violation:{name:"违规",color:"var(--warning)",isLegitimate:!1},Illegal:{name:"非法",color:"var(--destructive)",isLegitimate:!1}},ky=[kb.LEGITIMATE,kb.UNKNOWN,kb.KNOWN,kb.VIOLATION,kb.ILLEGAL],kw=e=>"string"==typeof e&&ky.includes(e)?e:kb.UNKNOWN,kx=null,kk=-1,kS=0,kM=1,kF=2,kC=[-1,0,1,2],kD={[-1]:{name:"未分配",color:"var(--signal-level-unassigned)"},0:{name:"一级",color:"var(--signal-level-first)"},1:{name:"二级",color:"var(--signal-level-second)"},2:{name:"三级",color:"var(--success)"}},kz=e=>"number"==typeof e&&Number.isInteger(e)&&(-1===e||0===e||1===e||2===e)?e:-1,kN=e=>{if(e.color)return e.color;let t=kw(e.signalType);return"simple"===e.source&&t===kb.LEGITIMATE?kD[kz(e.level)].color:kv[t].color},kE=["station","simple"],kT={station:"台站库",simple:"信号库"};function kR(e){return"signalName"in e&&"orgName"in e}let kA=e=>kR(e)?"station":"simple",kI=e=>`${kA(e)}:${kw(e.signalType)}:${kz(e.level)}`;function kP(e){let t=kA(e);return e.id?`${t}:${e.id}`:kR(e)?`${t}:${e.signalName}-${e.frequency}`:null!=e.startFrequency&&null!=e.stopFrequency?`${t}:${e.startFrequency}-${e.stopFrequency}`:`${t}:${e.frequency}-${e.bandwidth}`}let kL=e=>{let t=new Set,r=new Map,n=new Map;for(let a of e){let e=kI(a),i=kA(a);t.add(e),r.set(e,(r.get(e)??0)+1);let o=n.get(e)??new Set;o.add(kN({...a,source:i})),n.set(e,o)}let a=e=>e.reduce((e,t)=>e+(r.get(t)??0),0),i=e=>{let t=n.get(e);return t?.size===1?[...t][0]:void 0},o=e=>{let t=e.map(i);if(t.some(e=>null==e))return;let r=new Set(t);return 1===r.size?[...r][0]:void 0},l=[];for(let e of kE){let n=[...t].filter(t=>t.startsWith(`${e}:`));if(0===n.length)continue;if("station"===e){l.push({source:e,label:kT[e],leafKeys:n,dataLeafKeys:n,hasData:!0,count:a(n),types:[]});continue}let s=ky.flatMap(n=>{let l=kC.map(a=>{let o=`${e}:${n}:${a}`;return{level:a,label:kD[a].name,leafKey:o,hasData:t.has(o),count:r.get(o)??0,color:i(o)}}),s=l.map(e=>e.leafKey),c=s.filter(e=>t.has(e));return 0===c.length?[]:{signalType:n,label:kv[n].name,leafKeys:s,dataLeafKeys:c,hasData:c.length>0,count:a(c),color:o(c),levels:n===kb.LEGITIMATE?l.filter(e=>e.hasData):[]}});if(0===s.length)continue;let c=s.flatMap(e=>e.leafKeys),u=c.filter(e=>t.has(e));l.push({source:e,label:kT[e],leafKeys:c,dataLeafKeys:u,hasData:!0,count:a(u),types:s})}return{sources:l}},kO=(e,t,r)=>{let n=r.filter(t=>e.has(t));if(0===n.length)return"disabled";let a=n.filter(e=>t.has(e)).length;return 0===a?"checked":a===n.length?"unchecked":"indeterminate"},kq=(e,t,r)=>{let n=new Set(e),a=t.filter(e=>r.has(e)),i=a.filter(e=>n.has(e)).length;if(a.length>0&&0===i){for(let e of t)n.add(e);return[...n]}for(let e of t)n.delete(e);return[...n]},k$=(e,t)=>{if(!t.length)return e;let r=new Set(t);return e.filter(e=>!r.has(kI(e)))},k_=1,kj=e=>(e.startFreq+e.stopFreq)/2,kH=e=>Math.abs(e.stopFreq-e.startFreq),kB=(e,t,r)=>e<t?t-e:e>r?e-r:0,kW=(e,t)=>r$(e,t)?0:Math.min(Math.abs(e-t.startFreq),Math.abs(e-t.stopFreq)),kG=(e,t,r)=>{let n=kH(t.range)-kH(r.range);if(0!==n)return n;let a=Math.abs(kj(t.range)-e)-Math.abs(kj(r.range)-e);if(0!==a)return a;let i=Number(kR(r.item))-Number(kR(t.item));return 0!==i?i:kP(t.item).localeCompare(kP(r.item))},kY=(e,t,r,n)=>{let a=kB(t,r.startIndex,r.stopIndex)-kB(t,n.startIndex,n.stopIndex);if(0!==a)return a;let i=kH(r.range)-kH(n.range);if(0!==i)return i;let o=kW(e,r.range)-kW(e,n.range);if(0!==o)return o;let l=Number(kR(n.item))-Number(kR(r.item));return 0!==l?l:kP(r.item).localeCompare(kP(n.item))};function kU(e){return{frequency:null!=e.frequency?Number(e.frequency):void 0,bandwidth:null!=e.bandwidth?Number(e.bandwidth):void 0,startFrequency:null!=e.startFrequency?Number(e.startFrequency):void 0,stopFrequency:null!=e.stopFrequency?Number(e.stopFrequency):void 0}}function kX(e,t){let{currentFrequency:r,currentPointIndex:n}=t,a=t.indexTolerance??1;if(!Number.isFinite(r)||!Number.isFinite(n)||!e.length)return;let i=e.filter(({range:e})=>r$(r,e)).sort((e,t)=>kG(r,e,t));return i.length>0?i[0]:e.filter(({startIndex:e,stopIndex:t})=>rq(n,{startIndex:e,stopIndex:t},a)).sort((e,t)=>kY(r,n,e,t))[0]}let kK=e=>null!=e.frequency?`${e.frequency}MHz`:null!=e.startFrequency&&null!=e.stopFrequency?`${e.startFrequency}-${e.stopFrequency}MHz`:void 0,kV=e=>{let t=kA(e),r=kw(e.signalType),n=kv[r].name,a=kD[kz(e.level)].name,i=kN({...e,source:t}),o=kK(e),l=null!=e.bandwidth?`带宽: ${e.bandwidth}kHz`:void 0,s=kR(e)?{name:e.signalName,organization:e.orgName,modulation:e.modulation}:e.details;return kR(e)?{color:i,tooltip:[e.signalName,o,e.orgName&&`单位: ${e.orgName}`,n&&`类型: ${n}`].filter(Boolean).join(" | ")}:{color:i,tooltip:[s?.name,kT[t],o,s?.organization&&`单位: ${s.organization}`,l,s?.modulation&&`调制: ${s.modulation}`,n&&`类型: ${n}`,r===kb.LEGITIMATE&&a&&`等级: ${a}`].filter(Boolean).join(" | ")}},kQ=(e,t)=>e.flatMap(e=>{let r=rT(kU(e));if(!r||!r_(r,t))return[];let{startIndex:n,stopIndex:a}=rP(r,t);return[{item:e,range:r,startIndex:n,stopIndex:a}]}),kZ=(e,t,r)=>{let n=t.get(e)??0,a=0===n?e:`${e}#${n+1}`;for(;r.has(a);)n+=1,a=`${e}#${n+1}`;return t.set(e,n+1),r.add(a),a},kJ=(e,t)=>{let r=new Map,n=new Set;return kQ(e,t).map(({item:e,range:a,startIndex:i,stopIndex:o})=>{let{left:l,width:s}=rP(a,t),{color:c,tooltip:u}=kV(e);return{item:e,range:a,startIndex:i,stopIndex:o,key:kZ(kP(e),r,n),position:{left:`${l}%`,width:`${s}%`},color:c,tooltip:u}})},k0=({segments:e,signalItems:t,isCursorActive:r,currentFrequency:n,currentPosition:a})=>{if(!e.length)return[];let i=e.reduce((e,t)=>e+t.point,0);return e.map((o,l)=>{let s=kJ(t,o),c=r&&a.segmentIndex===l&&Number.isFinite(n)?resolveBestSignalMatch(s,{currentFrequency:n,currentPointIndex:a.pointIndex}):void 0,u=o.point/i*100,d=e.slice(0,l).reduce((e,t)=>e+t.point/i*100,0);return{segment:o,segmentIndex:l,signalPositions:s,activeSignalKey:c?.key,style:{left:`${d}%`,width:`${u}%`}}})},k1=({segments:e,signalItems:t})=>{if(!e.length)return[];let r=e.reduce((e,t)=>e+t.point,0),n=0;return e.map((e,a)=>{let i=e.point/r*100,o={segment:e,segmentIndex:a,signalPositions:kJ(t,e),style:{left:`${n}%`,width:`${i}%`}};return n+=i,o})},k2=({segmentData:e,isCursorActive:t,currentFrequency:r,currentPosition:n})=>{if(!t||!Number.isFinite(r)||n.segmentIndex<0)return;let a=e[n.segmentIndex];if(a)return kX(a.signalPositions,{currentFrequency:r,currentPointIndex:n.pointIndex})?.key},k5=({frequency:e,signalItems:t,segments:r,currentPosition:n})=>{if(!Number.isFinite(e))return;let a=r[n.segmentIndex];if(!a)return;let i=t.filter(isStationInfo);if(!i.length)return;let o=resolveBestSignalMatch(kQ(i,a),{currentFrequency:e,currentPointIndex:n.pointIndex});return o&&isStationInfo(o.item)?o.item:void 0},k4=({frequency:e,signalItems:t,segments:r,currentPosition:n})=>{if(!Number.isFinite(e))return;let a=r[n.segmentIndex];if(a)return resolveBestSignalMatch(kQ(t,a),{currentFrequency:e,currentPointIndex:n.pointIndex})?.item},k3=({signalItems:e,segments:t})=>e.length&&t.length?t.map(t=>kQ(e,t)):[],k6=({signalItems:e,segments:t})=>{if(!e.length||!t.length)return[];let r=e.filter(isStationInfo);return r.length?t.map(e=>kQ(r,e)):[]},k8=({frequency:e,stationRangeIndex:t,currentPosition:r})=>{if(!Number.isFinite(e))return;let n=t[r.segmentIndex];if(!n?.length)return;let a=resolveBestSignalMatch(n,{currentFrequency:e,currentPointIndex:r.pointIndex});return a&&isStationInfo(a.item)?a.item:void 0},k9=({frequency:e,signalRangeIndex:t,currentPosition:r})=>{if(!Number.isFinite(e))return;let n=t[r.segmentIndex];if(n?.length)return kX(n,{currentFrequency:e,currentPointIndex:r.pointIndex})?.item},k7=(e,t,r)=>{let n=`stationData-update-${e}`;return t&&r?tF(n,t,r,e):tF(n)},Se=(e,t)=>{if(!e)return[];let r=tS(`stationData-${e}`,t,[],e);return void 0!==t&&k7(e)(r),r};function St({respectVisibility:e=!1,filterHidden:t=!0}={}){let r=at(e=>e.globalID),n=at(e=>e.signal.data),a=at(e=>e.signal.display),i=at(e=>e.signal.show),o=at(e=>e.signal.hiddenCategoryKeys),[l,s]=b(0);return h(()=>{let e=`useUnifiedSignals-${r}-${Date.now()}`,t=k7(r,e,()=>{s(e=>e+1)}),n=Se(r);return n&&n.length>0&&s(e=>e+1),()=>{"function"==typeof t&&t()}},[r]),m(()=>{if(e&&(!i||!a))return[];let l=[...Se(r),...n||[]];return t&&o?.length?k$(l,o):l},[r,n,a,i,e,t,o,l])}let Sr=({frequency:e,enabled:t=!0,cursorSample:r},n)=>{let a=at(e=>e.cursor),i=at(e=>e.segments),o=r?.coord.left??a.coord.left,l=St({respectVisibility:t}),s=m(()=>t?"station"===n?l.filter(kR):l:[],[t,l,n]),c=m(()=>k3({signalItems:s,segments:i}),[s,i]),u=m(()=>t&&(!!r||ru(a)),[a,r,t]),d=m(()=>u&&"number"==typeof o?rL(o,i):{segmentIndex:-1,pointIndex:-1},[u,o,i]);return m(()=>{if(!t||"number"!=typeof o||!Number.isFinite(o)||o<0||!c.length||!i?.length||!u)return;let r=rO(i,d);if(!Number.isFinite(r)){let t=Number(e);if(!Number.isFinite(t))return;return k9({frequency:t,signalRangeIndex:c,currentPosition:d})}return k9({frequency:r,signalRangeIndex:c,currentPosition:d})},[t,e,c,i,d,o,u])};function Sn(e){return Sr(e,"all")}function Sa(e){let t=Sr(e,"station");return t&&isStationInfo(t)?t:void 0}let Si=null,So=null,Sl=({label:e,value:t,tabular:a=!1})=>/*#__PURE__*/n("div",{className:`flex gap-2${a?" tabular-nums":""}`,children:[/*#__PURE__*/r("span",{className:"w-10 shrink-0 text-muted-foreground",children:e}),/*#__PURE__*/r("span",{className:"min-w-0 break-words",children:t})]}),Ss=({color:e,label:t,testId:n})=>/*#__PURE__*/r("span",{className:"font-medium text-foreground","data-testid":n,style:e?{color:oi(e)}:void 0,children:t}),Sc=({signalInfo:e})=>{if(!e)return null;let t=kA(e),a=kR(e)?{name:e.signalName,organization:e.orgName,modulation:e.modulation,remark:e.remark}:e.details,i=kw(e.signalType),o=kv[i],l=kD[kz(e.level)],s="simple"===t&&i===kb.LEGITIMATE,c=kN({...e,source:t}),u=s?void 0:c,d=null!=e.startFrequency&&null!=e.stopFrequency;return /*#__PURE__*/r("div",{className:"mt-2 border-t border-border/60 pt-2 text-xs leading-5 text-foreground","data-signal-source":t,"data-testid":"signal-info-panel",children:/*#__PURE__*/n("div",{className:"space-y-0.5",children:[/*#__PURE__*/r(Sl,{label:"来源",value:kT[t]}),a?.name?/*#__PURE__*/r(Sl,{label:"名称",value:a.name}):null,a?.organization?/*#__PURE__*/r(Sl,{label:"单位",value:a.organization}):null,null!=e.frequency?/*#__PURE__*/r(Sl,{label:"频率",value:`${e.frequency}MHz`,tabular:!0}):d?/*#__PURE__*/r(Sl,{label:"范围",value:`${e.startFrequency}-${e.stopFrequency}MHz`,tabular:!0}):null,null!=e.bandwidth?/*#__PURE__*/r(Sl,{label:"带宽",value:`${e.bandwidth}kHz`,tabular:!0}):null,a?.modulation?/*#__PURE__*/r(Sl,{label:"调制",value:a.modulation}):null,/*#__PURE__*/r(Sl,{label:"类型",value:/*#__PURE__*/r(Ss,{color:u,label:o.name,testId:"signal-info-type-color"})}),s?/*#__PURE__*/r(Sl,{label:"等级",value:/*#__PURE__*/r(Ss,{color:c,label:l.name,testId:"signal-info-level-color"})}):null,a?.remark?/*#__PURE__*/r(Sl,{label:"备注",value:a.remark}):null]})})},Su=/*#__PURE__*/a.memo(Sc),Sd=({left:e,updateKey:t,onChange:a,showSignalInfo:i=!0,showBandInfo:o=!1,cursorSample:l})=>{let s=at(e=>e.axisY.unit),c=at(e=>e.axisX.frequencyFormat),d=at(e=>e.axisX.unit),p=at(e=>e.globalID),f=at(e=>e.band),b=at(e=>e.segments),v=g(null),y=xd(p,u(e=>!1!==e.display,[])),w=u((e,t,a,i)=>{if(!e||0===e.length)return null;let o=Math.max(0,Math.min(e.length-1,Math.floor(a))),l=Number.isFinite(i)?i:e[o];if("number"!=typeof l)return null;let c=s??"",u=nI(c,l)?.toFixed(1);return tY(u)?/*#__PURE__*/n("div",{className:"grid max-w-[220px] grid-cols-[minmax(0,1fr)_auto] items-center gap-x-1 text-xs",style:{color:t?.color},children:[/*#__PURE__*/r("span",{className:"min-w-0 truncate",children:t?.label||t.name}),/*#__PURE__*/n("div",{className:"text-right",children:[/*#__PURE__*/r("span",{className:"inline-flex min-w-9 justify-end",children:u}),/*#__PURE__*/r("span",{children:c})]})]},t.name):null},[s]),{value:x,currentIndex:k}=m(()=>{if(!p)return{value:null,currentIndex:0/0};let r=tO(p);if(!r)return{value:null,currentIndex:0/0};let n=l?.version,a=v.current,i=a&&a.globalID===p&&a.left===e&&a.sampleVersion===n&&a.updateKey===t?a.snapshot:r.getAllRawData(e);v.current={globalID:p,left:e,sampleVersion:n,updateKey:t,snapshot:i};let o=i.cursorIndex?.globalIndex,s=i.cursorIndex?.sampledIndex,c={realData:i.realData,maxData:i.maxData,minData:i.minData,avgData:i.avgData,thresholdData:i.thresholdData,templateData:i.templateData,occupancyData:i.occupancyData,backgroundNoiseData:i.backgroundNoiseData,...i.extraData},u={realData:i.rawData?.realData,maxData:i.rawData?.maxData,minData:i.rawData?.minData,avgData:i.rawData?.avgData,thresholdData:i.rawData?.thresholdData,templateData:i.rawData?.templateData,occupancyData:i.rawData?.occupancyData,backgroundNoiseData:i.rawData?.backgroundNoiseData,...i.rawData?.extraData},d=Object.values(c).find(e=>!!e&&e.length>0),h=d?.length??0;if(h<=0)return{value:null,currentIndex:0/0};let f="number"==typeof s&&Number.isFinite(s)?Math.max(0,Math.min(h-1,Math.floor(s))):rw(e,h),m=Number.isFinite(i.cursorIndex?.globalIndex)?Math.floor(i.cursorIndex?.globalIndex??0):void 0,g=i.rawData?.realData,b=void 0!==m&&g&&g.length>0&&m>=0&&m<g.length?g[m]:void 0;return{value:y.map(e=>{let t=c[e.name];if(!t||0===t.length)return null;let r="realData"===e.name?b:(e=>{if("number"!=typeof o||!Number.isFinite(o))return;let t=u[e];if(!t||0===t.length)return;let r=Math.max(0,Math.min(t.length-1,Math.floor(o)));return t[r]})(e.name);return w(t,e,f,r)}).filter(e=>null!==e),currentIndex:f}},[w,p,y,t,e,l?.version]),S=m(()=>c?.(e)??"",[e,c]);h(()=>{a?.({index:k,frequency:S})},[k,S,a]);let M=Sn({frequency:S,enabled:i,cursorSample:l}),F=i&&!!M,C=m(()=>o&&l?kf(f,b,e):void 0,[f,b,e,o,l]),D=m(()=>x&&(!Array.isArray(x)||x.length>0),[x]);return!(e<0)&&(D||F||C)?/*#__PURE__*/n(g9,{children:[S&&/*#__PURE__*/n("div",{className:"text-[14px] font-medium text-popover-foreground",children:[S,d]}),x?/*#__PURE__*/r("div",{className:"mt-2 space-y-1",children:x}):null,i?/*#__PURE__*/r(Su,{signalInfo:M}):null,/*#__PURE__*/r(kg,{band:C,frequencyFormat:c})]}):null},Sh=/*#__PURE__*/a.memo(Sd),Sp=({id:e})=>{let t=at(e=>e.signal.show),n=at(e=>e.signal.display),a=xo(e),i=a?.coord.left;return /*#__PURE__*/r(Sh,{left:"number"==typeof i?i:-1,updateKey:xa("SpectrumPopover",e),showSignalInfo:t&&n,showBandInfo:!0,cursorSample:a})},Sf=Sp,Sm=({id:e,mode:t,type:n})=>t===rr.LevelStream?/*#__PURE__*/r(kl,{id:e}):n===rr.Spectrum?/*#__PURE__*/r(Sp,{id:e}):n===rr.Heatmap?/*#__PURE__*/r(ki,{id:e}):n===rr.Occupancy?/*#__PURE__*/r(kc,{id:e}):null,Sg="Cursor",Sb=1,Sv=(e,t,r,n=Sb)=>e>=r.left-n&&e<=r.right+n&&t>=r.top-n&&t<=r.bottom+n,Sy=(e,t,r,n,a)=>{let i=e.currentTarget;if(!(i instanceof HTMLElement))return null;let o=a??rf(i);return{sourceId:r,sourceType:n,clientX:e.clientX,clientY:e.clientY,coord:t,bounds:o}},Sw=e=>{let t=e.currentTarget;return t instanceof HTMLElement?t:null},Sx=(e,t,r)=>{let n=e.event;return e.coord.left===t.left&&e.coord.top===t.top&&n?.sourceId===r?.sourceId&&n?.sourceType===r?.sourceType&&n?.clientX===r?.clientX&&n?.clientY===r?.clientY&&n?.bounds.left===r?.bounds.left&&n?.bounds.top===r?.bounds.top&&n?.bounds.right===r?.bounds.right&&n?.bounds.bottom===r?.bounds.bottom},Sk=({id:e,type:t})=>{let{state:{cursor:a,globalID:i},dispatch:o}=ae(),{active:l,show:s,mode:c,crosshair:u}=a,[d,p]=b(!1),f=g(a),v=g(l),y=g(d),w=g(null),x=g(null),k=g(null),S=g(null);h(()=>{f.current=a,v.current=l,y.current=d},[a,l,d]);let M=m(()=>(t="leave")=>{p(!1);let r=b6.getPointer(e);if(f.current.event?.sourceId!==e&&r?.sourceId!==e){y.current=!1,w.current=null,x.current=null,b6.clearPointer(e,t);return}let n={...f.current,event:null,coord:{left:0,top:0}};f.current=n,y.current=!1,w.current=null,x.current=null,b6.clearPointer(e,t),A(()=>{p(!1),o({payload:{cursor:n}})})},[o,e]);h(()=>{s||(p(!1),y.current=!1,w.current=null,x.current=null,b6.clearPointer(e,"manual"))},[e,s]),h(()=>()=>{b6.dispose(e)},[e]),h(()=>{if(i&&s)return b6.subscribeSample(e,t=>{if(!t||t.sourceId!==e)return;let r=b5(t);if(Sx(f.current,t.coord,r))return;let n={...f.current,event:r,coord:t.coord};f.current=n,o({payload:{cursor:n}}),v.current&&w$(i)()})},[o,i,e,s]),h(()=>{if(s&&l)return b6.subscribePointer(e,t=>{let r=k.current,n=S.current;if(!t||t.sourceId!==e){r&&(r.style.left="-200%"),n&&(n.style.top="-200%");return}r&&(r.style.left=`${t.coord.left}%`),n&&(n.style.top=`${t.coord.top}%`)})},[l,e,s]),h(()=>{if(!i||!s)return;let r=wQ(e,Sg,()=>{y.current=!0,p(!0)}),n=wY(e,Sg,(r,n)=>{if(!y.current)return;let a=Sw(r);if(!a)return;if(x.current!==a||!w.current){let t=rf(a);x.current=a,w.current=t,b6.refreshBounds(e,t)}let i=Sy(r,n,e,t,w.current);if(i){if(!Sv(i.clientX,i.clientY,i.bounds))return void M("bounds");b6.updatePointer(e,i)}}),a=wV(e,Sg,M);return()=>{r?.(),n?.(),a?.()}},[e,i,s,t,M]),h(()=>{if(!s)return;let t=()=>{let t=x.current;if(!t)return;let r=rf(t);w.current=r,b6.refreshBounds(e,r)};return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[e,s]),h(()=>{if(!s)return;let t=t=>{if(!y.current)return;let r=b6.getPointer(e),n=r?.bounds??f.current.event?.bounds;r&&r.sourceId===e&&n&&(n.width<=0||n.height<=0||!Sv(t.clientX,t.clientY,n))&&M("bounds")};return window.addEventListener("pointermove",t,!0),()=>{window.removeEventListener("pointermove",t,!0)}},[s,e,M]),h(()=>{if(!s)return;let e=()=>{M("blur")},t=()=>{"hidden"===document.visibilityState&&M("visibility")},r=e=>{null===e.relatedTarget&&M("mouseout")};return window.addEventListener("blur",e),document.addEventListener("visibilitychange",t),document.addEventListener("mouseout",r),()=>{window.removeEventListener("blur",e),document.removeEventListener("visibilitychange",t),document.removeEventListener("mouseout",r)}},[M,s]);let F=m(()=>Sm({id:e,mode:c,type:t}),[e,c,t]);return s&&d&&l?/*#__PURE__*/n(yi,{className:"z-[6]",children:[/*#__PURE__*/r("div",{ref:k,"data-testid":"cursor-line-x",className:"pointer-events-none absolute left-[-200%] top-0 h-full border-l border-dashed border-chart-highlight/80 opacity-50"}),(t===rr.Heatmap||t===rr.Spectrum&&u)&&/*#__PURE__*/r("div",{ref:S,"data-testid":"cursor-line-y",className:"absolute left-0 top-[-200%] w-full border-t border-dashed border-chart-highlight/80 opacity-50"}),F&&/*#__PURE__*/r(va,{id:e,children:F},`${c??t}-${e}`)]}):null},SS=Sk,SM=rl.EventBus;function SF(e){let{state:{segments:t,axisX:{frequencyFormat:r},eventBus:{onDoubleClick:n}}}=ae();h(()=>{let t=wX(e,SM,(t,a)=>{if(!w7(e,SM))return!1;let{left:i}=a;return n(r?.(i)??"",a),!0}),a=wK(e,SM,()=>{xt(e,SM)}),i=wV(e,SM,()=>{xt(e,SM)});return()=>{t?.(),a?.(),i?.()}},[e,t,r,n])}let SC=({id:e})=>{let t=at(e=>e.globalID),n=m(()=>wW(e),[e]),[a,i]=b(),o=g(null),l=g(null),s=g({isDragging:!1,startPoint:{x:0,y:0,event:null},lastPoint:{x:0,y:0}}),c=g({timerId:null,startPoint:null,fired:!1});SF(e),nq(t,n);let d=u(()=>{i(xe(e))},[e]),p=u(()=>{s.current.isDragging=!1,s.current.startPoint.event=null,c.current.timerId&&window.clearTimeout(c.current.timerId),c.current.timerId=null,c.current.startPoint=null,c.current.fired=!1},[]);h(()=>wK(e,"EventBusInteraction",p),[e,p]);let f=u(e=>{e.preventDefault()},[]),v=u(e=>{if(!e.defaultPrevented){l.current?.cancel();try{o.current?.setPointerCapture(e.pointerId)}catch{}if(wU(n)(wB(e)),o.current?.focus?.(),s.current={isDragging:!0,startPoint:{x:e.clientX,y:e.clientY,event:e},lastPoint:{x:e.clientX,y:e.clientY}},0===e.button){c.current.timerId&&window.clearTimeout(c.current.timerId),c.current.startPoint={x:e.clientX,y:e.clientY},c.current.fired=!1;let t=window.setTimeout(()=>{s.current.isDragging&&!c.current.fired&&(c.current.fired=!0,w1(n)(e,wB(e)))},500);c.current.timerId=t}}},[n,e,p]),y=u(rW(e=>{if(!e.currentTarget)return;wY(n)(e,wB(e)),d();let t=c.current.startPoint;if(t&&c.current.timerId&&!c.current.fired){let r=e.clientX-t.x,n=e.clientY-t.y;r*r+n*n>25&&(window.clearTimeout(c.current.timerId),c.current.timerId=null)}if(s.current.isDragging&&s.current.startPoint.event){let{height:t,width:r}=e.currentTarget.getBoundingClientRect(),a=s.current.startPoint.event,i=(e.clientX-s.current.lastPoint.x)/r,o=(e.clientY-s.current.lastPoint.y)/t;wJ(n)(wB(a),wB(e),{left:i,top:o},2===e.buttons),s.current.lastPoint={x:e.clientX,y:e.clientY}}}),[n,e,p,d]);l.current=y;let w=u(()=>{l.current?.flush(),wK(n)(),s.current.isDragging=!1,s.current.startPoint.event=null,c.current.timerId&&window.clearTimeout(c.current.timerId),c.current.timerId=null,c.current.startPoint=null,c.current.fired=!1},[n]),x=u(()=>{l.current?.flush(),wV(n)(),p()},[n,p]),k=u(()=>{wQ(n)()},[n]),S=u(e=>{wX(n)(e,wB(e))},[n]),M=u(rB(e=>{wZ(n)(-1*e.deltaY,wB(e))}),[n]);return h(()=>{o.current&&(o.current.id=n)},[n]),h(()=>{let e=()=>{x()},t=()=>{"hidden"===document.visibilityState&&x()},r=e=>{null===e.relatedTarget&&x()};return window.addEventListener("blur",e),document.addEventListener("visibilitychange",t),document.addEventListener("mouseout",r),()=>{window.removeEventListener("blur",e),document.removeEventListener("visibilitychange",t),document.removeEventListener("mouseout",r)}},[x]),h(()=>()=>l.current?.cancel(),[]),/*#__PURE__*/r(yi,{className:"z-[5] pointer-events-auto",children:/*#__PURE__*/r("button",{ref:o,type:"button",className:iX("absolute right-0 top-0 h-full w-full appearance-none border-0 bg-transparent p-0 outline-none"),style:{cursor:a},"aria-label":"Event bus",onContextMenu:f,onPointerDown:v,onPointerMove:y,onPointerUp:w,onBlur:x,onFocus:k,onPointerLeave:x,onPointerOver:k,onDoubleClick:S,onWheel:M})})},SD=SC,Sz=()=>{let{state:{gridLines:e}}=ae();return e&&/*#__PURE__*/r("div",{className:"pointer-events-none absolute right-0 top-0 z-[1] flex h-full w-full select-none flex-col border [border-color:var(--chart-grid)] bg-transparent"})},SN=Sz,SE=e=>{let{children:t,onWheelCapture:n}=e,{pluginBoxWidth:a}=yn();return /*#__PURE__*/r("div",{className:"absolute right-0 top-0 m-0 h-full overflow-hidden p-0",style:{width:a},onWheelCapture:n,children:t})},ST=/*#__PURE__*/a.memo(SE),SR=(e,t,r)=>Math.min(r,Math.max(t,e)),SA=e=>Number.isFinite(e)?Math.max(0,Math.floor(e)):0,SI=(e,t)=>{let r=SA(t);if(0===r)return{start:0,end:0};let n=Math.min(e.start,e.end),a=Math.max(e.start,e.end),i=SR(Math.floor(n),0,r-1),o=SR(Math.ceil(a),i,r-1);return{start:i,end:o}},SP=({anchorPercent:e,interval:t,scale:r,totalPoints:n})=>{let a=SA(n);if(0===a)return{start:0,end:0};let i=SI(t,a),o=i.end+1,l=o-i.start,s=Math.min(tV.ZOOM_MIN_RANGE,a),c=SR(Math.round(l*(Number.isFinite(r)&&r>0?r:1)),s,a),u=SR(SR(e,0,100)*a/100,i.start,o),d=(u-i.start)/l,h=SR(Math.round(u-c*d),0,a-c);return{start:h,end:h+c-1}},SL=(e,t,r)=>{let n=SA(t);if(0===n)return{start:0,end:0};let a=SI(e,n),i=a.end-a.start+1,o=Number.isFinite(r)?Math.round(r):0,l=SR(a.start+o,0,n-i);return{start:l,end:l+i-1}},SO=({endPercent:e,startPercent:t,totalPoints:r})=>{let n=SA(r);if(0===n)return null;let a=SR(Math.min(t,e),0,100),i=SR(Math.max(t,e),0,100),o=SR(Math.floor(a*n/100),0,n-1),l=SR(Math.ceil(i*n/100),o+1,n);return{start:o,end:l-1}},Sq=rl.Zoom;function S$(e,t,r=!0){let{state:{zoom:n,segments:a,globalID:i},dispatch:o}=ae(),{show:l,interval:{start:s,end:c}}=n,{totalPoints:d}=a,p=m(()=>t===rr.Spectrum,[t]),f=g(0),b=u((e,t)=>r&&l&&d?SP({anchorPercent:t,interval:{start:s,end:c},scale:e>0?.5:2,totalPoints:d}):null,[r,l,d,s,c]);h(()=>{if(r&&d)return wZ(e,t,(e,t)=>{let r=b(e,t.left);r&&(r.start!==n.interval.start||r.end!==n.interval.end)&&o({payload:{zoom:{...n,interval:r,isScanSegmentsUpdateMagnify:!1}}})})},[r,e,t,d,n,b,o]);let v=u((t,a,l,u)=>{if(!r||!w7(e,Sq)||!t||!a||!l||u||!i||!d)return;let h=SL({start:s,end:c},d,-l.left*d);(h.start!==s||h.end!==c)&&o({payload:{zoom:{...n,interval:h,isScanSegmentsUpdateMagnify:!1}}});let m=l.top;m&&p&&(f.current+=m,Math.abs(f.current)&&(nH(i)?.(f.current),f.current=0))},[r,e,p,s,c,d,n,i,o]);h(()=>{if(!r||!l||!e)return;let t=()=>{xt(e,Sq),f.current=0},n=wK(e,Sq,t),a=wV(e,Sq,t),i=wJ(e,Sq,v);return()=>{n?.(),a?.(),i?.(),t()}},[r,l,e,v])}let S_=1e4,Sj={startIndex:0,endIndex:0,startCol:0,endCol:0,startTimestamp:"",endTimestamp:"",startFrequency:0,startFrequencyFormat:"",endFrequency:0,endFrequencyFormat:"",bandwidth:0,bandwidthFormat:"",data:[]};function SH({endLeft:e,startLeft:t,startTop:r,endTop:n,frequencyFormat:a,globalID:i}){let{waterfallData:o}=tO(i).getAllRawData();if(!o?.length)return Sj;let l=kn(i),s={endLeft:e,endTop:n,startLeft:t,startTop:r},c=l?xw(l,s):x6(o,s);if(!c)return Sj;let u=l?xv(Math.min(t,e),l):Math.min(t,e),d=l?xv(Math.max(t,e),l):Math.max(t,e),h={start:Math.round(1e4*Number(a(u)))/1e4,end:Math.round(1e4*Number(a(d)))/1e4},p=Math.abs(h.end-h.start),f=l?.rawData??o,m=f[c.startIndex]?.timestamp||"",g=f[c.endIndex]?.timestamp||"";return{startIndex:c.startIndex,endIndex:c.endIndex,startCol:c.startCol,endCol:c.endCol,startTimestamp:m,endTimestamp:g,startFrequency:h.start,startFrequencyFormat:String(h.start),endFrequency:h.end,endFrequencyFormat:String(h.end),bandwidth:p,bandwidthFormat:rm(p),data:l?xx(l,c):x8(o,c)}}let SB=(e,t)=>tF(`heatmapCaptureUpdate-${e}`,"0",t,e),SW=e=>`heatmapCaptureSelection-${e}`,SG=e=>`${SW(e)}-update`,SY=(e,t)=>e===t||null!==e&&null!==t&&1e-7>=Math.abs(e.x[0]-t.x[0])&&1e-7>=Math.abs(e.x[1]-t.x[1])&&1e-7>=Math.abs(e.y[0]-t.y[0])&&1e-7>=Math.abs(e.y[1]-t.y[1]),SU=e=>tS(SW(e),void 0,null,e),SX=(e,t)=>{!e||SY(SU(e),t)||(tS(SW(e),t,null,e),tF(SG(e))(t))},SK=(e,t)=>tF(SG(e),"HeatmapOverview",t,e),SV=rl.HeatmapCapture,SQ=e=>{let{state:{heatmapCapture:t,axisX:{frequencyFormat:a,unit:i},system:o,globalID:l}}=ae(),{id:s}=e,{type:c,show:u,display:d,onChange:p}=t,f=m(()=>c===nn.Area&&u&&d,[c,u,d]),[g,v]=b(Sj),[y,w]=b();return(h(()=>{if(f){let e=wK(s,SV,()=>{p(g)}),t=wV(s,SV,()=>{p(g)}),r=wJ(s,SV,(e,t)=>{if(w7(s,SV)&&e&&t){let{left:r,top:n}=e,{left:i,top:s}=t;if(void 0===r||void 0===n||void 0===i||void 0===s)return;let c=i-r,u=s-n,d=Math.abs(c),h=Math.abs(u);d*o.width/100<=10||h*o.height/100<=10||(w({width:d,height:h,left:c>0?r:i,top:u>0?n:s,endLeft:i,startLeft:r}),v(SH({startTop:n,endTop:s,endLeft:i,startLeft:r,frequencyFormat:a,globalID:l})))}});return()=>{e?.(),t?.(),r?.()}}},[s,f,g,a,l,p]),h(()=>{f||(xt(s,SV),v(Sj),p(Sj))},[f]),f&&g?.bandwidth!==0)?/*#__PURE__*/n("div",{className:"pointer-events-none absolute inset-0 left-0 top-0 z-[5] h-full w-full overflow-hidden",children:[/*#__PURE__*/r("div",{className:"absolute bottom-5 right-5 h-auto w-auto",children:/*#__PURE__*/r(g9,{className:"p-1 text-xs text-popover-foreground",children:/*#__PURE__*/n("div",{className:"grid grid-cols-[auto_1fr] gap-x-[6px] gap-y-0.5",children:[/*#__PURE__*/r("div",{className:"min-w-0 opacity-60",children:"起始频率"}),/*#__PURE__*/n("div",{children:[g?.startFrequencyFormat,i]}),/*#__PURE__*/r("div",{className:"min-w-0 opacity-60",children:"结束频率"}),/*#__PURE__*/n("div",{children:[g?.endFrequencyFormat,i]}),/*#__PURE__*/r("div",{className:"min-w-0 opacity-60",children:"带宽"}),/*#__PURE__*/r("div",{children:rD(g.bandwidth).formatted}),/*#__PURE__*/r("div",{className:"min-w-0 opacity-60",children:"起始时间"}),/*#__PURE__*/r("div",{children:g?.startTimestamp}),/*#__PURE__*/r("div",{className:"min-w-0 opacity-60",children:"结束时间"}),/*#__PURE__*/r("div",{children:g?.endTimestamp})]})})}),/*#__PURE__*/r(yi,{children:/*#__PURE__*/r("div",{style:{left:`${y?.left}%`,top:`${y?.top}%`,width:`${y?.width}%`,height:`${y?.height}%`},className:"absolute z-[3] border-[2px] border-dashed border-foreground opacity-50"})})]}):null},SZ=SQ,SJ=rl.HeatmapCapture,S0=({id:e})=>{let{state:{heatmapCapture:t,globalID:a,publish:i}}=ae(),{onChange:o,show:l,type:s,display:c}=t,d=m(()=>s===nn.RowIndex&&l&&c,[s,l,c]),[p,f]=b(null),[v,y]=b(null),[w,x]=b(!1),k=u((e,t)=>Math.max(0,Math.min(t-1,Math.ceil((100-e)*t/100)-1)),[]),S=g(null),M=u(e=>{if(!o||!a)return;let{waterfallData:t}=tO(a).getAllRawData();if(t?.length){let r=kn(a),n=r?xy(r,{left:0,top:e.top}):null,i=n?n.rowIndex:k(e.top,t.length),l=t_(a)?.getAllRawData()?.rawData?.waterfallData,s=l?.[i];if(!s)return;let c=s.timestamp,u={data:s,timestamp:c,rowIndex:i};f(u),o(u),t_(a)?.setRealData(u.data)}},[a,o,k,i]);return(h(()=>{if(a&&d)return wU(e,SJ,()=>{x(!0)}),wK(e,SJ,()=>{x(!1),xt(e,SJ)}),wJ(e,SJ,(t,r)=>{w7(e,SJ)&&(y(r),M(r))}),()=>{wU(e,SJ,()=>{}),wK(e,SJ,()=>{}),wJ(e,SJ,()=>{})}},[e,a,d,M]),d)?/*#__PURE__*/r("div",{className:"pointer-events-none absolute left-0 top-0 z-[5] h-full w-full",ref:S,children:v&&p&&/*#__PURE__*/r("div",{className:iX("absolute left-0 h-0 w-full -translate-y-1/2 border-b-2 border-dashed text-xs text-foreground opacity-80",w&&"border-b-[3px] opacity-100"),"data-testid":"heatmap-row-index-line",style:{borderColor:tQ,top:`${v.top}%`},children:/*#__PURE__*/r("div",{className:"absolute left-2 w-max",style:{...(()=>{if(!v)return{};let e=v.top;return e<=10?{top:"0",transform:"translateY(0)"}:e>=90?{bottom:"0",top:"auto",transform:"translateY(0)"}:{top:"50%",transform:"translateY(-50%)"}})()},children:/*#__PURE__*/n(g9,{className:"gap-1 px-2 py-1.5 text-xs",children:[/*#__PURE__*/n("div",{className:"flex items-center justify-between gap-3",children:[/*#__PURE__*/r("span",{className:"text-muted-foreground",children:"行"}),/*#__PURE__*/r("span",{className:"font-medium tabular-nums",children:p.rowIndex})]}),/*#__PURE__*/n("div",{className:"flex items-center justify-between gap-3",children:[/*#__PURE__*/r("span",{className:"text-muted-foreground",children:"时间"}),/*#__PURE__*/r("span",{className:"tabular-nums",children:p.timestamp})]})]})})})}):null},S1=S0,S2=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
3725
3729
|
* @license lucide-react v1.46.0 - ISC
|
|
3726
3730
|
*
|
|
3727
3731
|
* This source code is licensed under the ISC license.
|
|
@@ -3756,12 +3760,12 @@ ${ta(` ${t.systemDark}`,n)}
|
|
|
3756
3760
|
*
|
|
3757
3761
|
* This source code is licensed under the ISC license.
|
|
3758
3762
|
* See the LICENSE file in the root directory of this source tree.
|
|
3759
|
-
*/let Ml={name:"move",size:24,node:[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]};Ml.node;let Ms=Mo(Ml),Mc=e=>e.leftPosition+Math.max(0,e.width)>=-1e-9&&e.leftPosition<=100+1e-9&&e.position+Math.max(0,e.height)>=-1e-9&&e.position<=100+1e-9,Mu={enabled:!0,defaultRect:{position:70,height:30,leftPosition:0,width:100},minSize:0,maxSize:100,snapThreshold:2,onChange:()=>{},onDragEnd:()=>{},preserveDefaultRect:!1,bounds:{bottom:100,left:0,right:100,top:0}},Md=(e,t,r,n,a)=>{let i=n-t,o=Math.max(r,Math.min(e,i)),l=Math.min(a,Math.max(0,(i-r)/2));return o<r+l?r:o>i-l?i:o},Mh=(e={})=>{let{enabled:t,defaultRect:r,minSize:n,minWidth:a,minHeight:i,maxSize:o,snapThreshold:l,onChange:s,onDragEnd:c,preserveDefaultRect:d,bounds:p}={...Mu,...e},f=a??n,m=i??n,[v,y]=b({position:r.position??Mu.defaultRect.position,height:d?r.height??Mu.defaultRect.height:Math.min(r.height??Mu.defaultRect.height,o),leftPosition:r.leftPosition??Mu.defaultRect.leftPosition,width:r.width??Mu.defaultRect.width}),[w,x]=b(!1),[k,S]=b(null),M=g(null),C=g({x:0,y:0,rect:v}),F=g(v);F.current=v,h(()=>{if(!w&&r){let e={position:r.position??v.position,height:void 0!==r.height?d?r.height:Math.min(r.height,o):v.height,leftPosition:r.leftPosition??v.leftPosition,width:r.width??v.width};(Math.abs(e.position-v.position)>.01||Math.abs(e.height-v.height)>.01||Math.abs(e.leftPosition-v.leftPosition)>.01||Math.abs(e.width-v.width)>.01)&&y(e)}},[r?.position,r?.height,r?.leftPosition,r?.width,w,o,d]);let D=u((e,r,n=v)=>{t&&(e.preventDefault(),x(!0),S(r),C.current={x:e.clientX,y:e.clientY,rect:{...n}})},[t,v]),z=u(e=>{if(!w||!M.current)return;let t=M.current,{x:r,y:n,rect:a}=C.current,i=(e.clientY-n)/t.clientHeight*100,c=(e.clientX-r)/t.clientWidth*100,{position:u,height:d,leftPosition:h,width:g}=a;switch(k){case"top":{let e=a.position+a.height;u=Math.max(p.top,Math.min(a.position+i,e-m)),(d=e-u)>o&&(d=o,u=e-o),0!==i&&u<p.top+l&&e-p.top<=o&&(d=e-(u=p.top));break}case"bottom":d=Math.max(m,Math.min(o,a.height+i,p.bottom-a.position)),0!==i&&a.position+d>p.bottom-l&&p.bottom-a.position<=o&&(d=p.bottom-a.position);break;case"left":{let e=a.leftPosition+a.width;h=Math.max(p.left,Math.min(a.leftPosition+c,e-f)),(g=e-h)>o&&(g=o,h=e-o),0!==c&&h<p.left+l&&e-p.left<=o&&(g=e-(h=p.left));break}case"right":g=Math.max(f,Math.min(o,a.width+c,p.right-a.leftPosition)),0!==c&&a.leftPosition+g>p.right-l&&p.right-a.leftPosition<=o&&(g=p.right-a.leftPosition);break;case"middle":0!==i&&(u=Md(a.position+i,a.height,p.top,p.bottom,l)),0!==c&&(h=Md(a.leftPosition+c,a.width,p.left,p.right,l))}let b={position:u,height:d,leftPosition:h,width:g};F.current=b,y(b),s(b)},[w,k,f,m,o,l,p.top,p.bottom,p.left,p.right,s]),N=u(()=>{w&&c(F.current),x(!1),S(null)},[w,c]);h(()=>{if(t&&w)return document.addEventListener("mousemove",z),document.addEventListener("mouseup",N),document.addEventListener("mouseleave",N),window.addEventListener("blur",N),()=>{document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",N),document.removeEventListener("mouseleave",N),window.removeEventListener("blur",N)}},[t,w,z,N]);let E=u(e=>{let t={...v,...e};y(t),s(t)},[v,s]);return{rect:v,isDragging:w,dragType:k,containerRef:M,handleMouseDown:D,resetRect:E,setRect:e=>{y(e),s(e)}}},Mp=4,Mf=14,Mm=10,Mg={bottom:100,left:0,right:100,top:0},Mb="pointer-events-auto absolute z-[2] appearance-none rounded-[3px] border-0 p-0 transition-[background-color,box-shadow] duration-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring [background:var(--mix-foreground-18)] [box-shadow:inset_0_0_0_1px_var(--mix-background-72),0_1px_3px_var(--mix-foreground-28)] hover:[background:var(--mix-foreground-32)] hover:[box-shadow:inset_0_0_0_1px_var(--mix-background-86),0_1px_4px_var(--mix-foreground-42)]",Mv="pointer-events-auto absolute z-[3] flex size-5 -translate-x-1/2 -translate-y-1/2 cursor-move items-center justify-center appearance-none rounded-sm border-0 p-0 text-foreground outline-none transition-[background-color,box-shadow] duration-100 focus-visible:ring-1 focus-visible:ring-ring [background:var(--mix-bg76-fg24)] [box-shadow:0_0_0_1px_var(--mix-background-82),0_1px_4px_var(--mix-foreground-32)] hover:[background:var(--mix-bg64-fg36)]",My=({ariaLabel:e,className:t,direction:n,onMouseDown:a,style:i})=>/*#__PURE__*/r("button",{type:"button",tabIndex:-1,"aria-label":e,className:iX("pointer-events-auto absolute z-[2] appearance-none rounded-[3px] border-0 p-0 transition-[background-color,box-shadow] duration-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring [background:var(--mix-foreground-18)] [box-shadow:inset_0_0_0_1px_var(--mix-background-72),0_1px_3px_var(--mix-foreground-28)] hover:[background:var(--mix-foreground-32)] hover:[box-shadow:inset_0_0_0_1px_var(--mix-background-86),0_1px_4px_var(--mix-foreground-42)]",t),style:i,onMouseDown:a,children:/*#__PURE__*/r("span",{"aria-hidden":"true",className:iX("pointer-events-none absolute left-1/2 top-1/2 rounded-full bg-foreground/85","horizontal"===n?"h-[2px] -translate-x-1/2 -translate-y-1/2":"w-[2px] -translate-x-1/2 -translate-y-1/2"),style:"horizontal"===n?{width:"clamp(10px, 18%, 24px)"}:{height:"clamp(10px, 18%, 24px)"}})}),Mw=(e,t,r)=>Math.min(Math.max(e,t),r),Mx=e=>"string"==typeof e||"number"==typeof e,Mk=e=>{if(!e)return e;let t={...e};return Mx(t.left)&&Mx(t.right)&&String(t.left)===String(t.right)&&(t.right=void 0),Mx(t.top)&&Mx(t.bottom)&&String(t.top)===String(t.bottom)&&(t.top=void 0),t},MS=({start:e,length:t,minLength:r,maxLength:n})=>{let a=Math.max(0,t),i=Math.min(Math.max(a,r),n),o=e+a/2,l=o-i/2,s=o+i/2;l<0&&(s=Math.min(n,s-l),l=0),s>n&&(l=Math.max(0,l-(s-n)),s=n);let c=s-l;return{start:l,end:s,length:c}},MM=({start:e,length:t,minLength:r})=>{let n=Math.max(0,t),a=Math.max(n,r),i=e+n/2-a/2;return{start:i,end:i+a,length:a}},MC=({rect:e,containerWidth:t,containerHeight:r,variant:n="contained"})=>{let a=e.leftPosition/100*t,i=e.position/100*r,o=e.width/100*t,l=e.height/100*r;if("projected"===n){let e=MM({start:a,length:o,minLength:14}),t=MM({start:i,length:l,minLength:14});return{left:e.start,top:t.start,width:e.length,height:t.length,right:e.end,bottom:t.end,centerX:e.start+e.length/2,centerY:t.start+t.length/2}}let s=MS({start:a,length:o,minLength:14,maxLength:t}),c=MS({start:i,length:l,minLength:14,maxLength:r});return{left:s.start,top:c.start,width:s.length,height:c.length,right:s.end,bottom:c.end,centerX:s.start+s.length/2,centerY:c.start+c.length/2}},MF=(e,t)=>Math.max(0,Math.min(e.left+e.width,t.left+t.width)-Math.max(e.left,t.left))*Math.max(0,Math.min(e.top+e.height,t.top+t.height)-Math.max(e.top,t.top)),MD=(e,t)=>Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(r=>{let n=e[r],a=t[r];return n&&a&&.5>Math.abs(n.left-a.left)&&.5>Math.abs(n.top-a.top)}),Mz=({left:e,top:t,size:r,containerWidth:n,containerHeight:a,score:i})=>{let o=Math.max(0,n-r.width),l=Math.max(0,a-r.height),s=Mw(e,0,o),c=Mw(t,0,l),u=Math.abs(s-e)+Math.abs(c-t);return{left:s,top:c,width:r.width,height:r.height,score:i+2*u}},MN=({key:e,size:t,rectBox:r,containerWidth:n,containerHeight:a})=>{let i=[],o="middle"===e&&(r.width<=t.width+8||r.height<=t.height+8),l=(e,r,o)=>{i.push(Mz({left:e,top:r,size:t,containerWidth:n,containerHeight:a,score:o}))},s=r.left-t.width-4,c=r.right+4,u=r.top-t.height-4,d=r.bottom+4,h=r.left+4,p=r.right-t.width-4,f=r.top+4,m=r.bottom-t.height-4,g=r.centerX-t.width/2,b=r.centerY-t.height/2;switch(e){case"left":l(s,b,0),l(h,b,6),l(s,r.top,10),l(s,r.bottom-t.height,11),l(h,r.top,16),l(h,r.bottom-t.height,17),l(r.left,u,22),l(r.left,d,24);break;case"right":l(c,b,0),l(p,b,6),l(c,r.top,10),l(c,r.bottom-t.height,11),l(p,r.top,16),l(p,r.bottom-t.height,17),l(r.right-t.width,u,22),l(r.right-t.width,d,24);break;case"top":l(g,u,0),l(g,f,6),l(r.left,u,10),l(r.right-t.width,u,11),l(r.left+4,f,16),l(r.right-t.width-4,f,17),l(s,r.top,24),l(c,r.top,25);break;case"bottom":l(g,d,0),l(g,m,6),l(r.left,d,10),l(r.right-t.width,d,11),l(r.left+4,m,16),l(r.right-t.width-4,m,17),l(s,r.bottom-t.height,24),l(c,r.bottom-t.height,25);break;case"middle":o?(l(g,u,0),l(g,d,1),l(c,b,2),l(s,b,3),l(c,u,4),l(c,d,5),l(s,u,6),l(s,d,7),l(g,b,12)):(l(g,b,0),l(g,u,8),l(g,d,9),l(c,b,10),l(s,b,11),l(r.left,u,14),l(r.right-t.width,u,15),l(r.left,d,16),l(r.right-t.width,d,17))}return i},ME=({enabled:e,defaultRect:a,minSize:i=0,minWidth:o,minHeight:l,maxSize:s=100,snapThreshold:c=2,onChange:u,onDragStart:d,onDragEnd:p,children:v,labels:y,className:w="",zIndex:x=7,showBoundaryLines:k=!1,variant:S="contained",interactionBounds:M=Mg})=>{let C=m(()=>Mk(y),[y?.top,y?.bottom,y?.left,y?.right]),{rect:F,containerRef:D,handleMouseDown:z}=Mh({enabled:e,defaultRect:a,minSize:i,minWidth:o,minHeight:l,maxSize:"projected"===S?Math.max(s,M.right-M.left,M.bottom-M.top):s,snapThreshold:c,onChange:u,onDragEnd:p,preserveDefaultRect:"projected"===S,bounds:M}),N=F.leftPosition+Math.max(0,F.width),E=F.position+Math.max(0,F.height),T="projected"!==S||Mc(F),R=Mw(F.leftPosition,0,100),A=Mw(N,0,100),I=Mw(F.position,0,100),P=Mw(E,0,100),L=A>=R,O=P>=I,q="projected"===S&&(F.leftPosition<Mg.left||N>Mg.right||F.position<Mg.top||E>Mg.bottom),$={left:(R+A)/2,top:(I+P)/2},[_,j]=b(0),[H,B]=b({width:0,height:0}),[W,G]=b({}),Y=g(null),U=g(null),X=g(null),K=g(null),V=g(null);h(()=>{if(!e||!T||"u"<typeof ResizeObserver)return;let t=new ResizeObserver(()=>{j(e=>e+1)});return[D.current,Y.current,U.current,X.current,K.current,V.current].filter(e=>null!==e).forEach(e=>{t.observe(e)}),()=>t.disconnect()},[e,T,!!C?.top,!!C?.bottom,!!C?.left,!!C?.right,!!v]),f(()=>{let t=D.current;if(!e||!T||!t)return void G(e=>Object.keys(e).length>0?{}:e);let r=t.clientWidth,n=t.clientHeight;if(r<=0||n<=0)return;B(e=>e.width===r&&e.height===n?e:{width:r,height:n});let a=[["top",Y.current],["bottom",U.current],["left",X.current],["right",K.current],["middle",V.current]].reduce((e,[t,r])=>(r&&(e[t]={width:r.offsetWidth,height:r.offsetHeight}),e),{}),i=MC({rect:F,containerWidth:r,containerHeight:n,variant:S}),o={middle:4,bottom:3,left:2,right:2,top:1},l=["top","bottom","left","right","middle"].filter(e=>a[e]).sort((e,t)=>{let r=o[t]-o[e];if(0!==r)return r;let n=(a[e]?.width??0)*(a[e]?.height??0);return(a[t]?.width??0)*(a[t]?.height??0)-n}),s=[],c={};l.forEach(e=>{let t=a[e];if(!t)return;let o=MN({key:e,size:t,rectBox:i,containerWidth:r,containerHeight:n}).map(e=>{let t=s.reduce((t,r)=>t+MF(e,r),0),r=e.score+(t>0?2e4+10*t:0),n=Math.max(1,e.width*e.height);return{...e,overlapArea:t,overlapRatio:t/n,totalScore:r}}),l=o.filter(e=>0===e.overlapArea).sort((e,t)=>e.totalScore-t.totalScore)[0]??null??o.sort((e,t)=>e.totalScore-t.totalScore)[0]??null;!l||"middle"!==e&&l.overlapRatio>.2||(c[e]={left:l.left,top:l.top},s.push(l))}),G(e=>MD(e,c)?e:c)},[e,T,F.position,F.height,F.leftPosition,F.width,_,!!C?.top,!!C?.bottom,!!C?.left,!!C?.right,!!v,S]);let Q={fontSize:"var(--size-font-second)",color:"var(--foreground)",border:"1px solid var(--border)",borderRadius:"var(--radius-control)",background:"var(--mix-background-80)"},Z=e=>{let t=W[e];return{left:t?.left??0,top:t?.top??0,visibility:t?"visible":"hidden"}},J=m(()=>H.width<=0||H.height<=0?null:MC({rect:F,containerWidth:H.width,containerHeight:H.height,variant:S}),[F.position,F.height,F.leftPosition,F.width,H.width,H.height,S]),ee=J?Math.max(0,Math.min(6,J.width/4)):6,et=J?Math.max(0,Math.min(6,J.height/4)):6,er=J?{top:J.top,height:J.height,left:J.left,width:J.width}:{top:`${F.position}%`,height:`${F.height}%`,left:`${F.leftPosition}%`,width:`${F.width}%`},en=e=>{let t={...F};switch(e){case"top":F.position<Mg.top&&(t.position=Mg.top,t.height=Math.max(0,F.position+F.height-Mg.top));break;case"bottom":E>Mg.bottom&&(t.height=Math.max(0,Mg.bottom-F.position));break;case"left":F.leftPosition<Mg.left&&(t.leftPosition=Mg.left,t.width=Math.max(0,N-Mg.left));break;case"right":N>Mg.right&&(t.width=Math.max(0,Mg.right-F.leftPosition))}return t},ea=(e,t,r)=>{d?.(t)!==!1&&(e.preventDefault(),e.stopPropagation(),z(e,t,r))};return e?/*#__PURE__*/n("div",{className:iX("pointer-events-none absolute left-0 top-0 h-full w-full select-none overflow-hidden bg-transparent",w),ref:D,style:{zIndex:x},children:[k&&/*#__PURE__*/n(t,{children:[/*#__PURE__*/r("div",{className:"pointer-events-none absolute left-0 right-0 top-0 h-px bg-border"}),/*#__PURE__*/r("div",{className:"pointer-events-none absolute bottom-0 left-0 right-0 h-px bg-border"}),/*#__PURE__*/r("div",{className:"pointer-events-none absolute bottom-0 left-0 top-0 w-px bg-border"}),/*#__PURE__*/r("div",{className:"pointer-events-none absolute bottom-0 right-0 top-0 w-px bg-border"})]}),T&&/*#__PURE__*/n("div",{className:"group pointer-events-none absolute box-border",style:er,children:[/*#__PURE__*/r("div",{className:"pointer-events-none absolute inset-0 border-[2px] border-dashed border-foreground group-hover:border-[4px]"}),/*#__PURE__*/r("div",{className:"pointer-events-auto absolute left-0 w-full cursor-ns-resize [background:var(--mix-secondary-15)] hover:[background:var(--mix-secondary-40)]",style:{top:-5,height:10},onMouseDown:e=>ea(e,"top")}),/*#__PURE__*/r("div",{className:"pointer-events-auto absolute left-0 w-full cursor-ns-resize [background:var(--mix-secondary-15)] hover:[background:var(--mix-secondary-40)]",style:{bottom:-5,height:10},onMouseDown:e=>ea(e,"bottom")}),/*#__PURE__*/r("div",{className:"pointer-events-auto absolute top-0 h-full cursor-ew-resize [background:var(--mix-secondary-15)] hover:[background:var(--mix-secondary-40)]",style:{left:-5,width:10},onMouseDown:e=>ea(e,"left")}),/*#__PURE__*/r("div",{className:"pointer-events-auto absolute top-0 h-full cursor-ew-resize [background:var(--mix-secondary-15)] hover:[background:var(--mix-secondary-40)]",style:{right:-5,width:10},onMouseDown:e=>ea(e,"right")}),!q&&/*#__PURE__*/r("div",{className:"pointer-events-auto absolute cursor-move [background:var(--mix-secondary-15)] hover:[background:var(--mix-secondary-20)]",style:{top:et,bottom:et,left:ee,right:ee},onMouseDown:e=>ea(e,"middle")})]}),q&&T&&L&&O&&/*#__PURE__*/r("button",{type:"button",tabIndex:-1,"aria-label":"移动框选范围",title:"移动框选范围",className:"pointer-events-auto absolute z-[3] flex size-5 -translate-x-1/2 -translate-y-1/2 cursor-move items-center justify-center appearance-none rounded-sm border-0 p-0 text-foreground outline-none transition-[background-color,box-shadow] duration-100 focus-visible:ring-1 focus-visible:ring-ring [background:var(--mix-bg76-fg24)] [box-shadow:0_0_0_1px_var(--mix-background-82),0_1px_4px_var(--mix-foreground-32)] hover:[background:var(--mix-bg64-fg36)]",style:{left:`clamp(10px, ${$.left}%, calc(100% - 10px))`,top:`clamp(10px, ${$.top}%, calc(100% - 10px))`},onMouseDown:e=>ea(e,"middle"),children:/*#__PURE__*/r(Ms,{"aria-hidden":"true",className:"pointer-events-none size-3",strokeWidth:1.75})}),"projected"===S&&T&&/*#__PURE__*/n(t,{children:[F.position<0&&L&&/*#__PURE__*/r(My,{ariaLabel:"调整框选上边界",direction:"horizontal",className:"top-0 h-[10px] cursor-ns-resize",style:{left:`${R}%`,minWidth:10,width:`${A-R}%`},onMouseDown:e=>ea(e,"top",en("top"))}),E>100&&L&&/*#__PURE__*/r(My,{ariaLabel:"调整框选下边界",direction:"horizontal",className:"bottom-0 h-[10px] cursor-ns-resize",style:{left:`${R}%`,minWidth:10,width:`${A-R}%`},onMouseDown:e=>ea(e,"bottom",en("bottom"))}),F.leftPosition<0&&O&&/*#__PURE__*/r(My,{ariaLabel:"调整框选左边界",direction:"vertical",className:"left-0 w-[10px] cursor-ew-resize",style:{height:`${P-I}%`,minHeight:10,top:`${I}%`},onMouseDown:e=>ea(e,"left",en("left"))}),N>100&&O&&/*#__PURE__*/r(My,{ariaLabel:"调整框选右边界",direction:"vertical",className:"right-0 w-[10px] cursor-ew-resize",style:{height:`${P-I}%`,minHeight:10,top:`${I}%`},onMouseDown:e=>ea(e,"right",en("right"))})]}),T&&v&&/*#__PURE__*/r("div",{ref:V,className:"pointer-events-none absolute",style:Z("middle"),children:/*#__PURE__*/r("div",{className:"flex items-start gap-0.5 whitespace-nowrap p-[var(--size-gap-base)]",style:{fontSize:"var(--size-font-second)",color:"var(--foreground)",border:"1px solid var(--border)",borderRadius:"var(--radius-control)",background:"var(--mix-secondary-80)"},children:v})}),T&&C?.left&&/*#__PURE__*/r("div",{ref:X,className:"pointer-events-none absolute whitespace-nowrap p-[calc(var(--size-gap-base)/2)]",style:{...Q,...Z("left")},children:C.left}),T&&C?.right&&/*#__PURE__*/r("div",{ref:K,className:"pointer-events-none absolute whitespace-nowrap p-[calc(var(--size-gap-base)/2)]",style:{...Q,...Z("right")},children:C.right}),T&&C?.top&&/*#__PURE__*/r("div",{ref:Y,className:"pointer-events-none absolute whitespace-nowrap p-[calc(var(--size-gap-base)/2)]",style:{...Q,...Z("top")},children:C.top}),T&&C?.bottom&&/*#__PURE__*/r("div",{ref:U,className:"pointer-events-none absolute whitespace-nowrap p-[calc(var(--size-gap-base)/2)]",style:{...Q,...Z("bottom")},children:C.bottom})]}):null},MT=ME,MR=1e6,MA=(e,t,r)=>Math.min(r,Math.max(t,e)),MI=e=>{if(!e)return null;let t=Number(e(0)),r=Number(e(100));return Number.isFinite(t)&&Number.isFinite(r)&&t!==r?[t,r]:null},MP=(e,t,r)=>{if(!t?.length)return null;let n=100*MA(e,0,1),a=t.length-1;for(let e=0;e<t.length;e+=1){let i=t[e],o=Math.min(i.progress[0],i.progress[1]),l=Math.max(i.progress[0],i.progress[1]);if(!("start"===r?n>=o&&(n<l||e===a&&n<=l):(n>o||0===e)&&n<=l))continue;let s=l-o,c=s?(n-o)/s:0;return i.start+(i.stop-i.start)*c}return null},ML=(e,t,r,n)=>{let a=r?.(100*MA(e,0,1)),i=void 0===a?0/0:Number(a);return Number.isFinite(i)?i:MP(e,t,n)},MO=(e,t,r)=>{if(t?.length){let r=null;for(let n of t){let t=n.start,a=n.stop,i=Math.min(t,a),o=Math.max(t,a),l=n.progress[0]/100,s=n.progress[1]/100;if(e>=i&&e<=o){let r=a-t;return MA(l+(s-l)*(r?(e-t)/r:0),0,1)}for(let n of[{distance:Math.abs(e-t),ratio:l},{distance:Math.abs(e-a),ratio:s}])(!r||n.distance<r.distance)&&(r=n)}if(r)return MA(r.ratio,0,1)}let n=MI(r);return n?MA((e-n[0])/(n[1]-n[0]),0,1):null},Mq=({frequencyFormat:e,frequencyRange:t,segments:r})=>{let n=MO(t[0],r,e),a=MO(t[1],r,e);return null===n||null===a?null:[Math.min(n,a),Math.max(n,a)]},M$=(e,t,r)=>{let n=ML(e[0],t,r,"start"),a=ML(e[1],t,r,"end");return null===n||null===a?null:[Math.min(n,a),Math.max(n,a)]},M_=({frequencyFormat:e,rect:t,segments:r,waterfallSnapshot:n})=>{let a=xC(n,{startLeft:t.leftPosition,endLeft:t.leftPosition+t.width,startTop:t.position+t.height,endTop:t.position});if(!a||n.sourceSize.width<=0)return null;let i=[a.x[0]/n.sourceSize.width,a.x[1]/n.sourceSize.width];return{frequency:M$(i,r,e),x:i,y:a.y}},Mj=({dragType:e,frequencyFormat:t,rect:r,segments:n,startSelection:a,waterfallSnapshot:i})=>{let o=M_({frequencyFormat:t,rect:r,segments:n,waterfallSnapshot:i});if(!o||!a)return o;switch(e){case"left":return{frequency:o.frequency&&a.frequency?[o.frequency[0],a.frequency[1]]:o.frequency,x:[o.x[0],a.x[1]],y:a.y};case"right":return{frequency:o.frequency&&a.frequency?[a.frequency[0],o.frequency[1]]:o.frequency,x:[a.x[0],o.x[1]],y:a.y};case"top":return{frequency:a.frequency,x:a.x,y:[a.y[0],o.y[1]]};case"bottom":return{frequency:a.frequency,x:a.x,y:[o.y[0],a.y[1]]};case"middle":return o}},MH=({selection:e,waterfallSnapshot:t})=>{let{sourceSize:r}=t;if(r.width<=0||r.height<=0)return null;let n=MA(Math.min(e.x[0],e.x[1]),0,1),a=MA(Math.max(e.x[0],e.x[1]),n,1),i=MA(Math.min(e.y[0],e.y[1]),0,r.height),o=MA(Math.max(e.y[0],e.y[1]),i,r.height);return{x:[n*r.width,a*r.width],y:[i,o]}},MB=({formatBandwidth:e,frequencyFormat:t,heatmapData:r,rect:n,segments:a,selectionOverride:i,sourceRangeOverride:o,waterfallSnapshot:l})=>{let s=r.length;if(s<=0)return null;let{position:c,height:u,leftPosition:d,width:h}=n,p=l&&i?MH({selection:i,waterfallSnapshot:l}):null,f=o??(l&&p?xD(l,p):null)??(l?xF(l,{startLeft:d,endLeft:d+h,startTop:c+u,endTop:c}):null),m=f??x4(c+u,c,s);if(!m)return null;let{startIndex:g,endIndex:b}=m,v=String(r[g]?.timestamp??""),y=String(r[b]?.timestamp??""),w=rK(v),x=rK(y),k=w>0&&x>0?Math.abs(x-w):0,S=f??x3(d,d+h,x1(r).columnCount);if(!S)return null;let{startCol:M,endCol:C}=S,F=l?.sourceSize.width??0,D=M$([(i?100*i.x[0]:o&&F>0?100*M/F:l?xv(d,l):d)/100,(i?100*i.x[1]:o&&F>0?(C+1)*100/F:l?xv(d+h,l):d+h)/100],a,t),z=i?.frequency?.[0]??D?.[0],N=i?.frequency?.[1]??D?.[1],E=Number.isFinite(z)?Math.round(1e6*Number(z))/1e6:0,T=Number.isFinite(N)?Math.round(1e6*Number(N))/1e6:0,R=Math.abs(T-E);return{startIndex:g,endIndex:b,startTimestamp:v,endTimestamp:y,duration:k,startCol:M,endCol:C,startFrequency:E,startFrequencyFormat:String(E),endFrequency:T,endFrequencyFormat:String(T),bandwidth:R,bandwidthFormat:e(R)}},MW=30,MG=70,MY=100,MU=0,MX=2,MK={position:MG,height:30,leftPosition:0,width:100},MV=(e,t)=>.01>=Math.abs(e.position-t.position)&&.01>=Math.abs(e.height-t.height)&&.01>=Math.abs(e.leftPosition-t.leftPosition)&&.01>=Math.abs(e.width-t.width),MQ=(e,t)=>.01>=Math.abs(e.top-t.top)&&.01>=Math.abs(e.bottom-t.bottom)&&.01>=Math.abs(e.left-t.left)&&.01>=Math.abs(e.right-t.right),MZ=(e,t)=>e.startIndex===t.startIndex&&e.endIndex===t.endIndex&&e.startTimestamp===t.startTimestamp&&e.endTimestamp===t.endTimestamp&&e.duration===t.duration&&e.startCol===t.startCol&&e.endCol===t.endCol&&e.startFrequency===t.startFrequency&&e.startFrequencyFormat===t.startFrequencyFormat&&e.endFrequency===t.endFrequency&&e.endFrequencyFormat===t.endFrequencyFormat&&e.bandwidth===t.bandwidth&&e.bandwidthFormat===t.bandwidthFormat,MJ=({id:e})=>{let{state:{globalID:t,heatmapCapture:{type:r,show:a,display:i,interval:o,onChange:l},axisX:{frequencyFormat:s,unit:c},segments:d}}=ae(),p=m(()=>r===nn.Slider&&a&&i,[r,a,i]),[f,v]=b(),y=g(void 0),w=g(null),[x,k]=b(MK),[S,M]=b(),C=g(x),F=g(null),D=g(null),z=g(null),N=g(null),E=g(s),T=g(d);E.current=s,T.current=d;let R=u(e=>{C.current=e,k(t=>MV(t,e)?t:e)},[]),A=u(e=>{M(t=>t&&e?MQ(t,e)?t:e:t===e?t:e)},[]),I=u(e=>{let r=kn(t),n=F.current,a=r&&n?MH({selection:n,waterfallSnapshot:r}):null;SX(t,p&&e&&a?a:null)},[p,t]),P=u((e,r)=>{y.current=e,v(e),I(e),r&&(w.current=kn(t)?.rawData??null,l?.(e))},[t,l,I]);h(()=>{if(t)return I(p?y.current??null:null),()=>SX(t,null)},[p,t,I]);let L=u(()=>{let e=tO(t).getAllRawData().waterfallData??[];return[e,e.length]},[t]),O=u((e,r)=>{let[n]=L();return MB({formatBandwidth:rm,frequencyFormat:E.current,heatmapData:n,rect:e,segments:T.current,selectionOverride:r,waterfallSnapshot:kn(t)})},[L,t]),q=u((e,r)=>{let n=kn(t);if(!n)return null;let a=r?Mj({dragType:r,frequencyFormat:E.current,rect:e,segments:T.current,startSelection:D.current,waterfallSnapshot:n}):M_({frequencyFormat:E.current,rect:e,segments:T.current,waterfallSnapshot:n});return a&&(F.current=a),a},[t]),[$,_]=b(0);h(()=>{if(e&&t&&p)return tq(e,"Slider",()=>_(e=>e+1))},[e,t,p]);let j=u(e=>{let t=z.current;if(t&&MV(t,e))return;R(e);let r=q(e,N.current),n=O(e,r??void 0);n&&P(n,!1)},[O,R,P,q]),H=u(t=>{let r=w7(e,rl.HeatmapCapture);return!1!==r&&(N.current=t,D.current=F.current,z.current=C.current,r)},[e]),B=u(()=>{N.current=null,D.current=null,z.current=null,wK(wW(e))(),xt(e,rl.HeatmapCapture)},[e]),W=u(e=>{try{let t=F.current??q(e,null),r=O(e,t??void 0);r&&P(r,!0)}finally{B()}},[O,B,P,q]);h(()=>B,[p,B]);let G=u(e=>{let{startIndex:r,endIndex:n,startFrequency:a,endFrequency:i}=e,[o,l]=L(),c=kn(t),u=y.current,d=r===u?.startIndex&&n===u.endIndex,h=F.current?.frequency,p=void 0===a||void 0===i||1e-7>=Math.abs(Math.min(a,i)-(h?.[0]??0/0))&&1e-7>=Math.abs(Math.max(a,i)-(h?.[1]??0/0));if(d&&p)return;let f=C.current;if(c){let{sourceSize:e}=c;if(e.width<=0||e.height<=0)return;let t=l>0&&r>=0&&n<l&&n-r>=Math.ceil(0*l/100),o=F.current??M_({frequencyFormat:E.current,rect:f,segments:T.current,waterfallSnapshot:c}),s=void 0!==a&&void 0!==i?[Math.min(a,i),Math.max(a,i)]:null,d=s?Mq({frequencyFormat:E.current,frequencyRange:s,segments:T.current}):null;if(s&&!d)return;let h={frequency:s??o?.frequency??null,x:d??o?.x??[c.range.x[0]/e.width,c.range.x[1]/e.width],y:t?[Math.min(r,n),Math.max(r,n)+1]:o?.y??[u?.startIndex??c.range.y[0],(u?.endIndex??c.range.y[1]-1)+1]},p=MH({selection:h,waterfallSnapshot:c});if(!p)return;let m=xS(c,p);if(!m)return;F.current=h,R(m);let g=O(m,h);g&&P(g,!0);return}let m=!d&&l>0&&r>=0&&n<l&&n-r>=Math.ceil(0*l/100),g=!1,b=f.leftPosition,v=f.width;if(void 0!==a&&void 0!==i&&s){let e=s(0),t=s(100),r=e?Number(e):0,n=(t?Number(t):0)-r;if(n>0){let e=(a-r)/n*100,t=(i-r)/n*100,o=t-e;e>=0&&t<=100&&o>=0&&(Math.abs(e-f.leftPosition)>.01||Math.abs(o-f.width)>.01)&&(g=!0,b=e,v=o)}}if(!m&&!g)return;let w={position:m?(1-n/l)*100:f.position,height:m?(n-r)/l*100:f.height,leftPosition:b,width:v};R(w);let x=O(w);x&&P(x,!0)},[L,t,s,O,R,P]);return(h(()=>{o&&p&&G(o)},[o?.startIndex,o?.endIndex,o?.startFrequency,o?.endFrequency,p,$,G]),h(()=>{if(!p||!t)return;let e=kn(t),r=y.current;if(e?.sourceSize.width&&e.sourceSize.height){let t=xk(e,{endCol:e.sourceSize.width-1,endIndex:e.sourceSize.height-1,startCol:0,startIndex:0});A(t?{bottom:t.position+t.height,left:t.leftPosition,right:t.leftPosition+t.width,top:t.position}:void 0)}else A(void 0);if(!e){let e=O(C.current);e&&P(e,!0);return}let n=F.current??M_({frequencyFormat:E.current,rect:C.current,segments:T.current,waterfallSnapshot:e});if(!n)return;if(n.frequency){let e=Mq({frequencyFormat:E.current,frequencyRange:n.frequency,segments:T.current});e&&(n={...n,x:e})}F.current=n;let a=MH({selection:n,waterfallSnapshot:e});if(!a)return;let i=xS(e,a);i&&R(i);let o=O(i??C.current,n);if(!o)return;let l=!r||!MZ(o,r),s=w.current!==e.rawData;(l||s)&&P(o,!0)},[$,s,d,p,t,O,R,A,P]),h(()=>{t&&SB(t,e=>{e.interval&&p&&G(e.interval)})},[t,p,G]),p)?/*#__PURE__*/n(ME,{enabled:p,defaultRect:x,minSize:0,maxSize:100,snapThreshold:2,onChange:j,onDragStart:H,onDragEnd:W,zIndex:5,showBoundaryLines:!0,variant:"projected",interactionBounds:S,labels:{left:f?.startFrequencyFormat?`${f.startFrequencyFormat}${c}`:"",right:f?.endFrequencyFormat?`${f.endFrequencyFormat}${c}`:"",top:f?.endTimestamp,bottom:f?.startTimestamp},children:[/*#__PURE__*/n("div",{children:["带宽:",f?.bandwidth!==void 0?rF(1e3*f.bandwidth).formatted:""]}),/*#__PURE__*/n("div",{children:["时长:",f?.duration!==void 0?(f.duration/1e3).toFixed(3):"","s"]})]}):null},M0=MJ,M1=e=>{let{state:{heatmapCapture:t}}=ae(),{show:n,type:a}=t;return n?a===nn.Slider?/*#__PURE__*/r(MJ,{...e}):a===nn.RowIndex?/*#__PURE__*/r(S0,{...e}):/*#__PURE__*/r(SQ,{...e}):null},M2=M1;class M5 extends vH{lastSeriesData=[];constructor(e){super({id:e.id,globalID:e.globalID,chart:null,realRange:e.realRange??ns,heatmapDefaultData:e.heatmapDefaultData??[],renderer:e.renderer})}init(){let{id:e}=this.state;e&&(this.state.chart=new C({id:e,colors:this.getInitialColors(),renderer:this.state.renderer}),this.subscribeToColor("Heatmap-Render"),this.updateSeries(this.state.heatmapDefaultData),this.setRange())}updateSeries(e){Array.isArray(e)&&(this.lastSeriesData=e,this.state.chart?.render(e))}supportsIncrementalWaterfall(){let{chart:e}=this.state;return"function"==typeof e?.append&&"function"==typeof e.replace}appendWaterfallFrame(e,t){this.state.chart?.append&&(this.lastSeriesData=[],this.state.chart.append(e,t))}replaceWaterfallFrames(e,t){this.state.chart?.replace&&(this.lastSeriesData=[],this.state.chart.replace(e,t))}resetWaterfall(){this.lastSeriesData=[],this.state.chart?.clear()}updateParams(e){let t=this.state.realRange,r=this.state.heatmapDefaultData;super.updateParams(e),e.heatmapDefaultData&&e.heatmapDefaultData!==r&&this.updateSeries(e.heatmapDefaultData),e.realRange&&(e.realRange[0]!==t[0]||e.realRange[1]!==t[1])&&this.setRange(e.realRange)}setRange(e=this.state.realRange){let{chart:t}=this.state,[r,n]=e;e&&void 0!==r&&void 0!==n&&t&&(this.state.realRange=e,t.setRange(e))}reset(){this.lastSeriesData=[],this.clear(),this.resize()}resize(){this.setRange(),this.state.chart?.resize(),this.lastSeriesData.length>0&&this.state.chart?.render(this.lastSeriesData)}}let M4=rl.Zoom;function M3(e,t){let r=at(e=>e.globalID),n=g(null);h(()=>{if(!t||!e||!r)return;let a=e=>{let t=tj(r),a=t?.getSnapshot();if(!a?.sourceSize.width||!a.sourceSize.height||"number"!=typeof e.left||"number"!=typeof e.top){n.current=null;return}n.current={start:{left:e.left,top:e.top},viewport:{range:a.range,sourceSize:a.sourceSize}}},i=wU(e,M4,a),o=wZ(e,M4,(e,t)=>{let n=tj(r),a=n?.getSnapshot();if(!n||!a?.sourceSize.width||!a.sourceSize.height||"number"!=typeof t.left||"number"!=typeof t.top)return;let i=xN(a,e,{left:t.left,top:t.top});xV(a,i)||n.updateSamplingRange(xK(i))}),l=wX(e,M4,()=>{if(!w7(e,M4))return!1;let t=ka(r);return xt(e,M4),t}),s=wJ(e,M4,(t,i,o,l)=>{if(l||!t||!i||"number"!=typeof t.left||"number"!=typeof t.top||"number"!=typeof i.left||"number"!=typeof i.top||!w7(e,M4))return;let s=tj(r),c=s?.getSnapshot();if(!s||!c?.sourceSize.width||!c.sourceSize.height)return;n.current||a(t);let u=n.current;if(!u)return;if(u.viewport.sourceSize.width!==c.sourceSize.width||u.viewport.sourceSize.height!==c.sourceSize.height){n.current=null;return}let d=xX(u.viewport,u.start,{left:i.left,top:i.top});xV(c,d)||s.updateSamplingRange(xK(d))}),c=()=>{n.current=null,xt(e,M4)},u=wK(e,M4,c),d=wV(e,M4,c);return()=>{i?.(),o?.(),l?.(),s?.(),u?.(),d?.(),c()}},[t,r,e])}let M6=e=>{let{heatmapDefaultData:t,onSubscriptionReadyChange:a,overview:i,zoomMode:o="disabled",renderer:l}=e,s="independent-xy"===o,c=g(a);c.current=a;let{state:{axisY:{realRange:d},globalID:p}}=ae(),{id:f,chart:b,Chart:v}=iV({Render:M5,params:{realRange:d,heatmapDefaultData:t,globalID:p,renderer:l}}),y=m(()=>{let e=wW(f);return rB((t,r)=>{wZ(e)(t,r)})},[f]),w=u(e=>{e.stopPropagation(),y(-1*e.deltaY,wB(e))},[y]);return S$(f,rr.Heatmap,"linked-x"===o),M3(f,s),i3({moduleType:rr.Heatmap,chart:b,handleRender:(e,t)=>{t.updateSeries?.(e.data),tq(f)()},eventHandlers:{[rn.Option]:e=>{e.key===ra.HeatmapCapture&&SB(p)(e.data)}}}),h(()=>{if(!b||!p||s||!b.supportsIncrementalWaterfall())return;let e=t_(p);if(!e?.setWaterfallSink)return;let t=tq(f);return e.setWaterfallSink({append:(e,r)=>{b.appendWaterfallFrame?.(e,r),t()},replace:(e,r)=>{b.replaceWaterfallFrames?.(e,r),t()},reset:()=>{b.resetWaterfall?.(),t()}}),()=>{t_(p)===e&&e.setWaterfallSink(null)}},[b,p,f,s]),h(()=>{if(b&&p)return c.current?.(!0),()=>{c.current?.(!1)}},[b,p]),/*#__PURE__*/n(yE,{children:[/*#__PURE__*/r(wL,{id:f,chart:b}),/*#__PURE__*/n(ST,{onWheelCapture:s?w:void 0,children:[/*#__PURE__*/r(Sz,{}),/*#__PURE__*/r(v,{}),/*#__PURE__*/r(SF,{id:f}),/*#__PURE__*/r(M1,{id:f}),/*#__PURE__*/r(Sk,{id:f,type:rr.Heatmap}),i]})]})},M8=M6,M9=[{r:0,g:0,b:0,a:1},{r:0,g:0,b:255,a:1},{r:0,g:188,b:212,a:1},{r:45,g:179,b:51,a:1},{r:255,g:235,b:59,a:1},{r:255,g:0,b:0,a:1}],M7={selectionFill:"rgba(255, 210, 64, 0.08)",selectionStroke:"rgba(255, 210, 64, 0.95)",shadow:"rgba(0, 0, 0, 0.8)",viewportFill:"rgba(255, 255, 255, 0.14)",viewportStroke:"rgba(255, 255, 255, 0.95)"},Ce=256,Ct=1024,Cr=2,Cn=(e,t,r)=>Math.min(r,Math.max(t,e)),Ca=(e,t,r,n)=>{let a=Cn(n,0,1)*(r.length-1),i=Math.floor(a),o=Math.min(i+1,r.length-1),l=a-i,s=r[i],c=r[o];e[t]=Math.round(s.r+(c.r-s.r)*l),e[t+1]=Math.round(s.g+(c.g-s.g)*l),e[t+2]=Math.round(s.b+(c.b-s.b)*l),e[t+3]=Math.round(255*Cn(s.a+(c.a-s.a)*l,0,1))},Ci=e=>{if(!Array.isArray(e)||e.length<2)return null;let t=[];for(let r of e){if(!r||"object"!=typeof r||!("r"in r)||!("g"in r)||!("b"in r))return null;let{r:e,g:n,b:a}=r,i="a"in r?r.a:1;if("number"!=typeof e||"number"!=typeof n||"number"!=typeof a||"number"!=typeof i||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(a)||!Number.isFinite(i))return null;t.push({r:Number(e),g:Number(n),b:Number(a),a:Number(i)})}return t},Co=/*#__PURE__*/s(({globalID:e,onResetViewport:t},a)=>{let i=at(e=>e.axisY.realRange),o=g(null),l=g(null),s=g(null),c=g(null),d=g(null),f=g(M7),m=g(null),b=g(null),v=g(null),y=g(M9),w=g(ns),x=g(null),k=g(!0),S=g(null),M=g(void 0),C=g(null);w.current=[i?.[0]??ns["0"],i?.[1]??ns["1"]];let F=u(()=>{let e=s.current,t=m.current;if(!e)return;let r=e.getContext("2d");if(!r)return;let{width:n,height:a}=e;if(r.clearRect(0,0,n,a),!t?.sourceSize.width||!t.sourceSize.height||n<=0||a<=0){v.current=t?.rawData??null;return}let[i,o]=w.current,l=Math.min(i,o),c=Math.max(i,o)-l||1,u=y.current,h=d.current;h&&h.width===n&&h.height===a||(d.current=h=r.createImageData(n,a));let p=h.data;for(let e=0;e<a;e++){let r=Cn(Math.floor((a-e-.5)*t.sourceSize.height/a),0,t.sourceSize.height-1),i=t.rawData[r];for(let r=0;r<n;r++){let a=Cn(Math.floor((r+.5)*t.sourceSize.width/n),0,t.sourceSize.width-1),o=i?.[a],s=(e*n+r)*4;if(!Number.isFinite(o)){p[s]=0,p[s+1]=0,p[s+2]=0,p[s+3]=0;continue}Ca(p,s,u,(o-l)/c)}}r.putImageData(h,0,0),v.current=t.rawData},[]),D=u(()=>{let e=l.current??c.current;e&&(f.current={selectionFill:ol("--warning",.12,e)||M7.selectionFill,selectionStroke:ol("--warning",.95,e)||M7.selectionStroke,shadow:ol("--background",.86,e)||M7.shadow,viewportFill:ol("--background",.16,e)||M7.viewportFill,viewportStroke:ol("--foreground",.95,e)||M7.viewportStroke})},[]),z=u(()=>{let e=c.current,t=m.current;if(!e)return;let r=e.getContext("2d");if(!r||(r.clearRect(0,0,e.width,e.height),!t?.sourceSize.width||!t.sourceSize.height))return;let{selectionFill:n,selectionStroke:a,shadow:i,viewportFill:o,viewportStroke:l}=f.current,s=xA(t),u=Math.max(1,Math.min(window.devicePixelRatio||1,2)),d=s.left*e.width,h=s.top*e.height,p=Math.max(s.width*e.width,2*u),g=Math.max(s.height*e.height,2*u);r.save(),r.fillStyle=o,r.strokeStyle=l,r.lineWidth=u,r.shadowColor=i,r.shadowBlur=2*u,r.fillRect(d,h,p,g),r.strokeRect(d+u/2,h+u/2,Math.max(0,Math.min(p-u,e.width-d-u)),Math.max(0,Math.min(g-u,e.height-h-u))),r.restore();let v=b.current;if(!v)return;let y=xP(t,v),w=y.left*e.width,x=y.top*e.height,k=Math.max(y.width*e.width,2*u),S=Math.max(y.height*e.height,2*u);r.save(),r.fillStyle=n,r.strokeStyle=a,r.lineWidth=u,r.setLineDash([3*u,2*u]),r.shadowColor=i,r.shadowBlur=2*u,r.fillRect(w,x,k,S),r.strokeRect(w+u/2,x+u/2,Math.max(0,Math.min(k-u,e.width-w-u)),Math.max(0,Math.min(S-u,e.height-x-u))),r.restore()},[]),N=u(e=>{k.current||=e,o.current?.hidden||null===x.current&&(x.current=window.requestAnimationFrame(()=>{x.current=null,k.current&&(k.current=!1,F()),z()}))},[F,z]),E=u(()=>{let e=l.current,t=s.current,r=c.current;if(!e||!t||!r)return;let n=e.getBoundingClientRect(),a=Math.min(window.devicePixelRatio||1,2),i=Math.max(1,Math.min(256,Math.round(n.width*a))),o=Math.max(1,Math.min(1024,Math.round(n.height*a)));(t.width!==i||t.height!==o||r.width!==i||r.height!==o)&&(t.width=i,t.height=o,r.width=i,r.height=o,N(!0))},[N]),T=u(e=>{let t=v.current!==e.rawData;m.current=e;let r=xj(e);if(o.current&&(o.current.hidden=r),r){k.current||=t,C.current=null,o.current?.removeAttribute("data-dragging"),M.current=void 0,null!==x.current&&(window.cancelAnimationFrame(x.current),x.current=null),null!==S.current&&(window.cancelAnimationFrame(S.current),S.current=null),c.current&&(c.current.style.cursor="grab");return}E(),N(t)},[E,N]);p(a,()=>({update:T}),[T]),h(()=>{let t=tj(e)?.getSnapshot();t&&T(t)},[e,T]),h(()=>{N(!0)},[i,N]),h(()=>(D(),oh(()=>{D(),N(!0)})),[N,D]),h(()=>{let t=e=>{b.current=e,N(!1)},r=SK(e,t);return t(SU(e)),r},[e,N]),h(()=>{if(e)return vA(e,"HeatmapOverview",e=>{let t=Ci(e);t&&(y.current=t,N(!0))})},[e,N]),h(()=>{E();let e=l.current;if(!e||"u"<typeof ResizeObserver)return;let t=new ResizeObserver(E);return t.observe(e),()=>t.disconnect()},[E]),h(()=>()=>{null!==x.current&&window.cancelAnimationFrame(x.current),null!==S.current&&window.cancelAnimationFrame(S.current)},[]);let R=u(t=>{let r=tj(e),n=r?.getSnapshot();!r||!n||xV(n,t)||r.updateSamplingRange(xK(t))},[e]),A=u(e=>{M.current=e,null===S.current&&(S.current=window.requestAnimationFrame(()=>{S.current=null;let e=M.current;M.current=void 0,e&&R(e)}))},[R]),I=u(e=>{let t=e.currentTarget.getBoundingClientRect();return{left:t.width?(e.clientX-t.left)/t.width:0,top:t.height?(e.clientY-t.top)/t.height:0}},[]),P=u(e=>{if(0!==e.button)return;let t=m.current;if(!t?.sourceSize.width||!t.sourceSize.height)return;let r=I(e),n=xR(t,r),a=xY(t,n),i=b.current;if(!a&&i&&!xO(t,i)){let r=e.currentTarget.getBoundingClientRect();if(x$(i,n,{x:r.width?6*t.sourceSize.width/r.width:0,y:r.height?6*t.sourceSize.height/r.height:0}))return void A(xB(t,i))}a?(C.current={pointerId:e.pointerId,grabOffset:{x:n.x-t.range.x[0],y:n.y-t.range.y[0]}},o.current?.setAttribute("data-dragging","true"),e.currentTarget.setPointerCapture(e.pointerId),e.currentTarget.style.cursor="grabbing",e.preventDefault()):A(xH(t,r))},[I,A]),L=u(e=>{let t=C.current,r=m.current;t&&t.pointerId===e.pointerId&&r&&A(xG(r,I(e),t.grabOffset))},[I,A]),O=u(e=>{C.current?.pointerId===e.pointerId&&(C.current=null,o.current?.removeAttribute("data-dragging"),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),e.currentTarget.style.cursor="grab")},[]);return /*#__PURE__*/r("aside",{ref:o,"aria-label":"瀑布图全景导航",className:"group absolute right-2 top-2 z-[6] isolate flex h-[14%] w-[14%] overflow-visible before:pointer-events-none before:absolute before:-inset-1 before:z-0 before:rounded-md before:bg-foreground/20 before:opacity-75 before:shadow-sm before:transition-opacity before:duration-100 hover:before:opacity-90 focus-within:before:opacity-90 data-[dragging=true]:before:opacity-100",hidden:!0,children:/*#__PURE__*/n("div",{ref:l,className:"relative z-[1] h-full min-h-0 w-full overflow-hidden rounded-sm",children:[/*#__PURE__*/r("canvas",{ref:s,className:"pointer-events-none absolute inset-0 h-full w-full opacity-60 transition-opacity duration-100 group-hover:opacity-90 group-focus-within:opacity-90 group-data-[dragging=true]:opacity-100"}),/*#__PURE__*/r("canvas",{ref:c,className:"absolute inset-0 h-full w-full touch-none cursor-grab opacity-80 outline-none transition-opacity duration-100 group-hover:opacity-100 group-focus-within:opacity-100 group-data-[dragging=true]:opacity-100 focus-visible:ring-1 focus-visible:ring-ring","aria-label":"瀑布图全景;点击空白区域居中,点击框选范围定位,拖动视口框平移,双击恢复全景",tabIndex:0,onContextMenu:e=>e.preventDefault(),onDoubleClick:e=>{e.preventDefault(),e.stopPropagation(),t()},onLostPointerCapture:O,onPointerCancel:O,onPointerDown:P,onPointerMove:L,onPointerUp:O})]})})});Co.displayName="HeatmapOverview";let Cl=Co,Cs=({publish:e,heatmapDefaultData:t,renderer:a})=>{let{state:{globalID:i,zoom:o},dispatch:l}=ae(),s=!0===o.xy&&!1!==o.show,c=s&&o.overview?.show===!0,d=g(s),p=g(i),f=g(null),m=g(null),b=g(!1),v=g(!1),y=g(!1),w=g(t),x=g(rJ(t??[]));d.current=s,p.current=i;let k=u(e=>{let t=p.current;if(!t)return;let r={range:{x:e.range.x,y:e.range.y},sourceSize:e.sourceSize},n=e.sourceSize.width>0?{start:e.range.x[0],end:e.range.x[1]-1}:{start:0,end:0};l({payload:t=>{let a=t.waterfallViewport,i=a.sourceSize.width!==e.sourceSize.width||a.sourceSize.height!==e.sourceSize.height||a.range.x[0]!==e.range.x[0]||a.range.x[1]!==e.range.x[1]||a.range.y[0]!==e.range.y[0]||a.range.y[1]!==e.range.y[1],o=t.zoom.interval.start!==n.start||t.zoom.interval.end!==n.end||null!==t.zoom.style;return i||o?{...i?{waterfallViewport:r}:{},...o?{zoom:{...t.zoom,interval:n,style:null,isScanSegmentsUpdateMagnify:!1}}:{}}:null}}),((e,t,r="0")=>tI(e,t,void 0,r))(t,rr.Heatmap)({pstype:rn.Render,data:e.data}),m.current?.update(e)},[l]),S=u(e=>{if(b.current=e,!e||!d.current)return;let t=f.current,r=x.current;t&&r.length>0&&kr(t,r)},[]);h(()=>{i&&(tO(i).getAllRawData=e=>({...tL().getAllRawData(e),waterfallData:x.current}))},[i]),h(()=>{if(!i)return;if(!s){if(f.current=null,tj(i,null),v.current){v.current=!1;let e=x.current.reduce((e,t)=>Math.max(e,t.length),0);e>0?l({payload:t=>({waterfallViewport:{range:{x:[0,0],y:[0,0]},sourceSize:{width:0,height:0}},zoom:{...t.zoom,interval:{start:0,end:e-1},style:null,isScanSegmentsUpdateMagnify:!1}})}):l({payload:{waterfallViewport:{range:{x:[0,0],y:[0,0]},sourceSize:{width:0,height:0}}}})}x.current.length>0&&((e,t,r="0")=>tI(e,t,void 0,r))(i,rr.Heatmap)({pstype:rn.Render,data:x.current});return}let e=new q({onWaterfallUpdate:k});return f.current=e,v.current=!0,tj(i,e),b.current&&x.current.length>0&&kr(e,x.current),()=>{f.current===e&&(f.current=null),tj(i,null)}},[l,i,k,s]),h(()=>{if(Object.is(w.current,t))return;w.current=t,y.current=!1;let e=rJ(t??[]);x.current=e;let r=f.current;s&&b.current&&r&&kr(r,e)},[t,s]);let M=wM(rt.Heatmap),C=u(()=>{let e=p.current;e&&ka(e)},[]);ac({publish:e,resetViewport:C,subscribe:e=>{M(e);let{pstype:t}=e;if(t===rn.Heatmap){let{data:t,timestamps:r}=e,n=rJ(t,r);x.current=n;let a=f.current;d.current?b.current&&a&&kr(a,n):((e,t,r="0")=>tI(e,t,void 0,r))(i,rr.Heatmap)({pstype:rn.Render,data:n})}if(t===rn.Reset||t===rn.Clear){y.current=!0,x.current=[],f.current?.setData([]),((e,t,r="0")=>tI(e,t,void 0,r))(i,rr.Heatmap)({pstype:rn.Reset}),t===rn.Reset&&((e,t,r="0")=>tI(e,t,void 0,r))(i,rn.Reset)(e),e.onFinally?.();return}((e,t,r="0")=>tI(e,t,void 0,r))(i,rr.Heatmap)(e)}});let F=!Object.is(w.current,t);return /*#__PURE__*/n(am,{children:[/*#__PURE__*/r(yE,{children:/*#__PURE__*/r(M6,{renderer:a,heatmapDefaultData:s||y.current&&!F?void 0:t,onSubscriptionReadyChange:S,overview:c?/*#__PURE__*/r(Co,{ref:m,globalID:i,onResetViewport:C}):null,zoomMode:s?"independent-xy":"disabled"})}),/*#__PURE__*/r(yN,{type:rt.Heatmap})]})},Cc=Cs,Cu=e=>/*#__PURE__*/r(aa,{...e,children:/*#__PURE__*/r(Cs,{...e})}),Cd=tB(Cu,"Heatmap"),Ch=Cd;function Cp({type:e="iqEye"}){let{chart:t,Chart:n}=iV({Render:m(()=>class extends vW{constructor(t){super({...t,type:e})}},[e])});return i3({moduleType:rr.IQEye,chart:t}),/*#__PURE__*/r(n,{})}let Cf={interval:0,majorTickValues:[]},Cm=7,Cg=.5,Cb=e=>{let[t,r]=e??[],n=r-t;if(!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)||n<=0)return 0;let a=n/7,i=10**Math.floor(Math.log10(a)),o=a/i;return Math.max(o<=1?i:o<=2?2*i:o<=5?5*i:o<=6?6*i:10*i,.5/14)},Cv=e=>{let[t,r]=e??[],n=Cb(e);if(!n)return Cf;let a=Math.ceil(t/n)*n,i=Math.floor((r+1e-6*n-a)/n);if(!Number.isFinite(i)||i<0)return{interval:n,majorTickValues:[]};let o=Array.from({length:i+1},(e,t)=>a+t*n);return{interval:n,majorTickValues:o}},Cy=e=>"number"==typeof e&&Number.isFinite(e)&&e>0?Math.ceil(e):0,Cw=e=>`${100*Math.min(1,Math.max(0,e))}%`,Cx=({horizontalPositions:e=[],col:t=10,strokeColor:a="var(--chart-grid)",strokeWidth:i=1,strokeDasharray:o=4})=>{let l=Cy(t);return /*#__PURE__*/n("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-full w-full",shapeRendering:"crispEdges",children:[m(()=>e.map(e=>{let t=Cw(e);return /*#__PURE__*/r("line",{x1:"0%",y1:t,x2:"100%",y2:t,stroke:a,strokeWidth:i,strokeDasharray:o,vectorEffect:"non-scaling-stroke"},`h-${e}`)}),[e,a,o,i]),m(()=>l>0?Array.from({length:l+1},(e,t)=>{let n=`${t/l*100}%`;return /*#__PURE__*/r("line",{x1:n,y1:"0%",x2:n,y2:"100%",stroke:a,strokeWidth:i,strokeDasharray:o,vectorEffect:"non-scaling-stroke"},`v-${(t/l).toFixed(6)}`)}):[],[l,a,o,i])]})},Ck=Cx,CS=e=>{let[t,r]=e??[],n=r-t;if(!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)||n<=0)return[];let{majorTickValues:a}=Cv(e);return a.map(e=>(r-e)/n).filter(e=>e>=-1e-9&&e<=1+1e-9).map(e=>Math.min(1,Math.max(0,e)))},CM=()=>{let{state:{gridLines:e,segments:t,axisY:{range:n}}}=ae(),a=m(()=>CS(n),[n]),i=t.length>1?1:10;return e?/*#__PURE__*/r("div",{className:"pointer-events-none absolute right-0 top-0 z-[1] h-full w-full select-none overflow-hidden",children:/*#__PURE__*/r(Cx,{col:i,horizontalPositions:a})}):null},CC=/*#__PURE__*/a.memo(CM);class CF extends of{useRangeAutoFocus=()=>{};firstRenderAutoFocus=!1;constructor(e){super({chart:null,autoranging:!1,prevAutoRangeTime:0,id:"id",renderRange:ns,interval:1,series:{},globalID:"",...e})}init(){if(this.state.chart)return;let{id:e,renderRange:t,globalID:r}=this.state;e&&(this.trackCleanup(y6(this)),this.state.chart=new N({id:e,range:t}),this.initSeries(),this.useRangeAutoFocus=()=>{nj(r)()},this.trackCleanup(nW(r,e=>{this.setRange(e)})))}initSeries(){let{globalID:e}=this.state;if(!e)throw Error("globalID is required for series initialization");wf(e).forEach(e=>{this.setSeries(e,!0)}),this.state.chart?.draw()}updateSeries({data:e,extraData:t}){let{series:r,chart:n}=this.state;if(n){if(e){let t=Object.entries(r);for(let r=0;r<t.length;r+=1){let[a]=t[r],i=e[a];i&&t4.includes(a)&&(n.render({name:a,data:i}),a===t3&&this.updateMainSeries(i))}}if(t){let e=Object.entries(t);for(let t=0;t<e.length;t+=1){let[a,i]=e[t],o=r[a];i&&n.render({...o,name:a,data:i})}}}}updateMainSeries(e){let{autoranging:t,interval:r,prevAutoRangeTime:n,chart:a}=this.state;if(!a)return;let i=e.length;i!==r&&(this.state.interval=i,a.setIntervel(i));let o=Date.now();t&&o-n>1e3&&(this.state.prevAutoRangeTime=o,this.useRangeAutoFocus()),this.firstRenderAutoFocus||void 0===e.at(0)||(this.firstRenderAutoFocus=!0)}setSeries(e,t=!1){let{chart:r,series:n,globalID:a}=this.state,{name:i}=e;if(!r||!i||!e)return;let o={...n[i],...e},l=o.type;!e.type&&a&&(l=wt(a,i));let{color:s=t5[i]?.color,thickness:c=1,display:u=!1}=o,d={name:i,label:o.label,type:l||M.Line,color:s,thickness:c,display:u};if(this.state.series={...n,[i]:d},r.setSeries(d),!t&&a)try{wd(a,{name:i,label:d.label||i,color:s,thickness:c,display:u,type:d.type})}catch(e){console.warn("Failed to update series in new management system:",e)}}setDisabledClearRect(e){this.state.chart?.updateProps({disabledClearRect:e})}setRange(e=this.state.renderRange){let{chart:t}=this.state,[r,n]=e;void 0!==r&&void 0!==n&&t&&(this.state.renderRange=e,t.setRange(e))}zoom(){let{chart:e,interval:t}=this.state;e&&e.setIntervel(t)}reset(){this.clear(),this.resize()}resize(){this.state.chart?this.hasRenderableContainerSize()&&(this.setRange(),this.zoom(),this.state.chart.resize()):this.initializeChartWhenReady()}clearChart(){this.clear()}}let CD=()=>{let{state:{axisY:{autoranging:e}}}=ae(),{chart:t,Chart:a}=iV({Render:CF,params:{autoranging:e}});return h(()=>{if(t){let{lineColor:e,pointColor:r}=t0("iq");t.setSeries({name:t5.realData.name,label:"IData",color:e}),t.setSeries({name:t5.maxData.name,label:"QData",color:r})}},[t]),i3({moduleType:rr.IQLine,chart:t,handleRender:(e,t)=>{let{IData:r,QData:n}=e;if(r&&n){let{min:e,max:a}=tU([...r,...n]),i=(a-e)/8;t.setRange?.([e-i,a+i]),t.updateSeries?.({data:{[t5.realData.name]:r,[t5.maxData.name]:n}})}},eventHandlers:{[rn.Reset]:(e,t)=>{t.reset()}}}),/*#__PURE__*/n(yE,{children:[/*#__PURE__*/r(CC,{}),/*#__PURE__*/r(a,{})]})},Cz=CD;function CN({type:e="iqPlanisphere"}){let{chart:t,Chart:n}=iV({Render:m(()=>class extends vW{constructor(t){super({...t,type:e})}},[e])});return i3({moduleType:rr.IQPlanisphere,chart:t}),/*#__PURE__*/r(oL,{children:/*#__PURE__*/r(n,{})})}let CE=({type:e="iqStream"})=>{let{chart:t,Chart:n}=iV({Render:m(()=>class extends vW{constructor(t){super({...t,type:e})}},[e])});return i3({moduleType:rr.IQStream,chart:t}),/*#__PURE__*/r(oL,{children:/*#__PURE__*/r(n,{})})},CT=CE,CR=e=>{let{type:t,publish:n}=e,{state:{globalID:a}}=ae();return h(()=>{a&&t===rt.IQEye&&((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.IQEye)({pstype:rn.Render})},[]),ac({publish:n,subscribe:e=>{let r=oI(e,{renderPSTypes:[rn.IQ]});switch(t){case rt.IQEye:((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.IQEye)(r);break;case rt.IQLine:((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.IQLine)(r);break;case rt.IQPlanisphere:((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.IQPlanisphere)(r);break;case rt.IQStream:((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.IQStream)(r)}}}),/*#__PURE__*/r(am,{children:/*#__PURE__*/r(m(()=>{switch(t){case rt.IQEye:return Cp;case rt.IQLine:return CD;case rt.IQPlanisphere:return CN;case rt.IQStream:return CE;default:return CN}},[t]),{})})},CA=CR,CI=e=>/*#__PURE__*/r(aa,{system:{padding:!1,border:!1},...e,children:/*#__PURE__*/r(CR,{...e})}),CP=tB(CI,"IQ"),CL=CP,CO=Object.values(rr),Cq=()=>{let{state:{globalID:e,publish:t}}=ae();return /*#__PURE__*/r(vd,{onClick:()=>{t?.({pstype:rn.Reset}),CO.forEach(t=>{((e,t,r="0")=>tI(e,t,void 0,r))(e,t)({pstype:rn.Reset})})},title:"重置",children:/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{d:"M512 160c-141.6 0-265.6 76.8-332.8 192l-76.8-76.8v224h224l-89.6-89.6C288 307.2 390.4 240 512 240c159.2 0 288 128.8 288 288s-128.8 288-288 288c-115.2 0-214.4-67.2-262.4-164.8l-68.8 36.8C240 800 364.8 880 512 880c194.4 0 352-157.6 352-352S706.4 160 512 160z",fill:"currentColor"})})})},C$=Cq,C_=()=>{let{state:{segments:e,globalID:t}}=ae(),[n,a]=b([]),[i,o]=b(null),l=e.totalPoints??0;h(()=>{a(e.map(e=>({display:!1,ratio:l>0?e.point/l:0})))},[e,l]);let s=u(e=>{let r="number"==typeof e?e:null;a(n.map((e,t)=>({...e,display:t===r}))),o(r),wS(t)(r??void 0)},[n,t]);return /*#__PURE__*/r(vz,{value:i,options:[{value:null,label:"所有频段"},...e.map((e,t)=>({value:t,label:`频段 ${e.start} - ${e.stop}`}))],onChange:s})},Cj=C_,CH=({type:e})=>{let{state:{globalID:t}}=ae(),{mode:a}=xl(t),i=u(()=>{e===rt.MScan||e===rt.ScanDF360||t&&y4(t)},[t,e]),o=m(()=>e===rt.MScan||e===rt.ScanDF360?"图形模式切换已禁用":`当前图形模式:${yJ[a]?.label||a}`,[a,e]),l=e===rt.MScan||e===rt.ScanDF360,s=m(()=>()=>{switch(a){case"bar":return /*#__PURE__*/n("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("rect",{x:"2",y:"8",width:"2",height:"6",fill:"currentColor"}),/*#__PURE__*/r("rect",{x:"5",y:"4",width:"2",height:"10",fill:"currentColor"}),/*#__PURE__*/r("rect",{x:"8",y:"6",width:"2",height:"8",fill:"currentColor"}),/*#__PURE__*/r("rect",{x:"11",y:"2",width:"2",height:"12",fill:"currentColor"})]});case"stepline":return /*#__PURE__*/r("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{d:"M2 12H4V8H6V8H8V4H10V4H12V2H14",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})});case"line":return /*#__PURE__*/r("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{d:"M2 12L5 8L8 10L11 4L14 6",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})});case"area":return /*#__PURE__*/n("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("path",{d:"M2 12L5 8L8 10L11 4L14 6V14H2V12Z",fill:"currentColor",opacity:"0.6"}),/*#__PURE__*/r("path",{d:"M2 12L5 8L8 10L11 4L14 6",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})]});default:return null}},[a]);return /*#__PURE__*/r(vd,{title:o,disabled:l,onClick:l?void 0:i,className:iX(l&&"text-muted-foreground"),children:s()})},CB=CH,CW=()=>{let{state:{globalID:e,series:t}}=ae(),a=xd(e);h(()=>{if(!e||!t?.forceDisplay)return;let r=a.filter(e=>!e.display);r.length>0&&wp(e,r.map(({name:e})=>({name:e,display:!0})))},[e,t?.forceDisplay,a.length]);let i=u(t=>{e&&0!==t.length&&wp(e,t)},[e]),o=u((e,t)=>{i([{name:e,display:t}])},[i]),l=u(e=>{let t=a.filter(t=>t.display!==e).map(t=>({name:t.name,display:e}));t.length>0&&i(t)},[a,i]),s=m(()=>{let e=a.every(e=>e.display);return[{label:e?"全不选":"全选",value:"__toggle_all__",onSelect:()=>l(!e),render:()=>/*#__PURE__*/r("span",{className:"inline-flex w-full text-xs font-medium",children:e?"全不选":"全选"})},...a.map(e=>{let t=e.display?"text-foreground opacity-100":"font-normal text-muted-foreground opacity-70";return{label:e.label||e.name,value:e.name,onSelect:()=>o(e.name,!e.display),render:()=>/*#__PURE__*/n("div",{className:"flex w-full min-w-0 items-center gap-[var(--size-gap-base)]",children:[/*#__PURE__*/r("span",{"aria-hidden":"true",className:iX("inline-flex h-3.5 w-3.5 shrink-0 rounded-[var(--radius-micro)] border transition-colors",e.display?"border-transparent":"border-border/70 bg-transparent opacity-55"),style:{backgroundColor:e.display?e.color:"transparent"}}),/*#__PURE__*/r("span",{className:iX("min-w-0 truncate text-xs",t),children:e.label||e.name})]})}})]},[a,o,l]);return /*#__PURE__*/r(vN,{value:m(()=>{let e=a.filter(e=>e.display).length,t=a.length;return 0===e?"无选择":e===t?"全部":`${e}/${t}`},[a]),options:s,title:"系列显示控制",icon:/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("path",{d:"M930.909091 896H93.090909c-18.618182 0-34.909091-16.290909-34.909091-34.909091V162.909091c0-18.618182 16.290909-34.909091 34.909091-34.909091h837.818182c18.618182 0 34.909091 16.290909 34.909091 34.909091v698.181818c0 18.618182-16.290909 34.909091-34.909091 34.909091z m-802.909091-69.818182h770.327273v-628.363636H128v628.363636z",fill:"currentColor"}),/*#__PURE__*/r("path",{d:"M232.727273 640c-4.654545 0-9.309091 0-13.963637-2.327273-16.290909-6.981818-25.6-27.927273-18.618181-44.218182l116.363636-279.272727c4.654545-11.636364 16.290909-20.945455 30.254545-20.945454 13.963636 0 25.6 4.654545 32.581819 16.290909l83.781818 146.618182H814.545455c18.618182 0 34.909091 16.290909 34.90909 34.90909s-16.290909 34.909091-34.90909 34.909091H442.181818c-11.636364 0-23.272727-6.981818-30.254545-16.290909l-58.181818-102.4-90.763637 216.436364c-4.654545 6.981818-16.290909 16.290909-30.254545 16.290909zM814.545455 663.272727H488.727273c-18.618182 0-34.909091-16.290909-34.909091-34.909091s16.290909-34.909091 34.909091-34.909091h325.818182c18.618182 0 34.909091 16.290909 34.90909 34.909091s-16.290909 34.909091-34.90909 34.909091z",fill:"currentColor"})]}),closeOnSelect:!1})},CG=CW,CY=()=>{let{state:{zoom:e,segments:t},dispatch:n}=ae(),{show:a,autoCloseTimeout:i,interval:{start:o,end:l}}=e,s=t.totalPoints??0,c=Math.max(s-1,0),[d,p]=b(!0),f=g(null);h(()=>()=>{f.current&&clearTimeout(f.current)},[]),h(()=>{f.current&&clearTimeout(f.current),p(!1),f.current=setTimeout(()=>{v()},i)},[o,l,i]);let v=u(()=>{n({payload:{zoom:ya(e,s)}}),p(!0)},[e,s,n]),y=m(()=>s?{background:`linear-gradient(to right,
|
|
3763
|
+
*/let Ml={name:"move",size:24,node:[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]};Ml.node;let Ms=Mo(Ml),Mc=e=>e.leftPosition+Math.max(0,e.width)>=-1e-9&&e.leftPosition<=100+1e-9&&e.position+Math.max(0,e.height)>=-1e-9&&e.position<=100+1e-9,Mu={enabled:!0,defaultRect:{position:70,height:30,leftPosition:0,width:100},minSize:0,maxSize:100,snapThreshold:2,onChange:()=>{},onDragEnd:()=>{},preserveDefaultRect:!1,bounds:{bottom:100,left:0,right:100,top:0}},Md=(e,t,r,n,a)=>{let i=n-t,o=Math.max(r,Math.min(e,i)),l=Math.min(a,Math.max(0,(i-r)/2));return o<r+l?r:o>i-l?i:o},Mh=(e={})=>{let{enabled:t,defaultRect:r,minSize:n,minWidth:a,minHeight:i,maxSize:o,snapThreshold:l,onChange:s,onDragEnd:c,preserveDefaultRect:d,bounds:p}={...Mu,...e},f=a??n,m=i??n,[v,y]=b({position:r.position??Mu.defaultRect.position,height:d?r.height??Mu.defaultRect.height:Math.min(r.height??Mu.defaultRect.height,o),leftPosition:r.leftPosition??Mu.defaultRect.leftPosition,width:r.width??Mu.defaultRect.width}),[w,x]=b(!1),[k,S]=b(null),M=g(null),F=g({x:0,y:0,rect:v}),C=g(v);C.current=v,h(()=>{if(!w&&r){let e={position:r.position??v.position,height:void 0!==r.height?d?r.height:Math.min(r.height,o):v.height,leftPosition:r.leftPosition??v.leftPosition,width:r.width??v.width};(Math.abs(e.position-v.position)>.01||Math.abs(e.height-v.height)>.01||Math.abs(e.leftPosition-v.leftPosition)>.01||Math.abs(e.width-v.width)>.01)&&y(e)}},[r?.position,r?.height,r?.leftPosition,r?.width,w,o,d]);let D=u((e,r,n=v)=>{t&&(e.preventDefault(),x(!0),S(r),F.current={x:e.clientX,y:e.clientY,rect:{...n}})},[t,v]),z=u(e=>{if(!w||!M.current)return;let t=M.current,{x:r,y:n,rect:a}=F.current,i=(e.clientY-n)/t.clientHeight*100,c=(e.clientX-r)/t.clientWidth*100,{position:u,height:d,leftPosition:h,width:g}=a;switch(k){case"top":{let e=a.position+a.height;u=Math.max(p.top,Math.min(a.position+i,e-m)),(d=e-u)>o&&(d=o,u=e-o),0!==i&&u<p.top+l&&e-p.top<=o&&(d=e-(u=p.top));break}case"bottom":d=Math.max(m,Math.min(o,a.height+i,p.bottom-a.position)),0!==i&&a.position+d>p.bottom-l&&p.bottom-a.position<=o&&(d=p.bottom-a.position);break;case"left":{let e=a.leftPosition+a.width;h=Math.max(p.left,Math.min(a.leftPosition+c,e-f)),(g=e-h)>o&&(g=o,h=e-o),0!==c&&h<p.left+l&&e-p.left<=o&&(g=e-(h=p.left));break}case"right":g=Math.max(f,Math.min(o,a.width+c,p.right-a.leftPosition)),0!==c&&a.leftPosition+g>p.right-l&&p.right-a.leftPosition<=o&&(g=p.right-a.leftPosition);break;case"middle":0!==i&&(u=Md(a.position+i,a.height,p.top,p.bottom,l)),0!==c&&(h=Md(a.leftPosition+c,a.width,p.left,p.right,l))}let b={position:u,height:d,leftPosition:h,width:g};C.current=b,y(b),s(b)},[w,k,f,m,o,l,p.top,p.bottom,p.left,p.right,s]),N=u(()=>{w&&c(C.current),x(!1),S(null)},[w,c]);h(()=>{if(t&&w)return document.addEventListener("mousemove",z),document.addEventListener("mouseup",N),document.addEventListener("mouseleave",N),window.addEventListener("blur",N),()=>{document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",N),document.removeEventListener("mouseleave",N),window.removeEventListener("blur",N)}},[t,w,z,N]);let E=u(e=>{let t={...v,...e};y(t),s(t)},[v,s]);return{rect:v,isDragging:w,dragType:k,containerRef:M,handleMouseDown:D,resetRect:E,setRect:e=>{y(e),s(e)}}},Mp=4,Mf=14,Mm=10,Mg={bottom:100,left:0,right:100,top:0},Mb="pointer-events-auto absolute z-[2] appearance-none rounded-[3px] border-0 p-0 transition-[background-color,box-shadow] duration-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring [background:var(--mix-foreground-18)] [box-shadow:inset_0_0_0_1px_var(--mix-background-72),0_1px_3px_var(--mix-foreground-28)] hover:[background:var(--mix-foreground-32)] hover:[box-shadow:inset_0_0_0_1px_var(--mix-background-86),0_1px_4px_var(--mix-foreground-42)]",Mv="pointer-events-auto absolute z-[3] flex size-5 -translate-x-1/2 -translate-y-1/2 cursor-move items-center justify-center appearance-none rounded-sm border-0 p-0 text-foreground outline-none transition-[background-color,box-shadow] duration-100 focus-visible:ring-1 focus-visible:ring-ring [background:var(--mix-bg76-fg24)] [box-shadow:0_0_0_1px_var(--mix-background-82),0_1px_4px_var(--mix-foreground-32)] hover:[background:var(--mix-bg64-fg36)]",My=({ariaLabel:e,className:t,direction:n,onMouseDown:a,style:i})=>/*#__PURE__*/r("button",{type:"button",tabIndex:-1,"aria-label":e,className:iX("pointer-events-auto absolute z-[2] appearance-none rounded-[3px] border-0 p-0 transition-[background-color,box-shadow] duration-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring [background:var(--mix-foreground-18)] [box-shadow:inset_0_0_0_1px_var(--mix-background-72),0_1px_3px_var(--mix-foreground-28)] hover:[background:var(--mix-foreground-32)] hover:[box-shadow:inset_0_0_0_1px_var(--mix-background-86),0_1px_4px_var(--mix-foreground-42)]",t),style:i,onMouseDown:a,children:/*#__PURE__*/r("span",{"aria-hidden":"true",className:iX("pointer-events-none absolute left-1/2 top-1/2 rounded-full bg-foreground/85","horizontal"===n?"h-[2px] -translate-x-1/2 -translate-y-1/2":"w-[2px] -translate-x-1/2 -translate-y-1/2"),style:"horizontal"===n?{width:"clamp(10px, 18%, 24px)"}:{height:"clamp(10px, 18%, 24px)"}})}),Mw=(e,t,r)=>Math.min(Math.max(e,t),r),Mx=e=>"string"==typeof e||"number"==typeof e,Mk=e=>{if(!e)return e;let t={...e};return Mx(t.left)&&Mx(t.right)&&String(t.left)===String(t.right)&&(t.right=void 0),Mx(t.top)&&Mx(t.bottom)&&String(t.top)===String(t.bottom)&&(t.top=void 0),t},MS=({start:e,length:t,minLength:r,maxLength:n})=>{let a=Math.max(0,t),i=Math.min(Math.max(a,r),n),o=e+a/2,l=o-i/2,s=o+i/2;l<0&&(s=Math.min(n,s-l),l=0),s>n&&(l=Math.max(0,l-(s-n)),s=n);let c=s-l;return{start:l,end:s,length:c}},MM=({start:e,length:t,minLength:r})=>{let n=Math.max(0,t),a=Math.max(n,r),i=e+n/2-a/2;return{start:i,end:i+a,length:a}},MF=({rect:e,containerWidth:t,containerHeight:r,variant:n="contained"})=>{let a=e.leftPosition/100*t,i=e.position/100*r,o=e.width/100*t,l=e.height/100*r;if("projected"===n){let e=MM({start:a,length:o,minLength:14}),t=MM({start:i,length:l,minLength:14});return{left:e.start,top:t.start,width:e.length,height:t.length,right:e.end,bottom:t.end,centerX:e.start+e.length/2,centerY:t.start+t.length/2}}let s=MS({start:a,length:o,minLength:14,maxLength:t}),c=MS({start:i,length:l,minLength:14,maxLength:r});return{left:s.start,top:c.start,width:s.length,height:c.length,right:s.end,bottom:c.end,centerX:s.start+s.length/2,centerY:c.start+c.length/2}},MC=(e,t)=>Math.max(0,Math.min(e.left+e.width,t.left+t.width)-Math.max(e.left,t.left))*Math.max(0,Math.min(e.top+e.height,t.top+t.height)-Math.max(e.top,t.top)),MD=(e,t)=>Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(r=>{let n=e[r],a=t[r];return n&&a&&.5>Math.abs(n.left-a.left)&&.5>Math.abs(n.top-a.top)}),Mz=({left:e,top:t,size:r,containerWidth:n,containerHeight:a,score:i})=>{let o=Math.max(0,n-r.width),l=Math.max(0,a-r.height),s=Mw(e,0,o),c=Mw(t,0,l),u=Math.abs(s-e)+Math.abs(c-t);return{left:s,top:c,width:r.width,height:r.height,score:i+2*u}},MN=({key:e,size:t,rectBox:r,containerWidth:n,containerHeight:a})=>{let i=[],o="middle"===e&&(r.width<=t.width+8||r.height<=t.height+8),l=(e,r,o)=>{i.push(Mz({left:e,top:r,size:t,containerWidth:n,containerHeight:a,score:o}))},s=r.left-t.width-4,c=r.right+4,u=r.top-t.height-4,d=r.bottom+4,h=r.left+4,p=r.right-t.width-4,f=r.top+4,m=r.bottom-t.height-4,g=r.centerX-t.width/2,b=r.centerY-t.height/2;switch(e){case"left":l(s,b,0),l(h,b,6),l(s,r.top,10),l(s,r.bottom-t.height,11),l(h,r.top,16),l(h,r.bottom-t.height,17),l(r.left,u,22),l(r.left,d,24);break;case"right":l(c,b,0),l(p,b,6),l(c,r.top,10),l(c,r.bottom-t.height,11),l(p,r.top,16),l(p,r.bottom-t.height,17),l(r.right-t.width,u,22),l(r.right-t.width,d,24);break;case"top":l(g,u,0),l(g,f,6),l(r.left,u,10),l(r.right-t.width,u,11),l(r.left+4,f,16),l(r.right-t.width-4,f,17),l(s,r.top,24),l(c,r.top,25);break;case"bottom":l(g,d,0),l(g,m,6),l(r.left,d,10),l(r.right-t.width,d,11),l(r.left+4,m,16),l(r.right-t.width-4,m,17),l(s,r.bottom-t.height,24),l(c,r.bottom-t.height,25);break;case"middle":o?(l(g,u,0),l(g,d,1),l(c,b,2),l(s,b,3),l(c,u,4),l(c,d,5),l(s,u,6),l(s,d,7),l(g,b,12)):(l(g,b,0),l(g,u,8),l(g,d,9),l(c,b,10),l(s,b,11),l(r.left,u,14),l(r.right-t.width,u,15),l(r.left,d,16),l(r.right-t.width,d,17))}return i},ME=({enabled:e,defaultRect:a,minSize:i=0,minWidth:o,minHeight:l,maxSize:s=100,snapThreshold:c=2,onChange:u,onDragStart:d,onDragEnd:p,children:v,labels:y,className:w="",zIndex:x=7,showBoundaryLines:k=!1,variant:S="contained",interactionBounds:M=Mg})=>{let F=m(()=>Mk(y),[y?.top,y?.bottom,y?.left,y?.right]),{rect:C,containerRef:D,handleMouseDown:z}=Mh({enabled:e,defaultRect:a,minSize:i,minWidth:o,minHeight:l,maxSize:"projected"===S?Math.max(s,M.right-M.left,M.bottom-M.top):s,snapThreshold:c,onChange:u,onDragEnd:p,preserveDefaultRect:"projected"===S,bounds:M}),N=C.leftPosition+Math.max(0,C.width),E=C.position+Math.max(0,C.height),T="projected"!==S||Mc(C),R=Mw(C.leftPosition,0,100),A=Mw(N,0,100),I=Mw(C.position,0,100),P=Mw(E,0,100),L=A>=R,O=P>=I,q="projected"===S&&(C.leftPosition<Mg.left||N>Mg.right||C.position<Mg.top||E>Mg.bottom),$={left:(R+A)/2,top:(I+P)/2},[_,j]=b(0),[H,B]=b({width:0,height:0}),[W,G]=b({}),Y=g(null),U=g(null),X=g(null),K=g(null),V=g(null);h(()=>{if(!e||!T||"u"<typeof ResizeObserver)return;let t=new ResizeObserver(()=>{j(e=>e+1)});return[D.current,Y.current,U.current,X.current,K.current,V.current].filter(e=>null!==e).forEach(e=>{t.observe(e)}),()=>t.disconnect()},[e,T,!!F?.top,!!F?.bottom,!!F?.left,!!F?.right,!!v]),f(()=>{let t=D.current;if(!e||!T||!t)return void G(e=>Object.keys(e).length>0?{}:e);let r=t.clientWidth,n=t.clientHeight;if(r<=0||n<=0)return;B(e=>e.width===r&&e.height===n?e:{width:r,height:n});let a=[["top",Y.current],["bottom",U.current],["left",X.current],["right",K.current],["middle",V.current]].reduce((e,[t,r])=>(r&&(e[t]={width:r.offsetWidth,height:r.offsetHeight}),e),{}),i=MF({rect:C,containerWidth:r,containerHeight:n,variant:S}),o={middle:4,bottom:3,left:2,right:2,top:1},l=["top","bottom","left","right","middle"].filter(e=>a[e]).sort((e,t)=>{let r=o[t]-o[e];if(0!==r)return r;let n=(a[e]?.width??0)*(a[e]?.height??0);return(a[t]?.width??0)*(a[t]?.height??0)-n}),s=[],c={};l.forEach(e=>{let t=a[e];if(!t)return;let o=MN({key:e,size:t,rectBox:i,containerWidth:r,containerHeight:n}).map(e=>{let t=s.reduce((t,r)=>t+MC(e,r),0),r=e.score+(t>0?2e4+10*t:0),n=Math.max(1,e.width*e.height);return{...e,overlapArea:t,overlapRatio:t/n,totalScore:r}}),l=o.filter(e=>0===e.overlapArea).sort((e,t)=>e.totalScore-t.totalScore)[0]??null??o.sort((e,t)=>e.totalScore-t.totalScore)[0]??null;!l||"middle"!==e&&l.overlapRatio>.2||(c[e]={left:l.left,top:l.top},s.push(l))}),G(e=>MD(e,c)?e:c)},[e,T,C.position,C.height,C.leftPosition,C.width,_,!!F?.top,!!F?.bottom,!!F?.left,!!F?.right,!!v,S]);let Q={fontSize:"var(--size-font-second)",color:"var(--foreground)",border:"1px solid var(--border)",borderRadius:"var(--radius-control)",background:"var(--mix-background-80)"},Z=e=>{let t=W[e];return{left:t?.left??0,top:t?.top??0,visibility:t?"visible":"hidden"}},J=m(()=>H.width<=0||H.height<=0?null:MF({rect:C,containerWidth:H.width,containerHeight:H.height,variant:S}),[C.position,C.height,C.leftPosition,C.width,H.width,H.height,S]),ee=J?Math.max(0,Math.min(6,J.width/4)):6,et=J?Math.max(0,Math.min(6,J.height/4)):6,er=J?{top:J.top,height:J.height,left:J.left,width:J.width}:{top:`${C.position}%`,height:`${C.height}%`,left:`${C.leftPosition}%`,width:`${C.width}%`},en=e=>{let t={...C};switch(e){case"top":C.position<Mg.top&&(t.position=Mg.top,t.height=Math.max(0,C.position+C.height-Mg.top));break;case"bottom":E>Mg.bottom&&(t.height=Math.max(0,Mg.bottom-C.position));break;case"left":C.leftPosition<Mg.left&&(t.leftPosition=Mg.left,t.width=Math.max(0,N-Mg.left));break;case"right":N>Mg.right&&(t.width=Math.max(0,Mg.right-C.leftPosition))}return t},ea=(e,t,r)=>{d?.(t)!==!1&&(e.preventDefault(),e.stopPropagation(),z(e,t,r))};return e?/*#__PURE__*/n("div",{className:iX("pointer-events-none absolute left-0 top-0 h-full w-full select-none overflow-hidden bg-transparent",w),ref:D,style:{zIndex:x},children:[k&&/*#__PURE__*/n(t,{children:[/*#__PURE__*/r("div",{className:"pointer-events-none absolute left-0 right-0 top-0 h-px bg-border"}),/*#__PURE__*/r("div",{className:"pointer-events-none absolute bottom-0 left-0 right-0 h-px bg-border"}),/*#__PURE__*/r("div",{className:"pointer-events-none absolute bottom-0 left-0 top-0 w-px bg-border"}),/*#__PURE__*/r("div",{className:"pointer-events-none absolute bottom-0 right-0 top-0 w-px bg-border"})]}),T&&/*#__PURE__*/n("div",{className:"group pointer-events-none absolute box-border",style:er,children:[/*#__PURE__*/r("div",{className:"pointer-events-none absolute inset-0 border-[2px] border-dashed border-foreground group-hover:border-[4px]"}),/*#__PURE__*/r("div",{className:"pointer-events-auto absolute left-0 w-full cursor-ns-resize [background:var(--mix-secondary-15)] hover:[background:var(--mix-secondary-40)]",style:{top:-5,height:10},onMouseDown:e=>ea(e,"top")}),/*#__PURE__*/r("div",{className:"pointer-events-auto absolute left-0 w-full cursor-ns-resize [background:var(--mix-secondary-15)] hover:[background:var(--mix-secondary-40)]",style:{bottom:-5,height:10},onMouseDown:e=>ea(e,"bottom")}),/*#__PURE__*/r("div",{className:"pointer-events-auto absolute top-0 h-full cursor-ew-resize [background:var(--mix-secondary-15)] hover:[background:var(--mix-secondary-40)]",style:{left:-5,width:10},onMouseDown:e=>ea(e,"left")}),/*#__PURE__*/r("div",{className:"pointer-events-auto absolute top-0 h-full cursor-ew-resize [background:var(--mix-secondary-15)] hover:[background:var(--mix-secondary-40)]",style:{right:-5,width:10},onMouseDown:e=>ea(e,"right")}),!q&&/*#__PURE__*/r("div",{className:"pointer-events-auto absolute cursor-move [background:var(--mix-secondary-15)] hover:[background:var(--mix-secondary-20)]",style:{top:et,bottom:et,left:ee,right:ee},onMouseDown:e=>ea(e,"middle")})]}),q&&T&&L&&O&&/*#__PURE__*/r("button",{type:"button",tabIndex:-1,"aria-label":"移动框选范围",title:"移动框选范围",className:"pointer-events-auto absolute z-[3] flex size-5 -translate-x-1/2 -translate-y-1/2 cursor-move items-center justify-center appearance-none rounded-sm border-0 p-0 text-foreground outline-none transition-[background-color,box-shadow] duration-100 focus-visible:ring-1 focus-visible:ring-ring [background:var(--mix-bg76-fg24)] [box-shadow:0_0_0_1px_var(--mix-background-82),0_1px_4px_var(--mix-foreground-32)] hover:[background:var(--mix-bg64-fg36)]",style:{left:`clamp(10px, ${$.left}%, calc(100% - 10px))`,top:`clamp(10px, ${$.top}%, calc(100% - 10px))`},onMouseDown:e=>ea(e,"middle"),children:/*#__PURE__*/r(Ms,{"aria-hidden":"true",className:"pointer-events-none size-3",strokeWidth:1.75})}),"projected"===S&&T&&/*#__PURE__*/n(t,{children:[C.position<0&&L&&/*#__PURE__*/r(My,{ariaLabel:"调整框选上边界",direction:"horizontal",className:"top-0 h-[10px] cursor-ns-resize",style:{left:`${R}%`,minWidth:10,width:`${A-R}%`},onMouseDown:e=>ea(e,"top",en("top"))}),E>100&&L&&/*#__PURE__*/r(My,{ariaLabel:"调整框选下边界",direction:"horizontal",className:"bottom-0 h-[10px] cursor-ns-resize",style:{left:`${R}%`,minWidth:10,width:`${A-R}%`},onMouseDown:e=>ea(e,"bottom",en("bottom"))}),C.leftPosition<0&&O&&/*#__PURE__*/r(My,{ariaLabel:"调整框选左边界",direction:"vertical",className:"left-0 w-[10px] cursor-ew-resize",style:{height:`${P-I}%`,minHeight:10,top:`${I}%`},onMouseDown:e=>ea(e,"left",en("left"))}),N>100&&O&&/*#__PURE__*/r(My,{ariaLabel:"调整框选右边界",direction:"vertical",className:"right-0 w-[10px] cursor-ew-resize",style:{height:`${P-I}%`,minHeight:10,top:`${I}%`},onMouseDown:e=>ea(e,"right",en("right"))})]}),T&&v&&/*#__PURE__*/r("div",{ref:V,className:"pointer-events-none absolute",style:Z("middle"),children:/*#__PURE__*/r("div",{className:"flex items-start gap-0.5 whitespace-nowrap p-[var(--size-gap-base)]",style:{fontSize:"var(--size-font-second)",color:"var(--foreground)",border:"1px solid var(--border)",borderRadius:"var(--radius-control)",background:"var(--mix-secondary-80)"},children:v})}),T&&F?.left&&/*#__PURE__*/r("div",{ref:X,className:"pointer-events-none absolute whitespace-nowrap p-[calc(var(--size-gap-base)/2)]",style:{...Q,...Z("left")},children:F.left}),T&&F?.right&&/*#__PURE__*/r("div",{ref:K,className:"pointer-events-none absolute whitespace-nowrap p-[calc(var(--size-gap-base)/2)]",style:{...Q,...Z("right")},children:F.right}),T&&F?.top&&/*#__PURE__*/r("div",{ref:Y,className:"pointer-events-none absolute whitespace-nowrap p-[calc(var(--size-gap-base)/2)]",style:{...Q,...Z("top")},children:F.top}),T&&F?.bottom&&/*#__PURE__*/r("div",{ref:U,className:"pointer-events-none absolute whitespace-nowrap p-[calc(var(--size-gap-base)/2)]",style:{...Q,...Z("bottom")},children:F.bottom})]}):null},MT=ME,MR=1e6,MA=(e,t,r)=>Math.min(r,Math.max(t,e)),MI=e=>{if(!e)return null;let t=Number(e(0)),r=Number(e(100));return Number.isFinite(t)&&Number.isFinite(r)&&t!==r?[t,r]:null},MP=(e,t,r)=>{if(!t?.length)return null;let n=100*MA(e,0,1),a=t.length-1;for(let e=0;e<t.length;e+=1){let i=t[e],o=Math.min(i.progress[0],i.progress[1]),l=Math.max(i.progress[0],i.progress[1]);if(!("start"===r?n>=o&&(n<l||e===a&&n<=l):(n>o||0===e)&&n<=l))continue;let s=l-o,c=s?(n-o)/s:0;return i.start+(i.stop-i.start)*c}return null},ML=(e,t,r,n)=>{let a=r?.(100*MA(e,0,1)),i=void 0===a?0/0:Number(a);return Number.isFinite(i)?i:MP(e,t,n)},MO=(e,t,r)=>{if(t?.length){let r=null;for(let n of t){let t=n.start,a=n.stop,i=Math.min(t,a),o=Math.max(t,a),l=n.progress[0]/100,s=n.progress[1]/100;if(e>=i&&e<=o){let r=a-t;return MA(l+(s-l)*(r?(e-t)/r:0),0,1)}for(let n of[{distance:Math.abs(e-t),ratio:l},{distance:Math.abs(e-a),ratio:s}])(!r||n.distance<r.distance)&&(r=n)}if(r)return MA(r.ratio,0,1)}let n=MI(r);return n?MA((e-n[0])/(n[1]-n[0]),0,1):null},Mq=({frequencyFormat:e,frequencyRange:t,segments:r})=>{let n=MO(t[0],r,e),a=MO(t[1],r,e);return null===n||null===a?null:[Math.min(n,a),Math.max(n,a)]},M$=(e,t,r)=>{let n=ML(e[0],t,r,"start"),a=ML(e[1],t,r,"end");return null===n||null===a?null:[Math.min(n,a),Math.max(n,a)]},M_=({frequencyFormat:e,rect:t,segments:r,waterfallSnapshot:n})=>{let a=xF(n,{startLeft:t.leftPosition,endLeft:t.leftPosition+t.width,startTop:t.position+t.height,endTop:t.position});if(!a||n.sourceSize.width<=0)return null;let i=[a.x[0]/n.sourceSize.width,a.x[1]/n.sourceSize.width];return{frequency:M$(i,r,e),x:i,y:a.y}},Mj=({dragType:e,frequencyFormat:t,rect:r,segments:n,startSelection:a,waterfallSnapshot:i})=>{let o=M_({frequencyFormat:t,rect:r,segments:n,waterfallSnapshot:i});if(!o||!a)return o;switch(e){case"left":return{frequency:o.frequency&&a.frequency?[o.frequency[0],a.frequency[1]]:o.frequency,x:[o.x[0],a.x[1]],y:a.y};case"right":return{frequency:o.frequency&&a.frequency?[a.frequency[0],o.frequency[1]]:o.frequency,x:[a.x[0],o.x[1]],y:a.y};case"top":return{frequency:a.frequency,x:a.x,y:[a.y[0],o.y[1]]};case"bottom":return{frequency:a.frequency,x:a.x,y:[o.y[0],a.y[1]]};case"middle":return o}},MH=({selection:e,waterfallSnapshot:t})=>{let{sourceSize:r}=t;if(r.width<=0||r.height<=0)return null;let n=MA(Math.min(e.x[0],e.x[1]),0,1),a=MA(Math.max(e.x[0],e.x[1]),n,1),i=MA(Math.min(e.y[0],e.y[1]),0,r.height),o=MA(Math.max(e.y[0],e.y[1]),i,r.height);return{x:[n*r.width,a*r.width],y:[i,o]}},MB=({formatBandwidth:e,frequencyFormat:t,heatmapData:r,rect:n,segments:a,selectionOverride:i,sourceRangeOverride:o,waterfallSnapshot:l})=>{let s=r.length;if(s<=0)return null;let{position:c,height:u,leftPosition:d,width:h}=n,p=l&&i?MH({selection:i,waterfallSnapshot:l}):null,f=o??(l&&p?xD(l,p):null)??(l?xC(l,{startLeft:d,endLeft:d+h,startTop:c+u,endTop:c}):null),m=f??x4(c+u,c,s);if(!m)return null;let{startIndex:g,endIndex:b}=m,v=String(r[g]?.timestamp??""),y=String(r[b]?.timestamp??""),w=rK(v),x=rK(y),k=w>0&&x>0?Math.abs(x-w):0,S=f??x3(d,d+h,x1(r).columnCount);if(!S)return null;let{startCol:M,endCol:F}=S,C=l?.sourceSize.width??0,D=M$([(i?100*i.x[0]:o&&C>0?100*M/C:l?xv(d,l):d)/100,(i?100*i.x[1]:o&&C>0?(F+1)*100/C:l?xv(d+h,l):d+h)/100],a,t),z=i?.frequency?.[0]??D?.[0],N=i?.frequency?.[1]??D?.[1],E=Number.isFinite(z)?Math.round(1e6*Number(z))/1e6:0,T=Number.isFinite(N)?Math.round(1e6*Number(N))/1e6:0,R=Math.abs(T-E);return{startIndex:g,endIndex:b,startTimestamp:v,endTimestamp:y,duration:k,startCol:M,endCol:F,startFrequency:E,startFrequencyFormat:String(E),endFrequency:T,endFrequencyFormat:String(T),bandwidth:R,bandwidthFormat:e(R)}},MW=30,MG=70,MY=100,MU=0,MX=2,MK={position:MG,height:30,leftPosition:0,width:100},MV=(e,t)=>.01>=Math.abs(e.position-t.position)&&.01>=Math.abs(e.height-t.height)&&.01>=Math.abs(e.leftPosition-t.leftPosition)&&.01>=Math.abs(e.width-t.width),MQ=(e,t)=>.01>=Math.abs(e.top-t.top)&&.01>=Math.abs(e.bottom-t.bottom)&&.01>=Math.abs(e.left-t.left)&&.01>=Math.abs(e.right-t.right),MZ=(e,t)=>e.startIndex===t.startIndex&&e.endIndex===t.endIndex&&e.startTimestamp===t.startTimestamp&&e.endTimestamp===t.endTimestamp&&e.duration===t.duration&&e.startCol===t.startCol&&e.endCol===t.endCol&&e.startFrequency===t.startFrequency&&e.startFrequencyFormat===t.startFrequencyFormat&&e.endFrequency===t.endFrequency&&e.endFrequencyFormat===t.endFrequencyFormat&&e.bandwidth===t.bandwidth&&e.bandwidthFormat===t.bandwidthFormat,MJ=({id:e})=>{let{state:{globalID:t,heatmapCapture:{type:r,show:a,display:i,interval:o,onChange:l},axisX:{frequencyFormat:s,unit:c},segments:d}}=ae(),p=m(()=>r===nn.Slider&&a&&i,[r,a,i]),[f,v]=b(),y=g(void 0),w=g(null),[x,k]=b(MK),[S,M]=b(),F=g(x),C=g(null),D=g(null),z=g(null),N=g(null),E=g(s),T=g(d);E.current=s,T.current=d;let R=u(e=>{F.current=e,k(t=>MV(t,e)?t:e)},[]),A=u(e=>{M(t=>t&&e?MQ(t,e)?t:e:t===e?t:e)},[]),I=u(e=>{let r=kn(t),n=C.current,a=r&&n?MH({selection:n,waterfallSnapshot:r}):null;SX(t,p&&e&&a?a:null)},[p,t]),P=u((e,r)=>{y.current=e,v(e),I(e),r&&(w.current=kn(t)?.rawData??null,l?.(e))},[t,l,I]);h(()=>{if(t)return I(p?y.current??null:null),()=>SX(t,null)},[p,t,I]);let L=u(()=>{let e=tO(t).getAllRawData().waterfallData??[];return[e,e.length]},[t]),O=u((e,r)=>{let[n]=L();return MB({formatBandwidth:rm,frequencyFormat:E.current,heatmapData:n,rect:e,segments:T.current,selectionOverride:r,waterfallSnapshot:kn(t)})},[L,t]),q=u((e,r)=>{let n=kn(t);if(!n)return null;let a=r?Mj({dragType:r,frequencyFormat:E.current,rect:e,segments:T.current,startSelection:D.current,waterfallSnapshot:n}):M_({frequencyFormat:E.current,rect:e,segments:T.current,waterfallSnapshot:n});return a&&(C.current=a),a},[t]),[$,_]=b(0);h(()=>{if(e&&t&&p)return tq(e,"Slider",()=>_(e=>e+1))},[e,t,p]);let j=u(e=>{let t=z.current;if(t&&MV(t,e))return;R(e);let r=q(e,N.current),n=O(e,r??void 0);n&&P(n,!1)},[O,R,P,q]),H=u(t=>{let r=w7(e,rl.HeatmapCapture);return!1!==r&&(N.current=t,D.current=C.current,z.current=F.current,r)},[e]),B=u(()=>{N.current=null,D.current=null,z.current=null,wK(wW(e))(),xt(e,rl.HeatmapCapture)},[e]),W=u(e=>{try{let t=C.current??q(e,null),r=O(e,t??void 0);r&&P(r,!0)}finally{B()}},[O,B,P,q]);h(()=>B,[p,B]);let G=u(e=>{let{startIndex:r,endIndex:n,startFrequency:a,endFrequency:i}=e,[o,l]=L(),c=kn(t),u=y.current,d=r===u?.startIndex&&n===u.endIndex,h=C.current?.frequency,p=void 0===a||void 0===i||1e-7>=Math.abs(Math.min(a,i)-(h?.[0]??0/0))&&1e-7>=Math.abs(Math.max(a,i)-(h?.[1]??0/0));if(d&&p)return;let f=F.current;if(c){let{sourceSize:e}=c;if(e.width<=0||e.height<=0)return;let t=l>0&&r>=0&&n<l&&n-r>=Math.ceil(0*l/100),o=C.current??M_({frequencyFormat:E.current,rect:f,segments:T.current,waterfallSnapshot:c}),s=void 0!==a&&void 0!==i?[Math.min(a,i),Math.max(a,i)]:null,d=s?Mq({frequencyFormat:E.current,frequencyRange:s,segments:T.current}):null;if(s&&!d)return;let h={frequency:s??o?.frequency??null,x:d??o?.x??[c.range.x[0]/e.width,c.range.x[1]/e.width],y:t?[Math.min(r,n),Math.max(r,n)+1]:o?.y??[u?.startIndex??c.range.y[0],(u?.endIndex??c.range.y[1]-1)+1]},p=MH({selection:h,waterfallSnapshot:c});if(!p)return;let m=xS(c,p);if(!m)return;C.current=h,R(m);let g=O(m,h);g&&P(g,!0);return}let m=!d&&l>0&&r>=0&&n<l&&n-r>=Math.ceil(0*l/100),g=!1,b=f.leftPosition,v=f.width;if(void 0!==a&&void 0!==i&&s){let e=s(0),t=s(100),r=e?Number(e):0,n=(t?Number(t):0)-r;if(n>0){let e=(a-r)/n*100,t=(i-r)/n*100,o=t-e;e>=0&&t<=100&&o>=0&&(Math.abs(e-f.leftPosition)>.01||Math.abs(o-f.width)>.01)&&(g=!0,b=e,v=o)}}if(!m&&!g)return;let w={position:m?(1-n/l)*100:f.position,height:m?(n-r)/l*100:f.height,leftPosition:b,width:v};R(w);let x=O(w);x&&P(x,!0)},[L,t,s,O,R,P]);return(h(()=>{o&&p&&G(o)},[o?.startIndex,o?.endIndex,o?.startFrequency,o?.endFrequency,p,$,G]),h(()=>{if(!p||!t)return;let e=kn(t),r=y.current;if(e?.sourceSize.width&&e.sourceSize.height){let t=xk(e,{endCol:e.sourceSize.width-1,endIndex:e.sourceSize.height-1,startCol:0,startIndex:0});A(t?{bottom:t.position+t.height,left:t.leftPosition,right:t.leftPosition+t.width,top:t.position}:void 0)}else A(void 0);if(!e){let e=O(F.current);e&&P(e,!0);return}let n=C.current??M_({frequencyFormat:E.current,rect:F.current,segments:T.current,waterfallSnapshot:e});if(!n)return;if(n.frequency){let e=Mq({frequencyFormat:E.current,frequencyRange:n.frequency,segments:T.current});e&&(n={...n,x:e})}C.current=n;let a=MH({selection:n,waterfallSnapshot:e});if(!a)return;let i=xS(e,a);i&&R(i);let o=O(i??F.current,n);if(!o)return;let l=!r||!MZ(o,r),s=w.current!==e.rawData;(l||s)&&P(o,!0)},[$,s,d,p,t,O,R,A,P]),h(()=>{t&&SB(t,e=>{e.interval&&p&&G(e.interval)})},[t,p,G]),p)?/*#__PURE__*/n(ME,{enabled:p,defaultRect:x,minSize:0,maxSize:100,snapThreshold:2,onChange:j,onDragStart:H,onDragEnd:W,zIndex:5,showBoundaryLines:!0,variant:"projected",interactionBounds:S,labels:{left:f?.startFrequencyFormat?`${f.startFrequencyFormat}${c}`:"",right:f?.endFrequencyFormat?`${f.endFrequencyFormat}${c}`:"",top:f?.endTimestamp,bottom:f?.startTimestamp},children:[/*#__PURE__*/n("div",{children:["带宽:",f?.bandwidth!==void 0?rC(1e3*f.bandwidth).formatted:""]}),/*#__PURE__*/n("div",{children:["时长:",f?.duration!==void 0?(f.duration/1e3).toFixed(3):"","s"]})]}):null},M0=MJ,M1=e=>{let{state:{heatmapCapture:t}}=ae(),{show:n,type:a}=t;return n?a===nn.Slider?/*#__PURE__*/r(MJ,{...e}):a===nn.RowIndex?/*#__PURE__*/r(S0,{...e}):/*#__PURE__*/r(SQ,{...e}):null},M2=M1;class M5 extends vH{lastSeriesData=[];constructor(e){super({id:e.id,globalID:e.globalID,chart:null,realRange:e.realRange??ns,heatmapDefaultData:e.heatmapDefaultData??[],renderer:e.renderer})}init(){let{id:e}=this.state;e&&(this.state.chart=new F({id:e,colors:this.getInitialColors(),renderer:this.state.renderer}),this.subscribeToColor("Heatmap-Render"),this.updateSeries(this.state.heatmapDefaultData),this.setRange())}updateSeries(e){Array.isArray(e)&&(this.lastSeriesData=e,this.state.chart?.render(e))}supportsIncrementalWaterfall(){let{chart:e}=this.state;return"function"==typeof e?.append&&"function"==typeof e.replace}appendWaterfallFrame(e,t){this.state.chart?.append&&(this.lastSeriesData=[],this.state.chart.append(e,t))}replaceWaterfallFrames(e,t){this.state.chart?.replace&&(this.lastSeriesData=[],this.state.chart.replace(e,t))}resetWaterfall(){this.lastSeriesData=[],this.state.chart?.clear()}updateParams(e){let t=this.state.realRange,r=this.state.heatmapDefaultData;super.updateParams(e),e.heatmapDefaultData&&e.heatmapDefaultData!==r&&this.updateSeries(e.heatmapDefaultData),e.realRange&&(e.realRange[0]!==t[0]||e.realRange[1]!==t[1])&&this.setRange(e.realRange)}setRange(e=this.state.realRange){let{chart:t}=this.state,[r,n]=e;e&&void 0!==r&&void 0!==n&&t&&(this.state.realRange=e,t.setRange(e))}reset(){this.lastSeriesData=[],this.clear(),this.resize()}resize(){this.setRange(),this.state.chart?.resize(),this.lastSeriesData.length>0&&this.state.chart?.render(this.lastSeriesData)}}let M4=rl.Zoom;function M3(e,t){let r=at(e=>e.globalID),n=g(null);h(()=>{if(!t||!e||!r)return;let a=e=>{let t=tj(r),a=t?.getSnapshot();if(!a?.sourceSize.width||!a.sourceSize.height||"number"!=typeof e.left||"number"!=typeof e.top){n.current=null;return}n.current={start:{left:e.left,top:e.top},viewport:{range:a.range,sourceSize:a.sourceSize}}},i=wU(e,M4,a),o=wZ(e,M4,(e,t)=>{let n=tj(r),a=n?.getSnapshot();if(!n||!a?.sourceSize.width||!a.sourceSize.height||"number"!=typeof t.left||"number"!=typeof t.top)return;let i=xN(a,e,{left:t.left,top:t.top});xV(a,i)||n.updateSamplingRange(xK(i))}),l=wX(e,M4,()=>{if(!w7(e,M4))return!1;let t=ka(r);return xt(e,M4),t}),s=wJ(e,M4,(t,i,o,l)=>{if(l||!t||!i||"number"!=typeof t.left||"number"!=typeof t.top||"number"!=typeof i.left||"number"!=typeof i.top||!w7(e,M4))return;let s=tj(r),c=s?.getSnapshot();if(!s||!c?.sourceSize.width||!c.sourceSize.height)return;n.current||a(t);let u=n.current;if(!u)return;if(u.viewport.sourceSize.width!==c.sourceSize.width||u.viewport.sourceSize.height!==c.sourceSize.height){n.current=null;return}let d=xX(u.viewport,u.start,{left:i.left,top:i.top});xV(c,d)||s.updateSamplingRange(xK(d))}),c=()=>{n.current=null,xt(e,M4)},u=wK(e,M4,c),d=wV(e,M4,c);return()=>{i?.(),o?.(),l?.(),s?.(),u?.(),d?.(),c()}},[t,r,e])}let M6=e=>{let{heatmapDefaultData:t,onSubscriptionReadyChange:a,overview:i,zoomMode:o="disabled",renderer:l}=e,s="independent-xy"===o,c=g(a);c.current=a;let{state:{axisY:{realRange:d},globalID:p}}=ae(),{id:f,chart:b,Chart:v}=iV({Render:M5,params:{realRange:d,heatmapDefaultData:t,globalID:p,renderer:l}}),y=m(()=>{let e=wW(f);return rB((t,r)=>{wZ(e)(t,r)})},[f]),w=u(e=>{e.stopPropagation(),y(-1*e.deltaY,wB(e))},[y]);return S$(f,rr.Heatmap,"linked-x"===o),M3(f,s),i3({moduleType:rr.Heatmap,chart:b,handleRender:(e,t)=>{t.updateSeries?.(e.data),tq(f)()},eventHandlers:{[rn.Option]:e=>{e.key===ra.HeatmapCapture&&SB(p)(e.data)}}}),h(()=>{if(!b||!p||s||!b.supportsIncrementalWaterfall())return;let e=t_(p);if(!e?.setWaterfallSink)return;let t=tq(f);return e.setWaterfallSink({append:(e,r)=>{b.appendWaterfallFrame?.(e,r),t()},replace:(e,r)=>{b.replaceWaterfallFrames?.(e,r),t()},reset:()=>{b.resetWaterfall?.(),t()}}),()=>{t_(p)===e&&e.setWaterfallSink(null)}},[b,p,f,s]),h(()=>{if(b&&p)return c.current?.(!0),()=>{c.current?.(!1)}},[b,p]),/*#__PURE__*/n(yE,{children:[/*#__PURE__*/r(wL,{id:f,chart:b}),/*#__PURE__*/n(ST,{onWheelCapture:s?w:void 0,children:[/*#__PURE__*/r(Sz,{}),/*#__PURE__*/r(v,{}),/*#__PURE__*/r(SC,{id:f}),/*#__PURE__*/r(M1,{id:f}),/*#__PURE__*/r(Sk,{id:f,type:rr.Heatmap}),i]})]})},M8=M6,M9=[{r:0,g:0,b:0,a:1},{r:0,g:0,b:255,a:1},{r:0,g:188,b:212,a:1},{r:45,g:179,b:51,a:1},{r:255,g:235,b:59,a:1},{r:255,g:0,b:0,a:1}],M7={selectionFill:"rgba(255, 210, 64, 0.08)",selectionStroke:"rgba(255, 210, 64, 0.95)",shadow:"rgba(0, 0, 0, 0.8)",viewportFill:"rgba(255, 255, 255, 0.14)",viewportStroke:"rgba(255, 255, 255, 0.95)"},Fe=256,Ft=1024,Fr=2,Fn=(e,t,r)=>Math.min(r,Math.max(t,e)),Fa=(e,t,r,n)=>{let a=Fn(n,0,1)*(r.length-1),i=Math.floor(a),o=Math.min(i+1,r.length-1),l=a-i,s=r[i],c=r[o];e[t]=Math.round(s.r+(c.r-s.r)*l),e[t+1]=Math.round(s.g+(c.g-s.g)*l),e[t+2]=Math.round(s.b+(c.b-s.b)*l),e[t+3]=Math.round(255*Fn(s.a+(c.a-s.a)*l,0,1))},Fi=e=>{if(!Array.isArray(e)||e.length<2)return null;let t=[];for(let r of e){if(!r||"object"!=typeof r||!("r"in r)||!("g"in r)||!("b"in r))return null;let{r:e,g:n,b:a}=r,i="a"in r?r.a:1;if("number"!=typeof e||"number"!=typeof n||"number"!=typeof a||"number"!=typeof i||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(a)||!Number.isFinite(i))return null;t.push({r:Number(e),g:Number(n),b:Number(a),a:Number(i)})}return t},Fo=/*#__PURE__*/s(({globalID:e,onResetViewport:t},a)=>{let i=at(e=>e.axisY.realRange),o=g(null),l=g(null),s=g(null),c=g(null),d=g(null),f=g(M7),m=g(null),b=g(null),v=g(null),y=g(M9),w=g(ns),x=g(null),k=g(!0),S=g(null),M=g(void 0),F=g(null);w.current=[i?.[0]??ns["0"],i?.[1]??ns["1"]];let C=u(()=>{let e=s.current,t=m.current;if(!e)return;let r=e.getContext("2d");if(!r)return;let{width:n,height:a}=e;if(r.clearRect(0,0,n,a),!t?.sourceSize.width||!t.sourceSize.height||n<=0||a<=0){v.current=t?.rawData??null;return}let[i,o]=w.current,l=Math.min(i,o),c=Math.max(i,o)-l||1,u=y.current,h=d.current;h&&h.width===n&&h.height===a||(d.current=h=r.createImageData(n,a));let p=h.data;for(let e=0;e<a;e++){let r=Fn(Math.floor((a-e-.5)*t.sourceSize.height/a),0,t.sourceSize.height-1),i=t.rawData[r];for(let r=0;r<n;r++){let a=Fn(Math.floor((r+.5)*t.sourceSize.width/n),0,t.sourceSize.width-1),o=i?.[a],s=(e*n+r)*4;if(!Number.isFinite(o)){p[s]=0,p[s+1]=0,p[s+2]=0,p[s+3]=0;continue}Fa(p,s,u,(o-l)/c)}}r.putImageData(h,0,0),v.current=t.rawData},[]),D=u(()=>{let e=l.current??c.current;e&&(f.current={selectionFill:ol("--warning",.12,e)||M7.selectionFill,selectionStroke:ol("--warning",.95,e)||M7.selectionStroke,shadow:ol("--background",.86,e)||M7.shadow,viewportFill:ol("--background",.16,e)||M7.viewportFill,viewportStroke:ol("--foreground",.95,e)||M7.viewportStroke})},[]),z=u(()=>{let e=c.current,t=m.current;if(!e)return;let r=e.getContext("2d");if(!r||(r.clearRect(0,0,e.width,e.height),!t?.sourceSize.width||!t.sourceSize.height))return;let{selectionFill:n,selectionStroke:a,shadow:i,viewportFill:o,viewportStroke:l}=f.current,s=xA(t),u=Math.max(1,Math.min(window.devicePixelRatio||1,2)),d=s.left*e.width,h=s.top*e.height,p=Math.max(s.width*e.width,2*u),g=Math.max(s.height*e.height,2*u);r.save(),r.fillStyle=o,r.strokeStyle=l,r.lineWidth=u,r.shadowColor=i,r.shadowBlur=2*u,r.fillRect(d,h,p,g),r.strokeRect(d+u/2,h+u/2,Math.max(0,Math.min(p-u,e.width-d-u)),Math.max(0,Math.min(g-u,e.height-h-u))),r.restore();let v=b.current;if(!v)return;let y=xP(t,v),w=y.left*e.width,x=y.top*e.height,k=Math.max(y.width*e.width,2*u),S=Math.max(y.height*e.height,2*u);r.save(),r.fillStyle=n,r.strokeStyle=a,r.lineWidth=u,r.setLineDash([3*u,2*u]),r.shadowColor=i,r.shadowBlur=2*u,r.fillRect(w,x,k,S),r.strokeRect(w+u/2,x+u/2,Math.max(0,Math.min(k-u,e.width-w-u)),Math.max(0,Math.min(S-u,e.height-x-u))),r.restore()},[]),N=u(e=>{k.current||=e,o.current?.hidden||null===x.current&&(x.current=window.requestAnimationFrame(()=>{x.current=null,k.current&&(k.current=!1,C()),z()}))},[C,z]),E=u(()=>{let e=l.current,t=s.current,r=c.current;if(!e||!t||!r)return;let n=e.getBoundingClientRect(),a=Math.min(window.devicePixelRatio||1,2),i=Math.max(1,Math.min(256,Math.round(n.width*a))),o=Math.max(1,Math.min(1024,Math.round(n.height*a)));(t.width!==i||t.height!==o||r.width!==i||r.height!==o)&&(t.width=i,t.height=o,r.width=i,r.height=o,N(!0))},[N]),T=u(e=>{let t=v.current!==e.rawData;m.current=e;let r=xj(e);if(o.current&&(o.current.hidden=r),r){k.current||=t,F.current=null,o.current?.removeAttribute("data-dragging"),M.current=void 0,null!==x.current&&(window.cancelAnimationFrame(x.current),x.current=null),null!==S.current&&(window.cancelAnimationFrame(S.current),S.current=null),c.current&&(c.current.style.cursor="grab");return}E(),N(t)},[E,N]);p(a,()=>({update:T}),[T]),h(()=>{let t=tj(e)?.getSnapshot();t&&T(t)},[e,T]),h(()=>{N(!0)},[i,N]),h(()=>(D(),oh(()=>{D(),N(!0)})),[N,D]),h(()=>{let t=e=>{b.current=e,N(!1)},r=SK(e,t);return t(SU(e)),r},[e,N]),h(()=>{if(e)return vA(e,"HeatmapOverview",e=>{let t=Fi(e);t&&(y.current=t,N(!0))})},[e,N]),h(()=>{E();let e=l.current;if(!e||"u"<typeof ResizeObserver)return;let t=new ResizeObserver(E);return t.observe(e),()=>t.disconnect()},[E]),h(()=>()=>{null!==x.current&&window.cancelAnimationFrame(x.current),null!==S.current&&window.cancelAnimationFrame(S.current)},[]);let R=u(t=>{let r=tj(e),n=r?.getSnapshot();!r||!n||xV(n,t)||r.updateSamplingRange(xK(t))},[e]),A=u(e=>{M.current=e,null===S.current&&(S.current=window.requestAnimationFrame(()=>{S.current=null;let e=M.current;M.current=void 0,e&&R(e)}))},[R]),I=u(e=>{let t=e.currentTarget.getBoundingClientRect();return{left:t.width?(e.clientX-t.left)/t.width:0,top:t.height?(e.clientY-t.top)/t.height:0}},[]),P=u(e=>{if(0!==e.button)return;let t=m.current;if(!t?.sourceSize.width||!t.sourceSize.height)return;let r=I(e),n=xR(t,r),a=xY(t,n),i=b.current;if(!a&&i&&!xO(t,i)){let r=e.currentTarget.getBoundingClientRect();if(x$(i,n,{x:r.width?6*t.sourceSize.width/r.width:0,y:r.height?6*t.sourceSize.height/r.height:0}))return void A(xB(t,i))}a?(F.current={pointerId:e.pointerId,grabOffset:{x:n.x-t.range.x[0],y:n.y-t.range.y[0]}},o.current?.setAttribute("data-dragging","true"),e.currentTarget.setPointerCapture(e.pointerId),e.currentTarget.style.cursor="grabbing",e.preventDefault()):A(xH(t,r))},[I,A]),L=u(e=>{let t=F.current,r=m.current;t&&t.pointerId===e.pointerId&&r&&A(xG(r,I(e),t.grabOffset))},[I,A]),O=u(e=>{F.current?.pointerId===e.pointerId&&(F.current=null,o.current?.removeAttribute("data-dragging"),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),e.currentTarget.style.cursor="grab")},[]);return /*#__PURE__*/r("aside",{ref:o,"aria-label":"瀑布图全景导航",className:"group absolute right-2 top-2 z-[6] isolate flex h-[14%] w-[14%] overflow-visible before:pointer-events-none before:absolute before:-inset-1 before:z-0 before:rounded-md before:bg-foreground/20 before:opacity-75 before:shadow-sm before:transition-opacity before:duration-100 hover:before:opacity-90 focus-within:before:opacity-90 data-[dragging=true]:before:opacity-100",hidden:!0,children:/*#__PURE__*/n("div",{ref:l,className:"relative z-[1] h-full min-h-0 w-full overflow-hidden rounded-sm",children:[/*#__PURE__*/r("canvas",{ref:s,className:"pointer-events-none absolute inset-0 h-full w-full opacity-60 transition-opacity duration-100 group-hover:opacity-90 group-focus-within:opacity-90 group-data-[dragging=true]:opacity-100"}),/*#__PURE__*/r("canvas",{ref:c,className:"absolute inset-0 h-full w-full touch-none cursor-grab opacity-80 outline-none transition-opacity duration-100 group-hover:opacity-100 group-focus-within:opacity-100 group-data-[dragging=true]:opacity-100 focus-visible:ring-1 focus-visible:ring-ring","aria-label":"瀑布图全景;点击空白区域居中,点击框选范围定位,拖动视口框平移,双击恢复全景",tabIndex:0,onContextMenu:e=>e.preventDefault(),onDoubleClick:e=>{e.preventDefault(),e.stopPropagation(),t()},onLostPointerCapture:O,onPointerCancel:O,onPointerDown:P,onPointerMove:L,onPointerUp:O})]})})});Fo.displayName="HeatmapOverview";let Fl=Fo,Fs=({publish:e,heatmapDefaultData:t,renderer:a})=>{let{state:{globalID:i,zoom:o},dispatch:l}=ae(),s=!0===o.xy&&!1!==o.show,c=s&&o.overview?.show===!0,d=g(s),p=g(i),f=g(null),m=g(null),b=g(!1),v=g(!1),y=g(!1),w=g(t),x=g(rJ(t??[]));d.current=s,p.current=i;let k=u(e=>{let t=p.current;if(!t)return;let r={range:{x:e.range.x,y:e.range.y},sourceSize:e.sourceSize},n=e.sourceSize.width>0?{start:e.range.x[0],end:e.range.x[1]-1}:{start:0,end:0};l({payload:t=>{let a=t.waterfallViewport,i=a.sourceSize.width!==e.sourceSize.width||a.sourceSize.height!==e.sourceSize.height||a.range.x[0]!==e.range.x[0]||a.range.x[1]!==e.range.x[1]||a.range.y[0]!==e.range.y[0]||a.range.y[1]!==e.range.y[1],o=t.zoom.interval.start!==n.start||t.zoom.interval.end!==n.end||null!==t.zoom.style;return i||o?{...i?{waterfallViewport:r}:{},...o?{zoom:{...t.zoom,interval:n,style:null,isScanSegmentsUpdateMagnify:!1}}:{}}:null}}),((e,t,r="0")=>tI(e,t,void 0,r))(t,rr.Heatmap)({pstype:rn.Render,data:e.data}),m.current?.update(e)},[l]),S=u(e=>{if(b.current=e,!e||!d.current)return;let t=f.current,r=x.current;t&&r.length>0&&kr(t,r)},[]);h(()=>{i&&(tO(i).getAllRawData=e=>({...tL().getAllRawData(e),waterfallData:x.current}))},[i]),h(()=>{if(!i)return;if(!s){if(f.current=null,tj(i,null),v.current){v.current=!1;let e=x.current.reduce((e,t)=>Math.max(e,t.length),0);e>0?l({payload:t=>({waterfallViewport:{range:{x:[0,0],y:[0,0]},sourceSize:{width:0,height:0}},zoom:{...t.zoom,interval:{start:0,end:e-1},style:null,isScanSegmentsUpdateMagnify:!1}})}):l({payload:{waterfallViewport:{range:{x:[0,0],y:[0,0]},sourceSize:{width:0,height:0}}}})}x.current.length>0&&((e,t,r="0")=>tI(e,t,void 0,r))(i,rr.Heatmap)({pstype:rn.Render,data:x.current});return}let e=new q({onWaterfallUpdate:k});return f.current=e,v.current=!0,tj(i,e),b.current&&x.current.length>0&&kr(e,x.current),()=>{f.current===e&&(f.current=null),tj(i,null)}},[l,i,k,s]),h(()=>{if(Object.is(w.current,t))return;w.current=t,y.current=!1;let e=rJ(t??[]);x.current=e;let r=f.current;s&&b.current&&r&&kr(r,e)},[t,s]);let M=wM(rt.Heatmap),F=u(()=>{let e=p.current;e&&ka(e)},[]);ac({publish:e,resetViewport:F,subscribe:e=>{M(e);let{pstype:t}=e;if(t===rn.Heatmap){let{data:t,timestamps:r}=e,n=rJ(t,r);x.current=n;let a=f.current;d.current?b.current&&a&&kr(a,n):((e,t,r="0")=>tI(e,t,void 0,r))(i,rr.Heatmap)({pstype:rn.Render,data:n})}if(t===rn.Reset||t===rn.Clear){y.current=!0,x.current=[],f.current?.setData([]),((e,t,r="0")=>tI(e,t,void 0,r))(i,rr.Heatmap)({pstype:rn.Reset}),t===rn.Reset&&((e,t,r="0")=>tI(e,t,void 0,r))(i,rn.Reset)(e),e.onFinally?.();return}((e,t,r="0")=>tI(e,t,void 0,r))(i,rr.Heatmap)(e)}});let C=!Object.is(w.current,t);return /*#__PURE__*/n(am,{children:[/*#__PURE__*/r(yE,{children:/*#__PURE__*/r(M6,{renderer:a,heatmapDefaultData:s||y.current&&!C?void 0:t,onSubscriptionReadyChange:S,overview:c?/*#__PURE__*/r(Fo,{ref:m,globalID:i,onResetViewport:F}):null,zoomMode:s?"independent-xy":"disabled"})}),/*#__PURE__*/r(yN,{type:rt.Heatmap})]})},Fc=Fs,Fu=e=>/*#__PURE__*/r(aa,{...e,children:/*#__PURE__*/r(Fs,{...e})}),Fd=tB(Fu,"Heatmap"),Fh=Fd;function Fp({type:e="iqEye"}){let{chart:t,Chart:n}=iV({Render:m(()=>class extends vW{constructor(t){super({...t,type:e})}},[e])});return i3({moduleType:rr.IQEye,chart:t}),/*#__PURE__*/r(n,{})}let Ff={interval:0,majorTickValues:[]},Fm=7,Fg=.5,Fb=e=>{let[t,r]=e??[],n=r-t;if(!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)||n<=0)return 0;let a=n/7,i=10**Math.floor(Math.log10(a)),o=a/i;return Math.max(o<=1?i:o<=2?2*i:o<=5?5*i:o<=6?6*i:10*i,.5/14)},Fv=e=>{let[t,r]=e??[],n=Fb(e);if(!n)return Ff;let a=Math.ceil(t/n)*n,i=Math.floor((r+1e-6*n-a)/n);if(!Number.isFinite(i)||i<0)return{interval:n,majorTickValues:[]};let o=Array.from({length:i+1},(e,t)=>a+t*n);return{interval:n,majorTickValues:o}},Fy=e=>"number"==typeof e&&Number.isFinite(e)&&e>0?Math.ceil(e):0,Fw=e=>`${100*Math.min(1,Math.max(0,e))}%`,Fx=({horizontalPositions:e=[],col:t=10,strokeColor:a="var(--chart-grid)",strokeWidth:i=1,strokeDasharray:o=4})=>{let l=Fy(t);return /*#__PURE__*/n("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-full w-full",shapeRendering:"crispEdges",children:[m(()=>e.map(e=>{let t=Fw(e);return /*#__PURE__*/r("line",{x1:"0%",y1:t,x2:"100%",y2:t,stroke:a,strokeWidth:i,strokeDasharray:o,vectorEffect:"non-scaling-stroke"},`h-${e}`)}),[e,a,o,i]),m(()=>l>0?Array.from({length:l+1},(e,t)=>{let n=`${t/l*100}%`;return /*#__PURE__*/r("line",{x1:n,y1:"0%",x2:n,y2:"100%",stroke:a,strokeWidth:i,strokeDasharray:o,vectorEffect:"non-scaling-stroke"},`v-${(t/l).toFixed(6)}`)}):[],[l,a,o,i])]})},Fk=Fx,FS=e=>{let[t,r]=e??[],n=r-t;if(!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)||n<=0)return[];let{majorTickValues:a}=Fv(e);return a.map(e=>(r-e)/n).filter(e=>e>=-1e-9&&e<=1+1e-9).map(e=>Math.min(1,Math.max(0,e)))},FM=()=>{let{state:{gridLines:e,segments:t,axisY:{range:n}}}=ae(),a=m(()=>FS(n),[n]),i=t.length>1?1:10;return e?/*#__PURE__*/r("div",{className:"pointer-events-none absolute right-0 top-0 z-[1] h-full w-full select-none overflow-hidden",children:/*#__PURE__*/r(Fx,{col:i,horizontalPositions:a})}):null},FF=/*#__PURE__*/a.memo(FM);class FC extends of{useRangeAutoFocus=()=>{};firstRenderAutoFocus=!1;constructor(e){super({chart:null,autoranging:!1,prevAutoRangeTime:0,id:"id",renderRange:ns,interval:1,series:{},globalID:"",...e})}init(){if(this.state.chart)return;let{id:e,renderRange:t,globalID:r}=this.state;e&&(this.trackCleanup(y6(this)),this.state.chart=new N({id:e,range:t}),this.initSeries(),this.useRangeAutoFocus=()=>{nj(r)()},this.trackCleanup(nW(r,e=>{this.setRange(e)})))}initSeries(){let{globalID:e}=this.state;if(!e)throw Error("globalID is required for series initialization");wf(e).forEach(e=>{this.setSeries(e,!0)}),this.state.chart?.draw()}updateSeries({data:e,extraData:t}){let{series:r,chart:n}=this.state;if(n){if(e){let t=Object.entries(r);for(let r=0;r<t.length;r+=1){let[a]=t[r],i=e[a];i&&t4.includes(a)&&(n.render({name:a,data:i}),a===t3&&this.updateMainSeries(i))}}if(t){let e=Object.entries(t);for(let t=0;t<e.length;t+=1){let[a,i]=e[t],o=r[a];i&&n.render({...o,name:a,data:i})}}}}updateMainSeries(e){let{autoranging:t,interval:r,prevAutoRangeTime:n,chart:a}=this.state;if(!a)return;let i=e.length;i!==r&&(this.state.interval=i,a.setIntervel(i));let o=Date.now();t&&o-n>1e3&&(this.state.prevAutoRangeTime=o,this.useRangeAutoFocus()),this.firstRenderAutoFocus||void 0===e.at(0)||(this.firstRenderAutoFocus=!0)}setSeries(e,t=!1){let{chart:r,series:n,globalID:a}=this.state,{name:i}=e;if(!r||!i||!e)return;let o={...n[i],...e},l=o.type;!e.type&&a&&(l=wt(a,i));let{color:s=t5[i]?.color,thickness:c=1,display:u=!1}=o,d={name:i,label:o.label,type:l||M.Line,color:s,thickness:c,display:u};if(this.state.series={...n,[i]:d},r.setSeries(d),!t&&a)try{wd(a,{name:i,label:d.label||i,color:s,thickness:c,display:u,type:d.type})}catch(e){console.warn("Failed to update series in new management system:",e)}}setDisabledClearRect(e){this.state.chart?.updateProps({disabledClearRect:e})}setRange(e=this.state.renderRange){let{chart:t}=this.state,[r,n]=e;void 0!==r&&void 0!==n&&t&&(this.state.renderRange=e,t.setRange(e))}zoom(){let{chart:e,interval:t}=this.state;e&&e.setIntervel(t)}reset(){this.clear(),this.resize()}resize(){this.state.chart?this.hasRenderableContainerSize()&&(this.setRange(),this.zoom(),this.state.chart.resize()):this.initializeChartWhenReady()}clearChart(){this.clear()}}let FD=()=>{let{state:{axisY:{autoranging:e}}}=ae(),{chart:t,Chart:a}=iV({Render:FC,params:{autoranging:e}});return h(()=>{if(t){let{lineColor:e,pointColor:r}=t0("iq");t.setSeries({name:t5.realData.name,label:"IData",color:e}),t.setSeries({name:t5.maxData.name,label:"QData",color:r})}},[t]),i3({moduleType:rr.IQLine,chart:t,handleRender:(e,t)=>{let{IData:r,QData:n}=e;if(r&&n){let{min:e,max:a}=tU([...r,...n]),i=(a-e)/8;t.setRange?.([e-i,a+i]),t.updateSeries?.({data:{[t5.realData.name]:r,[t5.maxData.name]:n}})}},eventHandlers:{[rn.Reset]:(e,t)=>{t.reset()}}}),/*#__PURE__*/n(yE,{children:[/*#__PURE__*/r(FF,{}),/*#__PURE__*/r(a,{})]})},Fz=FD;function FN({type:e="iqPlanisphere"}){let{chart:t,Chart:n}=iV({Render:m(()=>class extends vW{constructor(t){super({...t,type:e})}},[e])});return i3({moduleType:rr.IQPlanisphere,chart:t}),/*#__PURE__*/r(oL,{children:/*#__PURE__*/r(n,{})})}let FE=({type:e="iqStream"})=>{let{chart:t,Chart:n}=iV({Render:m(()=>class extends vW{constructor(t){super({...t,type:e})}},[e])});return i3({moduleType:rr.IQStream,chart:t}),/*#__PURE__*/r(oL,{children:/*#__PURE__*/r(n,{})})},FT=FE,FR=e=>{let{type:t,publish:n}=e,{state:{globalID:a}}=ae();return h(()=>{a&&t===rt.IQEye&&((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.IQEye)({pstype:rn.Render})},[]),ac({publish:n,subscribe:e=>{let r=oI(e,{renderPSTypes:[rn.IQ]});switch(t){case rt.IQEye:((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.IQEye)(r);break;case rt.IQLine:((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.IQLine)(r);break;case rt.IQPlanisphere:((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.IQPlanisphere)(r);break;case rt.IQStream:((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.IQStream)(r)}}}),/*#__PURE__*/r(am,{children:/*#__PURE__*/r(m(()=>{switch(t){case rt.IQEye:return Fp;case rt.IQLine:return FD;case rt.IQPlanisphere:return FN;case rt.IQStream:return FE;default:return FN}},[t]),{})})},FA=FR,FI=e=>/*#__PURE__*/r(aa,{system:{padding:!1,border:!1},...e,children:/*#__PURE__*/r(FR,{...e})}),FP=tB(FI,"IQ"),FL=FP,FO=Object.values(rr),Fq=()=>{let{state:{globalID:e,publish:t}}=ae();return /*#__PURE__*/r(vd,{onClick:()=>{t?.({pstype:rn.Reset}),FO.forEach(t=>{((e,t,r="0")=>tI(e,t,void 0,r))(e,t)({pstype:rn.Reset})})},title:"重置",children:/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{d:"M512 160c-141.6 0-265.6 76.8-332.8 192l-76.8-76.8v224h224l-89.6-89.6C288 307.2 390.4 240 512 240c159.2 0 288 128.8 288 288s-128.8 288-288 288c-115.2 0-214.4-67.2-262.4-164.8l-68.8 36.8C240 800 364.8 880 512 880c194.4 0 352-157.6 352-352S706.4 160 512 160z",fill:"currentColor"})})})},F$=Fq,F_=()=>{let{state:{segments:e,globalID:t}}=ae(),[n,a]=b([]),[i,o]=b(null),l=e.totalPoints??0;h(()=>{a(e.map(e=>({display:!1,ratio:l>0?e.point/l:0})))},[e,l]);let s=u(e=>{let r="number"==typeof e?e:null;a(n.map((e,t)=>({...e,display:t===r}))),o(r),wS(t)(r??void 0)},[n,t]);return /*#__PURE__*/r(vz,{value:i,options:[{value:null,label:"所有频段"},...e.map((e,t)=>({value:t,label:`频段 ${e.start} - ${e.stop}`}))],onChange:s})},Fj=F_,FH=({type:e})=>{let{state:{globalID:t}}=ae(),{mode:a}=xl(t),i=u(()=>{e===rt.MScan||e===rt.ScanDF360||t&&y4(t)},[t,e]),o=m(()=>e===rt.MScan||e===rt.ScanDF360?"图形模式切换已禁用":`当前图形模式:${yJ[a]?.label||a}`,[a,e]),l=e===rt.MScan||e===rt.ScanDF360,s=m(()=>()=>{switch(a){case"bar":return /*#__PURE__*/n("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("rect",{x:"2",y:"8",width:"2",height:"6",fill:"currentColor"}),/*#__PURE__*/r("rect",{x:"5",y:"4",width:"2",height:"10",fill:"currentColor"}),/*#__PURE__*/r("rect",{x:"8",y:"6",width:"2",height:"8",fill:"currentColor"}),/*#__PURE__*/r("rect",{x:"11",y:"2",width:"2",height:"12",fill:"currentColor"})]});case"stepline":return /*#__PURE__*/r("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{d:"M2 12H4V8H6V8H8V4H10V4H12V2H14",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})});case"line":return /*#__PURE__*/r("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{d:"M2 12L5 8L8 10L11 4L14 6",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})});case"area":return /*#__PURE__*/n("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("path",{d:"M2 12L5 8L8 10L11 4L14 6V14H2V12Z",fill:"currentColor",opacity:"0.6"}),/*#__PURE__*/r("path",{d:"M2 12L5 8L8 10L11 4L14 6",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})]});default:return null}},[a]);return /*#__PURE__*/r(vd,{title:o,disabled:l,onClick:l?void 0:i,className:iX(l&&"text-muted-foreground"),children:s()})},FB=FH,FW=()=>{let{state:{globalID:e,series:t}}=ae(),a=xd(e);h(()=>{if(!e||!t?.forceDisplay)return;let r=a.filter(e=>!e.display);r.length>0&&wp(e,r.map(({name:e})=>({name:e,display:!0})))},[e,t?.forceDisplay,a.length]);let i=u(t=>{e&&0!==t.length&&wp(e,t)},[e]),o=u((e,t)=>{i([{name:e,display:t}])},[i]),l=u(e=>{let t=a.filter(t=>t.display!==e).map(t=>({name:t.name,display:e}));t.length>0&&i(t)},[a,i]),s=m(()=>{let e=a.every(e=>e.display);return[{label:e?"全不选":"全选",value:"__toggle_all__",onSelect:()=>l(!e),render:()=>/*#__PURE__*/r("span",{className:"inline-flex w-full text-xs font-medium",children:e?"全不选":"全选"})},...a.map(e=>{let t=e.display?"text-foreground opacity-100":"font-normal text-muted-foreground opacity-70";return{label:e.label||e.name,value:e.name,onSelect:()=>o(e.name,!e.display),render:()=>/*#__PURE__*/n("div",{className:"flex w-full min-w-0 items-center gap-[var(--size-gap-base)]",children:[/*#__PURE__*/r("span",{"aria-hidden":"true",className:iX("inline-flex h-3.5 w-3.5 shrink-0 rounded-[var(--radius-micro)] border transition-colors",e.display?"border-transparent":"border-border/70 bg-transparent opacity-55"),style:{backgroundColor:e.display?e.color:"transparent"}}),/*#__PURE__*/r("span",{className:iX("min-w-0 truncate text-xs",t),children:e.label||e.name})]})}})]},[a,o,l]);return /*#__PURE__*/r(vN,{value:m(()=>{let e=a.filter(e=>e.display).length,t=a.length;return 0===e?"无选择":e===t?"全部":`${e}/${t}`},[a]),options:s,title:"系列显示控制",icon:/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("path",{d:"M930.909091 896H93.090909c-18.618182 0-34.909091-16.290909-34.909091-34.909091V162.909091c0-18.618182 16.290909-34.909091 34.909091-34.909091h837.818182c18.618182 0 34.909091 16.290909 34.909091 34.909091v698.181818c0 18.618182-16.290909 34.909091-34.909091 34.909091z m-802.909091-69.818182h770.327273v-628.363636H128v628.363636z",fill:"currentColor"}),/*#__PURE__*/r("path",{d:"M232.727273 640c-4.654545 0-9.309091 0-13.963637-2.327273-16.290909-6.981818-25.6-27.927273-18.618181-44.218182l116.363636-279.272727c4.654545-11.636364 16.290909-20.945455 30.254545-20.945454 13.963636 0 25.6 4.654545 32.581819 16.290909l83.781818 146.618182H814.545455c18.618182 0 34.909091 16.290909 34.90909 34.90909s-16.290909 34.909091-34.90909 34.909091H442.181818c-11.636364 0-23.272727-6.981818-30.254545-16.290909l-58.181818-102.4-90.763637 216.436364c-4.654545 6.981818-16.290909 16.290909-30.254545 16.290909zM814.545455 663.272727H488.727273c-18.618182 0-34.909091-16.290909-34.909091-34.909091s16.290909-34.909091 34.909091-34.909091h325.818182c18.618182 0 34.909091 16.290909 34.90909 34.909091s-16.290909 34.909091-34.90909 34.909091z",fill:"currentColor"})]}),closeOnSelect:!1})},FG=FW,FY=()=>{let{state:{zoom:e,segments:t},dispatch:n}=ae(),{show:a,autoCloseTimeout:i,interval:{start:o,end:l}}=e,s=t.totalPoints??0,c=Math.max(s-1,0),[d,p]=b(!0),f=g(null);h(()=>()=>{f.current&&clearTimeout(f.current)},[]),h(()=>{f.current&&clearTimeout(f.current),p(!1),f.current=setTimeout(()=>{v()},i)},[o,l,i]);let v=u(()=>{n({payload:{zoom:ya(e,s)}}),p(!0)},[e,s,n]),y=m(()=>s?{background:`linear-gradient(to right,
|
|
3760
3764
|
transparent ${(o+1)/s*100}%,
|
|
3761
3765
|
var(--chart-grid-strong) ${(o+1)/s*100}%,
|
|
3762
3766
|
var(--chart-grid-strong) ${(l+1)/s*100}%,
|
|
3763
3767
|
transparent ${(l+1)/s*100}%
|
|
3764
|
-
)`}:{background:"transparent"},[o,l,s]),w=m(()=>0===o&&l===c,[o,l,c]);return a?/*#__PURE__*/r(vp,{active:!d&&!w,tone:"primary",disabled:d,onClick:d?void 0:v,title:"缩放:左键按住移动,滚轮缩放,右键框选,点击全景展示",contentClassName:"w-4 justify-center",children:d||w?/*#__PURE__*/r("svg",{width:"16",height:"16",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{d:"M388.266667 512L290.133333 413.866667l29.866667-29.866667 149.333333 149.333333L320 682.666667l-29.866667-29.866667L388.266667 554.666667H128v-42.666667h260.266667z m290.133333 0H938.666667v42.666667h-260.266667l98.133333 98.133333-29.866666 29.866667-149.333334-149.333334L746.666667 384l29.866666 29.866667-98.133333 98.133333z",fill:"currentColor"})}):/*#__PURE__*/r("div",{className:"flex h-full w-4 bg-chart-surface",children:/*#__PURE__*/r("div",{className:"h-full w-full opacity-30",style:y})})}):null},CU=CY,CX=()=>{let{state:{fluorescence:e},dispatch:t}=ae(),{show:a,display:i,renderMode:o=k.Gaussian}=e,l=u(()=>{t({payload:{fluorescence:{...e,display:!i}}})},[e,i,t]),s=u(r=>{null!==r&&t({payload:{fluorescence:{...e,renderMode:r}}})},[e,t]),c=m(()=>`荧光谱:${i?"显示":"隐藏"}`,[i]),d=o===k.Gaussian?()=>/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("path",{fill:"currentColor",d:"M905.7 588.2C760 439.5 774.8 382.9 796.2 323.6c21.5-59.3-30.6-320.6-223.6-219C379.5 206.2 437 342.1 299.3 336c-137.7-6-306.9 67.8-206 340.2 39.5 106.4 114.5 209.7 230.6 224.6s306.8-23 422.9 34.7c116.2 57.6 304.5-198.6 158.9-347.3zM715.5 867c-98-45.6-258.3-18.8-356.8-29.7S184.3 757.8 152 671.8C69.2 452 229.3 389.9 346.2 393.5 463 397 413.5 260.9 578.3 176.7c164.9-84.2 175.4 133.9 156.6 182.2C713.1 414.7 715 467.7 842.5 592c122.3 119.1-28.9 320.7-127 275z"}),/*#__PURE__*/r("path",{fill:"currentColor",d:"M433.4 501c-88.1 41.2-99.5-56.2-207.6 36.8-53 45.6-7.5 153.6 60.8 175.7 68.4 22.2 135.9-2.3 189-48.4 53-46.3 46-205.5-42.2-164.1zM665.8 464.6c-4.3-103.8 47.5-259.5-55.4-233-63.3 16.3-122.9 122.4-97.3 169.7 25.6 47.1 80.7 130.9 62.6 191.6-18 60.6-4.6 134.2 55.7 156 60.4 21.8 189.4 14.5 191.1-49.1 1.6-63.6-152.3-131.3-156.7-235.2z"})]}):()=>/*#__PURE__*/n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("rect",{x:"1.9",y:"1.9",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.6"}),/*#__PURE__*/r("rect",{x:"6.6",y:"1.9",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.75"}),/*#__PURE__*/r("rect",{x:"11.3",y:"1.9",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.85"}),/*#__PURE__*/r("rect",{x:"1.9",y:"6.6",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.7"}),/*#__PURE__*/r("rect",{x:"6.6",y:"6.6",width:"2.8",height:"2.8",fill:"currentColor",opacity:"1"}),/*#__PURE__*/r("rect",{x:"11.3",y:"6.6",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.9"}),/*#__PURE__*/r("rect",{x:"1.9",y:"11.3",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.8"}),/*#__PURE__*/r("rect",{x:"6.6",y:"11.3",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.95"}),/*#__PURE__*/r("rect",{x:"11.3",y:"11.3",width:"2.8",height:"2.8",fill:"currentColor",opacity:"1"})]}),h=o===k.Grid?-.5:0,p=o===k.Grid?.94:1,f=m(()=>[{value:k.Grid,label:"栅格",render:()=>/*#__PURE__*/r("div",{className:iX("text-xs text-foreground",o===k.Grid&&"text-primary"),children:"栅格渲染"})},{value:k.Gaussian,label:"高斯",render:()=>/*#__PURE__*/r("div",{className:iX("text-xs text-foreground",o===k.Gaussian&&"text-primary"),children:"高斯渲染"})}],[o]);return a?i?/*#__PURE__*/r(vE,{leading:/*#__PURE__*/r(vT,{active:i,tone:"primary",onClick:l,title:c,children:/*#__PURE__*/r(vm,{opticalOffsetY:h,opticalScale:p,children:/*#__PURE__*/r(d,{})})}),value:o,options:f,onChange:s}):/*#__PURE__*/r(vd,{active:i,tone:"primary",onClick:l,title:c,children:/*#__PURE__*/r(vm,{opticalOffsetY:h,opticalScale:p,children:/*#__PURE__*/r(d,{})})}):null},CK=CX,CV=()=>/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",style:{transition:"transform 0.2s ease"},children:[/*#__PURE__*/r("path",{d:"M512 200 L812 824 L212 824 Z",fill:"none",stroke:"currentColor",strokeWidth:"60",strokeLinejoin:"miter"}),/*#__PURE__*/r("line",{x1:"350",y1:"650",x2:"674",y2:"650",stroke:"currentColor",strokeWidth:"40",strokeDasharray:"10,10"}),/*#__PURE__*/r("path",{d:"M 360 650 L 390 630 L 390 670 Z",fill:"currentColor"}),/*#__PURE__*/r("path",{d:"M 664 650 L 634 630 L 634 670 Z",fill:"currentColor"})]}),CQ=CV,CZ=()=>{let{state:{heatmapCapture:e},dispatch:a}=ae(),{show:i,display:o,type:l,toolbarVariant:s}=e,{title:c,icon:d}=m(()=>{if("deltaMeasurement"===s)return{title:o?"退出Δ测量模式":"进入Δ测量模式",icon:/*#__PURE__*/r(CV,{})};let e="瀑布图捕获-区域测量",a=/*#__PURE__*/n(t,{children:[/*#__PURE__*/r("path",{d:"M835.4 757.7h-69.9v-51h18.9v-18.8h51zM713.1 757.7h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0H220v-51h83.9v51zM167.5 757.7H97.6v-69.8h51v18.8h18.9zM148.6 637.5h-51V557h51v80.5z m0-130.7h-51v-80.5h51v80.5z m0-130.8h-51v-80.5h51V376zM148.6 245.2h-51v-69.9h69.9v51h-18.9zM713.1 226.3h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0H220v-51h83.9v51zM835.4 245.2h-51v-18.9h-18.9v-51h69.9zM835.4 637.5h-51V557h51v80.5z m0-130.7h-51v-80.5h51v80.5z m0-130.8h-51v-80.5h51V376z",fill:"currentColor"}),/*#__PURE__*/r("path",{d:"M784.4 615.7h51v233h-51z",fill:"currentColor"}),/*#__PURE__*/r("path",{d:"M693.4 706.7h233v51h-233z",fill:"currentColor"})]});return l===nn.Slider&&(e="瀑布图捕获-滑块",a=/*#__PURE__*/r("path",{d:"M800 124H224c-55 0-100 45-100 100v576c0 55 45 100 100 100h576c55 0 100-45 100-100V224c0-55-45-100-100-100zM224 224h576v576H224V224z M700 324v376H324V324h376z",fill:"currentColor",stroke:"currentColor",strokeWidth:"2"})),l===nn.RowIndex&&(e="瀑布图回放",a=/*#__PURE__*/n(t,{children:[/*#__PURE__*/r("path",{d:"M800 124H224c-55 0-100 45-100 100v576c0 55 45 100 100 100h576c55 0 100-45 100-100V224c0-55-45-100-100-100zM224 224h576v576H224V224z",fill:"none",stroke:"currentColor",strokeWidth:"30"}),/*#__PURE__*/r("path",{d:"M224 512h576",stroke:"currentColor",strokeWidth:"30"})]})),{title:e,icon:/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:a})}},[l,o,s]),h=u(t=>{a({payload:{heatmapCapture:{...e,display:!!t}}})},[e]);return i?/*#__PURE__*/r(vd,{active:o,tone:"primary",onClick:()=>{h(!o)},title:c,children:d}):null},CJ=/*#__PURE__*/a.memo(CZ),C0=500,C1=5e3,C2=100,C5=()=>{let{state:{timeRange:e},dispatch:t}=ae(),r=u(r=>{if(!e)return;let n=r.deltaY<0?e+100:e-100;t({payload:{timeRange:n=Math.max(500,Math.min(5e3,n))}})},[e,t]);return e?/*#__PURE__*/n(vp,{title:"瀑布图时间控制",onWheel:r,contentClassName:"min-w-8 justify-center text-center",children:[(e/1e3).toFixed(1),"s"]}):null},C4=/*#__PURE__*/a.memo(C5),C3=()=>{let{state:{deltaMeasurement:e},dispatch:t}=ae(),{show:n,display:a}=e,i=u(r=>{t({payload:{deltaMeasurement:{...e,display:r}}})},[e,t]);return n?/*#__PURE__*/r(vd,{active:a,tone:"primary",onClick:()=>i(!a),title:a?"退出Δ测量模式":"进入Δ测量模式",children:/*#__PURE__*/r(CV,{})}):null},C6=C3,C8=()=>{let{state:{frequencyAllocation:e},dispatch:t}=ae(),{display:n,show:a}=e,i=u(r=>{t({payload:{frequencyAllocation:{...e,display:!!r}}})},[e]);return a?/*#__PURE__*/r(vd,{active:n,tone:"primary",onClick:()=>{i(!n)},title:"频率划分",children:/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{fill:"currentColor",opacity:"0.75",d:"M64 192h896v96H64zM64 736h896v96H64zM192 352h192v320H192zM448 352h192v320H448zM704 352h192v320H704z"})})}):null},C9=C8,C7=()=>{let{state:{limit:e},dispatch:t}=ae(),{show:n,active:a}=e,i=u(r=>{t({payload:{limit:{...e,active:!!r}}})},[e]);return n?/*#__PURE__*/r(vd,{active:a,tone:"primary",onClick:()=>{i(!a)},title:"门限",children:/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",style:{transform:"scaleX(-1) scale(1, 0.75)"},children:/*#__PURE__*/r("path",{d:"M256 384l0-384 768 0 0 384-64 0 0-320-640 0 0 320zM1024 576l0 448-768 0 0-448 64 0 0 384 640 0 0-384zM512 448l128 0 0 64-128 0zM320 448l128 0 0 64-128 0zM704 448l128 0 0 64-128 0zM896 448l128 0 0 64-128 0zM0 288l192 192-192 192z",fillOpacity:".65",fill:"currentColor"})})}):null},Fe=/*#__PURE__*/a.memo(C7),Ft=new Map,Fr=(e,t)=>{let r=getChartRuntime(e);r?r.store.setState(t):Ft.set(e,t)},Fn=e=>{let t=n6(e);return t?t.getState():Ft.get(e)||null},Fa=e=>{e&&Ft.delete(e)};function Fi(e,t,r,n=!1){let a=Math.max(0,r);if(0===a||0===t.length)return{allowed:!1,keptMarkers:[...e],itemsToAdd:[],evictCount:0};if(!n){let r=Math.max(0,a-e.length);return r<=0?{allowed:!1,keptMarkers:[...e],itemsToAdd:[],evictCount:0}:{allowed:!0,keptMarkers:[...e],itemsToAdd:t.slice(0,r),evictCount:0}}if(t.length>=a)return{allowed:!0,keptMarkers:[],itemsToAdd:t.slice(t.length-a),evictCount:e.length};let i=[...t],o=e.length+i.length;if(o<=a)return{allowed:!0,keptMarkers:[...e],itemsToAdd:i,evictCount:0};let l=o-a;return{allowed:!0,keptMarkers:e.slice(l),itemsToAdd:i,evictCount:l}}let Fo=(e,t)=>tC(`MARKER_UPDATE_ATTRIBUTE-${e}`,"0",t,e),Fl=(e,t)=>createSubscriptionManager(`MARKER_UPDATE_RESET-${e}`,"0",t,e),Fs=(e,t)=>tC(`MARKER_COUNT_CHANGE-${e}`,"0",t,e),Fc=(e,t)=>tC(`MARKER_SELECTION_CHANGE-${e}`,"0",t,e),Fu=(e,t)=>tC(`MARKER_COMMAND-${e}`,"0",t,e),Fd=(e,t)=>{let r=t?.length,n=Math.round(r*e/100)-1;if(!n&&0!==n||r<=1||n>r-1)return e;let a=0,i=r-1,o=n-1,l=n+1;o>=0&&(a=o),l<=i&&(i=l);let s=n,c=t[s];for(let e=a;e<=i;e+=1){let r=t[e];r>c&&(c=r,s=e)}return(s+1)*100/r};function Fh(e,t){let r=1/t;return 100===e?100:(Math.floor(e/100/r)*r+r/2)*100}function Fp({left:e,globalID:t}){let{zoom:r,segments:n}=Fn(t),{start:a,end:i}=r.interval,o=n.totalPoints,l=i-a+1;return{insideLeft:(e*o/100-a)*100/l,outsideLeft:100*a/o,multiple:o/l}}function Ff(e){let t=e?.length;if(!t)return null;let r=-1/0,n=0;for(let a=0;a<t;a+=1){let t=e[a];t>r&&(r=t,n=a)}return{value:r,index:n}}function Fm(e){let t=Ff(e);return t?[t]:null}function Fg(e,t=2,r=.1,n=10){let a=e?.length;if(!a||t<=0)return[];let i=Ff(e);if(!i)return[];let o=i.value*r,l=[],s=e=>{for(let t=0;t<l.length;t+=1){let r=l[t];if(Math.abs(r.index-e.index)<n){e.value>r.value&&(l[t]=e);return}}if(l.length<t){l.push(e),l.sort((e,t)=>t.value-e.value);return}let r=l[l.length-1];e.value>r.value&&(l[l.length-1]=e,l.sort((e,t)=>t.value-e.value))};for(let t=1;t<a-1;t+=1){let r=e[t];if(r<o)continue;let n=e[t-1],a=e[t+1];r>n&&r>a&&s({value:r,index:t})}return l}function Fb(e,t=.1,r=10){let n=e?.length;if(!n)return[];let a=[],i=-1/0;for(let t=0;t<n;t+=1){let r=e[t];r>i&&(i=r)}let o=i*t;for(let t=1;t<n-1;t++){let n=e[t],i=e[t-1],l=e[t+1];n>i&&n>l&&n>=o&&(a.some(e=>Math.abs(e.index-t)<r)||a.push({value:n,index:t}))}return a.sort((e,t)=>t.value-e.value)}function Fv(e,t,r=5){let n=e?.length;if(!n||t<0||t>=n)return null;let a=Math.max(0,t-r),i=Math.min(n-1,t+r),o=-1/0,l=t;for(let t=a;t<=i;t++)e[t]>o&&(o=e[t],l=t);return{value:o,index:l}}let Fy=(e,t,r)=>{let{frequency:n,id:a}=e,i=t[0];if(void 0!==n&&i){let{start:e,stop:t}=i,o=t-e;void 0!==o&&n<t&&n>e&&r?.({pstype:PSType.Marker,event:MarkerEventType.Update,id:a,left:(n-e)*100/o})}},Fw=(e,t,r)=>{let{data:n,...a}=e,i=t[0];if(n?.length&&i){let{start:e,stop:t}=i,o=t-e;if(void 0!==o){let i=[];for(let r=0;r<n.length;r+=1){let a=n[r];a<=t&&a>=e&&i.push((a-e)*100/o)}i.length>0&&r?.({...a,pstype:PSType.Marker,event:MarkerEventType.Add,data:i})}}},Fx=(e,t)=>{if(e<0||e>100)return!1;let r=t[0];if(!r)return!1;let{start:n,stop:a}=r,i=n+e*(a-n)/100;return i>=n&&i<=a},Fk=(e,t)=>{let r=t[0];if(!r)return null;let{start:n,stop:a}=r;return n+e*(a-n)/100},FS=()=>{let{state:{globalID:e,marker:a},dispatch:i}=ae(),{enabled:o,visible:l,maxCount:s,fifo:c,readonly:d}=a,p=o&&!d,[f,g]=b(0),[v,y]=b(null);h(()=>{if(e&&p){let t=Fs(e,e=>{e&&g(t=>t===e.count?t:e.count)});return()=>{t?.()}}},[e,p]),h(()=>{if(e&&p){let t=Fc(e,e=>{y(e?.selectedId??null)});return()=>{t?.()}}},[e,p]);let w=u(e=>{i({payload:{marker:{...a,visible:!!e}}})},[a,i]);h(()=>{if(!p)return;let e=e=>{if("m"!==e.key.toLowerCase()||e.repeat)return;let t=e.target;t?.tagName==="INPUT"||t?.tagName==="TEXTAREA"||t?.isContentEditable||(e.preventDefault(),w(!l))};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[p,l,w]);let x=s>0?s:5,k=f>=x,S=!!v,M=m(()=>/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("path",{d:"M643.657143 241.956571L913.700571 512 643.657143 782.043429 373.613714 512z",fill:"currentColor",opacity:"0.5"}),/*#__PURE__*/r("path",{d:"M380.342857 241.956571L650.386286 512 380.342857 782.043429 110.299429 512z",fill:"currentColor"})]}),[]),C=u(()=>{e&&v&&Fu(e)({type:"left-peak",selectedId:v})},[e,v]),F=u(()=>{e&&v&&Fu(e)({type:"right-peak",selectedId:v})},[e,v]),D=u(()=>{e&&Fu(e)({type:"create-main-peak"})},[e]),z=u(()=>{e&&Fu(e)({type:"create-secondary-peak"})},[e]),N=u(()=>{e&&Fu(e)({type:"clear-all"})},[e]);if(!p)return null;let E=f>0,T=/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{d:"M724 218L512 430 300 218l-82 82 294 294 294-294z",fill:"currentColor",transform:"rotate(90 512 512)"})}),R=/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{d:"M724 218L512 430 300 218l-82 82 294 294 294-294z",fill:"currentColor",transform:"rotate(-90 512 512)"})}),A=/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("path",{d:"M200 750L400 450 512 200 624 450 824 750",stroke:"currentColor",strokeWidth:"80",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/r("circle",{cx:"512",cy:"200",r:"60",fill:"currentColor"})]}),I=/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("path",{d:"M150 750L300 400 450 550 600 250 750 500 900 750",stroke:"currentColor",strokeWidth:"70",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/r("circle",{cx:"450",cy:"550",r:"50",fill:"currentColor"})]}),P=/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",style:{transform:"scale(0.9)"},children:[/*#__PURE__*/r("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72z",fill:"currentColor"}),/*#__PURE__*/r("path",{d:"M864 256H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h466c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z",fill:"currentColor"})]}),L=`标记点控制 (M键切换)
|
|
3768
|
+
)`}:{background:"transparent"},[o,l,s]),w=m(()=>0===o&&l===c,[o,l,c]);return a?/*#__PURE__*/r(vp,{active:!d&&!w,tone:"primary",disabled:d,onClick:d?void 0:v,title:"缩放:左键按住移动,滚轮缩放,右键框选,点击全景展示",contentClassName:"w-4 justify-center",children:d||w?/*#__PURE__*/r("svg",{width:"16",height:"16",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{d:"M388.266667 512L290.133333 413.866667l29.866667-29.866667 149.333333 149.333333L320 682.666667l-29.866667-29.866667L388.266667 554.666667H128v-42.666667h260.266667z m290.133333 0H938.666667v42.666667h-260.266667l98.133333 98.133333-29.866666 29.866667-149.333334-149.333334L746.666667 384l29.866666 29.866667-98.133333 98.133333z",fill:"currentColor"})}):/*#__PURE__*/r("div",{className:"flex h-full w-4 bg-chart-surface",children:/*#__PURE__*/r("div",{className:"h-full w-full opacity-30",style:y})})}):null},FU=FY,FX=()=>{let{state:{fluorescence:e},dispatch:t}=ae(),{show:a,display:i,renderMode:o=k.Gaussian}=e,l=u(()=>{t({payload:{fluorescence:{...e,display:!i}}})},[e,i,t]),s=u(r=>{null!==r&&t({payload:{fluorescence:{...e,renderMode:r}}})},[e,t]),c=m(()=>`荧光谱:${i?"显示":"隐藏"}`,[i]),d=o===k.Gaussian?()=>/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("path",{fill:"currentColor",d:"M905.7 588.2C760 439.5 774.8 382.9 796.2 323.6c21.5-59.3-30.6-320.6-223.6-219C379.5 206.2 437 342.1 299.3 336c-137.7-6-306.9 67.8-206 340.2 39.5 106.4 114.5 209.7 230.6 224.6s306.8-23 422.9 34.7c116.2 57.6 304.5-198.6 158.9-347.3zM715.5 867c-98-45.6-258.3-18.8-356.8-29.7S184.3 757.8 152 671.8C69.2 452 229.3 389.9 346.2 393.5 463 397 413.5 260.9 578.3 176.7c164.9-84.2 175.4 133.9 156.6 182.2C713.1 414.7 715 467.7 842.5 592c122.3 119.1-28.9 320.7-127 275z"}),/*#__PURE__*/r("path",{fill:"currentColor",d:"M433.4 501c-88.1 41.2-99.5-56.2-207.6 36.8-53 45.6-7.5 153.6 60.8 175.7 68.4 22.2 135.9-2.3 189-48.4 53-46.3 46-205.5-42.2-164.1zM665.8 464.6c-4.3-103.8 47.5-259.5-55.4-233-63.3 16.3-122.9 122.4-97.3 169.7 25.6 47.1 80.7 130.9 62.6 191.6-18 60.6-4.6 134.2 55.7 156 60.4 21.8 189.4 14.5 191.1-49.1 1.6-63.6-152.3-131.3-156.7-235.2z"})]}):()=>/*#__PURE__*/n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("rect",{x:"1.9",y:"1.9",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.6"}),/*#__PURE__*/r("rect",{x:"6.6",y:"1.9",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.75"}),/*#__PURE__*/r("rect",{x:"11.3",y:"1.9",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.85"}),/*#__PURE__*/r("rect",{x:"1.9",y:"6.6",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.7"}),/*#__PURE__*/r("rect",{x:"6.6",y:"6.6",width:"2.8",height:"2.8",fill:"currentColor",opacity:"1"}),/*#__PURE__*/r("rect",{x:"11.3",y:"6.6",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.9"}),/*#__PURE__*/r("rect",{x:"1.9",y:"11.3",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.8"}),/*#__PURE__*/r("rect",{x:"6.6",y:"11.3",width:"2.8",height:"2.8",fill:"currentColor",opacity:"0.95"}),/*#__PURE__*/r("rect",{x:"11.3",y:"11.3",width:"2.8",height:"2.8",fill:"currentColor",opacity:"1"})]}),h=o===k.Grid?-.5:0,p=o===k.Grid?.94:1,f=m(()=>[{value:k.Grid,label:"栅格",render:()=>/*#__PURE__*/r("div",{className:iX("text-xs text-foreground",o===k.Grid&&"text-primary"),children:"栅格渲染"})},{value:k.Gaussian,label:"高斯",render:()=>/*#__PURE__*/r("div",{className:iX("text-xs text-foreground",o===k.Gaussian&&"text-primary"),children:"高斯渲染"})}],[o]);return a?i?/*#__PURE__*/r(vE,{leading:/*#__PURE__*/r(vT,{active:i,tone:"primary",onClick:l,title:c,children:/*#__PURE__*/r(vm,{opticalOffsetY:h,opticalScale:p,children:/*#__PURE__*/r(d,{})})}),value:o,options:f,onChange:s}):/*#__PURE__*/r(vd,{active:i,tone:"primary",onClick:l,title:c,children:/*#__PURE__*/r(vm,{opticalOffsetY:h,opticalScale:p,children:/*#__PURE__*/r(d,{})})}):null},FK=FX,FV=()=>/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",style:{transition:"transform 0.2s ease"},children:[/*#__PURE__*/r("path",{d:"M512 200 L812 824 L212 824 Z",fill:"none",stroke:"currentColor",strokeWidth:"60",strokeLinejoin:"miter"}),/*#__PURE__*/r("line",{x1:"350",y1:"650",x2:"674",y2:"650",stroke:"currentColor",strokeWidth:"40",strokeDasharray:"10,10"}),/*#__PURE__*/r("path",{d:"M 360 650 L 390 630 L 390 670 Z",fill:"currentColor"}),/*#__PURE__*/r("path",{d:"M 664 650 L 634 630 L 634 670 Z",fill:"currentColor"})]}),FQ=FV,FZ=()=>{let{state:{heatmapCapture:e},dispatch:a}=ae(),{show:i,display:o,type:l,toolbarVariant:s}=e,{title:c,icon:d}=m(()=>{if("deltaMeasurement"===s)return{title:o?"退出Δ测量模式":"进入Δ测量模式",icon:/*#__PURE__*/r(FV,{})};let e="瀑布图捕获-区域测量",a=/*#__PURE__*/n(t,{children:[/*#__PURE__*/r("path",{d:"M835.4 757.7h-69.9v-51h18.9v-18.8h51zM713.1 757.7h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0H220v-51h83.9v51zM167.5 757.7H97.6v-69.8h51v18.8h18.9zM148.6 637.5h-51V557h51v80.5z m0-130.7h-51v-80.5h51v80.5z m0-130.8h-51v-80.5h51V376zM148.6 245.2h-51v-69.9h69.9v51h-18.9zM713.1 226.3h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0H220v-51h83.9v51zM835.4 245.2h-51v-18.9h-18.9v-51h69.9zM835.4 637.5h-51V557h51v80.5z m0-130.7h-51v-80.5h51v80.5z m0-130.8h-51v-80.5h51V376z",fill:"currentColor"}),/*#__PURE__*/r("path",{d:"M784.4 615.7h51v233h-51z",fill:"currentColor"}),/*#__PURE__*/r("path",{d:"M693.4 706.7h233v51h-233z",fill:"currentColor"})]});return l===nn.Slider&&(e="瀑布图捕获-滑块",a=/*#__PURE__*/r("path",{d:"M800 124H224c-55 0-100 45-100 100v576c0 55 45 100 100 100h576c55 0 100-45 100-100V224c0-55-45-100-100-100zM224 224h576v576H224V224z M700 324v376H324V324h376z",fill:"currentColor",stroke:"currentColor",strokeWidth:"2"})),l===nn.RowIndex&&(e="瀑布图回放",a=/*#__PURE__*/n(t,{children:[/*#__PURE__*/r("path",{d:"M800 124H224c-55 0-100 45-100 100v576c0 55 45 100 100 100h576c55 0 100-45 100-100V224c0-55-45-100-100-100zM224 224h576v576H224V224z",fill:"none",stroke:"currentColor",strokeWidth:"30"}),/*#__PURE__*/r("path",{d:"M224 512h576",stroke:"currentColor",strokeWidth:"30"})]})),{title:e,icon:/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:a})}},[l,o,s]),h=u(t=>{a({payload:{heatmapCapture:{...e,display:!!t}}})},[e]);return i?/*#__PURE__*/r(vd,{active:o,tone:"primary",onClick:()=>{h(!o)},title:c,children:d}):null},FJ=/*#__PURE__*/a.memo(FZ),F0=500,F1=5e3,F2=100,F5=()=>{let{state:{timeRange:e},dispatch:t}=ae(),r=u(r=>{if(!e)return;let n=r.deltaY<0?e+100:e-100;t({payload:{timeRange:n=Math.max(500,Math.min(5e3,n))}})},[e,t]);return e?/*#__PURE__*/n(vp,{title:"瀑布图时间控制",onWheel:r,contentClassName:"min-w-8 justify-center text-center",children:[(e/1e3).toFixed(1),"s"]}):null},F4=/*#__PURE__*/a.memo(F5),F3=()=>{let{state:{deltaMeasurement:e},dispatch:t}=ae(),{show:n,display:a}=e,i=u(r=>{t({payload:{deltaMeasurement:{...e,display:r}}})},[e,t]);return n?/*#__PURE__*/r(vd,{active:a,tone:"primary",onClick:()=>i(!a),title:a?"退出Δ测量模式":"进入Δ测量模式",children:/*#__PURE__*/r(FV,{})}):null},F6=F3,F8=()=>{let{state:{frequencyAllocation:e},dispatch:t}=ae(),{display:n,show:a}=e,i=u(r=>{t({payload:{frequencyAllocation:{...e,display:!!r}}})},[e]);return a?/*#__PURE__*/r(vd,{active:n,tone:"primary",onClick:()=>{i(!n)},title:"频率划分",children:/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{fill:"currentColor",opacity:"0.75",d:"M64 192h896v96H64zM64 736h896v96H64zM192 352h192v320H192zM448 352h192v320H448zM704 352h192v320H704z"})})}):null},F9=F8,F7=()=>{let{state:{limit:e},dispatch:t}=ae(),{show:n,active:a}=e,i=u(r=>{t({payload:{limit:{...e,active:!!r}}})},[e]);return n?/*#__PURE__*/r(vd,{active:a,tone:"primary",onClick:()=>{i(!a)},title:"门限",children:/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",style:{transform:"scaleX(-1) scale(1, 0.75)"},children:/*#__PURE__*/r("path",{d:"M256 384l0-384 768 0 0 384-64 0 0-320-640 0 0 320zM1024 576l0 448-768 0 0-448 64 0 0 384 640 0 0-384zM512 448l128 0 0 64-128 0zM320 448l128 0 0 64-128 0zM704 448l128 0 0 64-128 0zM896 448l128 0 0 64-128 0zM0 288l192 192-192 192z",fillOpacity:".65",fill:"currentColor"})})}):null},Ce=/*#__PURE__*/a.memo(F7),Ct=new Map,Cr=(e,t)=>{let r=getChartRuntime(e);r?r.store.setState(t):Ct.set(e,t)},Cn=e=>{let t=n6(e);return t?t.getState():Ct.get(e)||null},Ca=e=>{e&&Ct.delete(e)};function Ci(e,t,r,n=!1){let a=Math.max(0,r);if(0===a||0===t.length)return{allowed:!1,keptMarkers:[...e],itemsToAdd:[],evictCount:0};if(!n){let r=Math.max(0,a-e.length);return r<=0?{allowed:!1,keptMarkers:[...e],itemsToAdd:[],evictCount:0}:{allowed:!0,keptMarkers:[...e],itemsToAdd:t.slice(0,r),evictCount:0}}if(t.length>=a)return{allowed:!0,keptMarkers:[],itemsToAdd:t.slice(t.length-a),evictCount:e.length};let i=[...t],o=e.length+i.length;if(o<=a)return{allowed:!0,keptMarkers:[...e],itemsToAdd:i,evictCount:0};let l=o-a;return{allowed:!0,keptMarkers:e.slice(l),itemsToAdd:i,evictCount:l}}let Co=(e,t)=>tF(`MARKER_UPDATE_ATTRIBUTE-${e}`,"0",t,e),Cl=(e,t)=>createSubscriptionManager(`MARKER_UPDATE_RESET-${e}`,"0",t,e),Cs=(e,t)=>tF(`MARKER_COUNT_CHANGE-${e}`,"0",t,e),Cc=(e,t)=>tF(`MARKER_SELECTION_CHANGE-${e}`,"0",t,e),Cu=(e,t)=>tF(`MARKER_COMMAND-${e}`,"0",t,e),Cd=(e,t)=>{let r=t?.length,n=Math.round(r*e/100)-1;if(!n&&0!==n||r<=1||n>r-1)return e;let a=0,i=r-1,o=n-1,l=n+1;o>=0&&(a=o),l<=i&&(i=l);let s=n,c=t[s];for(let e=a;e<=i;e+=1){let r=t[e];r>c&&(c=r,s=e)}return(s+1)*100/r};function Ch(e,t){let r=1/t;return 100===e?100:(Math.floor(e/100/r)*r+r/2)*100}function Cp({left:e,globalID:t}){let{zoom:r,segments:n}=Cn(t),{start:a,end:i}=r.interval,o=n.totalPoints,l=i-a+1;return{insideLeft:(e*o/100-a)*100/l,outsideLeft:100*a/o,multiple:o/l}}function Cf(e){let t=e?.length;if(!t)return null;let r=-1/0,n=0;for(let a=0;a<t;a+=1){let t=e[a];t>r&&(r=t,n=a)}return{value:r,index:n}}function Cm(e){let t=Cf(e);return t?[t]:null}function Cg(e,t=2,r=.1,n=10){let a=e?.length;if(!a||t<=0)return[];let i=Cf(e);if(!i)return[];let o=i.value*r,l=[],s=e=>{for(let t=0;t<l.length;t+=1){let r=l[t];if(Math.abs(r.index-e.index)<n){e.value>r.value&&(l[t]=e);return}}if(l.length<t){l.push(e),l.sort((e,t)=>t.value-e.value);return}let r=l[l.length-1];e.value>r.value&&(l[l.length-1]=e,l.sort((e,t)=>t.value-e.value))};for(let t=1;t<a-1;t+=1){let r=e[t];if(r<o)continue;let n=e[t-1],a=e[t+1];r>n&&r>a&&s({value:r,index:t})}return l}function Cb(e,t=.1,r=10){let n=e?.length;if(!n)return[];let a=[],i=-1/0;for(let t=0;t<n;t+=1){let r=e[t];r>i&&(i=r)}let o=i*t;for(let t=1;t<n-1;t++){let n=e[t],i=e[t-1],l=e[t+1];n>i&&n>l&&n>=o&&(a.some(e=>Math.abs(e.index-t)<r)||a.push({value:n,index:t}))}return a.sort((e,t)=>t.value-e.value)}function Cv(e,t,r=5){let n=e?.length;if(!n||t<0||t>=n)return null;let a=Math.max(0,t-r),i=Math.min(n-1,t+r),o=-1/0,l=t;for(let t=a;t<=i;t++)e[t]>o&&(o=e[t],l=t);return{value:o,index:l}}let Cy=(e,t,r)=>{let{frequency:n,id:a}=e,i=t[0];if(void 0!==n&&i){let{start:e,stop:t}=i,o=t-e;void 0!==o&&n<t&&n>e&&r?.({pstype:PSType.Marker,event:MarkerEventType.Update,id:a,left:(n-e)*100/o})}},Cw=(e,t,r)=>{let{data:n,...a}=e,i=t[0];if(n?.length&&i){let{start:e,stop:t}=i,o=t-e;if(void 0!==o){let i=[];for(let r=0;r<n.length;r+=1){let a=n[r];a<=t&&a>=e&&i.push((a-e)*100/o)}i.length>0&&r?.({...a,pstype:PSType.Marker,event:MarkerEventType.Add,data:i})}}},Cx=(e,t)=>{if(e<0||e>100)return!1;let r=t[0];if(!r)return!1;let{start:n,stop:a}=r,i=n+e*(a-n)/100;return i>=n&&i<=a},Ck=(e,t)=>{let r=t[0];if(!r)return null;let{start:n,stop:a}=r;return n+e*(a-n)/100},CS=()=>{let{state:{globalID:e,marker:a},dispatch:i}=ae(),{enabled:o,visible:l,maxCount:s,fifo:c,readonly:d}=a,p=o&&!d,[f,g]=b(0),[v,y]=b(null);h(()=>{if(e&&p){let t=Cs(e,e=>{e&&g(t=>t===e.count?t:e.count)});return()=>{t?.()}}},[e,p]),h(()=>{if(e&&p){let t=Cc(e,e=>{y(e?.selectedId??null)});return()=>{t?.()}}},[e,p]);let w=u(e=>{i({payload:{marker:{...a,visible:!!e}}})},[a,i]);h(()=>{if(!p)return;let e=e=>{if("m"!==e.key.toLowerCase()||e.repeat)return;let t=e.target;t?.tagName==="INPUT"||t?.tagName==="TEXTAREA"||t?.isContentEditable||(e.preventDefault(),w(!l))};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[p,l,w]);let x=s>0?s:5,k=f>=x,S=!!v,M=m(()=>/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("path",{d:"M643.657143 241.956571L913.700571 512 643.657143 782.043429 373.613714 512z",fill:"currentColor",opacity:"0.5"}),/*#__PURE__*/r("path",{d:"M380.342857 241.956571L650.386286 512 380.342857 782.043429 110.299429 512z",fill:"currentColor"})]}),[]),F=u(()=>{e&&v&&Cu(e)({type:"left-peak",selectedId:v})},[e,v]),C=u(()=>{e&&v&&Cu(e)({type:"right-peak",selectedId:v})},[e,v]),D=u(()=>{e&&Cu(e)({type:"create-main-peak"})},[e]),z=u(()=>{e&&Cu(e)({type:"create-secondary-peak"})},[e]),N=u(()=>{e&&Cu(e)({type:"clear-all"})},[e]);if(!p)return null;let E=f>0,T=/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{d:"M724 218L512 430 300 218l-82 82 294 294 294-294z",fill:"currentColor",transform:"rotate(90 512 512)"})}),R=/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{d:"M724 218L512 430 300 218l-82 82 294 294 294-294z",fill:"currentColor",transform:"rotate(-90 512 512)"})}),A=/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("path",{d:"M200 750L400 450 512 200 624 450 824 750",stroke:"currentColor",strokeWidth:"80",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/r("circle",{cx:"512",cy:"200",r:"60",fill:"currentColor"})]}),I=/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/r("path",{d:"M150 750L300 400 450 550 600 250 750 500 900 750",stroke:"currentColor",strokeWidth:"70",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/r("circle",{cx:"450",cy:"550",r:"50",fill:"currentColor"})]}),P=/*#__PURE__*/n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",style:{transform:"scale(0.9)"},children:[/*#__PURE__*/r("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72z",fill:"currentColor"}),/*#__PURE__*/r("path",{d:"M864 256H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h466c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z",fill:"currentColor"})]}),L=`标记点控制 (M键切换)
|
|
3765
3769
|
━━━━━━━━━━━━━━━━
|
|
3766
3770
|
• 点击图表:添加标记
|
|
3767
3771
|
• 点击标记:删除标记
|
|
@@ -3772,9 +3776,9 @@ ${ta(` ${t.systemDark}`,n)}
|
|
|
3772
3776
|
━━━━━━━━━━━━━━━━
|
|
3773
3777
|
已达最大数量 ${x}(已开启先进先出滚动覆盖)`:`
|
|
3774
3778
|
━━━━━━━━━━━━━━━━
|
|
3775
|
-
⚠ 已达最大数量 ${x}`:""}`;return /*#__PURE__*/r("div",{className:"relative select-none",children:/*#__PURE__*/n(
|
|
3779
|
+
⚠ 已达最大数量 ${x}`:""}`;return /*#__PURE__*/r("div",{className:"relative select-none",children:/*#__PURE__*/n(vF,{children:[/*#__PURE__*/r(vT,{active:l||E||k,tone:k&&!c?"warning":"primary",onClick:()=>w(!l),title:L,children:M}),l&&/*#__PURE__*/n(t,{children:[/*#__PURE__*/r(vC,{}),/*#__PURE__*/r(vT,{active:S,tone:"primary",className:iX(!S&&"opacity-40"),onClick:S?F:void 0,title:"左峰值",children:T}),/*#__PURE__*/r(vT,{active:S,tone:"primary",className:iX(!S&&"opacity-40"),onClick:S?C:void 0,title:"右峰值",children:R}),/*#__PURE__*/r(vC,{}),/*#__PURE__*/r(vT,{active:!0,tone:"primary",onClick:D,title:"主峰值",children:A}),/*#__PURE__*/r(vT,{active:!0,tone:"primary",onClick:z,title:"次峰值",children:I}),/*#__PURE__*/r(vC,{}),/*#__PURE__*/r(vT,{active:E,tone:"destructive",className:iX(!E&&"opacity-40"),onClick:E?N:void 0,title:"清除所有",children:P})]})]})})},CM=CS,CF={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};CF.node;let CC=Mo(CF),CD={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};CD.node;let Cz=Mo(CD);var CN=Object.defineProperty,CE=(e,t)=>CN(e,"name",{value:t,configurable:!0}),CT="Checkbox",[CR,CA]=ly(CT),[CI,CP]=CR(CT);function CL(e){let{__scopeCheckbox:t,checked:n,children:a,defaultChecked:i,disabled:o,form:l,name:s,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:h}=e,[p,f]=lT({prop:n,defaultProp:i??!1,onChange:c,caller:CT}),[m,g]=$.useState(null),[b,v]=$.useState(null),y=$.useRef(!1),[w,x]=$.useReducer(e=>e+1,0),k=!m||!!l||!!m.closest("form"),S={checked:p,disabled:o,setChecked:f,control:m,setControl:g,name:s,form:l,value:d,hasConsumerStoppedPropagationRef:y,userInteractionCount:w,onUserInteraction:x,required:u,defaultChecked:!CG(i)&&i,isFormControl:k,bubbleInput:b,setBubbleInput:v};return /* @__PURE__ */r(CI,{scope:t,...S,children:CW(h)?h(S):a})}CE(CL,"CheckboxProvider");var CO="CheckboxTrigger",Cq=/* @__PURE__ */$.forwardRef(/* @__PURE__ */CE(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...a},i){let{control:o,value:l,disabled:s,checked:c,required:u,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:p,onUserInteraction:f,isFormControl:m,bubbleInput:g}=CP(CO,e),b=lm(i,d),v=$.useRef(c);return $.useEffect(()=>{let e=o?.form;if(e){let t=/* @__PURE__ */CE(()=>h(v.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[o,h]),/* @__PURE__ */r(l2.button,{type:"button",role:"checkbox","aria-checked":CG(c)?"mixed":c,"aria-required":u,"data-state":CY(c),"data-disabled":s?"":void 0,disabled:s,value:l,...a,ref:b,onKeyDown:lo(t,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:lo(n,e=>{f(),h(e=>!!CG(e)||!e),g&&m&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})},"CheckboxTrigger")),C$=/* @__PURE__ */$.forwardRef(/* @__PURE__ */CE(function(e,a){let{__scopeCheckbox:i,name:o,checked:l,defaultChecked:s,required:c,disabled:u,value:d,onCheckedChange:h,form:p,...f}=e;return /* @__PURE__ */r(CL,{__scopeCheckbox:i,checked:l,defaultChecked:s,disabled:u,required:c,onCheckedChange:h,name:o,form:p,value:d,internal_do_not_use_render:({isFormControl:e})=>/* @__PURE__ */n(t,{children:[/* @__PURE__ */r(Cq,{...f,ref:a,__scopeCheckbox:i}),e&&/* @__PURE__ */r(CB,{__scopeCheckbox:i})]})})},"Checkbox")),C_="CheckboxIndicator",Cj=/* @__PURE__ */$.forwardRef(/* @__PURE__ */CE(function(e,t){let{__scopeCheckbox:n,forceMount:a,...i}=e,o=CP(C_,n);return /* @__PURE__ */r(d_,{present:a||CG(o.checked)||!0===o.checked,children:/* @__PURE__ */r(l2.span,{"data-state":CY(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),CH="CheckboxBubbleInput",CB=/* @__PURE__ */$.forwardRef(/* @__PURE__ */CE(function({__scopeCheckbox:e,onClick:t,...n},a){let{control:i,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:s,defaultChecked:c,required:u,disabled:d,name:h,value:p,form:f,bubbleInput:m,setBubbleInput:g}=CP(CH,e),b=lm(a,g),v=di(i),y=$.useRef(!1),w=$.useRef(s),x=$.useRef(l);$.useEffect(()=>{if(!m)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=l!==x.current;x.current=l;let r=w.current!==s;w.current=s;let n=!(t&&o.current);if(r&&e){y.current=!t;let r=new Event("click",{bubbles:n});m.indeterminate=CG(s),e.call(m,!CG(s)&&s),m.dispatchEvent(r),y.current=!1}},[m,s,o,l]);let k=$.useRef(!CG(s)&&s);return /* @__PURE__ */r(l2.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??k.current,required:u,disabled:d,name:h,value:p,form:f,...n,tabIndex:-1,ref:b,onClick:lo(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function CW(e){return"function"==typeof e}function CG(e){return"indeterminate"===e}function CY(e){return CG(e)?"indeterminate":e?"checked":"unchecked"}CE(CW,"isFunction"),CE(CG,"isIndeterminate"),CE(CY,"getState");/**
|
|
3776
3780
|
* @license lucide-react v1.46.0 - ISC
|
|
3777
3781
|
*
|
|
3778
3782
|
* This source code is licensed under the ISC license.
|
|
3779
3783
|
* See the LICENSE file in the root directory of this source tree.
|
|
3780
|
-
*/let FU={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};FU.node;let FX=Mo(FU),FK={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};FK.node;let FV=Mo(FK),FQ=/*#__PURE__*/$.forwardRef(({className:e,...t},n)=>/*#__PURE__*/r(F$,{ref:n,"data-slot":"checkbox",className:iX("peer inline-flex size-4 shrink-0 items-center justify-center rounded-[var(--radius-micro)] border border-border bg-background text-primary shadow-xs transition-colors outline-none","focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground","data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",e),...t,children:/*#__PURE__*/r(Fj,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current",children:"indeterminate"===t.checked?/*#__PURE__*/r(FX,{className:"size-3.5"}):/*#__PURE__*/r(FV,{className:"size-3.5"})})}));FQ.displayName=F$.displayName;let FZ=e=>"checked"===e||"indeterminate"===e&&"indeterminate",FJ=({count:e,show:t,testId:r})=>t?/*#__PURE__*/n("span",{className:"shrink-0 tabular-nums text-[11px] font-normal text-muted-foreground","data-testid":r,children:["(",e,")"]}):null,F0=({source:e,type:t,leafKeysWithData:a,hiddenKeys:i,showCount:o,expanded:l,onToggleExpanded:s,onToggleNode:c})=>{let u=kO(a,i,t.leafKeys),d=`signal-tree-type-checkbox-${e.source}-${t.signalType}`,h=t.levels.length>0,p=h?void 0:t.color??kv[t.signalType].color;return /*#__PURE__*/n("div",{children:[/*#__PURE__*/n("div",{className:"group flex items-center gap-1.5 rounded-[var(--radius-control)] px-[var(--size-gap-base)] py-[calc(var(--size-gap-base)/2)] transition-colors hover:bg-accent/80","data-testid":`signal-tree-type-${e.source}-${t.signalType}`,children:[h?/*#__PURE__*/r("button",{type:"button","aria-label":l?"折叠信号类型":"展开信号类型",className:"flex size-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",onClick:s,children:l?/*#__PURE__*/r(FF,{className:"size-3.5"}):/*#__PURE__*/r(Fz,{className:"size-3.5"})}):/*#__PURE__*/r("span",{"aria-hidden":"true",className:"size-4 shrink-0"}),/*#__PURE__*/n("label",{htmlFor:d,className:iX("flex min-w-0 flex-1 items-center gap-1.5","disabled"===u?"cursor-not-allowed":"cursor-pointer"),children:[/*#__PURE__*/r(FQ,{id:d,"aria-label":`${e.label} ${t.label}`,checked:FZ(u),disabled:"disabled"===u,onCheckedChange:()=>c(t.leafKeys)}),/*#__PURE__*/r("span",{className:iX("min-w-0 truncate text-xs font-medium","disabled"===u?"text-muted-foreground":"text-foreground/90"),"data-testid":`signal-tree-type-color-${e.source}-${t.signalType}`,style:"disabled"===u||null==p?void 0:{color:oi(p)},children:t.label}),/*#__PURE__*/r(FJ,{count:t.count,show:o,testId:`signal-tree-type-count-${e.source}-${t.signalType}`})]})]}),l&&h?/*#__PURE__*/r("div",{className:"relative ml-6 border-l border-border/60 pl-1",children:t.levels.map(n=>/*#__PURE__*/r(F1,{source:e.source,signalType:t.signalType,level:n,leafKeysWithData:a,hiddenKeys:i,showCount:o,onToggleNode:c},n.leafKey))}):null]},t.signalType)},F1=({source:e,signalType:t,level:a,leafKeysWithData:i,hiddenKeys:o,showCount:l,onToggleNode:s})=>{let c=kO(i,o,[a.leafKey]),u=`signal-tree-level-checkbox-${e}-${t}-${a.level}`;return /*#__PURE__*/r("div",{className:"group flex items-center gap-1.5 rounded-[var(--radius-control)] px-[var(--size-gap-base)] py-[calc(var(--size-gap-base)/2)] transition-colors hover:bg-accent/80","data-testid":`signal-tree-level-${e}-${t}-${a.level}`,children:/*#__PURE__*/n("label",{htmlFor:u,className:iX("flex min-w-0 flex-1 items-center gap-1.5","disabled"===c?"cursor-not-allowed":"cursor-pointer"),children:[/*#__PURE__*/r(FQ,{id:u,"aria-label":`${t} ${a.label}`,checked:FZ(c),disabled:"disabled"===c,onCheckedChange:()=>s([a.leafKey])}),/*#__PURE__*/r("span",{className:iX("text-xs font-medium","disabled"===c?"text-muted-foreground":"text-foreground/80"),"data-testid":`signal-tree-level-color-${e}-${t}-${a.level}`,style:"disabled"===c?void 0:{color:oi(a.color??kD[a.level].color)},children:a.label}),/*#__PURE__*/r(FJ,{count:a.count,show:l,testId:`signal-tree-level-count-${e}-${t}-${a.level}`})]})})},F2=({tree:e,leafKeysWithData:t,hiddenKeys:a,showCount:i,onToggleNode:o})=>{let[l,s]=b(()=>new Set),[c,d]=b(()=>new Set),h=u(e=>{s(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},[]),p=u(e=>{d(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},[]);return /*#__PURE__*/r(g6,{viewportClassName:"h-auto max-h-[var(--radix-dropdown-menu-content-available-height)]",children:/*#__PURE__*/r("div",{className:"p-[calc(var(--size-gap-base)/2)]",children:e.sources.map((e,s)=>{let u=kO(t,a,e.leafKeys),d=`signal-tree-source-checkbox-${e.source}`;return /*#__PURE__*/n("div",{className:iX(s>0&&"mt-[calc(var(--size-gap-base)/2)] border-t border-border/60 pt-[calc(var(--size-gap-base)/2)]"),"data-testid":`signal-tree-source-${e.source}`,children:[/*#__PURE__*/n("div",{className:"flex items-center gap-1.5 rounded-[var(--radius-control)] px-[var(--size-gap-base)] py-[calc(var(--size-gap-base)/2)] transition-colors hover:bg-accent/80","data-testid":`signal-tree-source-row-${e.source}`,children:[e.types.length>0?/*#__PURE__*/r("button",{type:"button","aria-label":c.has(e.source)?"展开数据来源":"折叠数据来源",className:"flex size-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",onClick:()=>p(e.source),children:c.has(e.source)?/*#__PURE__*/r(Fz,{className:"size-3.5"}):/*#__PURE__*/r(FF,{className:"size-3.5"})}):/*#__PURE__*/r("span",{"aria-hidden":"true",className:"size-4 shrink-0"}),/*#__PURE__*/n("label",{htmlFor:d,className:iX("flex min-w-0 flex-1 items-center gap-1.5","disabled"===u?"cursor-not-allowed":"cursor-pointer"),children:[/*#__PURE__*/r(FQ,{id:d,"aria-label":`${e.label}筛选`,checked:FZ(u),disabled:"disabled"===u,onCheckedChange:()=>o(e.leafKeys)}),/*#__PURE__*/r("span",{className:"text-xs font-medium text-foreground",children:e.label}),/*#__PURE__*/r(FJ,{count:e.count,show:i,testId:`signal-tree-source-count-${e.source}`})]})]}),c.has(e.source)?null:/*#__PURE__*/r("div",{className:"ml-4 divide-y divide-border/40 border-l border-border/60 pl-1",children:e.types.map(n=>/*#__PURE__*/r(F0,{source:e,type:n,leafKeysWithData:t,hiddenKeys:a,showCount:i,expanded:!l.has(`${e.source}:${n.signalType}`),onToggleExpanded:()=>h(`${e.source}:${n.signalType}`),onToggleNode:o},n.signalType))})]},e.source)})})})},F5=()=>{let{state:{signal:e},dispatch:t}=ae(),n=e.display,a=e.show,i=St({respectVisibility:!1,filterHidden:!1}),o=m(()=>kL(i),[i]),l=m(()=>new Set(o.sources.flatMap(e=>e.dataLeafKeys)),[o]),s=m(()=>new Set(e.hiddenCategoryKeys??[]),[e.hiddenCategoryKeys]),c=(e.hiddenCategoryKeys?.length??0)>0,d=u(r=>{t({payload:{signal:{...e,display:r}}})},[e,t]),h=u(r=>{let n=kq(e.hiddenCategoryKeys??[],r,l);t({payload:{signal:{...e,hiddenCategoryKeys:n}}})},[e,l,t]);return a?/*#__PURE__*/r(vE,{leading:/*#__PURE__*/r(vT,{active:n,tone:"primary",onClick:()=>{d(!n)},title:`全部信号标注:${n?"显示":"隐藏"}`,children:/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{fill:"currentColor",d:"M563.072 376.48a79.456 79.456 0 0 0 28.928-61.12 80 80 0 1 0-160 0c0 24.672 11.392 46.432 28.928 61.12l-202.88 540.256a32 32 0 1 0 59.904 22.496l49.28-131.264h289.504l49.28 131.264a32.064 32.064 0 0 0 41.248 18.752c16.544-6.208 24.896-24.672 18.72-41.216l-202.912-540.288z m-1.312 178.624h-99.552L512 422.56l49.76 132.544z m-170.464 188.896l46.912-124.896h147.616l46.912 124.896h-241.44zM662.464 417.408a32 32 0 1 0 53.12 35.648 254.72 254.72 0 0 0 43.136-142.304 255.04 255.04 0 0 0-43.136-142.304 32 32 0 1 0-53.12 35.68 190.944 190.944 0 0 1 32.288 106.624 190.816 190.816 0 0 1-32.288 106.656zM289.888 453.024a32 32 0 1 0 53.184-35.616 191.36 191.36 0 0 1-32.32-106.656 191.328 191.328 0 0 1 32.32-106.656 32.064 32.064 0 0 0-8.768-44.416 32.096 32.096 0 0 0-44.416 8.768 254.976 254.976 0 0 0-43.136 142.304 254.976 254.976 0 0 0 43.136 142.272zM210.656 117.12A32 32 0 1 0 157.44 81.536a420.032 420.032 0 0 0-70.848 233.824 419.744 419.744 0 0 0 70.88 233.856 31.936 31.936 0 0 0 44.416 8.768 32 32 0 0 0 8.768-44.416 355.168 355.168 0 0 1-60.032-198.24A355.36 355.36 0 0 1 210.656 117.12zM896.224 154.304a416.96 416.96 0 0 0-38.912-72.768 32 32 0 1 0-53.184 35.584 354.912 354.912 0 0 1 60.064 198.24 355.2 355.2 0 0 1-60.064 198.208 32.032 32.032 0 0 0 53.184 35.648 418.816 418.816 0 0 0 70.88-233.856c0-55.68-10.752-109.856-31.968-161.056z"})})}),value:null,options:[],triggerTitle:`筛选信号标注类别${c?"(已应用筛选)":""}`,triggerTestId:"signal-tree-trigger",triggerContent:/*#__PURE__*/r("span",{className:"sr-only",children:c?"信号标注类别筛选(已应用)":"信号标注类别筛选"}),customContent:/*#__PURE__*/r("div",{"data-testid":"signal-tree-popover",children:/*#__PURE__*/r(F2,{tree:o,leafKeysWithData:l,hiddenKeys:s,showCount:!1!==e.showCount,onToggleNode:h})}),contentClassName:"w-max max-w-[calc(100vw-1rem)] p-0",triggerClassName:iX("justify-center [&>span:last-child]:ml-0",c&&"bg-accent/72 shadow-[inset_0_0_0_1px_var(--mix-primary-28)] [&>span:last-child]:text-primary")}):null},F4=F5,F3=[{component:yL,toolType:rs.AutorangingSwitch,supportedCharts:[],excludedCharts:[rt.Heatmap,rt.ScanDF360,rt.LevelStream,rt.LiteNormalized]},{component:yB,toolType:rs.UnitSwitch,supportedCharts:[],excludedCharts:[rt.ScanDF360,rt.LevelStream]},{component:v$,toolType:rs.GradientRibbon,supportedCharts:[rt.Heatmap]},{component:v_,toolType:rs.SpacerLine,supportedCharts:[],excludedCharts:[rt.ScanDF360,rt.LevelStream]},{component:Cq,toolType:rs.Reset,supportedCharts:[],excludedCharts:[rt.LiteNormalized]},{component:F5,toolType:rs.StationAllocationSwitch,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.MScan,rt.DDC]},{component:CH,toolType:rs.SeriesControl,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.MScan],props:{type:"dynamic"}},{component:C8,toolType:rs.FrequencyAllocationSwitch,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.MScan,rt.LiteNormalized]},{component:CY,toolType:rs.ZoomSwitch,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.MScan,rt.LiteNormalized]},{component:Fe,toolType:rs.LimitSwitch,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.MScan]},{component:FS,toolType:rs.MarkersSwitch,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.MScan]},{component:C_,toolType:rs.SegmentsDisplayControl,supportedCharts:[rt.Scan]},{component:CJ,toolType:rs.HeatmapCaptureSwitch,supportedCharts:[rt.Heatmap]},{component:C4,toolType:rs.TimeRangeSwitch,supportedCharts:[rt.Heatmap]},{component:CW,toolType:rs.SeriesDisplayControl,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.LiteNormalized,rt.MScan]},{component:CX,toolType:rs.FluorescenceSwitch,supportedCharts:[rt.SingleFrequency]},{component:C3,toolType:rs.DeltaMeasurementSwitch,supportedCharts:[rt.SingleFrequency,rt.Scan]}],F6=(e,t,r=[])=>!new Set(r).has(e.toolType)&&(e.supportedCharts.length>0?!!t&&e.supportedCharts.includes(t):!e.excludedCharts||!(e.excludedCharts.length>0)||!t||!e.excludedCharts.includes(t)),F8=(e,t)=>e.props?"dynamic"===e.props.type?{...e.props,type:t}:e.props:{},F9=({type:e})=>{let t=at(e=>e.toolbar.show),n=at(e=>e.toolbar.hiddenTools??[]),{width:a,pluginBoxWidth:i}=yn(),o=m(()=>({marginLeft:a,width:i,...o_}),[a,i]),l=m(()=>F3.filter(t=>F6(t,e,n)).map(t=>/*#__PURE__*/r(t.component,{...F8(t,e)},t.toolType)),[n,e]);return e!==rt.Occupancy&&t?/*#__PURE__*/r("div",{className:"relative flex h-10 min-w-0 w-full items-center justify-between pl-[var(--size-gap-base)] text-xs text-foreground",style:o,children:/*#__PURE__*/r("div",{className:"min-w-0 flex-1 overflow-x-auto overflow-y-hidden",children:/*#__PURE__*/r("div",{className:"flex h-full w-max min-w-full items-center gap-[var(--size-gap-base)]",children:l})})}):null},F7=/*#__PURE__*/c(F9);function De(){let{state:{globalID:e,axisY:t,levelStream:r}}=ae(),n=t.range??ns,{cacheTime:a=2e4,granularity:i=1,maxPoints:o=500}=r??{},l=g(null),s=g(e),c=u(e=>{((e,t,r="0")=>tI(e,t,void 0,r))(s.current,rr.Spectrum)({pstype:rn.Render,data:{[t3]:e.spectrumData}}),((e,t,r="0")=>tI(e,t,void 0,r))(s.current,rr.LevelStream)({pstype:rn.Render,data:e.probabilityRangeData})},[]),d=u(e=>{let{probabilityRangeData:t,spectrumData:r}=e;tO(s.current).getAllRawData=t=>({...tL().getAllRawData(t),levelStreamData:e}),c({probabilityRangeData:t,spectrumData:r})},[c]);if(h(()=>{s.current=e},[e]),!l.current&&e){l.current=new P({range:n,cacheTime:a,granularity:i,maxPoints:o,onLevelStreamUpdate:d});let{line:t}=t0("levelStream");((e,t,r="0")=>tI(e,t,void 0,r))(e,rr.Spectrum)({pstype:rn.Series,name:t3,color:t})}return h(()=>{l.current?.setConfig({range:n})},[n]),h(()=>{l.current?.setConfig({cacheTime:a})},[a]),h(()=>{l.current?.setConfig({granularity:i})},[i]),h(()=>{l.current?.setConfig({onLevelStreamUpdate:d})},[d]),{analyzer:l.current,updateLevelStreamData:c}}class Dt extends of{constructor(e){super({id:e.id,chart:null,orientation:e.orientation??z.Vertical})}init(){let{id:e,orientation:t}=this.state,r=[...t2()].reverse().map(e=>E(e));this.state.chart=new N({id:e,series:[{name:"bar",type:M.Bar,display:!0,color:t0("bar"),orientation:t}],range:[0,100],barValue2Color:!0,colors:r})}updateSeries(e){this.state.chart?.render({name:"bar",data:e})}}let Dr=e=>{let{opacity:t}=e,{chart:n,Chart:a}=iV({Render:Dt,params:{orientation:z.Horizontal}});return i3({moduleType:rr.LevelStream,chart:n,extractData:e=>e.data}),/*#__PURE__*/r(a,{style:m(()=>({opacity:t,zIndex:1}),[t])})},Dn=Dr,Da=6,Di=4,Do=8,Dl=({axisLineWidth:e,inside:t,width:r})=>t?{axisX:e,majorTickEndX:6,majorTickStartX:0,minorTickEndX:4,minorTickStartX:0,textAlign:"left",textX:8}:{axisX:r-e,majorTickEndX:r,majorTickStartX:r-6,minorTickEndX:r,minorTickStartX:r-4,textAlign:"right",textX:r-8},Ds=.5,Dc=2,Du=4,Dd=100,Dh=1,Dp=.5,Df=.5;function Dm(e){let{ranging:t}=e,{range:r,disabled:n,placement:a,show:i}=at(e=>e.axisY),o="inside"===a,l=g(null),s=g(null),[c,d]=b(0),[p,f]=b(window.devicePixelRatio||1),[v,y]=b(!1),[w,x]=b(0),k=u((e,t)=>{let r=.5*(Math.max(1,Math.round(t*p))%2!=0);return(Math.round(e*p-r)+r)/p},[p]),S=u((e,t,r)=>{let n=r/2;return Math.min(t-n,Math.max(n,e))},[]),M=m(()=>{let[e,t]=r;return{min:e,max:t}},[r]);h(()=>{let e=window.matchMedia(`(resolution: ${p}dppx)`),t=()=>f(window.devicePixelRatio||1);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[p]),h(()=>{let e=s.current;if(!e)return;let t=new ResizeObserver(e=>{let t=e[0];t&&d(t.contentRect.height)});return t.observe(e),()=>t.disconnect()},[i]);let C=u((e,t)=>{if(t.useScientific)return e.toExponential(1);if(t.useKFormat){let r=e/1e3;return t.useDecimals?`${r.toFixed(1)}k`:`${Math.round(r)}k`}return t.useDecimals?e.toFixed(1):Math.round(e).toString()},[]),F=m(()=>{if(0===c)return{majorTicks:[],minorTicks:[]};let e=M.max-M.min,{interval:t,majorTickValues:r}=Cv([M.min,M.max]);if(!t||0===r.length)return{majorTicks:[],minorTicks:[]};let n=r.some(e=>Math.abs(e)>=1e3),a=r.some(e=>.01>Math.abs(e)&&0!==e),i={useScientific:a,useKFormat:n&&!a,useDecimals:r.some(e=>e%1!=0)},o=[];for(let t of r){let r=(M.max-t)/e*c,n=r,a=!0,l=!1,s=c-6,u=.3*c;r<-u||r>c+u?a=!1:r<6?(n=6,l=!0):r>s&&(n=s,l=!0),a&&o.push({value:t,position:r,textPosition:n,label:C(t,i),isAdjusted:l})}let l=[],s=t/2,u=s/e*c,d=e<1;if(u>=(d?8:4)&&c>100&&!d){let r=Math.ceil(M.min/s)*s;for(let n=r;n<=M.max;n+=s){if(Math.abs(n%t)<.1*s)continue;let r=(M.max-n)/e*c;r>=0&&r<=c&&l.push({value:n,position:r,textPosition:r,label:""})}}return{majorTicks:o,minorTicks:l}},[M,c,C]),D=u(()=>{let e=l.current;if(!e||0===c)return;let t=e.getContext("2d");if(!t)return;let r=e.getBoundingClientRect().width,n=Dl({axisLineWidth:.5,inside:o,width:r});e.width=r*p,e.height=c*p,e.style.width=`${r}px`,e.style.height=`${c}px`,t.setTransform(p,0,0,p,0,0),t.imageSmoothingEnabled=!0,t.imageSmoothingQuality="high",t.clearRect(0,0,r,c),t.font="12px -apple-system, BlinkMacSystemFont, sans-serif",t.textAlign=n.textAlign,t.textBaseline="middle",t.lineWidth=Dh;let a=ol("--foreground",.5,s.current);F.majorTicks.forEach(e=>{t.fillStyle=a,t.strokeStyle=a,t.fillText(e.label,n.textX,e.textPosition),t.beginPath();let r=k(S(e.position,c,Dh),Dh);t.moveTo(n.majorTickStartX,r),t.lineTo(n.majorTickEndX,r),t.stroke()}),t.strokeStyle=a,t.lineWidth=.5,F.minorTicks.forEach(e=>{t.beginPath();let r=k(S(e.position,c,.5),.5);t.moveTo(n.minorTickStartX,r),t.lineTo(n.minorTickEndX,r),t.stroke()}),t.strokeStyle=a,t.lineWidth=.5,t.beginPath();let i=k(n.axisX,.5);t.moveTo(i,0),t.lineTo(i,c),t.stroke()},[F,c,p,o,k,S]);h(()=>{!1!==i&&D()},[D,i]),h(()=>oh(()=>{D()}),[D]);let z=u(e=>{n||(y(!0),x(e.clientY))},[n]),N=u(e=>{n||t.moveWheel?.(e)},[t,n]),E=u(e=>{if(n||!v||!s.current)return;let r=(e.clientY-w)/s.current.offsetHeight;Math.abs(r)>(M.max-M.min<1?.005:.01)&&(t.move?.(r),x(e.clientY))},[n,v,w,t,M]);return{canvasRef:l,containerRef:s,isDragging:v,range:M,handleMouseDown:z,handleMouseMove:E,handleMouseUp:u(()=>{n||y(!1)},[n]),handleMouseLeave:u(()=>{n||y(!1)},[n]),handleWheel:N,ticksData:F}}function Dg(e){let{chart:t}=e,{state:{axisY:n,globalID:a}}=ae(),{show:i}=n,o=nY({chart:t}),{axisYWidth:l,inside:s,marginLeft:c}=yn(),{canvasRef:u,containerRef:d,isDragging:h,handleMouseDown:p,handleMouseMove:f,handleMouseUp:m,handleMouseLeave:g,handleWheel:b}=Dm({ranging:o});return!1===i?null:/*#__PURE__*/r("div",{ref:d,className:iX("h-full select-none",s?"absolute left-0 top-0 z-[7]":"relative",h?"cursor-grabbing":"cursor-ns-resize"),style:{width:l,marginLeft:c},onMouseDown:p,onMouseMove:f,onMouseUp:m,onMouseLeave:g,onWheel:b,onDoubleClick:()=>{let{realRange:e}=nA({range:n.defaultRange??ns,unit:n.unit,step:n.step,globalID:a}),t=yR(n.restrict,e);o.setAxisY?.({realRange:t}),o.onChange?.()},children:/*#__PURE__*/r("canvas",{ref:u,className:"pointer-events-none absolute left-0 top-0 h-full w-full"})})}let Db=(e,t,r)=>{let[n,a]=r;return e<=0||t.end<t.start||!Number.isFinite(n)||!Number.isFinite(a)||a<=n?null:{x:[100*t.start/e,(t.end+1)*100/e],y:[n,a]}},Dv=(e,t)=>{let r=t.x[1]-t.x[0],n=t.y[1]-t.y[0],a=e=>Math.max(0,Math.min(100,t.x[0]+e*r/100));return{x:[a(e.leftPosition),a(e.leftPosition+e.width)],y:[t.y[1]-(e.position+e.height)*n/100,t.y[1]-e.position*n/100]}},Dy=(e,t)=>{let r=t.x[1]-t.x[0],n=t.y[1]-t.y[0];return{leftPosition:(e.x[0]-t.x[0])*100/r,width:(e.x[1]-e.x[0])*100/r,position:(t.y[1]-e.y[1])*100/n,height:(e.y[1]-e.y[0])*100/n}},Dw=(e,t)=>{let r=t.x[1]-t.x[0];return{left:-(100*t.x[0])/r,right:(100-t.x[0])*100/r,top:Math.min(0,100-e.height,e.position),bottom:Math.max(100,e.height,e.position+e.height)}},Dx=(e,t,r=0)=>{let n=t(e.x[0]),a=t(e.x[1]),i=Number(n),o=Number(a);return n&&a&&Number.isFinite(i)&&Number.isFinite(o)?{deltaX:Math.abs(o-i),deltaY:Math.abs(e.y[1]-e.y[0]),centerFrequency:(i+o)/2,startFrequency:i,endFrequency:o,startAmplitude:e.y[0]+r,endAmplitude:e.y[1]+r}:null},Dk=1e-9,DS=(e,t,r,n,a)=>{for(let i=n;i<=a;i+=1)if(r(e,i)!==r(t,i))return i;return a},DM={position:40,height:20,leftPosition:40,width:20},DC=()=>{let{state:{deltaMeasurement:{show:e,display:t,onChange:a},axisX:{frequencyFormat:i},axisY:{unit:o,range:l,renderRange:s},segments:c,zoom:{interval:d}}}=ae(),p=e&&t,[f,v]=b(null),y=g(null),w=g(a);w.current=a;let x=s??l??[-120,0],k=(l?.[0]??x[0])-x[0],S=m(()=>Db(c.totalPoints??0,d,x),[c.totalPoints,d.start,d.end,x[0],x[1]]),M=m(()=>f&&S?Dy(f,S):null,[f,S]),C=m(()=>f&&i&&c.length?Dx(f,i,k):null,[f,i,c,k]);h(()=>{p&&S&&v(e=>e??Dv(DM,S))},[p,S]),h(()=>{p||(y.current=null,v(null),w.current?.(null))},[p]);let F=u(e=>{let t=y.current??S;t&&v(Dv(e,t))},[S]),D=u(e=>{let t=y.current??S;if(y.current=null,!t||!i||!c.length)return;let r=Dv(e,t);v(r);let n=Dx(r,i,k);n&&a?.(n)},[S,i,c,k,a]),z=(e,t=3)=>rD(e,t).formatted,N=(e,t=2)=>{let r=Number.parseFloat(e.toFixed(t));return`${r} ${o}`},E=m(()=>{if(!C)return{labels:void 0,middleContent:null};let e=C.deltaX<=1e-9,t=C.deltaY<=1e-9,a=e?3:DS(C.startFrequency,C.endFrequency,z,3,6),i=t?2:DS(C.startAmplitude,C.endAmplitude,N,2,4),l=z(C.startFrequency,a),s=z(C.endFrequency,a),c=N(C.endAmplitude,i),u=N(C.startAmplitude,i),d=z(C.deltaX,a),h=`${Number.parseFloat(C.deltaY.toFixed(i))} ${o}`,p=z(C.centerFrequency,a);return{labels:{left:e?void 0:l,right:e?void 0:s,top:t?void 0:c,bottom:t?void 0:u},middleContent:/*#__PURE__*/n("div",{className:"grid gap-0.5",children:[/*#__PURE__*/r("div",{children:e?`频点: ${l}`:`ΔX: ${d}`}),/*#__PURE__*/r("div",{children:t?`幅度: ${u}`:`ΔY: ${h}`}),!e&&/*#__PURE__*/n("div",{children:["中心: ",p]})]})}},[C,o]);if(!M||!S)return null;let T=y.current??S,R=f?Dy(f,T):M;return /*#__PURE__*/r(ME,{enabled:p,defaultRect:M,minSize:0,minWidth:0,minHeight:0,variant:"projected",interactionBounds:Dw(R,T),onDragStart:()=>{y.current=S},onChange:F,onDragEnd:D,zIndex:7,labels:E.labels,children:E.middleContent})},DF=DC,DD=({frequencyLeft:e,segments:t})=>ry(t)(e),Dz=({e,zoom:t,segments:r,onChange:n,globalID:a})=>{let{realData:i}=tO(a).getAllRawData();if(!i)return;let o=i.length,{interval:{start:l,end:s}}=t,{left:c}=e,u=e.left+e.width,d=w_({coord:e,segments:r,zoom:t}),h=w_({coord:{left:u},segments:r,zoom:t}),p=Math.max(0,Math.ceil(o*d/100)-1),f=Math.ceil(o*h/100),{maxIndex:m}=tU(Array.from(i.slice(p,f)));n({frequency:(({frequencyLeft:e,segments:t})=>ry(t)(e))({frequencyLeft:(l+(p+m+1)/o*(s-l))*100/r.totalPoints,segments:r}),bandwidth:Math.round(1e3*rk({segments:r,endLeft:u,startLeft:c})),left:d,right:h})},DN=rl.DragFrame,DE=({id:e})=>{let{state:{zoom:a,segments:i,signalAnalysis:o,globalID:l},dispatch:s}=ae(),[c,d]=b(null),p=u((e,t=!1)=>{o.show&&o.display&&t?Dz({e,zoom:a,segments:i,onChange:o.onChange,globalID:l}):s({payload:{zoom:{...a,interval:e.interval,isScanSegmentsUpdateMagnify:e.isScanSegmentsUpdateMagnify}}})},[o,a,i,l]),f=u((e,t,r,n)=>{if(e&&t&&n){let r=e.left,n=t.left,a=n-r;d({diffX:a,left:a>0?r:n,width:Math.abs(a),isScanSegmentsUpdateMagnify:a>0})}},[]),m=u(()=>{if(!c)return;let{left:e,width:t,isScanSegmentsUpdateMagnify:r,diffX:n}=c,{totalPoints:a}=i;if(r&&n>0){let n=SO({startPercent:e,endPercent:e+t,totalPoints:a}),i=n?n.end-n.start+1:0;n&&i>tV.ZOOM_MIN_RANGE&&p({interval:n,isScanSegmentsUpdateMagnify:r,left:e,width:t},!0)}n<0&&p({interval:{start:0,end:a-1},isScanSegmentsUpdateMagnify:r,left:e,width:t})},[c,i,a.interval.end,p]);return(h(()=>{if(a.show){let t=()=>{d(null),xt(e,DN)};wU(e,DN,t),wK(e,DN,()=>{m(),t()}),wV(e,DN,t),wJ(e,DN,(...t)=>{w7(e,DN)&&f(t[0],t[1],t[2],t[3])})}},[a.show,e,m,f]),h(()=>{c||xt(e,DN)},[c,e]),a.show)?/*#__PURE__*/r(yi,{className:"z-[3]",children:/*#__PURE__*/r("div",{className:"absolute left-[-100%] top-0 h-full w-0 box-border border-2 border-dashed border-chart-grid-strong bg-chart-surface opacity-40",style:c?{left:`${c.left}%`,width:`${c.width}%`}:{},children:c&&!c.isScanSegmentsUpdateMagnify&&/*#__PURE__*/n(t,{children:[/*#__PURE__*/r("div",{className:"pointer-events-none absolute inset-0 opacity-20",style:{background:"linear-gradient(to top right, transparent, transparent calc(50% - 1px), var(--chart-grid-strong), transparent calc(50% + 1px), transparent)"}}),/*#__PURE__*/r("div",{className:"pointer-events-none absolute inset-0 opacity-20",style:{background:"linear-gradient(to bottom right, transparent, transparent calc(50% - 1px), var(--chart-grid-strong), transparent calc(50% + 1px), transparent)"}})]})})}):null},DT=/*#__PURE__*/c(DE),DR=14,DA=5,DI=4,DP=({density:e="auto",channelCount:t})=>{let r="compact"===e||"auto"===e&&t>4;return{compact:r,laneHeight:r?5:14,showLabels:!r}},DL=null,DO=["#B22222","#CD5C5C","#FF6347","#FA8072","#F08080","#A0522D","#FF4500","#FF7F50","#B8860B","#FFA500","#808000","#9ACD32","#32CD32","#8FBC8F","#2E8B57","#3CB371","#00FA9A","#66CDAA","#7FFFD4","#2F4F4F","#008080","#00CED1","#20B2AA","#48D1CC","#4682B4","#778899","#87CEFA","#4169E1","#4169E1","#6495ED","#483D8B","#6A5ACD","#7B68EE","#9370DB","#9370DB","#9932CC","#8A2BE2","#BA55D3","#800080","#DDA0DD","#C71585","#DC143C"];function Dq(e){let t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,n),i=Math.min(t,r,n),o=0,l=0,s=(a+i)/2;if(a!==i){let e=a-i;switch(l=s>.5?e/(2-a-i):e/(a+i),a){case t:o=(r-n)/e+6*(r<n);break;case r:o=(n-t)/e+2;break;case n:o=(t-r)/e+4}o/=6}return{h:360*o,s:100*l,l:100*s}}let D$=[...DO].map(e=>({color:e,hsl:Dq(e)})).sort((e,t)=>Math.abs(e.hsl.h-t.hsl.h)>10?e.hsl.h-t.hsl.h:e.hsl.l-t.hsl.l).map(e=>e.color);function D_(e){let t=[...e].sort((e,t)=>Number(e.startFrequency)-Number(t.startFrequency));return t.map((e,r)=>{let n=t.length,a=D$.length,i=Math.floor(r/n*a),o=Math.floor((r+1)/n*a),l=D$[Math.min(i,a-1)],s=D$[Math.min(o,a-1)],c=r===n-1?D$[a-1]:s;return{...e,color:l,gradientColors:[l,c]}})}let Dj=[{startFrequency:87,stopFrequency:108,stepFrequency:100,bandwidth:150,modulation:"AM",demodulation:"不解调",status:"合法",title:"FM广播",description:"FM调频广播频段,用于音频广播服务"},{startFrequency:108,stopFrequency:118,stepFrequency:50,bandwidth:100,modulation:"FM",demodulation:"解调",status:"合法",title:"航空导航",description:"航空无线电导航频段,用于仪表着陆系统等"},{startFrequency:118,stopFrequency:137,stepFrequency:25,bandwidth:50,modulation:"AM",demodulation:"解调",status:"合法",title:"航空语音通信",description:"民用航空语音通信频段"},{startFrequency:121,stopFrequency:122,stepFrequency:25,bandwidth:50,modulation:"FM",demodulation:"解调",status:"合法",title:"紧急通信",description:"紧急情况通信专用频段"},{startFrequency:136,stopFrequency:174,stepFrequency:25,bandwidth:50,modulation:"FM",demodulation:"解调",status:"合法",title:"对讲通信",description:"专业无线对讲通信频段"},{startFrequency:161,stopFrequency:162,stepFrequency:25,bandwidth:50,modulation:"GMSK",demodulation:"解调",status:"合法",title:"AIS船舶通信",description:"船舶自动识别系统(AIS)专用频段"},{startFrequency:351,stopFrequency:400,stepFrequency:25,bandwidth:50,modulation:"FM",demodulation:"解调",status:"合法",title:"集群通信",description:"专业集群通信系统频段"},{startFrequency:400,stopFrequency:470,stepFrequency:25,bandwidth:50,modulation:"FM",demodulation:"解调",status:"合法",title:"专业对讲",description:"专业无线对讲通信频段"},{startFrequency:534,stopFrequency:542,stepFrequency:100,bandwidth:8e3,modulation:"OFDM",demodulation:"解调",status:"合法",title:"数字电视",description:"数字电视广播频段"},{startFrequency:622,stopFrequency:630,stepFrequency:100,bandwidth:8e3,modulation:"OFDM",demodulation:"解调",status:"合法",title:"数字电视",description:"数字电视广播频段"},{startFrequency:703,stopFrequency:733,stepFrequency:100,bandwidth:3e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"5G上行(广电/移动)",description:"广电和移动5G网络上行频段"},{startFrequency:758,stopFrequency:788,stepFrequency:100,bandwidth:3e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"5G下行(广电/移动)",description:"广电和移动5G网络下行频段"},{startFrequency:806,stopFrequency:821,stepFrequency:25,bandwidth:50,modulation:"π/4DQPSK",demodulation:"解调",status:"合法",title:"数字集群上行",description:"数字集群通信系统(TETRA)上行频段"},{startFrequency:824,stopFrequency:835,stepFrequency:100,bandwidth:5e3,modulation:"QPSK",demodulation:"解调",status:"合法",title:"电信3G/4G/5G上行",description:"中国电信3G/4G/5G网络上行频段"},{startFrequency:851,stopFrequency:866,stepFrequency:25,bandwidth:50,modulation:"π/4DQPSK",demodulation:"解调",status:"合法",title:"数字集群下行",description:"数字集群通信系统(TETRA)下行频段"},{startFrequency:869,stopFrequency:880,stepFrequency:100,bandwidth:5e3,modulation:"QPSK",demodulation:"解调",status:"合法",title:"电信3G/4G/5G下行",description:"中国电信3G/4G/5G网络下行频段"},{startFrequency:885,stopFrequency:889,stepFrequency:200,bandwidth:200,modulation:"GMSK",demodulation:"解调",status:"合法",title:"GSM-R上行",description:"铁路专用GSM-R网络上行频段"},{startFrequency:889,stopFrequency:904,stepFrequency:200,bandwidth:200,modulation:"GMSK",demodulation:"解调",status:"合法",title:"移动2G/4G上行",description:"中国移动2G/4G网络上行频段"},{startFrequency:904,stopFrequency:915,stepFrequency:200,bandwidth:200,modulation:"QPSK",demodulation:"解调",status:"合法",title:"联通2/3/4/5G上行",description:"中国联通2G/3G/4G/5G网络上行频段"},{startFrequency:930,stopFrequency:934,stepFrequency:200,bandwidth:200,modulation:"GMSK",demodulation:"解调",status:"合法",title:"GSM-R下行",description:"铁路专用GSM-R网络下行频段"},{startFrequency:934,stopFrequency:949,stepFrequency:200,bandwidth:200,modulation:"GMSK",demodulation:"解调",status:"合法",title:"移动2G/4G下行",description:"中国移动2G/4G网络下行频段"},{startFrequency:949,stopFrequency:960,stepFrequency:200,bandwidth:200,modulation:"QPSK",demodulation:"解调",status:"合法",title:"联通2/3/4/5G下行",description:"中国联通2G/3G/4G/5G网络下行频段"},{startFrequency:1164,stopFrequency:1189,stepFrequency:1e3,bandwidth:1e4,modulation:"BPSK",demodulation:"解调",status:"合法",title:"GPS L5频段",description:"全球定位系统GPS L5频段"},{startFrequency:1215,stopFrequency:1234,stepFrequency:1e3,bandwidth:1e4,modulation:"BPSK",demodulation:"解调",status:"合法",title:"GPS L2频段",description:"全球定位系统GPS L2频段"},{startFrequency:1447,stopFrequency:1467,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"政务公安专网",description:"政务和公安专用LTE网络频段"},{startFrequency:1563,stopFrequency:1587,stepFrequency:1e3,bandwidth:1e4,modulation:"BPSK",demodulation:"解调",status:"合法",title:"GPS L1频段",description:"全球定位系统GPS L1频段"},{startFrequency:1710,stopFrequency:1735,stepFrequency:200,bandwidth:5e3,modulation:"QPSK",demodulation:"解调",status:"合法",title:"移动2G/4G上行",description:"中国移动2G/4G网络上行频段"},{startFrequency:1735,stopFrequency:1765,stepFrequency:200,bandwidth:5e3,modulation:"QPSK",demodulation:"解调",status:"合法",title:"联通2/4G上行",description:"中国联通2G/4G网络上行频段"},{startFrequency:1805,stopFrequency:1830,stepFrequency:200,bandwidth:5e3,modulation:"QPSK",demodulation:"解调",status:"合法",title:"移动2G/4G下行",description:"中国移动2G/4G网络下行频段"},{startFrequency:1830,stopFrequency:1860,stepFrequency:200,bandwidth:5e3,modulation:"QPSK",demodulation:"解调",status:"合法",title:"联通2/4G下行",description:"中国联通2G/4G网络下行频段"},{startFrequency:1885,stopFrequency:1915,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"移动4G",description:"中国移动4G网络频段"},{startFrequency:1920,stopFrequency:1940,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"电信/联通5G上行",description:"中国电信/联通5G网络上行频段"},{startFrequency:1940,stopFrequency:1965,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"联通3/4/5G上行",description:"中国联通3G/4G/5G网络上行频段"},{startFrequency:2110,stopFrequency:2130,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"电信/联通5G下行",description:"中国电信/联通5G网络下行频段"},{startFrequency:2300,stopFrequency:2320,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"联通4G",description:"中国联通4G网络频段"},{startFrequency:2320,stopFrequency:2370,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"移动4G",description:"中国移动4G网络频段"},{startFrequency:2400,stopFrequency:2500,stepFrequency:1,bandwidth:20,modulation:"OFDM",demodulation:"解调",status:"合法",title:"ISM 2.4GHz",description:"WIFI、蓝牙、无人机等使用频段"},{startFrequency:2515,stopFrequency:2675,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"移动5G/4G",description:"中国移动5G和4G网络频段"},{startFrequency:3300,stopFrequency:3600,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"5G频段",description:"电信、联通、广电5G网络频段"},{startFrequency:4800,stopFrequency:4900,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"移动5G",description:"中国移动5G网络频段"},{startFrequency:4900,stopFrequency:4960,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"广电5G",description:"中国广电5G网络频段"},{startFrequency:5725,stopFrequency:5875.5,stepFrequency:5,bandwidth:20,modulation:"OFDM",demodulation:"解调",status:"合法",title:"ISM 5GHz",description:"WIFI、无人机等使用频段"}],DH="rfkit-charts-frequency-allocation",DB=e=>!!e&&"object"==typeof e&&2===e.version&&Array.isArray(e.channels),DW=()=>{let e=localStorage.getItem(DH);if(!e)return null;let t=JSON.parse(e);return Array.isArray(t)||DB(t)?t:null},DG=()=>{let e=DW();return Array.isArray(e)?e:null},DY=()=>{let e=DW();return DB(e)?e.channels:null},DU=e=>{localStorage.setItem(DH,JSON.stringify(e))},DX=e=>{localStorage.setItem(DH,JSON.stringify({version:2,channels:e}))},DK=()=>{localStorage.removeItem(DH)},DV=()=>null!==localStorage.getItem(DH),DQ="default",DZ=(e,t)=>e.id||e.title||`${DQ}-${t}`,DJ=e=>e.id?`channel:id:${e.id}`:e.title?`channel:title:${e.title}`:"channel:anonymous",D0=(e,t,r)=>{let n=t.get(e)??0,a=0===n?e:`${e}#${n+1}`;for(;r.has(a);)n+=1,a=`${e}#${n+1}`;return t.set(e,n+1),r.add(a),a},D1=(e,t)=>{let r=new Map,n=new Set;return e.map((e,r)=>({id:DZ(e,r),renderKeyBase:DJ(e),title:e.title,data:t(e.data??[])})).filter(e=>e.data.length>0).map(({renderKeyBase:e,...t})=>({...t,renderKey:D0(e,r,n)}))},D2=(e,t)=>[{id:DQ,renderKey:`channel:id:${DQ}`,data:t(e)}];function D5({data:e,channels:t,cachedData:r,cachedChannels:n,presetData:a,normalizeData:i}){if(t)return t.length?D1(t,i):D2(e?.length?e:a,i);if(n?.length)return D1(n,i);let o=e??[];return D2(r&&r.length>0?r:o.length>0?o:a,i)}function D4({data:e,channels:t}){return D5({data:e,channels:t,cachedData:DG(),cachedChannels:DY(),presetData:Dj,normalizeData:D_})}function D3(e){return D4({data:e})[0]?.data??[]}let D6=e=>{if(null!=e.startFrequency&&null!=e.stopFrequency){let t=rT({startFrequency:Number(e.startFrequency),stopFrequency:Number(e.stopFrequency)});if(t)return{start:t.startFreq,stop:t.stopFreq,type:"range"}}return null},D8=e=>JSON.stringify([e.title,e.startFrequency,e.stopFrequency,e.centerFrequency,e.bandwidth,e.stepFrequency,e.modulation,e.description,e.demodulation,e.status]),D9=e=>e.id?`band:id:${e.id}`:`band:fingerprint:${D8(e)}`,D7=(e,t,r)=>{let n=t.get(e)??0,a=0===n?e:`${e}#${n+1}`;for(;r.has(a);)n+=1,a=`${e}#${n+1}`;return t.set(e,n+1),r.add(a),a},ze=({segments:e,allocations:t,channelIndex:r,channelTitle:n})=>{if(!e.length||!t.length)return[];let a=e.reduce((e,t)=>e+t.point,0),i=new Map,o=new Set,l=t.map(e=>({band:e,renderKey:D7(D9(e),i,o)}));return e.map((t,i)=>{let o=l.map(({band:e,renderKey:a})=>{let i=D6(e);if(!i||i.stop<t.start||i.start>t.stop)return null;let{left:o,width:l}=rP({startFreq:i.start,stopFreq:i.stop},t);return{band:e,renderKey:a,range:i,channelIndex:r??0,channelTitle:n,position:{left:`${o}%`,width:`${l}%`}}}).filter(e=>null!==e),s=t.point/a*100,c=e.slice(0,i).reduce((e,t)=>e+t.point/a*100,0);return{segment:t,segmentIndex:i,bandPositions:o,style:{left:`${c}%`,width:`${s}%`}}})},zt=({segments:e,channels:t})=>t.map((t,r)=>({channel:t,channelIndex:r,segmentData:ze({segments:e,allocations:t.data,channelIndex:r,channelTitle:t.title})})).filter(e=>e.segmentData.some(e=>e.bandPositions.length>0)),zr=e=>e.map(e=>{let t=calculateFrequencyRange(null!=e.startFrequency&&null!=e.stopFrequency?{startFrequency:Number(e.startFrequency),stopFrequency:Number(e.stopFrequency)}:{frequency:null!=e.centerFrequency?Number(e.centerFrequency):void 0,bandwidth:null!=e.bandwidth?Number(e.bandwidth):void 0});return t?{item:e,range:t,width:Math.abs(t.stopFreq-t.startFreq),center:(t.startFreq+t.stopFreq)/2,title:String(e.title??"")}:null}).filter(e=>null!==e),zn=({rangeIndex:e,frequency:t})=>{let r;if(Number.isFinite(t)&&e.length){for(let n of e){let{range:e}=n;if(t<e.startFreq||t>e.stopFreq)continue;if(!r){r=n;continue}let a=n.width-r.width;if(a<0){r=n;continue}if(a>0)continue;let i=Math.abs(n.center-t)-Math.abs(r.center-t);if(i<0){r=n;continue}!(i>0)&&0>n.title.localeCompare(r.title)&&(r=n)}return r?.item}},za=({allocations:e,frequency:t})=>zn({rangeIndex:zr(e),frequency:t});function zi(){let e=useSelector(e=>e.frequencyAllocation.data);return useMemo(()=>resolveFrequencyAllocationData(e),[e])}function zo(){let e=at(e=>e.frequencyAllocation.data),t=at(e=>e.frequencyAllocation.channels);return m(()=>D4({data:e,channels:t}),[e,t])}function zl({frequency:e,cursorSample:t}){let r=useSelector(e=>e.cursor),n=useSelector(e=>e.segments),a=useSelector(e=>e.frequencyAllocation.display),i=useSelector(e=>e.frequencyAllocation.show),o=t?.coord.left??r.coord.left,l=useFrequencyAllocationData(),s=useMemo(()=>createFrequencyAllocationRangeIndex(l),[l]),c=useMemo(()=>!!t||hasActiveSpectrumCursor(r),[r,t]),u=useMemo(()=>c&&"number"==typeof o?calculateCursorPosition(o,n):{segmentIndex:-1,pointIndex:-1},[c,o,n]);return useMemo(()=>{if(!i||!a||!e||!n?.length||!c||!n[u.segmentIndex])return;let t=getCursorFrequencyAtPosition(n,u),r=Number.isFinite(t)?t:Number(e);if(Number.isFinite(r))return findFrequencyAllocationInRangeIndex({rangeIndex:s,frequency:r})},[s,u.segmentIndex,a,e,c,n,i])}let zs=null,zc=({allocationInfo:e,variant:t="default"})=>{if(!e)return null;let{title:r,description:a,startFrequency:i,stopFrequency:o,bandwidth:l,modulation:s,channelTitle:c}=e;return /*#__PURE__*/n("div",{className:iX("text-xs leading-5 text-popover-foreground","board"===t&&"mt-[calc(var(--size-gap-base)/2)] border-t border-dashed border-border pt-[calc(var(--size-gap-base)/2)]"),children:[r?/*#__PURE__*/n("div",{className:"mb-1 font-bold",children:["业务类型:",r]}):null,/*#__PURE__*/n("div",{className:"mb-1 text-primary",children:[c?/*#__PURE__*/n("div",{children:["通道:",c]}):null,null!=i&&null!=o&&/*#__PURE__*/n("div",{children:["频率范围:",i," - ",o]}),null!=l&&""!==l?/*#__PURE__*/n("div",{children:["信号带宽:",l," kHz"]}):null,s?/*#__PURE__*/n("div",{children:["调制方式:",s]}):null]}),a?.trim()?/*#__PURE__*/n("div",{className:"whitespace-pre-line break-words leading-5 opacity-85",children:["备注信息:",a]}):null]})},zu=/*#__PURE__*/a.memo(zc),zd=/*#__PURE__*/c(({style:e,bandPositions:t,showLabels:n,onMouseEnter:a,onMouseMove:i,onMouseLeave:o})=>/*#__PURE__*/r("div",{className:"absolute top-0 h-full [contain:layout]",style:e,children:t.map(e=>{let{band:t,position:l,renderKey:s}=e;return /*#__PURE__*/r("div",{className:"pointer-events-auto absolute flex h-full items-center justify-center overflow-hidden px-1 text-xs text-foreground/90 opacity-60 backdrop-blur-sm transition-[opacity,box-shadow] duration-200 hover:z-[1] hover:opacity-100 hover:shadow-lg",style:{...t.gradientColors?{backgroundImage:`linear-gradient(to right, ${t.gradientColors[0]}, ${t.gradientColors[1]})`}:{backgroundColor:t.color||"var(--primary)"},left:l.left,width:l.width},onMouseEnter:a(e),onMouseMove:i,onMouseLeave:o,children:n?/*#__PURE__*/r("span",{className:"truncate",children:t.title}):null},s)})})),zh=zd,zp=({title:e,description:t,visible:n,x:a,y:i,startFrequency:o,stopFrequency:l,centerFrequency:s,stepFrequency:c,bandwidth:d,modulation:p,channelTitle:f,positionRef:m,scheduleRef:b})=>{let v=g(null),y=g(null),w=gi("tooltip"),x=u(()=>{if(!n||!v.current)return;let e=v.current,t=e.offsetWidth,r=e.offsetHeight,o=window.innerWidth,l=window.innerHeight,s=m.current??{x:a,y:i},c=s.x,u=s.y,d=Math.max(12,Math.min(c+t>o-12?c-t-10:c,o-t-12)),h=Math.max(12,Math.min(u+r>l-12?u-r-10:u,l-r-12));e.style.transform=`translate3d(${d}px, ${h}px, 0)`},[m,n,a,i]),k=u(()=>{n&&null===y.current&&(y.current=requestAnimationFrame(()=>{y.current=null,x()}))},[x,n]);return(h(()=>(b.current=k,()=>{b.current===k&&(b.current=null)}),[k,b]),h(()=>{if(n)return k(),()=>{null!==y.current&&(cancelAnimationFrame(y.current),y.current=null)}},[w,k,n]),n&&w)?/*#__PURE__*/R(/*#__PURE__*/r("div",{ref:v,"data-rfkit-frequency-allocation-tooltip":"true",className:"pointer-events-none fixed z-[1] max-w-[300px] rounded-[var(--radius-surface)] border border-border/70 bg-chart-panel/95 p-[var(--size-gap-base)] text-chart-panel-foreground shadow-lg backdrop-blur-md",style:{left:0,top:0,transform:`translate3d(${a}px, ${i}px, 0)`},children:/*#__PURE__*/r(zu,{allocationInfo:{title:e,description:t,startFrequency:o,stopFrequency:l,centerFrequency:s,stepFrequency:c,bandwidth:d,modulation:p,channelTitle:f}})}),w):null},zf=zp,zm=()=>{let e=at(e=>e.axisX.unit),t=at(e=>e.segments),a=at(e=>e.frequencyAllocation.display),i=at(e=>e.frequencyAllocation.show),o=at(e=>e.frequencyAllocation.density),l=at(e=>e.zoom.style),s=zo(),[c,d]=b({visible:!1,x:0,y:0}),h=g({x:0,y:0}),p=g(null),f=u(e=>{h.current={x:e.clientX+10,y:e.clientY+10},p.current?.()},[]),v=m(()=>zt({segments:t,channels:s}),[t,s]),{laneHeight:y,showLabels:w}=DP({density:o,channelCount:v.length}),x=Math.max(y,v.length*y),k=u(e=>{d(t=>({...t,...e}))},[]),S=u(({band:t,channelTitle:r,range:n})=>a=>{f(a);let i={...t,visible:!0,x:h.current.x,y:h.current.y,channelTitle:r,startFrequency:`${n.start}${e}`,stopFrequency:`${n.stop}${e}`};"centerBandwidth"===n.type&&null!=n.frequency&&null!=n.bandwidth&&(i.centerFrequency=`${n.frequency}${e}`),k(i)},[e,k,f]),M=u(e=>{f(e)},[f]),C=u(()=>{k({visible:!1})},[k]);return i&&a&&0!==v.length?/*#__PURE__*/n("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-[5] flex w-full select-none items-center overflow-hidden",style:{height:x,backgroundColor:"var(--mix-chart-surface-12)"},children:[/*#__PURE__*/r("div",{className:"absolute right-0 top-0 h-full w-full will-change-transform",style:l??void 0,children:v.map(({channel:e,channelIndex:t,segmentData:n})=>/*#__PURE__*/r("div",{className:"absolute left-0 w-full",style:{bottom:t*y,height:y},children:n.map(({segmentIndex:t,bandPositions:n,style:a})=>/*#__PURE__*/r(zd,{style:a,bandPositions:n,showLabels:w,onMouseEnter:S,onMouseMove:M,onMouseLeave:C},`${e.renderKey}-segment-${t}`))},e.renderKey))}),/*#__PURE__*/r(zp,{...c,positionRef:h,scheduleRef:p})]}):null},zg=zm,zb=e=>{let[t,r]=b(0);return h(()=>{if(!e)return;let t=tq(e,"FrequencyTagLineBoard",()=>{r(e=>e+1)});return()=>{t?.()}},[e]),t},zv=({id:e})=>{let{state:{frequencyTagLine:t,cursor:n}}=ae(),{show:a,display:i,left:o,onChange:l}=t,s=zb(e),c=n.show&&n.active&&n.event?.sourceType===rr.Spectrum,d=u(e=>{if(!e)return;let{index:t,frequency:r}=e;tY(r)&&l({index:t,frequency:r})},[l]);return a&&i&&!c?/*#__PURE__*/r("div",{className:"absolute bottom-5 right-[34px] z-[6] h-auto w-auto",children:/*#__PURE__*/r(Sh,{left:o,updateKey:s,onChange:d,showSignalInfo:!1})}):null},zy=/*#__PURE__*/a.memo(zv),zw=()=>{let{state:{frequencyTagLine:e},dispatch:t}=useStore(),{display:r,show:n}=e,a=useCallback(r=>{t({payload:{frequencyTagLine:{...e,display:!!r}}})},[e]),i=useMemo(()=>/*#__PURE__*/_jsx("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",children:/*#__PURE__*/_jsx("path",{d:"M288 128H896l-120 256L896 640H288v320H192v-896h96V128z",fillOpacity:".65",fill:"currentColor",style:{transition:"fill 0.2s ease"}})}),[r]);return n?/*#__PURE__*/_jsx(IconBox,{active:r,tone:"primary",onClick:()=>a(!r),title:"频率标记线显示控制",children:i}):null},zx=/*#__PURE__*/null,zk=rl.FrequencyTagLine,zS=e=>{let{state:{frequencyTagLine:t},dispatch:n}=ae(),{show:a,display:i,left:o,onChange:l}=t,{id:s}=e,c=g(t);return(h(()=>{c.current=t},[t]),h(()=>{let e=wK(s,zk,()=>{a&&i&&xt(s,zk)}),t=wV(s,zk,()=>{a&&i&&xt(s,zk)});return()=>{e?.(),t?.()}},[s,a,i,l]),h(()=>{let e=wU(s,zk,e=>{a&&i&&n({payload:{frequencyTagLine:{...c.current,...e,id:s}}})}),t=wJ(s,zk,(e,t)=>{a&&i&&(w7(s,zk),n({payload:{frequencyTagLine:{...c.current,...t,id:s}}}))});return()=>{e?.(),t?.()}},[s,a,i,n]),h(()=>{n({payload:{frequencyTagLine:{...t,left:-100}}})},[a]),a&&i)?/*#__PURE__*/r(yi,{className:"z-[3]",children:/*#__PURE__*/r("div",{className:"relative flex h-full w-px border-l border-dashed border-chart-highlight/80 opacity-80",style:{left:`${o}%`}})}):null},zM=/*#__PURE__*/a.memo(zS),zC={color:tQ},zF={borderColor:tQ},zD=({value:e,onChange:t,dragging:a})=>{let{state:{axisY:i,limit:o}}=ae(),{label:l,disabled:s}=o,{unit:c="",range:d=ns,step:h=no}=i,[p,f]=d,v=m(()=>rg(c)?ny(0):0,[c]),y=u(e=>(f-e-v)/(f-p)*100,[f,v,p]),w=m(()=>y(e),[y,e]),x=m(()=>Math.round(v+e),[v,e]),[k,S]=b(!1),M=g(null),C=u(e=>{switch(e.key){case"Enter":{if(!M.current){S(!1);break}let e=Number(M.current.value);!Number.isNaN(e)&&e>=p&&e<=f&&(t?.(Math.floor(e-v)),M.current.blur()),S(!1);break}case"Escape":S(!1)}},[M,d,v,t]);return /*#__PURE__*/r("div",{className:"relative h-full w-full",children:/*#__PURE__*/n("div",{className:"absolute right-0 h-0 w-full",style:{top:`${w}%`},children:[!k||s?/*#__PURE__*/n("button",{type:"button",disabled:s,className:`${a?"pointer-events-none":"pointer-events-auto"} absolute right-7 top-[-28px] z-[8] flex h-6 appearance-none items-center justify-center rounded-[var(--radius-control)] border-0 bg-secondary px-2 text-xs text-foreground`,style:zC,onClick:()=>S(!0),children:[l," ",x,c]}):/*#__PURE__*/n("div",{className:"pointer-events-auto absolute right-7 top-[-28px] z-[8] flex h-6 items-center justify-between bg-secondary px-2 text-xs text-foreground",style:zC,children:[l," ",/*#__PURE__*/r("input",{ref:M,type:"number","aria-label":`${l}${c}门限值`,defaultValue:x,min:p,max:f,step:h/5,className:"h-auto w-14 border-none bg-transparent p-0 text-center outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",style:zC,onKeyDown:C}),/*#__PURE__*/r("div",{className:"flex items-center",children:c})]}),/*#__PURE__*/r("div",{className:"absolute right-0 top-[-0.5px] z-[8] h-0 w-full border-b border-dashed",style:zF})]})})},zz=zD,zN=rl.Limit,zE=10,zT=({id:e})=>{let{state:{limit:t,segments:n,axisY:a,system:i},dispatch:o}=ae(),{show:l,active:s,disabled:c,value:d,onChange:p,unified:f}=t,[v,y]=a.range,{totalPoints:w}=n,x=m(()=>l&&s,[l,s]),[k,S]=b(0/0),M=g(null),C=g(!1),F=g(t);h(()=>{F.current=t},[t]);let D=u((e,t)=>{let r,n=f?[t]:((r=[...F.current.value])[e]=t,r);o({payload:{limit:{...F.current,value:n}}})},[o,f]),z=u(()=>{p(f?Array.from({length:n.length},()=>F.current.value[0]):F.current.value)},[p,f,n.length]);return(h(()=>{wU(e,zN,e=>{if(!x||c||!e?.left||!e?.top)return;let t=e.left,r=f?0:n.findIndex(e=>e.progress[0]<=t&&t<e.progress[1]);if(!Number.isFinite(r)||r<0){S(0/0),M.current=null,C.current=!1;return}let o=y-v;if(!Number.isFinite(o)||0===o)return;let l=rg(a.unit)?ny(0):0,s=F.current.value[r],u=(y-s-l)/o*100,d=Math.max(1.2,10/Math.max(1,i.height||1)*100);if(Math.abs(e.top-u)>d){S(0/0),M.current=null,C.current=!1;return}S(r),M.current=s,C.current=!0}),wV(e,zN,()=>{x&&!c&&(C.current&&z(),S(0/0),M.current=null,C.current=!1,xt(e,zN))}),wK(e,zN,()=>{x&&!c&&(C.current&&z(),S(0/0),M.current=null,C.current=!1,xt(e,zN))}),wJ(e,zN,(t,r,n)=>{if(x&&!c&&tY(k)&&w7(e,zN)&&n?.top){let e=y-v;if(!Number.isFinite(e)||0===e)return;let t=(M.current??F.current.value[k])-n.top*e;M.current=t,D(k,t)}})},[x,c,k,n,e,D,z,f,v,y,a.unit,i.height]),x)?f?/*#__PURE__*/r(yi,{className:"z-[7]",children:/*#__PURE__*/r("div",{className:"h-full w-full",style:{opacity:+!!tY(d[0])},children:/*#__PURE__*/r(zD,{id:e,value:d[0],onChange:e=>D(0,e),dragging:tY(k)})})}):/*#__PURE__*/r(yi,{className:"z-[7]",children:n?.map((t,n)=>/*#__PURE__*/r("div",{style:{width:`${100*t.point/w}%`,opacity:+!!tY(d[n])},className:"h-full w-[30%]",children:/*#__PURE__*/r(zD,{id:e,value:d[n],onChange:e=>D(n,e),dragging:tY(k)},t.index)},t.index))}):null},zR=zT,zA=rl.Markers,zI=6,zP=8,zL=e=>{let{id:t,markers:r,display:n,fixed:a,readonly:i,onCreateMarker:o,onDeleteMarker:l,onUpdateMarker:s,onToggleSelect:c,onHover:d,onResetHover:p}=e,f=g({isDown:null,dragStart:null,isHover:"",hoverId:null}),m=u(()=>document.getElementById(wW(t))??document.getElementById(t),[t]),b=u(e=>{if(!e||!r||0===r.length)return null;let{left:t}=e;if(void 0===t)return null;let n=m();if(!n)return null;let{width:a}=n.getBoundingClientRect();for(let e=0;e<r.length;e+=1){let n=r[e];if(n&&Math.abs(t-n.left)*a/100<=6)return{...n,index:e}}return null},[m,r]),v=u(e=>{let t=m();if(!t)return"";let n=t.getBoundingClientRect().width,a="";for(let t=0;t<r.length;t+=1){let i=r[t];if(i&&Math.abs(e.left-i.left)*n/100<=8){a={...i,index:t};break}}return a},[m,r]);return h(()=>{if(i)return;let e=wY(t,zA,(e,t)=>{if(n&&void 0!==t.left){let e=v({left:t.left}),r="object"==typeof e?e.id:null;if(f.current.hoverId===r){f.current.isHover=e;return}f.current.isHover=e,f.current.hoverId=r,d({left:t.left})}}),r=wJ(t,zA,(e,r)=>{let{isDown:i}=f.current;n&&i&&w7(t,zA)&&!a&&s(i.id,{left:r.left,top:r.top})}),u=wU(t,zA,e=>{if(!n)return;let t=b(e)||("object"==typeof f.current.isHover?f.current.isHover:null);t&&!a&&(f.current.isDown=t)}),h=wK(t,zA,()=>{n&&(f.current.isDown=null,xt(t,zA))}),m=wV(t,zA,()=>{if(!n)return;let e=null!==f.current.hoverId;f.current.isDown=null,f.current.isHover="",f.current.hoverId=null,xt(t,zA),e&&p()}),g=w1(t,zA,(e,r)=>{if(!n||!w7(t,zA))return;let a=b(r)||("object"==typeof f.current.isHover?f.current.isHover:null);a?.id&&c(a.id)}),y=wX(t,zA,(e,r)=>{if(!n||!w7(t,zA)||void 0===r.left)return!1;let a=v({left:r.left});return a&&"object"==typeof a&&a.id?l(a.id):o({left:r.left}),!0});return()=>{e?.(),r?.(),u?.(),h?.(),m?.(),g?.(),y?.()}},[t,n,r,a,i,o,l,s,c,d,p,b,v]),{isDown:f.current.isDown}},zO=t0("marker"),zq=e=>Fn(e);function z$(e,t,r){let{needsMaxPeak:n=!1,needsTopPeaks:a=!1}=r||{},i=null,o=null;try{let t=tO(e).getAllRawData()[t3];if(t?.peaks?.peaks&&Array.isArray(t.peaks.peaks)){let e=t.peaks.peaks;return n&&e.length>0&&(i=e[0]),a&&(o=e),{maxPeak:i,topPeaks:o}}}catch(e){console.warn("[useMarkers] Failed to get precomputed peaks:",e)}return n&&(i=Ff(t)),a&&(o=Fg(t,2)),{maxPeak:i,topPeaks:o}}let z_=e=>{let{id:t,globalID:r,onChange:n}=e,[a,i]=b({markers:[],colorIndex:0,isDown:null,isHover:"",peak:null,hasPeak:!1}),o=g(new Float32Array),l=u((e,t)=>{let{axisY:{unit:n},axisX:{frequencyFormat:a}}=Fn(r),i=e.left,{peak:l}=e,s=t?.data??o.current;s&&0!==s.length||(s=tO(r).getAllRawData()[t3]),o.current=s;let c=Fp({left:i,globalID:r}),{outsideLeft:u,multiple:d}=c,{insideLeft:h}=c,p=s.length,f=Math.floor(p*h/100);if(100===h&&(f=p-1),"mainSecondary"===e.peakTracking&&"number"==typeof e.peakRank){let n=t?.topPeaks;n||(n=z$(r,s,{needsTopPeaks:!0}).topPeaks);let a=n?.[e.peakRank];a&&(h=((f=a.index)+.5)*100/p)}else if(l){let e=t?.maxPeak;e||(e=z$(r,s,{needsMaxPeak:!0}).maxPeak),e&&(h=((f=e.index)+.5)*100/p)}let m=parseFloat(a(i=u+h/d)),g=s[f];return void 0===g||Number.isNaN(g)||(e.level=parseFloat(nI(n,g).toFixed(1))),{...e,left:i,frequency:m}},[r]),s=u((e,t=!1)=>{0!==o.current.length&&i(a=>{let{marker:{maxCount:i,fifo:o}}=Fn(r),s=Fi(a.markers,[e],i,o);if(!s.allowed)return a;let c=rV(),u=zO[a.colorIndex%20],d={...l({...e,id:c,color:u,select:!1,peak:!1,frequency:0,hover:!1}),id:c,color:u,select:!t,peak:!1,hover:!1},h=[...t?s.keptMarkers:s.keptMarkers.map(e=>({...e,select:!1})),d];return t||setTimeout(()=>{n?.(ro.Add,h)},0),{...a,markers:h,colorIndex:a.colorIndex+1}})},[l,n]),c=u(({event:e,marker:t,frequencies:a,silent:s=!1})=>{i(i=>{let c=[...i.markers],u=ro.Update,{id:d,peak:h,select:p,frequency:f,left:m,top:g}=t||{},b=m;if(e===ro.Update&&void 0!==f){let e=Fn(r),t=(e?.segments||{totalPoints:0})[0];if(t&&d){let{start:e,stop:r}=t,n=r-e;if(void 0!==n&&f<r&&f>e)b=(f-e)*100/n;else{let e=c.findIndex(e=>e.id===d);-1!==e&&(c.splice(e,1),u=ro.Del)}}}if(e===ro.Add&&a?.length){let e=Fn(r),t=(e?.segments||{totalPoints:0})[0];if(t){let{start:e,stop:r}=t,n=r-e;if(void 0!==n){let t=[];for(let i=0;i<a.length;i+=1){let o=a[i];o>=e&&o<=r&&t.push((o-e)*100/n)}t.length>0&&(a=t)}}}if(e===ro.Add&&a?.length){let{marker:{maxCount:e,fifo:t}}=Fn(r),n=Fi(c,a,e,t);if(n.allowed&&n.itemsToAdd.length>0){c=n.keptMarkers.map(e=>({...e,select:!1}));let e=n.itemsToAdd;for(let t=0;t<e.length;t+=1){let r=rV(),n=zO[(i.colorIndex+t)%20],a=!1;if(o.current&&o.current.length>0){let r=-1/0,n=0;for(let e=0;e<o.current.length;e++)o.current[e]>r&&(r=o.current[e],n=e);Math.abs(Math.floor(o.current.length*e[t]/100)-n)<=Math.max(1,Math.floor(.01*o.current.length))&&(a=!0)}let s=l({left:e[t],id:r,color:n,select:!1,peak:a,frequency:0,hover:!1});c.push({...s,id:r,color:n,select:t===e.length-1,peak:a,hover:!1})}u=ro.Add}}if(e===ro.Del){let e=c.findIndex(e=>e.id===d);-1!==e&&(c.splice(e,1),u=ro.Del)}return e===ro.Clear&&(c=[],u=ro.Clear),e===ro.Update&&(u=ro.Update,c=c.map(e=>(void 0!==h&&(e.peak=!1),void 0!==p&&e.id!==d&&(e.select=!1),e.id===d&&(void 0!==b&&(e=l({...e,left:b,top:g||e.top})),void 0!==p&&(e.select=p),void 0!==h&&(e.peak=h,h&&void 0===p&&(e.select=!0))),e.peak,e))),s||setTimeout(()=>{n?.(u,c)},0),{...i,markers:c,colorIndex:e===ro.Clear?0:i.colorIndex}})},[l,n]),d=u(()=>{i(e=>({...e,markers:[],colorIndex:0})),setTimeout(()=>{n?.(ro.Clear,[])},0)},[n]),h=u(e=>{e&&(o.current=e),i(t=>{if(0===t.markers.length)return t;let a=t.markers.some(e=>e.peak&&"mainSecondary"!==e.peakTracking),i=t.markers.some(e=>"mainSecondary"===e.peakTracking&&"number"==typeof e.peakRank),s=e??o.current??new Float32Array,{maxPeak:c,topPeaks:u}=z$(r,s,{needsMaxPeak:a,needsTopPeaks:i}),d=t.markers.map(e=>l(e,{data:s,maxPeak:c,topPeaks:u}));return d.some((e,r)=>{let n=t.markers[r];return n&&(Math.abs(e.frequency-n.frequency)>.001||Math.abs(e.level-n.level)>.001)})&&setTimeout(()=>{n?.(ro.Update,d)},0),{...t,markers:d}})},[l,n]),p=u(e=>{let a=document.getElementById(t);if(!a)return"";let o=a.getBoundingClientRect(),{zoom:{interval:{start:l,end:s}},segments:c}=Fn(r),u=c.totalPoints/(s-l+1),d=o.width*u/100,h="",p=!1;return i(t=>{let r=t.markers.map((t,r)=>{let n=Math.abs(e.left-t.left)*d<=16;return t.hover!==n&&(p=!0),n&&(h={...t,index:r}),{...t,hover:n}});return p&&setTimeout(()=>{n?.(ro.Update,r)},0),{...t,markers:r,isHover:h}}),h},[t,r,n]),f=u(()=>{i(e=>{let t=!1,r=e.markers.map(e=>(e.hover&&(t=!0),{...e,hover:!1}));return t&&setTimeout(()=>{n?.(ro.Update,r)},0),{...e,markers:r,isHover:""}})},[n]),m=g(null),v=g(null),y=u(()=>{i(e=>{if(e.markers.some(e=>"mainSecondary"===e.peakTracking)){let t=e.markers.filter(e=>"mainSecondary"!==e.peakTracking),r=m.current;if(r){let e=t.findIndex(e=>e.id===r);-1!==e&&(t[e]={...t[e],select:!0})}return m.current=null,setTimeout(()=>{n?.(ro.Update,t)},0),{...e,markers:t}}let{marker:t}=Fn(r),a=t.maxCount,i=t.fifo,s=Fi(e.markers,[0,1],a,i);if(!s.allowed||s.itemsToAdd.length<2)return e;m.current=e.markers.find(e=>e.select)?.id??null;let c=[],u=e.colorIndex,d=e=>{let t=rV(),r=zO[u%20];u+=1;let n=l({left:50,id:t,color:r,select:!1,peak:!0,peakTracking:"mainSecondary",peakRank:e,frequency:0,hover:!1});c.push({...n,id:t,color:r,select:!1,peak:!0,peakTracking:"mainSecondary",peakRank:e,hover:!1})};d(0),d(1);let h=[...s.keptMarkers,...c.map(e=>({...e,select:!1}))].map(e=>l(e,{data:o.current}));return setTimeout(()=>{n?.(ro.Update,h)},0),{...e,markers:h,colorIndex:u}})},[l,r,n]),w=u(()=>{i(e=>{if(e.markers.some(e=>"mainSecondary"===e.peakTracking&&0===e.peakRank)){let t=e.markers.filter(e=>"mainSecondary"!==e.peakTracking||0!==e.peakRank),r=v.current;if(r){let e=t.findIndex(e=>e.id===r);-1!==e&&(t[e]={...t[e],select:!0})}return v.current=null,setTimeout(()=>{n?.(ro.Update,t)},0),{...e,markers:t}}let{marker:t}=Fn(r),a=t.maxCount,i=t.fifo,s=Fi(e.markers,[0],a,i);if(!s.allowed||s.itemsToAdd.length<1)return e;v.current=e.markers.find(e=>e.select)?.id??null;let c=rV(),u=zO[e.colorIndex%20],d={...l({left:50,id:c,color:u,select:!1,peak:!0,peakTracking:"mainSecondary",peakRank:0,frequency:0,hover:!1}),id:c,color:u,select:!1,peak:!0,peakTracking:"mainSecondary",peakRank:0,hover:!1},h=[...s.keptMarkers,d].map(e=>l(e,{data:o.current}));return setTimeout(()=>{n?.(ro.Update,h)},0),{...e,markers:h,colorIndex:e.colorIndex+1}})},[l,r,n]),x=u((e,t)=>{i(a=>{let i=a.markers.find(e=>e.id===t);if(!i)return a;let s=tO(r).getAllRawData()[t3];if(!s||s.length<3)return a;o.current=s;let{zoom:c,segments:u}=Fn(r),d=s.length,h=u.totalPoints||d,p=c.interval.end-c.interval.start+1,f=(i.left*h/100-c.interval.start)*100/p,m=Math.floor(d*f/100);100===f&&(m=d-1);let g=-1;if(s.peaks?.peaks&&Array.isArray(s.peaks.peaks)){let t=s.peaks.peaks;if("left"===e){let e=1/0;for(let r of t)if(r.index<m){let t=m-r.index;t<e&&(e=t,g=r.index)}}else{let e=1/0;for(let r of t)if(r.index>m){let t=r.index-m;t<e&&(e=t,g=r.index)}}}if(-1===g){let t=e=>{if(e<=0||e>=d-1)return!1;let t=s[e];return t>s[e-1]&&t>s[e+1]};if("left"===e){for(let e=m-1;e>0;e-=1)if(t(e)){g=e;break}}else for(let e=m+1;e<d-1;e+=1)if(t(e)){g=e;break}}if(-1===g)return a;let b=((g+.5)*100/d*p/100+c.interval.start)*(100/h),v=a.markers.map(e=>{if(e.id!==t)return{...e,select:!1};let{peakTracking:r,peakRank:n,...a}=e;return l({...a,left:b,select:!0,peak:!1},{data:s})});return setTimeout(()=>{n?.(ro.Update,v)},0),{...a,markers:v}})},[l,r,n]),k=u(e=>{i(t=>{if(!t.markers.find(t=>t.id===e))return t;let a=tO(r).getAllRawData()[t3];if(!a||a.length<1)return t;o.current=a;let{zoom:i,segments:s}=Fn(r),c=a.length,u=s.totalPoints||c,d=0,h=a[0];for(let e=1;e<c;e+=1)a[e]>h&&(h=a[e],d=e);let p=(100*d/(c-1)*(i.interval.end-i.interval.start+1)/100+i.interval.start)*(100/u),f=t.markers.map(t=>{if(t.id!==e)return{...t,select:!1};let{peakTracking:r,peakRank:n,...i}=t;return l({...i,left:p,select:!0,peak:!1},{data:a})});return setTimeout(()=>{n?.(ro.Update,f)},0),{...t,markers:f}})},[l,r,n]),S=u(e=>{i(t=>{if(!t.markers.find(t=>t.id===e))return t;let a=tO(r).getAllRawData()[t3];if(!a||a.length<3)return t;o.current=a;let{zoom:i,segments:s}=Fn(r),c=a.length,u=s.totalPoints||c,d=0,h=a[0];for(let e=1;e<c;e+=1)a[e]>h&&(h=a[e],d=e);let p=Math.max(2,Math.floor(.1*c)),f=-1,m=-1/0;for(let e=1;e<c-1;e+=1){if(Math.abs(e-d)<p)continue;let t=a[e],r=a[e-1],n=a[e+1];t>r&&t>n&&t>m&&(m=t,f=e)}if(-1===f)return t;let g=(100*f/(c-1)*(i.interval.end-i.interval.start+1)/100+i.interval.start)*(100/u),b=t.markers.map(t=>{if(t.id!==e)return{...t,select:!1};let{peakTracking:r,peakRank:n,...i}=t;return l({...i,left:g,select:!0,peak:!1},{data:a})});return setTimeout(()=>{n?.(ro.Update,b)},0),{...t,markers:b}})},[l,r,n]),M=u((e,t)=>{i(a=>{let i,s=a.markers.find(e=>e.id===t);if(!s)return a;let c=tO(r).getAllRawData()[t3];if(!c||c.length<2)return a;o.current=c;let{zoom:u,segments:d}=Fn(r),h=c.length,p=d.totalPoints||h,f=u.interval.end-u.interval.start+1,m=Math.round((h-1)*((s.left*p/100-u.interval.start)*100/f)/100);if((i="left"===e?Math.max(0,m-1):Math.min(h-1,m+1))===m)return a;let g=(100*i/(h-1)*f/100+u.interval.start)*(100/p),b=a.markers.map(e=>{if(e.id!==t)return{...e,select:!1};let{peakTracking:r,peakRank:n,...a}=e;return l({...a,left:g,select:!0,peak:!1},{data:c})});return setTimeout(()=>{n?.(ro.Update,b)},0),{...a,markers:b}})},[l,r,n]),C="#F98116",F="#AA74E8",D=u(()=>{i(e=>{let t,a=tO(r).getAllRawData()[t3];if(!a||a.length<1)return e;o.current=a;let{zoom:i,segments:s}=Fn(r),c=a.length,u=s.totalPoints||c,d=0,h=a[0];for(let e=1;e<c;e+=1)a[e]>h&&(h=a[e],d=e);let p=(100*d/(c-1)*(i.interval.end-i.interval.start+1)/100+i.interval.start)*(100/u),f=e.markers.find(e=>e.color===C);if(f)t=e.markers.map(e=>e.id===f.id?l({...e,left:p},{data:a}):e);else{let{marker:n}=Fn(r),i=n.maxCount,o=n.fifo,s=Fi(e.markers,[p],i,o);if(!s.allowed)return e;let c=l({left:p,id:rV(),color:C,select:!1,peak:!1,hover:!1},{data:a});t=[...s.keptMarkers,c]}return setTimeout(()=>{n?.(ro.Update,t)},0),{...e,markers:t}})},[l,r,n]),z=u(()=>{i(e=>{let t,a=tO(r).getAllRawData()[t3];if(!a||a.length<3)return e;o.current=a;let{zoom:i,segments:s}=Fn(r),c=a.length,u=s.totalPoints||c,d=0,h=a[0];for(let e=1;e<c;e+=1)a[e]>h&&(h=a[e],d=e);let p=Math.max(2,Math.floor(.1*c)),f=-1,m=-1/0;for(let e=1;e<c-1;e+=1){if(Math.abs(e-d)<p)continue;let t=a[e],r=a[e-1],n=a[e+1];t>r&&t>n&&t>m&&(m=t,f=e)}if(-1===f)return e;let g=(100*f/(c-1)*(i.interval.end-i.interval.start+1)/100+i.interval.start)*(100/u),b=e.markers.find(e=>e.color===F);if(b)t=e.markers.map(e=>e.id===b.id?l({...e,left:g},{data:a}):e);else{let{marker:n}=Fn(r),i=n.maxCount,o=n.fifo,s=Fi(e.markers,[g],i,o);if(!s.allowed)return e;let c=l({left:g,id:rV(),color:F,select:!1,peak:!1,hover:!1},{data:a});t=[...s.keptMarkers,c]}return setTimeout(()=>{n?.(ro.Update,t)},0),{...e,markers:t}})},[l,r,n]);return{markers:a.markers,isDown:a.isDown,isHover:a.isHover,createMarker:s,updateMarkerAttribute:c,resetMarkers:d,updateByData:h,handleHover:p,resetHover:f,toggleMainSecondaryPeaks:y,toggleMainPeak:w,moveToAdjacentPeak:x,findMainPeak:k,findSecondaryPeak:S,moveToStep:M,createMainPeakMarker:D,createSecondaryPeakMarker:z,setState:i}},zj=e=>{let{top:a,left:i,color:o="transparent",x:l=!0,y:s=!0,lineWidth:c=1}=e;return /*#__PURE__*/n(t,{children:[l&&/*#__PURE__*/r("div",{className:"absolute left-0 top-[-200%] z-[5] w-full border-t border-dashed",style:{top:a,borderColor:o,borderTopWidth:`${c}px`}}),s&&/*#__PURE__*/r("div",{className:"absolute left-[-200%] top-0 z-[5] h-full border-l border-dashed",style:{left:i,borderColor:o,borderLeftWidth:`${c}px`}})]})},zH=zj,zB=({marker:e})=>{let{state:{axisX:t,axisY:a}}=ae(),i=g(null),o=g(null),[l,s]=b(0),[c,u]=b(0);h(()=>{let e=()=>{i.current&&s(i.current.offsetWidth),o.current&&u(o.current.offsetWidth)};e();let t=new ResizeObserver(()=>{e()});return i.current&&t.observe(i.current),o.current&&t.observe(o.current),()=>{t.disconnect()}},[e.frequency,e.level]);let d=m(()=>{let t=e.left/100*l,r=l>0&&c>0&&t+c+10>l-20;return{left:`${e.left}%`,color:e.color,opacity:e.hover?1:.68,fontWeight:e.hover?500:"normal",transform:r?"translateX(-100%)":"translateX(0)",marginLeft:r?"-10px":"10px"}},[e.left,e.hover,e.color,l,c]);return /*#__PURE__*/n("div",{ref:i,className:"absolute left-0 top-0 h-full w-full",id:e.id,title:`${e.frequency}${t.unit} / ${e.level}${a.unit}`,children:[/*#__PURE__*/n("div",{ref:o,className:"absolute top-[10px] z-[5] whitespace-nowrap text-[12px] leading-4 transition-[opacity,font-weight,transform,margin-left,color]",style:d,children:[/*#__PURE__*/n("div",{children:[e.frequency,t.unit]}),void 0!==e.level&&/*#__PURE__*/n("div",{children:[e.level,a.unit]})]}),/*#__PURE__*/r(zj,{x:!1,left:`${e.left}%`,top:`${e.top}%`,color:e.color,lineWidth:e.select?2:1})]},e.id)},zW=/*#__PURE__*/a.memo(zB),zG=({id:e})=>{let{state:{marker:t,globalID:n}}=ae(),{enabled:a,visible:i,fixed:o,readonly:l,maxCount:s,onChange:c}=t,d=u((e,t)=>{c?.(e,t),Fs(n)({count:t.length,maxCount:s});let r=t.find(e=>e.select)?.id??null;Fc(n)({selectedId:r})},[c,n,s]),p=m(()=>a&&i,[a,i,t.enabled,t.visible]),f=m(()=>wW(e),[e]),{markers:b,createMarker:v,updateMarkerAttribute:y,resetMarkers:w,updateByData:x,handleHover:k,resetHover:S,toggleMainSecondaryPeaks:M,toggleMainPeak:C,moveToAdjacentPeak:F,findMainPeak:D,findSecondaryPeak:z,createMainPeakMarker:N,createSecondaryPeakMarker:E}=z_({id:e,globalID:n,display:i,onChange:d});h(()=>{if(!n||!f||!p||l)return;let e=nP(n,f,e=>{let t=e.key.toLowerCase();if(!["a","d","w","s"].includes(t))return;if("w"===t){if(e.repeat)return;e.preventDefault(),N();return}if("s"===t){if(e.repeat)return;e.preventDefault(),E();return}let r=b.find(e=>e.select)?.id;r&&(e.preventDefault(),F("a"===t?"left":"right",r))});return()=>{e?.()}},[f,n,b,F,p,l,N,E]);let T=u(e=>{let t=b.find(t=>t.id===e),r=!t?.select;y({event:ro.Update,marker:{id:e,select:r}})},[b,y]),R=u((e,t)=>{y({event:ro.Update,marker:{id:e,left:t.left,top:t.top}})},[y]);zL({id:e,markers:b,display:p,fixed:o,readonly:l,onCreateMarker:v,onDeleteMarker:u(e=>{y({event:ro.Del,marker:{id:e}})},[y]),onUpdateMarker:R,onToggleSelect:T,onHover:k,onResetHover:S});let A=g(null);return(h(()=>{n&&e&&tq(e,"Marker",()=>{let{realData:e}=tO(n).getAllRawData();A.current=e??null,x(e)})},[n,e,x]),h(()=>{n&&e&&Fo(n,e=>{y(e)})},[n,e,y,w]),h(()=>{n&&e&&Fu(n,e=>{if(e?.type){if("main-secondary-peaks"===e.type)return void M();if("main-peak"===e.type)return void C();if("left-peak"===e.type)return void F("left",e.selectedId);if("right-peak"===e.type)return void F("right",e.selectedId);if("find-main-peak"===e.type)return void D(e.selectedId);if("find-secondary-peak"===e.type)return void z(e.selectedId);if("create-main-peak"===e.type)return void N();if("create-secondary-peak"===e.type)return void E();if("clear-all"===e.type)return void w()}})},[n,e,F,M,C,D,z,N,E,w]),p)?/*#__PURE__*/r(yi,{className:"z-[5]",children:b.map(e=>/*#__PURE__*/r(zW,{marker:e},e.id))}):null},zY=zG,zU=({segments:e,index:t,frequency:r,bandwidth:n})=>{if(!r||!n||!e||!e[t])return{left:0,width:0};let a=e[t],i=e.reduce((e,t)=>e+t.point,0),{left:o,width:l}=rP({startFreq:r-n/2e3,stopFreq:r+n/2e3},a),s=e.slice(0,t).reduce((e,t)=>e+t.point/i*100,0),c=a.point/i*100;return{left:s+o/100*c,width:l/100*c}};function zX(){let{state:{scope:e,segments:t},dispatch:r}=ae();return u(n=>{let{frequency:a,bandwidth:i,index:o=0}=n,{left:l,width:s}=zU({segments:t,index:o,frequency:a,bandwidth:i});r({payload:{scope:{...e,left:l,width:s}}})},[t,e])}let zK=()=>{let{state:{scope:{show:e,left:t,width:n}}}=ae();return e?/*#__PURE__*/r(yi,{children:/*#__PURE__*/r("div",{className:"relative flex h-full w-0 box-border border-y border-dashed border-chart-grid bg-chart-surface opacity-50",style:{width:`${n}%`,left:`${t}%`}})}):null},zV=zK,zQ=/*#__PURE__*/c(({style:e,signalPositions:t,activeSignalKey:n,segmentIndex:a})=>/*#__PURE__*/r("div",{className:"absolute h-full box-border",style:e,children:t.map(({item:e,key:t,position:i,color:o,tooltip:l})=>{let s=n===t,c={left:i.left,width:i.width,minWidth:"1px",backgroundColor:o,height:s?"100%":"8px",opacity:s?.5:1};return /*#__PURE__*/r("div",{className:"pointer-events-none absolute top-0 flex min-w-px items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap text-center text-xs text-foreground","data-signal-active":s?"true":"false","data-signal-key":t,"data-signal-source":kA(e),"data-testid":"signal-annotation",style:c,title:l},`segment-${a}-signal-${t}`)})})),zZ=zQ;function zJ(){let{state:e,dispatch:t}=ae(),r=g(e.globalID),n=g(e.signal),a=g({});return h(()=>{r.current=e.globalID,n.current=e.signal},[e.globalID,e.signal]),h(()=>{if(!e.globalID)return;let r=a.current.station,i=a.current.simple;void 0!==r&&(Se(e.globalID,r),a.current.station=void 0),void 0!==i&&(t({payload:{signal:{...n.current,data:i}}}),a.current.simple=void 0)},[t,e.globalID]),{updateSignalData:u(e=>{let{type:i,data:o}=e;if(Array.isArray(o)){if("station"===i){if(!r.current){a.current.station=o;return}Se(r.current,o)}else if("simple"===i){if(!r.current){a.current.simple=o;return}t({payload:{signal:{...n.current,data:o}}})}}},[t])}}let z0=({id:e,show:t=!0,display:n=!0})=>{let a=at(e=>e.segments),i=at(e=>e.zoom.style),o=at(e=>e.signal),l=xo(e),s=l?.coord.left,c=St({respectVisibility:!0}),u=o.show&&o.display&&n,d=!!l,h=m(()=>d&&"number"==typeof s?rL(s,a):{segmentIndex:-1,pointIndex:-1},[d,a,s]),p=m(()=>d?rO(a,h):0/0,[h,d,a]),f=m(()=>k1({segments:a,signalItems:c}),[a,c]),g=m(()=>k2({segmentData:f,isCursorActive:d,currentFrequency:p,currentPosition:h}),[p,h,d,f]);return t&&u?/*#__PURE__*/r("div",{className:"pointer-events-none absolute inset-0 z-[4] flex h-full w-full select-none items-center overflow-hidden bg-transparent",children:/*#__PURE__*/r("div",{className:"absolute right-0 top-0 flex h-full w-full",style:i??void 0,children:f.map(({segmentIndex:e,signalPositions:t,style:n})=>/*#__PURE__*/r(zQ,{style:n,signalPositions:t,activeSignalKey:h.segmentIndex===e?g:void 0,segmentIndex:e},`segment-${e}`))})}):null},z1=z0,z2=()=>{let{state:{stripe:e},dispatch:t}=useStore(),{display:r,show:n}=e,a=useCallback(r=>{t({payload:{stripe:{...e,display:!!r}}})},[e]);return n?/*#__PURE__*/_jsx(IconBox,{active:r,tone:"primary",onClick:()=>{a(!r)},title:"频谱框选",children:/*#__PURE__*/_jsxs("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/_jsx("path",{d:"M835.4 757.7h-69.9v-51h18.9v-18.8h51zM713.1 757.7h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0H220v-51h83.9v51zM167.5 757.7H97.6v-69.8h51v18.8h18.9zM148.6 637.5h-51V557h51v80.5z m0-130.7h-51v-80.5h51v80.5z m0-130.8h-51v-80.5h51V376zM148.6 245.2h-51v-69.9h69.9v51h-18.9zM713.1 226.3h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0H220v-51h83.9v51zM835.4 245.2h-51v-18.9h-18.9v-51h69.9zM835.4 637.5h-51V557h51v80.5z m0-130.7h-51v-80.5h51v80.5z m0-130.8h-51v-80.5h51V376z",fill:"currentColor"}),/*#__PURE__*/_jsx("path",{d:"M784.4 615.7h51v233h-51z",fill:"currentColor"}),/*#__PURE__*/_jsx("path",{d:"M693.4 706.7h233v51h-233z",fill:"currentColor"})]})}):null},z5=null,z4=rl.Stripe,z3=1.5,z6=e=>Math.max(0,Math.min(100,e)),z8=({cursor:e,left:t,right:r})=>{let n=Math.abs(e-t),a=Math.abs(e-r);return n<=1.5?"left":a<=1.5?"right":e>t&&e<r?"move":n<=a?"left":"right"},z9=({id:e})=>{let{state:{stripe:t,axisX:{frequencyFormat:n,unit:a}},dispatch:i}=ae(),{show:o,display:l,left:s,right:c,defaultLeft:d,defaultRight:p,onChange:f}=t,m=g(t),b=g(null),v=g(n),y=g(a),w=g(f);h(()=>{m.current=t,v.current=n,y.current=a,w.current=f},[t,n,a,f]),h(()=>{i({payload:{stripe:{...t,left:d,right:p}}})},[d,p]);let x=u(e=>{let t=b.current;if(!t||!Number.isFinite(e?.left))return;let r=z6(e.left),n=m.current,{mode:a,startCursor:o,startLeft:l,startRight:s}=t,c=l,u=s;if("move"===a){let e=s-l;(u=(c=z6(l+(r-o)))+e)>100&&(c=Math.max(0,(u=100)-e))}"left"===a&&(c=Math.min(r,s)),"right"===a&&(u=Math.max(r,l)),i({payload:{stripe:{...n,left:c,right:u}}})},[i]),k=u(()=>{let{left:e,right:t}=m.current,r=Math.round(10*e)/10,n=Math.round(10*t)/10,a=v.current?.(r)??"",i=v.current?.(n)??"",o=n-r,l=Number(i)-Number(a);w.current({left:r,right:n,width:o,start:a,end:i,bandwidth:l,unit:y.current})},[]);return(h(()=>{wU(e,z4,t=>{if(!o||!l||!Number.isFinite(t?.left))return;let r=m.current,n=z6(t.left);b.current={mode:z8({cursor:n,left:r.left,right:r.right}),startCursor:n,startLeft:r.left,startRight:r.right},w7(e,z4)}),wK(e,z4,()=>{o&&l&&b.current&&(b.current=null,xt(e,z4),k())}),wV(e,z4,()=>{o&&l&&b.current&&(b.current=null,xt(e,z4),k())}),wY(e,z4,(e,t)=>{o&&l&&b.current&&x(t)})},[e,o,l,x,k]),o&&s-c!=0&&l)?/*#__PURE__*/r(yi,{className:"z-[3]",children:/*#__PURE__*/r("div",{className:"relative flex h-full w-px box-border border-x-2 border-dashed border-y-0 border-chart-grid-strong bg-chart-surface opacity-40",style:{left:`${s}%`,width:`${c-s}%`}})}):null},z7=z9;function Ne(){let{dispatch:e,store:t}=ar();return u(r=>{let n=t.getState().band,a=r9(r,n,"replace");a!==n&&e({payload:{band:a}})},[e,t])}let Nt=()=>{let e=at(e=>e.band),t=at(e=>e.segments),n=m(()=>kp(e,t),[e,t]);return n.length?/*#__PURE__*/r(yi,{children:n.map(t=>/*#__PURE__*/r("div",{"data-testid":"spectrum-band","data-band-kind":e.kind,"data-band-key":t.key,className:"absolute flex h-full w-0 box-border border-y border-dashed opacity-50",style:{left:`${t.left}%`,width:`${t.width}%`,backgroundColor:e.color?`${e.color}40`:void 0,borderColor:e.color}},t.key))}):null},Nr=Nt,Nn=10,Na=300,Ni=300,No=30,Nl=60,Ns=()=>({mode:"idle",startX:0,startY:0,startTime:0,lastX:0,lastY:0,startCoord:null,pinchBase:null}),Nc=(e,t,r)=>Math.max(t,Math.min(e,r)),Nu=({id:e})=>{let{state:{zoom:t,segments:n,axisY:a,globalID:i},dispatch:o}=ae(),l=wW(e),s=g(null),c=g(Ns()),d=g(t),p=g(n.totalPoints),f=g(a),m=g(null);h(()=>{d.current=t},[t]),h(()=>{p.current=n.totalPoints},[n]),h(()=>{f.current=a},[a]);let b=u((e,t,r)=>({currentTarget:e,clientX:t,clientY:r}),[]),v=u(e=>{let t=Array.from(e.touches).map(e=>({x:e.clientX,y:e.clientY})),r=t.length,n=0,a=0,i=0;if(2===r){let[e,r]=t;n=Math.hypot(r.x-e.x,r.y-e.y),a=(e.x+r.x)/2,i=(e.y+r.y)/2}else 1===r&&(a=t[0].x,i=t[0].y);return{count:r,points:t,distance:n,midX:a,midY:i}},[]),y=u((e,t,r)=>{let n=b(e,t,r),a=wB(n);wQ(l)(),wY(l)(n,a)},[l,b]),w=u(e=>{let t=c.current.pinchBase,r=p.current;if(!t||t.distance<=0||e<=0)return;let n=e/t.distance;if(("x"===t.axisMode||"xy"===t.axisMode)&&d.current.show&&r){let e=SP({anchorPercent:t.anchorPercent,interval:t.interval,scale:1/n,totalPoints:r});o({payload:t=>t.zoom.interval.start===e.start&&t.zoom.interval.end===e.end?null:{zoom:{...t.zoom,interval:e,isScanSegmentsUpdateMagnify:!1}}})}("y"===t.axisMode||"xy"===t.axisMode)&&i&&(nB(i)(t.lastScale/n,t.yAnchorValue),t.lastScale=n)},[o,i]),x=g(w);x.current=w;let k=u(e=>{let t=s.current,r=c.current;if(t&&0!==e.touches.length){if(1===e.touches.length){let{clientX:n,clientY:a}=e.touches[0];r.mode="pending",r.startX=n,r.startY=a,r.startTime=Date.now(),r.lastX=n,r.lastY=a,r.startCoord=wB(b(t,n,a));return}if(2===e.touches.length){m.current?.flush(),r.mode="pinch",r.startTime=Date.now();let n=d.current,a=v(e),[i,o]=a.points,l=Math.abs(o.x-i.x),s=180*Math.atan2(Math.abs(o.y-i.y),l)/Math.PI,{start:c,end:u}=n.interval,h=wB(b(t,a.midX,a.midY)).left??0,p=t.getBoundingClientRect();if(p.height<=0||a.distance<=0){r.pinchBase=null;return}let[g,y]=f.current.realRange??[0,1],w=Nc((a.midY-p.top)/p.height,0,1);r.pinchBase={distance:a.distance,lastScale:1,interval:{start:c,end:u},anchorPercent:Nc(h,0,100),axisMode:s<30?"x":s>60?"y":"xy",yAnchorValue:y-w*(y-g),startPoints:a.points,pinchMoved:!1}}}},[v,b]),S=g(rW(e=>{if(!e||!("count"in e))return;let t=s.current,r=c.current;if(!t)return;let{count:n,points:a,distance:i}=e;if(2===n){if("pinch"===r.mode&&r.pinchBase){let e=r.pinchBase;if(!e.pinchMoved){let t={x:(a[0].x+a[1].x)/2,y:(a[0].y+a[1].y)/2},r={x:(e.startPoints[0].x+e.startPoints[1].x)/2,y:(e.startPoints[0].y+e.startPoints[1].y)/2};(Math.abs(i-e.distance)>10||Math.hypot(t.x-r.x,t.y-r.y)>10)&&(e.pinchMoved=!0)}x.current(i)}return}if(1!==n)return;let o=a[0];if("pending"===r.mode){let e=o.x-r.startX,t=o.y-r.startY;if(e*e+t*t<=100)return;r.mode="drag"}if("drag"!==r.mode)return;let u=t.getBoundingClientRect(),d={left:(o.x-r.lastX)/u.width,top:(o.y-r.lastY)/u.height},h=b(t,o.x,o.y),p=wB(h);wY(l)(h,p),wJ(l)(r.startCoord,p,d,!1),r.lastX=o.x,r.lastY=o.y})).current;m.current=S;let M=u(e=>{S(v(e))},[v,S]),C=u(e=>{S.flush();let t=s.current,r=c.current;if(!t)return;let n=e.changedTouches[0],a=n?.clientX??r.lastX,i=n?.clientY??r.lastY;if("pending"===r.mode){let e=Date.now()-r.startTime,n=a-r.startX,o=i-r.startY;n*n+o*o<=100&&e<=300&&y(t,a,i)}if(1===e.touches.length){let n=e.touches[0],a="pinch"===r.mode&&null!==r.pinchBase&&!r.pinchBase.pinchMoved&&Date.now()-r.startTime<=300;r.mode=a?"pinch":"drag",r.startX=n.clientX,r.startY=n.clientY,r.lastX=n.clientX,r.lastY=n.clientY,a||(r.pinchBase=null),r.startCoord=wB(b(t,n.clientX,n.clientY))}else 0===e.touches.length&&("pinch"===r.mode&&r.pinchBase&&!r.pinchBase.pinchMoved&&Date.now()-r.startTime<=300&&wV(l)(),r.mode="idle",r.pinchBase=null,wK(l)())},[l,y,b,S]),F=u(()=>{S.cancel();let e=c.current;e.mode="idle",e.pinchBase=null,wV(l)()},[l,S]),D=u(e=>{e.preventDefault()},[]);return h(()=>()=>{S.cancel(),wV(l)()},[l,S]),h(()=>{s.current&&(s.current.id=l)},[l]),/*#__PURE__*/r(yi,{className:"z-[5] pointer-events-auto",children:/*#__PURE__*/r("button",{ref:s,type:"button",className:iX("absolute right-0 top-0 h-full w-full appearance-none border-0 bg-transparent p-0 outline-none","touch-none select-none"),"aria-label":"Touch bus",onContextMenu:D,onTouchStart:k,onTouchMove:M,onTouchEnd:C,onTouchCancel:F})})},Nd=Nu,Nh=e=>{let{children:t,touch:a}=e,{state:{axisY:{autoranging:i},series:{enableLengthSyncFastMode:o},globalID:l}}=ae(),{id:s,chart:c,Chart:u}=iV({Render:CF,params:{autoranging:i,enableLengthSyncFastMode:o}});S$(s,rr.Spectrum);let d=Ne(),p=zX(),f=wx();return h(()=>{if(l&&c)return t$(l,e=>{c?.setDisabledClearRect(e)})},[l,c]),i3({moduleType:rr.Spectrum,chart:c,handleRender:(e,t)=>{t.updateSeries?.({data:e.data,extraData:e.extraData}),tq(s)()},eventHandlers:{autoranging:(e,t)=>{t.useRangeAutoFocus?.()},points:e=>{f(e.data)},[rn.Series]:(e,t)=>{t.setSeries?.(e)},band:e=>{d(e)},scope:e=>{p(e)}}}),/*#__PURE__*/n(yE,{children:[/*#__PURE__*/r(Dg,{chart:c}),/*#__PURE__*/n(ST,{children:[/*#__PURE__*/r(CC,{}),/*#__PURE__*/r(u,{}),t,/*#__PURE__*/r(zy,{id:s}),/*#__PURE__*/r(zG,{id:s}),a?/*#__PURE__*/r(Nu,{id:s}):/*#__PURE__*/r(SF,{id:s}),/*#__PURE__*/r(zT,{id:s}),/*#__PURE__*/r(Sk,{id:s,type:rr.Spectrum}),/*#__PURE__*/r(z0,{id:s}),/*#__PURE__*/r(DT,{id:s}),/*#__PURE__*/r(Nt,{}),/*#__PURE__*/r(zK,{}),/*#__PURE__*/r(z9,{id:s}),/*#__PURE__*/r(zM,{id:s}),/*#__PURE__*/r(zm,{}),/*#__PURE__*/r(DC,{})]})]})},Np=Nh,Nf=e=>{let{state:{cursor:t},dispatch:a}=ae(),{publish:i}=e,{analyzer:o}=De();return ac({publish:i,subscribe:e=>{let{pstype:t}=e;t===rn.Reset&&o?.reset(),t===rn.LevelStream&&o?.process(e.data,rK(e.timestamp))}}),h(()=>{t.mode!==rr.LevelStream&&a({payload:{cursor:{...t,mode:rr.LevelStream}}})},[t,a]),/*#__PURE__*/n(am,{children:[/*#__PURE__*/r(F7,{type:rt.LevelStream}),/*#__PURE__*/r(yE,{children:/*#__PURE__*/r(Nh,{children:/*#__PURE__*/r(ST,{children:/*#__PURE__*/r(Dr,{opacity:.5})})})})]})},Nm=Nf,Ng=e=>/*#__PURE__*/r(aa,{...e,cursor:{show:!0},zoom:{show:!1},signal:{show:!1},children:/*#__PURE__*/r(Nf,{...e})}),Nb=tB(Ng,"LevelStream"),Nv=Nb,Ny=["100%","75%","50%","25%","0%"],Nw=e=>{let{inside:t=!1}=e;return /*#__PURE__*/r("div",{className:"pointer-events-none relative z-[2] flex h-full w-full flex-col justify-between text-xs text-foreground opacity-50",style:{alignItems:t?"flex-start":"flex-end"},children:Ny.map(e=>/*#__PURE__*/r("div",{className:iX("flex justify-start box-border",t?"pl-0.5 pr-0":"pr-0.5"),children:e},e))})},Nx=Nw,Nk=e=>{let{inside:t=!1}=e,{axisYWidth:n,marginLeft:a}=yn();return /*#__PURE__*/r("div",{className:"relative flex h-full w-auto",style:{width:n,marginLeft:a,justifyContent:t?"flex-start":"flex-end"},children:/*#__PURE__*/r(Nw,{inside:t})})},NS=/*#__PURE__*/a.memo(Nk),NM=e=>{let{disabled:t,inside:n}=e,{state:{axisY:a}}=ae(),{show:i}=a;return!1===i||t?null:/*#__PURE__*/r(NS,{inside:n})},NC=NM,NF=()=>/*#__PURE__*/r("div",{className:"h-0 w-full flex-1 border-t [border-color:var(--chart-grid)] first:border-t-0"}),ND=()=>{let{state:{gridLines:e}}=ae();return e&&/*#__PURE__*/n("div",{className:"pointer-events-none absolute right-0 top-0 z-[1] flex h-full w-full select-none flex-col border [border-color:var(--chart-grid)] bg-transparent",children:[/*#__PURE__*/r(NF,{}),/*#__PURE__*/r(NF,{}),/*#__PURE__*/r(NF,{}),/*#__PURE__*/r(NF,{})]})},Nz=ND,NN=-200,NE=e=>`occupancy-total-line-${e}`,NT=(e,t,r=0)=>{e&&t&&(e.style.bottom=`${r||-200}%`,t.textContent=String(r))},NR=(e,t,r)=>tC(NE(e),t,r,e),NA=(e,t=0)=>{NR(e)(t)},NI=({id:e})=>{let t=g(null),a=g(null),i=g(`OccupancyTotalLine-${Math.random().toString(36).slice(2)}`);return h(()=>(NT(t.current,a.current),NR(e,i.current,e=>{NT(t.current,a.current,e)})),[e]),/*#__PURE__*/r("div",{className:"pointer-events-none absolute z-[4] h-full w-full",children:/*#__PURE__*/n("div",{ref:t,className:"absolute left-0 w-full opacity-50",style:{bottom:"-200%"},children:[/*#__PURE__*/r("div",{className:"absolute h-0 w-full border-b border-dashed border-foreground/80",style:{marginTop:"-0.5px"}}),/*#__PURE__*/r("div",{ref:a,className:"absolute right-7 -mt-7 flex h-6 items-center justify-center rounded-[var(--radius-control)] bg-secondary px-2 text-xs text-foreground",children:"0"})]})})},NP=NI,NL=e=>{let{occupancyAxisYDisabled:t}=e,{id:a,chart:i,Chart:o}=iV({Render:Dt});return(i3({moduleType:rr.Occupancy,chart:i,handleRender:(e,t)=>{let{data:r,totalOccupancy:n}=e;r&&t.updateSeries?.(r),void 0!==n&&NA(a,n)},eventHandlers:{[rn.Reset]:(e,t)=>{t.reset(),NA(a)}}}),S$(a,rr.Occupancy),t)?/*#__PURE__*/r("div",{className:"h-full w-full",style:{...eA},[ez]:"true",children:/*#__PURE__*/n("div",{className:"relative z-[0] h-full w-full",children:[/*#__PURE__*/r(o,{}),/*#__PURE__*/r(SF,{id:a}),/*#__PURE__*/r(NI,{id:a})]})}):/*#__PURE__*/n(yE,{children:[/*#__PURE__*/r(NM,{disabled:t}),/*#__PURE__*/n(ST,{children:[/*#__PURE__*/r(ND,{}),/*#__PURE__*/r(o,{}),/*#__PURE__*/r(SF,{id:a}),/*#__PURE__*/r(NI,{id:a}),/*#__PURE__*/r(Sk,{id:a,type:rr.Occupancy})]})]})},NO=NL,Nq=e=>{let{publish:t}=e,{state:{globalID:a}}=ae(),i=wM(rt.Scan);return ac({publish:t,subscribe:e=>{i(e),e.pstype===rn.Occupancy&&(e.data&&(tO(a).getAllRawData=t=>({...tL().getAllRawData(t),occupancyData:e.data})),((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Occupancy)({...e,pstype:rn.Render}))}}),/*#__PURE__*/n(am,{children:[/*#__PURE__*/r(yE,{children:/*#__PURE__*/r(NL,{})}),/*#__PURE__*/r(yN,{type:rt.Scan,allowScanCenterBandwidth:!1})]})},N$=Nq,N_=e=>/*#__PURE__*/r(aa,{...e,zoom:{show:!1},children:/*#__PURE__*/r(Nq,{...e})}),Nj=tB(N_,"Occupancy"),NH=Nj,NB=()=>{let e=an(),t=at(e=>e.zoom),r=at(e=>e.segments.totalPoints)??0,n=at(e=>e.axisX.frequencyFormat),{interval:{start:a,end:i},onChange:o}=t,l=m(()=>r&&n?[n((100*a+1)/r),n((100*i+1)/r)]:["",""],[a,i,r,n]);return h(()=>{r&&void 0!==l[0]&&void 0!==l[1]&&o(l,{start:a,end:i})},[l,o,r]),h(()=>{if(!r)return;let t=i-a+1,n=r/t,o=`-${a/t*100}%`,l=`${100*n}%`;e({payload:e=>({zoom:{...e.zoom,style:{left:o,width:l}}})})},[e,i,a,r]),null},NW=NB;class NG extends vH{constructor(e){super({id:e.id,globalID:e.globalID,chart:null,renderer:e.renderer,renderMode:e.renderMode})}init(){let{id:e,renderer:t,renderMode:r}=this.state;e&&(this.state.chart=new x({id:e,colors:this.getInitialColors(),ignoreValue:0,renderer:t,fluorescenceRenderMode:r}),this.subscribeToColor("Fluorescence-Render"))}updateProps(e){void 0!==e.renderMode&&(this.state.renderMode=e.renderMode),this.state.chart?.updateProps(e)}updateSeries(e){this.state.chart&&e&&this.state.chart.render(e)}setRenderMode(e){this.state.renderMode=e,this.state.chart?.setRenderMode(e)}}let NY=()=>{let{state:{axisY:{range:e},fluorescence:{display:t,renderer:n,renderMode:a}}}=ae(),{chart:i,Chart:o}=iV({Render:NG,params:{renderer:n,renderMode:a}});h(()=>{i?.updateProps({range:e})},[i,e]),h(()=>{i&&i.setRenderMode(a)},[a]),i3({moduleType:rr.Fluorescence,chart:i,renderPSTypes:[rn.Fluorescence],extractData:e=>e.data});let l=m(()=>({height:"100%",width:"100%",display:"flex",visibility:t?"visible":"hidden"}),[t]);return h(()=>{i&&i.updateProps({display:t})},[i,t]),/*#__PURE__*/r("div",{style:l,children:/*#__PURE__*/r(yE,{children:/*#__PURE__*/r(o,{})})})},NU=NY,NX=e=>{let{type:t,heatmapElementID:a,renderer:i}=e;return /*#__PURE__*/r(vo,{id:a,children:/*#__PURE__*/n(al,{children:[/*#__PURE__*/r(F7,{type:rt.Heatmap}),/*#__PURE__*/r(M6,{renderer:i,zoomMode:"linked-x"}),/*#__PURE__*/r(yN,{type:t})]})})},NK=NX,NV=e=>{let{occupancyElementID:a,occupancyAxisYElementID:i,type:o}=e;return /*#__PURE__*/n(t,{children:[/*#__PURE__*/r(vo,{id:a,children:i?/*#__PURE__*/r(NL,{occupancyAxisYDisabled:!0}):/*#__PURE__*/n(al,{children:[/*#__PURE__*/r(F7,{type:rt.Occupancy}),/*#__PURE__*/r(NL,{}),/*#__PURE__*/r(yN,{type:o})]})}),/*#__PURE__*/r(vo,{id:i,children:/*#__PURE__*/r(NM,{inside:!0})})]})},NQ=NV,NZ=(e,t)=>tC(`BLAZE_PROGRESS-${e}`,"0",t,e),NJ=()=>{let{state:{blaze:{show:e},segments:t,globalID:a}}=ae(),[i,o]=b(""),l=m(()=>{let e=[];for(let r=0;r<t.length;r++){let n=t[r];n.progress&&e.push(...n.progress)}return e},[t]);return(h(()=>{e&&a&&NZ(a,e=>{o(l.includes(e)?void 0:`${100*e}%`)})},[e,a]),e)?/*#__PURE__*/r(yi,{children:/*#__PURE__*/n("div",{className:"absolute left-[-100%] top-0 flex h-full w-0 opacity-50",style:{left:i},children:[/*#__PURE__*/r("div",{className:"ml-[-0.5px] opacity-50",style:{borderRight:"0.5px solid var(--chart-grid-strong)"}}),/*#__PURE__*/r("div",{className:"ml-[-31px] w-[30px] opacity-20",style:{background:"linear-gradient(90deg, transparent, var(--chart-grid-strong))"}})]})}):null},N0=/*#__PURE__*/a.memo(NJ),N1=()=>{let{state:{legend:{children:e}}}=ae();return /*#__PURE__*/r("div",{className:"absolute left-5 top-5 z-[6] flex h-auto w-auto items-center",children:e})},N2=N1,N5=()=>{let{state:{segments:e}}=ae(),t=e.totalPoints??0;return /*#__PURE__*/r(yi,{className:"z-[0]",children:e.map((e,n)=>/*#__PURE__*/r("div",{className:"h-full border-x",style:{width:t>0?`${100*e.point/t}%`:0,borderColor:n%2==1?"var(--chart-grid)":"transparent",background:n%2==1?"var(--chart-surface)":"transparent",opacity:n%2==1?.4:1}},`${e.start}_${e.stop}_${e.index}`))})},N4=N5,N3=({globalID:e})=>({handleMarkerPublish:u(t=>{if(e)switch(t.pstype){case rn.Marker:Fo(e)(t);break;case rn.Reset:Fo(e)({type:ro.Clear})}},[e])}),N6=N3;function N8(){let e=an();return u(()=>{e({payload:e=>e.axisY.fieldStrengthUnitAvailable?null:{axisY:{...e.axisY,fieldStrengthUnitAvailable:!0}}})},[e])}function N9({segmentOffset:e,offset:t}){let r={};return void 0!==e&&(r.segmentOffset=e),void 0!==t&&(r.offset=t),void 0!==r.segmentOffset||void 0!==r.offset?r:void 0}function N7(e,t){"thresholdData"in t&&e.setThresholdData(t.thresholdData,N9(t))}function Ee(){let e=at(e=>e.signal.onChange),t=g(e);return f(()=>{t.current=e},[e]),u(e=>{let r=t.current;r&&r(e.regions.map(t=>({...t,frequency:t.centerFrequency,timestamp:e.timestamp})),e)},[])}function Et(e){let{state:{globalID:t,series:{enableMetrics:r,enableWaterfall:n},fluorescence:{show:a},axisY:{unit:i},zoom:{interval:o},heatmapCapture:{display:l},system:{width:s},marker:c,signal:d}}=ae(),p=g(null),f=g(t),m=g(o),b=g(0),v=Ee(),y=d.templateDetection??e?.processing?.enableTemplateDetection??!1;h(()=>{p.current?.updateProcessing({enableTemplateDetection:y})},[y]);let w=g(null),{updateSignalData:x}=zJ(),k=N8(),S=g(l);h(()=>{S.current=l},[l]);let M=u(e=>{((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Spectrum)({pstype:rn.Render,data:e})},[]),C=u(e=>{((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Heatmap)({pstype:rn.Render,data:e})},[]),F=u(e=>{NZ(f.current)?.(e)},[]),D=u(e=>{(e.realData||e.templateData||e.backgroundNoiseData||"thresholdData"in e)&&M({minData:e.minData,maxData:e.maxData,avgData:e.avgData,thresholdData:e.thresholdData,backgroundNoiseData:e.backgroundNoiseData,realData:e.realData,templateData:e.templateData}),e.scanProgress&&F(e.scanProgress),e.templateDetection&&v(e.templateDetection),e.waterfallData&&C(e.waterfallData),e.fluorescenceData&&((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Fluorescence)({pstype:rn.Fluorescence,data:{fluorescenceData:e.fluorescenceData,fluorescenceMaxCount:e.fluorescenceMaxCount}}),e.occupancyData&&((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Occupancy)({pstype:rn.Render,data:e.occupancyData,totalOccupancy:b.current}),e.extraData&&((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Spectrum)({pstype:rn.Render,extraData:e.extraData})},[M,C,F,v]);h(()=>{f.current=t},[t]);let z=(e,t)=>!1!==e&&(t??!0);if(!p.current&&t){let i=Math.min(1|Math.floor(2*s),1001);p.current=new O({...e,outputPoints:i,processing:{...e?.processing,enableMetrics:z(r,e?.processing?.enableMetrics),enableWaterfall:z(n,e?.processing?.enableWaterfall),enableTemplateDetection:y,enableFluorescence:a,enablePeakStats:!!c?.enabled},onSpectrumUpdate:D});let o=tO(t),l=p.current;o.getAllRawData=e=>l.getAllRawData(e),t_(t,p.current)}h(()=>{let e=Math.floor(o.start),t=Math.ceil(o.end),r=Math.floor(m.current.start),n=Math.ceil(m.current.end);(e!==r||t!==n)&&p.current&&(m.current=o,p.current.updateSamplingRange(e,t+1))},[o]);let N=u(async(e=!1)=>{setTimeout(()=>{((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Heatmap)({pstype:rn.Reset}),((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Spectrum)({pstype:rn.Reset}),((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Occupancy)({pstype:rn.Reset}),e&&wh(f.current)},1)},[]),E=u(async e=>{if(p.current)switch(e.pstype){case rn.AntennaFactor:p.current.setAntennaFactor(e.data),e.data.length>0&&k();break;case rn.Signal:x({type:e.type,data:e.data});break;case rn.Spectrum:e.data&&p.current.process(e),N7(p.current,e),e.maxData&&p.current.setMaxData(e.maxData),e.minData&&p.current.setMinData(e.minData),e.avgData&&p.current.setAvgData(e.avgData),e.templateData&&p.current.setTemplateData(e.templateData,e.templateTolerance),e.backgroundNoiseData&&p.current.setBackgroundNoiseData(e.backgroundNoiseData),e.extraData&&p.current.setExtraData(e.extraData,I.MERGE,e.segmentedExtraData?{segmentOffset:e.segmentOffset,offset:e.offset}:void 0);break;case rn.Fluorescence:e.data&&p.current&&p.current.setFluorescenceData(e.data.fluorescenceData,e.data.fluorescenceMaxCount);break;case rn.Heatmap:if(e.data){let{data:t,timestamps:r}=e,n=rJ(t,r);p.current.setWaterfallData(n)}break;case rn.Occupancy:p.current?.setOccupancyData(e.data),b.current=e.totalOccupancy;break;case rn.Segments:p.current.initializeSegments(e.data),await N(),e.onFinally?.();break;case rn.SpectrumBandwidth:p.current.reset();break;case rn.Series:wd(f.current,e);break;case rn.Reset:p.current.reset(),await N(!0),e.onFinally?.();break;case rn.Clear:p.current.reset(),await N(!1),e.onFinally?.()}},[k,x,wd,N]);return h(()=>{let e=i.includes("/m");p.current?.setAntennaFactorSwitch(e)},[i]),h(()=>{if(!p.current)return;let t=z(r,e?.processing?.enableMetrics);t!==w.current&&(p.current.updateProcessing({enableMetrics:t}),w.current=t)},[r,e?.processing?.enableMetrics]),E}let Er=e=>{let{state:{globalID:a}}=ae(),i=g([]),o=g(""),{type:l=rt.SingleFrequency,publish:s,heatmapElementID:c,occupancyElementID:u,occupancyAxisYElementID:d,touch:h,children:p,processing:f,renderer:m}=e,{enableMetrics:b,enableWaterfall:v}=wy({type:l,heatmapElementID:c}),y=Et({processing:{enableWaterfall:v,enableMetrics:b,...f}}),w=wM(l);wC(h);let{handleMarkerPublish:x}=N3({globalID:a});return ac({publish:s,subscribe:e=>{if(y(e),x(e),w(e),e.pstype===rn.Heatmap){let{data:t,timestamps:r}=e;if(i.current=rJ(t,r),o.current!==a){let e=tO(a),t=e.getAllRawData;e.getAllRawData=e=>({...t(e),waterfallData:i.current}),o.current=a}}((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Spectrum)(e),((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Heatmap)(e),((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Occupancy)(e),e.pstype!==rn.Fluorescence&&((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Fluorescence)(e)}}),/*#__PURE__*/n(am,{children:[/*#__PURE__*/r(F7,{type:l}),/*#__PURE__*/n(yE,{children:[/*#__PURE__*/r(Nh,{touch:h,children:p||/*#__PURE__*/r(NY,{})}),/*#__PURE__*/r(NX,{type:l,heatmapElementID:c,renderer:m}),/*#__PURE__*/r(NV,{type:l,occupancyElementID:u,occupancyAxisYElementID:d}),/*#__PURE__*/n(ST,{children:[/*#__PURE__*/r(NB,{}),l===rt.Scan&&/*#__PURE__*/n(t,{children:[/*#__PURE__*/r(N5,{}),/*#__PURE__*/r(N0,{})]}),/*#__PURE__*/r(N1,{})]})]}),/*#__PURE__*/r(yN,{type:l})]})},En=Er,Ea="singleFrequency",Ei="slider",Eo=e=>"slider"===e?"deltaMeasurement":"default",El=e=>{let t=e.type??Ea;if(!e.heatmapElementID||t!==Ea&&"scan"!==t&&"mscan"!==t)return e;let r=e.heatmapCapture?.type??"slider",n=e.heatmapCapture?.toolbarVariant??Eo(r);return{...e,heatmapCapture:{show:!0,display:!1,...e.heatmapCapture,type:r,toolbarVariant:n}}},Es=e=>{let t=El(e);return /*#__PURE__*/r(aa,{...t,children:/*#__PURE__*/r(Er,{...t})})},Ec=tB(Es,"Spectrum"),Eu=Ec;function Ed(e={}){let{onChange:t,sizes:r,tokens:n}=e;th({sizes:r,tokens:n});let a=od();return{cleanup:t?oh(e=>t(e)):void 0,...a}}var Eh=/*#__PURE__*/function(e){return e.Station="station",e.Simple="simple",e}({});th();export{w as DialDirectionLabelMode,oR as AudioWaveform,vZ as Dial,ye as Gauge,Ch as Heatmap,CL as IQ,Nv as LevelStream,NH as Occupancy,Eu as Spectrum,t7 as AxisPlacement,re as AxisXLabelMode,rt as ChartType,t9 as FrequencyUnit,ro as MarkerEventType,rr as ModuleType,ra as OptionKey,rn as PSType,ri as SegmentsEvent,rc as SeriesType,rl as ToolType,rs as ToolbarItemType,rF as formatFrequencyUnit,rz as formatFrequencyUnitFromHz,rD as formatFrequencyUnitFromMHz,od as getChartsThemeState,nn as HeatmapCaptureType,Ed as initChartsTheme,nt as MarkerMode,DX as setFrequencyAllocationChannelsToCache,DU as setFrequencyAllocationToCache,Eh as SignalDataType,oh as subscribeChartsThemeChange,ad as useSafePublish,tB as withChartPublisher};
|
|
3784
|
+
*/let CU={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};CU.node;let CX=Mo(CU),CK={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};CK.node;let CV=Mo(CK),CQ=/*#__PURE__*/$.forwardRef(({className:e,...t},n)=>/*#__PURE__*/r(C$,{ref:n,"data-slot":"checkbox",className:iX("peer inline-flex size-4 shrink-0 items-center justify-center rounded-[var(--radius-micro)] border border-border bg-background text-primary shadow-xs transition-colors outline-none","focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground","data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",e),...t,children:/*#__PURE__*/r(Cj,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current",children:"indeterminate"===t.checked?/*#__PURE__*/r(CX,{className:"size-3.5"}):/*#__PURE__*/r(CV,{className:"size-3.5"})})}));CQ.displayName=C$.displayName;let CZ=e=>"checked"===e||"indeterminate"===e&&"indeterminate",CJ=({count:e,show:t,testId:r})=>t?/*#__PURE__*/n("span",{className:"shrink-0 tabular-nums text-[11px] font-normal text-muted-foreground","data-testid":r,children:["(",e,")"]}):null,C0=({source:e,type:t,leafKeysWithData:a,hiddenKeys:i,showCount:o,expanded:l,onToggleExpanded:s,onToggleNode:c})=>{let u=kO(a,i,t.leafKeys),d=`signal-tree-type-checkbox-${e.source}-${t.signalType}`,h=t.levels.length>0,p=h?void 0:t.color??kv[t.signalType].color;return /*#__PURE__*/n("div",{children:[/*#__PURE__*/n("div",{className:"group flex items-center gap-1.5 rounded-[var(--radius-control)] px-[var(--size-gap-base)] py-[calc(var(--size-gap-base)/2)] transition-colors hover:bg-accent/80","data-testid":`signal-tree-type-${e.source}-${t.signalType}`,children:[h?/*#__PURE__*/r("button",{type:"button","aria-label":l?"折叠信号类型":"展开信号类型",className:"flex size-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",onClick:s,children:l?/*#__PURE__*/r(CC,{className:"size-3.5"}):/*#__PURE__*/r(Cz,{className:"size-3.5"})}):/*#__PURE__*/r("span",{"aria-hidden":"true",className:"size-4 shrink-0"}),/*#__PURE__*/n("label",{htmlFor:d,className:iX("flex min-w-0 flex-1 items-center gap-1.5","disabled"===u?"cursor-not-allowed":"cursor-pointer"),children:[/*#__PURE__*/r(CQ,{id:d,"aria-label":`${e.label} ${t.label}`,checked:CZ(u),disabled:"disabled"===u,onCheckedChange:()=>c(t.leafKeys)}),/*#__PURE__*/r("span",{className:iX("min-w-0 truncate text-xs font-medium","disabled"===u?"text-muted-foreground":"text-foreground/90"),"data-testid":`signal-tree-type-color-${e.source}-${t.signalType}`,style:"disabled"===u||null==p?void 0:{color:oi(p)},children:t.label}),/*#__PURE__*/r(CJ,{count:t.count,show:o,testId:`signal-tree-type-count-${e.source}-${t.signalType}`})]})]}),l&&h?/*#__PURE__*/r("div",{className:"relative ml-6 border-l border-border/60 pl-1",children:t.levels.map(n=>/*#__PURE__*/r(C1,{source:e.source,signalType:t.signalType,level:n,leafKeysWithData:a,hiddenKeys:i,showCount:o,onToggleNode:c},n.leafKey))}):null]},t.signalType)},C1=({source:e,signalType:t,level:a,leafKeysWithData:i,hiddenKeys:o,showCount:l,onToggleNode:s})=>{let c=kO(i,o,[a.leafKey]),u=`signal-tree-level-checkbox-${e}-${t}-${a.level}`;return /*#__PURE__*/r("div",{className:"group flex items-center gap-1.5 rounded-[var(--radius-control)] px-[var(--size-gap-base)] py-[calc(var(--size-gap-base)/2)] transition-colors hover:bg-accent/80","data-testid":`signal-tree-level-${e}-${t}-${a.level}`,children:/*#__PURE__*/n("label",{htmlFor:u,className:iX("flex min-w-0 flex-1 items-center gap-1.5","disabled"===c?"cursor-not-allowed":"cursor-pointer"),children:[/*#__PURE__*/r(CQ,{id:u,"aria-label":`${t} ${a.label}`,checked:CZ(c),disabled:"disabled"===c,onCheckedChange:()=>s([a.leafKey])}),/*#__PURE__*/r("span",{className:iX("text-xs font-medium","disabled"===c?"text-muted-foreground":"text-foreground/80"),"data-testid":`signal-tree-level-color-${e}-${t}-${a.level}`,style:"disabled"===c?void 0:{color:oi(a.color??kD[a.level].color)},children:a.label}),/*#__PURE__*/r(CJ,{count:a.count,show:l,testId:`signal-tree-level-count-${e}-${t}-${a.level}`})]})})},C2=({tree:e,leafKeysWithData:t,hiddenKeys:a,showCount:i,onToggleNode:o})=>{let[l,s]=b(()=>new Set),[c,d]=b(()=>new Set),h=u(e=>{s(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},[]),p=u(e=>{d(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},[]);return /*#__PURE__*/r(g6,{viewportClassName:"h-auto max-h-[var(--radix-dropdown-menu-content-available-height)]",children:/*#__PURE__*/r("div",{className:"p-[calc(var(--size-gap-base)/2)]",children:e.sources.map((e,s)=>{let u=kO(t,a,e.leafKeys),d=`signal-tree-source-checkbox-${e.source}`;return /*#__PURE__*/n("div",{className:iX(s>0&&"mt-[calc(var(--size-gap-base)/2)] border-t border-border/60 pt-[calc(var(--size-gap-base)/2)]"),"data-testid":`signal-tree-source-${e.source}`,children:[/*#__PURE__*/n("div",{className:"flex items-center gap-1.5 rounded-[var(--radius-control)] px-[var(--size-gap-base)] py-[calc(var(--size-gap-base)/2)] transition-colors hover:bg-accent/80","data-testid":`signal-tree-source-row-${e.source}`,children:[e.types.length>0?/*#__PURE__*/r("button",{type:"button","aria-label":c.has(e.source)?"展开数据来源":"折叠数据来源",className:"flex size-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",onClick:()=>p(e.source),children:c.has(e.source)?/*#__PURE__*/r(Cz,{className:"size-3.5"}):/*#__PURE__*/r(CC,{className:"size-3.5"})}):/*#__PURE__*/r("span",{"aria-hidden":"true",className:"size-4 shrink-0"}),/*#__PURE__*/n("label",{htmlFor:d,className:iX("flex min-w-0 flex-1 items-center gap-1.5","disabled"===u?"cursor-not-allowed":"cursor-pointer"),children:[/*#__PURE__*/r(CQ,{id:d,"aria-label":`${e.label}筛选`,checked:CZ(u),disabled:"disabled"===u,onCheckedChange:()=>o(e.leafKeys)}),/*#__PURE__*/r("span",{className:"text-xs font-medium text-foreground",children:e.label}),/*#__PURE__*/r(CJ,{count:e.count,show:i,testId:`signal-tree-source-count-${e.source}`})]})]}),c.has(e.source)?null:/*#__PURE__*/r("div",{className:"ml-4 divide-y divide-border/40 border-l border-border/60 pl-1",children:e.types.map(n=>/*#__PURE__*/r(C0,{source:e,type:n,leafKeysWithData:t,hiddenKeys:a,showCount:i,expanded:!l.has(`${e.source}:${n.signalType}`),onToggleExpanded:()=>h(`${e.source}:${n.signalType}`),onToggleNode:o},n.signalType))})]},e.source)})})})},C5=()=>{let{state:{signal:e},dispatch:t}=ae(),n=e.display,a=e.show,i=St({respectVisibility:!1,filterHidden:!1}),o=m(()=>kL(i),[i]),l=m(()=>new Set(o.sources.flatMap(e=>e.dataLeafKeys)),[o]),s=m(()=>new Set(e.hiddenCategoryKeys??[]),[e.hiddenCategoryKeys]),c=(e.hiddenCategoryKeys?.length??0)>0,d=u(r=>{t({payload:{signal:{...e,display:r}}})},[e,t]),h=u(r=>{let n=kq(e.hiddenCategoryKeys??[],r,l);t({payload:{signal:{...e,hiddenCategoryKeys:n}}})},[e,l,t]);return a?/*#__PURE__*/r(vE,{leading:/*#__PURE__*/r(vT,{active:n,tone:"primary",onClick:()=>{d(!n)},title:`全部信号标注:${n?"显示":"隐藏"}`,children:/*#__PURE__*/r("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/r("path",{fill:"currentColor",d:"M563.072 376.48a79.456 79.456 0 0 0 28.928-61.12 80 80 0 1 0-160 0c0 24.672 11.392 46.432 28.928 61.12l-202.88 540.256a32 32 0 1 0 59.904 22.496l49.28-131.264h289.504l49.28 131.264a32.064 32.064 0 0 0 41.248 18.752c16.544-6.208 24.896-24.672 18.72-41.216l-202.912-540.288z m-1.312 178.624h-99.552L512 422.56l49.76 132.544z m-170.464 188.896l46.912-124.896h147.616l46.912 124.896h-241.44zM662.464 417.408a32 32 0 1 0 53.12 35.648 254.72 254.72 0 0 0 43.136-142.304 255.04 255.04 0 0 0-43.136-142.304 32 32 0 1 0-53.12 35.68 190.944 190.944 0 0 1 32.288 106.624 190.816 190.816 0 0 1-32.288 106.656zM289.888 453.024a32 32 0 1 0 53.184-35.616 191.36 191.36 0 0 1-32.32-106.656 191.328 191.328 0 0 1 32.32-106.656 32.064 32.064 0 0 0-8.768-44.416 32.096 32.096 0 0 0-44.416 8.768 254.976 254.976 0 0 0-43.136 142.304 254.976 254.976 0 0 0 43.136 142.272zM210.656 117.12A32 32 0 1 0 157.44 81.536a420.032 420.032 0 0 0-70.848 233.824 419.744 419.744 0 0 0 70.88 233.856 31.936 31.936 0 0 0 44.416 8.768 32 32 0 0 0 8.768-44.416 355.168 355.168 0 0 1-60.032-198.24A355.36 355.36 0 0 1 210.656 117.12zM896.224 154.304a416.96 416.96 0 0 0-38.912-72.768 32 32 0 1 0-53.184 35.584 354.912 354.912 0 0 1 60.064 198.24 355.2 355.2 0 0 1-60.064 198.208 32.032 32.032 0 0 0 53.184 35.648 418.816 418.816 0 0 0 70.88-233.856c0-55.68-10.752-109.856-31.968-161.056z"})})}),value:null,options:[],triggerTitle:`筛选信号标注类别${c?"(已应用筛选)":""}`,triggerTestId:"signal-tree-trigger",triggerContent:/*#__PURE__*/r("span",{className:"sr-only",children:c?"信号标注类别筛选(已应用)":"信号标注类别筛选"}),customContent:/*#__PURE__*/r("div",{"data-testid":"signal-tree-popover",children:/*#__PURE__*/r(C2,{tree:o,leafKeysWithData:l,hiddenKeys:s,showCount:!1!==e.showCount,onToggleNode:h})}),contentClassName:"w-max max-w-[calc(100vw-1rem)] p-0",triggerClassName:iX("justify-center [&>span:last-child]:ml-0",c&&"bg-accent/72 shadow-[inset_0_0_0_1px_var(--mix-primary-28)] [&>span:last-child]:text-primary")}):null},C4=C5,C3=[{component:yL,toolType:rs.AutorangingSwitch,supportedCharts:[],excludedCharts:[rt.Heatmap,rt.ScanDF360,rt.LevelStream,rt.LiteNormalized]},{component:yB,toolType:rs.UnitSwitch,supportedCharts:[],excludedCharts:[rt.ScanDF360,rt.LevelStream]},{component:v$,toolType:rs.GradientRibbon,supportedCharts:[rt.Heatmap]},{component:v_,toolType:rs.SpacerLine,supportedCharts:[],excludedCharts:[rt.ScanDF360,rt.LevelStream]},{component:Fq,toolType:rs.Reset,supportedCharts:[],excludedCharts:[rt.LiteNormalized]},{component:C5,toolType:rs.StationAllocationSwitch,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.MScan,rt.DDC]},{component:FH,toolType:rs.SeriesControl,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.MScan],props:{type:"dynamic"}},{component:F8,toolType:rs.FrequencyAllocationSwitch,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.MScan,rt.LiteNormalized]},{component:FY,toolType:rs.ZoomSwitch,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.MScan,rt.LiteNormalized]},{component:Ce,toolType:rs.LimitSwitch,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.MScan]},{component:CS,toolType:rs.MarkersSwitch,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.MScan]},{component:F_,toolType:rs.SegmentsDisplayControl,supportedCharts:[rt.Scan]},{component:FJ,toolType:rs.HeatmapCaptureSwitch,supportedCharts:[rt.Heatmap]},{component:F4,toolType:rs.TimeRangeSwitch,supportedCharts:[rt.Heatmap]},{component:FW,toolType:rs.SeriesDisplayControl,supportedCharts:[rt.SingleFrequency,rt.Scan,rt.LiteNormalized,rt.MScan]},{component:FX,toolType:rs.FluorescenceSwitch,supportedCharts:[rt.SingleFrequency]},{component:F3,toolType:rs.DeltaMeasurementSwitch,supportedCharts:[rt.SingleFrequency,rt.Scan]}],C6=(e,t,r=[])=>!new Set(r).has(e.toolType)&&(e.supportedCharts.length>0?!!t&&e.supportedCharts.includes(t):!e.excludedCharts||!(e.excludedCharts.length>0)||!t||!e.excludedCharts.includes(t)),C8=(e,t)=>e.props?"dynamic"===e.props.type?{...e.props,type:t}:e.props:{},C9=({type:e})=>{let t=at(e=>e.toolbar.show),n=at(e=>e.toolbar.hiddenTools??[]),{width:a,pluginBoxWidth:i}=yn(),o=m(()=>({marginLeft:a,width:i,...o_}),[a,i]),l=m(()=>C3.filter(t=>C6(t,e,n)).map(t=>/*#__PURE__*/r(t.component,{...C8(t,e)},t.toolType)),[n,e]);return e!==rt.Occupancy&&t?/*#__PURE__*/r("div",{className:"relative flex h-10 min-w-0 w-full items-center justify-between pl-[var(--size-gap-base)] text-xs text-foreground",style:o,children:/*#__PURE__*/r("div",{className:"min-w-0 flex-1 overflow-x-auto overflow-y-hidden",children:/*#__PURE__*/r("div",{className:"flex h-full w-max min-w-full items-center gap-[var(--size-gap-base)]",children:l})})}):null},C7=/*#__PURE__*/c(C9);function De(){let{state:{globalID:e,axisY:t,levelStream:r}}=ae(),n=t.range??ns,{cacheTime:a=2e4,granularity:i=1,maxPoints:o=500}=r??{},l=g(null),s=g(e),c=u(e=>{((e,t,r="0")=>tI(e,t,void 0,r))(s.current,rr.Spectrum)({pstype:rn.Render,data:{[t3]:e.spectrumData}}),((e,t,r="0")=>tI(e,t,void 0,r))(s.current,rr.LevelStream)({pstype:rn.Render,data:e.probabilityRangeData})},[]),d=u(e=>{let{probabilityRangeData:t,spectrumData:r}=e;tO(s.current).getAllRawData=t=>({...tL().getAllRawData(t),levelStreamData:e}),c({probabilityRangeData:t,spectrumData:r})},[c]);if(h(()=>{s.current=e},[e]),!l.current&&e){l.current=new P({range:n,cacheTime:a,granularity:i,maxPoints:o,onLevelStreamUpdate:d});let{line:t}=t0("levelStream");((e,t,r="0")=>tI(e,t,void 0,r))(e,rr.Spectrum)({pstype:rn.Series,name:t3,color:t})}return h(()=>{l.current?.setConfig({range:n})},[n]),h(()=>{l.current?.setConfig({cacheTime:a})},[a]),h(()=>{l.current?.setConfig({granularity:i})},[i]),h(()=>{l.current?.setConfig({onLevelStreamUpdate:d})},[d]),{analyzer:l.current,updateLevelStreamData:c}}class Dt extends of{constructor(e){super({id:e.id,chart:null,orientation:e.orientation??z.Vertical})}init(){let{id:e,orientation:t}=this.state,r=[...t2()].reverse().map(e=>E(e));this.state.chart=new N({id:e,series:[{name:"bar",type:M.Bar,display:!0,color:t0("bar"),orientation:t}],range:[0,100],barValue2Color:!0,colors:r})}updateSeries(e){this.state.chart?.render({name:"bar",data:e})}}let Dr=e=>{let{opacity:t}=e,{chart:n,Chart:a}=iV({Render:Dt,params:{orientation:z.Horizontal}});return i3({moduleType:rr.LevelStream,chart:n,extractData:e=>e.data}),/*#__PURE__*/r(a,{style:m(()=>({opacity:t,zIndex:1}),[t])})},Dn=Dr,Da=(e,t)=>{!0===t.batch?e.processBatch(t.data,t.timestamps):e.process(t.data,rK(t.timestamp))},Di=6,Do=4,Dl=8,Ds=({axisLineWidth:e,inside:t,width:r})=>t?{axisX:e,majorTickEndX:6,majorTickStartX:0,minorTickEndX:4,minorTickStartX:0,textAlign:"left",textX:8}:{axisX:r-e,majorTickEndX:r,majorTickStartX:r-6,minorTickEndX:r,minorTickStartX:r-4,textAlign:"right",textX:r-8},Dc=.5,Du=2,Dd=4,Dh=100,Dp=1,Df=.5,Dm=.5;function Dg(e){let{ranging:t}=e,{range:r,disabled:n,placement:a,show:i}=at(e=>e.axisY),o="inside"===a,l=g(null),s=g(null),[c,d]=b(0),[p,f]=b(window.devicePixelRatio||1),[v,y]=b(!1),[w,x]=b(0),k=u((e,t)=>{let r=.5*(Math.max(1,Math.round(t*p))%2!=0);return(Math.round(e*p-r)+r)/p},[p]),S=u((e,t,r)=>{let n=r/2;return Math.min(t-n,Math.max(n,e))},[]),M=m(()=>{let[e,t]=r;return{min:e,max:t}},[r]);h(()=>{let e=window.matchMedia(`(resolution: ${p}dppx)`),t=()=>f(window.devicePixelRatio||1);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[p]),h(()=>{let e=s.current;if(!e)return;let t=new ResizeObserver(e=>{let t=e[0];t&&d(t.contentRect.height)});return t.observe(e),()=>t.disconnect()},[i]);let F=u((e,t)=>{if(t.useScientific)return e.toExponential(1);if(t.useKFormat){let r=e/1e3;return t.useDecimals?`${r.toFixed(1)}k`:`${Math.round(r)}k`}return t.useDecimals?e.toFixed(1):Math.round(e).toString()},[]),C=m(()=>{if(0===c)return{majorTicks:[],minorTicks:[]};let e=M.max-M.min,{interval:t,majorTickValues:r}=Fv([M.min,M.max]);if(!t||0===r.length)return{majorTicks:[],minorTicks:[]};let n=r.some(e=>Math.abs(e)>=1e3),a=r.some(e=>.01>Math.abs(e)&&0!==e),i={useScientific:a,useKFormat:n&&!a,useDecimals:r.some(e=>e%1!=0)},o=[];for(let t of r){let r=(M.max-t)/e*c,n=r,a=!0,l=!1,s=c-6,u=.3*c;r<-u||r>c+u?a=!1:r<6?(n=6,l=!0):r>s&&(n=s,l=!0),a&&o.push({value:t,position:r,textPosition:n,label:F(t,i),isAdjusted:l})}let l=[],s=t/2,u=s/e*c,d=e<1;if(u>=(d?8:4)&&c>100&&!d){let r=Math.ceil(M.min/s)*s;for(let n=r;n<=M.max;n+=s){if(Math.abs(n%t)<.1*s)continue;let r=(M.max-n)/e*c;r>=0&&r<=c&&l.push({value:n,position:r,textPosition:r,label:""})}}return{majorTicks:o,minorTicks:l}},[M,c,F]),D=u(()=>{let e=l.current;if(!e||0===c)return;let t=e.getContext("2d");if(!t)return;let r=e.getBoundingClientRect().width,n=Ds({axisLineWidth:.5,inside:o,width:r});e.width=r*p,e.height=c*p,e.style.width=`${r}px`,e.style.height=`${c}px`,t.setTransform(p,0,0,p,0,0),t.imageSmoothingEnabled=!0,t.imageSmoothingQuality="high",t.clearRect(0,0,r,c),t.font="12px -apple-system, BlinkMacSystemFont, sans-serif",t.textAlign=n.textAlign,t.textBaseline="middle",t.lineWidth=Dp;let a=ol("--foreground",.5,s.current);C.majorTicks.forEach(e=>{t.fillStyle=a,t.strokeStyle=a,t.fillText(e.label,n.textX,e.textPosition),t.beginPath();let r=k(S(e.position,c,Dp),Dp);t.moveTo(n.majorTickStartX,r),t.lineTo(n.majorTickEndX,r),t.stroke()}),t.strokeStyle=a,t.lineWidth=.5,C.minorTicks.forEach(e=>{t.beginPath();let r=k(S(e.position,c,.5),.5);t.moveTo(n.minorTickStartX,r),t.lineTo(n.minorTickEndX,r),t.stroke()}),t.strokeStyle=a,t.lineWidth=.5,t.beginPath();let i=k(n.axisX,.5);t.moveTo(i,0),t.lineTo(i,c),t.stroke()},[C,c,p,o,k,S]);h(()=>{!1!==i&&D()},[D,i]),h(()=>oh(()=>{D()}),[D]);let z=u(e=>{n||(y(!0),x(e.clientY))},[n]),N=u(e=>{n||t.moveWheel?.(e)},[t,n]),E=u(e=>{if(n||!v||!s.current)return;let r=(e.clientY-w)/s.current.offsetHeight;Math.abs(r)>(M.max-M.min<1?.005:.01)&&(t.move?.(r),x(e.clientY))},[n,v,w,t,M]);return{canvasRef:l,containerRef:s,isDragging:v,range:M,handleMouseDown:z,handleMouseMove:E,handleMouseUp:u(()=>{n||y(!1)},[n]),handleMouseLeave:u(()=>{n||y(!1)},[n]),handleWheel:N,ticksData:C}}function Db(e){let{chart:t}=e,{state:{axisY:n,globalID:a}}=ae(),{show:i}=n,o=nY({chart:t}),{axisYWidth:l,inside:s,marginLeft:c}=yn(),{canvasRef:u,containerRef:d,isDragging:h,handleMouseDown:p,handleMouseMove:f,handleMouseUp:m,handleMouseLeave:g,handleWheel:b}=Dg({ranging:o});return!1===i?null:/*#__PURE__*/r("div",{ref:d,className:iX("h-full select-none",s?"absolute left-0 top-0 z-[7]":"relative",h?"cursor-grabbing":"cursor-ns-resize"),style:{width:l,marginLeft:c},onMouseDown:p,onMouseMove:f,onMouseUp:m,onMouseLeave:g,onWheel:b,onDoubleClick:()=>{let{realRange:e}=nA({range:n.defaultRange??ns,unit:n.unit,step:n.step,globalID:a}),t=yR(n.restrict,e);o.setAxisY?.({realRange:t}),o.onChange?.()},children:/*#__PURE__*/r("canvas",{ref:u,className:"pointer-events-none absolute left-0 top-0 h-full w-full"})})}let Dv=(e,t,r)=>{let[n,a]=r;return e<=0||t.end<t.start||!Number.isFinite(n)||!Number.isFinite(a)||a<=n?null:{x:[100*t.start/e,(t.end+1)*100/e],y:[n,a]}},Dy=(e,t)=>{let r=t.x[1]-t.x[0],n=t.y[1]-t.y[0],a=e=>Math.max(0,Math.min(100,t.x[0]+e*r/100));return{x:[a(e.leftPosition),a(e.leftPosition+e.width)],y:[t.y[1]-(e.position+e.height)*n/100,t.y[1]-e.position*n/100]}},Dw=(e,t)=>{let r=t.x[1]-t.x[0],n=t.y[1]-t.y[0];return{leftPosition:(e.x[0]-t.x[0])*100/r,width:(e.x[1]-e.x[0])*100/r,position:(t.y[1]-e.y[1])*100/n,height:(e.y[1]-e.y[0])*100/n}},Dx=(e,t)=>{let r=t.x[1]-t.x[0];return{left:-(100*t.x[0])/r,right:(100-t.x[0])*100/r,top:Math.min(0,100-e.height,e.position),bottom:Math.max(100,e.height,e.position+e.height)}},Dk=(e,t,r=0)=>{let n=t(e.x[0]),a=t(e.x[1]),i=Number(n),o=Number(a);return n&&a&&Number.isFinite(i)&&Number.isFinite(o)?{deltaX:Math.abs(o-i),deltaY:Math.abs(e.y[1]-e.y[0]),centerFrequency:(i+o)/2,startFrequency:i,endFrequency:o,startAmplitude:e.y[0]+r,endAmplitude:e.y[1]+r}:null},DS=1e-9,DM=(e,t,r,n,a)=>{for(let i=n;i<=a;i+=1)if(r(e,i)!==r(t,i))return i;return a},DF={position:40,height:20,leftPosition:40,width:20},DC=()=>{let{state:{deltaMeasurement:{show:e,display:t,onChange:a},axisX:{frequencyFormat:i},axisY:{unit:o,range:l,renderRange:s},segments:c,zoom:{interval:d}}}=ae(),p=e&&t,[f,v]=b(null),y=g(null),w=g(a);w.current=a;let x=s??l??[-120,0],k=(l?.[0]??x[0])-x[0],S=m(()=>Dv(c.totalPoints??0,d,x),[c.totalPoints,d.start,d.end,x[0],x[1]]),M=m(()=>f&&S?Dw(f,S):null,[f,S]),F=m(()=>f&&i&&c.length?Dk(f,i,k):null,[f,i,c,k]);h(()=>{p&&S&&v(e=>e??Dy(DF,S))},[p,S]),h(()=>{p||(y.current=null,v(null),w.current?.(null))},[p]);let C=u(e=>{let t=y.current??S;t&&v(Dy(e,t))},[S]),D=u(e=>{let t=y.current??S;if(y.current=null,!t||!i||!c.length)return;let r=Dy(e,t);v(r);let n=Dk(r,i,k);n&&a?.(n)},[S,i,c,k,a]),z=(e,t=3)=>rD(e,t).formatted,N=(e,t=2)=>{let r=Number.parseFloat(e.toFixed(t));return`${r} ${o}`},E=m(()=>{if(!F)return{labels:void 0,middleContent:null};let e=F.deltaX<=1e-9,t=F.deltaY<=1e-9,a=e?3:DM(F.startFrequency,F.endFrequency,z,3,6),i=t?2:DM(F.startAmplitude,F.endAmplitude,N,2,4),l=z(F.startFrequency,a),s=z(F.endFrequency,a),c=N(F.endAmplitude,i),u=N(F.startAmplitude,i),d=z(F.deltaX,a),h=`${Number.parseFloat(F.deltaY.toFixed(i))} ${o}`,p=z(F.centerFrequency,a);return{labels:{left:e?void 0:l,right:e?void 0:s,top:t?void 0:c,bottom:t?void 0:u},middleContent:/*#__PURE__*/n("div",{className:"grid gap-0.5",children:[/*#__PURE__*/r("div",{children:e?`频点: ${l}`:`ΔX: ${d}`}),/*#__PURE__*/r("div",{children:t?`幅度: ${u}`:`ΔY: ${h}`}),!e&&/*#__PURE__*/n("div",{children:["中心: ",p]})]})}},[F,o]);if(!M||!S)return null;let T=y.current??S,R=f?Dw(f,T):M;return /*#__PURE__*/r(ME,{enabled:p,defaultRect:M,minSize:0,minWidth:0,minHeight:0,variant:"projected",interactionBounds:Dx(R,T),onDragStart:()=>{y.current=S},onChange:C,onDragEnd:D,zIndex:7,labels:E.labels,children:E.middleContent})},DD=DC,Dz=({frequencyLeft:e,segments:t})=>ry(t)(e),DN=({e,zoom:t,segments:r,onChange:n,globalID:a})=>{let{realData:i}=tO(a).getAllRawData();if(!i)return;let o=i.length,{interval:{start:l,end:s}}=t,{left:c}=e,u=e.left+e.width,d=w_({coord:e,segments:r,zoom:t}),h=w_({coord:{left:u},segments:r,zoom:t}),p=Math.max(0,Math.ceil(o*d/100)-1),f=Math.ceil(o*h/100),{maxIndex:m}=tU(Array.from(i.slice(p,f)));n({frequency:(({frequencyLeft:e,segments:t})=>ry(t)(e))({frequencyLeft:(l+(p+m+1)/o*(s-l))*100/r.totalPoints,segments:r}),bandwidth:Math.round(1e3*rk({segments:r,endLeft:u,startLeft:c})),left:d,right:h})},DE=rl.DragFrame,DT=({id:e})=>{let{state:{zoom:a,segments:i,signalAnalysis:o,globalID:l},dispatch:s}=ae(),[c,d]=b(null),p=u((e,t=!1)=>{o.show&&o.display&&t?DN({e,zoom:a,segments:i,onChange:o.onChange,globalID:l}):s({payload:{zoom:{...a,interval:e.interval,isScanSegmentsUpdateMagnify:e.isScanSegmentsUpdateMagnify}}})},[o,a,i,l]),f=u((e,t,r,n)=>{if(e&&t&&n){let r=e.left,n=t.left,a=n-r;d({diffX:a,left:a>0?r:n,width:Math.abs(a),isScanSegmentsUpdateMagnify:a>0})}},[]),m=u(()=>{if(!c)return;let{left:e,width:t,isScanSegmentsUpdateMagnify:r,diffX:n}=c,{totalPoints:a}=i;if(r&&n>0){let n=SO({startPercent:e,endPercent:e+t,totalPoints:a}),i=n?n.end-n.start+1:0;n&&i>tV.ZOOM_MIN_RANGE&&p({interval:n,isScanSegmentsUpdateMagnify:r,left:e,width:t},!0)}n<0&&p({interval:{start:0,end:a-1},isScanSegmentsUpdateMagnify:r,left:e,width:t})},[c,i,a.interval.end,p]);return(h(()=>{if(a.show){let t=()=>{d(null),xt(e,DE)};wU(e,DE,t),wK(e,DE,()=>{m(),t()}),wV(e,DE,t),wJ(e,DE,(...t)=>{w7(e,DE)&&f(t[0],t[1],t[2],t[3])})}},[a.show,e,m,f]),h(()=>{c||xt(e,DE)},[c,e]),a.show)?/*#__PURE__*/r(yi,{className:"z-[3]",children:/*#__PURE__*/r("div",{className:"absolute left-[-100%] top-0 h-full w-0 box-border border-2 border-dashed border-chart-grid-strong bg-chart-surface opacity-40",style:c?{left:`${c.left}%`,width:`${c.width}%`}:{},children:c&&!c.isScanSegmentsUpdateMagnify&&/*#__PURE__*/n(t,{children:[/*#__PURE__*/r("div",{className:"pointer-events-none absolute inset-0 opacity-20",style:{background:"linear-gradient(to top right, transparent, transparent calc(50% - 1px), var(--chart-grid-strong), transparent calc(50% + 1px), transparent)"}}),/*#__PURE__*/r("div",{className:"pointer-events-none absolute inset-0 opacity-20",style:{background:"linear-gradient(to bottom right, transparent, transparent calc(50% - 1px), var(--chart-grid-strong), transparent calc(50% + 1px), transparent)"}})]})})}):null},DR=/*#__PURE__*/c(DT),DA=14,DI=5,DP=4,DL=({density:e="auto",channelCount:t})=>{let r="compact"===e||"auto"===e&&t>4;return{compact:r,laneHeight:r?5:14,showLabels:!r}},DO=null,Dq=["#B22222","#CD5C5C","#FF6347","#FA8072","#F08080","#A0522D","#FF4500","#FF7F50","#B8860B","#FFA500","#808000","#9ACD32","#32CD32","#8FBC8F","#2E8B57","#3CB371","#00FA9A","#66CDAA","#7FFFD4","#2F4F4F","#008080","#00CED1","#20B2AA","#48D1CC","#4682B4","#778899","#87CEFA","#4169E1","#4169E1","#6495ED","#483D8B","#6A5ACD","#7B68EE","#9370DB","#9370DB","#9932CC","#8A2BE2","#BA55D3","#800080","#DDA0DD","#C71585","#DC143C"];function D$(e){let t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,n),i=Math.min(t,r,n),o=0,l=0,s=(a+i)/2;if(a!==i){let e=a-i;switch(l=s>.5?e/(2-a-i):e/(a+i),a){case t:o=(r-n)/e+6*(r<n);break;case r:o=(n-t)/e+2;break;case n:o=(t-r)/e+4}o/=6}return{h:360*o,s:100*l,l:100*s}}let D_=[...Dq].map(e=>({color:e,hsl:D$(e)})).sort((e,t)=>Math.abs(e.hsl.h-t.hsl.h)>10?e.hsl.h-t.hsl.h:e.hsl.l-t.hsl.l).map(e=>e.color);function Dj(e){let t=[...e].sort((e,t)=>Number(e.startFrequency)-Number(t.startFrequency));return t.map((e,r)=>{let n=t.length,a=D_.length,i=Math.floor(r/n*a),o=Math.floor((r+1)/n*a),l=D_[Math.min(i,a-1)],s=D_[Math.min(o,a-1)],c=r===n-1?D_[a-1]:s;return{...e,color:l,gradientColors:[l,c]}})}let DH=[{startFrequency:87,stopFrequency:108,stepFrequency:100,bandwidth:150,modulation:"AM",demodulation:"不解调",status:"合法",title:"FM广播",description:"FM调频广播频段,用于音频广播服务"},{startFrequency:108,stopFrequency:118,stepFrequency:50,bandwidth:100,modulation:"FM",demodulation:"解调",status:"合法",title:"航空导航",description:"航空无线电导航频段,用于仪表着陆系统等"},{startFrequency:118,stopFrequency:137,stepFrequency:25,bandwidth:50,modulation:"AM",demodulation:"解调",status:"合法",title:"航空语音通信",description:"民用航空语音通信频段"},{startFrequency:121,stopFrequency:122,stepFrequency:25,bandwidth:50,modulation:"FM",demodulation:"解调",status:"合法",title:"紧急通信",description:"紧急情况通信专用频段"},{startFrequency:136,stopFrequency:174,stepFrequency:25,bandwidth:50,modulation:"FM",demodulation:"解调",status:"合法",title:"对讲通信",description:"专业无线对讲通信频段"},{startFrequency:161,stopFrequency:162,stepFrequency:25,bandwidth:50,modulation:"GMSK",demodulation:"解调",status:"合法",title:"AIS船舶通信",description:"船舶自动识别系统(AIS)专用频段"},{startFrequency:351,stopFrequency:400,stepFrequency:25,bandwidth:50,modulation:"FM",demodulation:"解调",status:"合法",title:"集群通信",description:"专业集群通信系统频段"},{startFrequency:400,stopFrequency:470,stepFrequency:25,bandwidth:50,modulation:"FM",demodulation:"解调",status:"合法",title:"专业对讲",description:"专业无线对讲通信频段"},{startFrequency:534,stopFrequency:542,stepFrequency:100,bandwidth:8e3,modulation:"OFDM",demodulation:"解调",status:"合法",title:"数字电视",description:"数字电视广播频段"},{startFrequency:622,stopFrequency:630,stepFrequency:100,bandwidth:8e3,modulation:"OFDM",demodulation:"解调",status:"合法",title:"数字电视",description:"数字电视广播频段"},{startFrequency:703,stopFrequency:733,stepFrequency:100,bandwidth:3e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"5G上行(广电/移动)",description:"广电和移动5G网络上行频段"},{startFrequency:758,stopFrequency:788,stepFrequency:100,bandwidth:3e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"5G下行(广电/移动)",description:"广电和移动5G网络下行频段"},{startFrequency:806,stopFrequency:821,stepFrequency:25,bandwidth:50,modulation:"π/4DQPSK",demodulation:"解调",status:"合法",title:"数字集群上行",description:"数字集群通信系统(TETRA)上行频段"},{startFrequency:824,stopFrequency:835,stepFrequency:100,bandwidth:5e3,modulation:"QPSK",demodulation:"解调",status:"合法",title:"电信3G/4G/5G上行",description:"中国电信3G/4G/5G网络上行频段"},{startFrequency:851,stopFrequency:866,stepFrequency:25,bandwidth:50,modulation:"π/4DQPSK",demodulation:"解调",status:"合法",title:"数字集群下行",description:"数字集群通信系统(TETRA)下行频段"},{startFrequency:869,stopFrequency:880,stepFrequency:100,bandwidth:5e3,modulation:"QPSK",demodulation:"解调",status:"合法",title:"电信3G/4G/5G下行",description:"中国电信3G/4G/5G网络下行频段"},{startFrequency:885,stopFrequency:889,stepFrequency:200,bandwidth:200,modulation:"GMSK",demodulation:"解调",status:"合法",title:"GSM-R上行",description:"铁路专用GSM-R网络上行频段"},{startFrequency:889,stopFrequency:904,stepFrequency:200,bandwidth:200,modulation:"GMSK",demodulation:"解调",status:"合法",title:"移动2G/4G上行",description:"中国移动2G/4G网络上行频段"},{startFrequency:904,stopFrequency:915,stepFrequency:200,bandwidth:200,modulation:"QPSK",demodulation:"解调",status:"合法",title:"联通2/3/4/5G上行",description:"中国联通2G/3G/4G/5G网络上行频段"},{startFrequency:930,stopFrequency:934,stepFrequency:200,bandwidth:200,modulation:"GMSK",demodulation:"解调",status:"合法",title:"GSM-R下行",description:"铁路专用GSM-R网络下行频段"},{startFrequency:934,stopFrequency:949,stepFrequency:200,bandwidth:200,modulation:"GMSK",demodulation:"解调",status:"合法",title:"移动2G/4G下行",description:"中国移动2G/4G网络下行频段"},{startFrequency:949,stopFrequency:960,stepFrequency:200,bandwidth:200,modulation:"QPSK",demodulation:"解调",status:"合法",title:"联通2/3/4/5G下行",description:"中国联通2G/3G/4G/5G网络下行频段"},{startFrequency:1164,stopFrequency:1189,stepFrequency:1e3,bandwidth:1e4,modulation:"BPSK",demodulation:"解调",status:"合法",title:"GPS L5频段",description:"全球定位系统GPS L5频段"},{startFrequency:1215,stopFrequency:1234,stepFrequency:1e3,bandwidth:1e4,modulation:"BPSK",demodulation:"解调",status:"合法",title:"GPS L2频段",description:"全球定位系统GPS L2频段"},{startFrequency:1447,stopFrequency:1467,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"政务公安专网",description:"政务和公安专用LTE网络频段"},{startFrequency:1563,stopFrequency:1587,stepFrequency:1e3,bandwidth:1e4,modulation:"BPSK",demodulation:"解调",status:"合法",title:"GPS L1频段",description:"全球定位系统GPS L1频段"},{startFrequency:1710,stopFrequency:1735,stepFrequency:200,bandwidth:5e3,modulation:"QPSK",demodulation:"解调",status:"合法",title:"移动2G/4G上行",description:"中国移动2G/4G网络上行频段"},{startFrequency:1735,stopFrequency:1765,stepFrequency:200,bandwidth:5e3,modulation:"QPSK",demodulation:"解调",status:"合法",title:"联通2/4G上行",description:"中国联通2G/4G网络上行频段"},{startFrequency:1805,stopFrequency:1830,stepFrequency:200,bandwidth:5e3,modulation:"QPSK",demodulation:"解调",status:"合法",title:"移动2G/4G下行",description:"中国移动2G/4G网络下行频段"},{startFrequency:1830,stopFrequency:1860,stepFrequency:200,bandwidth:5e3,modulation:"QPSK",demodulation:"解调",status:"合法",title:"联通2/4G下行",description:"中国联通2G/4G网络下行频段"},{startFrequency:1885,stopFrequency:1915,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"移动4G",description:"中国移动4G网络频段"},{startFrequency:1920,stopFrequency:1940,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"电信/联通5G上行",description:"中国电信/联通5G网络上行频段"},{startFrequency:1940,stopFrequency:1965,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"联通3/4/5G上行",description:"中国联通3G/4G/5G网络上行频段"},{startFrequency:2110,stopFrequency:2130,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"电信/联通5G下行",description:"中国电信/联通5G网络下行频段"},{startFrequency:2300,stopFrequency:2320,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"联通4G",description:"中国联通4G网络频段"},{startFrequency:2320,stopFrequency:2370,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"移动4G",description:"中国移动4G网络频段"},{startFrequency:2400,stopFrequency:2500,stepFrequency:1,bandwidth:20,modulation:"OFDM",demodulation:"解调",status:"合法",title:"ISM 2.4GHz",description:"WIFI、蓝牙、无人机等使用频段"},{startFrequency:2515,stopFrequency:2675,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"移动5G/4G",description:"中国移动5G和4G网络频段"},{startFrequency:3300,stopFrequency:3600,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"5G频段",description:"电信、联通、广电5G网络频段"},{startFrequency:4800,stopFrequency:4900,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"移动5G",description:"中国移动5G网络频段"},{startFrequency:4900,stopFrequency:4960,stepFrequency:100,bandwidth:1e4,modulation:"OFDMA",demodulation:"解调",status:"合法",title:"广电5G",description:"中国广电5G网络频段"},{startFrequency:5725,stopFrequency:5875.5,stepFrequency:5,bandwidth:20,modulation:"OFDM",demodulation:"解调",status:"合法",title:"ISM 5GHz",description:"WIFI、无人机等使用频段"}],DB="rfkit-charts-frequency-allocation",DW=e=>!!e&&"object"==typeof e&&2===e.version&&Array.isArray(e.channels),DG=()=>{let e=localStorage.getItem(DB);if(!e)return null;let t=JSON.parse(e);return Array.isArray(t)||DW(t)?t:null},DY=()=>{let e=DG();return Array.isArray(e)?e:null},DU=()=>{let e=DG();return DW(e)?e.channels:null},DX=e=>{localStorage.setItem(DB,JSON.stringify(e))},DK=e=>{localStorage.setItem(DB,JSON.stringify({version:2,channels:e}))},DV=()=>{localStorage.removeItem(DB)},DQ=()=>null!==localStorage.getItem(DB),DZ="default",DJ=(e,t)=>e.id||e.title||`${DZ}-${t}`,D0=e=>e.id?`channel:id:${e.id}`:e.title?`channel:title:${e.title}`:"channel:anonymous",D1=(e,t,r)=>{let n=t.get(e)??0,a=0===n?e:`${e}#${n+1}`;for(;r.has(a);)n+=1,a=`${e}#${n+1}`;return t.set(e,n+1),r.add(a),a},D2=(e,t)=>{let r=new Map,n=new Set;return e.map((e,r)=>({id:DJ(e,r),renderKeyBase:D0(e),title:e.title,data:t(e.data??[])})).filter(e=>e.data.length>0).map(({renderKeyBase:e,...t})=>({...t,renderKey:D1(e,r,n)}))},D5=(e,t)=>[{id:DZ,renderKey:`channel:id:${DZ}`,data:t(e)}];function D4({data:e,channels:t,cachedData:r,cachedChannels:n,presetData:a,normalizeData:i}){if(t)return t.length?D2(t,i):D5(e?.length?e:a,i);if(n?.length)return D2(n,i);let o=e??[];return D5(r&&r.length>0?r:o.length>0?o:a,i)}function D3({data:e,channels:t}){return D4({data:e,channels:t,cachedData:DY(),cachedChannels:DU(),presetData:DH,normalizeData:Dj})}function D6(e){return D3({data:e})[0]?.data??[]}let D8=e=>{if(null!=e.startFrequency&&null!=e.stopFrequency){let t=rT({startFrequency:Number(e.startFrequency),stopFrequency:Number(e.stopFrequency)});if(t)return{start:t.startFreq,stop:t.stopFreq,type:"range"}}return null},D9=e=>JSON.stringify([e.title,e.startFrequency,e.stopFrequency,e.centerFrequency,e.bandwidth,e.stepFrequency,e.modulation,e.description,e.demodulation,e.status]),D7=e=>e.id?`band:id:${e.id}`:`band:fingerprint:${D9(e)}`,ze=(e,t,r)=>{let n=t.get(e)??0,a=0===n?e:`${e}#${n+1}`;for(;r.has(a);)n+=1,a=`${e}#${n+1}`;return t.set(e,n+1),r.add(a),a},zt=({segments:e,allocations:t,channelIndex:r,channelTitle:n})=>{if(!e.length||!t.length)return[];let a=e.reduce((e,t)=>e+t.point,0),i=new Map,o=new Set,l=t.map(e=>({band:e,renderKey:ze(D7(e),i,o)}));return e.map((t,i)=>{let o=l.map(({band:e,renderKey:a})=>{let i=D8(e);if(!i||i.stop<t.start||i.start>t.stop)return null;let{left:o,width:l}=rP({startFreq:i.start,stopFreq:i.stop},t);return{band:e,renderKey:a,range:i,channelIndex:r??0,channelTitle:n,position:{left:`${o}%`,width:`${l}%`}}}).filter(e=>null!==e),s=t.point/a*100,c=e.slice(0,i).reduce((e,t)=>e+t.point/a*100,0);return{segment:t,segmentIndex:i,bandPositions:o,style:{left:`${c}%`,width:`${s}%`}}})},zr=({segments:e,channels:t})=>t.map((t,r)=>({channel:t,channelIndex:r,segmentData:zt({segments:e,allocations:t.data,channelIndex:r,channelTitle:t.title})})).filter(e=>e.segmentData.some(e=>e.bandPositions.length>0)),zn=e=>e.map(e=>{let t=calculateFrequencyRange(null!=e.startFrequency&&null!=e.stopFrequency?{startFrequency:Number(e.startFrequency),stopFrequency:Number(e.stopFrequency)}:{frequency:null!=e.centerFrequency?Number(e.centerFrequency):void 0,bandwidth:null!=e.bandwidth?Number(e.bandwidth):void 0});return t?{item:e,range:t,width:Math.abs(t.stopFreq-t.startFreq),center:(t.startFreq+t.stopFreq)/2,title:String(e.title??"")}:null}).filter(e=>null!==e),za=({rangeIndex:e,frequency:t})=>{let r;if(Number.isFinite(t)&&e.length){for(let n of e){let{range:e}=n;if(t<e.startFreq||t>e.stopFreq)continue;if(!r){r=n;continue}let a=n.width-r.width;if(a<0){r=n;continue}if(a>0)continue;let i=Math.abs(n.center-t)-Math.abs(r.center-t);if(i<0){r=n;continue}!(i>0)&&0>n.title.localeCompare(r.title)&&(r=n)}return r?.item}},zi=({allocations:e,frequency:t})=>za({rangeIndex:zn(e),frequency:t});function zo(){let e=useSelector(e=>e.frequencyAllocation.data);return useMemo(()=>resolveFrequencyAllocationData(e),[e])}function zl(){let e=at(e=>e.frequencyAllocation.data),t=at(e=>e.frequencyAllocation.channels);return m(()=>D3({data:e,channels:t}),[e,t])}function zs({frequency:e,cursorSample:t}){let r=useSelector(e=>e.cursor),n=useSelector(e=>e.segments),a=useSelector(e=>e.frequencyAllocation.display),i=useSelector(e=>e.frequencyAllocation.show),o=t?.coord.left??r.coord.left,l=useFrequencyAllocationData(),s=useMemo(()=>createFrequencyAllocationRangeIndex(l),[l]),c=useMemo(()=>!!t||hasActiveSpectrumCursor(r),[r,t]),u=useMemo(()=>c&&"number"==typeof o?calculateCursorPosition(o,n):{segmentIndex:-1,pointIndex:-1},[c,o,n]);return useMemo(()=>{if(!i||!a||!e||!n?.length||!c||!n[u.segmentIndex])return;let t=getCursorFrequencyAtPosition(n,u),r=Number.isFinite(t)?t:Number(e);if(Number.isFinite(r))return findFrequencyAllocationInRangeIndex({rangeIndex:s,frequency:r})},[s,u.segmentIndex,a,e,c,n,i])}let zc=null,zu=({allocationInfo:e,variant:t="default"})=>{if(!e)return null;let{title:r,description:a,startFrequency:i,stopFrequency:o,bandwidth:l,modulation:s,channelTitle:c}=e;return /*#__PURE__*/n("div",{className:iX("text-xs leading-5 text-popover-foreground","board"===t&&"mt-[calc(var(--size-gap-base)/2)] border-t border-dashed border-border pt-[calc(var(--size-gap-base)/2)]"),children:[r?/*#__PURE__*/n("div",{className:"mb-1 font-bold",children:["业务类型:",r]}):null,/*#__PURE__*/n("div",{className:"mb-1 text-primary",children:[c?/*#__PURE__*/n("div",{children:["通道:",c]}):null,null!=i&&null!=o&&/*#__PURE__*/n("div",{children:["频率范围:",i," - ",o]}),null!=l&&""!==l?/*#__PURE__*/n("div",{children:["信号带宽:",l," kHz"]}):null,s?/*#__PURE__*/n("div",{children:["调制方式:",s]}):null]}),a?.trim()?/*#__PURE__*/n("div",{className:"whitespace-pre-line break-words leading-5 opacity-85",children:["备注信息:",a]}):null]})},zd=/*#__PURE__*/a.memo(zu),zh=/*#__PURE__*/c(({style:e,bandPositions:t,showLabels:n,onMouseEnter:a,onMouseMove:i,onMouseLeave:o})=>/*#__PURE__*/r("div",{className:"absolute top-0 h-full [contain:layout]",style:e,children:t.map(e=>{let{band:t,position:l,renderKey:s}=e;return /*#__PURE__*/r("div",{className:"pointer-events-auto absolute flex h-full items-center justify-center overflow-hidden px-1 text-xs text-foreground/90 opacity-60 backdrop-blur-sm transition-[opacity,box-shadow] duration-200 hover:z-[1] hover:opacity-100 hover:shadow-lg",style:{...t.gradientColors?{backgroundImage:`linear-gradient(to right, ${t.gradientColors[0]}, ${t.gradientColors[1]})`}:{backgroundColor:t.color||"var(--primary)"},left:l.left,width:l.width},onMouseEnter:a(e),onMouseMove:i,onMouseLeave:o,children:n?/*#__PURE__*/r("span",{className:"truncate",children:t.title}):null},s)})})),zp=zh,zf=({title:e,description:t,visible:n,x:a,y:i,startFrequency:o,stopFrequency:l,centerFrequency:s,stepFrequency:c,bandwidth:d,modulation:p,channelTitle:f,positionRef:m,scheduleRef:b})=>{let v=g(null),y=g(null),w=gi("tooltip"),x=u(()=>{if(!n||!v.current)return;let e=v.current,t=e.offsetWidth,r=e.offsetHeight,o=window.innerWidth,l=window.innerHeight,s=m.current??{x:a,y:i},c=s.x,u=s.y,d=Math.max(12,Math.min(c+t>o-12?c-t-10:c,o-t-12)),h=Math.max(12,Math.min(u+r>l-12?u-r-10:u,l-r-12));e.style.transform=`translate3d(${d}px, ${h}px, 0)`},[m,n,a,i]),k=u(()=>{n&&null===y.current&&(y.current=requestAnimationFrame(()=>{y.current=null,x()}))},[x,n]);return(h(()=>(b.current=k,()=>{b.current===k&&(b.current=null)}),[k,b]),h(()=>{if(n)return k(),()=>{null!==y.current&&(cancelAnimationFrame(y.current),y.current=null)}},[w,k,n]),n&&w)?/*#__PURE__*/R(/*#__PURE__*/r("div",{ref:v,"data-rfkit-frequency-allocation-tooltip":"true",className:"pointer-events-none fixed z-[1] max-w-[300px] rounded-[var(--radius-surface)] border border-border/70 bg-chart-panel/95 p-[var(--size-gap-base)] text-chart-panel-foreground shadow-lg backdrop-blur-md",style:{left:0,top:0,transform:`translate3d(${a}px, ${i}px, 0)`},children:/*#__PURE__*/r(zd,{allocationInfo:{title:e,description:t,startFrequency:o,stopFrequency:l,centerFrequency:s,stepFrequency:c,bandwidth:d,modulation:p,channelTitle:f}})}),w):null},zm=zf,zg=()=>{let e=at(e=>e.axisX.unit),t=at(e=>e.segments),a=at(e=>e.frequencyAllocation.display),i=at(e=>e.frequencyAllocation.show),o=at(e=>e.frequencyAllocation.density),l=at(e=>e.zoom.style),s=zl(),[c,d]=b({visible:!1,x:0,y:0}),h=g({x:0,y:0}),p=g(null),f=u(e=>{h.current={x:e.clientX+10,y:e.clientY+10},p.current?.()},[]),v=m(()=>zr({segments:t,channels:s}),[t,s]),{laneHeight:y,showLabels:w}=DL({density:o,channelCount:v.length}),x=Math.max(y,v.length*y),k=u(e=>{d(t=>({...t,...e}))},[]),S=u(({band:t,channelTitle:r,range:n})=>a=>{f(a);let i={...t,visible:!0,x:h.current.x,y:h.current.y,channelTitle:r,startFrequency:`${n.start}${e}`,stopFrequency:`${n.stop}${e}`};"centerBandwidth"===n.type&&null!=n.frequency&&null!=n.bandwidth&&(i.centerFrequency=`${n.frequency}${e}`),k(i)},[e,k,f]),M=u(e=>{f(e)},[f]),F=u(()=>{k({visible:!1})},[k]);return i&&a&&0!==v.length?/*#__PURE__*/n("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-[5] flex w-full select-none items-center overflow-hidden",style:{height:x,backgroundColor:"var(--mix-chart-surface-12)"},children:[/*#__PURE__*/r("div",{className:"absolute right-0 top-0 h-full w-full will-change-transform",style:l??void 0,children:v.map(({channel:e,channelIndex:t,segmentData:n})=>/*#__PURE__*/r("div",{className:"absolute left-0 w-full",style:{bottom:t*y,height:y},children:n.map(({segmentIndex:t,bandPositions:n,style:a})=>/*#__PURE__*/r(zh,{style:a,bandPositions:n,showLabels:w,onMouseEnter:S,onMouseMove:M,onMouseLeave:F},`${e.renderKey}-segment-${t}`))},e.renderKey))}),/*#__PURE__*/r(zf,{...c,positionRef:h,scheduleRef:p})]}):null},zb=zg,zv=e=>{let[t,r]=b(0);return h(()=>{if(!e)return;let t=tq(e,"FrequencyTagLineBoard",()=>{r(e=>e+1)});return()=>{t?.()}},[e]),t},zy=({id:e})=>{let{state:{frequencyTagLine:t,cursor:n}}=ae(),{show:a,display:i,left:o,onChange:l}=t,s=zv(e),c=n.show&&n.active&&n.event?.sourceType===rr.Spectrum,d=u(e=>{if(!e)return;let{index:t,frequency:r}=e;tY(r)&&l({index:t,frequency:r})},[l]);return a&&i&&!c?/*#__PURE__*/r("div",{className:"absolute bottom-5 right-[34px] z-[6] h-auto w-auto",children:/*#__PURE__*/r(Sh,{left:o,updateKey:s,onChange:d,showSignalInfo:!1})}):null},zw=/*#__PURE__*/a.memo(zy),zx=()=>{let{state:{frequencyTagLine:e},dispatch:t}=useStore(),{display:r,show:n}=e,a=useCallback(r=>{t({payload:{frequencyTagLine:{...e,display:!!r}}})},[e]),i=useMemo(()=>/*#__PURE__*/_jsx("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",children:/*#__PURE__*/_jsx("path",{d:"M288 128H896l-120 256L896 640H288v320H192v-896h96V128z",fillOpacity:".65",fill:"currentColor",style:{transition:"fill 0.2s ease"}})}),[r]);return n?/*#__PURE__*/_jsx(IconBox,{active:r,tone:"primary",onClick:()=>a(!r),title:"频率标记线显示控制",children:i}):null},zk=/*#__PURE__*/null,zS=rl.FrequencyTagLine,zM=e=>{let{state:{frequencyTagLine:t},dispatch:n}=ae(),{show:a,display:i,left:o,onChange:l}=t,{id:s}=e,c=g(t);return(h(()=>{c.current=t},[t]),h(()=>{let e=wK(s,zS,()=>{a&&i&&xt(s,zS)}),t=wV(s,zS,()=>{a&&i&&xt(s,zS)});return()=>{e?.(),t?.()}},[s,a,i,l]),h(()=>{let e=wU(s,zS,e=>{a&&i&&n({payload:{frequencyTagLine:{...c.current,...e,id:s}}})}),t=wJ(s,zS,(e,t)=>{a&&i&&(w7(s,zS),n({payload:{frequencyTagLine:{...c.current,...t,id:s}}}))});return()=>{e?.(),t?.()}},[s,a,i,n]),h(()=>{n({payload:{frequencyTagLine:{...t,left:-100}}})},[a]),a&&i)?/*#__PURE__*/r(yi,{className:"z-[3]",children:/*#__PURE__*/r("div",{className:"relative flex h-full w-px border-l border-dashed border-chart-highlight/80 opacity-80",style:{left:`${o}%`}})}):null},zF=/*#__PURE__*/a.memo(zM),zC={color:tQ},zD={borderColor:tQ},zz=28,zN=e=>{let t=Math.round(100*e)/100;return 0===t?0:t},zE=({value:e,onChange:t,dragging:a})=>{let{state:{axisY:i,limit:o,system:l}}=ae(),{label:s,disabled:c}=o,{unit:d="",range:p=ns}=i,[f,v]=p,y=Math.min(f,v),w=Math.max(f,v),x=m(()=>rg(d)?ny(0):0,[d]),k=m(()=>{let t=v-f;return Number.isFinite(e)&&Number.isFinite(t)&&0!==t?(v-e-x)/t*100:0},[v,x,f,e]),S=m(()=>Number.isFinite(e)?zN(x+e):0/0,[x,e]),M=Number.isFinite(S)?String(S):"",[F,C]=b(!1),D=g(null),z=g(null),N=g(""),E=g(!1),T=D.current?.clientHeight||l.height,R=(T>0?k/100*T<28:k<15)?"top-[4px]":"top-[-28px]";h(()=>{c&&(E.current=!0,C(!1))},[c]),h(()=>{F&&(z.current?.focus(),z.current?.select())},[F]);let A=u(()=>{!c&&Number.isFinite(S)&&(N.current=M,E.current=!1,C(!0))},[c,M,S]),I=u(()=>{let e=z.current;if(c||!e||e.validity.badInput)return void C(!1);let r=e.value.trim();if(!r||r===N.current)return void C(!1);let n=Number(r);if(Number.isFinite(n)){let e=Math.min(w,Math.max(y,zN(n)));t?.(zN(e-x))}C(!1)},[x,c,t,w,y]),P=u(e=>{"Enter"===e.key?(e.preventDefault(),E.current=!0,I()):"Escape"===e.key&&(e.preventDefault(),E.current=!0,C(!1))},[I]),L=u(()=>{if(E.current){E.current=!1;return}I()},[I]);return /*#__PURE__*/r("div",{ref:D,className:"relative h-full w-full",children:/*#__PURE__*/n("div",{className:"absolute right-0 h-0 w-full",style:{top:`${k}%`},children:[!F||c?/*#__PURE__*/n("button",{type:"button",disabled:c||!Number.isFinite(e),className:`${a?"pointer-events-none":"pointer-events-auto"} absolute right-7 ${R} z-[8] flex h-6 appearance-none items-center justify-center rounded-[var(--radius-control)] border-0 bg-secondary px-2 text-xs text-foreground`,style:zC,onClick:A,children:[s," ",M,d]}):/*#__PURE__*/n("div",{className:`pointer-events-auto absolute right-7 ${R} z-[8] flex h-6 items-center justify-between bg-secondary px-2 text-xs text-foreground`,style:zC,children:[s," ",/*#__PURE__*/r("input",{ref:z,type:"number","aria-label":`${s}${d}门限值`,defaultValue:M,min:y,max:w,step:"any",className:"h-auto w-14 border-none bg-transparent p-0 text-center outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",style:zC,onKeyDown:P,onBlur:L}),/*#__PURE__*/r("div",{className:"flex items-center",children:d})]}),/*#__PURE__*/r("div",{className:"absolute right-0 top-[-0.5px] z-[8] h-0 w-full border-b border-dashed",style:zD})]})})},zT=zE,zR=rl.Limit,zA=10,zI=e=>{let t=Math.round(100*e)/100;return 0===t?0:t},zP=({id:e})=>{let{state:{limit:t,segments:n,axisY:a,system:i},dispatch:o}=ae(),{show:l,active:s,disabled:c,value:d,onChange:p,unified:f}=t,[v,y]=a.range??ns,{totalPoints:w}=n,x=m(()=>l&&s,[l,s]),[k,S]=b(!1),M=g(null),F=g(null),C=g(null),D=g(!1),z=g(t);z.current=t;let N=u(e=>{p?.(f?Array.from({length:Math.max(1,n.length)},()=>e[0]):[...e])},[p,f,n.length]),E=u((e,t,r=!1)=>{let n;if(!Number.isFinite(t))return;let a=zI(t),i=f?0:e;if(z.current.value[i]===a)return;let l=f?[a]:((n=[...z.current.value])[i]=a,n),s={...z.current,value:l};z.current=s,o({payload:{limit:s}}),r&&N(l)},[o,N,f]),T=u(()=>{M.current=null,F.current=null,C.current=null,D.current=!1,S(!1),xt(e,zR)},[e]);if(h(()=>{(!x||c)&&T()},[x,c,T]),h(()=>{let t=()=>{if(x&&!c){if(D.current){let e=M.current,t=null!==e?z.current.value[e]:void 0;"number"==typeof t&&Number.isFinite(t)&&t!==C.current&&N(z.current.value)}T()}},r=wU(e,zR,t=>{if(!x||c||"number"!=typeof t?.left||!Number.isFinite(t.left)||"number"!=typeof t?.top||!Number.isFinite(t.top))return;let r=t.left,o=f?0:n.findIndex(e=>e.progress[0]<=r&&r<e.progress[1]);if(!Number.isFinite(o)||o<0)return void T();let l=y-v;if(!Number.isFinite(l)||0===l)return;let s=rg(a.unit)?ny(0):0,u=z.current.value[o];if("number"!=typeof u||!Number.isFinite(u))return void T();let d=(y-u-s)/l*100,h=Math.max(1.2,10/Math.max(1,i.height||1)*100);Math.abs(t.top-d)>h||!w7(e,zR)?T():(M.current=o,F.current=u,C.current=u,D.current=!0,S(!0))}),o=wV(e,zR,t),l=wK(e,zR,t),s=wJ(e,zR,(t,r,n)=>{if(!x||c)return;let i=M.current;if(null!==i&&w7(e,zR)&&"number"==typeof n?.top&&Number.isFinite(n.top)&&0!==n.top){let e=y-v;if(!Number.isFinite(e)||0===e)return;let t=F.current??z.current.value[i];if(!Number.isFinite(t))return;let r=t-n.top*e;F.current=r;let o=rg(a.unit)?ny(0):0,l=Math.min(v,y),s=Math.max(v,y),c=Math.min(s,Math.max(l,r+o));E(i,Math.min(s,Math.max(l,Math.round(c)))-o,!1)}});return()=>{r?.(),o?.(),l?.(),s?.()}},[x,c,n,e,E,N,T,f,v,y,a.unit,i.height]),!x)return null;if(f){let t=d[0];return /*#__PURE__*/r(yi,{className:"z-[7]",children:/*#__PURE__*/r("div",{className:"h-full w-full",children:"number"==typeof t&&Number.isFinite(t)?/*#__PURE__*/r(zE,{id:e,value:t,onChange:e=>E(0,e,!0),dragging:k}):null})})}return /*#__PURE__*/r(yi,{className:"z-[7]",children:n?.map((t,n)=>{let a=d[n],i="number"==typeof a&&Number.isFinite(a);return /*#__PURE__*/r("div",{style:{width:`${100*t.point/w}%`},className:"h-full w-[30%]",children:i?/*#__PURE__*/r(zE,{id:e,value:a,onChange:e=>E(n,e,!0),dragging:k},t.index):null},t.index)})})},zL=zP,zO=rl.Markers,zq=6,z$=8,z_=e=>{let{id:t,markers:r,display:n,fixed:a,readonly:i,onCreateMarker:o,onDeleteMarker:l,onUpdateMarker:s,onToggleSelect:c,onHover:d,onResetHover:p}=e,f=g({isDown:null,dragStart:null,isHover:"",hoverId:null}),m=u(()=>document.getElementById(wW(t))??document.getElementById(t),[t]),b=u(e=>{if(!e||!r||0===r.length)return null;let{left:t}=e;if(void 0===t)return null;let n=m();if(!n)return null;let{width:a}=n.getBoundingClientRect();for(let e=0;e<r.length;e+=1){let n=r[e];if(n&&Math.abs(t-n.left)*a/100<=6)return{...n,index:e}}return null},[m,r]),v=u(e=>{let t=m();if(!t)return"";let n=t.getBoundingClientRect().width,a="";for(let t=0;t<r.length;t+=1){let i=r[t];if(i&&Math.abs(e.left-i.left)*n/100<=8){a={...i,index:t};break}}return a},[m,r]);return h(()=>{if(i)return;let e=wY(t,zO,(e,t)=>{if(n&&void 0!==t.left){let e=v({left:t.left}),r="object"==typeof e?e.id:null;if(f.current.hoverId===r){f.current.isHover=e;return}f.current.isHover=e,f.current.hoverId=r,d({left:t.left})}}),r=wJ(t,zO,(e,r)=>{let{isDown:i}=f.current;n&&i&&w7(t,zO)&&!a&&s(i.id,{left:r.left,top:r.top})}),u=wU(t,zO,e=>{if(!n)return;let t=b(e)||("object"==typeof f.current.isHover?f.current.isHover:null);t&&!a&&(f.current.isDown=t)}),h=wK(t,zO,()=>{n&&(f.current.isDown=null,xt(t,zO))}),m=wV(t,zO,()=>{if(!n)return;let e=null!==f.current.hoverId;f.current.isDown=null,f.current.isHover="",f.current.hoverId=null,xt(t,zO),e&&p()}),g=w1(t,zO,(e,r)=>{if(!n||!w7(t,zO))return;let a=b(r)||("object"==typeof f.current.isHover?f.current.isHover:null);a?.id&&c(a.id)}),y=wX(t,zO,(e,r)=>{if(!n||!w7(t,zO)||void 0===r.left)return!1;let a=v({left:r.left});return a&&"object"==typeof a&&a.id?l(a.id):o({left:r.left}),!0});return()=>{e?.(),r?.(),u?.(),h?.(),m?.(),g?.(),y?.()}},[t,n,r,a,i,o,l,s,c,d,p,b,v]),{isDown:f.current.isDown}},zj=t0("marker"),zH=e=>Cn(e);function zB(e,t,r){let{needsMaxPeak:n=!1,needsTopPeaks:a=!1}=r||{},i=null,o=null;try{let t=tO(e).getAllRawData()[t3];if(t?.peaks?.peaks&&Array.isArray(t.peaks.peaks)){let e=t.peaks.peaks;return n&&e.length>0&&(i=e[0]),a&&(o=e),{maxPeak:i,topPeaks:o}}}catch(e){console.warn("[useMarkers] Failed to get precomputed peaks:",e)}return n&&(i=Cf(t)),a&&(o=Cg(t,2)),{maxPeak:i,topPeaks:o}}let zW=e=>{let{id:t,globalID:r,onChange:n}=e,[a,i]=b({markers:[],colorIndex:0,isDown:null,isHover:"",peak:null,hasPeak:!1}),o=g(new Float32Array),l=u((e,t)=>{let{axisY:{unit:n},axisX:{frequencyFormat:a}}=Cn(r),i=e.left,{peak:l}=e,s=t?.data??o.current;s&&0!==s.length||(s=tO(r).getAllRawData()[t3]),o.current=s;let c=Cp({left:i,globalID:r}),{outsideLeft:u,multiple:d}=c,{insideLeft:h}=c,p=s.length,f=Math.floor(p*h/100);if(100===h&&(f=p-1),"mainSecondary"===e.peakTracking&&"number"==typeof e.peakRank){let n=t?.topPeaks;n||(n=zB(r,s,{needsTopPeaks:!0}).topPeaks);let a=n?.[e.peakRank];a&&(h=((f=a.index)+.5)*100/p)}else if(l){let e=t?.maxPeak;e||(e=zB(r,s,{needsMaxPeak:!0}).maxPeak),e&&(h=((f=e.index)+.5)*100/p)}let m=parseFloat(a(i=u+h/d)),g=s[f];return void 0===g||Number.isNaN(g)||(e.level=parseFloat(nI(n,g).toFixed(1))),{...e,left:i,frequency:m}},[r]),s=u((e,t=!1)=>{0!==o.current.length&&i(a=>{let{marker:{maxCount:i,fifo:o}}=Cn(r),s=Ci(a.markers,[e],i,o);if(!s.allowed)return a;let c=rV(),u=zj[a.colorIndex%20],d={...l({...e,id:c,color:u,select:!1,peak:!1,frequency:0,hover:!1}),id:c,color:u,select:!t,peak:!1,hover:!1},h=[...t?s.keptMarkers:s.keptMarkers.map(e=>({...e,select:!1})),d];return t||setTimeout(()=>{n?.(ro.Add,h)},0),{...a,markers:h,colorIndex:a.colorIndex+1}})},[l,n]),c=u(({event:e,marker:t,frequencies:a,silent:s=!1})=>{i(i=>{let c=[...i.markers],u=ro.Update,{id:d,peak:h,select:p,frequency:f,left:m,top:g}=t||{},b=m;if(e===ro.Update&&void 0!==f){let e=Cn(r),t=(e?.segments||{totalPoints:0})[0];if(t&&d){let{start:e,stop:r}=t,n=r-e;if(void 0!==n&&f<r&&f>e)b=(f-e)*100/n;else{let e=c.findIndex(e=>e.id===d);-1!==e&&(c.splice(e,1),u=ro.Del)}}}if(e===ro.Add&&a?.length){let e=Cn(r),t=(e?.segments||{totalPoints:0})[0];if(t){let{start:e,stop:r}=t,n=r-e;if(void 0!==n){let t=[];for(let i=0;i<a.length;i+=1){let o=a[i];o>=e&&o<=r&&t.push((o-e)*100/n)}t.length>0&&(a=t)}}}if(e===ro.Add&&a?.length){let{marker:{maxCount:e,fifo:t}}=Cn(r),n=Ci(c,a,e,t);if(n.allowed&&n.itemsToAdd.length>0){c=n.keptMarkers.map(e=>({...e,select:!1}));let e=n.itemsToAdd;for(let t=0;t<e.length;t+=1){let r=rV(),n=zj[(i.colorIndex+t)%20],a=!1;if(o.current&&o.current.length>0){let r=-1/0,n=0;for(let e=0;e<o.current.length;e++)o.current[e]>r&&(r=o.current[e],n=e);Math.abs(Math.floor(o.current.length*e[t]/100)-n)<=Math.max(1,Math.floor(.01*o.current.length))&&(a=!0)}let s=l({left:e[t],id:r,color:n,select:!1,peak:a,frequency:0,hover:!1});c.push({...s,id:r,color:n,select:t===e.length-1,peak:a,hover:!1})}u=ro.Add}}if(e===ro.Del){let e=c.findIndex(e=>e.id===d);-1!==e&&(c.splice(e,1),u=ro.Del)}return e===ro.Clear&&(c=[],u=ro.Clear),e===ro.Update&&(u=ro.Update,c=c.map(e=>(void 0!==h&&(e.peak=!1),void 0!==p&&e.id!==d&&(e.select=!1),e.id===d&&(void 0!==b&&(e=l({...e,left:b,top:g||e.top})),void 0!==p&&(e.select=p),void 0!==h&&(e.peak=h,h&&void 0===p&&(e.select=!0))),e.peak,e))),s||setTimeout(()=>{n?.(u,c)},0),{...i,markers:c,colorIndex:e===ro.Clear?0:i.colorIndex}})},[l,n]),d=u(()=>{i(e=>({...e,markers:[],colorIndex:0})),setTimeout(()=>{n?.(ro.Clear,[])},0)},[n]),h=u(e=>{e&&(o.current=e),i(t=>{if(0===t.markers.length)return t;let a=t.markers.some(e=>e.peak&&"mainSecondary"!==e.peakTracking),i=t.markers.some(e=>"mainSecondary"===e.peakTracking&&"number"==typeof e.peakRank),s=e??o.current??new Float32Array,{maxPeak:c,topPeaks:u}=zB(r,s,{needsMaxPeak:a,needsTopPeaks:i}),d=t.markers.map(e=>l(e,{data:s,maxPeak:c,topPeaks:u}));return d.some((e,r)=>{let n=t.markers[r];return n&&(Math.abs(e.frequency-n.frequency)>.001||Math.abs(e.level-n.level)>.001)})&&setTimeout(()=>{n?.(ro.Update,d)},0),{...t,markers:d}})},[l,n]),p=u(e=>{let a=document.getElementById(t);if(!a)return"";let o=a.getBoundingClientRect(),{zoom:{interval:{start:l,end:s}},segments:c}=Cn(r),u=c.totalPoints/(s-l+1),d=o.width*u/100,h="",p=!1;return i(t=>{let r=t.markers.map((t,r)=>{let n=Math.abs(e.left-t.left)*d<=16;return t.hover!==n&&(p=!0),n&&(h={...t,index:r}),{...t,hover:n}});return p&&setTimeout(()=>{n?.(ro.Update,r)},0),{...t,markers:r,isHover:h}}),h},[t,r,n]),f=u(()=>{i(e=>{let t=!1,r=e.markers.map(e=>(e.hover&&(t=!0),{...e,hover:!1}));return t&&setTimeout(()=>{n?.(ro.Update,r)},0),{...e,markers:r,isHover:""}})},[n]),m=g(null),v=g(null),y=u(()=>{i(e=>{if(e.markers.some(e=>"mainSecondary"===e.peakTracking)){let t=e.markers.filter(e=>"mainSecondary"!==e.peakTracking),r=m.current;if(r){let e=t.findIndex(e=>e.id===r);-1!==e&&(t[e]={...t[e],select:!0})}return m.current=null,setTimeout(()=>{n?.(ro.Update,t)},0),{...e,markers:t}}let{marker:t}=Cn(r),a=t.maxCount,i=t.fifo,s=Ci(e.markers,[0,1],a,i);if(!s.allowed||s.itemsToAdd.length<2)return e;m.current=e.markers.find(e=>e.select)?.id??null;let c=[],u=e.colorIndex,d=e=>{let t=rV(),r=zj[u%20];u+=1;let n=l({left:50,id:t,color:r,select:!1,peak:!0,peakTracking:"mainSecondary",peakRank:e,frequency:0,hover:!1});c.push({...n,id:t,color:r,select:!1,peak:!0,peakTracking:"mainSecondary",peakRank:e,hover:!1})};d(0),d(1);let h=[...s.keptMarkers,...c.map(e=>({...e,select:!1}))].map(e=>l(e,{data:o.current}));return setTimeout(()=>{n?.(ro.Update,h)},0),{...e,markers:h,colorIndex:u}})},[l,r,n]),w=u(()=>{i(e=>{if(e.markers.some(e=>"mainSecondary"===e.peakTracking&&0===e.peakRank)){let t=e.markers.filter(e=>"mainSecondary"!==e.peakTracking||0!==e.peakRank),r=v.current;if(r){let e=t.findIndex(e=>e.id===r);-1!==e&&(t[e]={...t[e],select:!0})}return v.current=null,setTimeout(()=>{n?.(ro.Update,t)},0),{...e,markers:t}}let{marker:t}=Cn(r),a=t.maxCount,i=t.fifo,s=Ci(e.markers,[0],a,i);if(!s.allowed||s.itemsToAdd.length<1)return e;v.current=e.markers.find(e=>e.select)?.id??null;let c=rV(),u=zj[e.colorIndex%20],d={...l({left:50,id:c,color:u,select:!1,peak:!0,peakTracking:"mainSecondary",peakRank:0,frequency:0,hover:!1}),id:c,color:u,select:!1,peak:!0,peakTracking:"mainSecondary",peakRank:0,hover:!1},h=[...s.keptMarkers,d].map(e=>l(e,{data:o.current}));return setTimeout(()=>{n?.(ro.Update,h)},0),{...e,markers:h,colorIndex:e.colorIndex+1}})},[l,r,n]),x=u((e,t)=>{i(a=>{let i=a.markers.find(e=>e.id===t);if(!i)return a;let s=tO(r).getAllRawData()[t3];if(!s||s.length<3)return a;o.current=s;let{zoom:c,segments:u}=Cn(r),d=s.length,h=u.totalPoints||d,p=c.interval.end-c.interval.start+1,f=(i.left*h/100-c.interval.start)*100/p,m=Math.floor(d*f/100);100===f&&(m=d-1);let g=-1;if(s.peaks?.peaks&&Array.isArray(s.peaks.peaks)){let t=s.peaks.peaks;if("left"===e){let e=1/0;for(let r of t)if(r.index<m){let t=m-r.index;t<e&&(e=t,g=r.index)}}else{let e=1/0;for(let r of t)if(r.index>m){let t=r.index-m;t<e&&(e=t,g=r.index)}}}if(-1===g){let t=e=>{if(e<=0||e>=d-1)return!1;let t=s[e];return t>s[e-1]&&t>s[e+1]};if("left"===e){for(let e=m-1;e>0;e-=1)if(t(e)){g=e;break}}else for(let e=m+1;e<d-1;e+=1)if(t(e)){g=e;break}}if(-1===g)return a;let b=((g+.5)*100/d*p/100+c.interval.start)*(100/h),v=a.markers.map(e=>{if(e.id!==t)return{...e,select:!1};let{peakTracking:r,peakRank:n,...a}=e;return l({...a,left:b,select:!0,peak:!1},{data:s})});return setTimeout(()=>{n?.(ro.Update,v)},0),{...a,markers:v}})},[l,r,n]),k=u(e=>{i(t=>{if(!t.markers.find(t=>t.id===e))return t;let a=tO(r).getAllRawData()[t3];if(!a||a.length<1)return t;o.current=a;let{zoom:i,segments:s}=Cn(r),c=a.length,u=s.totalPoints||c,d=0,h=a[0];for(let e=1;e<c;e+=1)a[e]>h&&(h=a[e],d=e);let p=(100*d/(c-1)*(i.interval.end-i.interval.start+1)/100+i.interval.start)*(100/u),f=t.markers.map(t=>{if(t.id!==e)return{...t,select:!1};let{peakTracking:r,peakRank:n,...i}=t;return l({...i,left:p,select:!0,peak:!1},{data:a})});return setTimeout(()=>{n?.(ro.Update,f)},0),{...t,markers:f}})},[l,r,n]),S=u(e=>{i(t=>{if(!t.markers.find(t=>t.id===e))return t;let a=tO(r).getAllRawData()[t3];if(!a||a.length<3)return t;o.current=a;let{zoom:i,segments:s}=Cn(r),c=a.length,u=s.totalPoints||c,d=0,h=a[0];for(let e=1;e<c;e+=1)a[e]>h&&(h=a[e],d=e);let p=Math.max(2,Math.floor(.1*c)),f=-1,m=-1/0;for(let e=1;e<c-1;e+=1){if(Math.abs(e-d)<p)continue;let t=a[e],r=a[e-1],n=a[e+1];t>r&&t>n&&t>m&&(m=t,f=e)}if(-1===f)return t;let g=(100*f/(c-1)*(i.interval.end-i.interval.start+1)/100+i.interval.start)*(100/u),b=t.markers.map(t=>{if(t.id!==e)return{...t,select:!1};let{peakTracking:r,peakRank:n,...i}=t;return l({...i,left:g,select:!0,peak:!1},{data:a})});return setTimeout(()=>{n?.(ro.Update,b)},0),{...t,markers:b}})},[l,r,n]),M=u((e,t)=>{i(a=>{let i,s=a.markers.find(e=>e.id===t);if(!s)return a;let c=tO(r).getAllRawData()[t3];if(!c||c.length<2)return a;o.current=c;let{zoom:u,segments:d}=Cn(r),h=c.length,p=d.totalPoints||h,f=u.interval.end-u.interval.start+1,m=Math.round((h-1)*((s.left*p/100-u.interval.start)*100/f)/100);if((i="left"===e?Math.max(0,m-1):Math.min(h-1,m+1))===m)return a;let g=(100*i/(h-1)*f/100+u.interval.start)*(100/p),b=a.markers.map(e=>{if(e.id!==t)return{...e,select:!1};let{peakTracking:r,peakRank:n,...a}=e;return l({...a,left:g,select:!0,peak:!1},{data:c})});return setTimeout(()=>{n?.(ro.Update,b)},0),{...a,markers:b}})},[l,r,n]),F="#F98116",C="#AA74E8",D=u(()=>{i(e=>{let t,a=tO(r).getAllRawData()[t3];if(!a||a.length<1)return e;o.current=a;let{zoom:i,segments:s}=Cn(r),c=a.length,u=s.totalPoints||c,d=0,h=a[0];for(let e=1;e<c;e+=1)a[e]>h&&(h=a[e],d=e);let p=(100*d/(c-1)*(i.interval.end-i.interval.start+1)/100+i.interval.start)*(100/u),f=e.markers.find(e=>e.color===F);if(f)t=e.markers.map(e=>e.id===f.id?l({...e,left:p},{data:a}):e);else{let{marker:n}=Cn(r),i=n.maxCount,o=n.fifo,s=Ci(e.markers,[p],i,o);if(!s.allowed)return e;let c=l({left:p,id:rV(),color:F,select:!1,peak:!1,hover:!1},{data:a});t=[...s.keptMarkers,c]}return setTimeout(()=>{n?.(ro.Update,t)},0),{...e,markers:t}})},[l,r,n]),z=u(()=>{i(e=>{let t,a=tO(r).getAllRawData()[t3];if(!a||a.length<3)return e;o.current=a;let{zoom:i,segments:s}=Cn(r),c=a.length,u=s.totalPoints||c,d=0,h=a[0];for(let e=1;e<c;e+=1)a[e]>h&&(h=a[e],d=e);let p=Math.max(2,Math.floor(.1*c)),f=-1,m=-1/0;for(let e=1;e<c-1;e+=1){if(Math.abs(e-d)<p)continue;let t=a[e],r=a[e-1],n=a[e+1];t>r&&t>n&&t>m&&(m=t,f=e)}if(-1===f)return e;let g=(100*f/(c-1)*(i.interval.end-i.interval.start+1)/100+i.interval.start)*(100/u),b=e.markers.find(e=>e.color===C);if(b)t=e.markers.map(e=>e.id===b.id?l({...e,left:g},{data:a}):e);else{let{marker:n}=Cn(r),i=n.maxCount,o=n.fifo,s=Ci(e.markers,[g],i,o);if(!s.allowed)return e;let c=l({left:g,id:rV(),color:C,select:!1,peak:!1,hover:!1},{data:a});t=[...s.keptMarkers,c]}return setTimeout(()=>{n?.(ro.Update,t)},0),{...e,markers:t}})},[l,r,n]);return{markers:a.markers,isDown:a.isDown,isHover:a.isHover,createMarker:s,updateMarkerAttribute:c,resetMarkers:d,updateByData:h,handleHover:p,resetHover:f,toggleMainSecondaryPeaks:y,toggleMainPeak:w,moveToAdjacentPeak:x,findMainPeak:k,findSecondaryPeak:S,moveToStep:M,createMainPeakMarker:D,createSecondaryPeakMarker:z,setState:i}},zG=e=>{let{top:a,left:i,color:o="transparent",x:l=!0,y:s=!0,lineWidth:c=1}=e;return /*#__PURE__*/n(t,{children:[l&&/*#__PURE__*/r("div",{className:"absolute left-0 top-[-200%] z-[5] w-full border-t border-dashed",style:{top:a,borderColor:o,borderTopWidth:`${c}px`}}),s&&/*#__PURE__*/r("div",{className:"absolute left-[-200%] top-0 z-[5] h-full border-l border-dashed",style:{left:i,borderColor:o,borderLeftWidth:`${c}px`}})]})},zY=zG,zU=({marker:e})=>{let{state:{axisX:t,axisY:a}}=ae(),i=g(null),o=g(null),[l,s]=b(0),[c,u]=b(0);h(()=>{let e=()=>{i.current&&s(i.current.offsetWidth),o.current&&u(o.current.offsetWidth)};e();let t=new ResizeObserver(()=>{e()});return i.current&&t.observe(i.current),o.current&&t.observe(o.current),()=>{t.disconnect()}},[e.frequency,e.level]);let d=m(()=>{let t=e.left/100*l,r=l>0&&c>0&&t+c+10>l-20;return{left:`${e.left}%`,color:e.color,opacity:e.hover?1:.68,fontWeight:e.hover?500:"normal",transform:r?"translateX(-100%)":"translateX(0)",marginLeft:r?"-10px":"10px"}},[e.left,e.hover,e.color,l,c]);return /*#__PURE__*/n("div",{ref:i,className:"absolute left-0 top-0 h-full w-full",id:e.id,title:`${e.frequency}${t.unit} / ${e.level}${a.unit}`,children:[/*#__PURE__*/n("div",{ref:o,className:"absolute top-[10px] z-[5] whitespace-nowrap text-[12px] leading-4 transition-[opacity,font-weight,transform,margin-left,color]",style:d,children:[/*#__PURE__*/n("div",{children:[e.frequency,t.unit]}),void 0!==e.level&&/*#__PURE__*/n("div",{children:[e.level,a.unit]})]}),/*#__PURE__*/r(zG,{x:!1,left:`${e.left}%`,top:`${e.top}%`,color:e.color,lineWidth:e.select?2:1})]},e.id)},zX=/*#__PURE__*/a.memo(zU),zK=({id:e})=>{let{state:{marker:t,globalID:n}}=ae(),{enabled:a,visible:i,fixed:o,readonly:l,maxCount:s,onChange:c}=t,d=u((e,t)=>{c?.(e,t),Cs(n)({count:t.length,maxCount:s});let r=t.find(e=>e.select)?.id??null;Cc(n)({selectedId:r})},[c,n,s]),p=m(()=>a&&i,[a,i,t.enabled,t.visible]),f=m(()=>wW(e),[e]),{markers:b,createMarker:v,updateMarkerAttribute:y,resetMarkers:w,updateByData:x,handleHover:k,resetHover:S,toggleMainSecondaryPeaks:M,toggleMainPeak:F,moveToAdjacentPeak:C,findMainPeak:D,findSecondaryPeak:z,createMainPeakMarker:N,createSecondaryPeakMarker:E}=zW({id:e,globalID:n,display:i,onChange:d});h(()=>{if(!n||!f||!p||l)return;let e=nP(n,f,e=>{let t=e.key.toLowerCase();if(!["a","d","w","s"].includes(t))return;if("w"===t){if(e.repeat)return;e.preventDefault(),N();return}if("s"===t){if(e.repeat)return;e.preventDefault(),E();return}let r=b.find(e=>e.select)?.id;r&&(e.preventDefault(),C("a"===t?"left":"right",r))});return()=>{e?.()}},[f,n,b,C,p,l,N,E]);let T=u(e=>{let t=b.find(t=>t.id===e),r=!t?.select;y({event:ro.Update,marker:{id:e,select:r}})},[b,y]),R=u((e,t)=>{y({event:ro.Update,marker:{id:e,left:t.left,top:t.top}})},[y]);z_({id:e,markers:b,display:p,fixed:o,readonly:l,onCreateMarker:v,onDeleteMarker:u(e=>{y({event:ro.Del,marker:{id:e}})},[y]),onUpdateMarker:R,onToggleSelect:T,onHover:k,onResetHover:S});let A=g(null);return(h(()=>{n&&e&&tq(e,"Marker",()=>{let{realData:e}=tO(n).getAllRawData();A.current=e??null,x(e)})},[n,e,x]),h(()=>{n&&e&&Co(n,e=>{y(e)})},[n,e,y,w]),h(()=>{n&&e&&Cu(n,e=>{if(e?.type){if("main-secondary-peaks"===e.type)return void M();if("main-peak"===e.type)return void F();if("left-peak"===e.type)return void C("left",e.selectedId);if("right-peak"===e.type)return void C("right",e.selectedId);if("find-main-peak"===e.type)return void D(e.selectedId);if("find-secondary-peak"===e.type)return void z(e.selectedId);if("create-main-peak"===e.type)return void N();if("create-secondary-peak"===e.type)return void E();if("clear-all"===e.type)return void w()}})},[n,e,C,M,F,D,z,N,E,w]),p)?/*#__PURE__*/r(yi,{className:"z-[5]",children:b.map(e=>/*#__PURE__*/r(zX,{marker:e},e.id))}):null},zV=zK,zQ=({segments:e,index:t,frequency:r,bandwidth:n})=>{if(!r||!n||!e||!e[t])return{left:0,width:0};let a=e[t],i=e.reduce((e,t)=>e+t.point,0),{left:o,width:l}=rP({startFreq:r-n/2e3,stopFreq:r+n/2e3},a),s=e.slice(0,t).reduce((e,t)=>e+t.point/i*100,0),c=a.point/i*100;return{left:s+o/100*c,width:l/100*c}};function zZ(){let{state:{scope:e,segments:t},dispatch:r}=ae();return u(n=>{let{frequency:a,bandwidth:i,index:o=0}=n,{left:l,width:s}=zQ({segments:t,index:o,frequency:a,bandwidth:i});r({payload:{scope:{...e,left:l,width:s}}})},[t,e])}let zJ=()=>{let{state:{scope:{show:e,left:t,width:n}}}=ae();return e?/*#__PURE__*/r(yi,{children:/*#__PURE__*/r("div",{className:"relative flex h-full w-0 box-border border-y border-dashed border-chart-grid bg-chart-surface opacity-50",style:{width:`${n}%`,left:`${t}%`}})}):null},z0=zJ,z1=/*#__PURE__*/c(({style:e,signalPositions:t,activeSignalKey:n,segmentIndex:a})=>/*#__PURE__*/r("div",{className:"absolute h-full box-border",style:e,children:t.map(({item:e,key:t,position:i,color:o,tooltip:l})=>{let s=n===t,c={left:i.left,width:i.width,minWidth:"1px",backgroundColor:o,height:s?"100%":"8px",opacity:s?.5:1};return /*#__PURE__*/r("div",{className:"pointer-events-none absolute top-0 flex min-w-px items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap text-center text-xs text-foreground","data-signal-active":s?"true":"false","data-signal-key":t,"data-signal-source":kA(e),"data-testid":"signal-annotation",style:c,title:l},`segment-${a}-signal-${t}`)})})),z2=z1;function z5(){let{state:e,dispatch:t}=ae(),r=g(e.globalID),n=g(e.signal),a=g({});return h(()=>{r.current=e.globalID,n.current=e.signal},[e.globalID,e.signal]),h(()=>{if(!e.globalID)return;let r=a.current.station,i=a.current.simple;void 0!==r&&(Se(e.globalID,r),a.current.station=void 0),void 0!==i&&(t({payload:{signal:{...n.current,data:i}}}),a.current.simple=void 0)},[t,e.globalID]),{updateSignalData:u(e=>{let{type:i,data:o}=e;if(Array.isArray(o)){if("station"===i){if(!r.current){a.current.station=o;return}Se(r.current,o)}else if("simple"===i){if(!r.current){a.current.simple=o;return}t({payload:{signal:{...n.current,data:o}}})}}},[t])}}let z4=({id:e,show:t=!0,display:n=!0})=>{let a=at(e=>e.segments),i=at(e=>e.zoom.style),o=at(e=>e.signal),l=xo(e),s=l?.coord.left,c=St({respectVisibility:!0}),u=o.show&&o.display&&n,d=!!l,h=m(()=>d&&"number"==typeof s?rL(s,a):{segmentIndex:-1,pointIndex:-1},[d,a,s]),p=m(()=>d?rO(a,h):0/0,[h,d,a]),f=m(()=>k1({segments:a,signalItems:c}),[a,c]),g=m(()=>k2({segmentData:f,isCursorActive:d,currentFrequency:p,currentPosition:h}),[p,h,d,f]);return t&&u?/*#__PURE__*/r("div",{className:"pointer-events-none absolute inset-0 z-[4] flex h-full w-full select-none items-center overflow-hidden bg-transparent",children:/*#__PURE__*/r("div",{className:"absolute right-0 top-0 flex h-full w-full",style:i??void 0,children:f.map(({segmentIndex:e,signalPositions:t,style:n})=>/*#__PURE__*/r(z1,{style:n,signalPositions:t,activeSignalKey:h.segmentIndex===e?g:void 0,segmentIndex:e},`segment-${e}`))})}):null},z3=z4,z6=()=>{let{state:{stripe:e},dispatch:t}=useStore(),{display:r,show:n}=e,a=useCallback(r=>{t({payload:{stripe:{...e,display:!!r}}})},[e]);return n?/*#__PURE__*/_jsx(IconBox,{active:r,tone:"primary",onClick:()=>{a(!r)},title:"频谱框选",children:/*#__PURE__*/_jsxs("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:[/*#__PURE__*/_jsx("path",{d:"M835.4 757.7h-69.9v-51h18.9v-18.8h51zM713.1 757.7h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0H220v-51h83.9v51zM167.5 757.7H97.6v-69.8h51v18.8h18.9zM148.6 637.5h-51V557h51v80.5z m0-130.7h-51v-80.5h51v80.5z m0-130.8h-51v-80.5h51V376zM148.6 245.2h-51v-69.9h69.9v51h-18.9zM713.1 226.3h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0h-83.9v-51h83.9v51z m-136.4 0H220v-51h83.9v51zM835.4 245.2h-51v-18.9h-18.9v-51h69.9zM835.4 637.5h-51V557h51v80.5z m0-130.7h-51v-80.5h51v80.5z m0-130.8h-51v-80.5h51V376z",fill:"currentColor"}),/*#__PURE__*/_jsx("path",{d:"M784.4 615.7h51v233h-51z",fill:"currentColor"}),/*#__PURE__*/_jsx("path",{d:"M693.4 706.7h233v51h-233z",fill:"currentColor"})]})}):null},z8=null,z9=rl.Stripe,z7=1.5,Ne=e=>Math.max(0,Math.min(100,e)),Nt=({cursor:e,left:t,right:r})=>{let n=Math.abs(e-t),a=Math.abs(e-r);return n<=1.5?"left":a<=1.5?"right":e>t&&e<r?"move":n<=a?"left":"right"},Nr=({id:e})=>{let{state:{stripe:t,axisX:{frequencyFormat:n,unit:a}},dispatch:i}=ae(),{show:o,display:l,left:s,right:c,defaultLeft:d,defaultRight:p,onChange:f}=t,m=g(t),b=g(null),v=g(n),y=g(a),w=g(f);h(()=>{m.current=t,v.current=n,y.current=a,w.current=f},[t,n,a,f]),h(()=>{i({payload:{stripe:{...t,left:d,right:p}}})},[d,p]);let x=u(e=>{let t=b.current;if(!t||!Number.isFinite(e?.left))return;let r=Ne(e.left),n=m.current,{mode:a,startCursor:o,startLeft:l,startRight:s}=t,c=l,u=s;if("move"===a){let e=s-l;(u=(c=Ne(l+(r-o)))+e)>100&&(c=Math.max(0,(u=100)-e))}"left"===a&&(c=Math.min(r,s)),"right"===a&&(u=Math.max(r,l)),i({payload:{stripe:{...n,left:c,right:u}}})},[i]),k=u(()=>{let{left:e,right:t}=m.current,r=Math.round(10*e)/10,n=Math.round(10*t)/10,a=v.current?.(r)??"",i=v.current?.(n)??"",o=n-r,l=Number(i)-Number(a);w.current({left:r,right:n,width:o,start:a,end:i,bandwidth:l,unit:y.current})},[]);return(h(()=>{wU(e,z9,t=>{if(!o||!l||!Number.isFinite(t?.left))return;let r=m.current,n=Ne(t.left);b.current={mode:Nt({cursor:n,left:r.left,right:r.right}),startCursor:n,startLeft:r.left,startRight:r.right},w7(e,z9)}),wK(e,z9,()=>{o&&l&&b.current&&(b.current=null,xt(e,z9),k())}),wV(e,z9,()=>{o&&l&&b.current&&(b.current=null,xt(e,z9),k())}),wY(e,z9,(e,t)=>{o&&l&&b.current&&x(t)})},[e,o,l,x,k]),o&&s-c!=0&&l)?/*#__PURE__*/r(yi,{className:"z-[3]",children:/*#__PURE__*/r("div",{className:"relative flex h-full w-px box-border border-x-2 border-dashed border-y-0 border-chart-grid-strong bg-chart-surface opacity-40",style:{left:`${s}%`,width:`${c-s}%`}})}):null},Nn=Nr;function Na(){let{dispatch:e,store:t}=ar();return u(r=>{let n=t.getState().band,a=r9(r,n,"replace");a!==n&&e({payload:{band:a}})},[e,t])}let Ni=()=>{let e=at(e=>e.band),t=at(e=>e.segments),n=m(()=>kp(e,t),[e,t]);return n.length?/*#__PURE__*/r(yi,{children:n.map(t=>/*#__PURE__*/r("div",{"data-testid":"spectrum-band","data-band-kind":e.kind,"data-band-key":t.key,className:"absolute flex h-full w-0 box-border border-y border-dashed opacity-50",style:{left:`${t.left}%`,width:`${t.width}%`,backgroundColor:e.color?`${e.color}40`:void 0,borderColor:e.color}},t.key))}):null},No=Ni,Nl=10,Ns=300,Nc=300,Nu=30,Nd=60,Nh=()=>({mode:"idle",startX:0,startY:0,startTime:0,lastX:0,lastY:0,startCoord:null,pinchBase:null}),Np=(e,t,r)=>Math.max(t,Math.min(e,r)),Nf=({id:e})=>{let{state:{zoom:t,segments:n,axisY:a,globalID:i},dispatch:o}=ae(),l=wW(e),s=g(null),c=g(Nh()),d=g(t),p=g(n.totalPoints),f=g(a),m=g(null);h(()=>{d.current=t},[t]),h(()=>{p.current=n.totalPoints},[n]),h(()=>{f.current=a},[a]);let b=u((e,t,r)=>({currentTarget:e,clientX:t,clientY:r}),[]),v=u(e=>{let t=Array.from(e.touches).map(e=>({x:e.clientX,y:e.clientY})),r=t.length,n=0,a=0,i=0;if(2===r){let[e,r]=t;n=Math.hypot(r.x-e.x,r.y-e.y),a=(e.x+r.x)/2,i=(e.y+r.y)/2}else 1===r&&(a=t[0].x,i=t[0].y);return{count:r,points:t,distance:n,midX:a,midY:i}},[]),y=u((e,t,r)=>{let n=b(e,t,r),a=wB(n);wQ(l)(),wY(l)(n,a)},[l,b]),w=u(e=>{let t=c.current.pinchBase,r=p.current;if(!t||t.distance<=0||e<=0)return;let n=e/t.distance;if(("x"===t.axisMode||"xy"===t.axisMode)&&d.current.show&&r){let e=SP({anchorPercent:t.anchorPercent,interval:t.interval,scale:1/n,totalPoints:r});o({payload:t=>t.zoom.interval.start===e.start&&t.zoom.interval.end===e.end?null:{zoom:{...t.zoom,interval:e,isScanSegmentsUpdateMagnify:!1}}})}("y"===t.axisMode||"xy"===t.axisMode)&&i&&(nB(i)(t.lastScale/n,t.yAnchorValue),t.lastScale=n)},[o,i]),x=g(w);x.current=w;let k=u(e=>{let t=s.current,r=c.current;if(t&&0!==e.touches.length){if(1===e.touches.length){let{clientX:n,clientY:a}=e.touches[0];r.mode="pending",r.startX=n,r.startY=a,r.startTime=Date.now(),r.lastX=n,r.lastY=a,r.startCoord=wB(b(t,n,a));return}if(2===e.touches.length){m.current?.flush(),r.mode="pinch",r.startTime=Date.now();let n=d.current,a=v(e),[i,o]=a.points,l=Math.abs(o.x-i.x),s=180*Math.atan2(Math.abs(o.y-i.y),l)/Math.PI,{start:c,end:u}=n.interval,h=wB(b(t,a.midX,a.midY)).left??0,p=t.getBoundingClientRect();if(p.height<=0||a.distance<=0){r.pinchBase=null;return}let[g,y]=f.current.realRange??[0,1],w=Np((a.midY-p.top)/p.height,0,1);r.pinchBase={distance:a.distance,lastScale:1,interval:{start:c,end:u},anchorPercent:Np(h,0,100),axisMode:s<30?"x":s>60?"y":"xy",yAnchorValue:y-w*(y-g),startPoints:a.points,pinchMoved:!1}}}},[v,b]),S=g(rW(e=>{if(!e||!("count"in e))return;let t=s.current,r=c.current;if(!t)return;let{count:n,points:a,distance:i}=e;if(2===n){if("pinch"===r.mode&&r.pinchBase){let e=r.pinchBase;if(!e.pinchMoved){let t={x:(a[0].x+a[1].x)/2,y:(a[0].y+a[1].y)/2},r={x:(e.startPoints[0].x+e.startPoints[1].x)/2,y:(e.startPoints[0].y+e.startPoints[1].y)/2};(Math.abs(i-e.distance)>10||Math.hypot(t.x-r.x,t.y-r.y)>10)&&(e.pinchMoved=!0)}x.current(i)}return}if(1!==n)return;let o=a[0];if("pending"===r.mode){let e=o.x-r.startX,t=o.y-r.startY;if(e*e+t*t<=100)return;r.mode="drag"}if("drag"!==r.mode)return;let u=t.getBoundingClientRect(),d={left:(o.x-r.lastX)/u.width,top:(o.y-r.lastY)/u.height},h=b(t,o.x,o.y),p=wB(h);wY(l)(h,p),wJ(l)(r.startCoord,p,d,!1),r.lastX=o.x,r.lastY=o.y})).current;m.current=S;let M=u(e=>{S(v(e))},[v,S]),F=u(e=>{S.flush();let t=s.current,r=c.current;if(!t)return;let n=e.changedTouches[0],a=n?.clientX??r.lastX,i=n?.clientY??r.lastY;if("pending"===r.mode){let e=Date.now()-r.startTime,n=a-r.startX,o=i-r.startY;n*n+o*o<=100&&e<=300&&y(t,a,i)}if(1===e.touches.length){let n=e.touches[0],a="pinch"===r.mode&&null!==r.pinchBase&&!r.pinchBase.pinchMoved&&Date.now()-r.startTime<=300;r.mode=a?"pinch":"drag",r.startX=n.clientX,r.startY=n.clientY,r.lastX=n.clientX,r.lastY=n.clientY,a||(r.pinchBase=null),r.startCoord=wB(b(t,n.clientX,n.clientY))}else 0===e.touches.length&&("pinch"===r.mode&&r.pinchBase&&!r.pinchBase.pinchMoved&&Date.now()-r.startTime<=300&&wV(l)(),r.mode="idle",r.pinchBase=null,wK(l)())},[l,y,b,S]),C=u(()=>{S.cancel();let e=c.current;e.mode="idle",e.pinchBase=null,wV(l)()},[l,S]),D=u(e=>{e.preventDefault()},[]);return h(()=>()=>{S.cancel(),wV(l)()},[l,S]),h(()=>{s.current&&(s.current.id=l)},[l]),/*#__PURE__*/r(yi,{className:"z-[5] pointer-events-auto",children:/*#__PURE__*/r("button",{ref:s,type:"button",className:iX("absolute right-0 top-0 h-full w-full appearance-none border-0 bg-transparent p-0 outline-none","touch-none select-none"),"aria-label":"Touch bus",onContextMenu:D,onTouchStart:k,onTouchMove:M,onTouchEnd:F,onTouchCancel:C})})},Nm=Nf,Ng=e=>{let{children:t,touch:a}=e,{state:{axisY:{autoranging:i},series:{enableLengthSyncFastMode:o},globalID:l}}=ae(),{id:s,chart:c,Chart:u}=iV({Render:FC,params:{autoranging:i,enableLengthSyncFastMode:o}});S$(s,rr.Spectrum);let d=Na(),p=zZ(),f=wx();return h(()=>{if(l&&c)return t$(l,e=>{c?.setDisabledClearRect(e)})},[l,c]),i3({moduleType:rr.Spectrum,chart:c,handleRender:(e,t)=>{t.updateSeries?.({data:e.data,extraData:e.extraData}),tq(s)()},eventHandlers:{autoranging:(e,t)=>{t.useRangeAutoFocus?.()},points:e=>{f(e.data)},[rn.Series]:(e,t)=>{t.setSeries?.(e)},band:e=>{d(e)},scope:e=>{p(e)}}}),/*#__PURE__*/n(yE,{children:[/*#__PURE__*/r(Db,{chart:c}),/*#__PURE__*/n(ST,{children:[/*#__PURE__*/r(FF,{}),/*#__PURE__*/r(u,{}),t,/*#__PURE__*/r(zw,{id:s}),/*#__PURE__*/r(zK,{id:s}),a?/*#__PURE__*/r(Nf,{id:s}):/*#__PURE__*/r(SC,{id:s}),/*#__PURE__*/r(zP,{id:s}),/*#__PURE__*/r(Sk,{id:s,type:rr.Spectrum}),/*#__PURE__*/r(z4,{id:s}),/*#__PURE__*/r(DR,{id:s}),/*#__PURE__*/r(Ni,{}),/*#__PURE__*/r(zJ,{}),/*#__PURE__*/r(Nr,{id:s}),/*#__PURE__*/r(zF,{id:s}),/*#__PURE__*/r(zg,{}),/*#__PURE__*/r(DC,{})]})]})},Nb=Ng,Nv=e=>{let{state:{cursor:t},dispatch:a}=ae(),{publish:i}=e,{analyzer:o}=De();return ac({publish:i,subscribe:e=>{let{pstype:t}=e;t===rn.Reset&&o?.reset(),t===rn.LevelStream&&o&&Da(o,e)}}),h(()=>{t.mode!==rr.LevelStream&&a({payload:{cursor:{...t,mode:rr.LevelStream}}})},[t,a]),/*#__PURE__*/n(am,{children:[/*#__PURE__*/r(C7,{type:rt.LevelStream}),/*#__PURE__*/r(yE,{children:/*#__PURE__*/r(Ng,{children:/*#__PURE__*/r(ST,{children:/*#__PURE__*/r(Dr,{opacity:.5})})})})]})},Ny=Nv,Nw=e=>/*#__PURE__*/r(aa,{...e,cursor:{show:!0},zoom:{show:!1},signal:{show:!1},children:/*#__PURE__*/r(Nv,{...e})}),Nx=tB(Nw,"LevelStream"),Nk=Nx,NS=["100%","75%","50%","25%","0%"],NM=e=>{let{inside:t=!1}=e;return /*#__PURE__*/r("div",{className:"pointer-events-none relative z-[2] flex h-full w-full flex-col justify-between text-xs text-foreground opacity-50",style:{alignItems:t?"flex-start":"flex-end"},children:NS.map(e=>/*#__PURE__*/r("div",{className:iX("flex justify-start box-border",t?"pl-0.5 pr-0":"pr-0.5"),children:e},e))})},NF=NM,NC=e=>{let{inside:t=!1}=e,{axisYWidth:n,marginLeft:a}=yn();return /*#__PURE__*/r("div",{className:"relative flex h-full w-auto",style:{width:n,marginLeft:a,justifyContent:t?"flex-start":"flex-end"},children:/*#__PURE__*/r(NM,{inside:t})})},ND=/*#__PURE__*/a.memo(NC),Nz=e=>{let{disabled:t,inside:n}=e,{state:{axisY:a}}=ae(),{show:i}=a;return!1===i||t?null:/*#__PURE__*/r(ND,{inside:n})},NN=Nz,NE=()=>/*#__PURE__*/r("div",{className:"h-0 w-full flex-1 border-t [border-color:var(--chart-grid)] first:border-t-0"}),NT=()=>{let{state:{gridLines:e}}=ae();return e&&/*#__PURE__*/n("div",{className:"pointer-events-none absolute right-0 top-0 z-[1] flex h-full w-full select-none flex-col border [border-color:var(--chart-grid)] bg-transparent",children:[/*#__PURE__*/r(NE,{}),/*#__PURE__*/r(NE,{}),/*#__PURE__*/r(NE,{}),/*#__PURE__*/r(NE,{})]})},NR=NT,NA=-200,NI=e=>`occupancy-total-line-${e}`,NP=(e,t,r=0)=>{e&&t&&(e.style.bottom=`${r||-200}%`,t.textContent=String(r))},NL=(e,t,r)=>tF(NI(e),t,r,e),NO=(e,t=0)=>{NL(e)(t)},Nq=({id:e})=>{let t=g(null),a=g(null),i=g(`OccupancyTotalLine-${Math.random().toString(36).slice(2)}`);return h(()=>(NP(t.current,a.current),NL(e,i.current,e=>{NP(t.current,a.current,e)})),[e]),/*#__PURE__*/r("div",{className:"pointer-events-none absolute z-[4] h-full w-full",children:/*#__PURE__*/n("div",{ref:t,className:"absolute left-0 w-full opacity-50",style:{bottom:"-200%"},children:[/*#__PURE__*/r("div",{className:"absolute h-0 w-full border-b border-dashed border-foreground/80",style:{marginTop:"-0.5px"}}),/*#__PURE__*/r("div",{ref:a,className:"absolute right-7 -mt-7 flex h-6 items-center justify-center rounded-[var(--radius-control)] bg-secondary px-2 text-xs text-foreground",children:"0"})]})})},N$=Nq,N_=e=>{let{occupancyAxisYDisabled:t}=e,{id:a,chart:i,Chart:o}=iV({Render:Dt});return(i3({moduleType:rr.Occupancy,chart:i,handleRender:(e,t)=>{let{data:r,totalOccupancy:n}=e;r&&t.updateSeries?.(r),void 0!==n&&NO(a,n)},eventHandlers:{[rn.Reset]:(e,t)=>{t.reset(),NO(a)}}}),S$(a,rr.Occupancy),t)?/*#__PURE__*/r("div",{className:"h-full w-full",style:{...eA},[ez]:"true",children:/*#__PURE__*/n("div",{className:"relative z-[0] h-full w-full",children:[/*#__PURE__*/r(o,{}),/*#__PURE__*/r(SC,{id:a}),/*#__PURE__*/r(Nq,{id:a})]})}):/*#__PURE__*/n(yE,{children:[/*#__PURE__*/r(Nz,{disabled:t}),/*#__PURE__*/n(ST,{children:[/*#__PURE__*/r(NT,{}),/*#__PURE__*/r(o,{}),/*#__PURE__*/r(SC,{id:a}),/*#__PURE__*/r(Nq,{id:a}),/*#__PURE__*/r(Sk,{id:a,type:rr.Occupancy})]})]})},Nj=N_,NH=e=>{let{publish:t}=e,{state:{globalID:a}}=ae(),i=wM(rt.Scan);return ac({publish:t,subscribe:e=>{i(e),e.pstype===rn.Occupancy&&(e.data&&(tO(a).getAllRawData=t=>({...tL().getAllRawData(t),occupancyData:e.data})),((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Occupancy)({...e,pstype:rn.Render}))}}),/*#__PURE__*/n(am,{children:[/*#__PURE__*/r(yE,{children:/*#__PURE__*/r(N_,{})}),/*#__PURE__*/r(yN,{type:rt.Scan,allowScanCenterBandwidth:!1})]})},NB=NH,NW=e=>/*#__PURE__*/r(aa,{...e,zoom:{show:!1},children:/*#__PURE__*/r(NH,{...e})}),NG=tB(NW,"Occupancy"),NY=NG,NU=()=>{let e=an(),t=at(e=>e.zoom),r=at(e=>e.segments.totalPoints)??0,n=at(e=>e.axisX.frequencyFormat),{interval:{start:a,end:i},onChange:o}=t,l=m(()=>r&&n?[n((100*a+1)/r),n((100*i+1)/r)]:["",""],[a,i,r,n]);return h(()=>{r&&void 0!==l[0]&&void 0!==l[1]&&o(l,{start:a,end:i})},[l,o,r]),h(()=>{if(!r)return;let t=i-a+1,n=r/t,o=`-${a/t*100}%`,l=`${100*n}%`;e({payload:e=>({zoom:{...e.zoom,style:{left:o,width:l}}})})},[e,i,a,r]),null},NX=NU;class NK extends vH{constructor(e){super({id:e.id,globalID:e.globalID,chart:null,renderer:e.renderer,renderMode:e.renderMode})}init(){let{id:e,renderer:t,renderMode:r}=this.state;e&&(this.state.chart=new x({id:e,colors:this.getInitialColors(),ignoreValue:0,renderer:t,fluorescenceRenderMode:r}),this.subscribeToColor("Fluorescence-Render"))}updateProps(e){void 0!==e.renderMode&&(this.state.renderMode=e.renderMode),this.state.chart?.updateProps(e)}updateSeries(e){this.state.chart&&e&&this.state.chart.render(e)}setRenderMode(e){this.state.renderMode=e,this.state.chart?.setRenderMode(e)}}let NV=()=>{let{state:{axisY:{range:e},fluorescence:{display:t,renderer:n,renderMode:a}}}=ae(),{chart:i,Chart:o}=iV({Render:NK,params:{renderer:n,renderMode:a}});h(()=>{i?.updateProps({range:e})},[i,e]),h(()=>{i&&i.setRenderMode(a)},[a]),i3({moduleType:rr.Fluorescence,chart:i,renderPSTypes:[rn.Fluorescence],extractData:e=>e.data});let l=m(()=>({height:"100%",width:"100%",display:"flex",visibility:t?"visible":"hidden"}),[t]);return h(()=>{i&&i.updateProps({display:t})},[i,t]),/*#__PURE__*/r("div",{style:l,children:/*#__PURE__*/r(yE,{children:/*#__PURE__*/r(o,{})})})},NQ=NV,NZ=e=>{let{type:t,heatmapElementID:a,renderer:i}=e;return /*#__PURE__*/r(vo,{id:a,children:/*#__PURE__*/n(al,{children:[/*#__PURE__*/r(C7,{type:rt.Heatmap}),/*#__PURE__*/r(M6,{renderer:i,zoomMode:"linked-x"}),/*#__PURE__*/r(yN,{type:t})]})})},NJ=NZ,N0=e=>{let{occupancyElementID:a,occupancyAxisYElementID:i,type:o}=e;return /*#__PURE__*/n(t,{children:[/*#__PURE__*/r(vo,{id:a,children:i?/*#__PURE__*/r(N_,{occupancyAxisYDisabled:!0}):/*#__PURE__*/n(al,{children:[/*#__PURE__*/r(C7,{type:rt.Occupancy}),/*#__PURE__*/r(N_,{}),/*#__PURE__*/r(yN,{type:o})]})}),/*#__PURE__*/r(vo,{id:i,children:/*#__PURE__*/r(Nz,{inside:!0})})]})},N1=N0,N2=(e,t)=>tF(`BLAZE_PROGRESS-${e}`,"0",t,e),N5=()=>{let{state:{blaze:{show:e},segments:t,globalID:a}}=ae(),[i,o]=b(""),l=m(()=>{let e=[];for(let r=0;r<t.length;r++){let n=t[r];n.progress&&e.push(...n.progress)}return e},[t]);return(h(()=>{e&&a&&N2(a,e=>{o(l.includes(e)?void 0:`${100*e}%`)})},[e,a]),e)?/*#__PURE__*/r(yi,{children:/*#__PURE__*/n("div",{className:"absolute left-[-100%] top-0 flex h-full w-0 opacity-50",style:{left:i},children:[/*#__PURE__*/r("div",{className:"ml-[-0.5px] opacity-50",style:{borderRight:"0.5px solid var(--chart-grid-strong)"}}),/*#__PURE__*/r("div",{className:"ml-[-31px] w-[30px] opacity-20",style:{background:"linear-gradient(90deg, transparent, var(--chart-grid-strong))"}})]})}):null},N4=/*#__PURE__*/a.memo(N5),N3=()=>{let{state:{legend:{children:e}}}=ae();return /*#__PURE__*/r("div",{className:"absolute left-5 top-5 z-[6] flex h-auto w-auto items-center",children:e})},N6=N3,N8=()=>{let{state:{segments:e}}=ae(),t=e.totalPoints??0;return /*#__PURE__*/r(yi,{className:"z-[0]",children:e.map((e,n)=>/*#__PURE__*/r("div",{className:"h-full border-x",style:{width:t>0?`${100*e.point/t}%`:0,borderColor:n%2==1?"var(--chart-grid)":"transparent",background:n%2==1?"var(--chart-surface)":"transparent",opacity:n%2==1?.4:1}},`${e.start}_${e.stop}_${e.index}`))})},N9=N8,N7=({globalID:e})=>({handleMarkerPublish:u(t=>{if(e)switch(t.pstype){case rn.Marker:Co(e)(t);break;case rn.Reset:Co(e)({type:ro.Clear})}},[e])}),Ee=N7;function Et(){let e=an();return u(()=>{e({payload:e=>e.axisY.fieldStrengthUnitAvailable?null:{axisY:{...e.axisY,fieldStrengthUnitAvailable:!0}}})},[e])}function Er({segmentOffset:e,offset:t}){let r={};return void 0!==e&&(r.segmentOffset=e),void 0!==t&&(r.offset=t),void 0!==r.segmentOffset||void 0!==r.offset?r:void 0}function En(e,t){"thresholdData"in t&&e.setThresholdData(t.thresholdData,Er(t))}function Ea(){let e=at(e=>e.signal.onChange),t=g(e);return f(()=>{t.current=e},[e]),u(e=>{let r=t.current;r&&r(e.regions.map(t=>({...t,frequency:t.centerFrequency,timestamp:e.timestamp})),e)},[])}function Ei(e){let{state:{globalID:t,series:{enableMetrics:r,enableWaterfall:n},fluorescence:{show:a},axisY:{unit:i},zoom:{interval:o},heatmapCapture:{display:l},system:{width:s},marker:c,signal:d}}=ae(),p=g(null),f=g(t),m=g(o),b=g(0),v=Ea(),y=d.templateDetection??e?.processing?.enableTemplateDetection??!1;h(()=>{p.current?.updateProcessing({enableTemplateDetection:y})},[y]);let w=g(null),{updateSignalData:x}=z5(),k=Et(),S=g(l);h(()=>{S.current=l},[l]);let M=u(e=>{((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Spectrum)({pstype:rn.Render,data:e})},[]),F=u(e=>{((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Heatmap)({pstype:rn.Render,data:e})},[]),C=u(e=>{N2(f.current)?.(e)},[]),D=u(e=>{(e.realData||e.templateData||e.backgroundNoiseData||"thresholdData"in e)&&M({minData:e.minData,maxData:e.maxData,avgData:e.avgData,thresholdData:e.thresholdData,backgroundNoiseData:e.backgroundNoiseData,realData:e.realData,templateData:e.templateData}),e.scanProgress&&C(e.scanProgress),e.templateDetection&&v(e.templateDetection),e.waterfallData&&F(e.waterfallData),e.fluorescenceData&&((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Fluorescence)({pstype:rn.Fluorescence,data:{fluorescenceData:e.fluorescenceData,fluorescenceMaxCount:e.fluorescenceMaxCount}}),e.occupancyData&&((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Occupancy)({pstype:rn.Render,data:e.occupancyData,totalOccupancy:b.current}),e.extraData&&((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Spectrum)({pstype:rn.Render,extraData:e.extraData})},[M,F,C,v]);h(()=>{f.current=t},[t]);let z=(e,t)=>!1!==e&&(t??!0);if(!p.current&&t){let i=Math.min(1|Math.floor(2*s),1001);p.current=new O({...e,outputPoints:i,processing:{...e?.processing,enableMetrics:z(r,e?.processing?.enableMetrics),enableWaterfall:z(n,e?.processing?.enableWaterfall),enableTemplateDetection:y,enableFluorescence:a,enablePeakStats:!!c?.enabled},onSpectrumUpdate:D});let o=tO(t),l=p.current;o.getAllRawData=e=>l.getAllRawData(e),t_(t,p.current)}h(()=>{let e=Math.floor(o.start),t=Math.ceil(o.end),r=Math.floor(m.current.start),n=Math.ceil(m.current.end);(e!==r||t!==n)&&p.current&&(m.current=o,p.current.updateSamplingRange(e,t+1))},[o]);let N=u(async(e=!1)=>{setTimeout(()=>{((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Heatmap)({pstype:rn.Reset}),((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Spectrum)({pstype:rn.Reset}),((e,t,r="0")=>tI(e,t,void 0,r))(f.current,rr.Occupancy)({pstype:rn.Reset}),e&&wh(f.current)},1)},[]),E=u(async e=>{if(p.current)switch(e.pstype){case rn.AntennaFactor:p.current.setAntennaFactor(e.data),e.data.length>0&&k();break;case rn.Signal:x({type:e.type,data:e.data});break;case rn.Spectrum:e.data&&p.current.process(e),En(p.current,e),e.maxData&&p.current.setMaxData(e.maxData),e.minData&&p.current.setMinData(e.minData),e.avgData&&p.current.setAvgData(e.avgData),e.templateData&&p.current.setTemplateData(e.templateData,e.templateTolerance),e.backgroundNoiseData&&p.current.setBackgroundNoiseData(e.backgroundNoiseData),e.extraData&&p.current.setExtraData(e.extraData,I.MERGE,e.segmentedExtraData?{segmentOffset:e.segmentOffset,offset:e.offset}:void 0);break;case rn.Fluorescence:e.data&&p.current&&p.current.setFluorescenceData(e.data.fluorescenceData,e.data.fluorescenceMaxCount);break;case rn.Heatmap:if(e.data){let{data:t,timestamps:r}=e,n=rJ(t,r);p.current.setWaterfallData(n)}break;case rn.Occupancy:p.current?.setOccupancyData(e.data),b.current=e.totalOccupancy;break;case rn.Segments:p.current.initializeSegments(e.data),await N(),e.onFinally?.();break;case rn.SpectrumBandwidth:p.current.reset();break;case rn.Series:wd(f.current,e);break;case rn.Reset:p.current.reset(),await N(!0),e.onFinally?.();break;case rn.Clear:p.current.reset(),await N(!1),e.onFinally?.()}},[k,x,wd,N]);return h(()=>{let e=i.includes("/m");p.current?.setAntennaFactorSwitch(e)},[i]),h(()=>{if(!p.current)return;let t=z(r,e?.processing?.enableMetrics);t!==w.current&&(p.current.updateProcessing({enableMetrics:t}),w.current=t)},[r,e?.processing?.enableMetrics]),E}let Eo=e=>{let{state:{globalID:a}}=ae(),i=g([]),o=g(""),{type:l=rt.SingleFrequency,publish:s,heatmapElementID:c,occupancyElementID:u,occupancyAxisYElementID:d,touch:h,children:p,processing:f,renderer:m}=e,{enableMetrics:b,enableWaterfall:v}=wy({type:l,heatmapElementID:c}),y=Ei({processing:{enableWaterfall:v,enableMetrics:b,...f}}),w=wM(l);wF(h);let{handleMarkerPublish:x}=N7({globalID:a});return ac({publish:s,subscribe:e=>{if(y(e),x(e),w(e),e.pstype===rn.Heatmap){let{data:t,timestamps:r}=e;if(i.current=rJ(t,r),o.current!==a){let e=tO(a),t=e.getAllRawData;e.getAllRawData=e=>({...t(e),waterfallData:i.current}),o.current=a}}((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Spectrum)(e),((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Heatmap)(e),((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Occupancy)(e),e.pstype!==rn.Fluorescence&&((e,t,r="0")=>tI(e,t,void 0,r))(a,rr.Fluorescence)(e)}}),/*#__PURE__*/n(am,{children:[/*#__PURE__*/r(C7,{type:l}),/*#__PURE__*/n(yE,{children:[/*#__PURE__*/r(Ng,{touch:h,children:p||/*#__PURE__*/r(NV,{})}),/*#__PURE__*/r(NZ,{type:l,heatmapElementID:c,renderer:m}),/*#__PURE__*/r(N0,{type:l,occupancyElementID:u,occupancyAxisYElementID:d}),/*#__PURE__*/n(ST,{children:[/*#__PURE__*/r(NU,{}),l===rt.Scan&&/*#__PURE__*/n(t,{children:[/*#__PURE__*/r(N8,{}),/*#__PURE__*/r(N4,{})]}),/*#__PURE__*/r(N3,{})]})]}),/*#__PURE__*/r(yN,{type:l})]})},El=Eo,Es="singleFrequency",Ec="slider",Eu=e=>"slider"===e?"deltaMeasurement":"default",Ed=e=>{let t=e.type??Es;if(!e.heatmapElementID||t!==Es&&"scan"!==t&&"mscan"!==t)return e;let r=e.heatmapCapture?.type??"slider",n=e.heatmapCapture?.toolbarVariant??Eu(r);return{...e,heatmapCapture:{show:!0,display:!1,...e.heatmapCapture,type:r,toolbarVariant:n}}},Eh=e=>{let t=Ed(e);return /*#__PURE__*/r(aa,{...t,children:/*#__PURE__*/r(Eo,{...t})})},Ep=tB(Eh,"Spectrum"),Ef=Ep;function Em(e={}){let{onChange:t,sizes:r,tokens:n}=e;th({sizes:r,tokens:n});let a=od();return{cleanup:t?oh(e=>t(e)):void 0,...a}}var Eg=/*#__PURE__*/function(e){return e.Station="station",e.Simple="simple",e}({});th();export{w as DialDirectionLabelMode,oR as AudioWaveform,vZ as Dial,ye as Gauge,Fh as Heatmap,FL as IQ,Nk as LevelStream,NY as Occupancy,Ef as Spectrum,t7 as AxisPlacement,re as AxisXLabelMode,rt as ChartType,t9 as FrequencyUnit,ro as MarkerEventType,rr as ModuleType,ra as OptionKey,rn as PSType,ri as SegmentsEvent,rc as SeriesType,rl as ToolType,rs as ToolbarItemType,rC as formatFrequencyUnit,rz as formatFrequencyUnitFromHz,rD as formatFrequencyUnitFromMHz,od as getChartsThemeState,nn as HeatmapCaptureType,Em as initChartsTheme,nt as MarkerMode,DK as setFrequencyAllocationChannelsToCache,DX as setFrequencyAllocationToCache,Eg as SignalDataType,oh as subscribeChartsThemeChange,ad as useSafePublish,tB as withChartPublisher};
|