@nyaruka/temba-components 0.121.0 → 0.121.1

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.
package/CHANGELOG.md CHANGED
@@ -4,8 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v0.121.1](https://github.com/nyaruka/temba-components/compare/v0.121.0...v0.121.1)
8
+
9
+ - Don't update positions if they don't exist yet [`4278e31`](https://github.com/nyaruka/temba-components/commit/4278e31bc97faa361b19c40895fd819b00712e94)
10
+
7
11
  #### [v0.121.0](https://github.com/nyaruka/temba-components/compare/v0.120.8...v0.121.0)
8
12
 
13
+ > 3 May 2025
14
+
9
15
  - Add AppState using zustand and immer [`#496`](https://github.com/nyaruka/temba-components/pull/496)
10
16
  - Add immer [`48ed498`](https://github.com/nyaruka/temba-components/commit/48ed498de5acf1a3d20b724b75c09e8a1fad5d58)
11
17
 
@@ -386,7 +386,7 @@ let fr=Ks,vr=!1;const yr=["es","fr","pt"],br="data:image/png;base64,iVBORw0KGgoA
386
386
  -webkit-box-orient: vertical;
387
387
  overflow: hidden;
388
388
  }
389
- `,t([ce({type:Number})],xr.prototype,"scale",void 0),t([ce({type:Boolean})],xr.prototype,"showName",void 0),t([ce({type:Boolean})],xr.prototype,"system",void 0),t([ce({type:String,attribute:!1})],xr.prototype,"bgimage",void 0),t([ce({type:String,attribute:!1})],xr.prototype,"bgcolor",void 0),t([ce({type:String,attribute:!1})],xr.prototype,"initials",void 0),t([ce({type:String})],xr.prototype,"name",void 0),t([ce({type:String})],xr.prototype,"email",void 0),t([ce({type:String})],xr.prototype,"avatar",void 0);const wr=t=>{let e;const i=new Set,o=(t,o)=>{const n="function"==typeof t?t(e):t;if(!Object.is(n,e)){const t=e;e=(null!=o?o:"object"!=typeof n||null===n)?n:Object.assign({},e,n),i.forEach((i=>i(e,t)))}},n=()=>e,s={setState:o,getState:n,getInitialState:()=>r,subscribe:t=>(i.add(t),()=>i.delete(t))},r=e=t(o,n,s);return s};var kr=Symbol.for("immer-nothing"),Ar=Symbol.for("immer-draftable"),Sr=Symbol.for("immer-state"),Cr=[function(t){return`The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`},function(t){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${t}'`},"This object has been frozen and should not be mutated",function(t){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+t},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(t){return`'current' expects a draft, got: ${t}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(t){return`'original' expects a draft, got: ${t}`}];function Tr(t,...e){{const i=Cr[t],o="function"==typeof i?i.apply(null,e):i;throw new Error(`[Immer] ${o}`)}}var Er=Object.getPrototypeOf;function $r(t){return!!t&&!!t[Sr]}function Or(t){return!!t&&(Lr(t)||Array.isArray(t)||!!t[Ar]||!!t.constructor?.[Ar]||Nr(t)||Br(t))}var zr=Object.prototype.constructor.toString();function Lr(t){if(!t||"object"!=typeof t)return!1;const e=Er(t);if(null===e)return!0;const i=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return i===Object||"function"==typeof i&&Function.toString.call(i)===zr}function Mr(t,e){0===Ir(t)?Reflect.ownKeys(t).forEach((i=>{e(i,t[i],t)})):t.forEach(((i,o)=>e(o,i,t)))}function Ir(t){const e=t[Sr];return e?e.type_:Array.isArray(t)?1:Nr(t)?2:Br(t)?3:0}function Pr(t,e){return 2===Ir(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Dr(t,e,i){const o=Ir(t);2===o?t.set(e,i):3===o?t.add(i):t[e]=i}function Nr(t){return t instanceof Map}function Br(t){return t instanceof Set}function Rr(t){return t.copy_||t.base_}function qr(t,e){if(Nr(t))return new Map(t);if(Br(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const i=Lr(t);if(!0===e||"class_only"===e&&!i){const e=Object.getOwnPropertyDescriptors(t);delete e[Sr];let i=Reflect.ownKeys(e);for(let o=0;o<i.length;o++){const n=i[o],s=e[n];!1===s.writable&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(e[n]={configurable:!0,writable:!0,enumerable:s.enumerable,value:t[n]})}return Object.create(Er(t),e)}{const e=Er(t);if(null!==e&&i)return{...t};const o=Object.create(e);return Object.assign(o,t)}}function Fr(t,e=!1){return jr(t)||$r(t)||!Or(t)||(Ir(t)>1&&(t.set=t.add=t.clear=t.delete=Ur),Object.freeze(t),e&&Object.entries(t).forEach((([t,e])=>Fr(e,!0)))),t}function Ur(){Tr(2)}function jr(t){return Object.isFrozen(t)}var Vr,Zr={};function Hr(t){const e=Zr[t];return e||Tr(0,t),e}function Wr(){return Vr}function Gr(t,e){e&&(Hr("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function Kr(t){Yr(t),t.drafts_.forEach(Jr),t.drafts_=null}function Yr(t){t===Vr&&(Vr=t.parent_)}function Qr(t){return Vr={drafts_:[],parent_:Vr,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Jr(t){const e=t[Sr];0===e.type_||1===e.type_?e.revoke_():e.revoked_=!0}function Xr(t,e){e.unfinalizedDrafts_=e.drafts_.length;const i=e.drafts_[0];return void 0!==t&&t!==i?(i[Sr].modified_&&(Kr(e),Tr(4)),Or(t)&&(t=ta(e,t),e.parent_||ia(e,t)),e.patches_&&Hr("Patches").generateReplacementPatches_(i[Sr].base_,t,e.patches_,e.inversePatches_)):t=ta(e,i,[]),Kr(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==kr?t:void 0}function ta(t,e,i){if(jr(e))return e;const o=e[Sr];if(!o)return Mr(e,((n,s)=>ea(t,o,e,n,s,i))),e;if(o.scope_!==t)return e;if(!o.modified_)return ia(t,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const e=o.copy_;let n=e,s=!1;3===o.type_&&(n=new Set(e),e.clear(),s=!0),Mr(n,((n,r)=>ea(t,o,e,n,r,i,s))),ia(t,e,!1),i&&t.patches_&&Hr("Patches").generatePatches_(o,i,t.patches_,t.inversePatches_)}return o.copy_}function ea(t,e,i,o,n,s,r){if(n===i&&Tr(5),$r(n)){const r=ta(t,n,s&&e&&3!==e.type_&&!Pr(e.assigned_,o)?s.concat(o):void 0);if(Dr(i,o,r),!$r(r))return;t.canAutoFreeze_=!1}else r&&i.add(n);if(Or(n)&&!jr(n)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;ta(t,n),e&&e.scope_.parent_||"symbol"==typeof o||!Object.prototype.propertyIsEnumerable.call(i,o)||ia(t,n)}}function ia(t,e,i=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Fr(e,i)}var oa={get(t,e){if(e===Sr)return t;const i=Rr(t);if(!Pr(i,e))return function(t,e,i){const o=ra(e,i);return o?"value"in o?o.value:o.get?.call(t.draft_):void 0}(t,i,e);const o=i[e];return t.finalized_||!Or(o)?o:o===sa(t.base_,e)?(la(t),t.copy_[e]=ha(o,t)):o},has:(t,e)=>e in Rr(t),ownKeys:t=>Reflect.ownKeys(Rr(t)),set(t,e,i){const o=ra(Rr(t),e);if(o?.set)return o.set.call(t.draft_,i),!0;if(!t.modified_){const o=sa(Rr(t),e),n=o?.[Sr];if(n&&n.base_===i)return t.copy_[e]=i,t.assigned_[e]=!1,!0;if(function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}(i,o)&&(void 0!==i||Pr(t.base_,e)))return!0;la(t),aa(t)}return t.copy_[e]===i&&(void 0!==i||e in t.copy_)||Number.isNaN(i)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=i,t.assigned_[e]=!0),!0},deleteProperty:(t,e)=>(void 0!==sa(t.base_,e)||e in t.base_?(t.assigned_[e]=!1,la(t),aa(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0),getOwnPropertyDescriptor(t,e){const i=Rr(t),o=Reflect.getOwnPropertyDescriptor(i,e);return o?{writable:!0,configurable:1!==t.type_||"length"!==e,enumerable:o.enumerable,value:i[e]}:o},defineProperty(){Tr(11)},getPrototypeOf:t=>Er(t.base_),setPrototypeOf(){Tr(12)}},na={};function sa(t,e){const i=t[Sr];return(i?Rr(i):t)[e]}function ra(t,e){if(!(e in t))return;let i=Er(t);for(;i;){const t=Object.getOwnPropertyDescriptor(i,e);if(t)return t;i=Er(i)}}function aa(t){t.modified_||(t.modified_=!0,t.parent_&&aa(t.parent_))}function la(t){t.copy_||(t.copy_=qr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}Mr(oa,((t,e)=>{na[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),na.deleteProperty=function(t,e){return isNaN(parseInt(e))&&Tr(13),na.set.call(this,t,e,void 0)},na.set=function(t,e,i){return"length"!==e&&isNaN(parseInt(e))&&Tr(14),oa.set.call(this,t[0],e,i,t[0])};function ha(t,e){const i=Nr(t)?Hr("MapSet").proxyMap_(t,e):Br(t)?Hr("MapSet").proxySet_(t,e):function(t,e){const i=Array.isArray(t),o={type_:i?1:0,scope_:e?e.scope_:Wr(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let n=o,s=oa;i&&(n=[o],s=na);const{revoke:r,proxy:a}=Proxy.revocable(n,s);return o.draft_=a,o.revoke_=r,a}(t,e);return(e?e.scope_:Wr()).drafts_.push(i),i}function ca(t){if(!Or(t)||jr(t))return t;const e=t[Sr];let i;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,i=qr(t,e.scope_.immer_.useStrictShallowCopy_)}else i=qr(t,!0);return Mr(i,((t,e)=>{Dr(i,t,ca(e))})),e&&(e.finalized_=!1),i}var da=new class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,e,i)=>{if("function"==typeof t&&"function"!=typeof e){const i=e;e=t;const o=this;return function(t=i,...n){return o.produce(t,(t=>e.call(this,t,...n)))}}let o;if("function"!=typeof e&&Tr(6),void 0!==i&&"function"!=typeof i&&Tr(7),Or(t)){const n=Qr(this),s=ha(t,void 0);let r=!0;try{o=e(s),r=!1}finally{r?Kr(n):Yr(n)}return Gr(n,i),Xr(o,n)}if(!t||"object"!=typeof t){if(o=e(t),void 0===o&&(o=t),o===kr&&(o=void 0),this.autoFreeze_&&Fr(o,!0),i){const e=[],n=[];Hr("Patches").generateReplacementPatches_(t,o,e,n),i(e,n)}return o}Tr(1,t)},this.produceWithPatches=(t,e)=>{if("function"==typeof t)return(e,...i)=>this.produceWithPatches(e,(e=>t(e,...i)));let i,o;const n=this.produce(t,e,((t,e)=>{i=t,o=e}));return[n,i,o]},"boolean"==typeof t?.autoFreeze&&this.setAutoFreeze(t.autoFreeze),"boolean"==typeof t?.useStrictShallowCopy&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){Or(t)||Tr(8),$r(t)&&(t=function(t){$r(t)||Tr(10,t);return ca(t)}(t));const e=Qr(this),i=ha(t,void 0);return i[Sr].isManual_=!0,Yr(e),i}finishDraft(t,e){const i=t&&t[Sr];i&&i.isManual_||Tr(9);const{scope_:o}=i;return Gr(o,e),Xr(void 0,o)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let i;for(i=e.length-1;i>=0;i--){const o=e[i];if(0===o.path.length&&"replace"===o.op){t=o.value;break}}i>-1&&(e=e.slice(i+1));const o=Hr("Patches").applyPatches_;return $r(t)?o(t,e):this.produce(t,(t=>o(t,e)))}},ua=da.produce;da.produceWithPatches.bind(da),da.setAutoFreeze.bind(da),da.setUseStrictShallowCopy.bind(da),da.applyPatches.bind(da),da.createDraft.bind(da),da.finishDraft.bind(da);const pa=t=>(e,i,o)=>(o.setState=(t,i,...o)=>{const n="function"==typeof t?ua(t):t;return e(n,i,...o)},t(o.setState,i,o));var ma=wr(pa(((t,e)=>({languageNames:{},languageCode:"",workspace:null,flow:null,isTranslating:!1,fetchRevision:async(e,i=null)=>{i||(i="latest");const o=await fetch(`${e}/${i}/?version=14.3`);if(!o.ok)throw new Error("Network response was not ok");const n=await o.json();t({flow:n})},fetchWorkspace:async e=>{const i=await fetch(e);if(!i.ok)throw new Error("Network response was not ok");const o=await i.json();t({workspace:o})},fetchAllLanguages:async e=>{const i=(await Wt(e)).reduce((function(t,e){return t[e.value]=e.name,t}),{});t({languageNames:i})},getFlowResults:()=>e().flow.info.results,getResultByKey:t=>e().flow.info.results.find((e=>e.key===t)),getLanguage:()=>{const t=e(),i=t.languageCode;return{name:t.languageNames[i],code:i}},setFlowContents:e=>{t((t=>{const i=e.definition.language,o=t.languageCode||i;t.flow=e,t.isTranslating=i!==o,t.languageCode=o||i}))},setFlowInfo:e=>{t((t=>{t.flow.info=e}))},setLanguageCode:e=>{t((t=>{t.languageCode=e,t.isTranslating=t.flow.definition.language!==e}))},updateCanvasPositions:e=>{t((t=>{for(const i in e)t.flow.definition._ui.nodes[i].position=e[i]}))},removeNodes:e=>{t((t=>{for(const i of e)delete t.flow.definition._ui.nodes[i];t.flow.definition.nodes=t.flow.definition.nodes.filter((t=>!e.includes(t.uuid)))}))}}))));const{setLocale:ga}=(t=>(function(t){if(vr)throw new Error("lit-localize can only be configured once");fr=t,vr=!0}(((t,e)=>nr(cr,t,e))),dr=ar=t.sourceLocale,lr=new Set(t.targetLocales),lr.add(t.sourceLocale),hr=t.loadLocale,{getLocale:mr,setLocale:gr}))({sourceLocale:"en",targetLocales:yr,loadLocale:t=>import(`./locales/${t}.js`)});class fa extends pe{constructor(){super(...arguments),this.settings={},this.ttl=6e4,this.max=20,this.ready=!1,this.loader=!1,this.keyedAssets={},this.locale=[...navigator.languages],this.fields={},this.groups={},this.shortcuts=[],this.languages={},this.featuredFields=[],this.dirtyElements=[],this.pendingResolves={},this.fetching={}}static get styles(){return r`
389
+ `,t([ce({type:Number})],xr.prototype,"scale",void 0),t([ce({type:Boolean})],xr.prototype,"showName",void 0),t([ce({type:Boolean})],xr.prototype,"system",void 0),t([ce({type:String,attribute:!1})],xr.prototype,"bgimage",void 0),t([ce({type:String,attribute:!1})],xr.prototype,"bgcolor",void 0),t([ce({type:String,attribute:!1})],xr.prototype,"initials",void 0),t([ce({type:String})],xr.prototype,"name",void 0),t([ce({type:String})],xr.prototype,"email",void 0),t([ce({type:String})],xr.prototype,"avatar",void 0);const wr=t=>{let e;const i=new Set,o=(t,o)=>{const n="function"==typeof t?t(e):t;if(!Object.is(n,e)){const t=e;e=(null!=o?o:"object"!=typeof n||null===n)?n:Object.assign({},e,n),i.forEach((i=>i(e,t)))}},n=()=>e,s={setState:o,getState:n,getInitialState:()=>r,subscribe:t=>(i.add(t),()=>i.delete(t))},r=e=t(o,n,s);return s};var kr=Symbol.for("immer-nothing"),Ar=Symbol.for("immer-draftable"),Sr=Symbol.for("immer-state"),Cr=[function(t){return`The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`},function(t){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${t}'`},"This object has been frozen and should not be mutated",function(t){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+t},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(t){return`'current' expects a draft, got: ${t}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(t){return`'original' expects a draft, got: ${t}`}];function Tr(t,...e){{const i=Cr[t],o="function"==typeof i?i.apply(null,e):i;throw new Error(`[Immer] ${o}`)}}var Er=Object.getPrototypeOf;function $r(t){return!!t&&!!t[Sr]}function Or(t){return!!t&&(Lr(t)||Array.isArray(t)||!!t[Ar]||!!t.constructor?.[Ar]||Nr(t)||Br(t))}var zr=Object.prototype.constructor.toString();function Lr(t){if(!t||"object"!=typeof t)return!1;const e=Er(t);if(null===e)return!0;const i=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return i===Object||"function"==typeof i&&Function.toString.call(i)===zr}function Mr(t,e){0===Ir(t)?Reflect.ownKeys(t).forEach((i=>{e(i,t[i],t)})):t.forEach(((i,o)=>e(o,i,t)))}function Ir(t){const e=t[Sr];return e?e.type_:Array.isArray(t)?1:Nr(t)?2:Br(t)?3:0}function Pr(t,e){return 2===Ir(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Dr(t,e,i){const o=Ir(t);2===o?t.set(e,i):3===o?t.add(i):t[e]=i}function Nr(t){return t instanceof Map}function Br(t){return t instanceof Set}function Rr(t){return t.copy_||t.base_}function qr(t,e){if(Nr(t))return new Map(t);if(Br(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const i=Lr(t);if(!0===e||"class_only"===e&&!i){const e=Object.getOwnPropertyDescriptors(t);delete e[Sr];let i=Reflect.ownKeys(e);for(let o=0;o<i.length;o++){const n=i[o],s=e[n];!1===s.writable&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(e[n]={configurable:!0,writable:!0,enumerable:s.enumerable,value:t[n]})}return Object.create(Er(t),e)}{const e=Er(t);if(null!==e&&i)return{...t};const o=Object.create(e);return Object.assign(o,t)}}function Fr(t,e=!1){return jr(t)||$r(t)||!Or(t)||(Ir(t)>1&&(t.set=t.add=t.clear=t.delete=Ur),Object.freeze(t),e&&Object.entries(t).forEach((([t,e])=>Fr(e,!0)))),t}function Ur(){Tr(2)}function jr(t){return Object.isFrozen(t)}var Vr,Zr={};function Hr(t){const e=Zr[t];return e||Tr(0,t),e}function Wr(){return Vr}function Gr(t,e){e&&(Hr("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function Kr(t){Yr(t),t.drafts_.forEach(Jr),t.drafts_=null}function Yr(t){t===Vr&&(Vr=t.parent_)}function Qr(t){return Vr={drafts_:[],parent_:Vr,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Jr(t){const e=t[Sr];0===e.type_||1===e.type_?e.revoke_():e.revoked_=!0}function Xr(t,e){e.unfinalizedDrafts_=e.drafts_.length;const i=e.drafts_[0];return void 0!==t&&t!==i?(i[Sr].modified_&&(Kr(e),Tr(4)),Or(t)&&(t=ta(e,t),e.parent_||ia(e,t)),e.patches_&&Hr("Patches").generateReplacementPatches_(i[Sr].base_,t,e.patches_,e.inversePatches_)):t=ta(e,i,[]),Kr(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==kr?t:void 0}function ta(t,e,i){if(jr(e))return e;const o=e[Sr];if(!o)return Mr(e,((n,s)=>ea(t,o,e,n,s,i))),e;if(o.scope_!==t)return e;if(!o.modified_)return ia(t,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const e=o.copy_;let n=e,s=!1;3===o.type_&&(n=new Set(e),e.clear(),s=!0),Mr(n,((n,r)=>ea(t,o,e,n,r,i,s))),ia(t,e,!1),i&&t.patches_&&Hr("Patches").generatePatches_(o,i,t.patches_,t.inversePatches_)}return o.copy_}function ea(t,e,i,o,n,s,r){if(n===i&&Tr(5),$r(n)){const r=ta(t,n,s&&e&&3!==e.type_&&!Pr(e.assigned_,o)?s.concat(o):void 0);if(Dr(i,o,r),!$r(r))return;t.canAutoFreeze_=!1}else r&&i.add(n);if(Or(n)&&!jr(n)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;ta(t,n),e&&e.scope_.parent_||"symbol"==typeof o||!Object.prototype.propertyIsEnumerable.call(i,o)||ia(t,n)}}function ia(t,e,i=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Fr(e,i)}var oa={get(t,e){if(e===Sr)return t;const i=Rr(t);if(!Pr(i,e))return function(t,e,i){const o=ra(e,i);return o?"value"in o?o.value:o.get?.call(t.draft_):void 0}(t,i,e);const o=i[e];return t.finalized_||!Or(o)?o:o===sa(t.base_,e)?(la(t),t.copy_[e]=ha(o,t)):o},has:(t,e)=>e in Rr(t),ownKeys:t=>Reflect.ownKeys(Rr(t)),set(t,e,i){const o=ra(Rr(t),e);if(o?.set)return o.set.call(t.draft_,i),!0;if(!t.modified_){const o=sa(Rr(t),e),n=o?.[Sr];if(n&&n.base_===i)return t.copy_[e]=i,t.assigned_[e]=!1,!0;if(function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}(i,o)&&(void 0!==i||Pr(t.base_,e)))return!0;la(t),aa(t)}return t.copy_[e]===i&&(void 0!==i||e in t.copy_)||Number.isNaN(i)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=i,t.assigned_[e]=!0),!0},deleteProperty:(t,e)=>(void 0!==sa(t.base_,e)||e in t.base_?(t.assigned_[e]=!1,la(t),aa(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0),getOwnPropertyDescriptor(t,e){const i=Rr(t),o=Reflect.getOwnPropertyDescriptor(i,e);return o?{writable:!0,configurable:1!==t.type_||"length"!==e,enumerable:o.enumerable,value:i[e]}:o},defineProperty(){Tr(11)},getPrototypeOf:t=>Er(t.base_),setPrototypeOf(){Tr(12)}},na={};function sa(t,e){const i=t[Sr];return(i?Rr(i):t)[e]}function ra(t,e){if(!(e in t))return;let i=Er(t);for(;i;){const t=Object.getOwnPropertyDescriptor(i,e);if(t)return t;i=Er(i)}}function aa(t){t.modified_||(t.modified_=!0,t.parent_&&aa(t.parent_))}function la(t){t.copy_||(t.copy_=qr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}Mr(oa,((t,e)=>{na[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),na.deleteProperty=function(t,e){return isNaN(parseInt(e))&&Tr(13),na.set.call(this,t,e,void 0)},na.set=function(t,e,i){return"length"!==e&&isNaN(parseInt(e))&&Tr(14),oa.set.call(this,t[0],e,i,t[0])};function ha(t,e){const i=Nr(t)?Hr("MapSet").proxyMap_(t,e):Br(t)?Hr("MapSet").proxySet_(t,e):function(t,e){const i=Array.isArray(t),o={type_:i?1:0,scope_:e?e.scope_:Wr(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let n=o,s=oa;i&&(n=[o],s=na);const{revoke:r,proxy:a}=Proxy.revocable(n,s);return o.draft_=a,o.revoke_=r,a}(t,e);return(e?e.scope_:Wr()).drafts_.push(i),i}function ca(t){if(!Or(t)||jr(t))return t;const e=t[Sr];let i;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,i=qr(t,e.scope_.immer_.useStrictShallowCopy_)}else i=qr(t,!0);return Mr(i,((t,e)=>{Dr(i,t,ca(e))})),e&&(e.finalized_=!1),i}var da=new class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,e,i)=>{if("function"==typeof t&&"function"!=typeof e){const i=e;e=t;const o=this;return function(t=i,...n){return o.produce(t,(t=>e.call(this,t,...n)))}}let o;if("function"!=typeof e&&Tr(6),void 0!==i&&"function"!=typeof i&&Tr(7),Or(t)){const n=Qr(this),s=ha(t,void 0);let r=!0;try{o=e(s),r=!1}finally{r?Kr(n):Yr(n)}return Gr(n,i),Xr(o,n)}if(!t||"object"!=typeof t){if(o=e(t),void 0===o&&(o=t),o===kr&&(o=void 0),this.autoFreeze_&&Fr(o,!0),i){const e=[],n=[];Hr("Patches").generateReplacementPatches_(t,o,e,n),i(e,n)}return o}Tr(1,t)},this.produceWithPatches=(t,e)=>{if("function"==typeof t)return(e,...i)=>this.produceWithPatches(e,(e=>t(e,...i)));let i,o;const n=this.produce(t,e,((t,e)=>{i=t,o=e}));return[n,i,o]},"boolean"==typeof t?.autoFreeze&&this.setAutoFreeze(t.autoFreeze),"boolean"==typeof t?.useStrictShallowCopy&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){Or(t)||Tr(8),$r(t)&&(t=function(t){$r(t)||Tr(10,t);return ca(t)}(t));const e=Qr(this),i=ha(t,void 0);return i[Sr].isManual_=!0,Yr(e),i}finishDraft(t,e){const i=t&&t[Sr];i&&i.isManual_||Tr(9);const{scope_:o}=i;return Gr(o,e),Xr(void 0,o)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let i;for(i=e.length-1;i>=0;i--){const o=e[i];if(0===o.path.length&&"replace"===o.op){t=o.value;break}}i>-1&&(e=e.slice(i+1));const o=Hr("Patches").applyPatches_;return $r(t)?o(t,e):this.produce(t,(t=>o(t,e)))}},ua=da.produce;da.produceWithPatches.bind(da),da.setAutoFreeze.bind(da),da.setUseStrictShallowCopy.bind(da),da.applyPatches.bind(da),da.createDraft.bind(da),da.finishDraft.bind(da);const pa=t=>(e,i,o)=>(o.setState=(t,i,...o)=>{const n="function"==typeof t?ua(t):t;return e(n,i,...o)},t(o.setState,i,o));var ma=wr(pa(((t,e)=>({languageNames:{},languageCode:"",workspace:null,flow:null,isTranslating:!1,fetchRevision:async(e,i=null)=>{i||(i="latest");const o=await fetch(`${e}/${i}/?version=14.3`);if(!o.ok)throw new Error("Network response was not ok");const n=await o.json();t({flow:n})},fetchWorkspace:async e=>{const i=await fetch(e);if(!i.ok)throw new Error("Network response was not ok");const o=await i.json();t({workspace:o})},fetchAllLanguages:async e=>{const i=(await Wt(e)).reduce((function(t,e){return t[e.value]=e.name,t}),{});t({languageNames:i})},getFlowResults:()=>e().flow.info.results,getResultByKey:t=>e().flow.info.results.find((e=>e.key===t)),getLanguage:()=>{const t=e(),i=t.languageCode;return{name:t.languageNames[i],code:i}},setFlowContents:e=>{t((t=>{const i=e.definition.language,o=t.languageCode||i;t.flow=e,t.isTranslating=i!==o,t.languageCode=o||i}))},setFlowInfo:e=>{t((t=>{t.flow.info=e}))},setLanguageCode:e=>{t((t=>{t.languageCode=e,t.isTranslating=t.flow.definition.language!==e}))},updateCanvasPositions:e=>{t((t=>{for(const i in e)t.flow.definition._ui.nodes[i]&&(t.flow.definition._ui.nodes[i].position=e[i])}))},removeNodes:e=>{t((t=>{for(const i of e)delete t.flow.definition._ui.nodes[i];t.flow.definition.nodes=t.flow.definition.nodes.filter((t=>!e.includes(t.uuid)))}))}}))));const{setLocale:ga}=(t=>(function(t){if(vr)throw new Error("lit-localize can only be configured once");fr=t,vr=!0}(((t,e)=>nr(cr,t,e))),dr=ar=t.sourceLocale,lr=new Set(t.targetLocales),lr.add(t.sourceLocale),hr=t.loadLocale,{getLocale:mr,setLocale:gr}))({sourceLocale:"en",targetLocales:yr,loadLocale:t=>import(`./locales/${t}.js`)});class fa extends pe{constructor(){super(...arguments),this.settings={},this.ttl=6e4,this.max=20,this.ready=!1,this.loader=!1,this.keyedAssets={},this.locale=[...navigator.languages],this.fields={},this.groups={},this.shortcuts=[],this.languages={},this.featuredFields=[],this.dirtyElements=[],this.pendingResolves={},this.fetching={}}static get styles(){return r`
390
390
  :host {
391
391
  position: fixed;
392
392
  z-index: 1000;