@viasoftbr/shared-ui 0.0.4 → 0.0.6

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.
@@ -22728,10 +22728,10 @@ var Accordion = ({ title, children, defaultOpen = false }) => {
22728
22728
  var Accordion_default = Accordion;
22729
22729
 
22730
22730
  // src/components/display/Section.tsx
22731
- import { useEffect as useEffect2, useRef, createContext as createContext2, useContext as useContext2 } from "react";
22731
+ import { useEffect as useEffect2, useRef, createContext as createContext2, use as use2 } from "react";
22732
22732
 
22733
22733
  // src/context/AuthContext.tsx
22734
- import { createContext, useContext, useEffect, useState as useState2 } from "react";
22734
+ import { createContext, use, useEffect, useState as useState2 } from "react";
22735
22735
 
22736
22736
  // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/bind.js
22737
22737
  function bind(fn, thisArg) {
@@ -25571,12 +25571,61 @@ function buildWsUrl(path = "/") {
25571
25571
  return `${proto}://${host}${path.startsWith("/") ? path : "/" + path}`;
25572
25572
  }
25573
25573
  }
25574
+ function extractBearerToken(headers, explicitToken) {
25575
+ if (explicitToken)
25576
+ return explicitToken;
25577
+ if (!headers)
25578
+ return null;
25579
+ const authHeader = headers.Authorization || headers.authorization;
25580
+ if (!authHeader)
25581
+ return null;
25582
+ const match = authHeader.match(/^Bearer\s+(.+)$/i);
25583
+ return match ? match[1] : null;
25584
+ }
25585
+ function appendWsQueryParam(url, key, value) {
25586
+ try {
25587
+ const parsed = new URL(
25588
+ url,
25589
+ typeof window !== "undefined" ? window.location.href : void 0
25590
+ );
25591
+ parsed.searchParams.set(key, value);
25592
+ return parsed.toString();
25593
+ } catch {
25594
+ const separator = url.includes("?") ? "&" : "?";
25595
+ return `${url}${separator}${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
25596
+ }
25597
+ }
25598
+ function normalizeProtocols(protocols) {
25599
+ if (!protocols)
25600
+ return void 0;
25601
+ return Array.isArray(protocols) ? protocols.filter(Boolean) : [protocols];
25602
+ }
25574
25603
  async function decodeFfurl(ffurl) {
25575
25604
  const { settings } = await fetchApi.postJson("/auth/protocols/ffurl/decode", { ffurl });
25576
25605
  return settings;
25577
25606
  }
25578
- function subscribeToWebsocket(url, onMessage) {
25579
- const socket = new WebSocket(url);
25607
+ function subscribeToWebsocket(url, onMessage, options = {}) {
25608
+ const bearerToken = extractBearerToken(options.headers, options.bearerToken);
25609
+ const bearerStrategy = options.bearerStrategy ?? "query";
25610
+ let resolvedUrl = url;
25611
+ const protocols = normalizeProtocols(options.protocols) ?? [];
25612
+ if (options.headers && Object.keys(options.headers).length > 0) {
25613
+ console.warn(
25614
+ "WebSocket connections in browsers do not support custom HTTP headers. shared-ui will derive bearer auth from Authorization and forward it using query string or subprotocol."
25615
+ );
25616
+ }
25617
+ if (bearerToken) {
25618
+ if (bearerStrategy === "protocol") {
25619
+ protocols.push("bearer", bearerToken);
25620
+ } else {
25621
+ resolvedUrl = appendWsQueryParam(
25622
+ url,
25623
+ options.bearerQueryParam ?? "access_token",
25624
+ bearerToken
25625
+ );
25626
+ }
25627
+ }
25628
+ const socket = protocols.length > 0 ? new WebSocket(resolvedUrl, protocols) : new WebSocket(resolvedUrl);
25580
25629
  socket.onmessage = (event) => {
25581
25630
  try {
25582
25631
  const data = JSON.parse(event.data);
@@ -25591,140 +25640,6 @@ function subscribeToWebsocket(url, onMessage) {
25591
25640
  };
25592
25641
  }
25593
25642
 
25594
- // src/services/loadRemoteModule.ts
25595
- import * as React2 from "react";
25596
- import * as ReactDOM from "react-dom";
25597
- var sharedScopeInitialized = false;
25598
- function getSharedScope() {
25599
- if (!globalThis.__federation_shared__) {
25600
- globalThis.__federation_shared__ = {};
25601
- }
25602
- if (!sharedScopeInitialized) {
25603
- globalThis.__federation_shared__["react"] = {
25604
- "18.3.1": {
25605
- get: () => Promise.resolve(() => React2),
25606
- loaded: true,
25607
- from: "core",
25608
- scope: "default"
25609
- }
25610
- };
25611
- globalThis.__federation_shared__["react-dom"] = {
25612
- "18.3.1": {
25613
- get: () => Promise.resolve(() => ReactDOM),
25614
- loaded: true,
25615
- from: "core",
25616
- scope: "default"
25617
- }
25618
- };
25619
- sharedScopeInitialized = true;
25620
- }
25621
- return globalThis.__federation_shared__;
25622
- }
25623
- var loadedContainers = /* @__PURE__ */ new Map();
25624
- var initializedContainers = /* @__PURE__ */ new Set();
25625
- async function loadContainer(url) {
25626
- if (loadedContainers.has(url)) {
25627
- return loadedContainers.get(url);
25628
- }
25629
- const loadPromise = (async () => {
25630
- try {
25631
- const container = await import(
25632
- /* @vite-ignore */
25633
- url
25634
- );
25635
- if (container.init && !initializedContainers.has(url)) {
25636
- await container.init(getSharedScope());
25637
- initializedContainers.add(url);
25638
- }
25639
- return container;
25640
- } catch (error2) {
25641
- loadedContainers.delete(url);
25642
- initializedContainers.delete(url);
25643
- throw error2;
25644
- }
25645
- })();
25646
- loadedContainers.set(url, loadPromise);
25647
- return loadPromise;
25648
- }
25649
- async function loadRemoteModule(config) {
25650
- const container = await loadContainer(config.url);
25651
- if (!container || typeof container.get !== "function") {
25652
- throw new Error(`Container inv\xE1lido ou sem m\xE9todo get: ${config.scope}`);
25653
- }
25654
- if (typeof container.dynamicLoadingCss === "function") {
25655
- try {
25656
- await container.dynamicLoadingCss([]);
25657
- } catch (err) {
25658
- console.warn(`Aviso: Falha ao carregar CSS global do remote ${config.scope}`, err);
25659
- }
25660
- }
25661
- const factory2 = await container.get(config.module);
25662
- const moduleExports = await factory2();
25663
- if (moduleExports && typeof moduleExports === "object" && "default" in moduleExports) {
25664
- return moduleExports.default;
25665
- }
25666
- return moduleExports;
25667
- }
25668
-
25669
- // src/services/metadataLoader.ts
25670
- var MetadataLoader = class {
25671
- constructor() {
25672
- __publicField(this, "metadataCache", /* @__PURE__ */ new Map());
25673
- }
25674
- async loadMetadata(metadataUrl) {
25675
- if (this.metadataCache.has(metadataUrl)) {
25676
- return this.metadataCache.get(metadataUrl) || [];
25677
- }
25678
- try {
25679
- const response = await fetch(metadataUrl);
25680
- console.log(response);
25681
- if (!response.ok) {
25682
- throw new Error(`Failed to fetch metadata: ${response.statusText}`);
25683
- }
25684
- const data = await response.json();
25685
- let metadata;
25686
- if (Array.isArray(data)) {
25687
- metadata = data;
25688
- } else if (data.pages && Array.isArray(data.pages)) {
25689
- metadata = data.pages;
25690
- } else {
25691
- throw new Error(
25692
- "Invalid metadata format: expected array or object with pages property"
25693
- );
25694
- }
25695
- metadata.forEach((page, index3) => {
25696
- if (!page.id || !page.name || !page.path || !page.url) {
25697
- throw new Error(
25698
- `Invalid page metadata at index ${index3}: missing required fields`
25699
- );
25700
- }
25701
- });
25702
- this.metadataCache.set(metadataUrl, metadata);
25703
- return metadata;
25704
- } catch (error2) {
25705
- console.warn(`Failed to load metadata from ${metadataUrl}:`, error2);
25706
- return [];
25707
- }
25708
- }
25709
- async loadFromDirectory(directoryUrl) {
25710
- try {
25711
- const manifestUrl = `${directoryUrl}/manifest.json`;
25712
- return await this.loadMetadata(manifestUrl);
25713
- } catch (error2) {
25714
- throw new Error(
25715
- `Directory manifest not found at ${directoryUrl}/manifest.json: ${error2}`
25716
- );
25717
- }
25718
- }
25719
- clearCache() {
25720
- this.metadataCache.clear();
25721
- }
25722
- getCachedMetadata(metadataUrl) {
25723
- return this.metadataCache.get(metadataUrl);
25724
- }
25725
- };
25726
- var metadataLoader = new MetadataLoader();
25727
-
25728
25643
  // src/services/registry.ts
25729
25644
  var PluginRegistryImpl = class {
25730
25645
  constructor() {
@@ -25822,7 +25737,7 @@ var saveConfig = async (payload, basePath = "./php") => {
25822
25737
  import { jsx as jsx2 } from "react/jsx-runtime";
25823
25738
  var AuthContext = createContext(void 0);
25824
25739
  function useAuth() {
25825
- const ctx = useContext(AuthContext);
25740
+ const ctx = use(AuthContext);
25826
25741
  if (!ctx)
25827
25742
  throw new Error("useAuth must be used within AuthProvider");
25828
25743
  return ctx;
@@ -25862,7 +25777,7 @@ var SkeletonBlock = ({ lines = 3, className = "" }) => {
25862
25777
  import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
25863
25778
  var SectionContext = createContext2(void 0);
25864
25779
  function useSection() {
25865
- const ctx = useContext2(SectionContext);
25780
+ const ctx = use2(SectionContext);
25866
25781
  return ctx ?? { readonly: false };
25867
25782
  }
25868
25783
  var Section2 = ({ id, title, icon, expanded, onToggle, children, readonly, loading = false }) => {
@@ -25907,7 +25822,7 @@ var Section2 = ({ id, title, icon, expanded, onToggle, children, readonly, loadi
25907
25822
  overflow-hidden
25908
25823
  ${expanded ? "max-h-fit opacity-100" : "max-h-0 opacity-0"}
25909
25824
  `,
25910
- children: /* @__PURE__ */ jsx4("div", { className: "px-6 py-4 border-t transition-all transition-discrete border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50", children: /* @__PURE__ */ jsx4(SectionContext.Provider, { value: { readonly: !!effectiveReadonly }, children: loading ? /* @__PURE__ */ jsx4(SkeletonBlock, { lines: 5 }) : children }) })
25825
+ children: /* @__PURE__ */ jsx4("div", { className: "px-6 py-4 border-t transition-all transition-discrete border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50", children: /* @__PURE__ */ jsx4(SectionContext, { value: { readonly: !!effectiveReadonly }, children: loading ? /* @__PURE__ */ jsx4(SkeletonBlock, { lines: 5 }) : children }) })
25911
25826
  }
25912
25827
  )
25913
25828
  ] });
@@ -28066,7 +27981,7 @@ function m6(u16, t15) {
28066
27981
  }
28067
27982
 
28068
27983
  // node_modules/.pnpm/@floating-ui+react@0.26.28_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@floating-ui/react/dist/floating-ui.react.mjs
