@keload/node-red-dxp 1.20.0 → 1.22.0

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.
@@ -0,0 +1 @@
1
+ var a=e=>!!(e&&e.constructor&&e.call&&e.apply);var u=e=>!(!e||!e.then||!a(e.then));var p=(e,r,t)=>!r&&!e?[]:r?e?t?e.reduce((n,c)=>{let s=r.find(i=>t(c)===t(i));return s?n.push(s):n.push(c),n},[]):e:[]:e;var o=e=>(...r)=>{try{let t=e(...r);return u(t)?t.then(n=>[void 0,n]).catch(n=>[n,void 0]):[void 0,t]}catch(t){return [t,void 0]}};var f=e=>{if(!e||e.length===0)return "";let r=e.toLowerCase();return r.substring(0,1).toUpperCase()+r.substring(1,r.length)};var m=(e,r)=>{var c;let t=(c=e==null?void 0:e.replace(/([A-Z])+/g,f).split(/(?=[A-Z])|[\.\-\s_]/).map(s=>s.toLowerCase()))!=null?c:[];if(t.length===0)return "";if(t.length===1)return t[0];let n=t.reduce((s,i)=>`${s}_${i.toLowerCase()}`);return (r==null?void 0:r.splitOnNumber)===!1?n:n.replace(/([A-Za-z]{1}[0-9]{1})/,s=>`${s[0]}_${s[1]}`)};export{p as a,o as b,m as c};
File without changes
@@ -7,7 +7,7 @@
7
7
  ${t}`,Cu=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hu=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Eu=(e,t,u)=>{let r=u===""?"":`with ${u.trim()}() `,o=pu.bind(null,r,t.toString());Object.defineProperty(o,"name",hu);let{writable:s,enumerable:i,configurable:n}=Cu;Object.defineProperty(e,"toString",{value:o,writable:s,enumerable:i,configurable:n});};function se(e,t,{ignoreNonConfigurable:u=!1}={}){let{name:r}=e;for(let o of Reflect.ownKeys(t))mu(e,t,o,u);return fu(e,t),Eu(e,t,r),e}var W=new WeakMap,We=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let u,r=0,o=e.displayName||e.name||"<anonymous>",s=function(...i){if(W.set(s,++r),r===1)u=e.apply(this,i),e=void 0;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return u};return se(s,e),W.set(s,r),s};We.callCount=e=>{if(!W.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return W.get(e)};var He=We;var x=[];x.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&x.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&x.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var H=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",ie=Symbol.for("signal-exit emitter"),ne=globalThis,gu=Object.defineProperty.bind(Object),De=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(ne[ie])return ne[ie];gu(ne,ie,{value:this,writable:!1,enumerable:!1,configurable:!1});}on(t,u){this.listeners[t].push(u);}removeListener(t,u){let r=this.listeners[t],o=r.indexOf(u);o!==-1&&(o===0&&r.length===1?r.length=0:r.splice(o,1));}emit(t,u,r){if(this.emitted[t])return !1;this.emitted[t]=!0;let o=!1;for(let s of this.listeners[t])o=s(u,r)===!0||o;return t==="exit"&&(o=this.emit("afterExit",u,r)||o),o}},U=class{},Bu=e=>({onExit(t,u){return e.onExit(t,u)},load(){return e.load()},unload(){return e.unload()}}),ae=class extends U{onExit(){return ()=>{}}load(){}unload(){}},le=class extends U{#i=Fe.platform==="win32"?"SIGINT":"SIGHUP";#u=new De;#e;#o;#c;#t={};#s=!1;constructor(t){super(),this.#e=t,this.#t={};for(let u of x)this.#t[u]=()=>{let r=this.#e.listeners(u),{count:o}=this.#u,s=t;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(o+=s.__signal_exit_emitter__.count),r.length===o){this.unload();let i=this.#u.emit("exit",null,u),n=u==="SIGHUP"?this.#i:u;i||t.kill(t.pid,n);}};this.#c=t.reallyExit,this.#o=t.emit;}onExit(t,u){if(!H(this.#e))return ()=>{};this.#s===!1&&this.load();let r=u!=null&&u.alwaysLast?"afterExit":"exit";return this.#u.on(r,t),()=>{this.#u.removeListener(r,t),this.#u.listeners.exit.length===0&&this.#u.listeners.afterExit.length===0&&this.unload();}}load(){if(!this.#s){this.#s=!0,this.#u.count+=1;for(let t of x)try{let u=this.#t[t];u&&this.#e.on(t,u);}catch{}this.#e.emit=(t,...u)=>this.#m(t,...u),this.#e.reallyExit=t=>this.#r(t);}}unload(){this.#s&&(this.#s=!1,x.forEach(t=>{let u=this.#t[t];if(!u)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,u);}catch{}}),this.#e.emit=this.#o,this.#e.reallyExit=this.#c,this.#u.count-=1);}#r(t){return H(this.#e)?(this.#e.exitCode=t||0,this.#u.emit("exit",this.#e.exitCode,null),this.#c.call(this.#e,this.#e.exitCode)):0}#m(t,...u){let r=this.#o;if(t==="exit"&&H(this.#e)){typeof u[0]=="number"&&(this.#e.exitCode=u[0]);let o=r.call(this.#e,t,...u);return this.#u.emit("exit",this.#e.exitCode,null),o}else return r.call(this.#e,t,...u)}},Fe=globalThis.process,{onExit:Ue,load:go,unload:Bo}=Bu(H(Fe)?new le(Fe):new ae);var Ye=h__namespace.default.stderr.isTTY?h__namespace.default.stderr:h__namespace.default.stdout.isTTY?h__namespace.default.stdout:void 0,_u=Ye?He(()=>{Ue(()=>{Ye.write("\x1B[?25h");},{alwaysLast:!0});}):()=>{},qe=_u;var q=!1,v={};v.show=(e=h__namespace.default.stderr)=>{e.isTTY&&(q=!1,e.write("\x1B[?25h"));};v.hide=(e=h__namespace.default.stderr)=>{e.isTTY&&(qe(),q=!0,e.write("\x1B[?25l"));};v.toggle=(e,t)=>{e!==void 0&&(q=e),q?v.show(t):v.hide(t);};var ce=v;var M=Pe(me());function de(){return h__namespace.default.platform!=="win32"?h__namespace.default.env.TERM!=="linux":!!h__namespace.default.env.CI||!!h__namespace.default.env.WT_SESSION||!!h__namespace.default.env.TERMINUS_SUBLIME||h__namespace.default.env.ConEmuTask==="{cmd::Cmder}"||h__namespace.default.env.TERM_PROGRAM==="Terminus-Sublime"||h__namespace.default.env.TERM_PROGRAM==="vscode"||h__namespace.default.env.TERM==="xterm-256color"||h__namespace.default.env.TERM==="alacritty"||h__namespace.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var xu={info:C.blue("\u2139"),success:C.green("\u2714"),warning:C.yellow("\u26A0"),error:C.red("\u2716")},bu={info:C.blue("i"),success:C.green("\u221A"),warning:C.yellow("\u203C"),error:C.red("\xD7")},Au=de()?xu:bu,R=Au;function fe({onlyFirst:e=!1}={}){let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(u,e?void 0:"g")}var wu=fe();function j(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(wu,"")}function Ze(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function Xe(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Qe(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function Nu(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function et(e,{ambiguousAsWide:t=!1}={}){return Nu(e),Xe(e)||Qe(e)||t&&Ze(e)?2:1}var tt=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;var vu=new Intl.Segmenter,Pu=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function pe(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:u=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=j(e)),e.length===0)return 0;let o=0,s={ambiguousAsWide:!u};for(let{segment:i}of vu.segment(e)){let n=i.codePointAt(0);if(!(n<=31||n>=127&&n<=159)&&!(n>=8203&&n<=8207||n===65279)&&!(n>=768&&n<=879||n>=6832&&n<=6911||n>=7616&&n<=7679||n>=8400&&n<=8447||n>=65056&&n<=65071)&&!(n>=55296&&n<=57343)&&!(n>=65024&&n<=65039)&&!Pu.test(i)){if(tt().test(i)){o+=2;continue}o+=et(n,s);}}return o}function Ce({stream:e=process.stdout}={}){return !!(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}function he(){let{env:e}=h__namespace.default,{TERM:t,TERM_PROGRAM:u}=e;return h__namespace.default.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||u==="Terminus-Sublime"||u==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Su=3,Ee=class{#i=0;start(){this.#i++,this.#i===1&&this.#u();}stop(){if(this.#i<=0)throw new Error("`stop` called more times than `start`");this.#i--,this.#i===0&&this.#e();}#u(){h__namespace.default.platform==="win32"||!h__namespace.default.stdin.isTTY||(h__namespace.default.stdin.setRawMode(!0),h__namespace.default.stdin.on("data",this.#o),h__namespace.default.stdin.resume());}#e(){h__namespace.default.stdin.isTTY&&(h__namespace.default.stdin.off("data",this.#o),h__namespace.default.stdin.pause(),h__namespace.default.stdin.setRawMode(!1));}#o(t){t[0]===Su&&h__namespace.default.emit("SIGINT");}},Tu=new Ee,ge=Tu;Pe(me());var Be=class{#i=0;#u=!1;#e=0;#o=-1;#c=0;#t;#s;#r;#m;#f;#a;#l;#F;#p;#n;#D;color;constructor(t){typeof t=="string"&&(t={text:t}),this.#t={color:"cyan",stream:h__namespace.default.stderr,discardStdin:!0,hideCursor:!0,...t},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#f=this.#t.interval,this.#r=this.#t.stream,this.#a=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:Ce({stream:this.#r}),this.#l=typeof this.#t.isSilent=="boolean"?this.#t.isSilent:!1,this.text=this.#t.text,this.prefixText=this.#t.prefixText,this.suffixText=this.#t.suffixText,this.indent=this.#t.indent,h__namespace.default.env.NODE_ENV==="test"&&(this._stream=this.#r,this._isEnabled=this.#a,Object.defineProperty(this,"_linesToClear",{get(){return this.#i},set(u){this.#i=u;}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#o}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}));}get indent(){return this.#F}set indent(t=0){if(!(t>=0&&Number.isInteger(t)))throw new Error("The `indent` option must be an integer from 0 and up");this.#F=t,this.#d();}get interval(){return this.#f??this.#s.interval??100}get spinner(){return this.#s}set spinner(t){if(this.#o=-1,this.#f=void 0,typeof t=="object"){if(t.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#s=t;}else if(!he())this.#s=M.default.line;else if(t===void 0)this.#s=M.default.dots;else if(t!=="default"&&M.default[t])this.#s=M.default[t];else throw new Error(`There is no built-in spinner named '${t}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#p}set text(t=""){this.#p=t,this.#d();}get prefixText(){return this.#n}set prefixText(t=""){this.#n=t,this.#d();}get suffixText(){return this.#D}set suffixText(t=""){this.#D=t,this.#d();}get isSpinning(){return this.#m!==void 0}#C(t=this.#n,u=" "){return typeof t=="string"&&t!==""?t+u:typeof t=="function"?t()+u:""}#h(t=this.#D,u=" "){return typeof t=="string"&&t!==""?u+t:typeof t=="function"?u+t():""}#d(){let t=this.#r.columns??80,u=this.#C(this.#n,"-"),r=this.#h(this.#D,"-"),o=" ".repeat(this.#F)+u+"--"+this.#p+"--"+r;this.#e=0;for(let s of j(o).split(`
