UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 2.47 kB
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`n8n@2.16.1`}}catch{}})();try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`a146c7c6-268e-463c-af5e-dbf07953139d`,e._sentryDebugIdIdentifier=`sentry-dbid-a146c7c6-268e-463c-af5e-dbf07953139d`)})()}catch{}import{n as e,r as t}from"./comlink-3h19_0W7.js";var n=new SharedWorker(new URL(`/%7B%7BBASE_PATH%7D%7D/assets/worker-BbnDp7F0.js`,``+import.meta.url),{type:`module`,name:`n8n-coordinator`});n.port.start();var r=new Worker(new URL(`/%7B%7BBASE_PATH%7D%7D/assets/worker-FLvH_Wit.js`,``+import.meta.url),{type:`module`,name:`n8n-data`}),i=t(n.port),a={tabId:null,isRegistered:!1};async function o(){if(a.isRegistered&&a.tabId)return a.tabId;console.log(`[Coordinator] Registering tab...`);let t=new MessageChannel;r.postMessage({type:`connect`,port:t.port1},[t.port1]);let n=await i.registerTab(e(t.port2,[t.port2]));return a.tabId=n,a.isRegistered=!0,console.log(`[Coordinator] Registered as tab: ${n}`),c(),n}function s(){a.tabId&&=(i.unregisterTab(a.tabId).catch(console.error),a.isRegistered=!1,null)}function c(){window.addEventListener(`beforeunload`,s),window.addEventListener(`pagehide`,s),window.addEventListener(`pageshow`,e=>{e.persisted&&!a.isRegistered&&(console.log(`[Coordinator] Page restored from bfcache, re-registering...`),o().catch(console.error))}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&!a.isRegistered&&(console.log(`[Coordinator] Page became visible, re-registering...`),o().catch(console.error))})}async function l(){await o()}async function u({version:e}){await l(),await i.initialize({version:e})}async function d(e){await l(),await i.exec(e)}async function f(e){return await l(),await i.query(e)}async function p(e,t){return await l(),await i.queryWithParams(e,t)}async function m(){return await i.isInitialized()}async function h(e){await l(),await i.loadNodeTypes(e)}async function g(e){await l(),await i.storeVersion(e)}async function _(){return await l(),await i.getStoredVersion()}export{d as exec,_ as getStoredVersion,u as initialize,m as isInitialized,h as loadNodeTypes,f as query,p as queryWithParams,g as storeVersion}; //# sourceMappingURL=workers-CvrSaN01.js.map