"use strict";(self.webpackChunkdami=self.webpackChunkdami||[]).push([[5761],{5761:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(93150),i=a.n(n),s=a(31263);async function o({data:e,id:t}){const a=i().runtime.getURL("/params.html");let n=(await i().tabs.query({})).find((e=>e.url.includes(a)));if(n)await i().tabs.update(n.id,{active:!0}),await i().windows.update(n.windowId,{focused:!0});else{const{tabs:e}=await i().windows.create({type:"popup",width:480,height:600,url:i().runtime.getURL("/params.html")});[n]=e,await(0,s._v)(1e3)}const o=e.timeout||2e4;await i().tabs.sendMessage(n.id,{name:"workflow:params-block",data:{blockId:t,execId:this.engine.id,params:e.parameters,timeout:Date.now()+o,name:this.engine.workflow.name,icon:this.engine.workflow.icon,description:this.engine.workflow.description}});const r=await function({execId:e,blockId:t},a){return new Promise(((n,s)=>{let o=null;const r=`params-prompt:${e}__${t}`,d=e=>{if(!e[r])return;clearTimeout(o),i().storage.onChanged.removeListener(d);const{newValue:t}=e[r];t.$isError?s(new Error(t.message)):n(t)};o=setTimeout((()=>{i().storage.onChanged.removeListener(d),n({})}),a||1e4),i().storage.onChanged.addListener(d)}))}({blockId:t,execId:this.engine.id},o);return Object.entries(r).forEach((([e,t])=>{this.setVariable(e,t)})),{data:"",nextBlockId:this.getBlockConnections(t)}}}}]);