8
8
  `))this.#e+=Math.max(1,Math.ceil(pe(s,{countAnsiEscapeCodes:!0})/t));}get isEnabled(){return this.#a&&!this.#l}set isEnabled(t){if(typeof t!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#a=t;}get isSilent(){return this.#l}set isSilent(t){if(typeof t!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#l=t;}frame(){let t=Date.now();(this.#o===-1||t-this.#c>=this.interval)&&(this.#o=++this.#o%this.#s.frames.length,this.#c=t);let{frames:u}=this.#s,r=u[this.#o];this.color&&(r=C[this.color](r));let o=typeof this.#n=="string"&&this.#n!==""?this.#n+" ":"",s=typeof this.text=="string"?" "+this.text:"",i=typeof this.#D=="string"&&this.#D!==""?" "+this.#D:"";return o+r+s+i}clear(){if(!this.#a||!this.#r.isTTY)return this;this.#r.cursorTo(0);for(let t=0;t<this.#i;t++)t>0&&this.#r.moveCursor(0,-1),this.#r.clearLine(1);return (this.#F||this.lastIndent!==this.#F)&&this.#r.cursorTo(this.#F),this.lastIndent=this.#F,this.#i=0,this}render(){return this.#l?this:(this.clear(),this.#r.write(this.frame()),this.#i=this.#e,this)}start(t){return t&&(this.text=t),this.#l?this:this.#a?this.isSpinning?this:(this.#t.hideCursor&&ce.hide(this.#r),this.#t.discardStdin&&h__namespace.default.stdin.isTTY&&(this.#u=!0,ge.start()),this.render(),this.#m=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#r.write(`- ${this.text}
9
9
  `),this)}stop(){return this.#a?(clearInterval(this.#m),this.#m=void 0,this.#o=0,this.clear(),this.#t.hideCursor&&ce.show(this.#r),this.#t.discardStdin&&h__namespace.default.stdin.isTTY&&this.#u&&(ge.stop(),this.#u=!1),this):this}succeed(t){return this.stopAndPersist({symbol:R.success,text:t})}fail(t){return this.stopAndPersist({symbol:R.error,text:t})}warn(t){return this.stopAndPersist({symbol:R.warning,text:t})}info(t){return this.stopAndPersist({symbol:R.info,text:t})}stopAndPersist(t={}){if(this.#l)return this;let u=t.prefixText??this.#n,r=this.#C(u," "),o=t.symbol??" ",s=t.text??this.text,n=typeof s=="string"?(o?" ":"")+s:"",l=t.suffixText??this.#D,m=this.#h(l," "),d=r+o+n+m+`
