UNPKG

@kvaser/canking-api

Version:

CanKing API to communicate with the CanKing service using Node.js.

1,026 lines (1,025 loc) 35.2 kB
import h from "long"; import { M as x, C as m, L as p, a as A } from "./status_params.mjs"; import { A as K, d as Y, e as Z, f as Q, g as ee, h as se, i as te, j as ae, k as ne, l as re, B as ie, m as oe, n as le, o as ge, p as ce, q as ue, r as de, s as he, t as fe, u as me, v as Fe, b as pe, w as Se, x as ye, y as xe, z as Ae, D as be, E as we, G as Ie, H as Re, I as Ne, J as Ce, K as Te, N as ve, O as Oe, P as Le, Q as Ee, R as _e, T as Pe, U as De, V as Me, X as ze, Y as Je, Z as Ue, _ as qe, $ as ke, F as Ge, a0 as je, a1 as Be, a2 as Ve, a3 as $e, a4 as He, a5 as We, a6 as Xe, a7 as Ke, a8 as Ye, a9 as Ze, aa as Qe, ab as es, ac as ss, ad as ts, ae as as, af as ns, ag as rs, ah as is, ai as os, aj as ls, ak as gs, al as cs, am as us, an as ds, ao as hs, ap as fs, aq as ms, ar as Fs, as as ps, at as Ss, au as ys, av as xs, aw as As, ax as bs, ay as ws, az as Is, aA as Rs, aB as Ns, aC as Cs, aD as Ts, aE as vs, aF as Os, aG as Ls, aH as Es, aI as _s, aJ as Ps, aK as Ds, aL as Ms, aM as zs, aN as Js, aO as Us, aP as qs, aQ as ks, aR as Gs, aS as js, aT as Bs, aU as Vs, aV as $s, aW as Hs, aX as Ws, aY as Xs, aZ as Ks, a_ as Ys, a$ as Zs, b0 as Qs, b1 as et, b2 as st, b3 as tt, b4 as at, b5 as nt, b6 as rt, b7 as it, b8 as ot, b9 as lt, S as gt, ba as ct, bb as ut, bc as dt, bd as ht, be as ft, bf as mt, bg as Ft, bh as pt, bi as St, bj as yt, bk as xt, bl as At, c as bt, bm as wt, bn as It, bo as Rt, bp as Nt, bq as Ct, br as Tt, bs as vt, bt as Ot, bu as Lt, W as Et, bv as _t, bw as Pt, bx as Dt, by as Mt, bz as zt, bA as Jt, bB as Ut, bC as qt, bD as kt, bE as Gt, bF as jt, bG as Bt, bH as Vt, bI as $t, bJ as Ht, bK as Wt, bL as Xt, bM as Kt, bN as Yt, bO as Zt, bP as Qt, bQ as ea, bR as sa, bS as ta, bT as aa, bU as na, bV as ra, bW as ia, bX as oa, bY as la, bZ as ga, b_ as ca, b$ as ua, c0 as da, c1 as ha, c2 as fa, c3 as ma, c4 as Fa, c5 as pa, c6 as Sa, c7 as ya, c8 as xa, c9 as Aa, ca as ba, cb as wa, cc as Ia } from "./status_params.mjs"; class u { data; index; size; endIndex; length; normalizedIndex; filterCallback; constructor(e, t, a, r, n, l) { this.data = e, this.index = a, this.size = t, this.endIndex = r, this.length = n, this.normalizedIndex = 0, this.filterCallback = l; } next() { for (; this.normalizedIndex < this.length; ) { this.normalizedIndex += 1; const e = { value: this.data[this.index], done: !1 }; if (this.index += 1, this.index === this.size && (this.index = 0), !this.filterCallback || this.filterCallback(e.value)) return e; } return { value: this.data[this.index], done: !0 }; } findIndex(e) { let t = this.index, a = this.normalizedIndex; for (; a < this.length; ) { if (e(this.data[t])) return t; a += 1, t += 1, t === this.size && (t = 0); } return -1; } /** * Returns an iterator of a section of this buffer. * @param start - The beginning index of the specified portion of the buffer. * @param end - The end index of the specified portion of the buffer. This is exclusive of the element at the index 'end'. * If end is undefined, then the slice extends to the end of the buffer. */ slice(e, t) { if (this.length === 0) return new u(this.data, this.size, 0, 0, 0); if (e < 0 || e >= this.length) throw new Error("Invalid start index"); if (t !== void 0 && (t < 0 || t > this.length)) throw new Error("Invalid end index"); let a = this.index + e; a >= this.size && (a -= this.size); let r = t !== void 0 ? this.index + t : this.endIndex; r >= this.size && (r -= this.size); const n = t !== void 0 ? t - e : this.length - e; return new u(this.data, this.size, a, r, n); } /** * Returns an iterator of a section of this buffer. * @param filter - An optional callback filter. */ filter(e) { return new u(this.data, this.size, this.index, this.endIndex, this.length, e); } /** * Returns an iterator of a section of this buffer. * @param start - The beginning index of the specified portion of the buffer. * @param end - The end index of the specified portion of the buffer. This is exclusive of the element at the index 'end'. * If end is undefined, then the slice extends to the end of the buffer. * @param filter - An optional callback filter. */ sliceAndFilter(e, t, a) { if (this.length === 0) return new u(this.data, this.size, 0, 0, 0, a); if (e < 0 || e >= this.length) throw new Error("Invalid start index"); if (t !== void 0 && (t < 0 || t > this.length)) throw new Error("Invalid end index"); let r = this.index + e; r >= this.size && (r -= this.size); let n = t !== void 0 ? this.index + t : this.endIndex; n >= this.size && (n -= this.size); const l = t !== void 0 ? t - e : this.length - e; return new u(this.data, this.size, r, n, l, a); } [Symbol.iterator]() { return this; } } class M { length = 0; size = 0; startIndex = 0; endIndex = 0; data = []; /** * Constructor. * @param size - An optional buffer size. */ constructor(e = 0) { this.clear(e); } /** * Clears this DataBuffer. * @param size - An optional new buffer size. */ clear(e) { this.size = e !== void 0 ? e : this.size, this.startIndex = 0, this.endIndex = 0, this.length = 0, this.data = this.size > 0 ? new Array(this.size) : []; } /** * Adds data to this DataBuffer. * @param elements - The new elements. */ push(...e) { for (let t = 0; t < e.length; t += 1) { const a = e[t]; this.length > 0 && (this.endIndex += 1, this.endIndex === this.size && (this.endIndex = 0), this.length === this.size && (this.startIndex += 1, this.startIndex === this.size && (this.startIndex = 0))), this.data[this.endIndex] = a, this.length < this.size && (this.length += 1); } } /** * Takes an integer value and returns the item at that index, * allowing for positive and negative integers. * Negative integers count back from the last item in the array. */ at(e) { if (Math.abs(e) >= this.length) throw new Error("Argument out of range!"); if (e < 0) { const t = this.endIndex + e + 1; return t >= 0 ? this.data[t] : this.data[this.size + t]; } return this.startIndex + e < this.size ? this.data[this.startIndex + e] : this.data[this.startIndex + e - this.size]; } /** * Returns an iterator of a section of this buffer. * @param start - The beginning index of the specified portion of the buffer. * @param end - The end index of the specified portion of the buffer. This is exclusive of the element at the index 'end'. * If end is undefined, then the slice extends to the end of the buffer. */ slice(e, t) { if (this.length === 0) return new u(this.data, this.size, 0, 0, 0); if (e < 0 || e >= this.length) throw new Error("Invalid start index"); if (t !== void 0 && (t < 0 || t > this.length)) throw new Error("Invalid end index"); let a = this.startIndex + e; a >= this.size && (a -= this.size); let r = t !== void 0 ? this.startIndex + t : this.endIndex; r >= this.size && (r -= this.size); const n = t !== void 0 ? t - e : this.length - e; return new u(this.data, this.size, a, r, n); } /** * Returns an iterator of a section of this buffer. * @param filter - An optional callback filter. */ filter(e) { return new u(this.data, this.size, this.startIndex, this.endIndex, this.length, e); } /** * Returns an iterator of a section of this buffer. * @param start - The beginning index of the specified portion of the buffer. * @param end - The end index of the specified portion of the buffer. This is exclusive of the element at the index 'end'. * If end is undefined, then the slice extends to the end of the buffer. * @param filter - An optional callback filter. */ sliceAndFilter(e, t, a) { if (this.length === 0) return new u(this.data, this.size, 0, 0, 0, a); if (e < 0 || e >= this.length) throw new Error("Invalid start index"); if (t !== void 0 && (t < 0 || t > this.length)) throw new Error("Invalid end index"); let r = this.startIndex + e; r >= this.size && (r -= this.size); let n = t !== void 0 ? this.startIndex + t : this.endIndex; n >= this.size && (n -= this.size); const l = t !== void 0 ? t - e : this.length - e; return new u(this.data, this.size, r, n, l, a); } view() { return new u(this.data, this.size, this.startIndex, this.endIndex, this.length); } [Symbol.iterator]() { return new u(this.data, this.size, this.startIndex, this.endIndex, this.length); } } class b { userSettings; /** * Creates a new IpcRendererFake. */ constructor(e) { this.userSettings = e; } /** * Listens to `channel`, when a new message arrives `listener` would be called with * `listener(event, args...)`. */ on(e, t) { return () => { }; } /** * Adds a one time `listener` function for the event. This `listener` is invoked * only the next time a message is sent to `channel`, after which it is removed. */ once(e, t) { return () => { }; } /** * Removes all listeners, or those of the specified `channel`. */ removeAllListeners(e) { } /** * Removes the specified `listener` from the listener array for the specified * `channel`. * * @deprecated Use `on` listen return instead * */ // eslint-disable-next-line @typescript-eslint/no-explicit-any removeListener(e, t) { return this; } /** * Send an asynchronous message to the main process via `channel`, along with * arguments. Arguments will be serialized with the Structured Clone Algorithm, * just like `window.postMessage`, so prototype chains will not be included. * Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an * exception. * * **NOTE:** Sending non-standard JavaScript types such as DOM objects or special * Electron objects will throw an exception. * * Since the main process does not have support for DOM objects such as * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over * Electron's IPC to the main process, as the main process would have no way to * decode them. Attempting to send such objects over IPC will result in an error. * * The main process handles it by listening for `channel` with the `ipcMain` * module. * * If you need to transfer a `MessagePort` to the main process, use * `ipcRenderer.postMessage`. * * If you want to receive a single response from the main process, like the result * of a method call, consider using `ipcRenderer.invoke`. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any send(e, ...t) { } /** * Resolves with the response from the main process. * * Send a message to the main process via `channel` and expect a result * asynchronously. Arguments will be serialized with the Structured Clone * Algorithm, just like `window.postMessage`, so prototype chains will not be * included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw * an exception. * * **NOTE:** Sending non-standard JavaScript types such as DOM objects or special * Electron objects will throw an exception. * * Since the main process does not have support for DOM objects such as * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over * Electron's IPC to the main process, as the main process would have no way to * decode them. Attempting to send such objects over IPC will result in an error. * * The main process should listen for `channel` with `ipcMain.handle()`. * * For example: * * If you need to transfer a `MessagePort` to the main process, use * `ipcRenderer.postMessage`. * * If you do not need a response to the message, consider using `ipcRenderer.send`. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any invoke(e, ...t) { switch (e) { case "dm-get-devices": { const a = []; return Promise.resolve(a); } case "main-get-session-data": return Promise.resolve(null); case "main-get-user-settings": return Promise.resolve(this.userSettings); case "mm-get-online-status": { const a = { isOnline: !1, onlineCounter: 0 }; return Promise.resolve(a); } case "mm-get-node-statuses": { const a = []; return Promise.resolve(a); } case "prj-get-meas-setup": return Promise.resolve(x.create()); case "prj-get-workspaces": { const a = []; return Promise.resolve(a); } case "prj-get-workspace-panes": { const a = []; return Promise.resolve(a); } case "main-get-workspace-view-session-data-object": case "main-get-workspace-view-session-data-slice": return Promise.resolve({}); case "mm-start-periodic-transmission": return Promise.resolve(""); case "mm-get-message-log-file-formats": { const a = []; return Promise.resolve(a); } case "mm-get-signal-log-file-formats": { const a = []; return Promise.resolve(a); } case "mm-get-frame-definitions": { const a = []; return Promise.resolve(a); } case "mm-get-frame-definitions-with-meta": { const a = []; return Promise.resolve({ items: a, truncated: !1, originalCount: a.length }); } case "mm-get-measurement-data-before-timestamp": { const a = []; return Promise.resolve(a); } case "mm-get-latest-timestamp": return Promise.resolve(0); default: return Promise.resolve(); } } /** * Send a message to the main process, optionally transferring ownership of zero or * more `MessagePort` objects. * * The transferred `MessagePort` objects will be available in the main process as * `MessagePortMain` objects by accessing the `ports` property of the emitted * event. * * **NOTE:** Cannot transfer these when `contextIsolation: true`. * * For example: * * For more information on using `MessagePort` and `MessageChannel`, see the MDN * documentation. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any postMessage(e, t, a) { } /** * The value sent back by the `ipcMain` handler. * * Send a message to the main process via `channel` and expect a result * synchronously. Arguments will be serialized with the Structured Clone Algorithm, * just like `window.postMessage`, so prototype chains will not be included. * Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an * exception. * * **NOTE:** Sending non-standard JavaScript types such as DOM objects or special * Electron objects will throw an exception. * * Since the main process does not have support for DOM objects such as * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over * Electron's IPC to the main process, as the main process would have no way to * decode them. Attempting to send such objects over IPC will result in an error. * * The main process handles it by listening for `channel` with `ipcMain` module, * and replies by setting `event.returnValue`. * * warning: **WARNING**: Sending a synchronous message will block the whole * renderer process until the reply is received, so use this method only as a last * resort. It's much better to use the asynchronous version, `invoke()`. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any sendSync(e, ...t) { return null; } /** * Sends a message to a window with `webContentsId` via `channel`. * * @deprecated This methond has been removed since Electron 28. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any sendTo(e, t, ...a) { } /** * Like `ipcRenderer.send` but the event will be sent to the `<webview>` element in * the host page instead of the main process. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any sendToHost(e, ...t) { } } class w { /** * A key for the inserted CSS that can later be used to remove the CSS via * `webFrame.removeInsertedCSS(key)`. * * Injects CSS into the current web page and returns a unique key for the inserted * stylesheet. */ insertCSS(e) { return ""; } /** * Changes the zoom factor to the specified factor. Zoom factor is zoom percent * divided by 100, so 300% = 3.0. * * The factor must be greater than 0.0. */ setZoomFactor(e) { } /** * Changes the zoom level to the specified level. The original size is 0 and each * increment above or below represents zooming 20% larger or smaller to default * limits of 300% and 50% of original size, respectively. * * **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that * the zoom level for a specific domain propagates across all instances of windows * with the same domain. Differentiating the window URLs will make zoom work * per-window. */ setZoomLevel(e) { } } class I { /** * The file system path that this `File` object points to. In the case where the * object passed in is not a `File` object an exception is thrown. In the case * where the File object passed in was constructed in JS and is not backed by a * file on disk an empty string is returned. * * This method superseded the previous augmentation to the `File` object with the * `path` property. An example is included below. */ getPathForFile(e) { return ""; } } class R { /** * The process.platform property returns a string identifying the operating system platform * on which the Node.js process is running. */ platform = ""; /** * A list of versions for the current node.js/electron configuration. */ versions = {}; /** * The process.env property returns an object containing the user environment. */ env = {}; } const N = (s) => { const e = { version: "1.0.0", theme: "light", language: "en", strings: {}, showToolsPanel: !0, useHexNumericBase: !0, maxDataBytes: 16, defaultProjectFolder: "", defaultLogFilesFolder: "", defaultCANDatabasesFolder: "", defaultLINDatabasesFolder: "", currentProjectFile: "", currentProjectFileName: "", recentProjectFiles: [], closeAppServiceAction: "prompt" }; return { ipcRenderer: new b(s ?? e), webFrame: new w(), webUtils: new I(), process: new R() }; }, z = N(); class d { x; y; constructor(e, t) { this.x = Number(e.toFixed(1)), this.y = Number(t.toFixed(1)); } add(e) { return new d(this.x + e.x, this.y + e.y); } subtract(e) { return new d(this.x - e.x, this.y - e.y); } multiply(e) { return new d(this.x * e, this.y * e); } divide(e) { return new d(this.x / e, this.y / e); } // Normalize to the device pixel ratio (zoom + HiDPI) // This is only needed for direct pixel manipulation (i.e. canvas), not HTML, CSS, or SVG normalize() { return this.multiply(window.devicePixelRatio); } static vectorWidth(e) { return Math.abs(e.end.x - e.start.x); } static vectorHeight(e) { return Math.abs(e.end.y - e.start.y); } static vectorLength(e) { return Math.sqrt(d.vectorHeight(e) ** 2 + d.vectorWidth(e) ** 2); } distanceFrom(e) { return Math.abs((e.end.y - e.start.y) * this.x - (e.end.x - e.start.x) * this.y + e.end.x * e.start.y - e.end.y * e.start.x) / d.vectorLength(e); } isInsideOf(e) { const t = Math.min(e.start.x, e.end.x), a = Math.min(e.start.y, e.end.y), r = Math.max(e.start.x, e.end.x), n = Math.max(e.start.y, e.end.y); return t <= this.x && this.x <= r && a <= this.y && this.y <= n; } } function f(s, e) { if (s === e) return !0; if (s == null || e == null) return !1; const t = (n) => Object.prototype.toString.call(n), a = t(s), r = t(e); if (a !== r) return !1; if (a === "[object Date]") return s.getTime() === e.getTime(); if (a === "[object RegExp]") { const n = s, l = e; return n.source === l.source && n.flags === l.flags; } if (s && e && typeof s == "object" && typeof e == "object") { if (a === "[object Map]") { const i = s, o = e; if (i.size !== o.size) return !1; for (const [c, g] of i.entries()) if (!o.has(c) || !f(g, o.get(c))) return !1; return !0; } if (a === "[object Set]") { const i = s, o = e; if (i.size !== o.size) return !1; for (const c of i) { let g = !1; for (const y of o) if (f(c, y)) { g = !0; break; } if (!g) return !1; } return !0; } if (s.constructor !== e.constructor) return !1; if (Array.isArray(s) && Array.isArray(e)) { const i = s.length; if (i !== e.length) return !1; for (let o = 0; o < i; o++) if (!f(s[o], e[o])) return !1; return !0; } if (ArrayBuffer.isView(s) && ArrayBuffer.isView(e)) { const i = s.byteLength; if (i !== e.byteLength) return !1; const o = new Uint8Array(s.buffer, s.byteOffset, s.byteLength), c = new Uint8Array(e.buffer, e.byteOffset, e.byteLength); for (let g = 0; g < i; g++) if (o[g] !== c[g]) return !1; return !0; } if (s.valueOf !== Object.prototype.valueOf) return s.valueOf() === e.valueOf(); if (s.toString !== Object.prototype.toString) return s.toString() === e.toString(); const n = Object.keys(s), l = n.length; if (l !== Object.keys(e).length) return !1; for (let i = 0; i < l; i++) if (!Object.prototype.hasOwnProperty.call(e, n[i])) return !1; for (let i = 0; i < l; i++) { const o = n[i]; if (!f(s[o], e[o])) return !1; } return !0; } return s !== s && e !== e; } const S = { Uint8Array, Int8Array, Uint16Array, Int16Array, Uint32Array, Int32Array, Float32Array, Float64Array }; function F(s) { return typeof s == "object" && s !== null; } function C(s) { return s instanceof Uint8Array || s instanceof Int8Array || s instanceof Uint16Array || s instanceof Int16Array || s instanceof Uint32Array || s instanceof Int32Array || s instanceof Float32Array || s instanceof Float64Array; } function T(s) { return s in S; } function v(s) { return F(s) ? typeof s.__type == "string" && "value" in s : !1; } function O(s) { return F(s) ? typeof s.low == "number" && typeof s.high == "number" && typeof s.unsigned == "boolean" : !1; } function L(s) { return F(s) ? typeof s.source == "string" && typeof s.flags == "string" : !1; } function E(s) { if (!F(s)) return !1; const e = s.stack === void 0 || typeof s.stack == "string"; return typeof s.name == "string" && typeof s.message == "string" && e; } function J(s, e) { const t = this[s]; return t instanceof Date ? { __type: "Date", value: t.toISOString() } : e instanceof Map ? { __type: "Map", value: Array.from(e.entries()) } : e instanceof Set ? { __type: "Set", value: Array.from(e.values()) } : e instanceof Date ? { __type: "Date", value: e.toISOString() } : e instanceof RegExp ? { __type: "RegExp", value: { source: e.source, flags: e.flags } } : typeof e == "bigint" ? { __type: "BigInt", value: e.toString() } : h.isLong(e) ? { __type: "Long", value: { low: e.low, high: e.high, unsigned: e.unsigned } } : C(e) ? { __type: e.constructor.name, value: Array.from(e) } : e instanceof Error ? { __type: "Error", value: { name: e.name, message: e.message, stack: e.stack } } : e; } function U(s, e) { if (v(e)) switch (e.__type) { case "Map": return Array.isArray(e.value) ? new Map(e.value) : e; case "Set": return Array.isArray(e.value) ? new Set(e.value) : e; case "Date": return typeof e.value == "string" ? new Date(e.value) : e; case "RegExp": return L(e.value) ? new RegExp(e.value.source, e.value.flags) : e; case "BigInt": return typeof e.value == "string" ? BigInt(e.value) : e; case "Long": return O(e.value) ? new h(e.value.low, e.value.high, e.value.unsigned) : e; case "Uint8Array": case "Int8Array": case "Uint16Array": case "Int16Array": case "Uint32Array": case "Int32Array": case "Float32Array": case "Float64Array": return !T(e.__type) || !Array.isArray(e.value) ? e : new S[e.__type](e.value); case "Error": { if (!E(e.value)) return e; const t = new Error(e.value.message); return t.name = e.value.name, t.stack = e.value.stack, t; } default: return e; } return e; } const q = (s, e) => { if (s.id !== e.id || s.canFrameFlags === void 0 && e.canFrameFlags !== void 0 || s.canFrameFlags !== void 0 && e.canFrameFlags === void 0) return !1; if (s.canFrameFlags !== void 0 && e.canFrameFlags !== void 0) { if (s.canFrameFlags.flags.length !== e.canFrameFlags.flags.length) return !1; for (let t = 0; t < s.canFrameFlags.flags.length; t++) if (!e.canFrameFlags.flags.includes(s.canFrameFlags.flags[t])) return !1; } if (s.linFrameFlags === void 0 && e.linFrameFlags !== void 0 || s.linFrameFlags !== void 0 && e.linFrameFlags === void 0) return !1; if (s.linFrameFlags !== void 0 && e.linFrameFlags !== void 0) { if (s.linFrameFlags.flags.length !== e.linFrameFlags.flags.length) return !1; for (let t = 0; t < s.linFrameFlags.flags.length; t++) if (!e.linFrameFlags.flags.includes(s.linFrameFlags.flags[t])) return !1; } return !(s.mux !== void 0 && s.mux !== e.mux || s.tx !== void 0 && s.tx !== e.tx || s.sourceId !== void 0 && s.sourceId !== "" && s.sourceId !== e.sourceId); }, _ = (s) => { let e = m.CAN_FRAME_FLAG_UNSPECIFIED; if (s.canFrameFlags !== void 0) for (let c = 0; c < s.canFrameFlags.flags.length; c++) { const g = s.canFrameFlags.flags[c]; g !== m.CAN_FRAME_FLAG_TXACK && g !== m.CAN_FRAME_FLAG_LOCAL_TXACK && (e |= g); } let t = p.LIN_FRAME_FLAG_UNSPECIFIED; if (s.linFrameFlags !== void 0) for (let c = 0; c < s.linFrameFlags.flags.length; c++) { const g = s.linFrameFlags.flags[c]; g !== p.LIN_FRAME_FLAG_TX && (t |= g); } const a = s.id.toString(16).padStart(8, "0"), r = e.toString(16).padStart(8, "0"), n = t.toString(16).padStart(8, "0"), l = (s.mux ?? 4294967295).toString(16).padStart(8, "0"), i = (s.tx === void 0 ? 15 : s.tx ? 1 : 0).toString(16).padStart(1, "0"), o = s.sourceId !== void 0 && s.sourceId !== "" ? s.sourceId.replace(/-/g, "") : "ffffffffffffffffffffffffffffffff"; return `${a}${r}${n}${l}${i}${o}`; }, k = (s, e = !1, t = !1, a = !1, r = !1) => { const n = A.create({ id: s.id, canFrameFlags: s.canFrameFlags, linFrameFlags: s.linFrameFlags, mux: a ? void 0 : s.muxValue, tx: t ? void 0 : s.tx, sourceId: e ? void 0 : s.sourceId }); return r && n.canFrameFlags && (n.canFrameFlags.flags = n.canFrameFlags.flags.filter((l) => l !== m.CAN_FRAME_FLAG_FD_BRS)), _(n); }, G = (s, e = 2, t = !1) => { let a = s.toString(16).toUpperCase(); for (; a.length < e; ) a = `0${a}`; return t ? `0x${a}` : a; }, j = (s, e = 3) => { let t = s.toString(); for (; t.length < e; ) t = `0${t}`; return t; }, B = (s) => { try { return new h(s.low, s.high, s.unsigned).toNumber(); } catch { return NaN; } }, V = { version: "1.0.0", theme: "light", language: "en", strings: {}, showToolsPanel: !0, useHexNumericBase: !0, maxDataBytes: 16, defaultProjectFolder: "", defaultLogFilesFolder: "", defaultCANDatabasesFolder: "", defaultLINDatabasesFolder: "", currentProjectFile: "", currentProjectFileName: "", recentProjectFiles: [], closeAppServiceAction: "prompt" }; function $(s) { return { ...s, timeUsParts: { low: s.timeUs.low, high: s.timeUs.high, unsigned: s.timeUs.unsigned }, deltaTimeUsParts: s.deltaTimeUs ? { low: s.deltaTimeUs.low, high: s.deltaTimeUs.high, unsigned: s.deltaTimeUs.unsigned } : void 0 }; } function H(s) { return { ...s, timeUs: new h(s.timeUsParts.low, s.timeUsParts.high, s.timeUsParts.unsigned), deltaTimeUs: s.deltaTimeUsParts ? new h(s.deltaTimeUsParts.low, s.deltaTimeUsParts.high, s.deltaTimeUsParts.unsigned) : void 0 }; } export { K as AboutInformation, Y as AccessMode, Z as ActivateLicenseRequest, Q as AddAllConnectedCanChannelsRequest, ee as AddAllConnectedLinChannelsRequest, se as AddOrUpdateDataProcessorRequest, te as AddOrUpdateSourceRequest, ae as AddOrUpdateTargetRequest, ne as AppEvent, re as AppEventArgs, ie as BaseNodeProperties, oe as BusStatus, le as CanBusParamLimits, ge as CanBusParams, ce as CanBusSpeedInfo, ue as CanChannelCap, de as CanChannelCapacity, he as CanChannelConfiguration, fe as CanConfigMode, me as CanFDBusSpeedCombination, Fe as CanFDBusSpeedInfo, m as CanFrameFlag, pe as CanFrameFlags, Se as CanMessageFilterSettings, ye as CanMessageFilterType, xe as CanMode, Ae as Channel, be as ChannelSettings, we as ClearLinMessageRequest, Ie as ConnectNodesRequest, M as DataBuffer, u as DataBufferView, Re as DataProcessingStatus, Ne as DataProcessorNodeProperties, Ce as DatabaseFiles, Te as DatabasesSettings, ve as DecimalChar, Oe as Device, Le as DeviceEvent, Ee as DeviceEventArgs, _e as Devices, Pe as DisconnectNodesRequest, De as Empty, Me as ErrorStatus, ze as ExtensionInfo, Je as ExtensionInfos, Ue as FileConflictAction, A as FixedPosFrameIdentifier, qe as Frame, ke as FrameDataEnvelope, Ge as FrameDefinition, je as FrameDefinitions, Be as FramePropertyNames, Ve as FramePropertyValue, $e as FrameReceivedTrigger, He as Frame_PropertiesEntry, We as Frames, Xe as GetAvailableFramePropertyNamesResponse, Ke as GetAvailableFramePropertyNamesResponse_FramePropertyNamesByNodeTypeEntry, Ye as GetCanChannelBusSpeedsRequest, Ze as GetCanChannelBusSpeedsResponse, Qe as GetCanFdBusSpeedsRequest, es as GetCanFdBusSpeedsResponse, ss as GetChannelsFromLogFileRequest, ts as GetChannelsFromLogFileResponse, as as GetClassicCanBusSpeedsRequest, ns as GetClassicCanBusSpeedsResponse, rs as GetDataFramesBeforeTimestampRequest, is as GetDataFramesBetweenTimestampsRequest, os as GetDataProcessorResponse, ls as GetDevicesRequest, gs as GetDevicesResponse, cs as GetExtensionInfoRequest, us as GetFrameEnvelopesRequest, ds as GetFrameEnvelopesResponse, hs as GetLicensesResponse, fs as GetLogFileFormatsRequest, ms as GetLogFileFormatsResponse, Fs as GetLogLevelResponse, ps as GetScheduleTablesFromDatabaseFilesRequest, Ss as GetScheduleTablesFromDatabaseFilesResponse, ys as GetSignalDataFromMessageDataRequest, xs as GetSignalDataFromMessageDataResponse, As as GetSourceResponse, bs as GetTargetResponse, ws as IdentifierRequest, Is as IdentifiersRequest, Rs as InstallExtensionRequest, Ns as InterpreterSettings, Cs as J1939InterpreterSettings, Ts as LicenseInformation, vs as Licenses, Os as LinChannelConfiguration, p as LinFrameFlag, Ls as LinFrameFlags, Es as LogFileFormat, _s as LogFileFormatInfo, Ps as LogLevel, Ds as LogMessage, Ms as LogMessages, zs as LogReplaySettings, Js as LogReplaySettings_ChannelIdentifiersEntry, Us as LogReplayState, qs as LogReplayStatus, ks as LoggerState, Gs as LoggerStatus, js as MeasurementEvent, Bs as MeasurementEventArgs, x as MeasurementSetup, Vs as MessageLoggerSettings, $s as NodeStatus, Hs as NodeStatuses, Ws as OnlineStatus, Xs as PeriodicTransmissionSettings, d as Point, Ks as RequestLinMessageRequest, Ys as ScheduleTable, Zs as ScheduleTableEntry, Qs as SendLinWakeupFrameRequest, et as SendMessageRequest, st as SendMessagesRequest, tt as Separator, at as ServiceExtensionSettings, nt as SetLogLevelRequest, rt as SetMeasurementSetupRequest, it as SetSignalDataToMessageDataRequest, ot as SetSignalDataToMessageDataResponse, lt as SignalDataEnvelope, gt as SignalDefinition, ct as SignalDefinition_EnumValuesEntry, ut as SignalDefinitions, dt as SignalEncoding, ht as SignalFilterSettings, ft as SignalLoggerSettings, mt as SignalType, Ft as SignalValue, pt as SignalValueTrigger, St as SignalValueTriggerOperator, yt as SourceNodeProperties, xt as StartPeriodicTransmissionRequest, At as StartPeriodicTransmissionResponse, bt as StatusLevel, wt as SubscribeForDataRequest, It as TargetNodeProperties, Rt as TdcConfiguration, Nt as TimeReference, Ct as TriggerOperator, Tt as TriggerSettings, vt as UninstallExtensionRequest, Ot as UpdateLinMessageRequest, Lt as UpdatePeriodicTransmissionRequest, Et as WriteFrame, _t as accessModeFromJSON, Pt as accessModeToJSON, Dt as appEventFromJSON, Mt as appEventToJSON, _ as calculateSubscriptionKey, k as calculateSubscriptionKeyFromFrame, zt as canChannelCapFromJSON, Jt as canChannelCapToJSON, Ut as canConfigModeFromJSON, qt as canConfigModeToJSON, kt as canFrameFlagFromJSON, Gt as canFrameFlagToJSON, jt as canMessageFilterTypeFromJSON, Bt as canMessageFilterTypeToJSON, Vt as canModeFromJSON, $t as canModeToJSON, q as compareFixedPosFrameIdentifiers, N as createElectronApiFake, Ht as decimalCharFromJSON, Wt as decimalCharToJSON, j as decimalToFixed, G as decimalToHex, f as deep_equal, V as defaultUserSettings, H as deserializeFrame, Xt as deviceEventFromJSON, Kt as deviceEventToJSON, z as electronApiFake, Yt as fileConflictActionFromJSON, Zt as fileConflictActionToJSON, J as jsonReplacer, U as jsonReviver, Qt as linFrameFlagFromJSON, ea as linFrameFlagToJSON, sa as logFileFormatFromJSON, ta as logFileFormatToJSON, aa as logLevelFromJSON, na as logLevelToJSON, ra as logReplayStateFromJSON, ia as logReplayStateToJSON, oa as loggerStateFromJSON, la as loggerStateToJSON, B as longToNumber, ga as measurementEventFromJSON, ca as measurementEventToJSON, ua as separatorFromJSON, da as separatorToJSON, $ as serializeFrame, ha as signalEncodingFromJSON, fa as signalEncodingToJSON, ma as signalTypeFromJSON, Fa as signalTypeToJSON, pa as signalValueTriggerOperatorFromJSON, Sa as signalValueTriggerOperatorToJSON, ya as statusLevelFromJSON, xa as statusLevelToJSON, Aa as timeReferenceFromJSON, ba as timeReferenceToJSON, wa as triggerOperatorFromJSON, Ia as triggerOperatorToJSON };