@keload/node-red-dxp 1.23.2 → 1.23.3

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.
@@ -1,6 +1,7 @@
1
- import { E as EditorDomHelper } from '../../types-B7YUmbnu.cjs';
2
- import '../../index.cjs';
3
- import 'node-red';
1
+ import { EditorDomHelper } from "../../types-B_x2zkuM.cjs";
2
+ import "../../index-CZL133rH.cjs";
3
+
4
+ //#region src/editor/dom.d.ts
4
5
 
5
6
  /**
6
7
  * Checks if a given selector is a node input selector.
@@ -9,10 +10,10 @@ import 'node-red';
9
10
  * @returns True if the selector is a node input selector, false otherwise.
10
11
  */
11
12
  declare function isNodeInput(selector: string): {
12
- isNodeIdShortcut: boolean;
13
- isNodeConfigIdShortcut: boolean;
14
- isFullSelector: boolean;
15
- value: boolean;
13
+ isNodeIdShortcut: boolean;
14
+ isNodeConfigIdShortcut: boolean;
15
+ isFullSelector: boolean;
16
+ value: boolean;
16
17
  };
17
18
  /**
18
19
  * Resolves a selector string into a specific format based on predefined rules.
@@ -127,7 +128,7 @@ declare function initSelect(selector: string, options: Record<string, string>[],
127
128
  * watchInput(['$input-1', '$input-2'], (values) => console.log(values));
128
129
  */
129
130
  declare function watchInput<T = any>(selectors: string | string[], callback: (values: T[]) => void, opt?: {
130
- additionalEvents: any[];
131
+ additionalEvents: any[];
131
132
  }): void;
132
133
  /**
133
134
  * Sets the value of an input element.
@@ -234,9 +235,9 @@ declare function getFormValues(prefix: string): Record<string, string | boolean>
234
235
  */
235
236
  declare function setFormValues(prefix: string, values: Record<string, unknown | boolean>): void;
236
237
  type InitTabsParams = {
237
- targetId: any;
238
- tabsLabel: string[];
239
- initialTab: string;
238
+ targetId: any;
239
+ tabsLabel: string[];
240
+ initialTab: string;
240
241
  };
241
242
  /**
242
243
  * Initializes a tab system with the provided configuration and handles tab switching behavior.
@@ -273,5 +274,5 @@ type InitTabsParams = {
273
274
  * @throws {Error} Throws an error if the `params.initialTab` does not match any label in `tabsLabel`.
274
275
  */
275
276
  declare function initTabs(params: InitTabsParams): void;
276
-
277
- export { addClassesOnSelectors, getFormValues, handleAddRemoveClassesOnSelectors, initSelect, initTabs, isCheckboxChecked, isNodeInput, jqSelector, removeClassesOnSelectors, resolveInputKey, resolveSelector, setFormValues, setInputValue, setText, watchInput };
277
+ //#endregion
278
+ export { addClassesOnSelectors, getFormValues, handleAddRemoveClassesOnSelectors, initSelect, initTabs, isCheckboxChecked, isNodeInput, jqSelector, removeClassesOnSelectors, resolveInputKey, resolveSelector, setFormValues, setInputValue, setText, watchInput };
@@ -1,6 +1,7 @@
1
- import { E as EditorDomHelper } from '../../types-B7YUmbnu.js';
2
- import '../../index.js';
3
- import 'node-red';
1
+ import { EditorDomHelper } from "../../types-LozbF9aD.js";
2
+ import "../../index-Br38J6RF.js";
3
+
4
+ //#region src/editor/dom.d.ts
4
5
 
5
6
  /**
6
7
  * Checks if a given selector is a node input selector.
@@ -9,10 +10,10 @@ import 'node-red';
9
10
  * @returns True if the selector is a node input selector, false otherwise.
10
11
  */
11
12
  declare function isNodeInput(selector: string): {
12
- isNodeIdShortcut: boolean;
13
- isNodeConfigIdShortcut: boolean;
14
- isFullSelector: boolean;
15
- value: boolean;
13
+ isNodeIdShortcut: boolean;
14
+ isNodeConfigIdShortcut: boolean;
15
+ isFullSelector: boolean;
16
+ value: boolean;
16
17
  };
17
18
  /**
18
19
  * Resolves a selector string into a specific format based on predefined rules.
@@ -127,7 +128,7 @@ declare function initSelect(selector: string, options: Record<string, string>[],
127
128
  * watchInput(['$input-1', '$input-2'], (values) => console.log(values));
128
129
  */
129
130
  declare function watchInput<T = any>(selectors: string | string[], callback: (values: T[]) => void, opt?: {
130
- additionalEvents: any[];
131
+ additionalEvents: any[];
131
132
  }): void;
132
133
  /**
133
134
  * Sets the value of an input element.
@@ -234,9 +235,9 @@ declare function getFormValues(prefix: string): Record<string, string | boolean>
234
235
  */
235
236
  declare function setFormValues(prefix: string, values: Record<string, unknown | boolean>): void;
236
237
  type InitTabsParams = {
237
- targetId: any;
238
- tabsLabel: string[];
239
- initialTab: string;
238
+ targetId: any;
239
+ tabsLabel: string[];
240
+ initialTab: string;
240
241
  };
241
242
  /**
242
243
  * Initializes a tab system with the provided configuration and handles tab switching behavior.
@@ -273,5 +274,5 @@ type InitTabsParams = {
273
274
  * @throws {Error} Throws an error if the `params.initialTab` does not match any label in `tabsLabel`.
274
275
  */
275
276
  declare function initTabs(params: InitTabsParams): void;