10
- `;return this.stop(),this.#r.write(d),this}};function _e(e){return new Be(e)}var rt={name:"@keload/node-red-dxp",version:"1.19.0",description:"",type:"module",scripts:{build:"tsup",watch:"tsup --watch",format:"pnpm biome format",lint:"pnpm biome lint","lint:check":"pnpm biome check",release:"pnpm release-it","release:test":"pnpm release-it --dry-run","docs:dev":"./build-docs.sh && vitepress dev docs","docs:build":"./build-docs.sh && vitepress build docs","docs:preview":"vitepress preview docs","test:unit":"vitest"},publishConfig:{access:"public"},bin:{"node-red-dxp":"./dist/cli/index.cjs"},exports:{".":{import:"./dist/index.js",require:"./dist/index.cjs"},"./editor":{import:"./dist/editor/index.js",require:"./dist/editor/index.cjs"},"./editor/dom-helper":{import:"./dist/editor/dom-helper/index.js",require:"./dist/editor/dom-helper/index.cjs"},"./builder":{import:"./dist/builder/index.js",require:"./dist/builder/index.cjs"},"./utils":{import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"},"./utils/controller":{import:"./dist/utils/controller.js",require:"./dist/utils/controller.cjs"},"./package.json":"./package.json"},keywords:[],author:"Cl\xE9ment BERARD <contact@berard.dev>",license:"MIT",repository:{type:"git",url:"https://github.com/clement-berard/node-red-dxp.git"},bugs:{url:"https://github.com/clement-berard/node-red-dxp/issues"},homepage:"https://github.com/clement-berard/node-red-dxp",devDependencies:{"@biomejs/biome":"1.9.4","@release-it/conventional-changelog":"10.0.0","release-it":"18.1.1",tsup:"8.3.5",tsx:"4.19.2",typedoc:"0.27.6","typedoc-plugin-markdown":"4.4.1",typescript:"5.7.3",vitepress:"1.5.0","vitepress-plugin-npm-commands":"^0.6.0","vitepress-plugin-tabs":"^0.5.0",vitest:"2.1.8"},dependencies:{"@fullhuman/postcss-purgecss":"7.0.2","@types/html-minifier-terser":"7.0.2","@types/jquery":"3.5.32","@types/jqueryui":"1.12.23","@types/node-red":"1.3.5","@types/prettyjson":"0.0.33",autoprefixer:"10.4.20","browser-sync":"3.0.3",chokidar:"4.0.3",commander:"13.0.0",consola:"3.3.3",cosmiconfig:"9.0.0",cssnano:"7.0.6",esbuild:"0.24.2","fast-glob":"3.3.3",handlebars:"4.7.8","html-minifier-terser":"7.2.0","mdx-to-md":"0.3.2","merge-anything":"6.0.2",nodemon:"3.1.9",ora:"8.1.1",postcss:"8.4.49",prettyjson:"1.2.5",pug:"3.0.3",radash:"12.1.0",sass:"1.83.1",tailwindcss:"3.4.17"},files:["dist"]};function K(e){return Object.prototype.toString.call(e).slice(8,-1)}function P(e){if(K(e)!=="Object")return !1;let t=Object.getPrototypeOf(e);return !!t&&t.constructor===Object&&t===Object.prototype}function z(e){return K(e)==="Symbol"}function ot(e,t,u,r){let o={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";o==="enumerable"&&(e[t]=u),o==="nonenumerable"&&Object.defineProperty(e,t,{value:u,enumerable:!1,writable:!0,configurable:!0});}function st(e,t,u){if(!P(t))return t;let r={};if(P(e)){let n=Object.getOwnPropertyNames(e),l=Object.getOwnPropertySymbols(e);r=[...n,...l].reduce((m,d)=>{let y=e[d];return (!z(d)&&!Object.getOwnPropertyNames(t).includes(d)||z(d)&&!Object.getOwnPropertySymbols(t).includes(d))&&ot(m,d,y,e),m},{});}let o=Object.getOwnPropertyNames(t),s=Object.getOwnPropertySymbols(t);return [...o,...s].reduce((n,l)=>{let m=t[l],d=P(e)?e[l]:void 0;d!==void 0&&P(m)&&(m=st(d,m));let y=m;return ot(n,l,y,t),n},r)}function Z(e,...t){return t.reduce((u,r)=>st(u,r),e)}var it={builder:{outputDir:"dist",esbuildControllerOptions:{includeInBundle:[]},tailwind:{forcedClassesInclusion:[]},editor:{webComponents:{formRow:!1}}},watcher:{nodeRed:{enabled:!0,path:"~/.node-red",url:"http://localhost:1880"}}};var a={libCacheDir:".node-red-dxp",srcDir:"src",nodesDirName:"nodes",localesDirName:"locales",globalStylesName:"styles",nodes:{controllerName:"controller",editor:{dirName:"editor",htmlName:"index",stylesName:"styles",tsName:"index"}}};var Lu="node-red-dxp",Gu=e=>e.replace("@","").replace("/","-");function Wu(){let e=cosmiconfig.cosmiconfigSync(Lu);try{let t=e.search();return Z(it,t?t.config:{})}catch(t){throw console.error("Error while loading configuration",t),t}}var nt=Wu(),B=process.cwd(),Dt=JSON.parse(lt.readFileSync(`${B}/package.json`,"utf-8")),k=`${B}/${a.srcDir}`,Hu=`${B}/resources`,Uu=`${B}/resources`,ye=`${k}/${a.nodesDirName}`,xe=`${B}/${a.libCacheDir}`,Yu=`${Ft__namespace.default.resolve(__dirname,"..")}`,at=Gu(Dt.name);function qu(e=[]){return e.map(t=>{let u=t.path,r=`${u}/${a.nodes.editor.dirName}`,o=u.replace(B,"").slice(1),s=`${o}/${a.nodes.editor.dirName}`,i=fastGlob.globSync(`${r}/${a.nodes.editor.stylesName}.scss`),n=fastGlob.globSync(`${u}/docs.mdx`),l=fastGlob.globSync(`${u}/docs.md`),m=radash.dash(t.name);return {fullEditorPath:r,fullPath:u,name:t.name,pascalName:radash.pascal(t.name),dashName:m,relativeEditorPath:s,relativePath:o,nodeIdentifier:`${at}-${m}`,fullControllerPath:`${u}/${a.nodes.controllerName}.ts`,editor:{tsPath:`${r}/${a.nodes.editor.tsName}.ts`,htmlPath:`${r}/${a.nodes.editor.htmlName}.html`,pugPath:`${r}/${a.nodes.editor.htmlName}.pug`,scssFiles:i},doc:{mdxFiles:n,mdFiles:l}}})}function Ju(){let e=fastGlob.globSync(`${ye}/**/*`,{onlyDirectories:!0,deep:1,objectMode:!0}),t=qu(e),u=t.map(r=>r.name);return {currentDir:B,pathSrcDir:k,pathSrcNodesDir:ye,pathResourcesDir:Hu,additionalResourcesDir:Uu,pathDist:`${B}/${nt.builder.outputDir}`,currentPackagedDistPath:Yu,cacheDirFiles:{controllerIndex:`${xe}/controller-index.ts`,editorIndex:`${xe}/editor-index.ts`},pathLibCacheDir:xe,packageName:Dt.name,packageNameSlug:at,config:nt,resolvedSrcPathsScss:fastGlob.globSync(`${k}/${a.globalStylesName}.scss`,{ignore:[`${ye}/**/*.scss`]}),resolvedNodesPaths:e.map(r=>r.path),resolvedSrcLocalesPaths:fastGlob.globSync(`${k}/${a.localesDirName}/*.json`),redServerPath:fastGlob.globSync(`${k}/red-server.ts`),listNodesFull:t,listNodesFullNames:u}}var D=Ju();var ct=`${Ft__namespace.default.resolve(__dirname,"..")}`;function A(e){lt__default.default.existsSync(e)||lt__default.default.mkdirSync(e,{recursive:!0});}async function E(e,t){try{await be__default.default.writeFile(e,t);}catch(u){console.error("Error writing controller index:",u);}}async function mt(e){for(let t of e)try{let u=Ft__namespace.default.resolve(t),r=await be__default.default.stat(u).catch(()=>null);r!=null&&r.isDirectory()&&await be__default.default.rm(u,{recursive:!0,force:!0});}catch(u){console.error(`Error cleaning path (${t}): ${u}`);}}var dt={name:"add-credentials-export",setup(e){e.onLoad({filter:/controller\.ts$/},async t=>{let u=await be__default.default.readFile(t.path,"utf8");return /export\s+const\s+credentials\s*=/.test(u)?{contents:u,loader:"ts"}:{contents:`${u}
10
+ `;return this.stop(),this.#r.write(d),this}};function _e(e){return new Be(e)}var rt={name:"@keload/node-red-dxp",version:"1.21.0",description:"",type:"module",scripts:{build:"tsup",watch:"tsup --watch",format:"pnpm biome format",lint:"pnpm biome lint","lint:check":"pnpm biome check",release:"pnpm release-it","release:test":"pnpm release-it --dry-run","docs:dev":"./build-docs.sh && vitepress dev docs","docs:build":"./build-docs.sh && vitepress build docs","docs:preview":"vitepress preview docs","test:unit":"vitest"},publishConfig:{access:"public"},bin:{"node-red-dxp":"./dist/cli/index.cjs"},exports:{".":{import:"./dist/index.js",require:"./dist/index.cjs"},"./editor":{import:"./dist/editor/index.js",require:"./dist/editor/index.cjs"},"./editor/dom-helper":{import:"./dist/editor/dom-helper/index.js",require:"./dist/editor/dom-helper/index.cjs"},"./builder":{import:"./dist/builder/index.js",require:"./dist/builder/index.cjs"},"./utils":{import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"},"./utils/controller":{import:"./dist/utils/controller.js",require:"./dist/utils/controller.cjs"},"./package.json":"./package.json"},keywords:[],author:"Cl\xE9ment BERARD <contact@berard.dev>",license:"MIT",repository:{type:"git",url:"https://github.com/clement-berard/node-red-dxp.git"},bugs:{url:"https://github.com/clement-berard/node-red-dxp/issues"},homepage:"https://github.com/clement-berard/node-red-dxp",devDependencies:{"@biomejs/biome":"1.9.4","@release-it/conventional-changelog":"10.0.0","release-it":"18.1.1",tsup:"8.3.5",tsx:"4.19.2",typedoc:"0.27.6","typedoc-plugin-markdown":"4.4.1",typescript:"5.7.3",vitepress:"1.5.0","vitepress-plugin-npm-commands":"^0.6.0","vitepress-plugin-tabs":"^0.5.0",vitest:"2.1.8"},dependencies:{"@fullhuman/postcss-purgecss":"7.0.2","@types/html-minifier-terser":"7.0.2","@types/jquery":"3.5.32","@types/jqueryui":"1.12.23","@types/node-red":"1.3.5","@types/prettyjson":"0.0.33",autoprefixer:"10.4.20","browser-sync":"3.0.3",chokidar:"4.0.3",commander:"13.1.0",consola:"3.3.3",cosmiconfig:"9.0.0",cssnano:"7.0.6",esbuild:"0.24.2","fast-glob":"3.3.3",handlebars:"4.7.8","html-minifier-terser":"7.2.0","mdx-to-md":"0.3.2","merge-anything":"6.0.2",nodemon:"3.1.9",ora:"8.1.1",postcss:"8.5.1",prettyjson:"1.2.5",pug:"3.0.3",radash:"12.1.0",sass:"1.83.1",tailwindcss:"3.4.17"},files:["dist"]};function K(e){return Object.prototype.toString.call(e).slice(8,-1)}function P(e){if(K(e)!=="Object")return !1;let t=Object.getPrototypeOf(e);return !!t&&t.constructor===Object&&t===Object.prototype}function z(e){return K(e)==="Symbol"}function ot(e,t,u,r){let o={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";o==="enumerable"&&(e[t]=u),o==="nonenumerable"&&Object.defineProperty(e,t,{value:u,enumerable:!1,writable:!0,configurable:!0});}function st(e,t,u){if(!P(t))return t;let r={};if(P(e)){let n=Object.getOwnPropertyNames(e),l=Object.getOwnPropertySymbols(e);r=[...n,...l].reduce((m,d)=>{let y=e[d];return (!z(d)&&!Object.getOwnPropertyNames(t).includes(d)||z(d)&&!Object.getOwnPropertySymbols(t).includes(d))&&ot(m,d,y,e),m},{});}let o=Object.getOwnPropertyNames(t),s=Object.getOwnPropertySymbols(t);return [...o,...s].reduce((n,l)=>{let m=t[l],d=P(e)?e[l]:void 0;d!==void 0&&P(m)&&(m=st(d,m));let y=m;return ot(n,l,y,t),n},r)}function Z(e,...t){return t.reduce((u,r)=>st(u,r),e)}var it={builder:{outputDir:"dist",esbuildControllerOptions:{includeInBundle:[]},tailwind:{forcedClassesInclusion:[]},editor:{webComponents:{formRow:!1}}},watcher:{nodeRed:{enabled:!0,path:"~/.node-red",url:"http://localhost:1880"}}};var a={libCacheDir:".node-red-dxp",srcDir:"src",nodesDirName:"nodes",localesDirName:"locales",globalStylesName:"styles",nodes:{controllerName:"controller",editor:{dirName:"editor",htmlName:"index",stylesName:"styles",tsName:"index"}}};var Lu="node-red-dxp",Gu=e=>e.replace("@","").replace("/","-");function Wu(){let e=cosmiconfig.cosmiconfigSync(Lu);try{let t=e.search();return Z(it,t?t.config:{})}catch(t){throw console.error("Error while loading configuration",t),t}}var nt=Wu(),B=process.cwd(),Dt=JSON.parse(lt.readFileSync(`${B}/package.json`,"utf-8")),k=`${B}/${a.srcDir}`,Hu=`${B}/resources`,Uu=`${B}/resources`,ye=`${k}/${a.nodesDirName}`,xe=`${B}/${a.libCacheDir}`,Yu=`${Ft__namespace.default.resolve(__dirname,"..")}`,at=Gu(Dt.name);function qu(e=[]){return e.map(t=>{let u=t.path,r=`${u}/${a.nodes.editor.dirName}`,o=u.replace(B,"").slice(1),s=`${o}/${a.nodes.editor.dirName}`,i=fastGlob.globSync(`${r}/${a.nodes.editor.stylesName}.scss`),n=fastGlob.globSync(`${u}/docs.mdx`),l=fastGlob.globSync(`${u}/docs.md`),m=radash.dash(t.name);return {fullEditorPath:r,fullPath:u,name:t.name,pascalName:radash.pascal(t.name),dashName:m,relativeEditorPath:s,relativePath:o,nodeIdentifier:`${at}-${m}`,fullControllerPath:`${u}/${a.nodes.controllerName}.ts`,editor:{tsPath:`${r}/${a.nodes.editor.tsName}.ts`,htmlPath:`${r}/${a.nodes.editor.htmlName}.html`,pugPath:`${r}/${a.nodes.editor.htmlName}.pug`,scssFiles:i},doc:{mdxFiles:n,mdFiles:l}}})}function Ju(){let e=fastGlob.globSync(`${ye}/**/*`,{onlyDirectories:!0,deep:1,objectMode:!0}),t=qu(e),u=t.map(r=>r.name);return {currentDir:B,pathSrcDir:k,pathSrcNodesDir:ye,pathResourcesDir:Hu,additionalResourcesDir:Uu,pathDist:`${B}/${nt.builder.outputDir}`,currentPackagedDistPath:Yu,cacheDirFiles:{controllerIndex:`${xe}/controller-index.ts`,editorIndex:`${xe}/editor-index.ts`},pathLibCacheDir:xe,packageName:Dt.name,packageNameSlug:at,config:nt,resolvedSrcPathsScss:fastGlob.globSync(`${k}/${a.globalStylesName}.scss`,{ignore:[`${ye}/**/*.scss`]}),resolvedNodesPaths:e.map(r=>r.path),resolvedSrcLocalesPaths:fastGlob.globSync(`${k}/${a.localesDirName}/*.json`),redServerPath:fastGlob.globSync(`${k}/red-server.ts`),listNodesFull:t,listNodesFullNames:u}}var D=Ju();var ct=`${Ft__namespace.default.resolve(__dirname,"..")}`;function A(e){lt__default.default.existsSync(e)||lt__default.default.mkdirSync(e,{recursive:!0});}async function E(e,t){try{await be__default.default.writeFile(e,t);}catch(u){console.error("Error writing controller index:",u);}}async function mt(e){for(let t of e)try{let u=Ft__namespace.default.resolve(t),r=await be__default.default.stat(u).catch(()=>null);r!=null&&r.isDirectory()&&await be__default.default.rm(u,{recursive:!0,force:!0});}catch(u){console.error(`Error cleaning path (${t}): ${u}`);}}var dt={name:"add-credentials-export",setup(e){e.onLoad({filter:/controller\.ts$/},async t=>{let u=await be__default.default.readFile(t.path,"utf8");return /export\s+const\s+credentials\s*=/.test(u)?{contents:u,loader:"ts"}:{contents:`${u}
11
11
  export const credentials = {};`,loader:"ts"}});}};var Zu=`${D.currentDir}/package.json`,X=class{params;constructor(t){this.params={minify:!1,...t};}async getControllerIndexContent(){return `
12
12
  import type { NodeAPI } from 'node-red';
13
13
  ${D.listNodesFull.map(t=>`// @ts-ignore
@@ -1,42 +1,93 @@
1
- mixin dxpFormRowInputText(id, label, icon='', placeholder='')
1
+ mixin dxpFormRowInputText(id, label, icon='', placeholder='', isConfig=false)
2
+ - var prefix = isConfig ? 'node-config-input-' : 'node-input-'
2
3
  .dxp-template-form-row
3
- label(for=`node-input-${id}`)
4
+ label(for=`${prefix}${id}`)
4
5
  if icon
5
6
  i.fa(class=`fa-${icon}`)
6
7
  span(data-i18n=label)= label.charAt(0).toUpperCase() + label.slice(1)
7
8
  .content
8
9
  input(
9
10
  type="text"
10
- id=`node-input-${id}`
11
+ id=`${prefix}${id}`
11
12
  data-i18n=`[placeholder]${label}`
12
13
  placeholder=placeholder
13
14
  )&attributes(attributes)
14
15
  if block
15
16
  block
16
17
 
17
- mixin dxpFormRowSelect(id, label, icon='')
18
+ mixin dxpFormRowInputTextTyped(id, label, icon='', placeholder='', isConfig=false)
19
+ - var prefix = isConfig ? 'node-config-input-' : 'node-input-'
18
20
  .dxp-template-form-row
19
- label(for=`node-input-${id}`)
21
+ label(for=`${prefix}${id}`)
20
22
  if icon
21
23
  i.fa(class=`fa-${icon}`)
22
24
  span(data-i18n=label)= label.charAt(0).toUpperCase() + label.slice(1)
23
25
  .content
24
- select(
25
- id=`node-input-${id}`
26
+ input(
27
+ type="text"
28
+ id=`${prefix}${id}`
29
+ data-i18n=`[placeholder]${label}`
30
+ placeholder=placeholder
26
31
  )&attributes(attributes)
32
+ input(type="hidden" id=`${prefix}${id}Type`)
33
+ if block
34
+ block
35
+
36
+ mixin dxpFormRowSelect(id, label, icon='', isConfig=false)
37
+ - var prefix = isConfig ? 'node-config-input-' : 'node-input-'
38
+ .dxp-template-form-row
39
+ label(for=`${prefix}${id}`)
40
+ if icon
41
+ i.fa(class=`fa-${icon}`)
42
+ span(data-i18n=label)= label.charAt(0).toUpperCase() + label.slice(1)
43
+ .content
44
+ select(id=`${prefix}${id}`)&attributes(attributes)
27
45
  if block
28
46
  block
29
47
 
30
- mixin dxpFormRowCheckbox(id, label, icon='', checkboxText='')
48
+ mixin dxpFormRowSelectConfigNode(id, label, icon='', isConfig=false)
49
+ - var prefix = isConfig ? 'node-config-input-' : 'node-input-'
31
50
  .dxp-template-form-row
32
- label(for=`node-input-${id}`)
51
+ label(for=`${prefix}${id}`)
52
+ if icon
53
+ i.fa(class=`fa-${icon}`)
54
+ span(data-i18n=label)= label.charAt(0).toUpperCase() + label.slice(1)
55
+ .content.force-w-full
56
+ select(id=`${prefix}${id}`)&attributes(attributes)
57
+ if block
58
+ block
59
+
60
+ mixin dxpFormRowCheckbox(id, label, icon='', checkboxText='', isConfig=false)
61
+ - var prefix = isConfig ? 'node-config-input-' : 'node-input-'
62
+ .dxp-template-form-row
63
+ label(for=`${prefix}${id}`)
33
64
  if icon
34
65
  i.fa(class=`fa-${icon}`)
35
66
  span(data-i18n=label)= label.charAt(0).toUpperCase() + label.slice(1)
36
67
  .content
37
68
  .checkbox
38
- input(type="checkbox" id=`node-input-${id}`)&attributes(attributes)
69
+ input(type="checkbox" id=`${prefix}${id}`)&attributes(attributes)
39
70
  if checkboxText
40
71
  span.italic= checkboxText
41
72
  if block
42
73
  block
74
+
75
+ mixin dxpTabs(targetId)
76
+ div
77
+ ul(id=targetId)
78
+ div(id=`tabs-content-${targetId}`, class='mt-4')
79
+ if block
80
+ block
81
+
82
+ mixin dxpHint(state, icon)
83
+ - var classState = state ? 'hint-' + state : ''
84
+ .hint(class=classState + 'max-w-[350px]')
85
+ if icon
86
+ i(class='mr-1 fa fa-' + icon)
87
+ if block
88
+ block
89
+
90
+ mixin dxpFormTitleSeparator(label="")
91
+ div.flex.items-center.gap-4.mb-2
92
+ span.text-md.font-semibold= label
93
+ div.flex-1.border-t.border-gray-300
@@ -71,6 +71,13 @@
71
71
  @apply !ml-[5px];
72
72
  }
73
73
  }
74
+
75
+ .red-ui-typedInput-option-trigger {
76
+ .red-ui-typedInput-option-label {
77
+ background-color: transparent !important;
78
+ @apply !mt-2;
79
+ }
80
+ }
74
81
  }
75
82
 
76
83
  div.checkbox {
@@ -79,6 +86,13 @@
79
86
  @apply !w-auto;
80
87
  }
81
88
  }
89
+
90
+
91
+ &.force-w-full {
92
+ > div {
93
+ @apply !w-full;
94
+ }
95
+ }
82
96
  }
83
97
 
84
98
  .hint {
@@ -1 +1 @@
1
- 'use strict';function l(e){let t=e.startsWith("$"),n=e.startsWith("$$"),o=e.startsWith("#node-config-input")||e.startsWith("#node-input");return {isNodeIdShortcut:t,isNodeConfigIdShortcut:n,isFullSelector:o,value:t||n||o}}function c(e){let t=l(e);return t.isNodeConfigIdShortcut?`#node-config-input-${e.replace("$$","")}`:t.isNodeIdShortcut?`#node-input-${e.replace("$","")}`:e}function s(e,t,n){t.forEach(o=>{let r=document.querySelector(o);r&&n.forEach(i=>r.classList[e](i));});}function u(e,t){s("remove",e,t);}function d(e,t){s("add",e,t);}function a(e){return c(e).split("-input-")[1]}function p(e,t,n){let o=c(e),r=t;n!=null&&n.emptyValue&&(r=[{value:"",text:n.emptyValue},...t]),$(o).empty().append(r.map(i=>$("<option>",{value:i.value,text:i.text,selected:i.value===(n==null?void 0:n.selected)})));}function g(e,t){let o=(Array.isArray(e)?e:[e]).map(c).join(", ");$(o).on("input",()=>{let r=$(o).map(function(){return $(this).val()}).get();t(r);});}function f(e,t){let n=c(e);$(n).val(t);}function h(e,t){let n=c(e);$(n).text(t);}function S(e){let t=c(e);return $(t)}function x(e){let t=c(e);return document.querySelector(t).checked}function m(e){let t={};return document.querySelectorAll(`[id^="node-input-${e}-"]`).forEach(n=>{let o=n,r=o.id.replace(`node-input-${e}-`,"");o.type==="checkbox"?t[r]=o.checked:t[r]=o.value;}),t}function v(e,t){t&&Object.entries(t).forEach(([n,o])=>{let r=document.querySelector(`#node-input-${e}-${n}`);r&&(r.type==="checkbox"?r.checked=!!o:r.value=String(o));});}exports.addClassesOnSelectors=d;exports.getFormValues=m;exports.handleAddRemoveClassesOnSelectors=s;exports.initSelect=p;exports.isCheckboxChecked=x;exports.isNodeInput=l;exports.jqSelector=S;exports.removeClassesOnSelectors=u;exports.resolveInputKey=a;exports.resolveSelector=c;exports.setFormValues=v;exports.setInputValue=f;exports.setText=h;exports.watchInput=g;
1
+ 'use strict';var a=e=>{if(!e||e.length===0)return "";let t=e.toLowerCase();return t.substring(0,1).toUpperCase()+t.substring(1,t.length)};var c=(e,t)=>{var o;let r=(o=e==null?void 0:e.replace(/([A-Z])+/g,a).split(/(?=[A-Z])|[\.\-\s_]/).map(i=>i.toLowerCase()))!=null?o:[];if(r.length===0)return "";if(r.length===1)return r[0];let n=r.reduce((i,u)=>`${i}_${u.toLowerCase()}`);return (t==null?void 0:t.splitOnNumber)===!1?n:n.replace(/([A-Za-z]{1}[0-9]{1})/,i=>`${i[0]}_${i[1]}`)};function p(e){let t=e.startsWith("$"),r=e.startsWith("$$"),n=e.startsWith("#node-config-input")||e.startsWith("#node-input");return {isNodeIdShortcut:t,isNodeConfigIdShortcut:r,isFullSelector:n,value:t||r||n}}function s(e){let t=p(e);return t.isNodeConfigIdShortcut?`#node-config-input-${e.replace("$$","")}`:t.isNodeIdShortcut?`#node-input-${e.replace("$","")}`:e}function l(e,t,r){t.forEach(n=>{let o=document.querySelector(n);o&&r.forEach(i=>o.classList[e](i));});}function C(e,t){l("remove",e,t);}function A(e,t){l("add",e,t);}function I(e){return s(e).split("-input-")[1]}function E(e,t,r){let n=s(e),o=t;r!=null&&r.emptyValue&&(o=[{value:"",text:r.emptyValue},...t]),$(n).empty().append(o.map(i=>$("<option>",{value:i.value,text:i.text,selected:i.value===(r==null?void 0:r.selected)})));}function T(e,t){let n=(Array.isArray(e)?e:[e]).map(s).join(", ");$(n).on("input",()=>{let o=$(n).map(function(){return $(this).val()}).get();t(o);});}function k(e,t){let r=s(e);$(r).val(t);}function L(e,t){let r=s(e);$(r).text(t);}function w(e){let t=s(e);return $(t)}function O(e){let t=s(e);return document.querySelector(t).checked}function j(e){let t={};return document.querySelectorAll(`[id^="node-input-${e}-"]`).forEach(r=>{let n=r,o=n.id.replace(`node-input-${e}-`,"");n.type==="checkbox"?t[o]=n.checked:t[o]=n.value;}),t}function H(e,t){t&&Object.entries(t).forEach(([r,n])=>{let o=document.querySelector(`#node-input-${e}-${r}`);o&&(o.type==="checkbox"?o.checked=!!n:o.value=String(n));});}function R(e){let t=`#tabs-content-${e.targetId}`,r=RED.tabs.create({id:e.targetId,onchange:n=>{$(t).children().addClass("hidden"),$(`#${n.id}`).removeClass("hidden");}});(e.tabsLabel||[]).forEach(n=>{r.addTab({id:`tab-${c(n)}`,label:n});}),r.activateTab(`tab-${c(e.initialTab)}`);}exports.addClassesOnSelectors=A;exports.getFormValues=j;exports.handleAddRemoveClassesOnSelectors=l;exports.initSelect=E;exports.initTabs=R;exports.isCheckboxChecked=O;exports.isNodeInput=p;exports.jqSelector=w;exports.removeClassesOnSelectors=C;exports.resolveInputKey=I;exports.resolveSelector=s;exports.setFormValues=H;exports.setInputValue=k;exports.setText=L;exports.watchInput=T;
@@ -1,4 +1,5 @@
1
1
  import { E as EditorDomHelper } from '../../types-B7YUmbnu.cjs';
2
+ import '../../index.cjs';
2
3
  import 'node-red';
3
4
 
4
5
  /**
@@ -229,5 +230,45 @@ declare function getFormValues(prefix: string): Record<string, string | boolean>
229
230
  * ```
230
231
  */
