@keload/node-red-dxp 1.13.0 → 1.14.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.
@@ -7,7 +7,7 @@
7
7
  ${t}`,mu=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),fu=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),du=(e,t,u)=>{let r=u===""?"":`with ${u.trim()}() `,s=cu.bind(null,r,t.toString());Object.defineProperty(s,"name",fu);let{writable:o,enumerable:i,configurable:n}=mu;Object.defineProperty(e,"toString",{value:s,writable:o,enumerable:i,configurable:n});};function oe(e,t,{ignoreNonConfigurable:u=!1}={}){let{name:r}=e;for(let s of Reflect.ownKeys(t))au(e,t,s,u);return Fu(e,t),du(e,t,r),e}var G=new WeakMap,Ge=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let u,r=0,s=e.displayName||e.name||"<anonymous>",o=function(...i){if(G.set(o,++r),r===1)u=e.apply(this,i),e=void 0;else if(t.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return u};return oe(o,e),G.set(o,r),o};Ge.callCount=e=>{if(!G.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return G.get(e)};var We=Ge;var _=[];_.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&_.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&_.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var W=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"),De=globalThis,pu=Object.defineProperty.bind(Object),ne=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(De[ie])return De[ie];pu(De,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],s=r.indexOf(u);s!==-1&&(s===0&&r.length===1?r.length=0:r.splice(s,1));}emit(t,u,r){if(this.emitted[t])return !1;this.emitted[t]=!0;let s=!1;for(let o of this.listeners[t])s=o(u,r)===!0||s;return t==="exit"&&(s=this.emit("afterExit",u,r)||s),s}},H=class{},Cu=e=>({onExit(t,u){return e.onExit(t,u)},load(){return e.load()},unload(){return e.unload()}}),ae=class extends H{onExit(){return ()=>{}}load(){}unload(){}},le=class extends H{#i=Fe.platform==="win32"?"SIGINT":"SIGHUP";#u=new ne;#e;#s;#c;#t={};#o=!1;constructor(t){super(),this.#e=t,this.#t={};for(let u of _)this.#t[u]=()=>{let r=this.#e.listeners(u),{count:s}=this.#u,o=t;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(s+=o.__signal_exit_emitter__.count),r.length===s){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.#s=t.emit;}onExit(t,u){if(!W(this.#e))return ()=>{};this.#o===!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.#o){this.#o=!0,this.#u.count+=1;for(let t of _)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.#o&&(this.#o=!1,_.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.#s,this.#e.reallyExit=this.#c,this.#u.count-=1);}#r(t){return W(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.#s;if(t==="exit"&&W(this.#e)){typeof u[0]=="number"&&(this.#e.exitCode=u[0]);let s=r.call(this.#e,t,...u);return this.#u.emit("exit",this.#e.exitCode,null),s}else return r.call(this.#e,t,...u)}},Fe=globalThis.process,{onExit:He,load:Fs,unload:cs}=Cu(W(Fe)?new le(Fe):new ae);var Ue=h__namespace.default.stderr.isTTY?h__namespace.default.stderr:h__namespace.default.stdout.isTTY?h__namespace.default.stdout:void 0,hu=Ue?We(()=>{He(()=>{Ue.write("\x1B[?25h");},{alwaysLast:!0});}):()=>{},Ye=hu;var Y=!1,N={};N.show=(e=h__namespace.default.stderr)=>{e.isTTY&&(Y=!1,e.write("\x1B[?25h"));};N.hide=(e=h__namespace.default.stderr)=>{e.isTTY&&(Ye(),Y=!0,e.write("\x1B[?25l"));};N.toggle=(e,t)=>{e!==void 0&&(Y=e),Y?N.show(t):N.hide(t);};var ce=N;var j=ve(me());function fe(){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 gu={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")},_u=fe()?gu:Bu,I=_u;function de({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 xu=de();function R(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(xu,"")}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 Ze(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Xe(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 yu(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Qe(e,{ambiguousAsWide:t=!1}={}){return yu(e),Ze(e)||Xe(e)||t&&ze(e)?2:1}var et=()=>/[#*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 bu=new Intl.Segmenter,Au=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=R(e)),e.length===0)return 0;let s=0,o={ambiguousAsWide:!u};for(let{segment:i}of bu.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)&&!Au.test(i)){if(et().test(i)){s+=2;continue}s+=Qe(n,o);}}return s}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 wu=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.#s),h__namespace.default.stdin.resume());}#e(){h__namespace.default.stdin.isTTY&&(h__namespace.default.stdin.off("data",this.#s),h__namespace.default.stdin.pause(),h__namespace.default.stdin.setRawMode(!1));}#s(t){t[0]===wu&&h__namespace.default.emit("SIGINT");}},Nu=new Ee,ge=Nu;ve(me());var Be=class{#i=0;#u=!1;#e=0;#s=-1;#c=0;#t;#o;#r;#m;#d;#a;#l;#F;#p;#D;#n;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.#d=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.#s}}),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.#f();}get interval(){return this.#d??this.#o.interval??100}get spinner(){return this.#o}set spinner(t){if(this.#s=-1,this.#d=void 0,typeof t=="object"){if(t.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#o=t;}else if(!he())this.#o=j.default.line;else if(t===void 0)this.#o=j.default.dots;else if(t!=="default"&&j.default[t])this.#o=j.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.#f();}get prefixText(){return this.#D}set prefixText(t=""){this.#D=t,this.#f();}get suffixText(){return this.#n}set suffixText(t=""){this.#n=t,this.#f();}get isSpinning(){return this.#m!==void 0}#C(t=this.#D,u=" "){return typeof t=="string"&&t!==""?t+u:typeof t=="function"?t()+u:""}#h(t=this.#n,u=" "){return typeof t=="string"&&t!==""?u+t:typeof t=="function"?u+t():""}#f(){let t=this.#r.columns??80,u=this.#C(this.#D,"-"),r=this.#h(this.#n,"-"),s=" ".repeat(this.#F)+u+"--"+this.#p+"--"+r;this.#e=0;for(let o of R(s).split(`
