UNPKG

do-red

Version:

A do-node and corresponding return-node for creating loops and task-lists.

1 lines 157 kB
<script type=text/javascript>"use strict";let component_Do;{function e(e){const t=(e="0.0.0")=>{const t=e.split("."),n=t.shift()||0,i=t.shift()||0;let o=t.join(".")||"0",l="";if(o.includes("-")){const e=o.split("-");o=e.shift(),l=e.shift()}const s={major:Number(n),minor:Number(i),patch:Number(o),tag:l,string:e};return s.aggregated=1e6*s.major+1e3*s.minor+s.patch,s},n=t(e);return n.parse=t,n}let t=[];const n=(e,t)=>(e.aggregated<=e.parse("0.3.5").aggregated&&(void 0===t.doneOutput&&(t.doneOutput=!0),void 0===t.mode&&(t.mode="msg"),void 0===t.each&&(t.each=""),void 0===t.eachType&&(t.eachType="msg"),void 0===t.yield&&(t.yield="keyValue"),setTimeout((()=>{RED.editor.validateNode(RED.nodes.node(t.id)),RED.view.select()}),2e3),void 0===t.firstValueOutput&&(t.firstValueOutput=!1),void 0===t.lastValueOutput&&(t.lastValueOutput=!1)),t);function i(o){if(RED.runtime.started){let i=!1,o=!1;setTimeout((function(){const s=RED.nodes.getType("do").category,r=[...Object.keys(RED.nodes.getType("do").defaults),...t],a="config"===s?RED.nodes.eachConfig:RED.nodes.eachNode;if(a((t=>{if("do"===t.type&&"1.1.0"!==t._version){const o=window.$.extend(!0,{},t);for(const e of Object.keys(o))-1===r.indexOf(e)&&"id"!==e&&delete o[e];const s=n(e(t._version),window.$.extend(!0,{},o));JSON.stringify(o)!==JSON.stringify(s)&&(t.__clone=s,l(t,{isStartupUpdate:!0}),i=!0)}})),i){const e="Updated node do to 1.1.0. Please check the node or deploy the automatic update changes.";RED.notify(e),console.log("[sir] "+e),a((e=>{"do"===e.type&&"1.1.0"!==e._version&&(e._version="1.1.0",t.forEach((t=>delete e[t])),e.dirty=!0,e.changed=!0,o=!0)}))}if(t?.length){const e=RED.nodes.getType("do").defaults;t.forEach((t=>delete e[t])),RED.nodes.filterNodes({type:"kdbx"}).forEach((e=>{t.forEach((t=>delete e[t]))}))}o&&RED.nodes.dirty(!0),RED.view.select("")}),1e3)}else setTimeout((()=>i()),1e3)}i();const o=function(e,t){try{if("object"!=typeof e)return;let n="400px";t&&t.minWidth&&(n=t.minWidth),e.__clone||(e.__clone=window.$.extend(!0,{},e)),component_Do=new Wo({target:document.getElementById("do-svelte-container"),props:{node:e.__clone}}),document.getElementById("do-svelte-container").style.width=n;if(!!!e.onchange){const t=e._def.oneditresize;e._def.oneditresize=function(n){document.getElementById("do-svelte-container").style.width="auto",t&&t(n),e._def.oneditresize=t}}}catch(e){console.log(e)}},l=function(e,t={}){if(e.__clone){const t=e.__clone;delete e.__clone;const n=Object.keys(e._def.defaults);for(const e of Object.keys(t))-1===n.indexOf(e)&&delete t[e];let i=!1;for(const o of n)if(e._def.defaults[o].type&&e[o]!==t[o]){i=!0;const n=RED.nodes.node(e[o]),l=RED.nodes.node(t[o]);n&&(n.users=n.users.filter((t=>t.id!==e.id))),l&&!l.users?.find((t=>t.id===e.id))&&l.users.push(RED.nodes.node(e.id))}i&&RED.sidebar.config.refresh(),Object.assign(e,t)}t.isStartupUpdate||setTimeout((()=>component_Do.$destroy()),250)},s=function(e){delete e.__clone,component_Do.$destroy()},r=function(e){e._version="1.1.0"};function a(){}const c=e=>e;function u(e,t){for(const n in t)e[n]=t[n];return e}function d(e){return e()}function p(){return Object.create(null)}function f(e){e.forEach(d)}function m(e){return"function"==typeof e}function v(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let h;function b(e,t){return e===t||(h||(h=document.createElement("a")),h.href=t,e===h.href)}function g(e,...t){if(null==e){for(const e of t)e(void 0);return a}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function y(e,t,n,i){if(e){const o=$(e,t,n,i);return e[0](o)}}function $(e,t,n,i){return e[1]&&i?u(n.ctx.slice(),e[1](i(t))):n.ctx}function x(e,t,n,i){if(e[2]&&i){const o=e[2](i(n));if(void 0===t.dirty)return o;if("object"==typeof o){const e=[],n=Math.max(t.dirty.length,o.length);for(let i=0;i<n;i+=1)e[i]=t.dirty[i]|o[i];return e}return t.dirty|o}return t.dirty}function w(e,t,n,i,o,l){if(o){const s=$(t,n,i,l);e.p(s,o)}}function k(e){if(e.ctx.length>32){const t=[],n=e.ctx.length/32;for(let e=0;e<n;e++)t[e]=-1;return t}return-1}function z(e){const t={};for(const n in e)t[n]=!0;return t}function E(e){return null==e?"":e}function R(e,t,n){return e.set(n),t}const _="undefined"!=typeof window;let D=_?()=>window.performance.now():()=>Date.now(),I=_?e=>requestAnimationFrame(e):a;const L=new Set;function O(e){L.forEach((t=>{t.c(e)||(L.delete(t),t.f())})),0!==L.size&&I(O)}function T(e){let t;return 0===L.size&&I(O),{promise:new Promise((n=>{L.add(t={c:e,f:n})})),abort(){L.delete(t)}}}function N(e,t){e.appendChild(t)}function C(e,t,n){const i=S(e);if(!i.getElementById(t)){const e=P("style");e.id=t,e.textContent=n,j(i,e)}}function S(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function B(e){const t=P("style");return t.textContent="/* empty */",j(S(e),t),t.sheet}function j(e,t){return N(e.head||e,t),t.sheet}function H(e,t,n){e.insertBefore(t,n||null)}function A(e){e.parentNode&&e.parentNode.removeChild(e)}function q(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function P(e){return document.createElement(e)}function V(e){return document.createTextNode(e)}function W(){return V(" ")}function M(){return V("")}function F(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function G(e){return function(t){return t.preventDefault(),e.call(this,t)}}function J(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function U(e){return function(t){t.target===this&&e.call(this,t)}}function X(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Y(e){return""===e?null:+e}function K(e){return Array.from(e.childNodes)}function Q(e,t){t=""+t,e.data!==t&&(e.data=t)}function Z(e,t){e.value=null==t?"":t}function ee(e,t,n,i){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function te(e,t,n){for(let n=0;n<e.options.length;n+=1){const i=e.options[n];if(i.__value===t)return void(i.selected=!0)}n&&void 0===t||(e.selectedIndex=-1)}function ne(e){const t=e.querySelector(":checked");return t&&t.__value}function ie(e,t,n){e.classList.toggle(t,!!n)}function oe(e,t,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:i})}class le{is_svg=!1;e=void 0;n=void 0;t=void 0;a=void 0;constructor(e=!1){this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,n=null){var i;this.e||(this.is_svg?this.e=(i=t.nodeName,document.createElementNS("http://www.w3.org/2000/svg",i)):this.e=P(11===t.nodeType?"TEMPLATE":t.nodeName),this.t="TEMPLATE"!==t.tagName?t:t.content,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from("TEMPLATE"===this.e.nodeName?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)H(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(A)}}const se=new Map;let re,ae=0;function ce(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function ue(e,t){const n={stylesheet:B(t),rules:{}};return se.set(e,n),n}function de(e,t,n,i,o,l,s,r=0){const a=16.666/i;let c="{\n";for(let e=0;e<=1;e+=a){const i=t+(n-t)*l(e);c+=100*e+`%{${s(i,1-i)}}\n`}const u=c+`100% {${s(n,1-n)}}\n}`,d=`__svelte_${ce(u)}_${r}`,p=S(e),{stylesheet:f,rules:m}=se.get(p)||ue(p,e);m[d]||(m[d]=!0,f.insertRule(`@keyframes ${d} ${u}`,f.cssRules.length));const v=e.style.animation||"";return e.style.animation=`${v?`${v}, `:""}${d} ${i}ms linear ${o}ms 1 both`,ae+=1,d}function pe(e,t){const n=(e.style.animation||"").split(", "),i=n.filter(t?e=>e.indexOf(t)<0:e=>-1===e.indexOf("__svelte")),o=n.length-i.length;o&&(e.style.animation=i.join(", "),ae-=o,ae||I((()=>{ae||(se.forEach((e=>{const{ownerNode:t}=e.stylesheet;t&&A(t)})),se.clear())})))}function fe(e,t,n,i){if(!t)return a;const o=e.getBoundingClientRect();if(t.left===o.left&&t.right===o.right&&t.top===o.top&&t.bottom===o.bottom)return a;const{delay:l=0,duration:s=300,easing:r=c,start:u=D()+l,end:d=u+s,tick:p=a,css:f}=n(e,{from:t,to:o},i);let m,v=!0,h=!1;function b(){f&&pe(e,m),v=!1}return T((e=>{if(!h&&e>=u&&(h=!0),h&&e>=d&&(p(1,0),b()),!v)return!1;if(h){const t=0+1*r((e-u)/s);p(t,1-t)}return!0})),f&&(m=de(e,0,1,s,l,r,f)),l||(h=!0),p(0,1),b}function me(e){const t=getComputedStyle(e);if("absolute"!==t.position&&"fixed"!==t.position){const{width:n,height:i}=t,o=e.getBoundingClientRect();e.style.position="absolute",e.style.width=n,e.style.height=i,ve(e,o)}}function ve(e,t){const n=e.getBoundingClientRect();if(t.left!==n.left||t.top!==n.top){const i=getComputedStyle(e),o="none"===i.transform?"":i.transform;e.style.transform=`${o} translate(${t.left-n.left}px, ${t.top-n.top}px)`}}function he(e){re=e}function be(){if(!re)throw new Error("Function called outside component initialization");return re}function ge(e){be().$$.on_mount.push(e)}function ye(){const e=be();return(t,n,{cancelable:i=!1}={})=>{const o=e.$$.callbacks[t];if(o){const l=oe(t,n,{cancelable:i});return o.slice().forEach((t=>{t.call(e,l)})),!l.defaultPrevented}return!0}}function $e(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e.call(this,t)))}const xe=[],we=[];let ke=[];const ze=[],Ee=Promise.resolve();let Re=!1;function _e(){Re||(Re=!0,Ee.then(Ce))}function De(){return _e(),Ee}function Ie(e){ke.push(e)}function Le(e){ze.push(e)}const Oe=new Set;let Te,Ne=0;function Ce(){if(0!==Ne)return;const e=re;do{try{for(;Ne<xe.length;){const e=xe[Ne];Ne++,he(e),Se(e.$$)}}catch(e){throw xe.length=0,Ne=0,e}for(he(null),xe.length=0,Ne=0;we.length;)we.pop()();for(let e=0;e<ke.length;e+=1){const t=ke[e];Oe.has(t)||(Oe.add(t),t())}ke.length=0}while(xe.length);for(;ze.length;)ze.pop()();Re=!1,Oe.clear(),he(e)}function Se(e){if(null!==e.fragment){e.update(),f(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Ie)}}function Be(e){const t=[],n=[];ke.forEach((i=>-1===e.indexOf(i)?t.push(i):n.push(i))),n.forEach((e=>e())),ke=t}function je(){return Te||(Te=Promise.resolve(),Te.then((()=>{Te=null}))),Te}function He(e,t,n){e.dispatchEvent(oe(`${t?"intro":"outro"}${n}`))}const Ae=new Set;let qe;function Pe(){qe={r:0,c:[],p:qe}}function Ve(){qe.r||f(qe.c),qe=qe.p}function We(e,t){e&&e.i&&(Ae.delete(e),e.i(t))}function Me(e,t,n,i){if(e&&e.o){if(Ae.has(e))return;Ae.add(e),qe.c.push((()=>{Ae.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}else i&&i()}const Fe={duration:0};function Ge(e,t,n){const i={direction:"in"};let o,l,s=t(e,n,i),r=!1,u=0;function d(){o&&pe(e,o)}function p(){const{delay:t=0,duration:n=300,easing:i=c,tick:p=a,css:f}=s||Fe;f&&(o=de(e,0,1,n,t,i,f,u++)),p(0,1);const m=D()+t,v=m+n;l&&l.abort(),r=!0,Ie((()=>He(e,!0,"start"))),l=T((t=>{if(r){if(t>=v)return p(1,0),He(e,!0,"end"),d(),r=!1;if(t>=m){const e=i((t-m)/n);p(e,1-e)}}return r}))}let f=!1;return{start(){f||(f=!0,pe(e),m(s)?(s=s(i),je().then(p)):p())},invalidate(){f=!1},end(){r&&(d(),r=!1)}}}function Je(e,t,n){const i={direction:"out"};let o,l=t(e,n,i),s=!0;const r=qe;let u;function d(){const{delay:t=0,duration:n=300,easing:i=c,tick:d=a,css:p}=l||Fe;p&&(o=de(e,1,0,n,t,i,p));const m=D()+t,v=m+n;Ie((()=>He(e,!1,"start"))),"inert"in e&&(u=e.inert,e.inert=!0),T((t=>{if(s){if(t>=v)return d(0,1),He(e,!1,"end"),--r.r||f(r.c),!1;if(t>=m){const e=i((t-m)/n);d(1-e,e)}}return s}))}return r.r+=1,m(l)?je().then((()=>{l=l(i),d()})):d(),{end(t){t&&"inert"in e&&(e.inert=u),t&&l.tick&&l.tick(1,0),s&&(o&&pe(e,o),s=!1)}}}function Ue(e){return void 0!==e?.length?e:Array.from(e)}function Xe(e,t){e.d(1),t.delete(e.key)}function Ye(e,t){Me(e,1,1,(()=>{t.delete(e.key)}))}function Ke(e,t){e.f(),Ye(e,t)}function Qe(e,t,n,i,o,l,s,r,a,c,u,d){let p=e.length,m=l.length,v=p;const h={};for(;v--;)h[e[v].key]=v;const b=[],g=new Map,y=new Map,$=[];for(v=m;v--;){const e=d(o,l,v),i=n(e);let r=s.get(i);r?$.push((()=>r.p(e,t))):(r=c(i,e),r.c()),g.set(i,b[v]=r),i in h&&y.set(i,Math.abs(v-h[i]))}const x=new Set,w=new Set;function k(e){We(e,1),e.m(r,u),s.set(e.key,e),u=e.first,m--}for(;p&&m;){const t=b[m-1],n=e[p-1],i=t.key,o=n.key;t===n?(u=t.first,p--,m--):g.has(o)?!s.has(i)||x.has(i)?k(t):w.has(o)?p--:y.get(i)>y.get(o)?(w.add(i),k(t)):(x.add(o),p--):(a(n,s),p--)}for(;p--;){const t=e[p];g.has(t.key)||a(t,s)}for(;m;)k(b[m-1]);return f($),b}function Ze(e,t,n){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function et(e){e&&e.c()}function tt(e,t,n){const{fragment:i,after_update:o}=e.$$;i&&i.m(t,n),Ie((()=>{const t=e.$$.on_mount.map(d).filter(m);e.$$.on_destroy?e.$$.on_destroy.push(...t):f(t),e.$$.on_mount=[]})),o.forEach(Ie)}function nt(e,t){const n=e.$$;null!==n.fragment&&(Be(n.after_update),f(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function it(e,t){-1===e.$$.dirty[0]&&(xe.push(e),_e(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function ot(e,t,n,i,o,l,s=null,r=[-1]){const c=re;he(e);const u=e.$$={fragment:null,ctx:[],props:l,update:a,not_equal:o,bound:p(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:p(),dirty:r,skip_bound:!1,root:t.target||c.$$.root};s&&s(u.root);let d=!1;if(u.ctx=n?n(e,t.props||{},((t,n,...i)=>{const l=i.length?i[0]:n;return u.ctx&&o(u.ctx[t],u.ctx[t]=l)&&(!u.skip_bound&&u.bound[t]&&u.bound[t](l),d&&it(e,t)),n})):[],u.update(),d=!0,f(u.before_update),u.fragment=!!i&&i(u.ctx),t.target){if(t.hydrate){const e=K(t.target);u.fragment&&u.fragment.l(e),e.forEach(A)}else u.fragment&&u.fragment.c();t.intro&&We(e.$$.fragment),tt(e,t.target,t.anchor),Ce()}he(c)}class lt{$$=void 0;$$set=void 0;$destroy(){nt(this,1),this.$destroy=a}$on(e,t){if(!m(t))return a;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const st="4";var actions,hasRequiredActions;function rt(){if(hasRequiredActions)return actions;hasRequiredActions=1;const e=function(){const e=RED.view.selection().nodes;if(!e||1!==e.length)return void RED.notify("Select exactly one single node to rename it.",{type:"warn"});const t=e[0];if("string"!=typeof t.name&&void 0===t._def.defaults.name)return void RED.notify("This node has no name attribute and thus cannot be renamed.",{type:"warn"});const n=e=>{const n=t.name,o=document.getElementById("renameDialogNameInputField").value;n!==o?(t.name=o,t.dirty=!0,t.resize=!0,RED.history.push({t:"edit",node:t,changed:t.changed,changes:{name:n},dirty:RED.nodes.dirty()}),t.changed=!0,RED.nodes.dirty(!0),RED.events.emit("nodes:change",t),RED.view.redraw(),RED.keyboard.remove("escape"),RED.keyboard.remove("enter"),i.close(),RED.view.focus()):i.close()},i=RED.notify(`<p>Set node name</p>\n <p>\n <div class='form-row'>\n <label for='renameDialogNameInputField'>New name</label>\n <input type='text' id='renameDialogNameInputField' value='${e[0].name||""}'>\n </div>\n </p>`,{modal:!0,fixed:!0,buttons:[{text:"Cancel",click:function(e){RED.keyboard.remove("escape"),RED.keyboard.remove("enter"),i.close()}},{text:"Rename",class:"primary",click:n}]});RED.keyboard.add("*","escape",(function(){RED.keyboard.remove("escape"),RED.keyboard.remove("enter"),i.close()})),RED.keyboard.add("*","enter",(function(){n()})),document.getElementById("renameDialogNameInputField").select(),setTimeout((()=>document.getElementById("renameDialogNameInputField").focus()),100)};RED.keyboard.add("red-ui-workspace","ctrl-shift-e","do:rename-node");const t=function(){const e=RED.view.selection().nodes;if(!e||1!==e.length)return void RED.notify("Select exactly one single node to rename it.",{type:"warn"});const t=e[0],n=window.$("#"+t.id.replace(".","\\.")).offset();RED.typeSearch.show({x:n.left,y:n.top,filter:{input:t.inputs>0},add:e=>{const n=[],i={type:e,id:RED.nodes.id(),x:t.x,y:t.y,z:t.z,_def:RED.nodes.getType(e),w:t.w,resize:!0,changed:!0,moved:!0,_do_red:"replace node"};i.inputs=i._def.inputs||0,i.outputs=i._def.outputs,i.h=Math.max(100,15*(i.outputs||0));for(const e in i._def.defaults)i._def.defaults?.[e]&&void 0!==i._def.defaults[e].value&&(i[e]=JSON.parse(JSON.stringify(i._def.defaults[e].value)));for(const e in i._def.defaults)i?.[e]&&t?.[e]&&typeof t[e]==typeof i[e]&&(i[e]=t[e]);if(void 0!==t.info&&(i.info=t.info),void 0!==t.l&&(i.l=t.l),void 0!==t.inputLabels){i.inputLabels=[];for(let e=0;e<i.inputs;e++)t.inputLabels.length>e&&(i.inputLabels[e]=t.inputLabels[e])}if(void 0!==t.outputLabels){i.outputLabels=[];for(let e=0;e<i.outputs;e++)t.outputLabels.length>e&&(i.outputLabels[e]=t.outputLabels[e])}if(i._def.onadd)try{i._def.onadd.call(i)}catch(e){console.log("Definition error: "+i.type+".onadd:",e)}i.name=t.name,RED.nodes.add(i),n.push({t:"add",nodes:[i.id]});const o=RED.nodes.filterLinks({target:t}),l=RED.nodes.filterLinks({source:t});n.push({t:"delete",links:[...o,...l]}),o.forEach((e=>{const t={source:e.source,sourcePort:e.sourcePort,target:RED.nodes.node(i.id),x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2};RED.nodes.addLink(t),n.push({t:"add",links:[t]})})),l.forEach((e=>{if(e.sourcePort<=i.outputs){const t={source:i,sourcePort:e.sourcePort,target:e.target,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2};RED.nodes.addLink(t),n.push({t:"add",links:[t]})}})),RED.editor.validateNode(i),RED.nodes.remove(t.id),n.push({t:"delete",nodes:[t]}),RED.history.push({t:"multi",events:n,dirty:RED.nodes.dirty()}),RED.nodes.dirty(!0),RED.view.updateActive(),RED.view.redraw(!0),RED.view.select(i.id)},cancel:e=>{},move:e=>{}})};RED.keyboard.add("red-ui-workspace","ctrl-shift-r","do:replace-node-with");const n=function(){const t=RED.view.selection().nodes;if(!t||1!==t.length)return void RED.notify("Select exactly one single node to which a do-node should be appended.",{type:"warn"});const n=t[0];if(0===n.outputs)return;const i=RED.nodes.getType("do"),o={type:"do",id:RED.nodes.id(),x:n.x+n.w+4*RED.view.gridSize(),y:n.y,z:n.z,_def:i,w:n.w,resize:!0,changed:!0,moved:!0,valid:!0,inputs:i.inputs||0,outputs:i.outputs,h:Math.max(100,15*(i.outputs||0)),_do_red:"append node"};for(const e in o._def.defaults)void 0!==o._def.defaults[e].value&&(o[e]=JSON.parse(JSON.stringify(o._def.defaults[e].value)));o._version=i.set.version,RED.nodes.add(o);const l=[...Array(n.outputs).keys()],s=RED.nodes.filterLinks({source:n}),a=[];s.forEach((e=>{const t=e.sourcePort;a.includes(t)||a.push(t)}));const d=l.filter((e=>!a.includes(e))),p={source:n,sourcePort:d.length>0?d[0]:0,target:RED.nodes.node(o.id)};RED.nodes.addLink(p),RED.history.push({t:"add",nodes:[o.id],links:[p],dirty:RED.nodes.dirty()}),RED.nodes.dirty(!0),RED.view.updateActive(),RED.view.redraw(),RED.view.select(o.id),r===n.id&&(c=[...c.slice(0,u+1),o.id],r=o.id,u=c.length),e()};RED.keyboard.add("red-ui-workspace","ctrl-shift-a","do:append-do-node");const i="left",o="right",l="up",s="down";let r,a=!0,c=[],u=0;const d=(e,t)=>{const n=e.sourcePort-t.sourcePort;return 0!==n?n:e.y2-t.y2},p=function(e){const t=RED.view.selection().nodes;if(!t||1!==t.length)return;const n=t[0];r!==n.id&&(r=n.id,c=[r],u=0);const p=RED.nodes.filterLinks({target:n}),f=RED.nodes.filterLinks({source:n});if(e===i){let e;if(a=!1,0===u){const t=p.sort(((e,t)=>e.y1-t.y1));if(0===t.length)return;e=t[0].source.id,c=[e,...c]}else u-=1,e=c[u];RED.view.select(e),r=e}else if(e===o){let e;if(a=!0,u===c.length-1){const t=f.sort(d);if(0===t.length)return;e=t[0].target.id,c=[...c,e]}else e=c[u+1];u+=1,RED.view.select(e),r=e}else if(e===l)if(a){if(0===u){const e=p.sort(((e,t)=>e.y1-t.y1));if(0===e.length)return;const t=e[0].source.id;c=[t,...c],u=1}const e=c[u-1];RED.view.reveal(e);const t=RED.nodes.filterLinks({source:RED.nodes.node(e)}).sort(d);for(let e=0;e<t.length;e++)if(t[e].target===n){let n=t[e].target.id;return e>0&&(n=t[e-1].target.id),c[u]=n,RED.view.select(n),r=n,void(c=c.slice(0,u+1))}RED.view.select(c[u])}else{if(u===c.length-1){const e=f.sort(d);if(0===e.length)return;const t=e[0].source.id;c=[...c,t],u+=1}const e=c[u+1];RED.view.reveal(e);const t=RED.nodes.filterLinks({target:RED.nodes.node(e)}).sort(((e,t)=>e.y1-t.y1));for(let e=0;e<t.length;e++)if(t[e].source===n){let n=t[e].source.id;return e>0&&(n=t[e-1].source.id),c[u]=n,RED.view.select(n),r=n,c=c.slice(u),void(u=0)}RED.view.select(c[u])}else if(e===s)if(a){if(0===u){const e=p.sort(((e,t)=>e.y1-t.y1));if(0===e.length)return;const t=e[0].source.id;c=[t,...c],u=1}const e=c[u-1];RED.view.reveal(e);const t=RED.nodes.filterLinks({source:RED.nodes.node(e)}).sort(d);for(let e=0;e<t.length;e++)if(t[e].target===n){let n=t[e].target.id;return t.length>e+1&&(n=t[e+1].target.id),c[u]=n,RED.view.select(n),r=n,void(c=c.slice(0,u+1))}RED.view.select(c[u])}else{if(u===c.length-1){const e=f.sort(d);if(0===e.length)return;const t=e[0].source.id;c=[...c,t],u+=1}const e=c[u+1];RED.view.reveal(e);const t=RED.nodes.filterLinks({target:RED.nodes.node(e)}).sort(((e,t)=>e.y1-t.y1));for(let e=0;e<t.length;e++)if(t[e].source===n){let n=t[e].source.id;return t.length>e+1&&(n=t[e+1].source.id),c[u]=n,RED.view.select(n),r=n,c=c.slice(u),void(u=0)}RED.view.select(c[u])}};return actions={rename:()=>RED.actions.add("do:rename-node",e),replace:()=>RED.actions.add("do:replace-node-with",t),appendNode:()=>RED.actions.add("do:append-do-node",n),moveCursor:()=>{RED.actions.add("do:move-cursor-left",(()=>p(i))),RED.actions.add("do:move-cursor-right",(()=>p(o))),RED.actions.add("do:move-cursor-up",(()=>p(l))),RED.actions.add("do:move-cursor-down",(()=>p(s))),RED.keyboard.add("red-ui-workspace","ctrl-shift-left","do:move-cursor-left"),RED.keyboard.add("red-ui-workspace","ctrl-shift-right","do:move-cursor-right"),RED.keyboard.add("red-ui-workspace","ctrl-shift-up","do:move-cursor-up"),RED.keyboard.add("red-ui-workspace","ctrl-shift-down","do:move-cursor-down")}}}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add(st);var actionsExports=rt();const at=e=>"boolean"==typeof e?e:"true"===e?.toString()?.toLowerCase()||!!e,ct=(e=null)=>{let t=e;return t||(t=(Date.now()+Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)).toString()),t},ut=e=>{let t=800;return"number"==typeof e||"string"==typeof e&&"true"!==e&&"false"!==e?t=Number(e):(e=at(e))||(t=0),t},dt=(e,t,n)=>e.updateNode&&void 0!==t?t:void 0!==n?n:"",pt=(e,t)=>{const n={init:!0,isError:!1,updateNode:void 0!==e,valueHasChanged:!1};return n.value=dt(n,e?.value,t),n.oldValue=n.value,n},ft=(e,t,n,i,o,l)=>{if(n.valueHasChanged=n.updateNode?e!==n.value:n.value!==t,n.valueHasChanged&&(n.value===n.oldValue&&(n.value=dt(n,e,t)),n.oldValue=n.value),i){const e=i.call(l,n.value);n.error="string"==typeof e?e:!e}else n.error=o;return n};function mt(e){const t=e-1;return t*t*t+1}function vt(e){return--e*e*e*e*e+1}function ht(e,{delay:t=0,duration:n=400,easing:i=c}={}){const o=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:i,css:e=>"opacity: "+e*o}}function bt(e,{delay:t=0,duration:n=400,easing:i=mt,axis:o="y"}={}){const l=getComputedStyle(e),s=+l.opacity,r="y"===o?"height":"width",a=parseFloat(l[r]),c="y"===o?["top","bottom"]:["left","right"],u=c.map((e=>`${e[0].toUpperCase()}${e.slice(1)}`)),d=parseFloat(l[`padding${u[0]}`]),p=parseFloat(l[`padding${u[1]}`]),f=parseFloat(l[`margin${u[0]}`]),m=parseFloat(l[`margin${u[1]}`]),v=parseFloat(l[`border${u[0]}Width`]),h=parseFloat(l[`border${u[1]}Width`]);return{delay:t,duration:n,easing:i,css:e=>`overflow: hidden;opacity: ${Math.min(20*e,1)*s};${r}: ${e*a}px;padding-${c[0]}: ${e*d}px;padding-${c[1]}: ${e*p}px;margin-${c[0]}: ${e*f}px;margin-${c[1]}: ${e*m}px;border-${c[0]}-width: ${e*v}px;border-${c[1]}-width: ${e*h}px;`}}function gt(e){C(e,"svelte-14o5nyg",".sir-Tooltip.svelte-14o5nyg{display:block;height:auto;position:fixed;z-index:1000;cursor:default}.sir-Tooltip.red-ui-popover-bottom.svelte-14o5nyg{margin-top:12px}.red-ui-editableList-container .sir-Tooltip .red-ui-popover-content li{background:var(--red-ui-popover-background);border-bottom:0;margin-bottom:6px}.sir-Tooltip p:last-child{margin-bottom:0px}.sir-Tooltip-icon.svelte-14o5nyg{margin-left:3px;cursor:help}.sir-Tooltip-icon.sir-Tooltip-clickable.svelte-14o5nyg{cursor:pointer\n }.sir-Tooltip-clickable.svelte-14o5nyg:hover{color:var(--red-ui-secondary-text-color)}.sir-Tooltip a{color:var(--red-ui-text-color-link) !important}.sir-Tooltip a:hover{text-decoration:underline}.sir-Tooltip .red-ui-popover-content{max-height:60vh;max-width:60vw;overflow:auto}.sir-Tooltip.red-ui-popover .red-ui-popover-content :is(pre, pre code){color:var(--red-ui-tertiary-text-color)}")}function yt(e){let t,n,i,o,l,s,r,a;return{c(){t=P("div"),n=P("div"),X(n,"class","red-ui-popover-content"),X(t,"id",i=e[1]+"_sir-Tooltip"),X(t,"role","tooltip"),X(t,"class",E(e[10])+" svelte-14o5nyg")},m(i,o){H(i,t,o),N(t,n),n.innerHTML=e[0],e[17](t),s=!0,r||(a=[F(t,"click",J(e[7])),F(t,"click",J(e[14])),F(t,"keypress",e[15]),F(t,"mouseenter",U(e[8])),F(t,"mouseleave",U(e[9]))],r=!0)},p(o,l){e=o,(!s||1&l)&&(n.innerHTML=e[0]),(!s||2&l&&i!==(i=e[1]+"_sir-Tooltip"))&&X(t,"id",i)},i(n){s||(n&&Ie((()=>{s&&(l&&l.end(1),o=Ge(t,ht,{delay:e[5].delay.show,duration:500}),o.start())})),s=!0)},o(n){o&&o.invalidate(),n&&(l=Je(t,ht,{delay:e[5].delay.hide,duration:500})),s=!1},d(n){n&&A(t),e[17](null),n&&l&&l.end(),r=!1,f(a)}}}function $t(e){let t,n,i,o,l,s=e[4]&&xt(e);return{c(){t=P("i"),s&&s.c(),X(t,"id",n=e[1]+"_sir-Tooltip-icon"),X(t,"class",i="fa fa-"+e[3].icon+" sir-Tooltip-icon svelte-14o5nyg"),X(t,"role","button"),X(t,"tabindex","-1"),ie(t,"sir-Tooltip-clickable","click"===e[5].trigger)},m(n,i){H(n,t,i),s&&s.m(t,null),o||(l=[F(t,"click",U(J(G(e[6])))),F(t,"keypress",U(J(G(e[6])))),F(t,"mouseenter",U(e[8])),F(t,"mouseleave",U(e[9]))],o=!0)},p(e,o){e[4]?s?(s.p(e,o),16&o&&We(s,1)):(s=xt(e),s.c(),We(s,1),s.m(t,null)):s&&(Pe(),Me(s,1,1,(()=>{s=null})),Ve()),2&o&&n!==(n=e[1]+"_sir-Tooltip-icon")&&X(t,"id",n),8&o&&i!==(i="fa fa-"+e[3].icon+" sir-Tooltip-icon svelte-14o5nyg")&&X(t,"class",i),40&o&&ie(t,"sir-Tooltip-clickable","click"===e[5].trigger)},i(e){We(s)},o(e){Me(s)},d(e){e&&A(t),s&&s.d(),o=!1,f(l)}}}function xt(e){let t,n,i,o,l,s,r,a;return{c(){t=P("div"),n=P("div"),X(n,"class","red-ui-popover-content"),X(t,"id",i=e[1]+"_sir-Tooltip"),X(t,"role","tooltip"),X(t,"class",E(e[10])+" svelte-14o5nyg")},m(i,o){H(i,t,o),N(t,n),n.innerHTML=e[0],e[16](t),s=!0,r||(a=[F(t,"click",J(e[7])),F(t,"click",J(e[12])),F(t,"keypress",e[13]),F(t,"mouseenter",U(e[8])),F(t,"mouseleave",U(e[9]))],r=!0)},p(o,l){e=o,(!s||1&l)&&(n.innerHTML=e[0]),(!s||2&l&&i!==(i=e[1]+"_sir-Tooltip"))&&X(t,"id",i)},i(n){s||(n&&Ie((()=>{s&&(l&&l.end(1),o=Ge(t,ht,{delay:e[5].delay.show,duration:500}),o.start())})),s=!0)},o(n){o&&o.invalidate(),n&&(l=Je(t,ht,{delay:e[5].delay.hide,duration:500})),s=!1},d(n){n&&A(t),e[16](null),n&&l&&l.end(),r=!1,f(a)}}}function wt(e){let t,n,i;const o=[$t,yt],l=[];function s(e,t){return e[3].icon?0:e[4]?1:-1}return~(t=s(e))&&(n=l[t]=o[t](e)),{c(){n&&n.c(),i=M()},m(e,n){~t&&l[t].m(e,n),H(e,i,n)},p(e,[r]){let a=t;t=s(e),t===a?~t&&l[t].p(e,r):(n&&(Pe(),Me(l[a],1,1,(()=>{l[a]=null})),Ve()),~t?(n=l[t],n?n.p(e,r):(n=l[t]=o[t](e),n.c()),We(n,1),n.m(i.parentNode,i)):n=null)},i(e){We(n)},o(e){Me(n)},d(e){e&&A(i),~t&&l[t].d(e)}}}function kt(e,t,n){let{id:i,ref:o,tooltip:l="",tooltipOptions:s={}}=t;i=i||ct();const r=async()=>{const e=document.getElementById(m.target)?.getBoundingClientRect();if(!e)return;m.width,m.maxWidth,await De();const t=document.getElementById(i+"_sir-Tooltip");if(!t)return;const n=t.getBoundingClientRect();let o,l;switch(m.direction){case"right":o=e.right+11+m.offset,l=e.top+e.height/2-n.height/2;break;case"left":o=e.left-n.width-11-m.offset,l=e.top+e.height/2-n.height/2;break;case"top":o=e.left+e.width/2-n.width/2-m.offset,l=e.top-n.height-11;break;case"bottom":o=e.left+e.width/2-n.width/2,l=e.bottom+m.offset}const s=l>0?l:0;t.style.left=o+"px",t.style.top=(l<0?l:s)+"px"},a=()=>{"click"===m.trigger&&(g?p():(document.removeEventListener("click",c),document.addEventListener("click",c),n(4,g=!0)))},c=e=>{e.target?.closest(".sir-Tooltip")||p()},u=()=>{b&&(clearTimeout(b),b=null),"hover"!==m.trigger||g||h||(h=setTimeout((()=>{n(4,g=!0),m.autoClose&&(v=setTimeout((()=>p()),m.autoClose))}),m.delay.show))},d=()=>{"hover"===m.trigger&&(b=setTimeout((()=>{clearTimeout(h),h=null,p(),v&&(clearTimeout(v),v=null)}),m.delay.hide))},p=()=>{n(4,g=!1),document.removeEventListener("click",c)},f=()=>{!1!==s.openLinkInNewTab&&n(0,l=l.replaceAll('<a href="','<a target="_blank" "rel"="noopener noreferrer" href="'))},m={target:s.target||i+"_sir-Tooltip-icon",direction:s.direction||"right",trigger:s.trigger||"hover",delay:s.delay||"click"===s.trigger?{show:150,hide:150}:{show:500,hide:150},autoClose:Number(s.autoClose)||0,width:s.width||"auto",maxWidth:s.maxWidth||"700px",size:s.size||"default",offset:Number(s.offset)||0,closeOnClick:!1!==s?.closeOnClick,class:s.class||"",interactive:!1!==s.interactive};let v,h,b,g=!!s.show,y=`red-ui-popover sir-Tooltip red-ui-popover-${m.direction} red-ui-popover-size-${m.size} ${m.class} `,$="";return l=RED.utils.renderMarkdown(RED.utils.sanitize(l)),f(),$=l,m.target.startsWith("#")&&(m.target=m.target.substring(1)),ge((()=>{let e;if(!s.icon){let t=0;e=setInterval((function(){const n=document.getElementById(m.target);n?(clearInterval(e),"click"===m.trigger?(n.addEventListener("click",a),n.addEventListener("keypress",a)):"hover"===m.trigger&&(n.addEventListener("mouseenter",u),n.addEventListener("mouseleave",d),n.matches(":hover")&&u())):t>20?(clearInterval(e),console.log("[Sir] No target for tooltip found ("+m.target+").")):t++}),100)}return document.querySelector("body").addEventListener("wheel",p),()=>{try{clearInterval(e)}catch(e){}}})),e.$$set=e=>{"id"in e&&n(1,i=e.id),"ref"in e&&n(2,o=e.ref),"tooltip"in e&&n(0,l=e.tooltip),"tooltipOptions"in e&&n(3,s=e.tooltipOptions)},e.$$.update=()=>{if(2065&e.$$.dirty)if(g&&l){if($!==l&&(n(0,l=RED.utils.renderMarkdown(RED.utils.sanitize(l))),f(),n(11,$=l)),r(),!document.getElementById("_temp_sir_Tooltip_Style_")){const e=document.createElement("style");e.id="_temp_sir_Tooltip_Style_",e.innerText="body > .red-ui-popover { display: none !important; }",document.head.appendChild(e)}}else document.getElementById("_temp_sir_Tooltip_Style_")?.remove()},[l,i,o,s,g,m,a,e=>{m.closeOnClick&&p()},u,d,y,$,function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(e){we[e?"unshift":"push"]((()=>{o=e,n(2,o)}))},function(e){we[e?"unshift":"push"]((()=>{o=e,n(2,o)}))}]}class zt extends lt{constructor(e){super(),ot(this,e,kt,wt,v,{id:1,ref:2,tooltip:0,tooltipOptions:3},gt)}}function Et(e){C(e,"svelte-1cnbg1t","label.svelte-1cnbg1t.svelte-1cnbg1t.svelte-1cnbg1t{width:auto;min-width:130px;max-width:130px;margin-bottom:0px;margin-right:7px;display:flex;align-items:center;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}label.notClickable.svelte-1cnbg1t.svelte-1cnbg1t.svelte-1cnbg1t{cursor:initial}div:not(.sir-Input-checkbox)>label.svelte-1cnbg1t i.svelte-1cnbg1t.svelte-1cnbg1t{text-align:left;width:22px}label.svelte-1cnbg1t .sir-Label-icon-stack.svelte-1cnbg1t>i.sir-Label-stackedIcons.svelte-1cnbg1t{text-align:center}label.svelte-1cnbg1t .hasTooltip.svelte-1cnbg1t.svelte-1cnbg1t{color:var(--red-ui-secondary-text-color-disabled);margin-left:5px}label.svelte-1cnbg1t .hasTooltip.svelte-1cnbg1t.svelte-1cnbg1t:hover{color:var(--red-ui-secondary-text-color-hover)}.sir-Label-outer.hasStackIcons.svelte-1cnbg1t.svelte-1cnbg1t.svelte-1cnbg1t{padding-left:10px}.sir-Label-icon-stack.svelte-1cnbg1t.svelte-1cnbg1t.svelte-1cnbg1t{width:19px;height:19px;line-height:19px;padding-left:0px}.sir-Label-icon-stack .fa-stack-2x{font-size:19px}.sir-Label-icon-stack .fa-stack-1x{font-size:10px}.sir-Label-svg-icon.svelte-1cnbg1t.svelte-1cnbg1t.svelte-1cnbg1t{width:26px;height:19px;background-color:var(--red-ui-primary-text-color);mask-size:contain;-webkit-mask-size:contain;mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;mask-position:center;-webkit-mask-position:center}label.sir-Label-maximize.svelte-1cnbg1t.svelte-1cnbg1t.svelte-1cnbg1t{width:-webkit-fill-available;width:-moz-available;width:stretch;max-width:100% !important}.sir-Input-checkbox label.sir-Label{padding-left:5px}.sir-Input-container .sir-Input-checkbox input{margin-top:0px}")}function Rt(e,t,n){const i=e.slice();return i[12]=t[n],i}function _t(e){let t,n;return{c(){t=P("i"),X(t,"class",n="fa "+e[1]+" fa-fw svelte-1cnbg1t")},m(e,n){H(e,t,n)},p(e,i){2&i&&n!==(n="fa "+e[1]+" fa-fw svelte-1cnbg1t")&&X(t,"class",n)},d(e){e&&A(t)}}}function Dt(e){let t,n,i;return{c(){t=P("div"),b(t.src,n=e[1])||X(t,"src",n),X(t,"class","sir-Label-svg-icon svelte-1cnbg1t"),X(t,"style",i=`mask-image: url(${e[1]}); -webkit-mask-image: url(${e[1]})`)},m(e,n){H(e,t,n)},p(e,o){2&o&&!b(t.src,n=e[1])&&X(t,"src",n),2&o&&i!==(i=`mask-image: url(${e[1]}); -webkit-mask-image: url(${e[1]})`)&&X(t,"style",i)},d(e){e&&A(t)}}}function It(e){let t,n=Ue(e[9]),i=[];for(let t=0;t<n.length;t+=1)i[t]=Lt(Rt(e,n,t));return{c(){t=P("span");for(let e=0;e<i.length;e+=1)i[e].c();X(t,"class","fa-stack fa fa-fw sir-Label-icon-stack svelte-1cnbg1t")},m(e,n){H(e,t,n);for(let e=0;e<i.length;e+=1)i[e]&&i[e].m(t,null)},p(e,o){if(512&o){let l;for(n=Ue(e[9]),l=0;l<n.length;l+=1){const s=Rt(e,n,l);i[l]?i[l].p(s,o):(i[l]=Lt(s),i[l].c(),i[l].m(t,null))}for(;l<i.length;l+=1)i[l].d(1);i.length=n.length}},d(e){e&&A(t),q(i,e)}}}function Lt(e){let t;return{c(){t=P("i"),X(t,"class","fa "+e[12]+" sir-Label-stackedIcons svelte-1cnbg1t")},m(e,n){H(e,t,n)},p:a,d(e){e&&A(t)}}}function Ot(e){let t,n;return t=new zt({props:{id:e[0],tooltip:e[8],tooltipOptions:e[2]}}),{c(){et(t.$$.fragment)},m(e,i){tt(t,e,i),n=!0},p(e,n){const i={};1&n&&(i.id=e[0]),256&n&&(i.tooltip=e[8]),4&n&&(i.tooltipOptions=e[2]),t.$set(i)},i(e){n||(We(t.$$.fragment,e),n=!0)},o(e){Me(t.$$.fragment,e),n=!1},d(e){nt(t,e)}}}function Tt(e){let t,n,i,o,l,s,r,a,c,u,d;function p(e,t){return 2&t&&(n=null),e[9].length?It:(null==n&&(n=!!e[1]?.endsWith(".svg")),n?Dt:e[1]?_t:void 0)}let m=p(e,-1),v=m&&m(e),h=e[8]&&Ot(e);return{c(){t=P("label"),v&&v.c(),i=W(),o=P("span"),l=P("span"),s=V(e[4]),r=W(),h&&h.c(),X(l,"class","sir-Label-text"),X(o,"class","sir-Label-outer svelte-1cnbg1t"),ie(o,"hasStackIcons",e[9].length),X(t,"id",e[0]),X(t,"for",e[5]),X(t,"class",a=E("sir-Label "+e[3])+" svelte-1cnbg1t"),ie(t,"notClickable",e[7]),ie(t,"sir-Label-maximize",e[6])},m(n,a){H(n,t,a),v&&v.m(t,null),N(t,i),N(t,o),N(o,l),N(l,s),N(o,r),h&&h.m(o,null),c=!0,u||(d=[F(t,"mouseenter",e[10]),F(t,"mouseleave",e[11])],u=!0)},p(e,[n]){m===(m=p(e,n))&&v?v.p(e,n):(v&&v.d(1),v=m&&m(e),v&&(v.c(),v.m(t,i))),(!c||16&n)&&Q(s,e[4]),e[8]?h?(h.p(e,n),256&n&&We(h,1)):(h=Ot(e),h.c(),We(h,1),h.m(o,null)):h&&(Pe(),Me(h,1,1,(()=>{h=null})),Ve()),(!c||1&n)&&X(t,"id",e[0]),(!c||32&n)&&X(t,"for",e[5]),(!c||8&n&&a!==(a=E("sir-Label "+e[3])+" svelte-1cnbg1t"))&&X(t,"class",a),(!c||136&n)&&ie(t,"notClickable",e[7]),(!c||72&n)&&ie(t,"sir-Label-maximize",e[6])},i(e){c||(We(h),c=!0)},o(e){Me(h),c=!1},d(e){e&&A(t),v&&v.d(),h&&h.d(),u=!1,f(d)}}}function Nt(e,t,n){let{clazz:i="",id:o,icon:l,label:s="",labelFor:r,maximize:a=!1,notClickable:c=!1,tooltip:u,tooltipOptions:d={}}=t;o&&!o.toString().endsWith("-Label")&&(o+="-Label"),d.icon||!1===d.icon||(d.icon="info-circle");const p=[];if(Array.isArray(l)){let e=l.length;l.forEach((t=>{t.startsWith("fa-")||p.push("fa-"+t.trim()+" fa-stack-"+e--+"x")}))}else!l||l.endsWith(".svg")||l.startsWith("fa-")?l?.endsWith(".svg")&&!l.includes("/")&&(l="icons/node-red/"+l):l="fa-"+l.trim();return e.$$set=e=>{"clazz"in e&&n(3,i=e.clazz),"id"in e&&n(0,o=e.id),"icon"in e&&n(1,l=e.icon),"label"in e&&n(4,s=e.label),"labelFor"in e&&n(5,r=e.labelFor),"maximize"in e&&n(6,a=e.maximize),"notClickable"in e&&n(7,c=e.notClickable),"tooltip"in e&&n(8,u=e.tooltip),"tooltipOptions"in e&&n(2,d=e.tooltipOptions)},[o,l,d,i,s,r,a,c,u,p,function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)}]}class Ct extends lt{constructor(e){super(),ot(this,e,Nt,Tt,v,{clazz:3,id:0,icon:1,label:4,labelFor:5,maximize:6,notClickable:7,tooltip:8,tooltipOptions:2},Et)}}function St(e){C(e,"svelte-1lgevmh",".sir-Row.svelte-1lgevmh{clear:both;margin-bottom:12px;display:flex;align-items:center;justify-content:flex-start}.sir-Row-maximize.svelte-1lgevmh{width:-webkit-fill-available;width:-moz-available;width:stretch}.sir-Row > *:not(:last-child){margin-right:7px}.sir-Row.inline button:not(:last-child){margin-right:3px}label.sir-Label.sir-Row-label{display:inline-block;min-width:105px;width:105px;margin-right:7px;align-items:center;margin-bottom:0px;overflow-wrap:break-word}i, .sir-Row{user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}")}function Bt(e){let t,n,i,o,l,s,r=e[3]&&Ht();const a=e[10].default,c=y(a,e,e[9],null);return{c(){t=P("div"),r&&r.c(),n=W(),c&&c.c(),X(t,"id",e[0]),X(t,"class",i=E(e[5])+" svelte-1lgevmh"),X(t,"style",e[6]),X(t,"role","row"),X(t,"tabindex","-1"),ie(t,"sir-Row",!e[1]),ie(t,"sir-Row-maximize",e[2])},m(i,a){H(i,t,a),r&&r.m(t,null),N(t,n),c&&c.m(t,null),e[24](t),o=!0,l||(s=[F(t,"click",e[17]),F(t,"keypress",e[18]),F(t,"keydown",e[19]),F(t,"dblclick",e[20]),F(t,"mouseenter",e[21]),F(t,"mouseleave",e[22])],l=!0)},p(e,l){e[3]?r?8&l&&We(r,1):(r=Ht(),r.c(),We(r,1),r.m(t,n)):r&&(Pe(),Me(r,1,1,(()=>{r=null})),Ve()),c&&c.p&&(!o||512&l)&&w(c,a,e,e[9],o?x(a,e[9],l,null):k(e[9]),null),(!o||1&l)&&X(t,"id",e[0]),(!o||32&l&&i!==(i=E(e[5])+" svelte-1lgevmh"))&&X(t,"class",i),(!o||64&l)&&X(t,"style",e[6]),(!o||34&l)&&ie(t,"sir-Row",!e[1]),(!o||36&l)&&ie(t,"sir-Row-maximize",e[2])},i(e){o||(We(r),We(c,e),o=!0)},o(e){Me(r),Me(c,e),o=!1},d(n){n&&A(t),r&&r.d(),c&&c.d(n),e[24](null),l=!1,f(s)}}}function jt(e){let t,n,i,o,l,s,r,a=e[3]&&At();const c=e[10].default,u=y(c,e,e[9],null);return{c(){t=P("div"),a&&a.c(),n=W(),u&&u.c(),X(t,"id",e[0]),X(t,"class",i=E(e[5])+" svelte-1lgevmh"),X(t,"style",e[6]),X(t,"role","row"),X(t,"tabindex","-1"),ie(t,"sir-Row",!e[1]),ie(t,"sir-Row-maximize",e[2])},m(i,o){H(i,t,o),a&&a.m(t,null),N(t,n),u&&u.m(t,null),e[23](t),l=!0,s||(r=[F(t,"click",e[11]),F(t,"keypress",e[12]),F(t,"keydown",e[13]),F(t,"dblclick",e[14]),F(t,"mouseenter",e[15]),F(t,"mouseleave",e[16])],s=!0)},p(o,s){(e=o)[3]?a?8&s&&We(a,1):(a=At(),a.c(),We(a,1),a.m(t,n)):a&&(Pe(),Me(a,1,1,(()=>{a=null})),Ve()),u&&u.p&&(!l||512&s)&&w(u,c,e,e[9],l?x(c,e[9],s,null):k(e[9]),null),(!l||1&s)&&X(t,"id",e[0]),(!l||32&s&&i!==(i=E(e[5])+" svelte-1lgevmh"))&&X(t,"class",i),(!l||64&s)&&X(t,"style",e[6]),(!l||34&s)&&ie(t,"sir-Row",!e[1]),(!l||36&s)&&ie(t,"sir-Row-maximize",e[2])},i(n){l||(We(a),We(u,n),n&&(o||Ie((()=>{o=Ge(t,ht,{duration:e[7]}),o.start()}))),l=!0)},o(e){Me(a),Me(u,e),l=!1},d(n){n&&A(t),a&&a.d(),u&&u.d(n),e[23](null),s=!1,f(r)}}}function Ht(e){let t,n;return t=new Ct({props:{clazz:"sir-Row-label"}}),{c(){et(t.$$.fragment)},m(e,i){tt(t,e,i),n=!0},i(e){n||(We(t.$$.fragment,e),n=!0)},o(e){Me(t.$$.fragment,e),n=!1},d(e){nt(t,e)}}}function At(e){let t,n;return t=new Ct({props:{clazz:"sir-Row-label"}}),{c(){et(t.$$.fragment)},m(e,i){tt(t,e,i),n=!0},i(e){n||(We(t.$$.fragment,e),n=!0)},o(e){Me(t.$$.fragment,e),n=!1},d(e){nt(t,e)}}}function qt(e){let t,n,i,o;const l=[jt,Bt],s=[];return t=function(e){return e[7]?0:1}(e),n=s[t]=l[t](e),{c(){n.c(),i=M()},m(e,n){s[t].m(e,n),H(e,i,n),o=!0},p(e,[t]){n.p(e,t)},i(e){o||(We(n),o=!0)},o(e){Me(n),o=!1},d(e){e&&A(i),s[t].d(e)}}}function Pt(e,t,n){let{$$slots:i={},$$scope:o}=t,{id:l,clazz:s="",style:r="",inline:a=!1,maximize:c=!1,indented:u=!1,fading:d=!0,ref:p}=t;l=l||ct(),l.toString().startsWith("sir-")||(l="sir-Row-"+l),a=at(a),c=at(c),u=at(u);const f=ut(d);return e.$$set=e=>{"id"in e&&n(0,l=e.id),"clazz"in e&&n(5,s=e.clazz),"style"in e&&n(6,r=e.style),"inline"in e&&n(1,a=e.inline),"maximize"in e&&n(2,c=e.maximize),"indented"in e&&n(3,u=e.indented),"fading"in e&&n(8,d=e.fading),"ref"in e&&n(4,p=e.ref),"$$scope"in e&&n(9,o=e.$$scope)},[l,a,c,u,p,s,r,f,d,o,i,function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(e){we[e?"unshift":"push"]((()=>{p=e,n(4,p)}))},function(e){we[e?"unshift":"push"]((()=>{p=e,n(4,p)}))}]}class Vt extends lt{constructor(e){super(),ot(this,e,Pt,qt,v,{id:0,clazz:5,style:6,inline:1,maximize:2,indented:3,fading:8,ref:4},St)}}localStorage.getItem("editor-language")||navigator.language;const Wt=(e,t={},n=!0,i)=>{let o=i;if(!1===n||"false"===n.toString().trim())return o;let l="";if("string"==typeof n)l=n;else if(t){l=t.type;let e=t?._def?.i18nOptions?.folder;e&&(e.endsWith("/")||(e+="/"),l=e+l)}if(l){l.endsWith(":")||(l+=":"),o=e._(l+i);const t=i.replaceAll(":",".");o!==l+i&&o!==l+t&&o!==t||(o=i)}return o};function Mt(e){C(e,"svelte-zzbj7f",".sir-Button.svelte-zzbj7f{width:fit-content}.minWidth.svelte-zzbj7f{min-width:33px}.red-ui-button-small.svelte-zzbj7f{min-width:21px}button.red-ui-button.sir-Button:not(.primary):not(.disabled):not(:disabled):hover{background:var(--red-ui-secondary-background-hover)}.maximize.svelte-zzbj7f{width:-webkit-fill-available;width:-moz-available;width:stretch}.sir-Button-container:has(button.sir-Button:disabled){cursor:not-allowed}button.svelte-zzbj7f:disabled{pointer-events:none;color:var(--red-ui-workspace-button-color-disabled)}")}function Ft(e){let t,n;return t=new zt({props:{tooltip:e[17],tooltipOptions:e[9]}}),{c(){et(t.$$.fragment)},m(e,i){tt(t,e,i),n=!0},p(e,n){const i={};131072&n&&(i.tooltip=e[17]),512&n&&(i.tooltipOptions=e[9]),t.$set(i)},i(e){n||(We(t.$$.fragment,e),n=!0)},o(e){Me(t.$$.fragment,e),n=!1},d(e){nt(t,e)}}}function Gt(e){let t,n;return t=new Ct({props:{label:e[13],notClickable:!0,maximize:e[6]}}),{c(){et(t.$$.fragment)},m(e,i){tt(t,e,i),n=!0},p(e,n){const i={};8192&n&&(i.label=e[13]),64&n&&(i.maximize=e[6]),t.$set(i)},i(e){n||(We(t.$$.fragment,e),n=!0)},o(e){Me(t.$$.fragment,e),n=!1},d(e){nt(t,e)}}}function Jt(e){let t,n;return{c(){t=P("i"),X(t,"class",n="fa fa-"+e[12]+" svelte-zzbj7f")},m(e,n){H(e,t,n)},p(e,i){4096&i&&n!==(n="fa fa-"+e[12]+" svelte-zzbj7f")&&X(t,"class",n)},d(e){e&&A(t)}}}function Ut(e){let t,n,i,o,l,s,r,a=(e[0]||"")+"",c=e[3]&&Gt(e),u=e[12]&&Jt(e);return{c(){c&&c.c(),t=W(),n=P("button"),u&&u.c(),i=W(),o=V(a),X(n,"id",e[2]),X(n,"style",e[16]),n.disabled=e[1],X(n,"type","button"),X(n,"class","red-ui-button sir-Button svelte-zzbj7f"),ie(n,"maximize",e[5]),ie(n,"selected",e[15]),ie(n,"red-ui-button-small",e[8]),ie(n,"primary",e[14]&&!e[1])},m(a,d){c&&c.m(a,d),H(a,t,d),H(a,n,d),u&&u.m(n,null),N(n,i),N(n,o),l=!0,s||(r=[F(n,"click",J(e[20])),F(n,"mousedown",J(e[21])),F(n,"mouseup",J(e[22])),F(n,"mouseenter",J(e[23])),F(n,"mouseleave",J(e[24]))],s=!0)},p(e,s){e[3]?c?(c.p(e,s),8&s&&We(c,1)):(c=Gt(e),c.c(),We(c,1),c.m(t.parentNode,t)):c&&(Pe(),Me(c,1,1,(()=>{c=null})),Ve()),e[12]?u?u.p(e,s):(u=Jt(e),u.c(),u.m(n,i)):u&&(u.d(1),u=null),(!l||1&s)&&a!==(a=(e[0]||"")+"")&&Q(o,a),(!l||4&s)&&X(n,"id",e[2]),(!l||65536&s)&&X(n,"style",e[16]),(!l||2&s)&&(n.disabled=e[1]),(!l||32&s)&&ie(n,"maximize",e[5]),(!l||32768&s)&&ie(n,"selected",e[15]),(!l||256&s)&&ie(n,"red-ui-button-small",e[8]),(!l||16386&s)&&ie(n,"primary",e[14]&&!e[1])},i(e){l||(We(c),l=!0)},o(e){Me(c),l=!1},d(e){e&&(A(t),A(n)),c&&c.d(e),u&&u.d(),s=!1,f(r)}}}function Xt(e){let t,n,i,o,l=e[17]&&Ft(e);function s(t){e[25](t)}let r={id:"sir-Button-container-"+e[2],clazz:e[10]+" sir-Button-container",inline:e[4],fading:e[11],$$slots:{default:[Ut]},$$scope:{ctx:e}};return void 0!==e[7]&&(r.ref=e[7]),n=new Vt({props:r}),we.push((()=>Ze(n,"ref",s))),{c(){l&&l.c(),t=W(),et(n.$$.fragment)},m(e,i){l&&l.m(e,i),H(e,t,i),tt(n,e,i),o=!0},p(e,[o]){e[17]?l?(l.p(e,o),131072&o&&We(l,1)):(l=Ft(e),l.c(),We(l,1),l.m(t.parentNode,t)):l&&(Pe(),Me(l,1,1,(()=>{l=null})),Ve());const s={};4&o&&(s.id="sir-Button-container-"+e[2]),1024&o&&(s.clazz=e[10]+" sir-Button-container"),16&o&&(s.inline=e[4]),2048&o&&(s.fading=e[11]),67236207&o&&(s.$$scope={dirty:o,ctx:e}),!i&&128&o&&(i=!0,s.ref=e[7],Le((()=>i=!1))),n.$set(s)},i(e){o||(We(l),We(n.$$.fragment,e),o=!0)},o(e){Me(l),Me(n.$$.fragment,e),o=!1},d(e){e&&A(t),l&&l.d(e),nt(n,e)}}}function Yt(e,t,n){let{clazz:i="",disabled:o=!1,fading:l=!0,i18n:s,icon:r,id:a,indented:c=!1,indentedLabel:u="",inline:d=!1,label:p,maximize:f=!1,maximizeLabel:m=!1,node:v,primary:h=!1,ref:b,selected:g=!1,small:y=!1,style:$="",tooltip:x="",tooltipOptions:w={}}=t;return y=at(y),o=at(o),f=at(f),m=at(m),d=at(d),c=at(c),a=a||ct(),p&&(p=Wt(RED,v,s,p)),w.icon=!1,w.target="sir-Button-container-"+a,e.$$set=e=>{"clazz"in e&&n(10,i=e.clazz),"disabled"in e&&n(1,o=e.disabled),"fading"in e&&n(11,l=e.fading),"i18n"in e&&n(18,s=e.i18n),"icon"in e&&n(12,r=e.icon),"id"in e&&n(2,a=e.id),"indented"in e&&n(3,c=e.indented),"indentedLabel"in e&&n(13,u=e.indentedLabel),"inline"in e&&n(4,d=e.inline),"label"in e&&n(0,p=e.label),"maximize"in e&&n(5,f=e.maximize),"maximizeLabel"in e&&n(6,m=e.maximizeLabel),"node"in e&&n(19,v=e.node),"primary"in e&&n(14,h=e.primary),"ref"in e&&n(7,b=e.ref),"selected"in e&&n(15,g=e.selected),"small"in e&&n(8,y=e.small),"style"in e&&n(16,$=e.style),"tooltip"in e&&n(17,x=e.tooltip),"tooltipOptions"in e&&n(9,w=e.tooltipOptions)},e.$$.update=()=>{786433&e.$$.dirty&&p&&n(0,p=Wt(RED,v,s,p))},[p,o,a,c,d,f,m,b,y,w,i,l,r,u,h,g,$,x,s,v,function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(e){b=e,n(7,b)}]}class Kt extends lt{constructor(e){super(),ot(this,e,Yt,Xt,v,{clazz:10,disabled:1,fading:11,i18n:18,icon:12,id:2,indented:3,indentedLabel:13,inline:4,label:0,maximize:5,maximizeLabel:6,node:19,primary:14,ref:7,selected:15,small:8,style:16,tooltip:17,tooltipOptions:9},Mt)}}function Qt(e){C(e,"svelte-1o55xza",".sir-ComponentHeader .sir-ComponentHeader-content label.sir-ComponentHeader-label{width:auto;max-width:100%}.sir-ComponentHeader.svelte-1o55xza{display:inline-flex;align-items:center;width:-webkit-fill-available;width:-moz-available;width:stretch;margin-bottom:6px;margin-right:0px}.sir-ComponentHeader-icon.svelte-1o55xza{margin-right:3px;margin-left:2px}.sir-ComponentHeader-content.svelte-1o55xza{display:inline-flex;align-items:center;justify-content:space-between;width:-webkit-fill-available;width:-moz-available;width:stretch}.sir-ComponentHeader-collapsible.svelte-1o55xza{padding-left:5px}.sir-ComponentHeader-mouse-pointer, .sir-ComponentHeader-mouse-pointer label.sir-ComponentHeader-label{cursor:pointer}")}const Zt=e=>({}),en=e=>({});function tn(e){let t;return{c(){t=P("i"),X(t,"class","fa fa-angle-right sir-ComponentHeader-mouse-pointer sir-ComponentHeader-icon svelte-1o55xza"),X(t,"style",e[5])},m(e,n){H(e,t,n)},p(e,n){32&n&&X(t,"style",e[5])},d(e){e&&A(t)}}}function nn(e){let t,n,i;function o(t){e[24](t)}let l={id:e[6],for:e[8],icon:e[4],label:e[7],tooltipOptions:e[2],maximize:e[9],clazz:"sir-ComponentHeader-label"};return void 0!==e[1]&&(l.tooltip=e[1]),t=new Ct({props:l}),we.push((()=>Ze(t,"tooltip",o))),{c(){et(t.$$.fragment)},m(e,n){tt(t,e,n),i=!0},p(e,i){const o={};64&i&&(o.id=e[6]),256&i&&(o.for=e[8]),16&i&&(o.icon=e[4]),128&i&&(o.label=e[7]),4&i&&(o.tooltipOptions=e[2]),512&i&&(o.maximize=e[9]),!n&&2&i&&(n=!0,o.tooltip=e[1],Le((()=>n=!1))),t.$set(o)},i(e){i||(We(t.$$.fragment,e),i=!0)},o(e){Me(t.$$.fragment,e),i=!1},d(e){nt(t,e)}}}function on(e){let t,n,i,o,l,s,r,a,c=e[10]&&tn(e),u=e[7]&&nn(e);const d=e[13].headerExtension,p=y(d,e,e[12],en);return{c(){t=P("div"),c&&c.c(),n=W(),i=P("div"),u&&u.c(),o=W(),p&&p.c(),X(i,"class","sir-ComponentHeader-content svelte-1o55xza"),ie(i,"sir-ComponentHeader-collapsible",e[10]),X(t,"class",l="sir-ComponentHeader "+e[3]+" svelte-1o55xza"),X(t,"style",e[0]),X(t,"role","presentation"),X(t,"aria-label","component header"),ie(t,"sir-ComponentHeader-mouse-pointer",e[10]&&!e[11])},m(l,d){H(l,t,d),c&&c.m(t,null),N(t,n),N(t,i),u&&u.m(i,null),N(i,o),p&&p.m(i,null),s=!0,r||(a=[F(t,"mouseenter",e[14]),F(t,"mouseleave",e[15]),F(t,"click",e[16]),F(t,"dblclick",e[17]),F(t,"keypress",e[18]),F(t,"keydown",e[19]),F(t,"dragenter",G(e[20])),F(t,"dragleave",G(e[21])),F(t,"drop",G(e[22])),F(t,"dragover",e[23])],r=!0)},p(e,[r]){e[10]?c?c.p(e,r):(c=tn(e),c.c(),c.m(t,n)):c&&(c.d(1),c=null),e[7]?u?(u.p(e,r),128&r&&We(u,1)):(u=nn(e),u.c(),We(u,1),u.m(i,o)):u&&(Pe(),Me(u,1,1,(()=>{u=null})),Ve()),p&&p.p&&(!s||4096&r)&&w(p,d,e,e[12],s?x(d,e[12],r,Zt):k(e[12]),en),(!s||1024&r)&&ie(i,"sir-ComponentHeader-collapsible",e[10]),(!s||8&r&&l!==(l="sir-ComponentHeader "+e[3]+" svelte-1o55xza"))&&X(t,"class",l),(!s||1&r)&&X(t,"style",e[0]),(!s||3080&r)&&ie(t,"sir-ComponentHeader-mouse-pointer",e[10]&&!e[11])},i(e){s||(We(u),We(p,e),s=!0)},o(e){Me(u),Me(p,e),s=!1},d(e){e&&A(t),c&&c.d(),u&&u.d(),p&&p.d(e),r=!1,f(a)}}}function ln(e,t,n){let{$$slots:i={},$$scope:o}=t,{clazz:l="",icon:s="",iconStyle:r="",id:a,label:c="",labelFor:u="",maximize:d=!1,style:p="",isCollapsible:f=!1,openOnlyOnIcon:m=!1,tooltip:v,tooltipOptions:h={}}=t;return f&&(p+=" margin-bottom: 0px;"),h.icon||!1===h.icon||(h.icon="info-circle"),e.$$set=e=>{"clazz"in e&&n(3,l=e.clazz),"icon"in e&&n(4,s=e.icon),"iconStyle"in e&&n(5,r=e.iconStyle),"id"in e&&n(6,a=e.id),"label"in e&&n(7,c=e.label),"labelFor"in e&&n(8,u=e.labelFor),"maximize"in e&&n(9,d=e.maximize),"style"in e&&n(0,p=e.style),"isCollapsible"in e&&n(10,f=e.isCollapsible),"openOnlyOnIcon"in e&&n(11,m=e.openOnlyOnIcon),"tooltip"in e&&n(1,v=e.tooltip),"tooltipOptions"in e&&n(2,h=e.tooltipOptions),"$$scope"in e&&n(12,o=e.$$scope)},[p,v,h,l,s,r,a,c,u,d,f,m,o,i,function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(t){$e.call(this,e,t)},function(e){v=e,n(1,v)}]}class sn extends lt{constructor(e){super(