231
232
  declare function setFormValues(prefix: string, values: Record<string, unknown | boolean>): void;
233
+ type InitTabsParams = {
234
+ targetId: any;
235
+ tabsLabel: string[];
236
+ initialTab: string;
237
+ };
238
+ /**
239
+ * Initializes a tab system with the provided configuration and handles tab switching behavior.
240
+ * This function creates a set of tabs and associates them with a specified container. It also sets
241
+ * an initial active tab and switches between tabs when a tab is clicked.
242
+ *
243
+ * @param {InitTabsParams} params - The configuration object to initialize the tabs.
244
+ * @param {any} params.targetId - The unique identifier for the tab container element. This ID will
245
+ * be used to create a content section that corresponds to the tabs.
246
+ * @param {string[]} params.tabsLabel - An array of labels for the tabs. Each label represents a tab.
247
+ * The labels are displayed as tab names in the UI.
248
+ * @param {string} params.initialTab - The label of the tab to be activated initially when the tabs
249
+ * are first rendered. This label must match one of the labels in
250
+ * the `tabsLabel` array.
251
+ *
252
+ * @example
253
+ * // Example usage of the initTabs function
254
+ * const tabsConfig = {
255
+ * targetId: 'myTabContainer',
256
+ * tabsLabel: ['Tab 1', 'Tab 2', 'Tab 3'],
257
+ * initialTab: 'Tab 2',
258
+ * };
259
+ * initTabs(tabsConfig);
260
+ *
261
+ * // In the above example:
262
+ * // - The tab container is identified by 'myTabContainer'.
263
+ * // - Three tabs are created with the labels "Tab 1", "Tab 2", and "Tab 3".
264
+ * // - The second tab ("Tab 2") is set as the initially active tab.
265
+ *
266
+ * @returns {void}
267
+ *
268
+ * @throws {Error} Throws an error if the `params.targetId` is missing or invalid.
269
+ * @throws {Error} Throws an error if the `params.tabsLabel` is empty or not provided.
270
+ * @throws {Error} Throws an error if the `params.initialTab` does not match any label in `tabsLabel`.
271
+ */
272
+ declare function initTabs(params: InitTabsParams): void;
232
273
 