8
8
  `))this.#e+=Math.max(1,Math.ceil(pe(o,{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.#s===-1||t-this.#c>=this.interval)&&(this.#s=++this.#s%this.#o.frames.length,this.#c=t);let{frames:u}=this.#o,r=u[this.#s];this.color&&(r=C[this.color](r));let s=typeof this.#D=="string"&&this.#D!==""?this.#D+" ":"",o=typeof this.text=="string"?" "+this.text:"",i=typeof this.#n=="string"&&this.#n!==""?" "+this.#n:"";return s+r+o+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.#s=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:I.success,text:t})}fail(t){return this.stopAndPersist({symbol:I.error,text:t})}warn(t){return this.stopAndPersist({symbol:I.warning,text:t})}info(t){return this.stopAndPersist({symbol:I.info,text:t})}stopAndPersist(t={}){if(this.#l)return this;let u=t.prefixText??this.#D,r=this.#C(u," "),s=t.symbol??" ",o=t.text??this.text,n=typeof o=="string"?(s?" ":"")+o:"",c=t.suffixText??this.#n,m=this.#h(c," "),f=r+s+n+m+`
10
- `;return this.stop(),this.#r.write(f),this}};function _e(e){return new Be(e)}var ut={name:"@keload/node-red-dxp",version:"1.12.2",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"},"./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":"9.0.3","release-it":"17.10.0",tsup:"8.3.5",tsx:"4.19.2",typedoc:"^0.26.11","typedoc-plugin-markdown":"^4.2.10",typescript:"5.6.3",vitepress:"1.5.0",vitest:"2.1.5"},dependencies:{"@fullhuman/postcss-purgecss":"^6.0.0","@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.1",commander:"12.1.0",consola:"3.2.3",cosmiconfig:"9.0.0",cssnano:"^7.0.6",esbuild:"0.24.0","fast-glob":"^3.3.2",handlebars:"4.7.8","html-minifier-terser":"7.2.0","is-ip":"^5.0.1","is-what":"^5.0.2","mdx-to-md":"^0.3.2","merge-anything":"6.0.2",nodemon:"3.1.7",ora:"8.1.1",postcss:"^8.4.49",prettyjson:"1.2.5",radash:"12.1.0",sass:"1.81.0",tailwindcss:"^3.4.15"},files:["dist"]};function q(e){return Object.prototype.toString.call(e).slice(8,-1)}function v(e){if(q(e)!=="Object")return !1;let t=Object.getPrototypeOf(e);return !!t&&t.constructor===Object&&t===Object.prototype}function K(e){return q(e)==="Symbol"}function rt(e,t,u,r){let s={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";s==="enumerable"&&(e[t]=u),s==="nonenumerable"&&Object.defineProperty(e,t,{value:u,enumerable:!1,writable:!0,configurable:!0});}function st(e,t,u){if(!v(t))return t;let r={};if(v(e)){let n=Object.getOwnPropertyNames(e),c=Object.getOwnPropertySymbols(e);r=[...n,...c].reduce((m,f)=>{let ee=e[f];return (!K(f)&&!Object.getOwnPropertyNames(t).includes(f)||K(f)&&!Object.getOwnPropertySymbols(t).includes(f))&&rt(m,f,ee,e),m},{});}let s=Object.getOwnPropertyNames(t),o=Object.getOwnPropertySymbols(t);return [...s,...o].reduce((n,c)=>{let m=t[c],f=v(e)?e[c]:void 0;f!==void 0&&v(m)&&(m=st(f,m));let ee=m;return rt(n,c,ee,t),n},r)}function z(e,...t){return t.reduce((u,r)=>st(u,r),e)}var ot={builder:{outputDir:"dist",esbuildControllerOptions:{includeInBundle:[]},tailwind:{forcedClassesInclusion:[]}},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 Ru="node-red-dxp",ju=e=>e.replace("@","").replace("/","-");function Mu(){let e=cosmiconfig.cosmiconfigSync(Ru);try{let t=e.search();return z(ot,t?t.config:{})}catch(t){throw console.error("Error while loading configuration",t),t}}var it=Mu(),B=process.cwd(),Dt=JSON.parse(at.readFileSync(`${B}/package.json`,"utf-8")),M=`${B}/${a.srcDir}`,ku=`${B}/resources`,Lu=`${B}/resources`,xe=`${M}/${a.nodesDirName}`,ye=`${B}/${a.libCacheDir}`,Gu=`${lt__namespace.default.resolve(__dirname,"..")}`,nt=ju(Dt.name);function Wu(e=[]){return e.map(t=>{let u=t.path,r=`${u}/${a.nodes.editor.dirName}`,s=u.replace(B,"").slice(1),o=`${s}/${a.nodes.editor.dirName}`,i=fastGlob.globSync(`${r}/${a.nodes.editor.stylesName}.scss`),n=fastGlob.globSync(`${u}/docs.mdx`),c=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:o,relativePath:s,nodeIdentifier:`${nt}-${m}`,fullControllerPath:`${u}/${a.nodes.controllerName}.ts`,editor:{tsPath:`${r}/${a.nodes.editor.tsName}.ts`,htmlPath:`${r}/${a.nodes.editor.htmlName}.html`,scssFiles:i},doc:{mdxFiles:n,mdFiles:c}}})}function Hu(){let e=fastGlob.globSync(`${xe}/**/*`,{onlyDirectories:!0,deep:1,objectMode:!0}),t=Wu(e),u=t.map(r=>r.name);return {currentDir:B,pathSrcDir:M,pathSrcNodesDir:xe,pathResourcesDir:ku,additionalResourcesDir:Lu,pathDist:`${B}/${it.builder.outputDir}`,currentPackagedDistPath:Gu,cacheDirFiles:{controllerIndex:`${ye}/controller-index.ts`,editorIndex:`${ye}/editor-index.ts`},pathLibCacheDir:ye,packageName:Dt.name,packageNameSlug:nt,config:it,resolvedSrcPathsScss:fastGlob.globSync(`${M}/${a.globalStylesName}.scss`,{ignore:[`${xe}/**/*.scss`]}),resolvedNodesPaths:e.map(r=>r.path),resolvedSrcLocalesPaths:fastGlob.globSync(`${M}/${a.localesDirName}/*.json`),redServerPath:fastGlob.globSync(`${M}/red-server.ts`),listNodesFull:t,listNodesFullNames:u}}var D=Hu();var Ft=`${lt__namespace.default.resolve(__dirname,"..")}`;function y(e){at__default.default.existsSync(e)||at__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 ct(e){for(let t of e)try{let u=lt__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 mt={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(f),this}};function _e(e){return new Be(e)}var ut={name:"@keload/node-red-dxp",version:"1.13.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"},"./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":"9.0.3","release-it":"17.10.0",tsup:"8.3.5",tsx:"4.19.2",typedoc:"^0.26.11","typedoc-plugin-markdown":"^4.2.10",typescript:"5.6.3",vitepress:"1.5.0",vitest:"2.1.5"},dependencies:{"@fullhuman/postcss-purgecss":"^6.0.0","@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.1",commander:"12.1.0",consola:"3.2.3",cosmiconfig:"9.0.0",cssnano:"^7.0.6",esbuild:"0.24.0","fast-glob":"^3.3.2",handlebars:"4.7.8","html-minifier-terser":"7.2.0","is-ip":"^5.0.1","is-what":"^5.0.2","mdx-to-md":"^0.3.2","merge-anything":"6.0.2",nodemon:"3.1.7",ora:"8.1.1",postcss:"^8.4.49",prettyjson:"1.2.5",radash:"12.1.0",sass:"1.81.0",tailwindcss:"^3.4.15"},files:["dist"]};function q(e){return Object.prototype.toString.call(e).slice(8,-1)}function v(e){if(q(e)!=="Object")return !1;let t=Object.getPrototypeOf(e);return !!t&&t.constructor===Object&&t===Object.prototype}function K(e){return q(e)==="Symbol"}function rt(e,t,u,r){let s={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";s==="enumerable"&&(e[t]=u),s==="nonenumerable"&&Object.defineProperty(e,t,{value:u,enumerable:!1,writable:!0,configurable:!0});}function st(e,t,u){if(!v(t))return t;let r={};if(v(e)){let n=Object.getOwnPropertyNames(e),c=Object.getOwnPropertySymbols(e);r=[...n,...c].reduce((m,f)=>{let ee=e[f];return (!K(f)&&!Object.getOwnPropertyNames(t).includes(f)||K(f)&&!Object.getOwnPropertySymbols(t).includes(f))&&rt(m,f,ee,e),m},{});}let s=Object.getOwnPropertyNames(t),o=Object.getOwnPropertySymbols(t);return [...s,...o].reduce((n,c)=>{let m=t[c],f=v(e)?e[c]:void 0;f!==void 0&&v(m)&&(m=st(f,m));let ee=m;return rt(n,c,ee,t),n},r)}function z(e,...t){return t.reduce((u,r)=>st(u,r),e)}var ot={builder:{outputDir:"dist",esbuildControllerOptions:{includeInBundle:[]},tailwind:{forcedClassesInclusion:[]}},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 Ru="node-red-dxp",ju=e=>e.replace("@","").replace("/","-");function Mu(){let e=cosmiconfig.cosmiconfigSync(Ru);try{let t=e.search();return z(ot,t?t.config:{})}catch(t){throw console.error("Error while loading configuration",t),t}}var it=Mu(),B=process.cwd(),Dt=JSON.parse(at.readFileSync(`${B}/package.json`,"utf-8")),M=`${B}/${a.srcDir}`,ku=`${B}/resources`,Lu=`${B}/resources`,xe=`${M}/${a.nodesDirName}`,ye=`${B}/${a.libCacheDir}`,Gu=`${lt__namespace.default.resolve(__dirname,"..")}`,nt=ju(Dt.name);function Wu(e=[]){return e.map(t=>{let u=t.path,r=`${u}/${a.nodes.editor.dirName}`,s=u.replace(B,"").slice(1),o=`${s}/${a.nodes.editor.dirName}`,i=fastGlob.globSync(`${r}/${a.nodes.editor.stylesName}.scss`),n=fastGlob.globSync(`${u}/docs.mdx`),c=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:o,relativePath:s,nodeIdentifier:`${nt}-${m}`,fullControllerPath:`${u}/${a.nodes.controllerName}.ts`,editor:{tsPath:`${r}/${a.nodes.editor.tsName}.ts`,htmlPath:`${r}/${a.nodes.editor.htmlName}.html`,scssFiles:i},doc:{mdxFiles:n,mdFiles:c}}})}function Hu(){let e=fastGlob.globSync(`${xe}/**/*`,{onlyDirectories:!0,deep:1,objectMode:!0}),t=Wu(e),u=t.map(r=>r.name);return {currentDir:B,pathSrcDir:M,pathSrcNodesDir:xe,pathResourcesDir:ku,additionalResourcesDir:Lu,pathDist:`${B}/${it.builder.outputDir}`,currentPackagedDistPath:Gu,cacheDirFiles:{controllerIndex:`${ye}/controller-index.ts`,editorIndex:`${ye}/editor-index.ts`},pathLibCacheDir:ye,packageName:Dt.name,packageNameSlug:nt,config:it,resolvedSrcPathsScss:fastGlob.globSync(`${M}/${a.globalStylesName}.scss`,{ignore:[`${xe}/**/*.scss`]}),resolvedNodesPaths:e.map(r=>r.path),resolvedSrcLocalesPaths:fastGlob.globSync(`${M}/${a.localesDirName}/*.json`),redServerPath:fastGlob.globSync(`${M}/red-server.ts`),listNodesFull:t,listNodesFullNames:u}}var D=Hu();var Ft=`${lt__namespace.default.resolve(__dirname,"..")}`;function y(e){at__default.default.existsSync(e)||at__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 ct(e){for(let t of e)try{let u=lt__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 mt={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 Vu=`${D.currentDir}/package.json`,Z=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=>`import ${t.pascalName}, {credentials as cred${t.pascalName}} from '${t.fullControllerPath}';`).join(`
@@ -1 +1 @@
1
- 'use strict';function u(t){let e=t.startsWith("$"),n=t.startsWith("$$"),r=t.startsWith("#node-config-input")||t.startsWith("#node-input");return {isNodeIdShortcut:e,isNodeConfigIdShortcut:n,isFullSelector:r,value:e||n||r}}function i(t){let e=u(t);return e.isNodeConfigIdShortcut?`#node-config-input-${t.replace("$$","")}`:e.isNodeIdShortcut?`#node-input-${t.replace("$","")}`:t}function c(t,e,n){e.forEach(r=>{let o=document.querySelector(r);o&&n.forEach(s=>o.classList[t](s));});}function l(t,e){c("remove",t,e);}function d(t,e){c("add",t,e);}function a(t){return i(t).split("-input-")[1]}function p(t,e,n){let r=i(t),o=e;n!=null&&n.emptyValue&&(o=[{value:"",text:n.emptyValue},...e]),$(r).empty().append(o.map(s=>$("<option>",{value:s.value,text:s.text,selected:s.value===(n==null?void 0:n.selected)})));}function g(t,e){let r=(Array.isArray(t)?t:[t]).map(i).join(", ");$(r).on("input",()=>{let o=$(r).map(function(){return $(this).val()}).get();e(o);});}function f(t,e){let n=i(t);$(n).val(e);}function x(t,e){let n=i(t);$(n).text(e);}function S(t){let e=i(t);return $(e)}function h(t){let e=i(t);return document.querySelector(e).checked}exports.addClassesOnSelectors=d;exports.handleAddRemoveClassesOnSelectors=c;exports.initSelect=p;exports.isCheckboxChecked=h;exports.isNodeInput=u;exports.jqSelector=S;exports.removeClassesOnSelectors=l;exports.resolveInputKey=a;exports.resolveSelector=i;exports.setInputValue=f;exports.setText=x;exports.watchInput=g;
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;
@@ -170,6 +170,64 @@ declare function setText(selector: string, text: string): void;
170
170
  * // Returns a jQuery object for the resolved selector
171
171
  */