276
-
277
- export { addClassesOnSelectors, getFormValues, handleAddRemoveClassesOnSelectors, initSelect, initTabs, isCheckboxChecked, isNodeInput, jqSelector, removeClassesOnSelectors, resolveInputKey, resolveSelector, setFormValues, setInputValue, setText, watchInput };
277
+ //#endregion
278
+ export { addClassesOnSelectors, getFormValues, handleAddRemoveClassesOnSelectors, initSelect, initTabs, isCheckboxChecked, isNodeInput, jqSelector, removeClassesOnSelectors, resolveInputKey, resolveSelector, setFormValues, setInputValue, setText, watchInput };
@@ -1 +1 @@
1
- import'../../chunk-Z65JVQED.js';import {c}from'../../chunk-YESMJQI4.js';import'../../chunk-O2XFH626.js';function u(t){let e=t.startsWith("$"),n=t.startsWith("$$"),o=t.startsWith("#node-config-input")||t.startsWith("#node-input");return {isNodeIdShortcut:e,isNodeConfigIdShortcut:n,isFullSelector:o,value:e||n||o}}function s(t){let e=u(t);return e.isNodeConfigIdShortcut?`#node-config-input-${t.replace("$$","")}`:e.isNodeIdShortcut?`#node-input-${t.replace("$","")}`:t}function l(t,e,n){e.forEach(o=>{let r=document.querySelector(o);r&&n.forEach(i=>r.classList[t](i));});}function g(t,e){l("remove",t,e);}function p(t,e){l("add",t,e);}function f(t){return s(t).split("-input-")[1]}function h(t,e,n){let o=s(t),r=e;n!=null&&n.emptyValue&&(r=[{value:"",text:n.emptyValue},...e]),$(o).empty().append(r.map(i=>$("<option>",{value:i.value,text:i.text,selected:i.value===(n==null?void 0:n.selected)})));}function b(t,e,n={additionalEvents:[]}){let r=(Array.isArray(t)?t:[t]).map(s).join(", "),i=["input",...n.additionalEvents];$(r).on(i.join(" "),()=>{let a=$(r).map(function(){return $(this).val()}).get();e(a);});}function m(t,e){let n=s(t);$(n).val(e);}function x(t,e){let n=s(t);$(n).text(e);}function S(t){let e=s(t);return $(e)}function v(t){let e=s(t);return document.querySelector(e).checked}function y(t){let e={};return document.querySelectorAll(`[id^="node-input-${t}-"]`).forEach(n=>{let o=n,r=o.id.replace(`node-input-${t}-`,"");o.type==="checkbox"?e[r]=o.checked:e[r]=o.value;}),e}function I(t,e){e&&Object.entries(e).forEach(([n,o])=>{let r=document.querySelector(`#node-input-${t}-${n}`);r&&(r.type==="checkbox"?r.checked=!!o:r.value=String(o));});}function E(t){let e=`#tabs-content-${t.targetId}`,n=RED.tabs.create({id:t.targetId,onchange:o=>{$(e).children().addClass("hidden"),$(`#${o.id}`).removeClass("hidden");}});(t.tabsLabel||[]).forEach(o=>{n.addTab({id:`tab-${c(o)}`,label:o});}),n.activateTab(`tab-${c(t.initialTab)}`);}export{p as addClassesOnSelectors,y as getFormValues,l as handleAddRemoveClassesOnSelectors,h as initSelect,E as initTabs,v as isCheckboxChecked,u as isNodeInput,S as jqSelector,g as removeClassesOnSelectors,f as resolveInputKey,s as resolveSelector,I as setFormValues,m as setInputValue,x as setText,b as watchInput};
1
+ import"../../src-CXOjPWwR.js";const e=e=>{if(!e||e.length===0)return``;let t=e.toLowerCase();return t.substring(0,1).toUpperCase()+t.substring(1,t.length)},t=(t,n)=>{var r;let i=(r=t==null?void 0:t.replace(/([A-Z])+/g,e).split(/(?=[A-Z])|[\.\-\s_]/).map(e=>e.toLowerCase()))==null?[]:r;if(i.length===0)return``;if(i.length===1)return i[0];let a=i.reduce((e,t)=>`${e}_${t.toLowerCase()}`);return(n==null?void 0:n.splitOnNumber)===!1?a:a.replace(/([A-Za-z]{1}[0-9]{1})/,e=>`${e[0]}_${e[1]}`)};function n(e){let t=e.startsWith(`$`),n=e.startsWith(`$$`),r=e.startsWith(`#node-config-input`)||e.startsWith(`#node-input`);return{isNodeIdShortcut:t,isNodeConfigIdShortcut:n,isFullSelector:r,value:t||n||r}}function r(e){let t=n(e);return t.isNodeConfigIdShortcut?`#node-config-input-${e.replace(`$$`,``)}`:t.isNodeIdShortcut?`#node-input-${e.replace(`$`,``)}`:e}function i(e,t,n){t.forEach(t=>{let r=document.querySelector(t);r&&n.forEach(t=>r.classList[e](t))})}function a(e,t){i(`remove`,e,t)}function o(e,t){i(`add`,e,t)}function s(e){return r(e).split(`-input-`)[1]}function c(e,t,n){let i=r(e),a=t;n!=null&&n.emptyValue&&(a=[{value:``,text:n.emptyValue},...t]),$(i).empty().append(a.map(e=>$(`<option>`,{value:e.value,text:e.text,selected:e.value===(n==null?void 0:n.selected)})))}function l(e,t,n={additionalEvents:[]}){let i=(Array.isArray(e)?e:[e]).map(r).join(`, `),a=[`input`,...n.additionalEvents];$(i).on(a.join(` `),()=>{t($(i).map(function(){return $(this).val()}).get())})}function u(e,t){let n=r(e);$(n).val(t)}function d(e,t){let n=r(e);$(n).text(t)}function f(e){let t=r(e);return $(t)}function p(e){let t=r(e);return document.querySelector(t).checked}function m(e){let t={};return document.querySelectorAll(`[id^="node-input-${e}-"]`).forEach(n=>{let r=n,i=r.id.replace(`node-input-${e}-`,``);r.type===`checkbox`?t[i]=r.checked:t[i]=r.value}),t}function h(e,t){t&&Object.entries(t).forEach(([t,n])=>{let r=document.querySelector(`#node-input-${e}-${t}`);r&&(r.type===`checkbox`?r.checked=!!n:r.value=String(n))})}function g(e){let n=`#tabs-content-${e.targetId}`,r=RED.tabs.create({id:e.targetId,onchange:e=>{$(n).children().addClass(`hidden`),$(`#${e.id}`).removeClass(`hidden`)}});(e.tabsLabel||[]).forEach(e=>{r.addTab({id:`tab-${t(e)}`,label:e})}),r.activateTab(`tab-${t(e.initialTab)}`)}export{o as addClassesOnSelectors,m as getFormValues,i as handleAddRemoveClassesOnSelectors,c as initSelect,g as initTabs,p as isCheckboxChecked,n as isNodeInput,f as jqSelector,a as removeClassesOnSelectors,s as resolveInputKey,r as resolveSelector,h as setFormValues,u as setInputValue,d as setText,l as watchInput};
@@ -1 +1 @@
1
- 'use strict';function u(e){return Object.prototype.toString.call(e).slice(8,-1)}function n(e){if(u(e)!=="Object")return false;let r=Object.getPrototypeOf(e);return !!r&&r.constructor===Object&&r===Object.prototype}function c(e){return u(e)==="Symbol"}function x(e,r,s,i){let m={}.propertyIsEnumerable.call(i,r)?"enumerable":"nonenumerable";m==="enumerable"&&(e[r]=s),m==="nonenumerable"&&Object.defineProperty(e,r,{value:s,enumerable:false,writable:true,configurable:true});}function d(e,r,s){if(!n(r))return r;let i={};if(n(e)){let f=Object.getOwnPropertyNames(e),p=Object.getOwnPropertySymbols(e);i=[...f,...p].reduce((o,t)=>{if(t==="__proto__")return o;let l=e[t];return (!c(t)&&!Object.getOwnPropertyNames(r).includes(t)||c(t)&&!Object.getOwnPropertySymbols(r).includes(t))&&x(o,t,l,e),o},{});}let m=Object.getOwnPropertyNames(r),a=Object.getOwnPropertySymbols(r);return [...m,...a].reduce((f,p)=>{if(p==="__proto__")return f;let o=r[p],t=n(e)?e[p]:void 0;t!==void 0&&n(o)&&(o=d(t,o));let l=o;return x(f,p,l,r),f},i)}function b(e,...r){return r.reduce((s,i)=>d(s,i),e)}var O={};function v(e){return b(O,e)}exports.createEditorNode=v;
1
+ function e(e){return Object.prototype.toString.call(e).slice(8,-1)}function t(t){if(e(t)!==`Object`)return!1;let n=Object.getPrototypeOf(t);return!!n&&n.constructor===Object&&n===Object.prototype}function n(t){return e(t)===`Symbol`}function r(e,t,n,r){let i={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;i===`enumerable`&&(e[t]=n),i===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function i(e,a,o){if(!t(a))return a;let s={};if(t(e)){let t=Object.getOwnPropertyNames(e),i=Object.getOwnPropertySymbols(e);s=[...t,...i].reduce((t,i)=>{if(i===`__proto__`)return t;let o=e[i];return(!n(i)&&!Object.getOwnPropertyNames(a).includes(i)||n(i)&&!Object.getOwnPropertySymbols(a).includes(i))&&r(t,i,o,e),t},{})}let c=Object.getOwnPropertyNames(a),l=Object.getOwnPropertySymbols(a);return[...c,...l].reduce((n,s)=>{if(s===`__proto__`)return n;let c=a[s],l=t(e)?e[s]:void 0;return l!==void 0&&t(c)&&(c=i(l,c,o)),r(n,s,o?o(l,c,s):c,a),n},s)}function a(e,...t){return t.reduce((e,t)=>i(e,t),e)}const o={};function s(e){return a(o,e)}exports.createEditorNode=s;
@@ -1,6 +1,7 @@
1
- import { EditorNodeProperties, EditorNodeDef } from 'node-red';
2
- export { E as EditorDomHelper, N as NodeControllerConfig, a as NodeControllerInst, c as NodeEditorDefinition, b as NodeEditorProps } from '../types-B7YUmbnu.cjs';
1
+ import { EditorDomHelper, NodeControllerConfig, NodeControllerInst, NodeEditorDefinition, NodeEditorProps } from "../types-B_x2zkuM.cjs";
2
+ import { EditorNodeDef, EditorNodeProperties } from "node-red";
3
3
 
4
+ //#region src/editor/index.d.ts
4
5
  declare function createEditorNode<TProps extends EditorNodeProperties, TCreds = undefined, TInstProps extends TProps = TProps>(props: Partial<EditorNodeDef<TProps, TCreds, TInstProps>>): EditorNodeDef<TProps, TCreds, TInstProps>;
5
-
6
- export { createEditorNode };
6
+ //#endregion
7
+ export { EditorDomHelper, NodeControllerConfig, NodeControllerInst, NodeEditorDefinition, NodeEditorProps, createEditorNode };
@@ -1,6 +1,7 @@
1
- import { EditorNodeProperties, EditorNodeDef } from 'node-red';
2
- export { E as EditorDomHelper, N as NodeControllerConfig, a as NodeControllerInst, c as NodeEditorDefinition, b as NodeEditorProps } from '../types-B7YUmbnu.js';
1
+ import { EditorDomHelper, NodeControllerConfig, NodeControllerInst, NodeEditorDefinition, NodeEditorProps } from "../types-LozbF9aD.js";
2
+ import { EditorNodeDef, EditorNodeProperties } from "node-red";
3
3
 
4
+ //#region src/editor/index.d.ts
4
5
  declare function createEditorNode<TProps extends EditorNodeProperties, TCreds = undefined, TInstProps extends TProps = TProps>(props: Partial<EditorNodeDef<TProps, TCreds, TInstProps>>): EditorNodeDef<TProps, TCreds, TInstProps>;
5
-
6
- export { createEditorNode };
6
+ //#endregion
7
+ export { EditorDomHelper, NodeControllerConfig, NodeControllerInst, NodeEditorDefinition, NodeEditorProps, createEditorNode };
@@ -1 +1 @@
1
- import'../chunk-O2XFH626.js';function u(e){return Object.prototype.toString.call(e).slice(8,-1)}function n(e){if(u(e)!=="Object")return false;let r=Object.getPrototypeOf(e);return !!r&&r.constructor===Object&&r===Object.prototype}function c(e){return u(e)==="Symbol"}function x(e,r,s,i){let m={}.propertyIsEnumerable.call(i,r)?"enumerable":"nonenumerable";m==="enumerable"&&(e[r]=s),m==="nonenumerable"&&Object.defineProperty(e,r,{value:s,enumerable:false,writable:true,configurable:true});}function d(e,r,s){if(!n(r))return r;let i={};if(n(e)){let f=Object.getOwnPropertyNames(e),p=Object.getOwnPropertySymbols(e);i=[...f,...p].reduce((o,t)=>{if(t==="__proto__")return o;let l=e[t];return (!c(t)&&!Object.getOwnPropertyNames(r).includes(t)||c(t)&&!Object.getOwnPropertySymbols(r).includes(t))&&x(o,t,l,e),o},{});}let m=Object.getOwnPropertyNames(r),a=Object.getOwnPropertySymbols(r);return [...m,...a].reduce((f,p)=>{if(p==="__proto__")return f;let o=r[p],t=n(e)?e[p]:void 0;t!==void 0&&n(o)&&(o=d(t,o));let l=o;return x(f,p,l,r),f},i)}function b(e,...r){return r.reduce((s,i)=>d(s,i),e)}var O={};function v(e){return b(O,e)}export{v as createEditorNode};
1
+ function e(e){return Object.prototype.toString.call(e).slice(8,-1)}function t(t){if(e(t)!==`Object`)return!1;let n=Object.getPrototypeOf(t);return!!n&&n.constructor===Object&&n===Object.prototype}function n(t){return e(t)===`Symbol`}function r(e,t,n,r){let i={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;i===`enumerable`&&(e[t]=n),i===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function i(e,a,o){if(!t(a))return a;let s={};if(t(e)){let t=Object.getOwnPropertyNames(e),i=Object.getOwnPropertySymbols(e);s=[...t,...i].reduce((t,i)=>{if(i===`__proto__`)return t;let o=e[i];return(!n(i)&&!Object.getOwnPropertyNames(a).includes(i)||n(i)&&!Object.getOwnPropertySymbols(a).includes(i))&&r(t,i,o,e),t},{})}let c=Object.getOwnPropertyNames(a),l=Object.getOwnPropertySymbols(a);return[...c,...l].reduce((n,s)=>{if(s===`__proto__`)return n;let c=a[s],l=t(e)?e[s]:void 0;return l!==void 0&&t(c)&&(c=i(l,c,o)),r(n,s,o?o(l,c,s):c,a),n},s)}function a(e,...t){return t.reduce((e,t)=>i(e,t),e)}const o={};function s(e){return a(o,e)}export{s as createEditorNode};
@@ -1 +1 @@
1
- 'use strict';var u=Object.defineProperty;var m=(t,e,i)=>e in t?u(t,e,{enumerable:true,configurable:true,writable:true,value:i}):t[e]=i;var n=(t,e,i)=>m(t,typeof e!="symbol"?e+"":e,i);function d(t){let e=t.startsWith("[config]"),i=t.replace("[config]","");return `node-${e?"config-":""}input-${i}`}function a(){let t=document.createElement("div");return t.classList.add("dxp-form-row"),t}function p(t){let e;return ["text","checkbox","password"].includes(t.type)&&(e=document.createElement("input"),e.setAttribute("type",t.type),t.type==="text"&&(t!=null&&t.placeholder)&&e.setAttribute("placeholder",t.placeholder)),t.type==="select"&&(e=document.createElement("select")),e.setAttribute("id",t.id),e}var s=class extends HTMLElement{constructor(){super();n(this,"formRowContainer");n(this,"mainContainer");n(this,"labelText");n(this,"inputType");n(this,"iconClass");n(this,"rowId");this.formRowContainer=a(),this.rowId=d(this.getAttribute("row-id")||"row-id"),this.labelText=this.getAttribute("label")||"Label",this.inputType=this.getAttribute("type")||"text",this.iconClass=this.getAttribute("icon"),this.mainContainer=document.createElement("div"),this.mainContainer.classList.add("main");let i=this.querySelector(".hint"),c=this.querySelector(".checkbox-hint"),o=document.createElement("div");if(this.iconClass){let l=document.createElement("i");l.classList.add("fa",`fa-${this.iconClass}`),o.appendChild(l);}let r=document.createElement("label");r.setAttribute("for",this.rowId),r.textContent=this.labelText,o.appendChild(r),this.mainContainer.appendChild(o);let h=p({type:this.inputType,id:this.rowId});this.mainContainer.appendChild(h),this.inputType==="checkbox"&&c&&this.mainContainer.appendChild(c),this.formRowContainer.appendChild(this.mainContainer),i&&this.formRowContainer.appendChild(i),this.appendChild(this.formRowContainer);}};customElements.get("dxp-form-row")||customElements.define("dxp-form-row",s);exports.DxpFormRow=s;
1
+ function e(e){let t=e.startsWith(`[config]`),n=e.replace(`[config]`,``);return`node-${t?`config-`:``}input-${n}`}function t(){let e=document.createElement(`div`);return e.classList.add(`dxp-form-row`),e}function n(e){let t;return[`text`,`checkbox`,`password`].includes(e.type)&&(t=document.createElement(`input`),t.setAttribute(`type`,e.type),e.type===`text`&&e!=null&&e.placeholder&&t.setAttribute(`placeholder`,e.placeholder)),e.type===`select`&&(t=document.createElement(`select`)),t.setAttribute(`id`,e.id),t}var r=class extends HTMLElement{constructor(){super(),this.formRowContainer=t(),this.rowId=e(this.getAttribute(`row-id`)||`row-id`),this.labelText=this.getAttribute(`label`)||`Label`,this.inputType=this.getAttribute(`type`)||`text`,this.iconClass=this.getAttribute(`icon`),this.mainContainer=document.createElement(`div`),this.mainContainer.classList.add(`main`);let r=this.querySelector(`.hint`),i=this.querySelector(`.checkbox-hint`),a=document.createElement(`div`);if(this.iconClass){let e=document.createElement(`i`);e.classList.add(`fa`,`fa-${this.iconClass}`),a.appendChild(e)}let o=document.createElement(`label`);o.setAttribute(`for`,this.rowId),o.textContent=this.labelText,a.appendChild(o),this.mainContainer.appendChild(a);let s=n({type:this.inputType,id:this.rowId});this.mainContainer.appendChild(s),this.inputType===`checkbox`&&i&&this.mainContainer.appendChild(i),this.formRowContainer.appendChild(this.mainContainer),r&&this.formRowContainer.appendChild(r),this.appendChild(this.formRowContainer)}};customElements.get(`dxp-form-row`)||customElements.define(`dxp-form-row`,r),exports.DxpFormRow=r;
@@ -1,11 +1,12 @@
1
+ //#region src/editor/web-components/dxpFormRow.d.ts
1
2
  declare class DxpFormRow extends HTMLElement {
2
- private formRowContainer;
3
- private mainContainer;
4
- private labelText;
5
- private inputType;
6
- private iconClass;
7
- private rowId;
8
- constructor();
3
+ private formRowContainer;
4
+ private mainContainer;
5
+ private labelText;
6
+ private inputType;
7
+ private iconClass;
8
+ private rowId;
9
+ constructor();
9
10
  }
10
-
11
- export { DxpFormRow };
11
+ //#endregion
12
+ export { DxpFormRow };
@@ -1,11 +1,12 @@
1
+ //#region src/editor/web-components/dxpFormRow.d.ts
1
2
  declare class DxpFormRow extends HTMLElement {
2
- private formRowContainer;
3
- private mainContainer;
4
- private labelText;
5
- private inputType;
6
- private iconClass;
7
- private rowId;
8
- constructor();
3
+ private formRowContainer;
4
+ private mainContainer;
5
+ private labelText;
6
+ private inputType;
7
+ private iconClass;
8
+ private rowId;
9
+ constructor();
9
10
  }
10
-
11
- export { DxpFormRow };
11
+ //#endregion
12
+ export { DxpFormRow };
@@ -1 +1 @@
1
- import {a as a$1}from'../../chunk-O2XFH626.js';function d(t){let e=t.startsWith("[config]"),n=t.replace("[config]","");return `node-${e?"config-":""}input-${n}`}function a(){let t=document.createElement("div");return t.classList.add("dxp-form-row"),t}function p(t){let e;return ["text","checkbox","password"].includes(t.type)&&(e=document.createElement("input"),e.setAttribute("type",t.type),t.type==="text"&&(t!=null&&t.placeholder)&&e.setAttribute("placeholder",t.placeholder)),t.type==="select"&&(e=document.createElement("select")),e.setAttribute("id",t.id),e}var s=class extends HTMLElement{constructor(){super();a$1(this,"formRowContainer");a$1(this,"mainContainer");a$1(this,"labelText");a$1(this,"inputType");a$1(this,"iconClass");a$1(this,"rowId");this.formRowContainer=a(),this.rowId=d(this.getAttribute("row-id")||"row-id"),this.labelText=this.getAttribute("label")||"Label",this.inputType=this.getAttribute("type")||"text",this.iconClass=this.getAttribute("icon"),this.mainContainer=document.createElement("div"),this.mainContainer.classList.add("main");let n=this.querySelector(".hint"),c=this.querySelector(".checkbox-hint"),o=document.createElement("div");if(this.iconClass){let l=document.createElement("i");l.classList.add("fa",`fa-${this.iconClass}`),o.appendChild(l);}let r=document.createElement("label");r.setAttribute("for",this.rowId),r.textContent=this.labelText,o.appendChild(r),this.mainContainer.appendChild(o);let h=p({type:this.inputType,id:this.rowId});this.mainContainer.appendChild(h),this.inputType==="checkbox"&&c&&this.mainContainer.appendChild(c),this.formRowContainer.appendChild(this.mainContainer),n&&this.formRowContainer.appendChild(n),this.appendChild(this.formRowContainer);}};customElements.get("dxp-form-row")||customElements.define("dxp-form-row",s);export{s as DxpFormRow};
1
+ function e(e){let t=e.startsWith(`[config]`),n=e.replace(`[config]`,``);return`node-${t?`config-`:``}input-${n}`}function t(){let e=document.createElement(`div`);return e.classList.add(`dxp-form-row`),e}function n(e){let t;return[`text`,`checkbox`,`password`].includes(e.type)&&(t=document.createElement(`input`),t.setAttribute(`type`,e.type),e.type===`text`&&e!=null&&e.placeholder&&t.setAttribute(`placeholder`,e.placeholder)),e.type===`select`&&(t=document.createElement(`select`)),t.setAttribute(`id`,e.id),t}var r=class extends HTMLElement{constructor(){super(),this.formRowContainer=t(),this.rowId=e(this.getAttribute(`row-id`)||`row-id`),this.labelText=this.getAttribute(`label`)||`Label`,this.inputType=this.getAttribute(`type`)||`text`,this.iconClass=this.getAttribute(`icon`),this.mainContainer=document.createElement(`div`),this.mainContainer.classList.add(`main`);let r=this.querySelector(`.hint`),i=this.querySelector(`.checkbox-hint`),a=document.createElement(`div`);if(this.iconClass){let e=document.createElement(`i`);e.classList.add(`fa`,`fa-${this.iconClass}`),a.appendChild(e)}let o=document.createElement(`label`);o.setAttribute(`for`,this.rowId),o.textContent=this.labelText,a.appendChild(o),this.mainContainer.appendChild(a);let s=n({type:this.inputType,id:this.rowId});this.mainContainer.appendChild(s),this.inputType===`checkbox`&&i&&this.mainContainer.appendChild(i),this.formRowContainer.appendChild(this.mainContainer),r&&this.formRowContainer.appendChild(r),this.appendChild(this.formRowContainer)}};customElements.get(`dxp-form-row`)||customElements.define(`dxp-form-row`,r);export{r as DxpFormRow};
@@ -0,0 +1,6 @@
1
+ import { NodeAPI } from "node-red";
2
+
3
+ //#region src/index.d.ts
4
+ declare global {
5
+ var RED: NodeAPI;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { NodeAPI } from "node-red";
2
+
3
+ //#region src/index.d.ts
4
+ declare global {
5
+ var RED: NodeAPI;
6
+ }
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';
1
+ require(`./src-BNoPX5QG.cjs`);
package/dist/index.d.cts CHANGED
@@ -1,5 +1 @@
1
- import { NodeAPI } from 'node-red';
2
-
3
- declare global {
4
- var RED: NodeAPI;
5
- }
1
+ import "./index-CZL133rH.cjs";
package/dist/index.d.ts CHANGED
@@ -1,5 +1 @@
1
- import { NodeAPI } from 'node-red';
2
-
3
- declare global {
4
- var RED: NodeAPI;
5
- }
1
+ import "./index-Br38J6RF.js";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import'./chunk-Z65JVQED.js';
1
+ import"./src-CXOjPWwR.js";
File without changes
@@ -1,14 +1,15 @@
1
- import { NodeDef, Node, EditorNodeProperties, EditorNodeDef } from 'node-red';
1
+ import { EditorNodeDef, EditorNodeProperties, Node, NodeDef } from "node-red";
2
2
 
3
+ //#region src/editor/types.d.ts
3
4
  type NodeControllerConfig<T> = NodeDef & T;
4
5
  type NodeControllerInst<T> = Node & T;
5
6
  type NodeEditorProps<T = Record<any, any>> = EditorNodeProperties & T;
6
7
  type NodeEditorDefinition<TProps extends EditorNodeProperties, TCreds = undefined, TInstProps extends TProps = TProps> = EditorNodeDef<TProps, TCreds, TInstProps>;
7
8
  declare namespace EditorDomHelper {
8
- type InitSelectParams = {
9
- selected?: string | number | unknown;
10
- emptyValue?: string;
11
- };
9
+ type InitSelectParams = {
10
+ selected?: string | number | unknown;
11
+ emptyValue?: string;
12
+ };
12
13
  }
13
-
14
- export { EditorDomHelper as E, type NodeControllerConfig as N, type NodeControllerInst as a, type NodeEditorProps as b, type NodeEditorDefinition as c };
14
+ //#endregion
15
+ export { EditorDomHelper, NodeControllerConfig, NodeControllerInst, NodeEditorDefinition, NodeEditorProps };
@@ -1,14 +1,15 @@
1
- import { NodeDef, Node, EditorNodeProperties, EditorNodeDef } from 'node-red';
1
+ import { EditorNodeDef, EditorNodeProperties, Node, NodeDef } from "node-red";
2
2
 
3
+ //#region src/editor/types.d.ts
3
4
  type NodeControllerConfig<T> = NodeDef & T;
4
5
  type NodeControllerInst<T> = Node & T;
5
6
  type NodeEditorProps<T = Record<any, any>> = EditorNodeProperties & T;
6
7
  type NodeEditorDefinition<TProps extends EditorNodeProperties, TCreds = undefined, TInstProps extends TProps = TProps> = EditorNodeDef<TProps, TCreds, TInstProps>;
7
8
  declare namespace EditorDomHelper {
8
- type InitSelectParams = {
9
- selected?: string | number | unknown;
10
- emptyValue?: string;
11
- };
9
+ type InitSelectParams = {
10
+ selected?: string | number | unknown;
11
+ emptyValue?: string;
12
+ };
12
13
  }
13
-
14
- export { EditorDomHelper as E, type NodeControllerConfig as N, type NodeControllerInst as a, type NodeEditorProps as b, type NodeEditorDefinition as c };
14
+ //#endregion
15
+ export { EditorDomHelper, NodeControllerConfig, NodeControllerInst, NodeEditorDefinition, NodeEditorProps };
@@ -1 +1 @@
1
- 'use strict';var y=(e,r,o)=>new Promise((d,a)=>{var l=n=>{try{u(o.next(n));}catch(i){a(i);}},t=n=>{try{u(o.throw(n));}catch(i){a(i);}},u=n=>n.done?d(n.value):Promise.resolve(n.value).then(l,t);u((o=o.apply(e,r)).next());});function N(e,r){return typeof e!="boolean"?(console.warn("Payload must be a boolean (true or false)."),[null,null]):e?[r,null]:[null,r]}function P(e){return RED.nodes.getNode(e)}function f(e){return new Promise(r=>{try{RED.util.evaluateNodeProperty(e.value,e.type,e.node,e.msg,(o,d)=>{r([o,d]);});}catch(o){r([o,void 0]);}})}function c(e,r,o={typedSuffix:"Type"}){function d(t,u){return f({value:t,type:u,node:e,msg:r})}function a(t){return typeof t!="boolean"&&t===""}function l(i,x){return y(this,arguments,function*(t,u,n={strictDefaultValue:void 0}){let[,s]=yield d(t==null?void 0:t[u],t==null?void 0:t[`${String(u)}${o.typedSuffix}`]);return (n==null?void 0:n.strictDefaultValue)!==void 0&&a(s)?n.strictDefaultValue:s})}return {evaluateNodeProperty:d,quickNodePropertyEval:l}}exports.evaluateNodeProperty=f;exports.getREDNode=P;exports.splitBooleanOutputs=N;exports.useControllerNode=c;
1
+ function e(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=t.apply(n,r);function s(t){e(o,i,a,s,c,`next`,t)}function c(t){e(o,i,a,s,c,`throw`,t)}s(void 0)})}}function n(e,t){return typeof e==`boolean`?e?[t,null]:[null,t]:(console.warn(`Payload must be a boolean (true or false).`),[null,null])}function r(e){return RED.nodes.getNode(e)}function i(e){return new Promise(t=>{try{RED.util.evaluateNodeProperty(e.value,e.type,e.node,e.msg,(e,n)=>{t([e,n])})}catch(e){t([e,void 0])}})}function a(e,n,r={typedSuffix:`Type`}){function a(t,r){return i({value:t,type:r,node:e,msg:n})}function o(e){return typeof e!=`boolean`&&e===``}function s(e,t){return c.apply(this,arguments)}function c(){return c=t(function*(e,t,n={strictDefaultValue:void 0}){let[,i]=yield a(e==null?void 0:e[t],e==null?void 0:e[`${String(t)}${r.typedSuffix}`]);return(n==null?void 0:n.strictDefaultValue)===void 0?i:o(i)?n.strictDefaultValue:i}),c.apply(this,arguments)}return{evaluateNodeProperty:a,quickNodePropertyEval:s}}exports.evaluateNodeProperty=i,exports.getREDNode=r,exports.splitBooleanOutputs=n,exports.useControllerNode=a;
@@ -1,8 +1,6 @@
1
- import { NodeAPI, Node, NodeMessage } from 'node-red';
1
+ import { Node, NodeMessage } from "node-red";
2
2
 
3
- declare global {
4
- var RED: NodeAPI;
5
- }
3
+ //#region src/utils/server-side/controller.d.ts
6
4
 
7
5
  /**
8
6
  * Splits a message into two outputs based on a boolean condition.
@@ -54,10 +52,10 @@ declare function splitBooleanOutputs(conditionTerm: boolean, msg: unknown): unkn
54
52
  */
55
53
  declare function getREDNode<TFields extends {} = Record<any, any>, TCreds extends {} = Record<any, any>>(idNode: string): (Node<TCreds> & TFields) | null;
56
54
  type EvaluateNodePropertyParams = {
57
- value: string;
58
- type: string;
59
- node: Node;
60
- msg: NodeMessage;
55
+ value: string;
56
+ type: string;
57
+ node: Node;
58
+ msg: NodeMessage;
61
59
  };
62
60
  /**
63
61
  * Evaluates a node property in the Node-RED environment.
@@ -139,12 +137,12 @@ declare function evaluateNodeProperty(params: EvaluateNodePropertyParams): Promi
139
137
  * @returns {object} An object containing utility functions for evaluating node properties.
140
138
  */
141
139
  declare function useControllerNode(node: Node, msg: NodeMessage, opts?: {
142
- typedSuffix: string;
140
+ typedSuffix: string;
143
141
  }): {
144
- evaluateNodeProperty: (value: EvaluateNodePropertyParams["value"], type: EvaluateNodePropertyParams["type"]) => Promise<[Error | undefined, any | undefined]>;
145
- quickNodePropertyEval: <T extends object>(bag: T, term: keyof T, quickOpts?: {
146
- strictDefaultValue: any;
147
- }) => Promise<any>;
142
+ evaluateNodeProperty: (value: EvaluateNodePropertyParams["value"], type: EvaluateNodePropertyParams["type"]) => Promise<[Error | undefined, any | undefined]>;
143
+ quickNodePropertyEval: <T extends object>(bag: T, term: keyof T, quickOpts?: {
144
+ strictDefaultValue: any;
145
+ }) => Promise<any>;
148
146
  };
149
-
150
- export { evaluateNodeProperty, getREDNode, splitBooleanOutputs, useControllerNode };
147
+ //#endregion
148
+ export { evaluateNodeProperty, getREDNode, splitBooleanOutputs, useControllerNode };
@@ -1,8 +1,6 @@
1
- import { NodeAPI, Node, NodeMessage } from 'node-red';
1
+ import { Node, NodeMessage } from "node-red";
2
2
 
3
- declare global {
4
- var RED: NodeAPI;
5
- }
3
+ //#region src/utils/server-side/controller.d.ts
6
4
 
7
5
  /**
8
6
  * Splits a message into two outputs based on a boolean condition.
@@ -54,10 +52,10 @@ declare function splitBooleanOutputs(conditionTerm: boolean, msg: unknown): unkn
54
52
  */
55
53
  declare function getREDNode<TFields extends {} = Record<any, any>, TCreds extends {} = Record<any, any>>(idNode: string): (Node<TCreds> & TFields) | null;
56
54
  type EvaluateNodePropertyParams = {
57
- value: string;
58
- type: string;
59
- node: Node;
60
- msg: NodeMessage;
55
+ value: string;
56
+ type: string;
57
+ node: Node;
58
+ msg: NodeMessage;
61
59
  };
62
60
  /**
63
61
  * Evaluates a node property in the Node-RED environment.
@@ -139,12 +137,12 @@ declare function evaluateNodeProperty(params: EvaluateNodePropertyParams): Promi
139
137
  * @returns {object} An object containing utility functions for evaluating node properties.
140
138
  */
141
139
  declare function useControllerNode(node: Node, msg: NodeMessage, opts?: {
142
- typedSuffix: string;
140
+ typedSuffix: string;
143
141
  }): {
144
- evaluateNodeProperty: (value: EvaluateNodePropertyParams["value"], type: EvaluateNodePropertyParams["type"]) => Promise<[Error | undefined, any | undefined]>;
145
- quickNodePropertyEval: <T extends object>(bag: T, term: keyof T, quickOpts?: {
146
- strictDefaultValue: any;
147
- }) => Promise<any>;
142
+ evaluateNodeProperty: (value: EvaluateNodePropertyParams["value"], type: EvaluateNodePropertyParams["type"]) => Promise<[Error | undefined, any | undefined]>;
143
+ quickNodePropertyEval: <T extends object>(bag: T, term: keyof T, quickOpts?: {
144
+ strictDefaultValue: any;
145
+ }) => Promise<any>;
148
146
  };
149
-
150
- export { evaluateNodeProperty, getREDNode, splitBooleanOutputs, useControllerNode };
147
+ //#endregion
148
+ export { evaluateNodeProperty, getREDNode, splitBooleanOutputs, useControllerNode };
@@ -1 +1 @@
1
- var y=(e,r,o)=>new Promise((d,a)=>{var l=n=>{try{u(o.next(n));}catch(i){a(i);}},t=n=>{try{u(o.throw(n));}catch(i){a(i);}},u=n=>n.done?d(n.value):Promise.resolve(n.value).then(l,t);u((o=o.apply(e,r)).next());});function N(e,r){return typeof e!="boolean"?(console.warn("Payload must be a boolean (true or false)."),[null,null]):e?[r,null]:[null,r]}function P(e){return RED.nodes.getNode(e)}function f(e){return new Promise(r=>{try{RED.util.evaluateNodeProperty(e.value,e.type,e.node,e.msg,(o,d)=>{r([o,d]);});}catch(o){r([o,void 0]);}})}function c(e,r,o={typedSuffix:"Type"}){function d(t,u){return f({value:t,type:u,node:e,msg:r})}function a(t){return typeof t!="boolean"&&t===""}function l(i,x){return y(this,arguments,function*(t,u,n={strictDefaultValue:void 0}){let[,s]=yield d(t==null?void 0:t[u],t==null?void 0:t[`${String(u)}${o.typedSuffix}`]);return (n==null?void 0:n.strictDefaultValue)!==void 0&&a(s)?n.strictDefaultValue:s})}return {evaluateNodeProperty:d,quickNodePropertyEval:l}}export{f as evaluateNodeProperty,P as getREDNode,N as splitBooleanOutputs,c as useControllerNode};
1
+ function e(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=t.apply(n,r);function s(t){e(o,i,a,s,c,`next`,t)}function c(t){e(o,i,a,s,c,`throw`,t)}s(void 0)})}}function n(e,t){return typeof e==`boolean`?e?[t,null]:[null,t]:(console.warn(`Payload must be a boolean (true or false).`),[null,null])}function r(e){return RED.nodes.getNode(e)}function i(e){return new Promise(t=>{try{RED.util.evaluateNodeProperty(e.value,e.type,e.node,e.msg,(e,n)=>{t([e,n])})}catch(e){t([e,void 0])}})}function a(e,n,r={typedSuffix:`Type`}){function a(t,r){return i({value:t,type:r,node:e,msg:n})}function o(e){return typeof e!=`boolean`&&e===``}function s(e,t){return c.apply(this,arguments)}function c(){return c=t(function*(e,t,n={strictDefaultValue:void 0}){let[,i]=yield a(e==null?void 0:e[t],e==null?void 0:e[`${String(t)}${r.typedSuffix}`]);return(n==null?void 0:n.strictDefaultValue)===void 0?i:o(i)?n.strictDefaultValue:i}),c.apply(this,arguments)}return{evaluateNodeProperty:a,quickNodePropertyEval:s}}export{i as evaluateNodeProperty,r as getREDNode,n as splitBooleanOutputs,a as useControllerNode};
@@ -1,2 +1 @@
1
- 'use strict';function l(t){return /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(t)}function a(t){return /^(([0-9a-fA-F]{1,4}:){7}([0-9a-fA-F]{1,4}|:)|(([0-9a-fA-F]{1,4}:){1,6}:)|(([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2})|(([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3})|(([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4})|(([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5})|([0-9a-fA-F]{1,4}:)((:[0-9a-fA-F]{1,4}){1,6})|(:((:[0-9a-fA-F]{1,4}){1,7}|:))|(fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,})|(::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9]))|(([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])))$/.test(t)}function g(t){return l(t)||a(t)}function p(t,{lenient:r=false}={}){if(typeof t!="string")throw new TypeError("isUrl: Expected a string");let e=t.trim();if(e.includes(" "))return false;try{return new URL(e),!0}catch(n){return r?p(`https://${e}`):false}}var h=t=>!!(t&&t.constructor&&t.call&&t.apply);var u=t=>!(!t||!t.then||!h(t.then));var o=(t,r,e)=>!r&&!t?[]:r?t?e?t.reduce((n,i)=>{let c=r.find(f=>e(i)===e(f));return c?n.push(c):n.push(i),n},[]):t:[]:t;var s=t=>(...r)=>{try{let e=t(...r);return u(e)?e.then(n=>[void 0,n]).catch(n=>[n,void 0]):[void 0,e]}catch(e){return [e,void 0]}};
2
- exports.isUrl=p;exports.isValidIP=g;exports.isValidIPv4=l;exports.isValidIPv6=a;exports.merge=o;exports.tryit=s;
1
+ const e=Array.isArray,t=e=>!!(e&&e.constructor&&e.call&&e.apply),n=e=>!(!e||!e.then||!t(e.then)),r=(e,t,n=!1)=>e?e.slice().sort(n===!0?(e,n)=>t(n)-t(e):(e,n)=>t(e)-t(n)):[];function*i(e,n,r=e=>e,i=1){let a=t(r)?r:()=>r,o=n?e:0,s=n==null?e:n;for(let e=o;e<=s&&(yield a(e),!(e+i>s));e+=i);}const a=(e,t,n,r)=>Array.from(i(e,t,n,r)),o=(e,t)=>e?e.reduce((e,n)=>{let[r,i]=e;return t(n)?[[...r,n],i]:[r,[...i,n]]},[[],[]]):[[],[]],s=(e,t,n)=>!t&&!e?[]:t?e?n?e.reduce((e,r)=>{let i=t.find(e=>n(r)===n(e));return i?e.push(i):e.push(r),e},[]):e:[]:e;function c(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function l(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){c(a,r,i,o,s,`next`,e)}function s(e){c(a,r,i,o,s,`throw`,e)}o(void 0)})}}const u=function(){var e=l(function*(e,t,n){let r=n!==void 0;if(!r&&(e==null?void 0:e.length)<1)throw Error(`Cannot reduce empty array with no init value`);let i=r?e:e.slice(1),a=r?n:e[0];for(let[e,n]of i.entries())a=yield t(a,n,e);return a});return function(t,n,r){return e.apply(this,arguments)}}(),d=function(){var e=l(function*(e,t){if(!e)return[];let n=[],r=0;for(let i of e){let e=yield t(i,r++);n.push(e)}return n});return function(t,n){return e.apply(this,arguments)}}(),f=function(){var e=l(function*(e){let t=[],[n,r]=yield _(e)((e,n)=>{var r;return t.push({fn:e,rethrow:(r=n==null?void 0:n.rethrow)==null?!1:r})});for(let{fn:e,rethrow:r}of t){let[t]=yield _(e)(n);if(t&&r)throw t}if(n)throw n;return r});return function(t){return e.apply(this,arguments)}}();var p=class extends Error{constructor(e=[]){var t,n,r,i;super(),this.name=`AggregateError(${(t=(n=e.find(e=>e.name))==null?void 0:n.name)==null?``:t}...)`,this.message=`AggregateError with ${e.length} errors`,this.stack=(r=(i=e.find(e=>e.stack))==null?void 0:i.stack)==null?this.stack:r,this.errors=e}};const m=function(){var e=l(function*(e,t,n){let i=t.map((e,t)=>({index:t,item:e})),s=function(){var e=l(function*(e){let t=[];for(;;){let r=i.pop();if(!r)return e(t);let[a,o]=yield _(n)(r.item);t.push({error:a,result:o,index:r.index})}});return function(t){return e.apply(this,arguments)}}(),c=a(1,e).map(()=>new Promise(s)),[u,d]=o(r((yield Promise.all(c)).flat(),e=>e.index),e=>!!e.error);if(u.length>0)throw new p(u.map(e=>e.error));return d.map(e=>e.result)});return function(t,n,r){return e.apply(this,arguments)}}(),h=function(){var e=l(function*(e,t){var n,r;let a=(n=e==null?void 0:e.times)==null?3:n,o=e==null?void 0:e.delay,s=(r=e==null?void 0:e.backoff)==null?null:r;for(let e of i(1,a)){let[n,r]=yield _(t)(e=>{throw{_exited:e}});if(!n)return r;if(n._exited)throw n._exited;if(e===a)throw n;o&&(yield g(o)),s&&(yield g(s(e)))}});return function(t,n){return e.apply(this,arguments)}}(),g=e=>new Promise(t=>setTimeout(t,e)),_=e=>(...t)=>{try{let r=e(...t);return n(r)?r.then(e=>[void 0,e]).catch(e=>[e,void 0]):[void 0,r]}catch(e){return[e,void 0]}};function v(e){return/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e)}function y(e){return/^(([0-9a-fA-F]{1,4}:){7}([0-9a-fA-F]{1,4}|:)|(([0-9a-fA-F]{1,4}:){1,6}:)|(([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2})|(([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3})|(([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4})|(([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5})|([0-9a-fA-F]{1,4}:)((:[0-9a-fA-F]{1,4}){1,6})|(:((:[0-9a-fA-F]{1,4}){1,7}|:))|(fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,})|(::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9]))|(([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])))$/.test(e)}function b(e){return v(e)||y(e)}function x(e,{lenient:t=!1}={}){if(typeof e!=`string`)throw TypeError(`isUrl: Expected a string`);let n=e.trim();if(n.includes(` `))return!1;try{return new URL(n),!0}catch(e){return t?x(`https://${n}`):!1}}exports.isUrl=x,exports.isValidIP=b,exports.isValidIPv4=v,exports.isValidIPv6=y,exports.merge=s,exports.tryit=_;
@@ -1,4 +1,6 @@
1
- export { merge, tryit } from 'radash';
1
+ import { merge, tryit } from "radash";
2
+
3
+ //#region src/utils/validators.d.ts
2
4
 
3
5
  /**
4
6
  * Validates if the given string is a valid IPv4 address.
@@ -72,8 +74,10 @@ declare function isValidIP(ip: string): boolean;
72
74
  * isUrl("invalid url"); // false
73
75
  * ```
74
76
  */
75
- declare function isUrl(string: string, { lenient }?: {
76
- lenient?: boolean;
77
+ declare function isUrl(string: string, {
78
+ lenient
79
+ }?: {
80
+ lenient?: boolean;
77
81
  }): boolean;
78
-
79
- export { isUrl, isValidIP, isValidIPv4, isValidIPv6 };
82
+ //#endregion
83
+ export { isUrl, isValidIP, isValidIPv4, isValidIPv6, merge, tryit };
@@ -1,4 +1,6 @@
1
- export { merge, tryit } from 'radash';
1
+ import { merge, tryit } from "radash";
2
+
3
+ //#region src/utils/validators.d.ts
2
4
 
3
5
  /**
4
6
  * Validates if the given string is a valid IPv4 address.
@@ -72,8 +74,10 @@ declare function isValidIP(ip: string): boolean;
72
74
  * isUrl("invalid url"); // false
73
75
  * ```
74
76
  */
75
- declare function isUrl(string: string, { lenient }?: {
76
- lenient?: boolean;
77
+ declare function isUrl(string: string, {
78
+ lenient
79
+ }?: {
80
+ lenient?: boolean;
77
81
  }): boolean;
78
-
79
- export { isUrl, isValidIP, isValidIPv4, isValidIPv6 };
82
+ //#endregion
83
+ export { isUrl, isValidIP, isValidIPv4, isValidIPv6, merge, tryit };
@@ -1,2 +1 @@
1
- export{a as merge,b as tryit}from'../chunk-YESMJQI4.js';import'../chunk-O2XFH626.js';function a(t){return /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(t)}function i(t){return /^(([0-9a-fA-F]{1,4}:){7}([0-9a-fA-F]{1,4}|:)|(([0-9a-fA-F]{1,4}:){1,6}:)|(([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2})|(([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3})|(([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4})|(([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5})|([0-9a-fA-F]{1,4}:)((:[0-9a-fA-F]{1,4}){1,6})|(:((:[0-9a-fA-F]{1,4}){1,7}|:))|(fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,})|(::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9]))|(([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])))$/.test(t)}function A(t){return a(t)||i(t)}function s(t,{lenient:r=false}={}){if(typeof t!="string")throw new TypeError("isUrl: Expected a string");let f=t.trim();if(f.includes(" "))return false;try{return new URL(f),!0}catch(o){return r?s(`https://${f}`):false}}
2
- export{s as isUrl,A as isValidIP,a as isValidIPv4,i as isValidIPv6};
1
+ Array.isArray;const e=e=>!!(e&&e.constructor&&e.call&&e.apply),t=t=>!(!t||!t.then||!e(t.then)),n=(e,t,n=!1)=>e?e.slice().sort(n===!0?(e,n)=>t(n)-t(e):(e,n)=>t(e)-t(n)):[];function*r(t,n,r=e=>e,i=1){let a=e(r)?r:()=>r,o=n?t:0,s=n==null?t:n;for(let e=o;e<=s&&(yield a(e),!(e+i>s));e+=i);}const i=(e,t,n,i)=>Array.from(r(e,t,n,i)),a=(e,t)=>e?e.reduce((e,n)=>{let[r,i]=e;return t(n)?[[...r,n],i]:[r,[...i,n]]},[[],[]]):[[],[]],o=(e,t,n)=>!t&&!e?[]:t?e?n?e.reduce((e,r)=>{let i=t.find(e=>n(r)===n(e));return i?e.push(i):e.push(r),e},[]):e:[]:e;function s(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){s(a,r,i,o,c,`next`,e)}function c(e){s(a,r,i,o,c,`throw`,e)}o(void 0)})}}(function(){var e=c(function*(e,t,n){let r=n!==void 0;if(!r&&(e==null?void 0:e.length)<1)throw Error(`Cannot reduce empty array with no init value`);let i=r?e:e.slice(1),a=r?n:e[0];for(let[e,n]of i.entries())a=yield t(a,n,e);return a});return function(t,n,r){return e.apply(this,arguments)}})(),function(){var e=c(function*(e,t){if(!e)return[];let n=[],r=0;for(let i of e){let e=yield t(i,r++);n.push(e)}return n});return function(t,n){return e.apply(this,arguments)}}(),function(){var e=c(function*(e){let t=[],[n,r]=yield d(e)((e,n)=>{var r;return t.push({fn:e,rethrow:(r=n==null?void 0:n.rethrow)==null?!1:r})});for(let{fn:e,rethrow:r}of t){let[t]=yield d(e)(n);if(t&&r)throw t}if(n)throw n;return r});return function(t){return e.apply(this,arguments)}}();var l=class extends Error{constructor(e=[]){var t,n,r,i;super(),this.name=`AggregateError(${(t=(n=e.find(e=>e.name))==null?void 0:n.name)==null?``:t}...)`,this.message=`AggregateError with ${e.length} errors`,this.stack=(r=(i=e.find(e=>e.stack))==null?void 0:i.stack)==null?this.stack:r,this.errors=e}};(function(){var e=c(function*(e,t,r){let o=t.map((e,t)=>({index:t,item:e})),s=function(){var e=c(function*(e){let t=[];for(;;){let n=o.pop();if(!n)return e(t);let[i,a]=yield d(r)(n.item);t.push({error:i,result:a,index:n.index})}});return function(t){return e.apply(this,arguments)}}(),u=i(1,e).map(()=>new Promise(s)),[f,p]=a(n((yield Promise.all(u)).flat(),e=>e.index),e=>!!e.error);if(f.length>0)throw new l(f.map(e=>e.error));return p.map(e=>e.result)});return function(t,n,r){return e.apply(this,arguments)}})(),function(){var e=c(function*(e,t){var n,i;let a=(n=e==null?void 0:e.times)==null?3:n,o=e==null?void 0:e.delay,s=(i=e==null?void 0:e.backoff)==null?null:i;for(let e of r(1,a)){let[n,r]=yield d(t)(e=>{throw{_exited:e}});if(!n)return r;if(n._exited)throw n._exited;if(e===a)throw n;o&&(yield u(o)),s&&(yield u(s(e)))}});return function(t,n){return e.apply(this,arguments)}}();const u=e=>new Promise(t=>setTimeout(t,e)),d=e=>(...n)=>{try{let r=e(...n);return t(r)?r.then(e=>[void 0,e]).catch(e=>[e,void 0]):[void 0,r]}catch(e){return[e,void 0]}};function f(e){return/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e)}function p(e){return/^(([0-9a-fA-F]{1,4}:){7}([0-9a-fA-F]{1,4}|:)|(([0-9a-fA-F]{1,4}:){1,6}:)|(([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2})|(([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3})|(([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4})|(([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5})|([0-9a-fA-F]{1,4}:)((:[0-9a-fA-F]{1,4}){1,6})|(:((:[0-9a-fA-F]{1,4}){1,7}|:))|(fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,})|(::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9]))|(([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9])?[0-9])))$/.test(e)}function m(e){return f(e)||p(e)}function h(e,{lenient:t=!1}={}){if(typeof e!=`string`)throw TypeError(`isUrl: Expected a string`);let n=e.trim();if(n.includes(` `))return!1;try{return new URL(n),!0}catch(e){return t?h(`https://${n}`):!1}}export{h as isUrl,m as isValidIP,f as isValidIPv4,p as isValidIPv6,o as merge,d as tryit};