233
- export { addClassesOnSelectors, getFormValues, handleAddRemoveClassesOnSelectors, initSelect, isCheckboxChecked, isNodeInput, jqSelector, removeClassesOnSelectors, resolveInputKey, resolveSelector, setFormValues, setInputValue, setText, watchInput };
274
+ export { addClassesOnSelectors, getFormValues, handleAddRemoveClassesOnSelectors, initSelect, initTabs, isCheckboxChecked, isNodeInput, jqSelector, removeClassesOnSelectors, resolveInputKey, resolveSelector, setFormValues, setInputValue, setText, watchInput };
@@ -1,4 +1,5 @@
1
1
  import { E as EditorDomHelper } from '../../types-B7YUmbnu.js';
2
+ import '../../index.js';
2
3
  import 'node-red';
3
4
 
4
5
  /**
@@ -229,5 +230,45 @@ declare function getFormValues(prefix: string): Record<string, string | boolean>
229
230
  * ```
230
231
  */
231
232
  declare function setFormValues(prefix: string, values: Record<string, unknown | boolean>): void;
233
+ type InitTabsParams = {
234
+ targetId: any;
235
+ tabsLabel: string[];
236
+ initialTab: string;
237
+ };
238
+ /**
239
+ * Initializes a tab system with the provided configuration and handles tab switching behavior.
240
+ * This function creates a set of tabs and associates them with a specified container. It also sets
241
+ * an initial active tab and switches between tabs when a tab is clicked.
242
+ *
243
+ * @param {InitTabsParams} params - The configuration object to initialize the tabs.
244
+ * @param {any} params.targetId - The unique identifier for the tab container element. This ID will
245
+ * be used to create a content section that corresponds to the tabs.
246
+ * @param {string[]} params.tabsLabel - An array of labels for the tabs. Each label represents a tab.
247
+ * The labels are displayed as tab names in the UI.
248
+ * @param {string} params.initialTab - The label of the tab to be activated initially when the tabs
249
+ * are first rendered. This label must match one of the labels in
250
+ * the `tabsLabel` array.
251
+ *
252
+ * @example
253
+ * // Example usage of the initTabs function
254
+ * const tabsConfig = {
255
+ * targetId: 'myTabContainer',
256
+ * tabsLabel: ['Tab 1', 'Tab 2', 'Tab 3'],
257
+ * initialTab: 'Tab 2',
258
+ * };
259
+ * initTabs(tabsConfig);
260
+ *
261
+ * // In the above example:
262
+ * // - The tab container is identified by 'myTabContainer'.
263
+ * // - Three tabs are created with the labels "Tab 1", "Tab 2", and "Tab 3".
264
+ * // - The second tab ("Tab 2") is set as the initially active tab.
265
+ *
266
+ * @returns {void}
267
+ *
268
+ * @throws {Error} Throws an error if the `params.targetId` is missing or invalid.
269
+ * @throws {Error} Throws an error if the `params.tabsLabel` is empty or not provided.
270
+ * @throws {Error} Throws an error if the `params.initialTab` does not match any label in `tabsLabel`.
271
+ */
272
+ declare function initTabs(params: InitTabsParams): void;
232
273
 