172
172
  declare function jqSelector(selector: string): JQuery<HTMLElement>;
173
+ /**
174
+ * Checks whether a checkbox is checked based on a CSS selector.
175
+ *
176
+ * @param selector - A valid CSS selector to identify the checkbox element.
177
+ * @returns `true` if the checkbox is checked, otherwise `false`.
178
+ *
179
+ * @example
180
+ * ```typescript
181
+ * const isChecked = isCheckboxChecked('#my-checkbox');
182
+ * console.log(isChecked); // true or false
183
+ * ```
184
+ */
173
185
  declare function isCheckboxChecked(selector: string): boolean;
186
+ /**
187
+ * Retrieves values from form inputs within a specific prefix in their `id`.
188
+ *
189
+ * It searches for elements with an `id` starting with `node-input-{prefix}-` and extracts their values.
190
+ * For checkboxes, it returns a boolean (`true` or `false`).
191
+ * For other inputs (e.g., text, select), it returns their value as a string.
192
+ *
193
+ * @param prefix - The prefix of the `id` to filter the form inputs.
194
+ * @returns An object where keys are derived from the input `id`, and values are the corresponding input values.
195
+ *
196
+ * @example
197
+ * ```typescript
198
+ * // HTML
199
+ * // <input type="checkbox" id="node-input-settings-enabled" checked />
200
+ * // <input type="text" id="node-input-settings-username" value="JohnDoe" />
201
+ *
202
+ * const values = getFormValues('settings');
203
+ * console.log(values);
204
+ * // Output: { enabled: true, username: 'JohnDoe' }
205
+ * ```
206
+ */
207
+ declare function getFormValues(prefix: string): Record<string, string | boolean>;
208
+ /**
209
+ * Sets values into form inputs identified by a specific prefix in their `id`.
210
+ *
211
+ * It searches for elements with an `id` starting with `node-input-{prefix}-` and assigns the provided values.
212
+ * For checkboxes, it sets their `checked` state to `true` or `false`.
213
+ * For other inputs (e.g., text, select), it sets their `value`.
214
+ *
215
+ * @param prefix - The prefix of the `id` to identify the form inputs.
216
+ * @param values - An object where keys correspond to the suffix of the input `id`, and values are the corresponding input values.
217
+ *
218
+ * @example
219
+ * ```typescript
220
+ * // HTML
221
+ * // <input type="checkbox" id="node-input-settings-enabled" />
222
+ * // <input type="text" id="node-input-settings-username" />
223
+ *
224
+ * setFormValues('settings', { enabled: true, username: 'JaneDoe' });
225
+ *
226
+ * // Results in:
227
+ * // Checkbox with id="node-input-settings-enabled" is checked
228
+ * // Input with id="node-input-settings-username" has value "JaneDoe"
229
+ * ```
230
+ */
231
+ declare function setFormValues(prefix: string, values: Record<string, unknown | boolean>): void;
174
232
 