28069
- import * as React6 from "react";
27984
+ import * as React5 from "react";
28070
27985
  import { useLayoutEffect as useLayoutEffect2, useEffect as useEffect5, useRef as useRef4 } from "react";
28071
27986
 
28072
27987
  // node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
@@ -28371,7 +28286,7 @@ function rectToClientRect(rect) {
28371
28286
  }
28372
28287
 
28373
28288
  // node_modules/.pnpm/@floating-ui+react@0.26.28_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@floating-ui/react/dist/floating-ui.react.mjs
28374
- import * as ReactDOM3 from "react-dom";
28289
+ import * as ReactDOM2 from "react-dom";
28375
28290
 
28376
28291
  // node_modules/.pnpm/@floating-ui+core@1.7.4/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
28377
28292
  function computeCoordsFromPlacement(_ref, placement, rtl) {
@@ -29574,9 +29489,9 @@ var computePosition2 = (reference, floating, options) => {
29574
29489
  };
29575
29490
 
29576
29491
  // node_modules/.pnpm/@floating-ui+react-dom@2.1.7_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
29577
- import * as React5 from "react";
29492
+ import * as React4 from "react";
29578
29493
  import { useLayoutEffect } from "react";
29579
- import * as ReactDOM2 from "react-dom";
29494
+ import * as ReactDOM from "react-dom";
29580
29495
  var isClient = typeof document !== "undefined";
29581
29496
  var noop2 = function noop3() {
29582
29497
  };
@@ -29641,7 +29556,7 @@ function roundByDPR(element, value) {
29641
29556
  return Math.round(value * dpr) / dpr;
29642
29557
  }
29643
29558
  function useLatestRef(value) {
29644
- const ref = React5.useRef(value);
29559
+ const ref = React4.useRef(value);
29645
29560
  index(() => {
29646
29561
  ref.current = value;
29647
29562
  });
@@ -29664,7 +29579,7 @@ function useFloating(options) {
29664
29579
  whileElementsMounted,
29665
29580
  open
29666
29581
  } = options;
29667
- const [data, setData] = React5.useState({
29582
+ const [data, setData] = React4.useState({
29668
29583
  x: 0,
29669
29584
  y: 0,
29670
29585
  strategy,
@@ -29672,19 +29587,19 @@ function useFloating(options) {
29672
29587
  middlewareData: {},
29673
29588
  isPositioned: false
29674
29589
  });
29675
- const [latestMiddleware, setLatestMiddleware] = React5.useState(middleware);
29590
+ const [latestMiddleware, setLatestMiddleware] = React4.useState(middleware);
29676
29591
  if (!deepEqual(latestMiddleware, middleware)) {
29677
29592
  setLatestMiddleware(middleware);
29678
29593
  }
29679
- const [_reference, _setReference] = React5.useState(null);
29680
- const [_floating, _setFloating] = React5.useState(null);
29681
- const setReference = React5.useCallback((node) => {
29594
+ const [_reference, _setReference] = React4.useState(null);
29595
+ const [_floating, _setFloating] = React4.useState(null);
29596
+ const setReference = React4.useCallback((node) => {
29682
29597
  if (node !== referenceRef.current) {
29683
29598
  referenceRef.current = node;
29684
29599
  _setReference(node);
29685
29600
  }
29686
29601
  }, []);
29687
- const setFloating = React5.useCallback((node) => {
29602
+ const setFloating = React4.useCallback((node) => {
29688
29603
  if (node !== floatingRef.current) {
29689
29604
  floatingRef.current = node;
29690
29605
  _setFloating(node);
@@ -29692,14 +29607,14 @@ function useFloating(options) {
29692
29607
  }, []);
29693
29608
  const referenceEl = externalReference || _reference;
29694
29609
  const floatingEl = externalFloating || _floating;
29695
- const referenceRef = React5.useRef(null);
29696
- const floatingRef = React5.useRef(null);
29697
- const dataRef = React5.useRef(data);
29610
+ const referenceRef = React4.useRef(null);
29611
+ const floatingRef = React4.useRef(null);
29612
+ const dataRef = React4.useRef(data);
29698
29613
  const hasWhileElementsMounted = whileElementsMounted != null;
29699
29614
  const whileElementsMountedRef = useLatestRef(whileElementsMounted);
29700
29615
  const platformRef = useLatestRef(platform2);
29701
29616
  const openRef = useLatestRef(open);
29702
- const update = React5.useCallback(() => {
29617
+ const update = React4.useCallback(() => {
29703
29618
  if (!referenceRef.current || !floatingRef.current) {
29704
29619
  return;
29705
29620
  }
@@ -29722,7 +29637,7 @@ function useFloating(options) {
29722
29637
  };
29723
29638
  if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
29724
29639
  dataRef.current = fullData;
29725
- ReactDOM2.flushSync(() => {
29640
+ ReactDOM.flushSync(() => {
29726
29641
  setData(fullData);
29727
29642
  });
29728
29643
  }
@@ -29737,7 +29652,7 @@ function useFloating(options) {
29737
29652
  }));
29738
29653
  }
29739
29654
  }, [open]);
29740
- const isMountedRef = React5.useRef(false);
29655
+ const isMountedRef = React4.useRef(false);
29741
29656
  index(() => {
29742
29657
  isMountedRef.current = true;
29743
29658
  return () => {
@@ -29756,17 +29671,17 @@ function useFloating(options) {
29756
29671
  update();
29757
29672
  }
29758
29673
  }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
29759
- const refs = React5.useMemo(() => ({
29674
+ const refs = React4.useMemo(() => ({
29760
29675
  reference: referenceRef,
29761
29676
  floating: floatingRef,
29762
29677
  setReference,
29763
29678
  setFloating
29764
29679
  }), [setReference, setFloating]);
29765
- const elements = React5.useMemo(() => ({
29680
+ const elements = React4.useMemo(() => ({
29766
29681
  reference: referenceEl,
29767
29682
  floating: floatingEl
29768
29683
  }), [referenceEl, floatingEl]);
29769
- const floatingStyles = React5.useMemo(() => {
29684
+ const floatingStyles = React4.useMemo(() => {
29770
29685
  const initialStyles = {
29771
29686
  position: strategy,
29772
29687
  left: 0,
@@ -29792,7 +29707,7 @@ function useFloating(options) {
29792
29707
  top: y8
29793
29708
  };
29794
29709
  }, [strategy, transform, elements.floating, data.x, data.y]);
29795
- return React5.useMemo(() => ({
29710
+ return React4.useMemo(() => ({
29796
29711
  ...data,
29797
29712
  update,
29798
29713
  refs,
@@ -29819,12 +29734,12 @@ var size3 = (options, deps) => ({
29819
29734
 
29820
29735
  // node_modules/.pnpm/@floating-ui+react@0.26.28_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@floating-ui/react/dist/floating-ui.react.mjs
29821
29736
  var SafeReact = {
29822
- ...React6
29737
+ ...React5
29823
29738
  };
29824
29739
  var useInsertionEffect = SafeReact.useInsertionEffect;
29825
29740
  var useSafeInsertionEffect = useInsertionEffect || ((fn) => fn());
29826
29741
  function useEffectEvent(callback) {
29827
- const ref = React6.useRef(() => {
29742
+ const ref = React5.useRef(() => {
29828
29743
  if (true) {
29829
29744
  throw new Error("Cannot call an event handler while rendering.");
29830
29745
  }
@@ -29832,7 +29747,7 @@ function useEffectEvent(callback) {
29832
29747
  useSafeInsertionEffect(() => {
29833
29748
  ref.current = callback;
29834
29749
  });
29835
- return React6.useCallback(function() {
29750
+ return React5.useCallback(function() {
29836
29751
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
29837
29752
  args[_key] = arguments[_key];
29838
29753
  }
@@ -29855,13 +29770,13 @@ var genId = () => (
29855
29770
  "floating-ui-" + Math.random().toString(36).slice(2, 6) + count++
29856
29771
  );
29857
29772
  function useFloatingId() {
29858
- const [id, setId] = React6.useState(() => serverHandoffComplete ? genId() : void 0);
29773
+ const [id, setId] = React5.useState(() => serverHandoffComplete ? genId() : void 0);
29859
29774
  index2(() => {
29860
29775
  if (id == null) {
29861
29776
  setId(genId());
29862
29777
  }
29863
29778
  }, []);
29864
- React6.useEffect(() => {
29779
+ React5.useEffect(() => {
29865
29780
  serverHandoffComplete = true;
29866
29781
  }, []);
29867
29782
  return id;
@@ -29912,13 +29827,13 @@ function createPubSub() {
29912
29827
  }
29913
29828
  };
29914
29829
  }
29915
- var FloatingNodeContext = /* @__PURE__ */ React6.createContext(null);
29916
- var FloatingTreeContext = /* @__PURE__ */ React6.createContext(null);
29830
+ var FloatingNodeContext = /* @__PURE__ */ React5.createContext(null);
29831
+ var FloatingTreeContext = /* @__PURE__ */ React5.createContext(null);
29917
29832
  var useFloatingParentNodeId = () => {
29918
29833
  var _React$useContext;
29919
- return ((_React$useContext = React6.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;
29834
+ return ((_React$useContext = React5.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;
29920
29835
  };
29921
- var useFloatingTree = () => React6.useContext(FloatingTreeContext);
29836
+ var useFloatingTree = () => React5.useContext(FloatingTreeContext);
29922
29837
  var FOCUSABLE_ATTRIBUTE = "data-floating-ui-focusable";
29923
29838
  function useFloatingRootContext(options) {
29924
29839
  const {
@@ -29927,8 +29842,8 @@ function useFloatingRootContext(options) {
29927
29842
  elements: elementsProp
29928
29843
  } = options;
29929
29844
  const floatingId = useId();
29930
- const dataRef = React6.useRef({});
29931
- const [events] = React6.useState(() => createPubSub());
29845
+ const dataRef = React5.useRef({});
29846
+ const [events] = React5.useState(() => createPubSub());
29932
29847
  const nested = useFloatingParentNodeId() != null;
29933
29848
  if (true) {
29934
29849
  const optionDomReference = elementsProp.reference;
@@ -29936,7 +29851,7 @@ function useFloatingRootContext(options) {
29936
29851
  error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
29937
29852
  }
29938
29853
  }
29939
- const [positionReference, setPositionReference] = React6.useState(elementsProp.reference);
29854
+ const [positionReference, setPositionReference] = React5.useState(elementsProp.reference);
29940
29855
  const onOpenChange = useEffectEvent((open2, event, reason) => {
29941
29856
  dataRef.current.openEvent = open2 ? event : void 0;
29942
29857
  events.emit("openchange", {
@@ -29947,15 +29862,15 @@ function useFloatingRootContext(options) {
29947
29862
  });
29948
29863
  onOpenChangeProp == null || onOpenChangeProp(open2, event, reason);
29949
29864
  });
29950
- const refs = React6.useMemo(() => ({
29865
+ const refs = React5.useMemo(() => ({
29951
29866
  setPositionReference
29952
29867
  }), []);
29953
- const elements = React6.useMemo(() => ({
29868
+ const elements = React5.useMemo(() => ({
29954
29869
  reference: positionReference || elementsProp.reference || null,
29955
29870
  floating: elementsProp.floating || null,
29956
29871
  domReference: elementsProp.reference
29957
29872
  }), [positionReference, elementsProp.reference, elementsProp.floating]);
29958
- return React6.useMemo(() => ({
29873
+ return React5.useMemo(() => ({
29959
29874
  dataRef,
29960
29875
  open,
29961
29876
  onOpenChange,
@@ -29982,11 +29897,11 @@ function useFloating2(options) {
29982
29897
  });
29983
29898
  const rootContext = options.rootContext || internalRootContext;
29984
29899
  const computedElements = rootContext.elements;
29985
- const [_domReference, setDomReference] = React6.useState(null);
29986
- const [positionReference, _setPositionReference] = React6.useState(null);
29900
+ const [_domReference, setDomReference] = React5.useState(null);
29901
+ const [positionReference, _setPositionReference] = React5.useState(null);
29987
29902
  const optionDomReference = computedElements == null ? void 0 : computedElements.domReference;
29988
29903
  const domReference = optionDomReference || _domReference;
29989
- const domReferenceRef = React6.useRef(null);
29904
+ const domReferenceRef = React5.useRef(null);
29990
29905
  const tree = useFloatingTree();
29991
29906
  index2(() => {
29992
29907
  if (domReference) {
@@ -30002,7 +29917,7 @@ function useFloating2(options) {
30002
29917
  }
30003
29918
  }
30004
29919
  });
30005
- const setPositionReference = React6.useCallback((node) => {
29920
+ const setPositionReference = React5.useCallback((node) => {
30006
29921
  const computedPositionReference = isElement(node) ? {
30007
29922
  getBoundingClientRect: () => node.getBoundingClientRect(),
30008
29923
  contextElement: node
@@ -30010,7 +29925,7 @@ function useFloating2(options) {
30010
29925
  _setPositionReference(computedPositionReference);
30011
29926
  position.refs.setReference(computedPositionReference);
30012
29927
  }, [position.refs]);
30013
- const setReference = React6.useCallback((node) => {
29928
+ const setReference = React5.useCallback((node) => {
30014
29929
  if (isElement(node) || node === null) {
30015
29930
  domReferenceRef.current = node;
30016
29931
  setDomReference(node);
@@ -30022,17 +29937,17 @@ function useFloating2(options) {
30022
29937
  position.refs.setReference(node);
30023
29938
  }
30024
29939
  }, [position.refs]);
30025
- const refs = React6.useMemo(() => ({
29940
+ const refs = React5.useMemo(() => ({
30026
29941
  ...position.refs,
30027
29942
  setReference,
30028
29943
  setPositionReference,
30029
29944
  domReference: domReferenceRef
30030
29945
  }), [position.refs, setReference, setPositionReference]);
30031
- const elements = React6.useMemo(() => ({
29946
+ const elements = React5.useMemo(() => ({
30032
29947
  ...position.elements,
30033
29948
  domReference
30034
29949
  }), [position.elements, domReference]);
30035
- const context = React6.useMemo(() => ({
29950
+ const context = React5.useMemo(() => ({
30036
29951
  ...position,
30037
29952
  ...rootContext,
30038
29953
  refs,
@@ -30046,7 +29961,7 @@ function useFloating2(options) {
30046
29961
  node.context = context;
30047
29962
  }
30048
29963
  });
30049
- return React6.useMemo(() => ({
29964
+ return React5.useMemo(() => ({
30050
29965
  ...position,
30051
29966
  context,
30052
29967
  refs,
@@ -30118,22 +30033,22 @@ function useInteractions(propsList) {
30118
30033
  const referenceDeps = propsList.map((key) => key == null ? void 0 : key.reference);
30119
30034
  const floatingDeps = propsList.map((key) => key == null ? void 0 : key.floating);
30120
30035
  const itemDeps = propsList.map((key) => key == null ? void 0 : key.item);
30121
- const getReferenceProps = React6.useCallback(
30036
+ const getReferenceProps = React5.useCallback(
30122
30037
  (userProps) => mergeProps(userProps, propsList, "reference"),
30123
30038
  // eslint-disable-next-line react-hooks/exhaustive-deps
30124
30039
  referenceDeps
30125
30040
  );
30126
- const getFloatingProps = React6.useCallback(
30041
+ const getFloatingProps = React5.useCallback(
30127
30042
  (userProps) => mergeProps(userProps, propsList, "floating"),
30128
30043
  // eslint-disable-next-line react-hooks/exhaustive-deps
30129
30044
  floatingDeps
30130
30045
  );
30131
- const getItemProps = React6.useCallback(
30046
+ const getItemProps = React5.useCallback(
30132
30047
  (userProps) => mergeProps(userProps, propsList, "item"),
30133
30048
  // eslint-disable-next-line react-hooks/exhaustive-deps
30134
30049
  itemDeps
30135
30050
  );
30136
- return React6.useMemo(() => ({
30051
+ return React5.useMemo(() => ({
30137
30052
  getReferenceProps,
30138
30053
  getFloatingProps,
30139
30054
  getItemProps
@@ -30204,7 +30119,7 @@ var inner = (props) => ({
30204
30119
  scrollEl.scrollTop = diffY;
30205
30120
  if (onFallbackChange) {
30206
30121
  const shouldFallback = scrollEl.offsetHeight < item.offsetHeight * min(minItemsVisible, listRef.current.length) - 1 || refOverflow.top >= -referenceOverflowThreshold || refOverflow.bottom >= -referenceOverflowThreshold;
30207
- ReactDOM3.flushSync(() => onFallbackChange(shouldFallback));
30122
+ ReactDOM2.flushSync(() => onFallbackChange(shouldFallback));
30208
30123
  }
30209
30124
  if (overflowRef) {
30210
30125
  overflowRef.current = await detectOverflow2(getArgsWithCustomFloatingHeight({
@@ -30229,10 +30144,10 @@ function useInnerOffset(context, props) {
30229
30144
  onChange: unstable_onChange
30230
30145
  } = props;
30231
30146
  const onChange = useEffectEvent(unstable_onChange);
30232
- const controlledScrollingRef = React6.useRef(false);
30233
- const prevScrollTopRef = React6.useRef(null);
30234
- const initialOverflowRef = React6.useRef(null);
30235
- React6.useEffect(() => {
30147
+ const controlledScrollingRef = React5.useRef(false);
30148
+ const prevScrollTopRef = React5.useRef(null);
30149
+ const initialOverflowRef = React5.useRef(null);
30150
+ React5.useEffect(() => {
30236
30151
  if (!enabled)
30237
30152
  return;
30238
30153
  function onWheel(e10) {
@@ -30250,7 +30165,7 @@ function useInnerOffset(context, props) {
30250
30165
  }
30251
30166
  if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {
30252
30167
  e10.preventDefault();
30253
- ReactDOM3.flushSync(() => {
30168
+ ReactDOM2.flushSync(() => {
30254
30169
  onChange((d9) => d9 + Math[method](dY, remainingScroll * sign));
30255
30170
  });
30256
30171
  } else if (/firefox/i.test(getUserAgent())) {
@@ -30275,7 +30190,7 @@ function useInnerOffset(context, props) {
30275
30190
  };
30276
30191
  }
30277
30192
  }, [enabled, open, elements.floating, overflowRef, scrollRef, onChange]);
30278
- const floating = React6.useMemo(() => ({
30193
+ const floating = React5.useMemo(() => ({
30279
30194
  onKeyDown() {
30280
30195
  controlledScrollingRef.current = true;
30281
30196
  },
@@ -30293,7 +30208,7 @@ function useInnerOffset(context, props) {
30293
30208
  if (prevScrollTopRef.current !== null) {
30294
30209
  const scrollDiff = el.scrollTop - prevScrollTopRef.current;
30295
30210
  if (overflowRef.current.bottom < -0.5 && scrollDiff < -1 || overflowRef.current.top < -0.5 && scrollDiff > 1) {
30296
- ReactDOM3.flushSync(() => onChange((d9) => d9 + scrollDiff));
30211
+ ReactDOM2.flushSync(() => onChange((d9) => d9 + scrollDiff));
30297
30212
  }
30298
30213
  }
30299
30214
  requestAnimationFrame(() => {
@@ -30301,7 +30216,7 @@ function useInnerOffset(context, props) {
30301
30216
  });
30302
30217
  }
30303
30218
  }), [elements.floating, onChange, overflowRef, scrollRef]);
30304
- return React6.useMemo(() => enabled ? {
30219
+ return React5.useMemo(() => enabled ? {
30305
30220
  floating
30306
30221
  } : {}, [enabled, floating]);
30307
30222
  }
@@ -32659,7 +32574,7 @@ var MiddlewareServiceGroup = ({ expanded, onToggle, loading, settings, onChange
32659
32574
  var Service_default = MiddlewareServiceGroup;
32660
32575
 
32661
32576
  // src/components/encoder/DvB.tsx
32662
- import { useState as useState12, useEffect as useEffect9, useImperativeHandle, forwardRef as forwardRef4 } from "react";
32577
+ import { useState as useState12, useEffect as useEffect9 } from "react";
32663
32578
  import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
32664
32579
  var defaultDvBSettings = {
32665
32580
  engine: "cpu",
@@ -32804,7 +32719,8 @@ var normalizeDvBData = (data) => {
32804
32719
  protocol: parseProtocolUrl(data.output_url || defaultProtocolSettings.ffurl)
32805
32720
  };
32806
32721
  };
32807
- var DvB = forwardRef4(function DvB2({ settings, setSettings, encoderId, isLoading, setIsLoading }, ref) {
32722
+ var DvB = function DvB2(props) {
32723
+ const { settings, setSettings, encoderId, isLoading, setIsLoading, ref } = props;
32808
32724
  const [internalSettings, setInternalSettings] = useState12(defaultDvBSettings);
32809
32725
  const [expandedSections, setExpandedSections] = useState12({
32810
32726
  video: true,
@@ -32865,13 +32781,33 @@ var DvB = forwardRef4(function DvB2({ settings, setSettings, encoderId, isLoadin
32865
32781
  newTracks[idx] = { label: newTracks[idx].label, value: !newTracks[idx].value };
32866
32782
  setTracks(newTracks);
32867
32783
  };
32868
- useImperativeHandle(ref, () => ({
32869
- getSettings: () => ({ ...effectiveSettings, output_url: buildProtocolUrl(effectiveSettings.protocol) }),
32870
- reset: () => {
32871
- effectiveSetSettings(savedSettings);
32872
- },
32873
- isDirty: () => JSON.stringify(effectiveSettings) !== JSON.stringify(savedSettings)
32874
- }));
32784
+ useEffect9(() => {
32785
+ if (!ref)
32786
+ return;
32787
+ const impl = {
32788
+ getSettings: () => ({ ...effectiveSettings, output_url: buildProtocolUrl(effectiveSettings.protocol) }),
32789
+ reset: () => {
32790
+ effectiveSetSettings(savedSettings);
32791
+ },
32792
+ isDirty: () => JSON.stringify(effectiveSettings) !== JSON.stringify(savedSettings)
32793
+ };
32794
+ try {
32795
+ if (typeof ref === "function")
32796
+ ref(impl);
32797
+ else if ("current" in ref)
32798
+ ref.current = impl;
32799
+ } catch {
32800
+ }
32801
+ return () => {
32802
+ try {
32803
+ if (typeof ref === "function")
32804
+ ref(null);
32805
+ else if ("current" in ref)
32806
+ ref.current = null;
32807
+ } catch {
32808
+ }
32809
+ };
32810
+ }, [ref, effectiveSettings, savedSettings, effectiveSetSettings]);
32875
32811
  return /* @__PURE__ */ jsxs15("div", { className: "space-y-4 pl-4 border-l-[1px] border-gray-600 custom-scroll overflow-y-auto max-h-[670px]", children: [
32876
32812
  /* @__PURE__ */ jsxs15(VideoGroup_default, { expanded: expandedSections.video, onToggle: toggleSection, loading: isLoading ?? false, children: [
32877
32813
  /* @__PURE__ */ jsxs15("div", { children: [
@@ -33218,11 +33154,11 @@ var DvB = forwardRef4(function DvB2({ settings, setSettings, encoderId, isLoadin
33218
33154
  }
33219
33155
  )
33220
33156
  ] });
33221
- });
33157
+ };
33222
33158
  var DvB_default = DvB;
33223
33159
 
33224
33160
  // src/components/encoder/Livecast.tsx
33225
- import { useState as useState13, useEffect as useEffect10, useImperativeHandle as useImperativeHandle2, forwardRef as forwardRef5 } from "react";
33161
+ import { useState as useState13, useEffect as useEffect10 } from "react";
33226
33162
  import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
33227
33163
  var defaultLivecastSettings = {
33228
33164
  service_label: "Encoder 2",
@@ -33346,7 +33282,8 @@ var normalizeLivecastData = (data) => {
33346
33282
  protocol: parsed
33347
33283
  };
33348
33284
  };
33349
- var Livecast = forwardRef5(function Livecast2({ settings, setSettings, encoderId, isLoading, setIsLoading }, ref) {
33285
+ var Livecast = function Livecast2(props) {
33286
+ const { settings, setSettings, encoderId, isLoading, setIsLoading, ref } = props;
33350
33287
  const [expandedSections, setExpandedSections] = useState13({
33351
33288
  video: true,
33352
33289
  audio: false,
@@ -33402,16 +33339,33 @@ var Livecast = forwardRef5(function Livecast2({ settings, setSettings, encoderId
33402
33339
  const next = { ...effectiveSettings, [key]: !effectiveSettings[key] };
33403
33340
  effectiveSetSettings(next);
33404
33341
  };
33405
- useImperativeHandle2(ref, () => ({
33406
- getSettings: () => ({
33407
- ...effectiveSettings,
33408
- send_url: buildProtocolUrl2(effectiveSettings.protocol)
33409
- }),
33410
- reset: () => {
33411
- effectiveSetSettings(savedSettings);
33412
- },
33413
- isDirty: () => JSON.stringify(effectiveSettings) !== JSON.stringify(savedSettings)
33414
- }));
33342
+ useEffect10(() => {
33343
+ if (!ref)
33344
+ return;
33345
+ const impl = {
33346
+ getSettings: () => ({ ...effectiveSettings, send_url: buildProtocolUrl2(effectiveSettings.protocol) }),
33347
+ reset: () => {
33348
+ effectiveSetSettings(savedSettings);
33349
+ },
33350
+ isDirty: () => JSON.stringify(effectiveSettings) !== JSON.stringify(savedSettings)
33351
+ };
33352
+ try {
33353
+ if (typeof ref === "function")
33354
+ ref(impl);
33355
+ else if ("current" in ref)
33356
+ ref.current = impl;
33357
+ } catch {
33358
+ }
33359
+ return () => {
33360
+ try {
33361
+ if (typeof ref === "function")
33362
+ ref(null);
33363
+ else if ("current" in ref)
33364
+ ref.current = null;
33365
+ } catch {
33366
+ }
33367
+ };
33368
+ }, [ref, effectiveSettings, savedSettings, effectiveSetSettings]);
33415
33369
  return /* @__PURE__ */ jsxs16("div", { className: "space-y-4 px-4 border-x-[1px] border-gray-500 custom-scroll overflow-y-auto max-h-[670px]", children: [
33416
33370
  /* @__PURE__ */ jsx19(VideoGroup_default, { expanded: expandedSections.video, onToggle: toggleSection, loading: isLoading ?? false, children: /* @__PURE__ */ jsxs16("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-4", children: [
33417
33371
  /* @__PURE__ */ jsx19(
@@ -33562,7 +33516,7 @@ var Livecast = forwardRef5(function Livecast2({ settings, setSettings, encoderId
33562
33516
  }
33563
33517
  )
33564
33518
  ] });
33565
- });
33519
+ };
33566
33520
  var Livecast_default = Livecast;
33567
33521
 
33568
33522
  // src/components/encoder/ViewLog.tsx
@@ -34345,11 +34299,11 @@ var EditInPlaceField = ({ initialValue, onSave }) => {
34345
34299
  var EditInPlaceField_default = EditInPlaceField;
34346
34300
 
34347
34301
  // src/context/ThemeContext.tsx
34348
- import { createContext as createContext4, useContext as useContext4, useEffect as useEffect14, useState as useState18 } from "react";
34302
+ import { createContext as createContext4, use as use3, useEffect as useEffect14, useState as useState18 } from "react";
34349
34303
  import { jsx as jsx25 } from "react/jsx-runtime";
34350
34304
  var ThemeContext = createContext4(void 0);
34351
34305
  function useTheme() {
34352
- const context = useContext4(ThemeContext);
34306
+ const context = use3(ThemeContext);
34353
34307
  if (context === void 0) {
34354
34308
  throw new Error("useTheme must be used within a ThemeProvider");
34355
34309
  }
@@ -35326,18 +35280,18 @@ var Footer = () => {
35326
35280
  var Footer_default = Footer;
35327
35281
 
35328
35282
  // src/components/main/Header.tsx
35329
- import React19, { useEffect as useEffect15, useState as useState21 } from "react";
35283
+ import React18, { useEffect as useEffect15, useState as useState21 } from "react";
35330
35284
  import { Link as Link3 } from "react-router-dom";
35331
35285
  import { Fragment as Fragment3, jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
35332
35286
  function classNames(...classes) {
35333
35287
  return classes.filter(Boolean).join(" ");
35334
35288
  }
35335
35289
  var Header = ({ isSidebarOpen, setSidebarOpen, onNavigate }) => {
35336
- const [status, setStatus] = React19.useState(null);
35337
- const [loading, setLoading] = React19.useState(true);
35338
- const [error2, setError] = React19.useState(null);
35290
+ const [status, setStatus] = React18.useState(null);
35291
+ const [loading, setLoading] = React18.useState(true);
35292
+ const [error2, setError] = React18.useState(null);
35339
35293
  const { theme, toggleTheme } = useTheme();
35340
- React19.useEffect(() => {
35294
+ React18.useEffect(() => {
35341
35295
  let active = true;
35342
35296
  (async () => {
35343
35297
  try {
@@ -35696,7 +35650,7 @@ var Header = ({ isSidebarOpen, setSidebarOpen, onNavigate }) => {
35696
35650
  var Header_default = Header;
35697
35651
 
35698
35652
  // src/components/main/PageHeader.tsx
35699
- import React20 from "react";
35653
+ import React19 from "react";
35700
35654
  import { Fragment as Fragment4, jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
35701
35655
  var PageHeader = ({
35702
35656
  icon,
@@ -35706,7 +35660,7 @@ var PageHeader = ({
35706
35660
  hasStates = false,
35707
35661
  children
35708
35662
  }) => {
35709
- const [currentState, setState] = React20.useState(state);
35663
+ const [currentState, setState] = React19.useState(state);
35710
35664
  const startStop = () => {
35711
35665
  setState(currentState == "start" ? "stop" : "start");
35712
35666
  console.log("here", currentState);
@@ -36586,6 +36540,20 @@ var InterfacesTimeseries = ({
36586
36540
  };
36587
36541
  var InterfacesTimeseries_default = InterfacesTimeseries;
36588
36542
 
36543
+ // src/components/network/validators.ts
36544
+ var isValidIPv4 = (ip) => {
36545
+ if (!ip)
36546
+ return false;
36547
+ const ipv4Regex = /^(25[0-5]|2[0-4]\d|1?\d?\d)(\.(25[0-5]|2[0-4]\d|1?\d?\d)){3}$/;
36548
+ return ipv4Regex.test(ip.trim());
36549
+ };
36550
+ var isValidIPv6 = (ip) => {
36551
+ if (!ip)
36552
+ return false;
36553
+ const ipv6Regex = /^(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}$|^((?:[A-F0-9]{1,4}(?::|$)){1,8})$/i;
36554
+ return ipv6Regex.test(ip.trim());
36555
+ };
36556
+
36589
36557
  // src/components/system/RequireAuth.tsx
36590
36558
  import { Navigate } from "react-router-dom";
36591
36559
  import { jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
@@ -36625,7 +36593,7 @@ var RequireAuth_default = RequireAuth;
36625
36593
  import { useEffect as useEffect19, useState as useState26 } from "react";
36626
36594
 
36627
36595
  // node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.2_typescript@5.9.3__react-dom@19.2.4_react@19.2.4__react@19.2.4_typescript@5.9.3/node_modules/react-i18next/dist/es/Trans.js
36628
- import { useContext as useContext5 } from "react";
36596
+ import { useContext as useContext2 } from "react";
36629
36597
 
36630
36598
  // node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.2_typescript@5.9.3__react-dom@19.2.4_react@19.2.4__react@19.2.4_typescript@5.9.3/node_modules/react-i18next/dist/es/TransWithoutContext.js
36631
36599
  import { Fragment as Fragment7, isValidElement, cloneElement as cloneElement2, createElement as createElement5, Children } from "react";
@@ -39018,7 +38986,7 @@ var dir = instance.dir;
39018
38986
  var init = instance.init;
39019
38987
  var loadResources = instance.loadResources;
39020
38988
  var reloadResources = instance.reloadResources;
39021
- var use = instance.use;
38989
+ var use4 = instance.use;
39022
38990
  var changeLanguage = instance.changeLanguage;
39023
38991
  var getFixedT = instance.getFixedT;
39024
38992
  var t14 = instance.t;
@@ -39185,10 +39153,10 @@ var ReportNamespaces = class {
39185
39153
  };
39186
39154
 
39187
39155
  // node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.2_typescript@5.9.3__react-dom@19.2.4_react@19.2.4__react@19.2.4_typescript@5.9.3/node_modules/react-i18next/dist/es/IcuTrans.js
39188
- import { useContext as useContext6 } from "react";
39156
+ import { useContext as useContext3 } from "react";
39189
39157
 
39190
39158
  // node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.2_typescript@5.9.3__react-dom@19.2.4_react@19.2.4__react@19.2.4_typescript@5.9.3/node_modules/react-i18next/dist/es/IcuTransWithoutContext.js
39191
- import React25 from "react";
39159
+ import React24 from "react";
39192
39160
 
39193
39161
  // node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.2_typescript@5.9.3__react-dom@19.2.4_react@19.2.4__react@19.2.4_typescript@5.9.3/node_modules/react-i18next/dist/es/IcuTransUtils/TranslationParserError.js
39194
39162
  var TranslationParserError = class _TranslationParserError extends Error {
@@ -39470,7 +39438,7 @@ var tokenize = (translation) => {
39470
39438
  };
39471
39439
 
39472
39440
  // node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.2_typescript@5.9.3__react-dom@19.2.4_react@19.2.4__react@19.2.4_typescript@5.9.3/node_modules/react-i18next/dist/es/IcuTransUtils/renderTranslation.js
39473
- import React24 from "react";
39441
+ import React23 from "react";
39474
39442
  var renderDeclarationNode = (declaration, children, childDeclarations) => {
39475
39443
  const {
39476
39444
  type,
@@ -39481,15 +39449,15 @@ var renderDeclarationNode = (declaration, children, childDeclarations) => {
39481
39449
  children: _childrenToRemove,
39482
39450
  ...propsWithoutChildren
39483
39451
  } = props;
39484
- return React24.createElement(type, propsWithoutChildren, ...children);
39452
+ return React23.createElement(type, propsWithoutChildren, ...children);
39485
39453
  }
39486
39454
  if (children.length === 0) {
39487
- return React24.createElement(type, props);
39455
+ return React23.createElement(type, props);
39488
39456
  }
39489
39457
  if (children.length === 1) {
39490
- return React24.createElement(type, props, children[0]);
39458
+ return React23.createElement(type, props, children[0]);
39491
39459
  }
39492
- return React24.createElement(type, props, ...children);
39460
+ return React23.createElement(type, props, ...children);
39493
39461
  };
39494
39462
  var renderTranslation = (translation, declarations = []) => {
39495
39463
  if (!translation) {
@@ -39589,7 +39557,7 @@ function IcuTransWithoutContext({
39589
39557
  warnOnce(i18n, "NO_I18NEXT_INSTANCE", `IcuTrans: You need to pass in an i18next instance using i18nextReactModule`, {
39590
39558
  i18nKey
39591
39559
  });
39592
- return React25.createElement(React25.Fragment, {}, defaultTranslation);
39560
+ return React24.createElement(React24.Fragment, {}, defaultTranslation);
39593
39561
  }
39594
39562
  const t15 = tFromProps || i18n.t?.bind(i18n) || ((k11) => k11);
39595
39563
  let namespaces = ns || t15.ns || i18n.options?.defaultNS;
@@ -39610,13 +39578,13 @@ function IcuTransWithoutContext({
39610
39578
  });
39611
39579
  try {
39612
39580
  const rendered = renderTranslation(translation, content);
39613
- return React25.createElement(React25.Fragment, {}, ...rendered);
39581
+ return React24.createElement(React24.Fragment, {}, ...rendered);
39614
39582
  } catch (error2) {
39615
39583
  warn2(i18n, "ICU_TRANS_RENDER_ERROR", `IcuTrans component error for key "${i18nKey}": ${error2.message}`, {
39616
39584
  i18nKey,
39617
39585
  error: error2
39618
39586
  });
39619
- return React25.createElement(React25.Fragment, {}, translation);
39587
+ return React24.createElement(React24.Fragment, {}, translation);
39620
39588
  }
39621
39589
  }
39622
39590
  IcuTransWithoutContext.displayName = "IcuTransWithoutContext";
@@ -39634,7 +39602,7 @@ function IcuTrans({
39634
39602
  const {
39635
39603
  i18n: i18nFromContext,
39636
39604
  defaultNS: defaultNSFromContext
39637
- } = useContext6(I18nContext) || {};
39605
+ } = useContext3(I18nContext) || {};
39638
39606
  const i18n = i18nFromProps || i18nFromContext || getI18n();
39639
39607
  const t15 = tFromProps || i18n?.t.bind(i18n);
39640
39608
  return IcuTransWithoutContext({
@@ -39650,7 +39618,7 @@ function IcuTrans({
39650
39618
  IcuTrans.displayName = "IcuTrans";
39651
39619
 
39652
39620
  // node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.2_typescript@5.9.3__react-dom@19.2.4_react@19.2.4__react@19.2.4_typescript@5.9.3/node_modules/react-i18next/dist/es/useTranslation.js
39653
- import { useContext as useContext7, useCallback as useCallback3, useMemo as useMemo6, useEffect as useEffect18, useRef as useRef9, useState as useState25 } from "react";
39621
+ import { useContext as useContext4, useCallback as useCallback3, useMemo as useMemo6, useEffect as useEffect18, useRef as useRef9, useState as useState25 } from "react";
39654
39622
  import { useSyncExternalStore } from "use-sync-external-store/shim";
39655
39623
  var notReadyT = (k11, optsOrDefaultValue) => {
39656
39624
  if (isString3(optsOrDefaultValue))
@@ -39672,7 +39640,7 @@ var useTranslation = (ns, props = {}) => {
39672
39640
  const {
39673
39641
  i18n: i18nFromContext,
39674
39642
  defaultNS: defaultNSFromContext
39675
- } = useContext7(I18nContext) || {};
39643
+ } = useContext4(I18nContext) || {};
39676
39644
  const i18n = i18nFromProps || i18nFromContext || getI18n();
39677
39645
  if (i18n && !i18n.reportNamespaces)
39678
39646
  i18n.reportNamespaces = new ReportNamespaces();
@@ -39822,7 +39790,7 @@ import { createElement as createElement7, useMemo as useMemo7 } from "react";
39822
39790
  import { createElement as createElement8 } from "react";
39823
39791
 
39824
39792
  // node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.2_typescript@5.9.3__react-dom@19.2.4_react@19.2.4__react@19.2.4_typescript@5.9.3/node_modules/react-i18next/dist/es/useSSR.js
39825
- import { useContext as useContext8 } from "react";
39793
+ import { useContext as useContext5 } from "react";
39826
39794
 
39827
39795
  // src/locales/pt/translation.json
39828
39796
  var translation_default = {
@@ -40059,7 +40027,7 @@ instance.use(initReactI18next).init({
40059
40027
  var i18n_default = instance;
40060
40028
 
40061
40029
  // src/context/SharedUiProvider.tsx
40062
- import React26 from "react";
40030
+ import React25 from "react";
40063
40031
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
40064
40032
  import { jsx as jsx41 } from "react/jsx-runtime";
40065
40033
 
@@ -40302,48 +40270,13 @@ var ConfigWizard = ({ basePath = "./config-xcoder-wizard/php", onComplete }) =>
40302
40270
  };
40303
40271
  var Wizard_default = ConfigWizard;
40304
40272
 
40305
- // src/components/RemoteModule.tsx
40306
- import { useEffect as useEffect20, useState as useState27 } from "react";
40307
- import { Fragment as Fragment8, jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
40308
- function RemoteModule({ scope, url, module, fallback }) {
40309
- const [Component2, setComponent] = useState27(null);
40310
- const [error2, setError] = useState27(null);
40311
- const [loading, setLoading] = useState27(true);
40312
- useEffect20(() => {
40313
- setLoading(true);
40314
- setError(null);
40315
- loadRemoteModule({ scope, url, module }).then((mod) => {
40316
- setComponent(() => mod);
40317
- }).catch((err) => {
40318
- console.error("Erro ao carregar m\xF3dulo:", err);
40319
- setError(err.message);
40320
- }).finally(() => {
40321
- setLoading(false);
40322
- });
40323
- }, [scope, url, module]);
40324
- if (loading) {
40325
- return /* @__PURE__ */ jsx43("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ jsx43("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-primary dark:border-primary-purple" }) });
40326
- }
40327
- if (error2) {
40328
- return /* @__PURE__ */ jsxs38("div", { className: "p-6 bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-800 rounded-lg", children: [
40329
- /* @__PURE__ */ jsx43("h3", { className: "text-lg font-semibold text-red-800 dark:text-red-300 mb-2", children: "Erro ao carregar m\xF3dulo" }),
40330
- /* @__PURE__ */ jsx43("p", { className: "text-red-600 dark:text-red-400", children: error2 }),
40331
- /* @__PURE__ */ jsx43("p", { className: "text-sm text-red-500 dark:text-red-500 mt-2", children: "Verifique se o m\xF3dulo est\xE1 instalado e o servidor est\xE1 rodando." })
40332
- ] });
40333
- }
40334
- if (!Component2) {
40335
- return /* @__PURE__ */ jsx43(Fragment8, { children: fallback || /* @__PURE__ */ jsx43("div", { className: "p-4 text-neutral-500 dark:text-neutral-400", children: "M\xF3dulo n\xE3o encontrado" }) });
40336
- }
40337
- return /* @__PURE__ */ jsx43(Component2, {});
40338
- }
40339
-
40340
40273
  // src/components/xcoder/Fflog.tsx
40341
- import { useEffect as useEffect21, useState as useState28 } from "react";
40342
- import { jsx as jsx44, jsxs as jsxs39 } from "react/jsx-runtime";
40274
+ import { useEffect as useEffect20, useState as useState27 } from "react";
40275
+ import { jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
40343
40276
  var Fflog = ({ index: index3 }) => {
40344
- const [message, setMessage] = useState28("");
40345
- const [tooltip, setTooltip] = useState28("Copy to Clipboard");
40346
- useEffect21(() => {
40277
+ const [message, setMessage] = useState27("");
40278
+ const [tooltip, setTooltip] = useState27("Copy to Clipboard");
40279
+ useEffect20(() => {
40347
40280
  const cleanupSocket = subscribeToWebsocket(buildWsUrl("/ws"), (data) => {
40348
40281
  const aux = data?.logs[index3 - 1];
40349
40282
  setMessage(aux.log);
@@ -40356,7 +40289,7 @@ var Fflog = ({ index: index3 }) => {
40356
40289
  cleanupSocket();
40357
40290
  };
40358
40291
  }, []);
40359
- return /* @__PURE__ */ jsxs39(
40292
+ return /* @__PURE__ */ jsxs38(
40360
40293
  "div",
40361
40294
  {
40362
40295
  "data-tooltip-id": "tooltip",
@@ -40371,8 +40304,8 @@ var Fflog = ({ index: index3 }) => {
40371
40304
  },
40372
40305
  onMouseLeave: () => message == "" ? setTooltip("Copy to Clipboard") : "",
40373
40306
  children: [
40374
- /* @__PURE__ */ jsx44(M10, { id: "tooltip" }),
40375
- /* @__PURE__ */ jsx44("p", { className: "relative mt-[-10px] text-justify text-gray-900 dark:text-slate-200 font-mono", style: { overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" }, children: message })
40307
+ /* @__PURE__ */ jsx43(M10, { id: "tooltip" }),
40308
+ /* @__PURE__ */ jsx43("p", { className: "relative mt-[-10px] text-justify text-gray-900 dark:text-slate-200 font-mono", style: { overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" }, children: message })
40376
40309
  ]
40377
40310
  }
40378
40311
  );
@@ -40380,7 +40313,7 @@ var Fflog = ({ index: index3 }) => {
40380
40313
  var Fflog_default = Fflog;
40381
40314
 
40382
40315
  // src/components/xcoder/Metrics.tsx
40383
- import { jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
40316
+ import { jsx as jsx44, jsxs as jsxs39 } from "react/jsx-runtime";
40384
40317
  var MetricBar = ({ label, value, suffix, color }) => {
40385
40318
  const colorClasses = {
40386
40319
  blue: "bg-blue-500",
@@ -40389,15 +40322,15 @@ var MetricBar = ({ label, value, suffix, color }) => {
40389
40322
  cyan: "bg-cyan-500",
40390
40323
  pink: "bg-pink-500"
40391
40324
  };
40392
- return /* @__PURE__ */ jsxs40("div", { className: "space-y-1", children: [
40393
- /* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between text-sm", children: [
40394
- /* @__PURE__ */ jsx45("span", { className: "text-gray-900 dark:text-slate-400", children: label }),
40395
- /* @__PURE__ */ jsxs40("span", { className: "text-gray-900 dark:text-white font-mono", children: [
40325
+ return /* @__PURE__ */ jsxs39("div", { className: "space-y-1", children: [
40326
+ /* @__PURE__ */ jsxs39("div", { className: "flex items-center justify-between text-sm", children: [
40327
+ /* @__PURE__ */ jsx44("span", { className: "text-gray-900 dark:text-slate-400", children: label }),
40328
+ /* @__PURE__ */ jsxs39("span", { className: "text-gray-900 dark:text-white font-mono", children: [
40396
40329
  Math.round(value),
40397
40330
  suffix
40398
40331
  ] })
40399
40332
  ] }),
40400
- /* @__PURE__ */ jsx45("div", { className: "h-2 bg-slate-300 dark:bg-slate-800 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx45(
40333
+ /* @__PURE__ */ jsx44("div", { className: "h-2 bg-slate-300 dark:bg-slate-800 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx44(
40401
40334
  "div",
40402
40335
  {
40403
40336
  className: `h-full transition-all duration-300 ${colorClasses[color]}`,
@@ -40409,8 +40342,8 @@ var MetricBar = ({ label, value, suffix, color }) => {
40409
40342
  var Metrics_default = MetricBar;
40410
40343
 
40411
40344
  // src/components/xcoder/Panel.tsx
40412
- import { useState as useState29, useEffect as useEffect22 } from "react";
40413
- import { Fragment as Fragment9, jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
40345
+ import { useState as useState28, useEffect as useEffect21 } from "react";
40346
+ import { Fragment as Fragment8, jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
40414
40347
  var convertServiceToOption = (serviceString) => {
40415
40348
  const match = serviceString.match(/^([^@]+)@/);
40416
40349
  if (!match) {
@@ -40424,12 +40357,12 @@ var convertServiceToOption = (serviceString) => {
40424
40357
  return { label, value: rawValue };
40425
40358
  };
40426
40359
  var EncoderDecoderPanel = ({ index: index3 }) => {
40427
- const [status, setStatus] = useState29("idle");
40428
- const [modes, setModes] = useState29([]);
40429
- const [oldModes, setOldModes] = useState29(modes);
40430
- const [open, setOpen] = useState29(false);
40431
- const [optionsList, setOptionsList] = useState29([]);
40432
- useEffect22(() => {
40360
+ const [status, setStatus] = useState28("idle");
40361
+ const [modes, setModes] = useState28([]);
40362
+ const [oldModes, setOldModes] = useState28(modes);
40363
+ const [open, setOpen] = useState28(false);
40364
+ const [optionsList, setOptionsList] = useState28([]);
40365
+ useEffect21(() => {
40433
40366
  const cleanupSocket = subscribeToWebsocket(buildWsUrl("/"), (data) => {
40434
40367
  setStatus(data?.services[`xcoder_${index3}`].status);
40435
40368
  });
@@ -40463,52 +40396,52 @@ var EncoderDecoderPanel = ({ index: index3 }) => {
40463
40396
  m: state ? "stop" : "start"
40464
40397
  });
40465
40398
  };
40466
- return /* @__PURE__ */ jsxs41("div", { className: "bg-gray-200 dark:bg-slate-900/50 border bg-gray-200 border-gray-400 dark:border-slate-800 rounded-lg", children: [
40467
- /* @__PURE__ */ jsxs41("div", { className: "px-6 py-3 border-b border-slate-800 flex items-center justify-between", children: [
40468
- /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-3", children: [
40469
- /* @__PURE__ */ jsx46(Radio, { className: "w-5 h-5 text-blue-500" }),
40470
- /* @__PURE__ */ jsx46("h1", { className: "text-base font-medium text-gray-800 dark:text-white hover:underline", children: /* @__PURE__ */ jsxs41("a", { href: `/page/${modes[index3 - 1]?.split("@")[0] ?? "encoder-dvb"}?channel=${index3}`, children: [
40399
+ return /* @__PURE__ */ jsxs40("div", { className: "bg-gray-200 dark:bg-slate-900/50 border bg-gray-200 border-gray-400 dark:border-slate-800 rounded-lg", children: [
40400
+ /* @__PURE__ */ jsxs40("div", { className: "px-6 py-3 border-b border-slate-800 flex items-center justify-between", children: [
40401
+ /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-3", children: [
40402
+ /* @__PURE__ */ jsx45(Radio, { className: "w-5 h-5 text-blue-500" }),
40403
+ /* @__PURE__ */ jsx45("h1", { className: "text-base font-medium text-gray-800 dark:text-white hover:underline", children: /* @__PURE__ */ jsxs40("a", { href: `/page/${modes[index3 - 1]?.split("@")[0] ?? "encoder-dvb"}?channel=${index3}`, children: [
40471
40404
  "Xcoder BMD Video Interface (",
40472
40405
  index3,
40473
40406
  ")"
40474
40407
  ] }) })
40475
40408
  ] }),
40476
- /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-4", children: [
40477
- /* @__PURE__ */ jsx46(
40409
+ /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-4", children: [
40410
+ /* @__PURE__ */ jsx45(
40478
40411
  "button",
40479
40412
  {
40480
40413
  onClick: () => startStop(status == "running"),
40481
40414
  className: `flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-all ${status == "running" ? "bg-red-600 hover:bg-red-700 text-white" : "bg-blue-600 hover:bg-blue-700 text-white"}`,
40482
- children: status == "running" ? /* @__PURE__ */ jsxs41(Fragment9, { children: [
40483
- /* @__PURE__ */ jsx46(Pause, { className: "w-4 h-4" }),
40415
+ children: status == "running" ? /* @__PURE__ */ jsxs40(Fragment8, { children: [
40416
+ /* @__PURE__ */ jsx45(Pause, { className: "w-4 h-4" }),
40484
40417
  "Stop"
40485
- ] }) : /* @__PURE__ */ jsxs41(Fragment9, { children: [
40486
- /* @__PURE__ */ jsx46(Play, { className: "w-4 h-4" }),
40418
+ ] }) : /* @__PURE__ */ jsxs40(Fragment8, { children: [
40419
+ /* @__PURE__ */ jsx45(Play, { className: "w-4 h-4" }),
40487
40420
  "Start"
40488
40421
  ] })
40489
40422
  }
40490
40423
  ),
40491
- /* @__PURE__ */ jsxs41("div", { className: `flex w-[100px] justify-center items-center gap-2 px-4 py-2 rounded-md ${status == "running" ? "bg-yellow-600" : "bg-slate-700"}`, children: [
40492
- /* @__PURE__ */ jsx46("div", { className: `w-2 h-2 rounded-full bg-white ${status == "running" ? "block" : "hidden"}` }),
40493
- /* @__PURE__ */ jsx46("span", { className: "text-sm text-slate-100 font-mono font-bold", children: status == "running" ? "READY" : "STANDBY" })
40424
+ /* @__PURE__ */ jsxs40("div", { className: `flex w-[100px] justify-center items-center gap-2 px-4 py-2 rounded-md ${status == "running" ? "bg-yellow-600" : "bg-slate-700"}`, children: [
40425
+ /* @__PURE__ */ jsx45("div", { className: `w-2 h-2 rounded-full bg-white ${status == "running" ? "block" : "hidden"}` }),
40426
+ /* @__PURE__ */ jsx45("span", { className: "text-sm text-slate-100 font-mono font-bold", children: status == "running" ? "READY" : "STANDBY" })
40494
40427
  ] }),
40495
- /* @__PURE__ */ jsx46(
40428
+ /* @__PURE__ */ jsx45(
40496
40429
  "button",
40497
40430
  {
40498
40431
  onClick: () => setOpen(true),
40499
40432
  className: "p-2 rounded-md transition-colors",
40500
- children: /* @__PURE__ */ jsx46(Settings, { className: "w-5 h-5 text-slate-400 hover:text-blue-400" })
40433
+ children: /* @__PURE__ */ jsx45(Settings, { className: "w-5 h-5 text-slate-400 hover:text-blue-400" })
40501
40434
  }
40502
40435
  )
40503
40436
  ] })
40504
40437
  ] }),
40505
- /* @__PURE__ */ jsx46(
40438
+ /* @__PURE__ */ jsx45(
40506
40439
  Modal_default,
40507
40440
  {
40508
40441
  open,
40509
40442
  setOpen,
40510
40443
  title: "Switching Operation Mode",
40511
- element: /* @__PURE__ */ jsx46("div", { children: optionsList[index3 - 1] && /* @__PURE__ */ jsx46("div", { className: "relative p-6", children: /* @__PURE__ */ jsx46(
40444
+ element: /* @__PURE__ */ jsx45("div", { children: optionsList[index3 - 1] && /* @__PURE__ */ jsx45("div", { className: "relative p-6", children: /* @__PURE__ */ jsx45(
40512
40445
  SelectField_default,
40513
40446
  {
40514
40447
  label: "New Mode",
@@ -40529,15 +40462,15 @@ var EncoderDecoderPanel = ({ index: index3 }) => {
40529
40462
  }
40530
40463
  }
40531
40464
  ),
40532
- /* @__PURE__ */ jsx46("div", { className: "p-6", children: /* @__PURE__ */ jsx46(Preview_default, { index: index3, setVuPts: () => {
40465
+ /* @__PURE__ */ jsx45("div", { className: "p-6", children: /* @__PURE__ */ jsx45(Preview_default, { index: index3, setVuPts: () => {
40533
40466
  } }) })
40534
40467
  ] });
40535
40468
  };
40536
40469
  var Panel_default = EncoderDecoderPanel;
40537
40470
 
40538
40471
  // src/components/xcoder/Preview.tsx
40539
- import { useEffect as useEffect23, useLayoutEffect as useLayoutEffect3, useMemo as useMemo8, useRef as useRef10, useState as useState30 } from "react";
40540
- import { jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
40472
+ import { useEffect as useEffect22, useLayoutEffect as useLayoutEffect3, useMemo as useMemo8, useRef as useRef10, useState as useState29 } from "react";
40473
+ import { jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
40541
40474
  var Preview = ({
40542
40475
  index: index3,
40543
40476
  setVuPts,
@@ -40547,8 +40480,8 @@ var Preview = ({
40547
40480
  orientation = "horizontal"
40548
40481
  }) => {
40549
40482
  const logEndRef = useRef10(null);
40550
- const [message, setMessage] = useState30([]);
40551
- useEffect23(() => {
40483
+ const [message, setMessage] = useState29([]);
40484
+ useEffect22(() => {
40552
40485
  const cleanupSocket = subscribeToWebsocket(buildWsUrl("/"), (data) => {
40553
40486
  const aux = data?.services[`xcoder_${index3}`];
40554
40487
  setMessage(aux.decklinkEvents.split("\n"));
@@ -40557,21 +40490,21 @@ var Preview = ({
40557
40490
  cleanupSocket();
40558
40491
  };
40559
40492
  }, []);
40560
- useEffect23(() => {
40493
+ useEffect22(() => {
40561
40494
  if (logEndRef.current) {
40562
40495
  logEndRef.current.scrollTop = logEndRef.current.scrollHeight;
40563
40496
  }
40564
40497
  }, [message]);
40565
- const [vuChannels, setVuChannels] = useState30(
40498
+ const [vuChannels, setVuChannels] = useState29(
40566
40499
  Array(8).fill({ left: 0, right: 0 })
40567
40500
  );
40568
40501
  const channelCount = 8;
40569
40502
  const vuBars = useMemo8(() => {
40570
- return Array.from({ length: channelCount }, (_7, i14) => /* @__PURE__ */ jsx47(VUMeter_default, { index: i14, volume: vuChannels }, `vu-bar-${i14}`));
40503
+ return Array.from({ length: channelCount }, (_7, i14) => /* @__PURE__ */ jsx46(VUMeter_default, { index: i14, volume: vuChannels }, `vu-bar-${i14}`));
40571
40504
  }, [channelCount, vuChannels]);
40572
40505
  const playerRef = useRef10(null);
40573
40506
  const vuRef = useRef10(null);
40574
- const [height, setHeight] = useState30("auto");
40507
+ const [height, setHeight] = useState29("auto");
40575
40508
  useLayoutEffect3(() => {
40576
40509
  const p8 = playerRef.current;
40577
40510
  const v6 = vuRef.current;
@@ -40586,15 +40519,15 @@ var Preview = ({
40586
40519
  }
40587
40520
  ;
40588
40521
  }, []);
40589
- const [isOpen, setIsOpen] = useState30(false);
40590
- const logData = message.map((log, i14) => /* @__PURE__ */ jsx47("div", { className: "flex gap-2", children: /* @__PURE__ */ jsx47("span", { className: "text-slate-900 dark:text-slate-300 break-words", children: log }) }, i14));
40591
- return /* @__PURE__ */ jsxs42("div", { className: `"w-full h-full" ${orientation === "horizontal" ? "" : "py-6"}`, children: [
40592
- /* @__PURE__ */ jsxs42(
40522
+ const [isOpen, setIsOpen] = useState29(false);
40523
+ const logData = message.map((log, i14) => /* @__PURE__ */ jsx46("div", { className: "flex gap-2", children: /* @__PURE__ */ jsx46("span", { className: "text-slate-900 dark:text-slate-300 break-words", children: log }) }, i14));
40524
+ return /* @__PURE__ */ jsxs41("div", { className: `"w-full h-full" ${orientation === "horizontal" ? "" : "py-6"}`, children: [
40525
+ /* @__PURE__ */ jsxs41(
40593
40526
  "div",
40594
40527
  {
40595
40528
  className: `grid gap-6 mb-5 ${orientation === "horizontal" ? "grid-cols-[1fr_300px] items-start" : "grid-cols-1"}`,
40596
40529
  children: [
40597
- /* @__PURE__ */ jsx47("div", { ref: playerRef, className: "bg-black rounded-lg overflow-hidden aspect-video", children: /* @__PURE__ */ jsx47("div", { className: "w-full h-full relative flex items-center justify-center", children: /* @__PURE__ */ jsx47(
40530
+ /* @__PURE__ */ jsx46("div", { ref: playerRef, className: "bg-black rounded-lg overflow-hidden aspect-video", children: /* @__PURE__ */ jsx46("div", { className: "w-full h-full relative flex items-center justify-center", children: /* @__PURE__ */ jsx46(
40598
40531
  VideoPlayer_default,
40599
40532
  {
40600
40533
  pgmIndex: index3,
@@ -40603,10 +40536,10 @@ var Preview = ({
40603
40536
  setVuChannels
40604
40537
  }
40605
40538
  ) }) }),
40606
- /* @__PURE__ */ jsxs42("div", { className: `flex flex-col ${orientation === "horizontal" ? "h-full" : "h-[200px]"}`, children: [
40607
- /* @__PURE__ */ jsx47("div", { ref: vuRef, className: `bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg p-4 ${showDlog || showStreamControl ? "mb-5" : "flex-1"}`, children: /* @__PURE__ */ jsx47("div", { className: `flex justify-between items-end ${showDlog || showStreamControl ? "h-32" : "h-full"}`, children: vuBars }) }),
40608
- showStreamControl && /* @__PURE__ */ jsx47(StreamControl_default, { index: index3 }),
40609
- showDlog && /* @__PURE__ */ jsx47("div", { className: "bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg overflow-hidden flex-1", children: /* @__PURE__ */ jsxs42(
40539
+ /* @__PURE__ */ jsxs41("div", { className: `flex flex-col ${orientation === "horizontal" ? "h-full" : "h-[200px]"}`, children: [
40540
+ /* @__PURE__ */ jsx46("div", { ref: vuRef, className: `bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg p-4 ${showDlog || showStreamControl ? "mb-5" : "flex-1"}`, children: /* @__PURE__ */ jsx46("div", { className: `flex justify-between items-end ${showDlog || showStreamControl ? "h-32" : "h-full"}`, children: vuBars }) }),
40541
+ showStreamControl && /* @__PURE__ */ jsx46(StreamControl_default, { index: index3 }),
40542
+ showDlog && /* @__PURE__ */ jsx46("div", { className: "bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg overflow-hidden flex-1", children: /* @__PURE__ */ jsxs41(
40610
40543
  "div",
40611
40544
  {
40612
40545
  ref: logEndRef,
@@ -40617,7 +40550,7 @@ var Preview = ({
40617
40550
  style: { height },
40618
40551
  onClick: () => setIsOpen(true),
40619
40552
  children: [
40620
- /* @__PURE__ */ jsx47(M10, { id: "tooltip" }),
40553
+ /* @__PURE__ */ jsx46(M10, { id: "tooltip" }),
40621
40554
  logData
40622
40555
  ]
40623
40556
  }
@@ -40626,15 +40559,15 @@ var Preview = ({
40626
40559
  ]
40627
40560
  }
40628
40561
  ),
40629
- showFflog && /* @__PURE__ */ jsx47(Fflog_default, { index: index3 }),
40630
- /* @__PURE__ */ jsx47(
40562
+ showFflog && /* @__PURE__ */ jsx46(Fflog_default, { index: index3 }),
40563
+ /* @__PURE__ */ jsx46(
40631
40564
  Modal_default,
40632
40565
  {
40633
40566
  open: isOpen,
40634
40567
  setOpen: () => setIsOpen(!isOpen),
40635
40568
  title: "Log Message",
40636
- element: /* @__PURE__ */ jsx47("div", { className: "custom-scroll overflow-y-auto p-3 h-[300px]", children: logData }),
40637
- icon: /* @__PURE__ */ jsx47(FileClock, { "aria-hidden": "true", className: "size-6 text-yellow-600" }),
40569
+ element: /* @__PURE__ */ jsx46("div", { className: "custom-scroll overflow-y-auto p-3 h-[300px]", children: logData }),
40570
+ icon: /* @__PURE__ */ jsx46(FileClock, { "aria-hidden": "true", className: "size-6 text-yellow-600" }),
40638
40571
  positiveLabel: "Copy",
40639
40572
  positiveCommand: () => {
40640
40573
  navigator.clipboard.writeText(message.join("\n"));
@@ -40646,11 +40579,11 @@ var Preview = ({
40646
40579
  var Preview_default = Preview;
40647
40580
 
40648
40581
  // src/components/xcoder/StreamControl.tsx
40649
- import { useState as useState31 } from "react";
40650
- import { jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
40582
+ import { useState as useState30 } from "react";
40583
+ import { jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
40651
40584
  var StreamControl = ({ index: index3 }) => {
40652
- const [bufferValue, setBufferValue] = useState31(0);
40653
- const [syncValue, setSyncValue] = useState31(0);
40585
+ const [bufferValue, setBufferValue] = useState30(0);
40586
+ const [syncValue, setSyncValue] = useState30(0);
40654
40587
  const minBuffer = 0;
40655
40588
  const maxBuffer = 100;
40656
40589
  const minSync = -30;
@@ -40663,45 +40596,45 @@ var StreamControl = ({ index: index3 }) => {
40663
40596
  true,
40664
40597
  1e3
40665
40598
  );
40666
- return /* @__PURE__ */ jsxs43("div", { className: "w-80 space-y-3", children: [
40667
- /* @__PURE__ */ jsx48("div", { className: "bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg p-3 max-h-[300px] min-h-[100px] overflow-auto", children: /* @__PURE__ */ jsxs43("div", { className: "text-xs space-y-2 text-gray-800 dark:text-slate-200", children: [
40668
- /* @__PURE__ */ jsxs43("div", { className: "space-y-1", children: [
40669
- /* @__PURE__ */ jsxs43("div", { className: "flex gap-2", children: [
40670
- /* @__PURE__ */ jsx48("span", { className: "font-medium", children: "Service Name:" }),
40671
- /* @__PURE__ */ jsx48("span", { className: "truncate", children: data?.service_name ?? "\u2014" })
40599
+ return /* @__PURE__ */ jsxs42("div", { className: "w-80 space-y-3", children: [
40600
+ /* @__PURE__ */ jsx47("div", { className: "bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg p-3 max-h-[300px] min-h-[100px] overflow-auto", children: /* @__PURE__ */ jsxs42("div", { className: "text-xs space-y-2 text-gray-800 dark:text-slate-200", children: [
40601
+ /* @__PURE__ */ jsxs42("div", { className: "space-y-1", children: [
40602
+ /* @__PURE__ */ jsxs42("div", { className: "flex gap-2", children: [
40603
+ /* @__PURE__ */ jsx47("span", { className: "font-medium", children: "Service Name:" }),
40604
+ /* @__PURE__ */ jsx47("span", { className: "truncate", children: data?.service_name ?? "\u2014" })
40672
40605
  ] }),
40673
- /* @__PURE__ */ jsxs43("div", { className: "flex gap-2", children: [
40674
- /* @__PURE__ */ jsx48("span", { className: "font-medium", children: "Service Provider:" }),
40675
- /* @__PURE__ */ jsx48("span", { className: "truncate", children: data?.service_provider ?? "\u2014" })
40606
+ /* @__PURE__ */ jsxs42("div", { className: "flex gap-2", children: [
40607
+ /* @__PURE__ */ jsx47("span", { className: "font-medium", children: "Service Provider:" }),
40608
+ /* @__PURE__ */ jsx47("span", { className: "truncate", children: data?.service_provider ?? "\u2014" })
40676
40609
  ] })
40677
40610
  ] }),
40678
- /* @__PURE__ */ jsxs43("div", { className: "space-y-1.5 pt-2", children: [
40679
- /* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-2", children: [
40680
- /* @__PURE__ */ jsx48(Video, { className: "w-4 h-4 text-sky-400" }),
40681
- /* @__PURE__ */ jsxs43("span", { className: "truncate", children: [
40611
+ /* @__PURE__ */ jsxs42("div", { className: "space-y-1.5 pt-2", children: [
40612
+ /* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-2", children: [
40613
+ /* @__PURE__ */ jsx47(Video, { className: "w-4 h-4 text-sky-400" }),
40614
+ /* @__PURE__ */ jsxs42("span", { className: "truncate", children: [
40682
40615
  "Video 0: ",
40683
40616
  data?.input_streans[1].input_stream.type
40684
40617
  ] })
40685
40618
  ] }),
40686
- /* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-2", children: [
40687
- /* @__PURE__ */ jsx48(Volume2, { className: "w-4 h-4 text-emerald-400" }),
40688
- /* @__PURE__ */ jsxs43("span", { className: "truncate", children: [
40619
+ /* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-2", children: [
40620
+ /* @__PURE__ */ jsx47(Volume2, { className: "w-4 h-4 text-emerald-400" }),
40621
+ /* @__PURE__ */ jsxs42("span", { className: "truncate", children: [
40689
40622
  "Audio 1: ",
40690
40623
  data?.input_streans[0].input_stream.type
40691
40624
  ] })
40692
40625
  ] })
40693
40626
  ] })
40694
40627
  ] }) }),
40695
- /* @__PURE__ */ jsx48("div", { className: "bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg p-3", children: /* @__PURE__ */ jsxs43("div", { className: "space-y-3 text-slate-200 text-xs", children: [
40696
- /* @__PURE__ */ jsx48(SliderField_default, { value: bufferValue, setValue: setBufferValue, label: "Fifo Size:", min: minBuffer, max: maxBuffer }),
40697
- /* @__PURE__ */ jsx48(SliderField_default, { value: syncValue, setValue: setSyncValue, label: "A/V Sync:", min: minSync, max: maxSync, content: ["<", ">"], step: 10 }),
40698
- /* @__PURE__ */ jsxs43("div", { className: "pt-2 border-t border-slate-700 text-xs text-gray-700 dark:text-slate-300 flex justify-between", children: [
40699
- /* @__PURE__ */ jsxs43("span", { children: [
40628
+ /* @__PURE__ */ jsx47("div", { className: "bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg p-3", children: /* @__PURE__ */ jsxs42("div", { className: "space-y-3 text-slate-200 text-xs", children: [
40629
+ /* @__PURE__ */ jsx47(SliderField_default, { value: bufferValue, setValue: setBufferValue, label: "Fifo Size:", min: minBuffer, max: maxBuffer }),
40630
+ /* @__PURE__ */ jsx47(SliderField_default, { value: syncValue, setValue: setSyncValue, label: "A/V Sync:", min: minSync, max: maxSync, content: ["<", ">"], step: 10 }),
40631
+ /* @__PURE__ */ jsxs42("div", { className: "pt-2 border-t border-slate-700 text-xs text-gray-700 dark:text-slate-300 flex justify-between", children: [
40632
+ /* @__PURE__ */ jsxs42("span", { children: [
40700
40633
  "Buffer: ",
40701
40634
  bufferValue,
40702
40635
  " frames"
40703
40636
  ] }),
40704
- /* @__PURE__ */ jsxs43("span", { children: [
40637
+ /* @__PURE__ */ jsxs42("span", { children: [
40705
40638
  "Sync: ",
40706
40639
  syncValue > 0 ? "+" : "",
40707
40640
  syncValue,
@@ -40714,8 +40647,8 @@ var StreamControl = ({ index: index3 }) => {
40714
40647
  var StreamControl_default = StreamControl;
40715
40648
 
40716
40649
  // src/components/xcoder/VideoPlayer.tsx
40717
- import { useEffect as useEffect24, useMemo as useMemo9, useRef as useRef11 } from "react";
40718
- import { jsx as jsx49 } from "react/jsx-runtime";
40650
+ import { useEffect as useEffect23, useMemo as useMemo9, useRef as useRef11 } from "react";
40651
+ import { jsx as jsx48 } from "react/jsx-runtime";
40719
40652
  var VideoPlayer = ({
40720
40653
  pgmIndex,
40721
40654
  vuChannels,
@@ -40726,7 +40659,7 @@ var VideoPlayer = ({
40726
40659
  const videoRef = useRef11(dummyCanvas);
40727
40660
  const prevRawChannelsRef = useRef11(null);
40728
40661
  const playerRef = useRef11(null);
40729
- useEffect24(() => {
40662
+ useEffect23(() => {
40730
40663
  let cancelled = false;
40731
40664
  if (!videoRef.current) {
40732
40665
  console.warn("Video canvas not ready yet");
@@ -40847,7 +40780,7 @@ var VideoPlayer = ({
40847
40780
  initPlayer();
40848
40781
  }
40849
40782
  }, [pgmIndex]);
40850
- return /* @__PURE__ */ jsx49(
40783
+ return /* @__PURE__ */ jsx48(
40851
40784
  "canvas",
40852
40785
  {
40853
40786
  ref: videoRef,
@@ -40858,15 +40791,15 @@ var VideoPlayer = ({
40858
40791
  var VideoPlayer_default = VideoPlayer;
40859
40792
 
40860
40793
  // src/components/xcoder/VUMeter.tsx
40861
- import { useRef as useRef12, useEffect as useEffect25, useCallback as useCallback4, useState as useState32 } from "react";
40862
- import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
40794
+ import { useRef as useRef12, useEffect as useEffect24, useCallback as useCallback4, useState as useState31 } from "react";
40795
+ import { jsx as jsx49, jsxs as jsxs43 } from "react/jsx-runtime";
40863
40796
  var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) => {
40864
- const [tickerTarget, setTickerTarget] = useState32({ left: 0, right: 0 });
40865
- const [tickerTransition, setTickerTransition] = useState32({
40797
+ const [tickerTarget, setTickerTarget] = useState31({ left: 0, right: 0 });
40798
+ const [tickerTransition, setTickerTransition] = useState31({
40866
40799
  left: 0,
40867
40800
  right: 0
40868
40801
  });
40869
- const [resetVUTimeout, setResetVUTimeout] = useState32(0);
40802
+ const [resetVUTimeout, setResetVUTimeout] = useState31(0);
40870
40803
  const tickerLeftRef = useRef12(null);
40871
40804
  const tickerRightRef = useRef12(null);
40872
40805
  const blockerLeftRef = useRef12(null);
@@ -40921,7 +40854,7 @@ var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) =>
40921
40854
  } catch (e10) {
40922
40855
  }
40923
40856
  }, []);
40924
- useEffect25(() => {
40857
+ useEffect24(() => {
40925
40858
  calcVolume();
40926
40859
  if (resetVUTimeout) {
40927
40860
  clearTimeout(resetVUTimeout);
@@ -40936,9 +40869,9 @@ var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) =>
40936
40869
  const MIN_DB = -70;
40937
40870
  const MAX_DB = 0;
40938
40871
  const measures = [0, -10, -20, -30, -40, -50, -60, -70];
40939
- return /* @__PURE__ */ jsxs44("div", { className: "flex w-full h-full justify-center", children: [
40940
- /* @__PURE__ */ jsx50("div", { className: displayMarks ? "mt-[60px]" : "hidden", children: measures.map((db) => {
40941
- return /* @__PURE__ */ jsxs44(
40872
+ return /* @__PURE__ */ jsxs43("div", { className: "flex w-full h-full justify-center", children: [
40873
+ /* @__PURE__ */ jsx49("div", { className: displayMarks ? "mt-[60px]" : "hidden", children: measures.map((db) => {
40874
+ return /* @__PURE__ */ jsxs43(
40942
40875
  "div",
40943
40876
  {
40944
40877
  style: { marginBottom: `${(db - MIN_DB) / (MAX_DB - MIN_DB) * 100}px`, marginRight: "25px", textAlignLast: "center" },
@@ -40959,15 +40892,15 @@ var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) =>
40959
40892
  db
40960
40893
  );
40961
40894
  }) }),
40962
- /* @__PURE__ */ jsxs44("div", { className: `h-full w-full text-xs text-center text-white`, style: { maxWidth: `${width}` }, children: [
40963
- /* @__PURE__ */ jsxs44("div", { className: "flex border border-gray-400 w-full h-[96%] rotate-180 scale-x-[-1]", children: [
40964
- /* @__PURE__ */ jsxs44("div", { ref: fillerRef, className: "w-1/2 h-full", style: { background: "linear-gradient(180deg, rgba(0, 187, 0, 1) 0%, rgba(255, 162, 0, 1) 50%, rgba(255, 0, 0, 1) 100%)", borderRadius: "inherit" }, children: [
40965
- /* @__PURE__ */ jsx50("div", { ref: blockerLeftRef, className: "absolute bg-gray-200 dark:bg-[#18191d] bottom-0 w-1/2", style: { height: `${100 - volume[index3].left}%`, transition: "height 0.1s ease-out" } }),
40966
- /* @__PURE__ */ jsx50("div", { ref: tickerLeftRef, className: "absolute h-[5px] w-1/2 bg-white border border-black", style: { top: `${tickerTarget.left}%`, transition: `top ${tickerTransition.left}s ease-out` } })
40895
+ /* @__PURE__ */ jsxs43("div", { className: `h-full w-full text-xs text-center text-white`, style: { maxWidth: `${width}` }, children: [
40896
+ /* @__PURE__ */ jsxs43("div", { className: "flex border border-gray-400 w-full h-[96%] rotate-180 scale-x-[-1]", children: [
40897
+ /* @__PURE__ */ jsxs43("div", { ref: fillerRef, className: "w-1/2 h-full", style: { background: "linear-gradient(180deg, rgba(0, 187, 0, 1) 0%, rgba(255, 162, 0, 1) 50%, rgba(255, 0, 0, 1) 100%)", borderRadius: "inherit" }, children: [
40898
+ /* @__PURE__ */ jsx49("div", { ref: blockerLeftRef, className: "absolute bg-gray-200 dark:bg-[#18191d] bottom-0 w-1/2", style: { height: `${100 - volume[index3].left}%`, transition: "height 0.1s ease-out" } }),
40899
+ /* @__PURE__ */ jsx49("div", { ref: tickerLeftRef, className: "absolute h-[5px] w-1/2 bg-white border border-black", style: { top: `${tickerTarget.left}%`, transition: `top ${tickerTransition.left}s ease-out` } })
40967
40900
  ] }),
40968
- /* @__PURE__ */ jsxs44("div", { className: "w-1/2 h-full", style: { background: "linear-gradient(180deg, rgba(0, 187, 0, 1) 0%, rgba(255, 162, 0, 1) 50%, rgba(255, 0, 0, 1) 100%)", borderRadius: "inherit" }, children: [
40969
- /* @__PURE__ */ jsx50("div", { ref: blockerRightRef, className: "absolute bg-gray-200 dark:bg-[#18191d] bottom-0 w-1/2", style: { height: `${100 - volume[index3].right}%`, transition: "height 0.1s ease-out" } }),
40970
- /* @__PURE__ */ jsx50("div", { ref: tickerRightRef, className: "absolute h-[5px] w-1/2 bg-white border border-black", style: { top: `${tickerTarget.right}%`, transition: `top ${tickerTransition.right}s ease-out` } })
40901
+ /* @__PURE__ */ jsxs43("div", { className: "w-1/2 h-full", style: { background: "linear-gradient(180deg, rgba(0, 187, 0, 1) 0%, rgba(255, 162, 0, 1) 50%, rgba(255, 0, 0, 1) 100%)", borderRadius: "inherit" }, children: [
40902
+ /* @__PURE__ */ jsx49("div", { ref: blockerRightRef, className: "absolute bg-gray-200 dark:bg-[#18191d] bottom-0 w-1/2", style: { height: `${100 - volume[index3].right}%`, transition: "height 0.1s ease-out" } }),
40903
+ /* @__PURE__ */ jsx49("div", { ref: tickerRightRef, className: "absolute h-[5px] w-1/2 bg-white border border-black", style: { top: `${tickerTarget.right}%`, transition: `top ${tickerTransition.right}s ease-out` } })
40971
40904
  ] })
40972
40905
  ] }),
40973
40906
  index3 + 1
@@ -41008,7 +40941,6 @@ export {
41008
40941
  Protocol_default as Protocol,
41009
40942
  ProtocolGroup_default as ProtocolGroup,
41010
40943
  RangeField_default as RangeField,
41011
- RemoteModule,
41012
40944
  RequireAuth_default as RequireAuth,
41013
40945
  SaveDiscard_default as SaveDiscard,
41014
40946
  Section_default as Section,
@@ -41022,7 +40954,9 @@ export {
41022
40954
  VideoGroup_default as VideoGroup,
41023
40955
  VideoPlayer_default as VideoPlayer,
41024
40956
  ViewLog_default as ViewLog,
41025
- getGridLabel
40957
+ getGridLabel,
40958
+ isValidIPv4,
40959
+ isValidIPv6
41026
40960
  };
41027
40961
  /*! Bundled license information:
41028
40962