233
- export { addClassesOnSelectors, getFormValues, handleAddRemoveClassesOnSelectors, initSelect, isCheckboxChecked, isNodeInput, jqSelector, removeClassesOnSelectors, resolveInputKey, resolveSelector, setFormValues, setInputValue, setText, watchInput };
274
+ export { addClassesOnSelectors, getFormValues, handleAddRemoveClassesOnSelectors, initSelect, initTabs, isCheckboxChecked, isNodeInput, jqSelector, removeClassesOnSelectors, resolveInputKey, resolveSelector, setFormValues, setInputValue, setText, watchInput };
@@ -1 +1 @@
1
- import'../../chunk-O2XFH626.js';function l(e){let t=e.startsWith("$"),n=e.startsWith("$$"),o=e.startsWith("#node-config-input")||e.startsWith("#node-input");return {isNodeIdShortcut:t,isNodeConfigIdShortcut:n,isFullSelector:o,value:t||n||o}}function c(e){let t=l(e);return t.isNodeConfigIdShortcut?`#node-config-input-${e.replace("$$","")}`:t.isNodeIdShortcut?`#node-input-${e.replace("$","")}`:e}function s(e,t,n){t.forEach(o=>{let r=document.querySelector(o);r&&n.forEach(i=>r.classList[e](i));});}function u(e,t){s("remove",e,t);}function d(e,t){s("add",e,t);}function a(e){return c(e).split("-input-")[1]}function p(e,t,n){let o=c(e),r=t;n!=null&&n.emptyValue&&(r=[{value:"",text:n.emptyValue},...t]),$(o).empty().append(r.map(i=>$("<option>",{value:i.value,text:i.text,selected:i.value===(n==null?void 0:n.selected)})));}function g(e,t){let o=(Array.isArray(e)?e:[e]).map(c).join(", ");$(o).on("input",()=>{let r=$(o).map(function(){return $(this).val()}).get();t(r);});}function f(e,t){let n=c(e);$(n).val(t);}function h(e,t){let n=c(e);$(n).text(t);}function S(e){let t=c(e);return $(t)}function x(e){let t=c(e);return document.querySelector(t).checked}function m(e){let t={};return document.querySelectorAll(`[id^="node-input-${e}-"]`).forEach(n=>{let o=n,r=o.id.replace(`node-input-${e}-`,"");o.type==="checkbox"?t[r]=o.checked:t[r]=o.value;}),t}function v(e,t){t&&Object.entries(t).forEach(([n,o])=>{let r=document.querySelector(`#node-input-${e}-${n}`);r&&(r.type==="checkbox"?r.checked=!!o:r.value=String(o));});}export{d as addClassesOnSelectors,m as getFormValues,s as handleAddRemoveClassesOnSelectors,p as initSelect,x as isCheckboxChecked,l as isNodeInput,S as jqSelector,u as removeClassesOnSelectors,a as resolveInputKey,c as resolveSelector,v as setFormValues,f as setInputValue,h as setText,g as watchInput};
1
+ import'../../chunk-Z65JVQED.js';import {c}from'../../chunk-O55HBSM5.js';import'../../chunk-O2XFH626.js';function a(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 i(t){let e=a(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(s=>r.classList[t](s));});}function d(t,e){l("remove",t,e);}function g(t,e){l("add",t,e);}function p(t){return i(t).split("-input-")[1]}function f(t,e,n){let o=i(t),r=e;n!=null&&n.emptyValue&&(r=[{value:"",text:n.emptyValue},...e]),$(o).empty().append(r.map(s=>$("<option>",{value:s.value,text:s.text,selected:s.value===(n==null?void 0:n.selected)})));}function h(t,e){let o=(Array.isArray(t)?t:[t]).map(i).join(", ");$(o).on("input",()=>{let r=$(o).map(function(){return $(this).val()}).get();e(r);});}function b(t,e){let n=i(t);$(n).val(e);}function m(t,e){let n=i(t);$(n).text(e);}function x(t){let e=i(t);return $(e)}function S(t){let e=i(t);return document.querySelector(e).checked}function v(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 y(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 I(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{g as addClassesOnSelectors,v as getFormValues,l as handleAddRemoveClassesOnSelectors,f as initSelect,I as initTabs,S as isCheckboxChecked,a as isNodeInput,x as jqSelector,d as removeClassesOnSelectors,p as resolveInputKey,i as resolveSelector,y as setFormValues,b as setInputValue,m as setText,h as watchInput};
package/dist/index.js CHANGED
@@ -0,0 +1 @@
1
+ import'./chunk-Z65JVQED.js';
@@ -1 +1 @@
1
- 'use strict';function o(l,n){return typeof l!="boolean"?(console.warn("Payload must be a boolean (true or false)."),[null,null]):l?[n,null]:[null,n]}exports.splitBooleanOutputs=o;
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,3 +1,9 @@
1
+ import { NodeAPI, Node, NodeMessage } from 'node-red';
2
+
3
+ declare global {
4
+ var RED: NodeAPI;
5
+ }
6
+
1
7
  /**
2
8
  * Splits a message into two outputs based on a boolean condition.
3
9
  *
@@ -14,5 +20,131 @@
14
20
  * console.log(result); // Output: [{ payload: 'Hello, world!' }, null]
15
21
  */
16
22
  declare function splitBooleanOutputs(conditionTerm: boolean, msg: unknown): unknown[];
23
+ /**
24
+ * Retrieves a node by its ID from the RED.nodes collection. This function returns the node object,
25
+ * which includes any custom fields and credentials associated with it. If the node with the specified
26
+ * ID doesn't exist, the function returns `null`.
27
+ *
28
+ * @template TFields - A generic type that extends an object, representing the additional fields
29
+ * associated with the node. This allows the caller to extend the node with custom fields.
30
+ * @template TCreds - A generic type that extends an object, representing the credentials associated with the node.
31
+ * This allows the caller to extend the node with custom credentials.
32
+ *
33
+ * @param {string} idNode - The unique identifier of the node to be retrieved.
34
+ *
35
+ * @returns {(Node<TCreds> & TFields) | null} The node object with credentials and additional fields, or `null` if
36
+ * the node cannot be found.
37
+ *
38
+ * @example
39
+ * // Example usage of the getREDNode function
40
+ * const nodeId = 'node123';
41
+ * const node = getREDNode<{customField: string}, {apiKey: string}>(nodeId);
42
+ * if (node) {
43
+ * console.log(node.customField); // Accessing custom field
44
+ * console.log(node.apiKey); // Accessing node credentials
45
+ * } else {
46
+ * console.log('Node not found');
47
+ * }
48
+ *
49
+ * // In this example:
50
+ * // - We retrieve the node with ID 'node123'.
51
+ * // - The node is expected to have a custom field called 'customField' and credentials including 'apiKey'.
52
+ *
53
+ * @throws {Error} Throws an error if the `idNode` is invalid or if there are issues retrieving the node.
54
+ */
55
+ declare function getREDNode<TFields extends {} = Record<any, any>, TCreds extends {} = Record<any, any>>(idNode: string): (Node<TCreds> & TFields) | null;
56
+ type EvaluateNodePropertyParams = {
57
+ value: string;
58
+ type: string;
59
+ node: Node;
60
+ msg: NodeMessage;
61
+ };
62
+ /**
63
+ * Evaluates a node property in the Node-RED environment.
64
+ * This function wraps the `evaluateNodeProperty` utility from `RED.util` and returns a Promise.
65
+ * It resolves with a tuple containing an `Error` (if any) and the evaluation result.
66
+ *
67
+ * The evaluation is performed asynchronously, and the function never rejects.
68
+ * The result will always be a tuple where:
69
+ * - The first element is an `Error` if one occurs during the evaluation, or `undefined` if no error occurs.
70
+ * - The second element is the result of the property evaluation, or `undefined` if no result is produced.
71
+ *
72
+ * **Note**: This function is designed to be used in the context of Node-RED node development.
73
+ * It requires access to the `RED` object and the necessary node properties.
74
+ *
75
+ * @param {EvaluateNodePropertyParams} params - The parameters needed to evaluate the node property.
76
+ * @param {string} params.value - The string representing the value or property to evaluate.
77
+ * @param {string} params.type - The type of the value (e.g., "jsonata", "str").
78
+ * @param {Node} params.node - The Node-RED node performing the evaluation.
79
+ * @param {NodeMessage} params.msg - The message object to be passed into the evaluation.
80
+ *
81
+ * @returns {Promise<[Error | undefined, any | undefined]>} - A promise that resolves with a tuple containing:
82
+ * - The error (if any) or `undefined` if no error occurs.
83
+ * - The result of the evaluation or `undefined` if no result is produced.
84
+ *
85
+ * @example
86
+ * // Example usage of evaluateNodeProperty with async/await
87
+ * async function processNodeProperty() {
88
+ * const params: EvaluateNodePropertyParams = {
89
+ * value: "msg.payload",
90
+ * type: "jsonata",
91
+ * node: myNode, // assuming myNode is a valid Node object
92
+ * msg: myMsg, // assuming myMsg is a valid NodeMessage object
93
+ * };
94
+ *
95
+ * const [err, result] = await evaluateNodeProperty(params);
96
+ *
97
+ * if (err) {
98
+ * console.error("Error:", err);
99
+ * } else {
100
+ * console.log("Evaluation Result:", result);
101
+ * }
102
+ * }
103
+ *
104
+ * @example
105
+ * // Handling the result when using the promise directly
106
+ * evaluateNodeProperty({
107
+ * value: "msg.payload.someProperty",
108
+ * type: "str",
109
+ * node: myNode, // assuming myNode is a valid Node object
110
+ * msg: myMsg, // assuming myMsg is a valid NodeMessage object
111
+ * })
112
+ * .then(([err, result]) => {
113
+ * if (err) {
114
+ * console.error("Error:", err);
115
+ * } else {
116
+ * console.log("Result:", result);
117
+ * }
118
+ * });
119
+ */
120
+ declare function evaluateNodeProperty(params: EvaluateNodePropertyParams): Promise<[Error | undefined, any | undefined]>;
121
+ /**
122
+ * A hook-like function that provides utilities for evaluating Node-RED properties
123
+ * within a custom node. It includes property evaluation with default values and
124
+ * quick property evaluation with type enforcement.
125
+ *
126
+ * @example
127
+ * const controller = useControllerNode(node, msg);
128
+ *
129
+ * // Evaluate a property
130
+ * const [error, value] = await controller.evaluateNodeProperty('someValue', 'msg');
131
+ *
132
+ * // Quickly evaluate a property from an object
133
+ * const result = await controller.quickNodePropertyEval({ foo: 'bar' }, 'foo');
134
+ *
135
+ * @param {Node} node - The Node-RED node instance.
136
+ * @param {NodeMessage} msg - The message object passing through the node.
137
+ * @param {object} [opts] - Optional configuration for property evaluation.
138
+ * @param {string} [opts.typedSuffix='Type'] - The suffix used to determine the type of a property.
139
+ * @returns {object} An object containing utility functions for evaluating node properties.
140
+ */
141
+ declare function useControllerNode(node: Node, msg: NodeMessage, opts?: {
142
+ typedSuffix: string;
143
+ }): {
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>;
148
+ };
17
149
 
18
- export { splitBooleanOutputs };
150
+ export { evaluateNodeProperty, getREDNode, splitBooleanOutputs, useControllerNode };
@@ -1,3 +1,9 @@
1
+ import { NodeAPI, Node, NodeMessage } from 'node-red';
2
+
3
+ declare global {
4
+ var RED: NodeAPI;
5
+ }
6
+
1
7
  /**
2
8
  * Splits a message into two outputs based on a boolean condition.
3
9
  *
@@ -14,5 +20,131 @@
14
20
  * console.log(result); // Output: [{ payload: 'Hello, world!' }, null]
15
21
  */
16
22
  declare function splitBooleanOutputs(conditionTerm: boolean, msg: unknown): unknown[];
23
+ /**
24
+ * Retrieves a node by its ID from the RED.nodes collection. This function returns the node object,
25
+ * which includes any custom fields and credentials associated with it. If the node with the specified
26
+ * ID doesn't exist, the function returns `null`.
27
+ *
28
+ * @template TFields - A generic type that extends an object, representing the additional fields
29
+ * associated with the node. This allows the caller to extend the node with custom fields.
30
+ * @template TCreds - A generic type that extends an object, representing the credentials associated with the node.
31
+ * This allows the caller to extend the node with custom credentials.
32
+ *
33
+ * @param {string} idNode - The unique identifier of the node to be retrieved.
34
+ *
35
+ * @returns {(Node<TCreds> & TFields) | null} The node object with credentials and additional fields, or `null` if
36
+ * the node cannot be found.
37
+ *
38
+ * @example
39
+ * // Example usage of the getREDNode function
40
+ * const nodeId = 'node123';
41
+ * const node = getREDNode<{customField: string}, {apiKey: string}>(nodeId);
42
+ * if (node) {
43
+ * console.log(node.customField); // Accessing custom field
44
+ * console.log(node.apiKey); // Accessing node credentials
45
+ * } else {
46
+ * console.log('Node not found');
47
+ * }
48
+ *
49
+ * // In this example:
50
+ * // - We retrieve the node with ID 'node123'.
51
+ * // - The node is expected to have a custom field called 'customField' and credentials including 'apiKey'.
52
+ *
53
+ * @throws {Error} Throws an error if the `idNode` is invalid or if there are issues retrieving the node.
54
+ */
55
+ declare function getREDNode<TFields extends {} = Record<any, any>, TCreds extends {} = Record<any, any>>(idNode: string): (Node<TCreds> & TFields) | null;
56
+ type EvaluateNodePropertyParams = {
57
+ value: string;
58
+ type: string;
59
+ node: Node;
60
+ msg: NodeMessage;
61
+ };
62
+ /**
63
+ * Evaluates a node property in the Node-RED environment.
64
+ * This function wraps the `evaluateNodeProperty` utility from `RED.util` and returns a Promise.
65
+ * It resolves with a tuple containing an `Error` (if any) and the evaluation result.
66
+ *
67
+ * The evaluation is performed asynchronously, and the function never rejects.
68
+ * The result will always be a tuple where:
69
+ * - The first element is an `Error` if one occurs during the evaluation, or `undefined` if no error occurs.
70
+ * - The second element is the result of the property evaluation, or `undefined` if no result is produced.
71
+ *
72
+ * **Note**: This function is designed to be used in the context of Node-RED node development.
73
+ * It requires access to the `RED` object and the necessary node properties.
74
+ *
75
+ * @param {EvaluateNodePropertyParams} params - The parameters needed to evaluate the node property.
76
+ * @param {string} params.value - The string representing the value or property to evaluate.
77
+ * @param {string} params.type - The type of the value (e.g., "jsonata", "str").
78
+ * @param {Node} params.node - The Node-RED node performing the evaluation.
79
+ * @param {NodeMessage} params.msg - The message object to be passed into the evaluation.
80
+ *
81
+ * @returns {Promise<[Error | undefined, any | undefined]>} - A promise that resolves with a tuple containing:
82
+ * - The error (if any) or `undefined` if no error occurs.
83
+ * - The result of the evaluation or `undefined` if no result is produced.
84
+ *
85
+ * @example
86
+ * // Example usage of evaluateNodeProperty with async/await
87
+ * async function processNodeProperty() {
88
+ * const params: EvaluateNodePropertyParams = {
89
+ * value: "msg.payload",
90
+ * type: "jsonata",
91
+ * node: myNode, // assuming myNode is a valid Node object
92
+ * msg: myMsg, // assuming myMsg is a valid NodeMessage object
93
+ * };
94
+ *
95
+ * const [err, result] = await evaluateNodeProperty(params);
96
+ *
97
+ * if (err) {
98
+ * console.error("Error:", err);
99
+ * } else {
100
+ * console.log("Evaluation Result:", result);
101
+ * }
102
+ * }
103
+ *
104
+ * @example
105
+ * // Handling the result when using the promise directly
106
+ * evaluateNodeProperty({
107
+ * value: "msg.payload.someProperty",
108
+ * type: "str",
109
+ * node: myNode, // assuming myNode is a valid Node object
110
+ * msg: myMsg, // assuming myMsg is a valid NodeMessage object
111
+ * })
112
+ * .then(([err, result]) => {
113
+ * if (err) {
114
+ * console.error("Error:", err);
115
+ * } else {
116
+ * console.log("Result:", result);
117
+ * }
118
+ * });
119
+ */
120
+ declare function evaluateNodeProperty(params: EvaluateNodePropertyParams): Promise<[Error | undefined, any | undefined]>;
121
+ /**
122
+ * A hook-like function that provides utilities for evaluating Node-RED properties
123
+ * within a custom node. It includes property evaluation with default values and
124
+ * quick property evaluation with type enforcement.
125
+ *
126
+ * @example
127
+ * const controller = useControllerNode(node, msg);
128
+ *
129
+ * // Evaluate a property
130
+ * const [error, value] = await controller.evaluateNodeProperty('someValue', 'msg');
131
+ *
132
+ * // Quickly evaluate a property from an object
133
+ * const result = await controller.quickNodePropertyEval({ foo: 'bar' }, 'foo');
134
+ *
135
+ * @param {Node} node - The Node-RED node instance.
136
+ * @param {NodeMessage} msg - The message object passing through the node.
137
+ * @param {object} [opts] - Optional configuration for property evaluation.
138
+ * @param {string} [opts.typedSuffix='Type'] - The suffix used to determine the type of a property.
139
+ * @returns {object} An object containing utility functions for evaluating node properties.
140
+ */
141
+ declare function useControllerNode(node: Node, msg: NodeMessage, opts?: {
142
+ typedSuffix: string;
143
+ }): {
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>;
148
+ };
17
149
 
18
- export { splitBooleanOutputs };
150
+ export { evaluateNodeProperty, getREDNode, splitBooleanOutputs, useControllerNode };
@@ -1 +1 @@
1
- function o(l,n){return typeof l!="boolean"?(console.warn("Payload must be a boolean (true or false)."),[null,null]):l?[n,null]:[null,n]}export{o as splitBooleanOutputs};
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,2 +1,2 @@
1
- import'../chunk-O2XFH626.js';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 d(t){return l(t)||a(t)}function p(t,{lenient:r=!1}={}){if(typeof t!="string")throw new TypeError("isUrl: Expected a string");let e=t.trim();if(e.includes(" "))return !1;try{return new URL(e),!0}catch(n){return r?p(`https://${e}`):!1}}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
- export{p as isUrl,d as isValidIP,l as isValidIPv4,a as isValidIPv6,o as merge,s as tryit};
1
+ export{a as merge,b as tryit}from'../chunk-O55HBSM5.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=!1}={}){if(typeof t!="string")throw new TypeError("isUrl: Expected a string");let f=t.trim();if(f.includes(" "))return !1;try{return new URL(f),!0}catch(o){return r?s(`https://${f}`):!1}}
2
+ export{s as isUrl,A as isValidIP,a as isValidIPv4,i as isValidIPv6};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keload/node-red-dxp",
3
- "version": "1.20.0",
3
+ "version": "1.22.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -84,7 +84,7 @@
84
84
  "autoprefixer": "10.4.20",
85
85
  "browser-sync": "3.0.3",
86
86
  "chokidar": "4.0.3",
87
- "commander": "13.0.0",
87
+ "commander": "13.1.0",
88
88
  "consola": "3.3.3",
89
89
  "cosmiconfig": "9.0.0",
90
90
  "cssnano": "7.0.6",
@@ -96,7 +96,7 @@
96
96
  "merge-anything": "6.0.2",
97
97
  "nodemon": "3.1.9",
98
98
  "ora": "8.1.1",
99
- "postcss": "8.4.49",
99
+ "postcss": "8.5.1",
100
100
  "prettyjson": "1.2.5",
101
101
  "pug": "3.0.3",
102
102
  "radash": "12.1.0",