175
- export { addClassesOnSelectors, handleAddRemoveClassesOnSelectors, initSelect, isCheckboxChecked, isNodeInput, jqSelector, removeClassesOnSelectors, resolveInputKey, resolveSelector, setInputValue, setText, watchInput };
233
+ export { addClassesOnSelectors, getFormValues, handleAddRemoveClassesOnSelectors, initSelect, isCheckboxChecked, isNodeInput, jqSelector, removeClassesOnSelectors, resolveInputKey, resolveSelector, setFormValues, setInputValue, setText, watchInput };
@@ -170,6 +170,64 @@ declare function setText(selector: string, text: string): void;
170
170
  * // Returns a jQuery object for the resolved selector
171
171
  */
172
172
  declare function jqSelector(selector: string): JQuery<HTMLElement>;
173
+ /**
174
+ * Checks whether a checkbox is checked based on a CSS selector.
175
+ *
176
+ * @param selector - A valid CSS selector to identify the checkbox element.
177
+ * @returns `true` if the checkbox is checked, otherwise `false`.
178
+ *
179
+ * @example
180
+ * ```typescript
181
+ * const isChecked = isCheckboxChecked('#my-checkbox');
182
+ * console.log(isChecked); // true or false
183
+ * ```
184
+ */
173
185
  declare function isCheckboxChecked(selector: string): boolean;
186
+ /**
187
+ * Retrieves values from form inputs within a specific prefix in their `id`.
188
+ *
189
+ * It searches for elements with an `id` starting with `node-input-{prefix}-` and extracts their values.
190
+ * For checkboxes, it returns a boolean (`true` or `false`).
191
+ * For other inputs (e.g., text, select), it returns their value as a string.
192
+ *
193
+ * @param prefix - The prefix of the `id` to filter the form inputs.
194
+ * @returns An object where keys are derived from the input `id`, and values are the corresponding input values.
195
+ *
196
+ * @example
197
+ * ```typescript
198
+ * // HTML
199
+ * // <input type="checkbox" id="node-input-settings-enabled" checked />
200
+ * // <input type="text" id="node-input-settings-username" value="JohnDoe" />
201
+ *
202
+ * const values = getFormValues('settings');
203
+ * console.log(values);
204
+ * // Output: { enabled: true, username: 'JohnDoe' }
205
+ * ```
206
+ */
207
+ declare function getFormValues(prefix: string): Record<string, string | boolean>;
208
+ /**
209
+ * Sets values into form inputs identified by a specific prefix in their `id`.
210
+ *
211
+ * It searches for elements with an `id` starting with `node-input-{prefix}-` and assigns the provided values.
212
+ * For checkboxes, it sets their `checked` state to `true` or `false`.
213
+ * For other inputs (e.g., text, select), it sets their `value`.
214
+ *
215
+ * @param prefix - The prefix of the `id` to identify the form inputs.
216
+ * @param values - An object where keys correspond to the suffix of the input `id`, and values are the corresponding input values.
217
+ *
218
+ * @example
219
+ * ```typescript
220
+ * // HTML
221
+ * // <input type="checkbox" id="node-input-settings-enabled" />
222
+ * // <input type="text" id="node-input-settings-username" />
223
+ *
224
+ * setFormValues('settings', { enabled: true, username: 'JaneDoe' });
225
+ *
226
+ * // Results in:
227
+ * // Checkbox with id="node-input-settings-enabled" is checked
228
+ * // Input with id="node-input-settings-username" has value "JaneDoe"
229
+ * ```
230
+ */
231
+ declare function setFormValues(prefix: string, values: Record<string, unknown | boolean>): void;
174
232
 
175
- export { addClassesOnSelectors, handleAddRemoveClassesOnSelectors, initSelect, isCheckboxChecked, isNodeInput, jqSelector, removeClassesOnSelectors, resolveInputKey, resolveSelector, setInputValue, setText, watchInput };
233
+ export { addClassesOnSelectors, getFormValues, handleAddRemoveClassesOnSelectors, initSelect, isCheckboxChecked, isNodeInput, jqSelector, removeClassesOnSelectors, resolveInputKey, resolveSelector, setFormValues, setInputValue, setText, watchInput };
@@ -1 +1 @@
1
- import'../../chunk-WOT6VMZA.js';function u(t){let e=t.startsWith("$"),n=t.startsWith("$$"),r=t.startsWith("#node-config-input")||t.startsWith("#node-input");return {isNodeIdShortcut:e,isNodeConfigIdShortcut:n,isFullSelector:r,value:e||n||r}}function i(t){let e=u(t);return e.isNodeConfigIdShortcut?`#node-config-input-${t.replace("$$","")}`:e.isNodeIdShortcut?`#node-input-${t.replace("$","")}`:t}function c(t,e,n){e.forEach(r=>{let o=document.querySelector(r);o&&n.forEach(s=>o.classList[t](s));});}function l(t,e){c("remove",t,e);}function d(t,e){c("add",t,e);}function a(t){return i(t).split("-input-")[1]}function p(t,e,n){let r=i(t),o=e;n!=null&&n.emptyValue&&(o=[{value:"",text:n.emptyValue},...e]),$(r).empty().append(o.map(s=>$("<option>",{value:s.value,text:s.text,selected:s.value===(n==null?void 0:n.selected)})));}function g(t,e){let r=(Array.isArray(t)?t:[t]).map(i).join(", ");$(r).on("input",()=>{let o=$(r).map(function(){return $(this).val()}).get();e(o);});}function f(t,e){let n=i(t);$(n).val(e);}function x(t,e){let n=i(t);$(n).text(e);}function S(t){let e=i(t);return $(e)}function h(t){let e=i(t);return document.querySelector(e).checked}export{d as addClassesOnSelectors,c as handleAddRemoveClassesOnSelectors,p as initSelect,h as isCheckboxChecked,u as isNodeInput,S as jqSelector,l as removeClassesOnSelectors,a as resolveInputKey,i as resolveSelector,f as setInputValue,x as setText,g as watchInput};
1
+ import'../../chunk-WOT6VMZA.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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keload/node-red-dxp",
3
- "version": "1.13.0",
3
+ "version": "1.14.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "scripts": {