diff --git a/dist/ueblueprint.min.js b/dist/ueblueprint.min.js
index 3ce266a..a64ae43 100644
--- a/dist/ueblueprint.min.js
+++ b/dist/ueblueprint.min.js
@@ -20,7 +20,7 @@ var m;p.finalized=!0,p.elementProperties=new Map,p.elementStyles=[],p.shadowRoot
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
-var K,X;null==q||q(I,z),(null!==(m=globalThis.litHtmlVersions)&&void 0!==m?m:globalThis.litHtmlVersions=[]).push("2.2.7");class Y extends p{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const n=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=n.firstChild),n}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{var i,r;const s=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:t;let o=s._$litPart$;if(void 0===o){const e=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:null;s._$litPart$=o=new z(t.insertBefore(w(),e),e,void 0,null!=n?n:{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return T}}Y.finalized=!0,Y._$litElement$=!0,null===(K=globalThis.litElementHydrateSupport)||void 0===K||K.call(globalThis,{LitElement:Y});const Z=globalThis.litElementPolyfillSupport;null==Z||Z({LitElement:Y}),(null!==(X=globalThis.litElementVersions)&&void 0!==X?X:globalThis.litElementVersions=[]).push("3.2.2");class J{static colorDragEventName="ueb-color-drag";static colorPickEventName="ueb-color-pick";static colorWindowEventName="ueb-color-window";static deleteNodesKeyboardKey="Delete";static dragGeneralEventName="ueb-drag-general";static dragEventName="ueb-drag";static editTextEventName={begin:"ueb-edit-text-begin",end:"ueb-edit-text-end"};static enableZoomIn=["LeftControl","RightControl"];static expandGridSize=400;static focusEventName={begin:"blueprint-focus",end:"blueprint-unfocus"};static fontSize=r``;static gridAxisLineColor=r``;static gridExpandThreshold=.25;static gridLineColor=r``;static gridLineWidth=1;static gridSet=8;static gridSetLineColor=r``;static gridShrinkThreshold=4;static gridSize=16;static hexColorRegex=/^\s*#(?[0-9a-fA-F]{2})(?[0-9a-fA-F]{2})(?[0-9a-fA-F]{2})([0-9a-fA-F]{2})?|#(?[0-9a-fA-F])(?[0-9a-fA-F])(?[0-9a-fA-F])\s*$/;static keysSeparator="+";static linkCurveHeight=15;static linkCurveWidth=80;static linkMinWidth=100;static linkRightSVGPath=(e,t,n)=>{let i=100-e;return`M ${e} 0 C ${t} 0, ${n} 0, 50 50 S ${i-t+e} 100, ${i} 100`};static maxZoom=7;static minZoom=-12;static mouseWheelFactor=.2;static nodeDeleteEventName="ueb-node-delete";static nodeDragGeneralEventName="ueb-node-drag-general";static nodeDragEventName="ueb-node-drag";static nodeName=(e,t)=>`${e}_${t}`;static nodeRadius=8;static nodeReflowEventName="ueb-node-reflow";static pinColor={"/Script/CoreUObject.LinearColor":r``,"/Script/CoreUObject.Rotator":r``,"/Script/CoreUObject.Transform":r``,"/Script/CoreUObject.Vector":r``,bool:r``,default:r``,exec:r``,name:r``,real:r``,string:r``};static selectAllKeyboardKey="(bCtrl=True,Key=A)";static trackingMouseEventName={begin:"ueb-tracking-mouse-begin",end:"ueb-tracking-mouse-end"};static windowApplyEventName="ueb-window-apply";static windowCancelEventName="ueb-window-cancel";static windowCloseEventName="ueb-window-close";static ModifierKeys=["Ctrl","Shift","Alt","Meta"];static Keys={Backspace:"Backspace",Tab:"Tab",LeftControl:"ControlLeft",RightControl:"ControlRight",LeftShift:"ShiftLeft",RightShift:"ShiftRight",LeftAlt:"AltLeft",RightAlt:"AltRight",Enter:"Enter",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Space:"Space",PageUp:"PageUp",PageDown:"PageDown",End:"End",Home:"Home",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",PrintScreen:"PrintScreen",Insert:"Insert",Delete:"Delete",Zero:"Digit0",One:"Digit1",Two:"Digit2",Three:"Digit3",Four:"Digit4",Five:"Digit5",Six:"Digit6",Seven:"Digit7",Eight:"Digit8",Nine:"Digit9",A:"KeyA",B:"KeyB",C:"KeyC",D:"KeyD",E:"KeyE",F:"KeyF",G:"KeyG",H:"KeyH",I:"KeyI",K:"KeyK",L:"KeyL",M:"KeyM",N:"KeyN",O:"KeyO",P:"KeyP",Q:"KeyQ",R:"KeyR",S:"KeyS",T:"KeyT",U:"KeyU",V:"KeyV",W:"KeyW",X:"KeyX",Y:"KeyY",Z:"KeyZ",NumPadZero:"Numpad0",NumPadOne:"Numpad1",NumPadTwo:"Numpad2",NumPadThree:"Numpad3",NumPadFour:"Numpad4",NumPadFive:"Numpad5",NumPadSix:"Numpad6",NumPadSeven:"Numpad7",NumPadEight:"Numpad8",NumPadNine:"Numpad9",Multiply:"NumpadMultiply",Add:"NumpadAdd",Subtract:"NumpadSubtract",Decimal:"NumpadDecimal",Divide:"NumpadDivide",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",NumLock:"NumLock",ScrollLock:"ScrollLock"}}class Q{#e;get target(){return this.#e}#t;get blueprint(){return this.#t}options;constructor(e,t,n={}){n.consumeEvent??=!1,n.listenOnFocus??=!1,n.unlistenOnTextEdit??=!1,this.#e=e,this.#t=t,this.options=n;let i=this;this.listenHandler=e=>i.listenEvents(),this.unlistenHandler=e=>i.unlistenEvents(),this.options.listenOnFocus&&(this.blueprint.addEventListener(J.focusEventName.begin,this.listenHandler),this.blueprint.addEventListener(J.focusEventName.end,this.unlistenHandler)),this.options.unlistenOnTextEdit&&(this.blueprint.addEventListener(J.editTextEventName.begin,this.unlistenHandler),this.blueprint.addEventListener(J.editTextEventName.end,this.listenHandler))}unlistenDOMElement(){this.unlistenEvents(),this.blueprint.removeEventListener(J.focusEventName.begin,this.listenHandler),this.blueprint.removeEventListener(J.focusEventName.end,this.unlistenHandler),this.blueprint.removeEventListener(J.editTextEventName.begin,this.unlistenHandler),this.blueprint.removeEventListener(J.editTextEventName.end,this.listenHandler)}listenEvents(){}unlistenEvents(){}}class ee{#n;constructor(e){this.#n=e}calculate(e){return this.#n(e)}}class te{static#i=new Map;static registerSerializer(e,t){te.#i.set(e,t)}static getSerializer(e){return te.#i.get(e)}}class ne{#r;get type(){return this.#r}set type(e){this.#r=e}#s=!0;get showDefault(){return this.#s}set showDefault(e){this.#s=e}#o;get value(){return this.#o}set value(e){this.#o=e}#a;get serialized(){return this.#a}set serialized(e){this.#a=e}#l;get ignored(){return this.#l}set ignored(e){this.#l=e}static sanitize(e,t){return void 0===t&&(t=e?.constructor),t&&!(e?.constructor===t||e instanceof t)&&(e=new t(e)),(e instanceof Boolean||e instanceof Number||e instanceof String)&&(e=e.valueOf()),e}constructor(e,t=!0,n,i=!1,r=!1){void 0===n&&(n=e instanceof Array?[]:i?"":()=>ne.sanitize(new e)),this.#r=e,this.#s=t,this.#o=n,this.#a=i,this.#l=r}}class ie{static emptyObj={};static booleanConverter={fromAttribute:(e,t)=>{},toAttribute:(e,t)=>!0===e?"true":!1===e?"false":""};static sigmoid(e,t=1.7){return 1/(1+e/(1-e)**-t)}static clamp(e,t,n){return Math.min(Math.max(e,t),n)}static getScale(e){const t=getComputedStyle(e).getPropertyValue("--ueb-scale");return""!=t?parseFloat(t):1}static minDecimals(e,t=1){const n=e*10**t;return Math.abs(n%1)>Number.EPSILON?e.toString():e.toFixed(t)}static roundDecimals(e,t=1){const n=10**t;return Math.round(e*n)/n}static convertLocation(e,t){const n=1/ie.getScale(t),i=t.getBoundingClientRect();return[Math.round((e[0]-i.x)*n),Math.round((e[1]-i.y)*n)]}static isSerialized(e,t,n=ie.objectGet(e.constructor.attributes,t)){return n instanceof ee?ie.isSerialized(e,t,n.calculate(e)):n instanceof ne&&(!!n.serialized||ie.isSerialized(e,t,n.type))}static objectGet(e,t,n){if(void 0!==e){if(!(t instanceof Array))throw new TypeError("Expected keys to be an array.");return 0!=t.length&&t[0]in e&&void 0!==e[t[0]]?1==t.length?e[t[0]]:ie.objectGet(e[t[0]],t.slice(1),n):n}}static objectSet(e,t,n,i=!1,r=Object){if(!(t instanceof Array))throw new TypeError("Expected keys to be an array.");if(1==t.length){if(i||t[0]in e||void 0===e[t[0]])return e[t[0]]=n,!0}else if(t.length>0)return!i||e[t[0]]instanceof Object||(e[t[0]]=new r),ie.objectSet(e[t[0]],t.slice(1),n,i,r);return!1}static equals(e,t){return(e=ne.sanitize(e))===(t=ne.sanitize(t))||(e instanceof Array&&t instanceof Array?e.length==t.length&&!e.find(((e,n)=>!ie.equals(e,t[n]))):void 0)}static getType(e){return null===e?null:e instanceof ne?ie.getType(e.type):e instanceof Function?e:e?.constructor}static snapToGrid(e,t){return 1===t?e:[t*Math.round(e[0]/t),t*Math.round(e[1]/t)]}static mergeArrays(e=[],t=[]){let n=[];for(let i=0;i","\n")}static formatStringName(e){return e.trim().replace(/^b/,"").replaceAll(/(?<=[a-z])(?=[A-Z])|_|\s+/g," ")}static getIdFromReference(e){return e.replace(/(?:.+\.)?([^\.]+)$/,"$1").replaceAll(/(?<=[a-z\d])(?=[A-Z])|(?<=[a-zA-Z])(?=\d)|(?<=[A-Z]{2})(?=[A-Z][a-z])/g,"-").toLocaleLowerCase()}static printLinearColor(e){return`${Math.round(255*e.R.valueOf())}, ${Math.round(255*e.G.valueOf())}, ${Math.round(255*e.B.valueOf())}`}static getPolarCoordinates([e,t],n=!1){let i=Math.atan2(t,e);return n&&i<0&&(i=2*Math.PI+i),[Math.sqrt(e*e+t*t),i]}static getCartesianCoordinates([e,t]){return[e*Math.cos(t),e*Math.sin(t)]}static range(e,t,n=1){return Array.from({length:Math.ceil((t-e)/n)},((t,i)=>e+i*n))}}class re extends class{#u=new Map;subscribe(e,t){let n=this.#u;if(n.has(e)){let i=n.get(e);if(i.includes(t))return!1;i.push(t)}else{let i=!1,r=Object.getOwnPropertyDescriptor(this,e);if(!r&&(i=!0,r=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e)??{},!r))return!1;n.set(e,[t]);const s="value"in r,o="set"in r;if(!s&&!o)throw new Error(`Property ${e} is not a value or a setter`);const a=Symbol.for(e+"Storage"),l=Symbol.for(e+"ValInfo");Object.defineProperties(i?Object.getPrototypeOf(this):this,{[a]:{configurable:!0,enumerable:!1,...s?{value:this[e],writable:!0}:{get:r.get,set:r.set}},[l]:{configurable:!0,enumerable:!1,value:[i,s]},[e]:{configurable:!0,...s&&{get(){return this[a]}},set(t){this[a]=t,n.get(e).forEach((t=>{t(this[e])}))}}})}return!0}unsubscribe(e,t){let n=this.#u.get(e);if(!n?.includes(t))return!1;if(n.splice(n.indexOf(t),1),0==n.length){const t=Symbol.for(e+"Storage"),n=Symbol.for(e+"ValInfo"),i=this[n][0];this[n][1],Object.defineProperty(i?Object.getPrototypeOf(this):this,e,Object.getOwnPropertyDescriptor(i?Object.getPrototypeOf(this):this,t)),delete this[n],delete this[t]}return!0}}{static attributes={};constructor(e){super();const t=(e,n,i,r="")=>{for(let s of ie.mergeArrays(Object.getOwnPropertyNames(n),Object.getOwnPropertyNames(i??{}))){let o=ie.objectGet(i,[s]),a=n[s],l=ie.getType(a);if(a instanceof ee&&(a=a.calculate(this),l=ie.getType(a)),s in n?s in i||void 0===a||a instanceof ne&&!a.showDefault||console.warn(`${this.constructor.name} will add attribute ${r}${s} not defined in the serialized data`):console.warn(`Attribute ${r}${s} in the serialized data is not defined in ${this.constructor.name}.attributes`),l!==Object)if(void 0===o){if(a instanceof ne){if(!a.showDefault){e[s]=void 0;continue}a.serialized?a="":(l=a.type,a=a.value,a instanceof Function&&(a=a()))}a instanceof Array&&(a=[]),e[s]=ne.sanitize(a,l)}else o?.constructor===String&&a instanceof ne&&a.serialized&&a.type!==String&&(o=te.getSerializer(a.type).deserialize(o)),e[s]=ne.sanitize(o,ie.getType(a));else e[s]={},t(e[s],n[s],i[s],s+".")}},n=this.constructor.attributes;e.constructor!==Object&&1==Object.getOwnPropertyNames(n).length&&(e={[Object.getOwnPropertyNames(n)[0]]:e}),t(this,n,e)}}class se extends re{static attributes={type:String,path:String};constructor(e={}){super(e),this.type,this.path}}class oe extends re{static attributes={MemberParent:se,MemberName:""};constructor(e={}){super(e),this.MemberParent,this.MemberName}}class ae extends re{static attributes={value:String};static generateGuid(e=!0){let t=new Uint32Array(4);!0===e&&crypto.getRandomValues(t);let n="";return t.forEach((e=>{n+=("0".repeat(8)+e.toString(16).toUpperCase()).slice(-8)})),new ae({value:n})}constructor(e={}){super(e),this.value}valueOf(){return this.value}toString(){return this.value}}class le extends re{static attributes={value:String};static attributeConverter={fromAttribute:(e,t)=>new le(e),toAttribute:(e,t)=>e.toString()};constructor(e={}){super(e),this.value}valueOf(){return this.value}toString(){return this.value}}class ue extends re{static attributes={value:Number};constructor(e=0){super(e),this.value=Math.round(this.value)}valueOf(){return this.value}toString(){return this.value.toString()}}class ce extends re{static lookbehind="INVTEXT";static attributes={value:String};constructor(e={}){super(e),this.value}}class he extends re{static attributes={ActionName:"",bShift:!1,bCtrl:!1,bAlt:!1,bCmd:!1,Key:le};constructor(e={}){e.ActionName=e.ActionName??"",e.bShift=e.bShift??!1,e.bCtrl=e.bCtrl??!1,e.bAlt=e.bAlt??!1,e.bCmd=e.bCmd??!1,super(e),this.ActionName,this.bShift,this.bCtrl,this.bAlt,this.bCmd,this.Key}}class de extends re{static attributes={value:0};constructor(e=0){super(e),this.value=ie.clamp(this.value,0,1)}valueOf(){return this.value}toString(){return this.value.toFixed(6)}}class pe extends re{static attributes={R:de,G:de,B:de,A:new ne(de,!0,(()=>new de(1)),!1,!0),H:new ne(de,!0,void 0,!1,!0),S:new ne(de,!0,void 0,!1,!0),V:new ne(de,!0,void 0,!1,!0)};static linearToSRGB(e){return e<=0?0:e>=1?1:e<.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055}static sRGBtoLinear(e){return e<=0?0:e>=1?1:e<.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}constructor(e={}){super(e),this.R,this.G,this.B,this.A,this.H,this.S,this.V,this.#c()}#c(){const e=this.R.value,t=this.G.value,n=this.B.value;if(!(Math.abs(e-t)>Number.EPSILON||Math.abs(e-n)>Number.EPSILON||Math.abs(t-n)>Number.EPSILON))return void(this.V.value=0);const i=Math.max(e,t,n),r=Math.min(e,t,n),s=i-r;let o;switch(i){case r:o=0;break;case e:o=(t-n)/s+(te.toString(16).toUpperCase().padStart(2,"0"))).join("")}toSRGBAString(){return this.toSRGBA().map((e=>e.toString(16).toUpperCase().padStart(2,"0"))).join("")}toHSVA(){const e=this.R.value,t=this.G.value,n=this.B.value,i=this.A.value,r=Math.max(e,t,n),s=Math.min(e,t,n),o=0==r?0:(r-s)/r,a=r;return[this.H.value,o,a,i]}toNumber(){return(this.R.value<<24)+(this.G.value<<16)+(this.B.value<<8)+this.A.value}setFromRGBANumber(e){this.A.value=(255&e)/255,this.B.value=(e>>8&255)/255,this.G.value=(e>>16&255)/255,this.R.value=(e>>24&255)/255,this.#c()}setFromSRGBANumber(e){this.A.value=(255&e)/255,this.B.value=pe.sRGBtoLinear((e>>8&255)/255),this.G.value=pe.sRGBtoLinear((e>>16&255)/255),this.R.value=pe.sRGBtoLinear((e>>24&255)/255),this.#c()}toString(){return ie.printLinearColor(this)}}class me extends re{static lookbehind="NSLOCTEXT";static attributes={namespace:String,key:String,value:String};constructor(e={}){super(e),this.namespace,this.key,this.value}}class ge extends re{static attributes={value:String};constructor(e={}){super(e),this.value}valueOf(){return this.value}toString(){return this.value}}class ve extends re{static attributes={objectName:ge,pinGuid:ae};constructor(e={}){super(e),this.objectName,this.pinGuid}}class be extends re{static attributes={R:Number,P:Number,Y:Number};constructor(e={}){super(e),this.R,this.P,this.Y}}class fe extends be{}class ye extends re{static attributes={X:Number,Y:Number,Z:Number};constructor(e={}){super(e),this.X,this.Y,this.Z}}class Ee extends ye{}class we extends re{static#h={"/Script/CoreUObject.LinearColor":pe,"/Script/CoreUObject.Rotator":be,"/Script/CoreUObject.Vector":ye,bool:Boolean,exec:String,name:String,real:Number,string:String};static#d={"/Script/CoreUObject.Vector":Ee,"/Script/CoreUObject.Rotator":fe};static lookbehind="Pin";static attributes={PinId:ae,PinName:"",PinFriendlyName:new ne(me,!1,null),PinToolTip:"",Direction:new ne(String,!1,""),PinType:{PinCategory:"",PinSubCategory:"",PinSubCategoryObject:se,PinSubCategoryMemberReference:null,PinValueType:null,ContainerType:se,bIsReference:!1,bIsConst:!1,bIsWeakPointer:!1,bIsUObjectWrapper:!1,bSerializeAsSinglePrecisionFloat:!1},LinkedTo:new ne([ve],!1),DefaultValue:new ee((e=>new ne(we.getEntityType(e.getType(),!0)??String,!1,void 0,!0))),AutogeneratedDefaultValue:new ne(String,!1),DefaultObject:new ne(se,!1,null),PersistentGuid:ae,bHidden:!1,bNotConnectable:!1,bDefaultValueIsReadOnly:!1,bDefaultValueIsIgnored:!1,bAdvancedView:!1,bOrphanedPin:!1};static getEntityType(e,t=!1){const[n,i]=[this.#h[e],this.#d[e]];return t&&void 0!==i?i:n}constructor(e={}){super(e),this.PinId,this.PinName,this.PinFriendlyName,this.PinToolTip,this.Direction,this.PinType,this.LinkedTo,this.DefaultValue,this.AutogeneratedDefaultValue,this.DefaultObject,this.PersistentGuid,this.bHidden,this.bNotConnectable,this.bDefaultValueIsReadOnly,this.bDefaultValueIsIgnored,this.bAdvancedView,this.bOrphanedPin}getType(){return"struct"==this.PinType.PinCategory?this.PinType.PinSubCategoryObject.path:this.PinType.PinCategory}getDefaultValue(){return this.DefaultValue}isHidden(){return this.bHidden}isInput(){return!this.bHidden&&"EGPD_Output"!=this.Direction}isOutput(){return!this.bHidden&&"EGPD_Output"==this.Direction}isLinked(){return this.LinkedTo?.length>0??!1}linkTo(e,t){this.LinkedTo;const n=this.LinkedTo?.find((n=>n.objectName.toString()==e&&n.pinGuid.valueOf()==t.PinId.valueOf()));return!n&&((this.LinkedTo??(this.LinkedTo=[])).push(new ve({objectName:e,pinGuid:t.PinId})),!0)}unlinkFrom(e,t){const n=this.LinkedTo?.findIndex((n=>n.objectName.toString()==e&&n.pinGuid.valueOf()==t.PinId.valueOf()));return n>=0&&(1==this.LinkedTo.length?this.LinkedTo=void 0:this.LinkedTo.splice(n,1),!0)}getSubCategory(){return this.PinType.PinSubCategoryObject.path}}class Se extends re{static attributes={MemberName:String,MemberGuid:ae,bSelfContext:!1}}class ke extends re{static attributes={Class:se,Name:"",bIsPureFunc:new ne(Boolean,!1,!1),VariableReference:new ne(Se,!1,null),FunctionReference:new ne(oe,!1,null),EventReference:new ne(oe,!1,null),TargetType:new ne(se,!1,null),NodePosX:ue,NodePosY:ue,AdvancedPinDisplay:new ne(le,!1,null),EnabledState:new ne(le,!1,null),NodeGuid:ae,ErrorType:new ne(ue,!1),ErrorMsg:new ne(String,!1,""),CustomProperties:[we]};static nameRegex=/(\w+)_(\d+)/;constructor(e={}){super(e),this.Class,this.Name,this.bIsPureFunc,this.VariableReference,this.FunctionReference,this.EventReference,this.TargetType,this.NodePosX,this.NodePosY,this.AdvancedPinDisplay,this.EnabledState,this.NodeGuid,this.ErrorType,this.ErrorMsg,this.CustomProperties}getObjectName(e=!1){return e?this.getNameAndCounter()[0]:this.Name}getNameAndCounter(){const e=this.getObjectName(!1).match(ke.nameRegex);return e&&3==e.length?[e[1],parseInt(e[2])]:["",0]}getDisplayName(){let e=this.FunctionReference?.MemberName;return e?(e=ie.formatStringName(e),e):(e=ie.formatStringName(this.getNameAndCounter()[0]),e)}getCounter(){return this.getNameAndCounter()[1]}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Pe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xe={exports:{}};"undefined"!=typeof self&&self;var Ce=Pe(xe.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){function i(e){if(!(this instanceof i))return new i(e);this._=e}var r=i.prototype;function s(e,t){for(var n=0;n>7),buf:function(e){var t=o((function(e,t,n,i){return e.concat(n===i.length-1?Buffer.from([t,0]).readUInt16BE(0):i.readUInt16BE(n))}),[],e);return Buffer.from(a((function(e){return(e<<1&65535)>>8}),t))}(n.buf)}})),n}function u(){return"undefined"!=typeof Buffer}function c(){if(!u())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function h(e){c();var t=o((function(e,t){return e+t}),0,e);if(t%8!=0)throw new Error("The bits ["+e.join(", ")+"] add up to "+t+" which is not an even number of bytes; the total should be divisible by 8");var n,r=t/8,s=(n=function(e){return e>48},o((function(e,t){return e||(n(t)?t:e)}),null,e));if(s)throw new Error(s+" bit range requested exceeds 48 bit (6 byte) Number max.");return new i((function(t,n){var i=r+n;return i>t.length?S(n,r.toString()+" bytes"):w(i,o((function(e,t){var n=l(t,e.buf);return{coll:e.coll.concat(n.v),buf:n.buf}}),{coll:[],buf:t.slice(n,i)},e).coll)}))}function d(e,t){return new i((function(n,i){return c(),i+t>n.length?S(i,t+" bytes for "+e):w(i+t,n.slice(i,i+t))}))}function p(e,t){if("number"!=typeof(n=t)||Math.floor(n)!==n||t<0||t>6)throw new Error(e+" requires integer length in range [0, 6].");var n}function m(e){return p("uintBE",e),d("uintBE("+e+")",e).map((function(t){return t.readUIntBE(0,e)}))}function g(e){return p("uintLE",e),d("uintLE("+e+")",e).map((function(t){return t.readUIntLE(0,e)}))}function v(e){return p("intBE",e),d("intBE("+e+")",e).map((function(t){return t.readIntBE(0,e)}))}function b(e){return p("intLE",e),d("intLE("+e+")",e).map((function(t){return t.readIntLE(0,e)}))}function f(e){return e instanceof i}function y(e){return"[object Array]"==={}.toString.call(e)}function E(e){return u()&&Buffer.isBuffer(e)}function w(e,t){return{status:!0,index:e,value:t,furthest:-1,expected:[]}}function S(e,t){return y(t)||(t=[t]),{status:!1,index:-1,value:null,furthest:e,expected:t}}function k(e,t){if(!t)return e;if(e.furthest>t.furthest)return e;var n=e.furthest===t.furthest?function(e,t){if(function(){if(void 0!==i._supportsSet)return i._supportsSet;var e="undefined"!=typeof Set;return i._supportsSet=e,e}()&&Array.from){for(var n=new Set(e),r=0;r=0;){if(o in n){i=n[o].line,0===s&&(s=n[o].lineStart);break}("\n"===e.charAt(o)||"\r"===e.charAt(o)&&"\n"!==e.charAt(o+1))&&(r++,0===s&&(s=o+1)),o--}var a=i+r,l=t-s;return n[t]={line:a,lineStart:s},{offset:t,line:a+1,column:l+1}}function C(e){if(!f(e))throw new Error("not a parser: "+e)}function A(e,t){return"string"==typeof e?e.charAt(t):e[t]}function N(e){if("number"!=typeof e)throw new Error("not a number: "+e)}function $(e){if("function"!=typeof e)throw new Error("not a function: "+e)}function L(e){if("string"!=typeof e)throw new Error("not a string: "+e)}var M=2,T=3,O=8,D=5*O,H=4*O,_=" ";function I(e,t){return new Array(t+1).join(e)}function B(e,t,n){var i=t-e.length;return i<=0?e:I(n,i)+e}function R(e,t,n,i){return{from:e-t>0?e-t:0,to:e+n>i?i:e+n}}function z(e,t){var n,i,r,s,l,u=t.index,c=u.offset,h=1;if(c===e.length)return"Got the end of the input";if(E(e)){var d=c-c%O,p=c-d,m=R(d,D,H+O,e.length),g=a((function(e){return a((function(e){return B(e.toString(16),2,"0")}),e)}),function(e,t){var n=e.length,i=[],r=0;if(n<=t)return[e.slice()];for(var s=0;s=4&&(n+=1),h=2,r=a((function(e){return e.length<=4?e.join(" "):e.slice(0,4).join(" ")+" "+e.slice(4).join(" ")}),g),(l=(8*(s.to>0?s.to-1:s.to)).toString(16).length)<2&&(l=2)}else{var v=e.split(/\r\n|[\n\r\u2028\u2029]/);n=u.column-1,i=u.line-1,s=R(i,M,T,v.length),r=v.slice(s.from,s.to),l=s.to.toString().length}var b=i-s.from;return E(e)&&(l=(8*(s.to>0?s.to-1:s.to)).toString(16).length)<2&&(l=2),o((function(t,i,r){var o,a=r===b,u=a?"> ":_;return o=E(e)?B((8*(s.from+r)).toString(16),l,"0"):B((s.from+r+1).toString(),l," "),[].concat(t,[u+o+" | "+i],a?[_+I(" ",l)+" | "+B("",n," ")+I("^",h)]:[])}),[],r).join("\n")}function G(e,t){return["\n","-- PARSING FAILED "+I("-",50),"\n\n",z(e,t),"\n\n",(n=t.expected,1===n.length?"Expected:\n\n"+n[0]:"Expected one of the following: \n\n"+n.join(", ")),"\n"].join("");var n}function F(e){return void 0!==e.flags?e.flags:[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.unicode?"u":"",e.sticky?"y":""].join("")}function j(){for(var e=[].slice.call(arguments),t=e.length,n=0;n=2?N(t):t=0;var n=function(e){return RegExp("^(?:"+e.source+")",F(e))}(e),r=""+e;return i((function(e,i){var s=n.exec(e.slice(i));if(s){if(0<=t&&t<=s.length){var o=s[0],a=s[t];return w(i+o.length,a)}return S(i,"valid match group (0 to "+s.length+") in "+r)}return S(i,r)}))}function Y(e){return i((function(t,n){return w(n,e)}))}function Z(e){return i((function(t,n){return S(n,e)}))}function J(e){if(f(e))return i((function(t,n){var i=e._(t,n);return i.index=n,i.value="",i}));if("string"==typeof e)return J(K(e));if(e instanceof RegExp)return J(X(e));throw new Error("not a string, regexp, or parser: "+e)}function Q(e){return C(e),i((function(t,n){var i=e._(t,n),r=t.slice(n,i.index);return i.status?S(n,'not "'+r+'"'):w(n,null)}))}function ee(e){return $(e),i((function(t,n){var i=A(t,n);return n=e.length?S(t,"any character/byte"):w(t+1,A(e,t))})),se=i((function(e,t){return w(e.length,e.slice(t))})),oe=i((function(e,t){return t=0})).desc(t)},i.optWhitespace=he,i.Parser=i,i.range=function(e,t){return ee((function(n){return e<=n&&n<=t})).desc(e+"-"+t)},i.regex=X,i.regexp=X,i.sepBy=W,i.sepBy1=q,i.seq=j,i.seqMap=V,i.seqObj=function(){for(var e,t={},n=0,r=(e=arguments,Array.prototype.slice.call(e)),s=r.length,o=0;o255)throw new Error("Value specified to byte constructor ("+e+"=0x"+e.toString(16)+") is larger in value than a single byte.");var t=(e>15?"0x":"0x0")+e.toString(16);return i((function(n,i){var r=A(n,i);return r===e?w(i+1,r):S(i,t)}))},buffer:function(e){return d("buffer",e).map((function(e){return Buffer.from(e)}))},encodedString:function(e,t){return d("string",t).map((function(t){return t.toString(e)}))},uintBE:m,uint8BE:m(1),uint16BE:m(2),uint32BE:m(4),uintLE:g,uint8LE:g(1),uint16LE:g(2),uint32LE:g(4),intBE:v,int8BE:v(1),int16BE:v(2),int32BE:v(4),intLE:b,int8LE:b(1),int16LE:b(2),int32LE:b(4),floatBE:d("floatBE",4).map((function(e){return e.readFloatBE(0)})),floatLE:d("floatLE",4).map((function(e){return e.readFloatLE(0)})),doubleBE:d("doubleBE",8).map((function(e){return e.readDoubleBE(0)})),doubleLE:d("doubleLE",8).map((function(e){return e.readDoubleLE(0)}))},e.exports=i}]));let Ae=Ce;class Ne{static getGrammarForType(e,t,n=e.AttributeAnyValue){if(t instanceof ne){let i=Ne.getGrammarForType(e,t.type,n);return!t.serialized||t.type instanceof String||(i=i.wrap(Ae.string('"'),Ae.string('"'))),i}switch(ie.getType(t)){case Array:return Ae.seqMap(Ae.string("("),t.map((t=>Ne.getGrammarForType(e,ie.getType(t)))).reduce(((t,n)=>n&&t!==e.AttributeAnyValue?t.or(n):e.AttributeAnyValue)).trim(Ae.optWhitespace).sepBy(Ae.string(",")).skip(Ae.regex(/,?\s*/)),Ae.string(")"),((e,t,n)=>t));case Boolean:return e.Boolean;case oe:return e.FunctionReference;case ae:return e.Guid;case le:return e.Identifier;case ue:return e.Integer;case ce:return e.InvariantText;case pe:return e.LinearColor;case me:return e.LocalizedText;case Number:return e.Number;case se:return e.Reference;case we:return e.Pin;case ve:return e.PinReference;case de:return e.RealUnit;case be:return e.Rotator;case fe:return e.SimpleSerializationRotator;case Ee:return e.SimpleSerializationVector;case String:return e.String;case ye:return e.Vector;default:return n}}static createAttributeGrammar=(e,t,n=Ae.string("=").trim(Ae.optWhitespace))=>e.AttributeName.skip(n).chain((n=>{const i=n.split("."),r=ie.objectGet(t.attributes,i);return Ne.getGrammarForType(e,r,e.AttributeAnyValue).map((e=>t=>ie.objectSet(t,i,e,!0)))}));static createEntityGrammar=(e,t)=>Ae.seqMap(t.lookbehind?Ae.seq(Ae.string(t.lookbehind),Ae.optWhitespace,Ae.string("(")):Ae.string("("),Ne.createAttributeGrammar(e,t).trim(Ae.optWhitespace).sepBy(Ae.string(",")).skip(Ae.regex(/,?/).then(Ae.optWhitespace)),Ae.string(")"),((e,n,i)=>{let r={};return n.forEach((e=>e(r))),new t(r)}));InlineWhitespace=e=>Ae.regex(/[^\S\n]+/).desc("inline whitespace");InlineOptWhitespace=e=>Ae.regex(/[^\S\n]*/).desc("inline optional whitespace");MultilineWhitespace=e=>Ae.regex(/[^\S\n]*\n\s*/).desc("whitespace with at least a newline");Null=e=>Ae.seq(Ae.string("("),e.InlineOptWhitespace,Ae.string(")")).map((e=>null)).desc("null: ()");Boolean=e=>Ae.alt(Ae.string("True"),Ae.string("true"),Ae.string("False"),Ae.string("false")).map((e=>"true"===e.toLocaleLowerCase())).desc("either True or False");HexDigit=e=>Ae.regex(/[0-9a-fA-f]/).desc("hexadecimal digit");Number=e=>Ae.regex(/[-\+]?[0-9]+(?:\.[0-9]+)?/).map(Number).desc("a number");RealNumber=e=>Ae.regex(/[-\+]?[0-9]+\.[0-9]+/).map(Number).desc("a number written as real");RealUnit=e=>Ae.regex(/\+?[0-9]+(?:\.[0-9]+)?/).map(Number).assert((e=>e>=0&&e<=1)).desc("a number between 0 and 1");NaturalNumber=e=>Ae.regex(/0|[1-9]\d*/).map(Number).desc("a natural number");ColorNumber=e=>e.NaturalNumber.assert((e=>0<=e&&e<256),"the color must be between 0 and 256 excluded");Word=e=>Ae.regex(/[a-zA-Z]+/).desc("a word");String=e=>Ae.regex(/(?:[^"\\]|\\.)*/).wrap(Ae.string('"'),Ae.string('"')).map(ie.unescapeString).desc('string (with possibility to escape the quote using ")');ReferencePath=e=>Ae.seq(Ae.string("/"),e.PathSymbol.map((e=>e.toString())).sepBy1(Ae.string(".")).tieWith(".")).tie().atLeast(2).tie().desc('a path (words with possibly underscore, separated by ".", separated by "/")');AttributeName=e=>e.Word.sepBy1(Ae.string(".")).tieWith(".").desc('words separated by ""');None=e=>Ae.string("None").map((e=>new se({type:"None",path:""}))).desc("none");Integer=e=>Ae.regex(/[\-\+]?[0-9]+/).map((e=>new ue(e))).desc("an integer");Guid=e=>e.HexDigit.times(32).tie().map((e=>new ae({value:e}))).desc("32 digit hexadecimal value");Identifier=e=>Ae.regex(/\w+/).map((e=>new le(e)));PathSymbol=e=>Ae.regex(/[0-9\w]+/).map((e=>new ge({value:e})));Reference=e=>Ae.alt(e.None,...[e.ReferencePath.map((e=>new se({type:"",path:e})))].flatMap((e=>[e,e.trim(Ae.string('"'))])),Ae.seqMap(e.Word,Ae.optWhitespace,Ae.alt(...[e.ReferencePath].flatMap((e=>[e.wrap(Ae.string('"'),Ae.string('"')),e.wrap(Ae.string("'\""),Ae.string("\"'"))]))),((e,t,n)=>new se({type:e,path:n}))),e.Word.map((e=>new se({type:e,path:""}))));LocalizedText=e=>Ae.seqMap(Ae.string(me.lookbehind).skip(Ae.optWhitespace).skip(Ae.string("(")),e.String.trim(Ae.optWhitespace),Ae.string(","),e.String.trim(Ae.optWhitespace),Ae.string(","),e.String.trim(Ae.optWhitespace),Ae.string(")"),((e,t,n,i,r,s,o)=>new me({namespace:t,key:i,value:s})));InvariantText=e=>e.String.trim(Ae.optWhitespace).wrap(Ae.string(ce.lookbehind).skip(Ae.optWhitespace).skip(Ae.string("(")),Ae.string(")")).map((e=>new ce({value:e})));AttributeAnyValue=e=>Ae.alt(e.Null,e.None,e.Boolean,e.Number,e.Integer,e.String,e.Guid,e.LocalizedText,e.InvariantText,e.Reference,e.Vector,e.LinearColor);PinReference=e=>Ae.seqMap(e.PathSymbol,Ae.whitespace,e.Guid,((e,t,n)=>new ve({objectName:e,pinGuid:n})));Vector=e=>Ne.createEntityGrammar(e,ye);Rotator=e=>Ne.createEntityGrammar(e,be);SimpleSerializationRotator=e=>Ae.seqMap(e.Number,Ae.string(",").trim(Ae.optWhitespace),e.Number,Ae.string(",").trim(Ae.optWhitespace),e.Number,((e,t,n,i,r)=>new fe({R:r,P:e,Y:n})));SimpleSerializationVector=e=>Ae.seqMap(e.Number,Ae.string(",").trim(Ae.optWhitespace),e.Number,Ae.string(",").trim(Ae.optWhitespace),e.Number,((e,t,n,i,r)=>new Ee({X:e,Y:n,Z:r})));LinearColor=e=>Ne.createEntityGrammar(e,pe);FunctionReference=e=>Ne.createEntityGrammar(e,oe);KeyBinding=e=>Ae.alt(e.Identifier.map((e=>new he({Key:e}))),Ne.createEntityGrammar(e,he));Pin=e=>Ne.createEntityGrammar(e,we);CustomProperties=e=>Ae.string("CustomProperties").then(Ae.whitespace).then(e.Pin).map((e=>t=>{let n=ie.objectGet(t,["CustomProperties"],[]);n.push(e),ie.objectSet(t,["CustomProperties"],n,!0)}));Object=e=>Ae.seqMap(Ae.seq(Ae.string("Begin"),Ae.whitespace,Ae.string("Object"),Ae.whitespace),Ae.alt(e.CustomProperties,Ne.createAttributeGrammar(e,ke)).sepBy1(Ae.whitespace),Ae.seq(e.MultilineWhitespace,Ae.string("End"),Ae.whitespace,Ae.string("Object")),((e,t,n)=>{let i={};return t.forEach((e=>e(i))),new ke(i)}));MultipleObject=e=>e.Object.sepBy1(Ae.whitespace).trim(Ae.optWhitespace);LinearColorFromHex=e=>Ae.string("#").then(e.HexDigit.times(2).tie().times(3,4)).trim(Ae.optWhitespace).map((([e,t,n,i])=>new pe({R:parseInt(e,16)/255,G:parseInt(t,16)/255,B:parseInt(n,16)/255,A:i?parseInt(i,16)/255:1})));LinearColorFromRGBList=e=>Ae.seqMap(e.ColorNumber,Ae.string(",").skip(Ae.optWhitespace),e.ColorNumber,Ae.string(",").skip(Ae.optWhitespace),e.ColorNumber.map(Number),((e,t,n,i,r)=>new pe({R:e/255,G:n/255,B:r/255,A:1})));LinearColorFromRGB=e=>Ae.string("rgb").then(e.LinearColorFromRGBList.wrap(Ae.regex(/\(\s*/),Ae.regex(/\s*\)/)));LinearColorFromRGBA=e=>Ae.string("rgba").then(Ae.seqMap(e.ColorNumber,Ae.string(",").skip(Ae.optWhitespace),e.ColorNumber,Ae.string(",").skip(Ae.optWhitespace),e.ColorNumber.map(Number),Ae.string(",").skip(Ae.optWhitespace),Ae.regex(/0?\.\d+|[01]/).map(Number),((e,t,n,i,r,s,o)=>new pe({R:e/255,G:n/255,B:r/255,A:o}))).wrap(Ae.regex(/\(\s*/),Ae.regex(/\s*\)/)));LinearColorFromAnyColor=e=>Ae.alt(e.LinearColorFromRGBList,e.LinearColorFromHex,e.LinearColorFromRGB,e.LinearColorFromRGBA)}class $e{static grammar=Ce.createLanguage(new Ne);constructor(e,t="",n=",",i=!1,r="=",s=(e=>e.join("."))){this.entityType=e,this.prefix=t,this.separator=n,this.trailingSeparator=i,this.attributeValueConjunctionSign=r,this.attributeKeyPrinter=s}deserialize(e){return this.read(e)}serialize(e,t=!1,n=e){return this.write(n,e,t)}read(e){throw new Error("Not implemented")}write(e,t,n){throw new Error("Not implemented")}writeValue(e,t,n,i){const r=te.getSerializer(ie.getType(t));if(!r)throw new Error("Unknown value type, a serializer must be registered in the SerializerFactory class");return r.write(e,t,i)}subWrite(e,t,n,i){let r="",s=t.concat("");const o=s.length-1;for(const t of Object.getOwnPropertyNames(n)){s[o]=t;const a=n[t];if(a?.constructor===Object)r+=(r.length?this.separator:"")+this.subWrite(e,s,a,i);else if(void 0!==a&&this.showProperty(e,n,s,a)){const t=ie.isSerialized(e,s);r+=(r.length?this.separator:"")+this.prefix+this.attributeKeyPrinter(s)+this.attributeValueConjunctionSign+(t?`"${this.writeValue(e,a,s,!0)}"`:this.writeValue(e,a,s,i))}}return this.trailingSeparator&&r.length&&1===s.length&&(r+=this.separator),r}showProperty(e,t,n,i){const r=this.entityType.attributes,s=ie.objectGet(r,n);return!(s instanceof ne)||!s.ignored&&(!ie.equals(s.value,i)||s.showDefault)}}class Le extends $e{constructor(){super(ke," ","\n",!1)}showProperty(e,t,n,i){switch(n.toString()){case"Class":case"Name":case"CustomProperties":return!1}return super.showProperty(e,t,n,i)}read(e){const t=$e.grammar.Object.parse(e);if(!t.status)throw new Error("Error when trying to parse the object.");return t.value}readMultiple(e){const t=$e.grammar.MultipleObject.parse(e);if(!t.status)throw new Error("Error when trying to parse the object.");return t.value}write(e,t,n){return`Begin Object Class=${t.Class.path} Name=${this.writeValue(e,t.Name,["Name"],n)}\n${this.subWrite(e,[],t,n)+t.CustomProperties.map((e=>this.separator+this.prefix+"CustomProperties "+te.getSerializer(we).serialize(e))).join("")}\nEnd Object\n`}}class Me extends Q{static#p=new Le;#m;constructor(e,t,n={}){n.listenOnFocus??=!0,n.unlistenOnTextEdit??=!0,super(e,t,n);let i=this;this.#m=e=>i.copied()}listenEvents(){document.body.addEventListener("copy",this.#m)}unlistenEvents(){document.body.removeEventListener("copy",this.#m)}copied(){const e=this.blueprint.getNodes(!0).map((e=>Me.#p.serialize(e.entity,!1))).join("\n\n");navigator.clipboard.writeText(e)}}class Te{static styles=r``;element;#g=[];get inputObjects(){return this.#g}constructed(e){this.element=e}connectedCallback(){}willUpdate(e){}update(e){}render(){return M``}firstUpdated(e){}updated(e){}inputSetup(){this.#g=this.createInputObjects()}cleanup(){this.#g.forEach((e=>e.unlistenDOMElement()))}createInputObjects(){return[]}}class Oe extends Q{#v;constructor(e,t,n={}){n.activateAnyKey??=!1,n.activationKeys??=[],n.listenOnFocus??=!0,n.unlistenOnTextEdit??=!0,n.activationKeys instanceof Array||(n.activationKeys=[n.activationKeys]),n.activationKeys=n.activationKeys.map((e=>{if(e instanceof he)return e;if(e.constructor===String){const t=$e.grammar.KeyBinding.parse(e);if(t.status)return t.value}throw new Error("Unexpected key value")})),super(e,t,n),this.#v=this.options.activationKeys??[];let i=this;this.keyDownHandler=e=>{(this.options.activateAnyKey||i.#v.some((t=>(e=>e.bShift||"LeftShift"==e.Key||"RightShift"==e.Key)(t)==e.shiftKey&&(e=>e.bCtrl||"LeftControl"==e.Key||"RightControl"==e.Key)(t)==e.ctrlKey&&(e=>e.bAlt||"LeftAlt"==e.Key||"RightAlt"==e.Key)(t)==e.altKey&&J.Keys[t.Key]==e.code)))&&(n.consumeEvent&&e.stopImmediatePropagation(),i.fire(),document.removeEventListener("keydown",i.keyDownHandler),document.addEventListener("keyup",i.keyUpHandler))},this.keyUpHandler=e=>{(this.options.activateAnyKey||i.#v.some((t=>t.bShift&&"Shift"==e.key||t.bCtrl&&"Control"==e.key||t.bAlt&&"Alt"==e.key||t.bCmd&&"Meta"==e.key||J.Keys[t.Key]==e.code)))&&(n.consumeEvent&&e.stopImmediatePropagation(),i.unfire(),document.removeEventListener("keyup",this.keyUpHandler),document.addEventListener("keydown",this.keyDownHandler))}}listenEvents(){document.addEventListener("keydown",this.keyDownHandler)}unlistenEvents(){document.removeEventListener("keydown",this.keyDownHandler)}fire(){}unfire(){}}class De extends Oe{constructor(e,t,n={}){n.activationKeys=J.deleteNodesKeyboardKey,super(e,t,n)}fire(){this.blueprint.removeGraphElement(...this.blueprint.getNodes(!0))}}class He extends Q{constructor(e,t,n={}){n.ignoreTranslateCompensate??=!1,n.movementSpace??=t.getGridDOMElement()??document.documentElement,super(e,t,n),this.movementSpace=n.movementSpace}locationFromEvent(e){const t=ie.convertLocation([e.clientX,e.clientY],this.movementSpace);return this.options.ignoreTranslateCompensate?t:this.blueprint.compensateTranslation(t)}}class _e extends He{#b;#f;constructor(e,t,n={}){n.listenOnFocus=!0,n.strictTarget??=!1,super(e,t,n),this.strictTarget=n.strictTarget;const i=this;this.#b=e=>{e.preventDefault();const t=i.locationFromEvent(e);i.wheel(Math.sign(e.deltaY*J.mouseWheelFactor),t)},this.#f=e=>e.preventDefault(),this.blueprint.focused&&this.movementSpace.addEventListener("wheel",this.#b,!1)}listenEvents(){this.movementSpace.addEventListener("wheel",this.#b,!1),this.movementSpace.parentElement?.addEventListener("wheel",this.#f)}unlistenEvents(){this.movementSpace.removeEventListener("wheel",this.#b,!1),this.movementSpace.parentElement?.removeEventListener("wheel",this.#f)}wheel(e,t){}}class Ie extends _e{#y=!1;get enableZoonIn(){return this.#y}set enableZoonIn(e){(e=Boolean(e))!=this.#y&&(this.#y=e)}wheel(e,t){let n=this.blueprint.getZoom();e=-e,!this.enableZoonIn&&0==n&&e>0||(n+=e,this.blueprint.setZoom(n,t))}}class Be extends Oe{#E;constructor(e,t,n={}){n.activationKeys=J.enableZoomIn,super(e,t,n)}fire(){this.#E=this.blueprint.getInputObject(Ie),this.#E.enableZoonIn=!0}unfire(){this.#E.enableZoonIn=!1}}class Re extends Oe{constructor(e,t,n={}){n.activationKeys=J.selectAllKeyboardKey,super(e,t,n)}fire(){this.blueprint.selectAll()}}class ze extends He{#w;#S;#k;#P;#x=!1;#C;#A;started=!1;stepSize=1;clickedPosition=[0,0];clickedOffset=[0,0];mouseLocation=[0,0];constructor(e,t,n={}){n.clickButton??=0,n.consumeEvent??=!0,n.draggableElement??=e,n.exitAnyButton??=!0,n.moveEverywhere??=!1,n.movementSpace??=t?.getGridDOMElement(),n.repositionOnClick??=!1,n.strictTarget??=!1,super(e,t,n),this.stepSize=parseInt(n?.stepSize??J.gridSize),this.#C=this.options.moveEverywhere?document.documentElement:this.movementSpace,this.#A=this.options.draggableElement;let i=this;this.#w=e=>{if(i.blueprint.setFocused(!0),e.button===i.options.clickButton)i.options.strictTarget&&e.target!=e.currentTarget||(i.options.consumeEvent&&e.stopImmediatePropagation(),i.#C.addEventListener("mousemove",i.#S),document.addEventListener("mouseup",i.#P),i.clickedPosition=i.locationFromEvent(e),i.clickedOffset=[i.clickedPosition[0]-i.target.locationX,i.clickedPosition[1]-i.target.locationY],i.clicked(i.clickedPosition));else i.options.exitAnyButton||i.#P(e)},this.#S=e=>{i.options.consumeEvent&&e.stopImmediatePropagation(),i.#C.removeEventListener("mousemove",i.#S),i.#C.addEventListener("mousemove",i.#k);const t=i.getEvent(J.trackingMouseEventName.begin);i.#x=0==i.target.dispatchEvent(t);const n=i.locationFromEvent(e);this.mouseLocation=ie.snapToGrid(this.clickedPosition,this.stepSize),i.startDrag(n),i.started=!0},this.#k=e=>{i.options.consumeEvent&&e.stopImmediatePropagation();const t=i.locationFromEvent(e),n=[e.movementX,e.movementY];i.dragTo(t,n),i.#x&&(i.blueprint.mousePosition=i.locationFromEvent(e))},this.#P=e=>{if(!i.options.exitAnyButton||e.button==i.options.clickButton){if(i.options.consumeEvent&&e.stopImmediatePropagation(),i.#C.removeEventListener("mousemove",i.#S),i.#C.removeEventListener("mousemove",i.#k),document.removeEventListener("mouseup",i.#P),i.started&&i.endDrag(),i.unclicked(),i.#x){const e=i.getEvent(J.trackingMouseEventName.end);i.target.dispatchEvent(e),i.#x=!1}i.started=!1}},this.listenEvents()}listenEvents(){this.#A.addEventListener("mousedown",this.#w),2==this.options.clickButton&&this.#A.addEventListener("contextmenu",(e=>e.preventDefault()))}unlistenEvents(){this.#A.removeEventListener("mousedown",this.#w)}getEvent(e){return new CustomEvent(e,{detail:{tracker:this},bubbles:!0,cancelable:!0})}clicked(e){}startDrag(e){}dragTo(e,t){}endDrag(){}unclicked(e){}}class Ge extends ze{startDrag(){this.blueprint.scrolling=!0}dragTo(e,t){this.blueprint.scrollDelta([-t[0],-t[1]])}endDrag(){this.blueprint.scrolling=!1}}class Fe extends He{#N=null;#$;#L;#M;constructor(e,t,n={}){n.listenOnFocus=!0,super(e,t,n);let i=this;this.#$=e=>{e.preventDefault(),i.blueprint.mousePosition=i.locationFromEvent(e)},this.#L=e=>{i.#N||(e.preventDefault(),this.#N=e.detail.tracker,i.unlistenMouseMove())},this.#M=e=>{i.#N==e.detail.tracker&&(e.preventDefault(),i.#N=null,i.listenMouseMove())}}listenMouseMove(){this.target.addEventListener("mousemove",this.#$)}unlistenMouseMove(){this.target.removeEventListener("mousemove",this.#$)}listenEvents(){this.listenMouseMove(),this.blueprint.addEventListener(J.trackingMouseEventName.begin,this.#L),this.blueprint.addEventListener(J.trackingMouseEventName.end,this.#M)}unlistenEvents(){this.unlistenMouseMove(),this.blueprint.removeEventListener(J.trackingMouseEventName.begin,this.#L),this.blueprint.removeEventListener(J.trackingMouseEventName.end,this.#M)}}class je extends Y{static properties={};#T=[];#t;get blueprint(){return this.#t}set blueprint(e){this.#t=e}#O;get entity(){return this.#O}set entity(e){this.#O=e}#D;get template(){return this.#D}inputObjects=[];constructor(e,t){super(),this.#O=e,this.#D=t,this.inputObjects=[],this.#D.constructed(this)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.blueprint=this.closest("ueb-blueprint"),this.template.connectedCallback()}willUpdate(e){super.willUpdate(e),this.template.willUpdate(e)}update(e){super.update(e),this.template.update(e)}render(){return this.template.render()}firstUpdated(e){super.firstUpdated(e),this.template.firstUpdated(e),this.template.inputSetup()}updated(e){super.updated(e),this.template.updated(e),this.#T.forEach((t=>t(e))),this.#T=[]}disconnectedCallback(){super.disconnectedCallback(),this.template.cleanup()}addNextUpdatedCallbacks(e,t=!1){this.#T.push(e),t&&this.requestUpdate()}isSameGraph(e){return this.blueprint&&this.blueprint==e?.blueprint}getInputObject(e){return this.template.inputObjects.find((t=>t.constructor==e))}}class Ve extends je{static properties={...super.properties,locationX:{type:Number,attribute:!1},locationY:{type:Number,attribute:!1}};static dragEventName=J.dragEventName;static dragGeneralEventName=J.dragGeneralEventName;constructor(e,t){super(e,t),this.locationX=0,this.locationY=0}setLocation([e,t]){const n=[e-this.locationX,t-this.locationY];if(this.locationX=e,this.locationY=t,this.blueprint){const e=new CustomEvent(this.constructor.dragEventName,{detail:{value:n},bubbles:!1,cancelable:!0});this.dispatchEvent(e)}}addLocation([e,t]){this.setLocation([this.locationX+e,this.locationY+t])}dispatchDragEvent(e){const t=new CustomEvent(this.constructor.dragGeneralEventName,{detail:{value:e},bubbles:!0,cancelable:!0});this.dispatchEvent(t)}snapToGrid(){const e=ie.snapToGrid([this.locationX,this.locationY],J.gridSize);this.locationX==e[0]&&this.locationY==e[1]||this.setLocation(e)}}class Ue extends Ve{static properties={...super.properties,selected:{type:Boolean,attribute:"data-selected",reflect:!0,converter:ie.booleanConverter}};constructor(...e){super(...e),this.selected=!1,this.listeningDrag=!1;let t=this;this.dragHandler=e=>t.addLocation(e.detail.value)}connectedCallback(){super.connectedCallback(),this.setSelected(this.selected)}disconnectedCallback(){super.disconnectedCallback(),this.blueprint.removeEventListener(J.nodeDragGeneralEventName,this.dragHandler)}setSelected(e=!0){this.selected=e,this.blueprint&&(this.selected?(this.listeningDrag=!0,this.blueprint.addEventListener(J.nodeDragGeneralEventName,this.dragHandler)):(this.blueprint.removeEventListener(J.nodeDragGeneralEventName,this.dragHandler),this.listeningDrag=!1))}}class We extends ze{clicked(e){this.options.repositionOnClick&&(this.target.setLocation(this.stepSize>1?ie.snapToGrid(e,this.stepSize):e),this.clickedOffset=[0,0])}dragTo(e,t){const n=[this.target.locationX,this.target.locationY],[i,r]=this.stepSize>1?[ie.snapToGrid(e,this.stepSize),ie.snapToGrid(n,this.stepSize)]:[e,n];0==(t=[i[0]-this.mouseLocation[0],i[1]-this.mouseLocation[1]])[0]&&0==t[1]||(t[0]+=r[0]-this.target.locationX,t[1]+=r[1]-this.target.locationY,this.dragAction(i,t),this.mouseLocation=i)}dragAction(e,t){this.target.setLocation([e[0]-this.clickedOffset[0],e[1]-this.clickedOffset[1]])}}class qe extends Te{getDraggableElement(){return this.element}createDraggableObject(){return new We(this.element,this.element.blueprint,{draggableElement:this.getDraggableElement()})}createInputObjects(){return[...super.createInputObjects(),this.createDraggableObject()]}}class Ke extends qe{update(e){super.update(e),e.has("locationX")&&(this.element.style.left=`${this.element.locationX}px`),e.has("locationY")&&(this.element.style.top=`${this.element.locationY}px`)}}class Xe extends We{startDrag(){this.target.selected||(this.blueprint.unselectAll(),this.target.setSelected(!0))}dragAction(e,t){this.target.dispatchDragEvent(t)}unclicked(){this.started||(this.blueprint.unselectAll(),this.target.setSelected(!0))}}class Ye extends Ke{getDraggableElement(){return this.element}createDraggableObject(){return new Xe(this.element,this.element.blueprint,{draggableElement:this.getDraggableElement()})}firstUpdated(e){super.firstUpdated(e),this.element.selected&&!this.element.listeningDrag&&this.element.setSelected(!0)}}class Ze extends ze{constructor(e,t,n={}){n.consumeEvent=!0,super(e,t,n)}}class Je extends je{static properties={...super.properties,fromX:{type:Number,attribute:!1},fromY:{type:Number,attribute:!1},toX:{type:Number,attribute:!1},toY:{type:Number,attribute:!1}};constructor(...e){super(...e),this.fromX=0,this.fromY=0,this.toX=0,this.toY=0}setBothLocations([e,t]){this.fromX=e,this.fromY=t,this.toX=e,this.toY=t}addSourceLocation([e,t]){this.fromX+=e,this.fromY+=t}addDestinationLocation([e,t]){this.toX+=e,this.toY+=t}}class Qe extends Te{update(e){super.update(e);const[t,n,i,r]=[Math.round(this.element.fromX),Math.round(this.element.fromY),Math.round(this.element.toX),Math.round(this.element.toY)],[s,o,a,l]=[Math.min(t,i),Math.min(n,r),Math.abs(t-i),Math.abs(n-r)];(e.has("fromX")||e.has("toX"))&&(this.element.style.left=`${s}px`,this.element.style.width=`${a}px`),(e.has("fromY")||e.has("toY"))&&(this.element.style.top=`${o}px`,this.element.style.height=`${l}px`)}}class et extends Qe{static decreasingValue(e,t){const n=-e*t[0]**2,i=t[1]-n/t[0];return e=>n/e+i}static clampedLine(e,t){if(e[0]>t[0]){const n=e;e=t,t=n}const n=(t[1]-e[1])/(t[0]-e[0]),i=e[1]-n*e[0];return r=>rt[0]?t[1]:n*r+i}static c1DecreasingValue=et.decreasingValue(-.15,[100,15]);static c2DecreasingValue=et.decreasingValue(-.06,[500,130]);static c2Clamped=et.clampedLine([0,100],[200,30]);willUpdate(e){super.willUpdate(e);const t=Math.max(Math.abs(this.element.fromX-this.element.toX),1),n=Math.max(t,J.linkMinWidth),i=t/n,r=this.element.originatesFromInput?this.element.fromXthis.element.toY?1:0)),this.element.style.setProperty("--ueb-start-percentage",`${Math.round(this.element.startPercentage)}%`),this.element.style.setProperty("--ueb-link-start",`${Math.round(this.element.startPixels)}`)}render(){const e="ueb-id-"+Math.floor(1e12*Math.random());return M` ${""!=this.element.linkMessageIcon||""!=this.element.linkMessageText?M`
${this.element.linkMessageText}
`:O}`}}class tt extends Je{static properties={...super.properties,source:{type:String,reflect:!0},destination:{type:String,reflect:!0},dragging:{type:Boolean,attribute:"data-dragging",converter:ie.booleanConverter,reflect:!0},originatesFromInput:{type:Boolean,attribute:!1},svgPathD:{type:String,attribute:!1},linkMessageIcon:{type:String,attribute:!1},linkMessageText:{type:String,attribute:!1}};#H;get sourcePin(){return this.#H}set sourcePin(e){this.#_(e,!1)}#I;get destinationPin(){return this.#I}set destinationPin(e){this.#_(e,!0)}#B;#R;#z;#G;#F;pathElement;constructor(e,t){super({},new et);const n=this;this.#B=()=>n.remove(),this.#R=e=>n.addSourceLocation(e.detail.value),this.#z=e=>n.addDestinationLocation(e.detail.value),this.#G=e=>n.setSourceLocation(),this.#F=e=>n.setDestinationLocation(),this.source=null,this.destination=null,this.dragging=!1,this.originatesFromInput=!1,this.startPercentage=0,this.svgPathD="",this.startPixels=0,this.linkMessageIcon="",this.linkMessageText="",e&&(this.sourcePin=e,t||(this.toX=this.fromX,this.toY=this.fromY)),t&&(this.destinationPin=t,e||(this.fromX=this.toX,this.fromY=this.toY)),this.#j()}#_(e,t){const n=()=>t?this.destinationPin:this.sourcePin;if(n()!=e){if(n()){const e=n().getNodeElement();e.removeEventListener(J.nodeDeleteEventName,this.#B),e.removeEventListener(J.nodeDragEventName,t?this.#z:this.#R),e.removeEventListener(J.nodeReflowEventName,t?this.#F:this.#G),this.#V()}if(t?this.#I=e:this.#H=e,n()){const e=n().getNodeElement();e.addEventListener(J.nodeDeleteEventName,this.#B),e.addEventListener(J.nodeDragEventName,t?this.#z:this.#R),e.addEventListener(J.nodeReflowEventName,t?this.#F:this.#G),t?this.setDestinationLocation():(this.setSourceLocation(),this.originatesFromInput=this.sourcePin.isInput()),this.#j()}}}#j(){this.sourcePin&&this.destinationPin&&(this.sourcePin.linkTo(this.destinationPin),this.destinationPin.linkTo(this.sourcePin))}#V(){this.sourcePin&&this.destinationPin&&(this.sourcePin.unlinkFrom(this.destinationPin),this.destinationPin.unlinkFrom(this.sourcePin))}disconnectedCallback(){super.disconnectedCallback(),this.#V(),this.sourcePin=null,this.destinationPin=null}setSourceLocation(e=null){if(null==e){const t=this;if(!this.hasUpdated||!this.sourcePin.hasUpdated)return void Promise.all([this.updateComplete,this.sourcePin.updateComplete]).then((()=>t.setSourceLocation()));e=this.sourcePin.template.getLinkLocation()}const[t,n]=e;this.fromX=t,this.fromY=n}setDestinationLocation(e=null){if(null==e){const t=this;if(!this.hasUpdated||!this.destinationPin.hasUpdated)return void Promise.all([this.updateComplete,this.destinationPin.updateComplete]).then((()=>t.setDestinationLocation()));e=this.destinationPin.template.getLinkLocation()}this.toX=e[0],this.toY=e[1]}startDragging(){this.dragging=!0}finishDragging(){this.dragging=!1}removeMessage(){this.linkMessageIcon="",this.linkMessageText=""}setMessageConvertType(){this.linkMessageIcon="ueb-icon-conver-type",this.linkMessageText=`Convert ${this.sourcePin.pinType} to ${this.destinationPin.pinType}.`}setMessageCorrect(){this.linkMessageIcon="ueb-icon-correct",this.linkMessageText=""}setMessageDirectionsIncompatible(){this.linkMessageIcon="ueb-icon-directions-incompatible",this.linkMessageText="Directions are not compatbile."}setMessagePlaceNode(){this.linkMessageIcon="ueb-icon-place-node",this.linkMessageText="Place a new node."}setMessageReplaceLink(){this.linkMessageIcon="ueb-icon-replace-link",this.linkMessageText="Replace existing input connections."}setMessageSameNode(){this.linkMessageIcon="ueb-icon-same-node",this.linkMessageText="Both are on the same node."}setMEssagetypesIncompatible(){this.linkMessageIcon="ueb-icon-types-incompatible",this.linkMessageText=`${this.sourcePin.pinType} is not compatible with ${this.destinationPin.pinType}.`}}customElements.define("ueb-link",tt);class nt extends ze{#U;#W;#q;link;enteredPin;linkValid=!1;constructor(e,t,n){super(e,t,n);let i=this;this.#W=e=>{if(!i.enteredPin){i.linkValid=!1,i.enteredPin=e.target;const t=i.enteredPin,n=i.target;t.getNodeElement()==n.getNodeElement()?i.link.setMessageSameNode():t.isOutput()==n.isOutput()||t.isOutput()==n.isOutput()?i.link.setMessageDirectionsIncompatible():i.blueprint.getLinks([t,n]).length?(i.link.setMessageReplaceLink(),i.linkValid=!0):(i.link.setMessageCorrect(),i.linkValid=!0)}},this.#q=e=>{i.enteredPin==e.target&&(i.enteredPin=null,i.linkValid=!1,i.link?.setMessagePlaceNode())}}startDrag(e){this.link=new tt(this.target,null),this.blueprint.linksContainerElement.prepend(this.link),this.link.setMessagePlaceNode(),this.#U=this.blueprint.querySelectorAll("ueb-pin"),this.#U.forEach((e=>{e!=this.target&&(e.getClickableElement().addEventListener("mouseenter",this.#W),e.getClickableElement().addEventListener("mouseleave",this.#q))})),this.link.startDragging(),this.link.setDestinationLocation(e)}dragTo(e,t){this.link.setDestinationLocation(e)}endDrag(){this.#U.forEach((e=>{e.removeEventListener("mouseenter",this.#W),e.removeEventListener("mouseleave",this.#q)})),this.enteredPin&&this.linkValid?(this.blueprint.addGraphElement(this.link),this.link.destinationPin=this.enteredPin,this.link.removeMessage(),this.link.finishDragging()):(this.link.finishDragging(),this.link.remove()),this.enteredPin=null,this.link=null,this.#U=null}}class it extends Te{connectedCallback(){super.connectedCallback(),this.element.nodeElement=this.element.closest("ueb-node")}createInputObjects(){return[new nt(this.element.clickableElement,this.element.blueprint,{moveEverywhere:!0})]}render(){const e=M`
`}renderIcon(){return M``}renderInput(){return M``}firstUpdated(e){super.firstUpdated(e),this.element.dataset.id=this.element.GetPinIdValue(),this.element.clickableElement=this.element}getLinkLocation(){const e=this.element.querySelector(".ueb-pin-icon").getBoundingClientRect(),t=ie.convertLocation([(e.left+e.right)/2,(e.top+e.bottom)/2],this.element.blueprint.gridElement);return this.element.blueprint.compensateTranslation(t)}}class rt extends it{#K;firstUpdated(e){super.firstUpdated(e),this.#K=this.element.querySelector(".ueb-pin-input");let t=this;this.onChangeHandler=e=>this.element.setDefaultValue(t.#K.checked),this.#K.addEventListener("change",this.onChangeHandler)}cleanup(){super.cleanup(),this.#K.removeEventListener("change",this.onChangeHandler)}createInputObjects(){return[...super.createInputObjects(),new Ze(this.#K,this.element.blueprint)]}renderInput(){return this.element.isInput()?M``:super.renderInput()}}class st extends it{renderIcon(){return M``}}
+var K,X;null==q||q(I,z),(null!==(m=globalThis.litHtmlVersions)&&void 0!==m?m:globalThis.litHtmlVersions=[]).push("2.2.7");class Y extends p{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const n=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=n.firstChild),n}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{var i,r;const s=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:t;let o=s._$litPart$;if(void 0===o){const e=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:null;s._$litPart$=o=new z(t.insertBefore(w(),e),e,void 0,null!=n?n:{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return T}}Y.finalized=!0,Y._$litElement$=!0,null===(K=globalThis.litElementHydrateSupport)||void 0===K||K.call(globalThis,{LitElement:Y});const Z=globalThis.litElementPolyfillSupport;null==Z||Z({LitElement:Y}),(null!==(X=globalThis.litElementVersions)&&void 0!==X?X:globalThis.litElementVersions=[]).push("3.2.2");class J{static alphaPattern="repeating-conic-gradient(#7c8184 0% 25%, #c2c3c4 0% 50%) 50% / 10px 10px";static colorDragEventName="ueb-color-drag";static colorPickEventName="ueb-color-pick";static colorWindowEventName="ueb-color-window";static deleteNodesKeyboardKey="Delete";static dragGeneralEventName="ueb-drag-general";static dragEventName="ueb-drag";static editTextEventName={begin:"ueb-edit-text-begin",end:"ueb-edit-text-end"};static enableZoomIn=["LeftControl","RightControl"];static expandGridSize=400;static focusEventName={begin:"blueprint-focus",end:"blueprint-unfocus"};static fontSize=r``;static gridAxisLineColor=r``;static gridExpandThreshold=.25;static gridLineColor=r``;static gridLineWidth=1;static gridSet=8;static gridSetLineColor=r``;static gridShrinkThreshold=4;static gridSize=16;static hexColorRegex=/^\s*#(?[0-9a-fA-F]{2})(?[0-9a-fA-F]{2})(?[0-9a-fA-F]{2})([0-9a-fA-F]{2})?|#(?[0-9a-fA-F])(?[0-9a-fA-F])(?[0-9a-fA-F])\s*$/;static keysSeparator="+";static linkCurveHeight=15;static linkCurveWidth=80;static linkMinWidth=100;static linkRightSVGPath=(e,t,n)=>{let i=100-e;return`M ${e} 0 C ${t} 0, ${n} 0, 50 50 S ${i-t+e} 100, ${i} 100`};static maxZoom=7;static minZoom=-12;static mouseWheelFactor=.2;static nodeDeleteEventName="ueb-node-delete";static nodeDragGeneralEventName="ueb-node-drag-general";static nodeDragEventName="ueb-node-drag";static nodeName=(e,t)=>`${e}_${t}`;static nodeRadius=8;static nodeReflowEventName="ueb-node-reflow";static pinColor={"/Script/CoreUObject.LinearColor":r``,"/Script/CoreUObject.Rotator":r``,"/Script/CoreUObject.Transform":r``,"/Script/CoreUObject.Vector":r``,bool:r``,default:r``,exec:r``,name:r``,real:r``,string:r``};static selectAllKeyboardKey="(bCtrl=True,Key=A)";static trackingMouseEventName={begin:"ueb-tracking-mouse-begin",end:"ueb-tracking-mouse-end"};static windowApplyEventName="ueb-window-apply";static windowCancelEventName="ueb-window-cancel";static windowCloseEventName="ueb-window-close";static ModifierKeys=["Ctrl","Shift","Alt","Meta"];static Keys={Backspace:"Backspace",Tab:"Tab",LeftControl:"ControlLeft",RightControl:"ControlRight",LeftShift:"ShiftLeft",RightShift:"ShiftRight",LeftAlt:"AltLeft",RightAlt:"AltRight",Enter:"Enter",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Space:"Space",PageUp:"PageUp",PageDown:"PageDown",End:"End",Home:"Home",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",PrintScreen:"PrintScreen",Insert:"Insert",Delete:"Delete",Zero:"Digit0",One:"Digit1",Two:"Digit2",Three:"Digit3",Four:"Digit4",Five:"Digit5",Six:"Digit6",Seven:"Digit7",Eight:"Digit8",Nine:"Digit9",A:"KeyA",B:"KeyB",C:"KeyC",D:"KeyD",E:"KeyE",F:"KeyF",G:"KeyG",H:"KeyH",I:"KeyI",K:"KeyK",L:"KeyL",M:"KeyM",N:"KeyN",O:"KeyO",P:"KeyP",Q:"KeyQ",R:"KeyR",S:"KeyS",T:"KeyT",U:"KeyU",V:"KeyV",W:"KeyW",X:"KeyX",Y:"KeyY",Z:"KeyZ",NumPadZero:"Numpad0",NumPadOne:"Numpad1",NumPadTwo:"Numpad2",NumPadThree:"Numpad3",NumPadFour:"Numpad4",NumPadFive:"Numpad5",NumPadSix:"Numpad6",NumPadSeven:"Numpad7",NumPadEight:"Numpad8",NumPadNine:"Numpad9",Multiply:"NumpadMultiply",Add:"NumpadAdd",Subtract:"NumpadSubtract",Decimal:"NumpadDecimal",Divide:"NumpadDivide",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",NumLock:"NumLock",ScrollLock:"ScrollLock"}}class Q{#e;get target(){return this.#e}#t;get blueprint(){return this.#t}options;constructor(e,t,n={}){n.consumeEvent??=!1,n.listenOnFocus??=!1,n.unlistenOnTextEdit??=!1,this.#e=e,this.#t=t,this.options=n;let i=this;this.listenHandler=e=>i.listenEvents(),this.unlistenHandler=e=>i.unlistenEvents(),this.options.listenOnFocus&&(this.blueprint.addEventListener(J.focusEventName.begin,this.listenHandler),this.blueprint.addEventListener(J.focusEventName.end,this.unlistenHandler)),this.options.unlistenOnTextEdit&&(this.blueprint.addEventListener(J.editTextEventName.begin,this.unlistenHandler),this.blueprint.addEventListener(J.editTextEventName.end,this.listenHandler))}unlistenDOMElement(){this.unlistenEvents(),this.blueprint.removeEventListener(J.focusEventName.begin,this.listenHandler),this.blueprint.removeEventListener(J.focusEventName.end,this.unlistenHandler),this.blueprint.removeEventListener(J.editTextEventName.begin,this.unlistenHandler),this.blueprint.removeEventListener(J.editTextEventName.end,this.listenHandler)}listenEvents(){}unlistenEvents(){}}class ee{#n;constructor(e){this.#n=e}calculate(e){return this.#n(e)}}class te{static#i=new Map;static registerSerializer(e,t){te.#i.set(e,t)}static getSerializer(e){return te.#i.get(e)}}class ne{#r;get type(){return this.#r}set type(e){this.#r=e}#s=!0;get showDefault(){return this.#s}set showDefault(e){this.#s=e}#o;get value(){return this.#o}set value(e){this.#o=e}#a;get serialized(){return this.#a}set serialized(e){this.#a=e}#l;get ignored(){return this.#l}set ignored(e){this.#l=e}static sanitize(e,t){return void 0===t&&(t=e?.constructor),t&&!(e?.constructor===t||e instanceof t)&&(e=new t(e)),(e instanceof Boolean||e instanceof Number||e instanceof String)&&(e=e.valueOf()),e}constructor(e,t=!0,n,i=!1,r=!1){void 0===n&&(n=e instanceof Array?[]:i?"":()=>ne.sanitize(new e)),this.#r=e,this.#s=t,this.#o=n,this.#a=i,this.#l=r}}class ie{static emptyObj={};static booleanConverter={fromAttribute:(e,t)=>{},toAttribute:(e,t)=>!0===e?"true":!1===e?"false":""};static sigmoid(e,t=1.7){return 1/(1+e/(1-e)**-t)}static clamp(e,t,n){return Math.min(Math.max(e,t),n)}static getScale(e){const t=getComputedStyle(e).getPropertyValue("--ueb-scale");return""!=t?parseFloat(t):1}static minDecimals(e,t=1){const n=e*10**t;return Math.abs(n%1)>Number.EPSILON?e.toString():e.toFixed(t)}static roundDecimals(e,t=1){const n=10**t;return Math.round(e*n)/n}static convertLocation(e,t){const n=1/ie.getScale(t),i=t.getBoundingClientRect();return[Math.round((e[0]-i.x)*n),Math.round((e[1]-i.y)*n)]}static isSerialized(e,t,n=ie.objectGet(e.constructor.attributes,t)){return n instanceof ee?ie.isSerialized(e,t,n.calculate(e)):n instanceof ne&&(!!n.serialized||ie.isSerialized(e,t,n.type))}static objectGet(e,t,n){if(void 0!==e){if(!(t instanceof Array))throw new TypeError("Expected keys to be an array.");return 0!=t.length&&t[0]in e&&void 0!==e[t[0]]?1==t.length?e[t[0]]:ie.objectGet(e[t[0]],t.slice(1),n):n}}static objectSet(e,t,n,i=!1,r=Object){if(!(t instanceof Array))throw new TypeError("Expected keys to be an array.");if(1==t.length){if(i||t[0]in e||void 0===e[t[0]])return e[t[0]]=n,!0}else if(t.length>0)return!i||e[t[0]]instanceof Object||(e[t[0]]=new r),ie.objectSet(e[t[0]],t.slice(1),n,i,r);return!1}static equals(e,t){return(e=ne.sanitize(e))===(t=ne.sanitize(t))||(e instanceof Array&&t instanceof Array?e.length==t.length&&!e.find(((e,n)=>!ie.equals(e,t[n]))):void 0)}static getType(e){return null===e?null:e instanceof ne?ie.getType(e.type):e instanceof Function?e:e?.constructor}static snapToGrid(e,t){return 1===t?e:[t*Math.round(e[0]/t),t*Math.round(e[1]/t)]}static mergeArrays(e=[],t=[]){let n=[];for(let i=0;i","\n")}static formatStringName(e){return e.trim().replace(/^b/,"").replaceAll(/(?<=[a-z])(?=[A-Z])|_|\s+/g," ")}static getIdFromReference(e){return e.replace(/(?:.+\.)?([^\.]+)$/,"$1").replaceAll(/(?<=[a-z\d])(?=[A-Z])|(?<=[a-zA-Z])(?=\d)|(?<=[A-Z]{2})(?=[A-Z][a-z])/g,"-").toLocaleLowerCase()}static printLinearColor(e){return`${Math.round(255*e.R.valueOf())}, ${Math.round(255*e.G.valueOf())}, ${Math.round(255*e.B.valueOf())}`}static getPolarCoordinates([e,t],n=!1){let i=Math.atan2(t,e);return n&&i<0&&(i=2*Math.PI+i),[Math.sqrt(e*e+t*t),i]}static getCartesianCoordinates([e,t]){return[e*Math.cos(t),e*Math.sin(t)]}static range(e,t,n=1){return Array.from({length:Math.ceil((t-e)/n)},((t,i)=>e+i*n))}}class re extends class{#u=new Map;subscribe(e,t){let n=this.#u;if(n.has(e)){let i=n.get(e);if(i.includes(t))return!1;i.push(t)}else{let i=!1,r=Object.getOwnPropertyDescriptor(this,e);if(!r&&(i=!0,r=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e)??{},!r))return!1;n.set(e,[t]);const s="value"in r,o="set"in r;if(!s&&!o)throw new Error(`Property ${e} is not a value or a setter`);const a=Symbol.for(e+"Storage"),l=Symbol.for(e+"ValInfo");Object.defineProperties(i?Object.getPrototypeOf(this):this,{[a]:{configurable:!0,enumerable:!1,...s?{value:this[e],writable:!0}:{get:r.get,set:r.set}},[l]:{configurable:!0,enumerable:!1,value:[i,s]},[e]:{configurable:!0,...s&&{get(){return this[a]}},set(t){this[a]=t,n.get(e).forEach((t=>{t(this[e])}))}}})}return!0}unsubscribe(e,t){let n=this.#u.get(e);if(!n?.includes(t))return!1;if(n.splice(n.indexOf(t),1),0==n.length){const t=Symbol.for(e+"Storage"),n=Symbol.for(e+"ValInfo"),i=this[n][0];this[n][1],Object.defineProperty(i?Object.getPrototypeOf(this):this,e,Object.getOwnPropertyDescriptor(i?Object.getPrototypeOf(this):this,t)),delete this[n],delete this[t]}return!0}}{static attributes={};constructor(e){super();const t=(e,n,i,r="")=>{for(let s of ie.mergeArrays(Object.getOwnPropertyNames(n),Object.getOwnPropertyNames(i??{}))){let o=ie.objectGet(i,[s]),a=n[s],l=ie.getType(a);if(a instanceof ee&&(a=a.calculate(this),l=ie.getType(a)),s in n?s in i||void 0===a||a instanceof ne&&!a.showDefault||console.warn(`${this.constructor.name} will add attribute ${r}${s} not defined in the serialized data`):console.warn(`Attribute ${r}${s} in the serialized data is not defined in ${this.constructor.name}.attributes`),l!==Object)if(void 0===o){if(a instanceof ne){if(!a.showDefault){e[s]=void 0;continue}a.serialized?a="":(l=a.type,a=a.value,a instanceof Function&&(a=a()))}a instanceof Array&&(a=[]),e[s]=ne.sanitize(a,l)}else o?.constructor===String&&a instanceof ne&&a.serialized&&a.type!==String&&(o=te.getSerializer(a.type).deserialize(o)),e[s]=ne.sanitize(o,ie.getType(a));else e[s]={},t(e[s],n[s],i[s],s+".")}},n=this.constructor.attributes;e.constructor!==Object&&1==Object.getOwnPropertyNames(n).length&&(e={[Object.getOwnPropertyNames(n)[0]]:e}),t(this,n,e)}}class se extends re{static attributes={type:String,path:String};constructor(e={}){super(e),this.type,this.path}}class oe extends re{static attributes={MemberParent:se,MemberName:""};constructor(e={}){super(e),this.MemberParent,this.MemberName}}class ae extends re{static attributes={value:String};static generateGuid(e=!0){let t=new Uint32Array(4);!0===e&&crypto.getRandomValues(t);let n="";return t.forEach((e=>{n+=("0".repeat(8)+e.toString(16).toUpperCase()).slice(-8)})),new ae({value:n})}constructor(e={}){super(e),this.value}valueOf(){return this.value}toString(){return this.value}}class le extends re{static attributes={value:String};static attributeConverter={fromAttribute:(e,t)=>new le(e),toAttribute:(e,t)=>e.toString()};constructor(e={}){super(e),this.value}valueOf(){return this.value}toString(){return this.value}}class ue extends re{static attributes={value:Number};constructor(e=0){super(e),this.value=Math.round(this.value)}valueOf(){return this.value}toString(){return this.value.toString()}}class ce extends re{static lookbehind="INVTEXT";static attributes={value:String};constructor(e={}){super(e),this.value}}class he extends re{static attributes={ActionName:"",bShift:!1,bCtrl:!1,bAlt:!1,bCmd:!1,Key:le};constructor(e={}){e.ActionName=e.ActionName??"",e.bShift=e.bShift??!1,e.bCtrl=e.bCtrl??!1,e.bAlt=e.bAlt??!1,e.bCmd=e.bCmd??!1,super(e),this.ActionName,this.bShift,this.bCtrl,this.bAlt,this.bCmd,this.Key}}class de extends re{static attributes={value:0};constructor(e=0){super(e),this.value=ie.clamp(this.value,0,1)}valueOf(){return this.value}toString(){return this.value.toFixed(6)}}class pe extends re{static attributes={R:de,G:de,B:de,A:new ne(de,!0,(()=>new de(1)),!1,!0),H:new ne(de,!0,void 0,!1,!0),S:new ne(de,!0,void 0,!1,!0),V:new ne(de,!0,void 0,!1,!0)};static linearToSRGB(e){return e<=0?0:e>=1?1:e<.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055}static sRGBtoLinear(e){return e<=0?0:e>=1?1:e<.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}constructor(e={}){super(e),this.R,this.G,this.B,this.A,this.H,this.S,this.V,this.#c()}#c(){const e=this.R.value,t=this.G.value,n=this.B.value;if(!(Math.abs(e-t)>Number.EPSILON||Math.abs(e-n)>Number.EPSILON||Math.abs(t-n)>Number.EPSILON))return void(this.V.value=0);const i=Math.max(e,t,n),r=Math.min(e,t,n),s=i-r;let o;switch(i){case r:o=0;break;case e:o=(t-n)/s+(te.toString(16).toUpperCase().padStart(2,"0"))).join("")}toSRGBAString(){return this.toSRGBA().map((e=>e.toString(16).toUpperCase().padStart(2,"0"))).join("")}toHSVA(){const e=this.R.value,t=this.G.value,n=this.B.value,i=this.A.value,r=Math.max(e,t,n),s=Math.min(e,t,n),o=0==r?0:(r-s)/r,a=r;return[this.H.value,o,a,i]}toNumber(){return(this.R.value<<24)+(this.G.value<<16)+(this.B.value<<8)+this.A.value}setFromRGBANumber(e){this.A.value=(255&e)/255,this.B.value=(e>>8&255)/255,this.G.value=(e>>16&255)/255,this.R.value=(e>>24&255)/255,this.#c()}setFromSRGBANumber(e){this.A.value=(255&e)/255,this.B.value=pe.sRGBtoLinear((e>>8&255)/255),this.G.value=pe.sRGBtoLinear((e>>16&255)/255),this.R.value=pe.sRGBtoLinear((e>>24&255)/255),this.#c()}toString(){return ie.printLinearColor(this)}}class me extends re{static lookbehind="NSLOCTEXT";static attributes={namespace:String,key:String,value:String};constructor(e={}){super(e),this.namespace,this.key,this.value}}class ge extends re{static attributes={value:String};constructor(e={}){super(e),this.value}valueOf(){return this.value}toString(){return this.value}}class ve extends re{static attributes={objectName:ge,pinGuid:ae};constructor(e={}){super(e),this.objectName,this.pinGuid}}class be extends re{static attributes={R:Number,P:Number,Y:Number};constructor(e={}){super(e),this.R,this.P,this.Y}}class fe extends be{}class ye extends re{static attributes={X:Number,Y:Number,Z:Number};constructor(e={}){super(e),this.X,this.Y,this.Z}}class Ee extends ye{}class we extends re{static#h={"/Script/CoreUObject.LinearColor":pe,"/Script/CoreUObject.Rotator":be,"/Script/CoreUObject.Vector":ye,bool:Boolean,exec:String,name:String,real:Number,string:String};static#d={"/Script/CoreUObject.Vector":Ee,"/Script/CoreUObject.Rotator":fe};static lookbehind="Pin";static attributes={PinId:ae,PinName:"",PinFriendlyName:new ne(me,!1,null),PinToolTip:"",Direction:new ne(String,!1,""),PinType:{PinCategory:"",PinSubCategory:"",PinSubCategoryObject:se,PinSubCategoryMemberReference:null,PinValueType:null,ContainerType:se,bIsReference:!1,bIsConst:!1,bIsWeakPointer:!1,bIsUObjectWrapper:!1,bSerializeAsSinglePrecisionFloat:!1},LinkedTo:new ne([ve],!1),DefaultValue:new ee((e=>new ne(we.getEntityType(e.getType(),!0)??String,!1,void 0,!0))),AutogeneratedDefaultValue:new ne(String,!1),DefaultObject:new ne(se,!1,null),PersistentGuid:ae,bHidden:!1,bNotConnectable:!1,bDefaultValueIsReadOnly:!1,bDefaultValueIsIgnored:!1,bAdvancedView:!1,bOrphanedPin:!1};static getEntityType(e,t=!1){const[n,i]=[this.#h[e],this.#d[e]];return t&&void 0!==i?i:n}constructor(e={}){super(e),this.PinId,this.PinName,this.PinFriendlyName,this.PinToolTip,this.Direction,this.PinType,this.LinkedTo,this.DefaultValue,this.AutogeneratedDefaultValue,this.DefaultObject,this.PersistentGuid,this.bHidden,this.bNotConnectable,this.bDefaultValueIsReadOnly,this.bDefaultValueIsIgnored,this.bAdvancedView,this.bOrphanedPin}getType(){return"struct"==this.PinType.PinCategory?this.PinType.PinSubCategoryObject.path:this.PinType.PinCategory}getDefaultValue(){return this.DefaultValue}isHidden(){return this.bHidden}isInput(){return!this.bHidden&&"EGPD_Output"!=this.Direction}isOutput(){return!this.bHidden&&"EGPD_Output"==this.Direction}isLinked(){return this.LinkedTo?.length>0??!1}linkTo(e,t){this.LinkedTo;const n=this.LinkedTo?.find((n=>n.objectName.toString()==e&&n.pinGuid.valueOf()==t.PinId.valueOf()));return!n&&((this.LinkedTo??(this.LinkedTo=[])).push(new ve({objectName:e,pinGuid:t.PinId})),!0)}unlinkFrom(e,t){const n=this.LinkedTo?.findIndex((n=>n.objectName.toString()==e&&n.pinGuid.valueOf()==t.PinId.valueOf()));return n>=0&&(1==this.LinkedTo.length?this.LinkedTo=void 0:this.LinkedTo.splice(n,1),!0)}getSubCategory(){return this.PinType.PinSubCategoryObject.path}}class Se extends re{static attributes={MemberName:String,MemberGuid:ae,bSelfContext:!1}}class ke extends re{static attributes={Class:se,Name:"",bIsPureFunc:new ne(Boolean,!1,!1),VariableReference:new ne(Se,!1,null),FunctionReference:new ne(oe,!1,null),EventReference:new ne(oe,!1,null),TargetType:new ne(se,!1,null),NodePosX:ue,NodePosY:ue,AdvancedPinDisplay:new ne(le,!1,null),EnabledState:new ne(le,!1,null),NodeGuid:ae,ErrorType:new ne(ue,!1),ErrorMsg:new ne(String,!1,""),CustomProperties:[we]};static nameRegex=/(\w+)_(\d+)/;constructor(e={}){super(e),this.Class,this.Name,this.bIsPureFunc,this.VariableReference,this.FunctionReference,this.EventReference,this.TargetType,this.NodePosX,this.NodePosY,this.AdvancedPinDisplay,this.EnabledState,this.NodeGuid,this.ErrorType,this.ErrorMsg,this.CustomProperties}getObjectName(e=!1){return e?this.getNameAndCounter()[0]:this.Name}getNameAndCounter(){const e=this.getObjectName(!1).match(ke.nameRegex);return e&&3==e.length?[e[1],parseInt(e[2])]:["",0]}getDisplayName(){let e=this.FunctionReference?.MemberName;return e?(e=ie.formatStringName(e),e):(e=ie.formatStringName(this.getNameAndCounter()[0]),e)}getCounter(){return this.getNameAndCounter()[1]}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Pe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xe={exports:{}};"undefined"!=typeof self&&self;var Ce=Pe(xe.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){function i(e){if(!(this instanceof i))return new i(e);this._=e}var r=i.prototype;function s(e,t){for(var n=0;n>7),buf:function(e){var t=o((function(e,t,n,i){return e.concat(n===i.length-1?Buffer.from([t,0]).readUInt16BE(0):i.readUInt16BE(n))}),[],e);return Buffer.from(a((function(e){return(e<<1&65535)>>8}),t))}(n.buf)}})),n}function u(){return"undefined"!=typeof Buffer}function c(){if(!u())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function h(e){c();var t=o((function(e,t){return e+t}),0,e);if(t%8!=0)throw new Error("The bits ["+e.join(", ")+"] add up to "+t+" which is not an even number of bytes; the total should be divisible by 8");var n,r=t/8,s=(n=function(e){return e>48},o((function(e,t){return e||(n(t)?t:e)}),null,e));if(s)throw new Error(s+" bit range requested exceeds 48 bit (6 byte) Number max.");return new i((function(t,n){var i=r+n;return i>t.length?S(n,r.toString()+" bytes"):w(i,o((function(e,t){var n=l(t,e.buf);return{coll:e.coll.concat(n.v),buf:n.buf}}),{coll:[],buf:t.slice(n,i)},e).coll)}))}function d(e,t){return new i((function(n,i){return c(),i+t>n.length?S(i,t+" bytes for "+e):w(i+t,n.slice(i,i+t))}))}function p(e,t){if("number"!=typeof(n=t)||Math.floor(n)!==n||t<0||t>6)throw new Error(e+" requires integer length in range [0, 6].");var n}function m(e){return p("uintBE",e),d("uintBE("+e+")",e).map((function(t){return t.readUIntBE(0,e)}))}function g(e){return p("uintLE",e),d("uintLE("+e+")",e).map((function(t){return t.readUIntLE(0,e)}))}function v(e){return p("intBE",e),d("intBE("+e+")",e).map((function(t){return t.readIntBE(0,e)}))}function b(e){return p("intLE",e),d("intLE("+e+")",e).map((function(t){return t.readIntLE(0,e)}))}function f(e){return e instanceof i}function y(e){return"[object Array]"==={}.toString.call(e)}function E(e){return u()&&Buffer.isBuffer(e)}function w(e,t){return{status:!0,index:e,value:t,furthest:-1,expected:[]}}function S(e,t){return y(t)||(t=[t]),{status:!1,index:-1,value:null,furthest:e,expected:t}}function k(e,t){if(!t)return e;if(e.furthest>t.furthest)return e;var n=e.furthest===t.furthest?function(e,t){if(function(){if(void 0!==i._supportsSet)return i._supportsSet;var e="undefined"!=typeof Set;return i._supportsSet=e,e}()&&Array.from){for(var n=new Set(e),r=0;r=0;){if(o in n){i=n[o].line,0===s&&(s=n[o].lineStart);break}("\n"===e.charAt(o)||"\r"===e.charAt(o)&&"\n"!==e.charAt(o+1))&&(r++,0===s&&(s=o+1)),o--}var a=i+r,l=t-s;return n[t]={line:a,lineStart:s},{offset:t,line:a+1,column:l+1}}function C(e){if(!f(e))throw new Error("not a parser: "+e)}function A(e,t){return"string"==typeof e?e.charAt(t):e[t]}function N(e){if("number"!=typeof e)throw new Error("not a number: "+e)}function $(e){if("function"!=typeof e)throw new Error("not a function: "+e)}function L(e){if("string"!=typeof e)throw new Error("not a string: "+e)}var M=2,T=3,O=8,D=5*O,H=4*O,_=" ";function I(e,t){return new Array(t+1).join(e)}function B(e,t,n){var i=t-e.length;return i<=0?e:I(n,i)+e}function R(e,t,n,i){return{from:e-t>0?e-t:0,to:e+n>i?i:e+n}}function z(e,t){var n,i,r,s,l,u=t.index,c=u.offset,h=1;if(c===e.length)return"Got the end of the input";if(E(e)){var d=c-c%O,p=c-d,m=R(d,D,H+O,e.length),g=a((function(e){return a((function(e){return B(e.toString(16),2,"0")}),e)}),function(e,t){var n=e.length,i=[],r=0;if(n<=t)return[e.slice()];for(var s=0;s=4&&(n+=1),h=2,r=a((function(e){return e.length<=4?e.join(" "):e.slice(0,4).join(" ")+" "+e.slice(4).join(" ")}),g),(l=(8*(s.to>0?s.to-1:s.to)).toString(16).length)<2&&(l=2)}else{var v=e.split(/\r\n|[\n\r\u2028\u2029]/);n=u.column-1,i=u.line-1,s=R(i,M,T,v.length),r=v.slice(s.from,s.to),l=s.to.toString().length}var b=i-s.from;return E(e)&&(l=(8*(s.to>0?s.to-1:s.to)).toString(16).length)<2&&(l=2),o((function(t,i,r){var o,a=r===b,u=a?"> ":_;return o=E(e)?B((8*(s.from+r)).toString(16),l,"0"):B((s.from+r+1).toString(),l," "),[].concat(t,[u+o+" | "+i],a?[_+I(" ",l)+" | "+B("",n," ")+I("^",h)]:[])}),[],r).join("\n")}function G(e,t){return["\n","-- PARSING FAILED "+I("-",50),"\n\n",z(e,t),"\n\n",(n=t.expected,1===n.length?"Expected:\n\n"+n[0]:"Expected one of the following: \n\n"+n.join(", ")),"\n"].join("");var n}function F(e){return void 0!==e.flags?e.flags:[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.unicode?"u":"",e.sticky?"y":""].join("")}function j(){for(var e=[].slice.call(arguments),t=e.length,n=0;n=2?N(t):t=0;var n=function(e){return RegExp("^(?:"+e.source+")",F(e))}(e),r=""+e;return i((function(e,i){var s=n.exec(e.slice(i));if(s){if(0<=t&&t<=s.length){var o=s[0],a=s[t];return w(i+o.length,a)}return S(i,"valid match group (0 to "+s.length+") in "+r)}return S(i,r)}))}function Y(e){return i((function(t,n){return w(n,e)}))}function Z(e){return i((function(t,n){return S(n,e)}))}function J(e){if(f(e))return i((function(t,n){var i=e._(t,n);return i.index=n,i.value="",i}));if("string"==typeof e)return J(K(e));if(e instanceof RegExp)return J(X(e));throw new Error("not a string, regexp, or parser: "+e)}function Q(e){return C(e),i((function(t,n){var i=e._(t,n),r=t.slice(n,i.index);return i.status?S(n,'not "'+r+'"'):w(n,null)}))}function ee(e){return $(e),i((function(t,n){var i=A(t,n);return n=e.length?S(t,"any character/byte"):w(t+1,A(e,t))})),se=i((function(e,t){return w(e.length,e.slice(t))})),oe=i((function(e,t){return t=0})).desc(t)},i.optWhitespace=he,i.Parser=i,i.range=function(e,t){return ee((function(n){return e<=n&&n<=t})).desc(e+"-"+t)},i.regex=X,i.regexp=X,i.sepBy=W,i.sepBy1=q,i.seq=j,i.seqMap=V,i.seqObj=function(){for(var e,t={},n=0,r=(e=arguments,Array.prototype.slice.call(e)),s=r.length,o=0;o255)throw new Error("Value specified to byte constructor ("+e+"=0x"+e.toString(16)+") is larger in value than a single byte.");var t=(e>15?"0x":"0x0")+e.toString(16);return i((function(n,i){var r=A(n,i);return r===e?w(i+1,r):S(i,t)}))},buffer:function(e){return d("buffer",e).map((function(e){return Buffer.from(e)}))},encodedString:function(e,t){return d("string",t).map((function(t){return t.toString(e)}))},uintBE:m,uint8BE:m(1),uint16BE:m(2),uint32BE:m(4),uintLE:g,uint8LE:g(1),uint16LE:g(2),uint32LE:g(4),intBE:v,int8BE:v(1),int16BE:v(2),int32BE:v(4),intLE:b,int8LE:b(1),int16LE:b(2),int32LE:b(4),floatBE:d("floatBE",4).map((function(e){return e.readFloatBE(0)})),floatLE:d("floatLE",4).map((function(e){return e.readFloatLE(0)})),doubleBE:d("doubleBE",8).map((function(e){return e.readDoubleBE(0)})),doubleLE:d("doubleLE",8).map((function(e){return e.readDoubleLE(0)}))},e.exports=i}]));let Ae=Ce;class Ne{static getGrammarForType(e,t,n=e.AttributeAnyValue){if(t instanceof ne){let i=Ne.getGrammarForType(e,t.type,n);return!t.serialized||t.type instanceof String||(i=i.wrap(Ae.string('"'),Ae.string('"'))),i}switch(ie.getType(t)){case Array:return Ae.seqMap(Ae.string("("),t.map((t=>Ne.getGrammarForType(e,ie.getType(t)))).reduce(((t,n)=>n&&t!==e.AttributeAnyValue?t.or(n):e.AttributeAnyValue)).trim(Ae.optWhitespace).sepBy(Ae.string(",")).skip(Ae.regex(/,?\s*/)),Ae.string(")"),((e,t,n)=>t));case Boolean:return e.Boolean;case oe:return e.FunctionReference;case ae:return e.Guid;case le:return e.Identifier;case ue:return e.Integer;case ce:return e.InvariantText;case pe:return e.LinearColor;case me:return e.LocalizedText;case Number:return e.Number;case se:return e.Reference;case we:return e.Pin;case ve:return e.PinReference;case de:return e.RealUnit;case be:return e.Rotator;case fe:return e.SimpleSerializationRotator;case Ee:return e.SimpleSerializationVector;case String:return e.String;case ye:return e.Vector;default:return n}}static createAttributeGrammar=(e,t,n=Ae.string("=").trim(Ae.optWhitespace))=>e.AttributeName.skip(n).chain((n=>{const i=n.split("."),r=ie.objectGet(t.attributes,i);return Ne.getGrammarForType(e,r,e.AttributeAnyValue).map((e=>t=>ie.objectSet(t,i,e,!0)))}));static createEntityGrammar=(e,t)=>Ae.seqMap(t.lookbehind?Ae.seq(Ae.string(t.lookbehind),Ae.optWhitespace,Ae.string("(")):Ae.string("("),Ne.createAttributeGrammar(e,t).trim(Ae.optWhitespace).sepBy(Ae.string(",")).skip(Ae.regex(/,?/).then(Ae.optWhitespace)),Ae.string(")"),((e,n,i)=>{let r={};return n.forEach((e=>e(r))),new t(r)}));InlineWhitespace=e=>Ae.regex(/[^\S\n]+/).desc("inline whitespace");InlineOptWhitespace=e=>Ae.regex(/[^\S\n]*/).desc("inline optional whitespace");MultilineWhitespace=e=>Ae.regex(/[^\S\n]*\n\s*/).desc("whitespace with at least a newline");Null=e=>Ae.seq(Ae.string("("),e.InlineOptWhitespace,Ae.string(")")).map((e=>null)).desc("null: ()");Boolean=e=>Ae.alt(Ae.string("True"),Ae.string("true"),Ae.string("False"),Ae.string("false")).map((e=>"true"===e.toLocaleLowerCase())).desc("either True or False");HexDigit=e=>Ae.regex(/[0-9a-fA-f]/).desc("hexadecimal digit");Number=e=>Ae.regex(/[-\+]?[0-9]+(?:\.[0-9]+)?/).map(Number).desc("a number");RealNumber=e=>Ae.regex(/[-\+]?[0-9]+\.[0-9]+/).map(Number).desc("a number written as real");RealUnit=e=>Ae.regex(/\+?[0-9]+(?:\.[0-9]+)?/).map(Number).assert((e=>e>=0&&e<=1)).desc("a number between 0 and 1");NaturalNumber=e=>Ae.regex(/0|[1-9]\d*/).map(Number).desc("a natural number");ColorNumber=e=>e.NaturalNumber.assert((e=>0<=e&&e<256),"the color must be between 0 and 256 excluded");Word=e=>Ae.regex(/[a-zA-Z]+/).desc("a word");String=e=>Ae.regex(/(?:[^"\\]|\\.)*/).wrap(Ae.string('"'),Ae.string('"')).map(ie.unescapeString).desc('string (with possibility to escape the quote using ")');ReferencePath=e=>Ae.seq(Ae.string("/"),e.PathSymbol.map((e=>e.toString())).sepBy1(Ae.string(".")).tieWith(".")).tie().atLeast(2).tie().desc('a path (words with possibly underscore, separated by ".", separated by "/")');AttributeName=e=>e.Word.sepBy1(Ae.string(".")).tieWith(".").desc('words separated by ""');None=e=>Ae.string("None").map((e=>new se({type:"None",path:""}))).desc("none");Integer=e=>Ae.regex(/[\-\+]?[0-9]+/).map((e=>new ue(e))).desc("an integer");Guid=e=>e.HexDigit.times(32).tie().map((e=>new ae({value:e}))).desc("32 digit hexadecimal value");Identifier=e=>Ae.regex(/\w+/).map((e=>new le(e)));PathSymbol=e=>Ae.regex(/[0-9\w]+/).map((e=>new ge({value:e})));Reference=e=>Ae.alt(e.None,...[e.ReferencePath.map((e=>new se({type:"",path:e})))].flatMap((e=>[e,e.trim(Ae.string('"'))])),Ae.seqMap(e.Word,Ae.optWhitespace,Ae.alt(...[e.ReferencePath].flatMap((e=>[e.wrap(Ae.string('"'),Ae.string('"')),e.wrap(Ae.string("'\""),Ae.string("\"'"))]))),((e,t,n)=>new se({type:e,path:n}))),e.Word.map((e=>new se({type:e,path:""}))));LocalizedText=e=>Ae.seqMap(Ae.string(me.lookbehind).skip(Ae.optWhitespace).skip(Ae.string("(")),e.String.trim(Ae.optWhitespace),Ae.string(","),e.String.trim(Ae.optWhitespace),Ae.string(","),e.String.trim(Ae.optWhitespace),Ae.string(")"),((e,t,n,i,r,s,o)=>new me({namespace:t,key:i,value:s})));InvariantText=e=>e.String.trim(Ae.optWhitespace).wrap(Ae.string(ce.lookbehind).skip(Ae.optWhitespace).skip(Ae.string("(")),Ae.string(")")).map((e=>new ce({value:e})));AttributeAnyValue=e=>Ae.alt(e.Null,e.None,e.Boolean,e.Number,e.Integer,e.String,e.Guid,e.LocalizedText,e.InvariantText,e.Reference,e.Vector,e.LinearColor);PinReference=e=>Ae.seqMap(e.PathSymbol,Ae.whitespace,e.Guid,((e,t,n)=>new ve({objectName:e,pinGuid:n})));Vector=e=>Ne.createEntityGrammar(e,ye);Rotator=e=>Ne.createEntityGrammar(e,be);SimpleSerializationRotator=e=>Ae.seqMap(e.Number,Ae.string(",").trim(Ae.optWhitespace),e.Number,Ae.string(",").trim(Ae.optWhitespace),e.Number,((e,t,n,i,r)=>new fe({R:r,P:e,Y:n})));SimpleSerializationVector=e=>Ae.seqMap(e.Number,Ae.string(",").trim(Ae.optWhitespace),e.Number,Ae.string(",").trim(Ae.optWhitespace),e.Number,((e,t,n,i,r)=>new Ee({X:e,Y:n,Z:r})));LinearColor=e=>Ne.createEntityGrammar(e,pe);FunctionReference=e=>Ne.createEntityGrammar(e,oe);KeyBinding=e=>Ae.alt(e.Identifier.map((e=>new he({Key:e}))),Ne.createEntityGrammar(e,he));Pin=e=>Ne.createEntityGrammar(e,we);CustomProperties=e=>Ae.string("CustomProperties").then(Ae.whitespace).then(e.Pin).map((e=>t=>{let n=ie.objectGet(t,["CustomProperties"],[]);n.push(e),ie.objectSet(t,["CustomProperties"],n,!0)}));Object=e=>Ae.seqMap(Ae.seq(Ae.string("Begin"),Ae.whitespace,Ae.string("Object"),Ae.whitespace),Ae.alt(e.CustomProperties,Ne.createAttributeGrammar(e,ke)).sepBy1(Ae.whitespace),Ae.seq(e.MultilineWhitespace,Ae.string("End"),Ae.whitespace,Ae.string("Object")),((e,t,n)=>{let i={};return t.forEach((e=>e(i))),new ke(i)}));MultipleObject=e=>e.Object.sepBy1(Ae.whitespace).trim(Ae.optWhitespace);LinearColorFromHex=e=>Ae.string("#").then(e.HexDigit.times(2).tie().times(3,4)).trim(Ae.optWhitespace).map((([e,t,n,i])=>new pe({R:parseInt(e,16)/255,G:parseInt(t,16)/255,B:parseInt(n,16)/255,A:i?parseInt(i,16)/255:1})));LinearColorFromRGBList=e=>Ae.seqMap(e.ColorNumber,Ae.string(",").skip(Ae.optWhitespace),e.ColorNumber,Ae.string(",").skip(Ae.optWhitespace),e.ColorNumber.map(Number),((e,t,n,i,r)=>new pe({R:e/255,G:n/255,B:r/255,A:1})));LinearColorFromRGB=e=>Ae.string("rgb").then(e.LinearColorFromRGBList.wrap(Ae.regex(/\(\s*/),Ae.regex(/\s*\)/)));LinearColorFromRGBA=e=>Ae.string("rgba").then(Ae.seqMap(e.ColorNumber,Ae.string(",").skip(Ae.optWhitespace),e.ColorNumber,Ae.string(",").skip(Ae.optWhitespace),e.ColorNumber.map(Number),Ae.string(",").skip(Ae.optWhitespace),Ae.regex(/0?\.\d+|[01]/).map(Number),((e,t,n,i,r,s,o)=>new pe({R:e/255,G:n/255,B:r/255,A:o}))).wrap(Ae.regex(/\(\s*/),Ae.regex(/\s*\)/)));LinearColorFromAnyColor=e=>Ae.alt(e.LinearColorFromRGBList,e.LinearColorFromHex,e.LinearColorFromRGB,e.LinearColorFromRGBA)}class $e{static grammar=Ce.createLanguage(new Ne);constructor(e,t="",n=",",i=!1,r="=",s=(e=>e.join("."))){this.entityType=e,this.prefix=t,this.separator=n,this.trailingSeparator=i,this.attributeValueConjunctionSign=r,this.attributeKeyPrinter=s}deserialize(e){return this.read(e)}serialize(e,t=!1,n=e){return this.write(n,e,t)}read(e){throw new Error("Not implemented")}write(e,t,n){throw new Error("Not implemented")}writeValue(e,t,n,i){const r=te.getSerializer(ie.getType(t));if(!r)throw new Error("Unknown value type, a serializer must be registered in the SerializerFactory class");return r.write(e,t,i)}subWrite(e,t,n,i){let r="",s=t.concat("");const o=s.length-1;for(const t of Object.getOwnPropertyNames(n)){s[o]=t;const a=n[t];if(a?.constructor===Object)r+=(r.length?this.separator:"")+this.subWrite(e,s,a,i);else if(void 0!==a&&this.showProperty(e,n,s,a)){const t=ie.isSerialized(e,s);r+=(r.length?this.separator:"")+this.prefix+this.attributeKeyPrinter(s)+this.attributeValueConjunctionSign+(t?`"${this.writeValue(e,a,s,!0)}"`:this.writeValue(e,a,s,i))}}return this.trailingSeparator&&r.length&&1===s.length&&(r+=this.separator),r}showProperty(e,t,n,i){const r=this.entityType.attributes,s=ie.objectGet(r,n);return!(s instanceof ne)||!s.ignored&&(!ie.equals(s.value,i)||s.showDefault)}}class Le extends $e{constructor(){super(ke," ","\n",!1)}showProperty(e,t,n,i){switch(n.toString()){case"Class":case"Name":case"CustomProperties":return!1}return super.showProperty(e,t,n,i)}read(e){const t=$e.grammar.Object.parse(e);if(!t.status)throw new Error("Error when trying to parse the object.");return t.value}readMultiple(e){const t=$e.grammar.MultipleObject.parse(e);if(!t.status)throw new Error("Error when trying to parse the object.");return t.value}write(e,t,n){return`Begin Object Class=${t.Class.path} Name=${this.writeValue(e,t.Name,["Name"],n)}\n${this.subWrite(e,[],t,n)+t.CustomProperties.map((e=>this.separator+this.prefix+"CustomProperties "+te.getSerializer(we).serialize(e))).join("")}\nEnd Object\n`}}class Me extends Q{static#p=new Le;#m;constructor(e,t,n={}){n.listenOnFocus??=!0,n.unlistenOnTextEdit??=!0,super(e,t,n);let i=this;this.#m=e=>i.copied()}listenEvents(){document.body.addEventListener("copy",this.#m)}unlistenEvents(){document.body.removeEventListener("copy",this.#m)}copied(){const e=this.blueprint.getNodes(!0).map((e=>Me.#p.serialize(e.entity,!1))).join("\n\n");navigator.clipboard.writeText(e)}}class Te{static styles=r``;element;#g=[];get inputObjects(){return this.#g}constructed(e){this.element=e}connectedCallback(){}willUpdate(e){}update(e){}render(){return M``}firstUpdated(e){}updated(e){}inputSetup(){this.#g=this.createInputObjects()}cleanup(){this.#g.forEach((e=>e.unlistenDOMElement()))}createInputObjects(){return[]}}class Oe extends Q{#v;constructor(e,t,n={}){n.activateAnyKey??=!1,n.activationKeys??=[],n.listenOnFocus??=!0,n.unlistenOnTextEdit??=!0,n.activationKeys instanceof Array||(n.activationKeys=[n.activationKeys]),n.activationKeys=n.activationKeys.map((e=>{if(e instanceof he)return e;if(e.constructor===String){const t=$e.grammar.KeyBinding.parse(e);if(t.status)return t.value}throw new Error("Unexpected key value")})),super(e,t,n),this.#v=this.options.activationKeys??[];let i=this;this.keyDownHandler=e=>{(this.options.activateAnyKey||i.#v.some((t=>(e=>e.bShift||"LeftShift"==e.Key||"RightShift"==e.Key)(t)==e.shiftKey&&(e=>e.bCtrl||"LeftControl"==e.Key||"RightControl"==e.Key)(t)==e.ctrlKey&&(e=>e.bAlt||"LeftAlt"==e.Key||"RightAlt"==e.Key)(t)==e.altKey&&J.Keys[t.Key]==e.code)))&&(n.consumeEvent&&e.stopImmediatePropagation(),i.fire(),document.removeEventListener("keydown",i.keyDownHandler),document.addEventListener("keyup",i.keyUpHandler))},this.keyUpHandler=e=>{(this.options.activateAnyKey||i.#v.some((t=>t.bShift&&"Shift"==e.key||t.bCtrl&&"Control"==e.key||t.bAlt&&"Alt"==e.key||t.bCmd&&"Meta"==e.key||J.Keys[t.Key]==e.code)))&&(n.consumeEvent&&e.stopImmediatePropagation(),i.unfire(),document.removeEventListener("keyup",this.keyUpHandler),document.addEventListener("keydown",this.keyDownHandler))}}listenEvents(){document.addEventListener("keydown",this.keyDownHandler)}unlistenEvents(){document.removeEventListener("keydown",this.keyDownHandler)}fire(){}unfire(){}}class De extends Oe{constructor(e,t,n={}){n.activationKeys=J.deleteNodesKeyboardKey,super(e,t,n)}fire(){this.blueprint.removeGraphElement(...this.blueprint.getNodes(!0))}}class He extends Q{constructor(e,t,n={}){n.ignoreTranslateCompensate??=!1,n.movementSpace??=t.getGridDOMElement()??document.documentElement,super(e,t,n),this.movementSpace=n.movementSpace}locationFromEvent(e){const t=ie.convertLocation([e.clientX,e.clientY],this.movementSpace);return this.options.ignoreTranslateCompensate?t:this.blueprint.compensateTranslation(t)}}class _e extends He{#b;#f;constructor(e,t,n={}){n.listenOnFocus=!0,n.strictTarget??=!1,super(e,t,n),this.strictTarget=n.strictTarget;const i=this;this.#b=e=>{e.preventDefault();const t=i.locationFromEvent(e);i.wheel(Math.sign(e.deltaY*J.mouseWheelFactor),t)},this.#f=e=>e.preventDefault(),this.blueprint.focused&&this.movementSpace.addEventListener("wheel",this.#b,!1)}listenEvents(){this.movementSpace.addEventListener("wheel",this.#b,!1),this.movementSpace.parentElement?.addEventListener("wheel",this.#f)}unlistenEvents(){this.movementSpace.removeEventListener("wheel",this.#b,!1),this.movementSpace.parentElement?.removeEventListener("wheel",this.#f)}wheel(e,t){}}class Ie extends _e{#y=!1;get enableZoonIn(){return this.#y}set enableZoonIn(e){(e=Boolean(e))!=this.#y&&(this.#y=e)}wheel(e,t){let n=this.blueprint.getZoom();e=-e,!this.enableZoonIn&&0==n&&e>0||(n+=e,this.blueprint.setZoom(n,t))}}class Be extends Oe{#E;constructor(e,t,n={}){n.activationKeys=J.enableZoomIn,super(e,t,n)}fire(){this.#E=this.blueprint.getInputObject(Ie),this.#E.enableZoonIn=!0}unfire(){this.#E.enableZoonIn=!1}}class Re extends Oe{constructor(e,t,n={}){n.activationKeys=J.selectAllKeyboardKey,super(e,t,n)}fire(){this.blueprint.selectAll()}}class ze extends He{#w;#S;#k;#P;#x=!1;#C;#A;started=!1;stepSize=1;clickedPosition=[0,0];clickedOffset=[0,0];mouseLocation=[0,0];constructor(e,t,n={}){n.clickButton??=0,n.consumeEvent??=!0,n.draggableElement??=e,n.exitAnyButton??=!0,n.moveEverywhere??=!1,n.movementSpace??=t?.getGridDOMElement(),n.repositionOnClick??=!1,n.strictTarget??=!1,super(e,t,n),this.stepSize=parseInt(n?.stepSize??J.gridSize),this.#C=this.options.moveEverywhere?document.documentElement:this.movementSpace,this.#A=this.options.draggableElement;let i=this;this.#w=e=>{if(i.blueprint.setFocused(!0),e.button===i.options.clickButton)i.options.strictTarget&&e.target!=e.currentTarget||(i.options.consumeEvent&&e.stopImmediatePropagation(),i.#C.addEventListener("mousemove",i.#S),document.addEventListener("mouseup",i.#P),i.clickedPosition=i.locationFromEvent(e),i.clickedOffset=[i.clickedPosition[0]-i.target.locationX,i.clickedPosition[1]-i.target.locationY],i.clicked(i.clickedPosition));else i.options.exitAnyButton||i.#P(e)},this.#S=e=>{i.options.consumeEvent&&e.stopImmediatePropagation(),i.#C.removeEventListener("mousemove",i.#S),i.#C.addEventListener("mousemove",i.#k);const t=i.getEvent(J.trackingMouseEventName.begin);i.#x=0==i.target.dispatchEvent(t);const n=i.locationFromEvent(e);this.mouseLocation=ie.snapToGrid(this.clickedPosition,this.stepSize),i.startDrag(n),i.started=!0},this.#k=e=>{i.options.consumeEvent&&e.stopImmediatePropagation();const t=i.locationFromEvent(e),n=[e.movementX,e.movementY];i.dragTo(t,n),i.#x&&(i.blueprint.mousePosition=i.locationFromEvent(e))},this.#P=e=>{if(!i.options.exitAnyButton||e.button==i.options.clickButton){if(i.options.consumeEvent&&e.stopImmediatePropagation(),i.#C.removeEventListener("mousemove",i.#S),i.#C.removeEventListener("mousemove",i.#k),document.removeEventListener("mouseup",i.#P),i.started&&i.endDrag(),i.unclicked(),i.#x){const e=i.getEvent(J.trackingMouseEventName.end);i.target.dispatchEvent(e),i.#x=!1}i.started=!1}},this.listenEvents()}listenEvents(){this.#A.addEventListener("mousedown",this.#w),2==this.options.clickButton&&this.#A.addEventListener("contextmenu",(e=>e.preventDefault()))}unlistenEvents(){this.#A.removeEventListener("mousedown",this.#w)}getEvent(e){return new CustomEvent(e,{detail:{tracker:this},bubbles:!0,cancelable:!0})}clicked(e){}startDrag(e){}dragTo(e,t){}endDrag(){}unclicked(e){}}class Ge extends ze{startDrag(){this.blueprint.scrolling=!0}dragTo(e,t){this.blueprint.scrollDelta([-t[0],-t[1]])}endDrag(){this.blueprint.scrolling=!1}}class Fe extends He{#N=null;#$;#L;#M;constructor(e,t,n={}){n.listenOnFocus=!0,super(e,t,n);let i=this;this.#$=e=>{e.preventDefault(),i.blueprint.mousePosition=i.locationFromEvent(e)},this.#L=e=>{i.#N||(e.preventDefault(),this.#N=e.detail.tracker,i.unlistenMouseMove())},this.#M=e=>{i.#N==e.detail.tracker&&(e.preventDefault(),i.#N=null,i.listenMouseMove())}}listenMouseMove(){this.target.addEventListener("mousemove",this.#$)}unlistenMouseMove(){this.target.removeEventListener("mousemove",this.#$)}listenEvents(){this.listenMouseMove(),this.blueprint.addEventListener(J.trackingMouseEventName.begin,this.#L),this.blueprint.addEventListener(J.trackingMouseEventName.end,this.#M)}unlistenEvents(){this.unlistenMouseMove(),this.blueprint.removeEventListener(J.trackingMouseEventName.begin,this.#L),this.blueprint.removeEventListener(J.trackingMouseEventName.end,this.#M)}}class je extends Y{static properties={};#T=[];#t;get blueprint(){return this.#t}set blueprint(e){this.#t=e}#O;get entity(){return this.#O}set entity(e){this.#O=e}#D;get template(){return this.#D}inputObjects=[];constructor(e,t){super(),this.#O=e,this.#D=t,this.inputObjects=[],this.#D.constructed(this)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.blueprint=this.closest("ueb-blueprint"),this.template.connectedCallback()}willUpdate(e){super.willUpdate(e),this.template.willUpdate(e)}update(e){super.update(e),this.template.update(e)}render(){return this.template.render()}firstUpdated(e){super.firstUpdated(e),this.template.firstUpdated(e),this.template.inputSetup()}updated(e){super.updated(e),this.template.updated(e),this.#T.forEach((t=>t(e))),this.#T=[]}disconnectedCallback(){super.disconnectedCallback(),this.template.cleanup()}addNextUpdatedCallbacks(e,t=!1){this.#T.push(e),t&&this.requestUpdate()}isSameGraph(e){return this.blueprint&&this.blueprint==e?.blueprint}getInputObject(e){return this.template.inputObjects.find((t=>t.constructor==e))}}class Ve extends je{static properties={...super.properties,locationX:{type:Number,attribute:!1},locationY:{type:Number,attribute:!1}};static dragEventName=J.dragEventName;static dragGeneralEventName=J.dragGeneralEventName;constructor(e,t){super(e,t),this.locationX=0,this.locationY=0}setLocation([e,t]){const n=[e-this.locationX,t-this.locationY];if(this.locationX=e,this.locationY=t,this.blueprint){const e=new CustomEvent(this.constructor.dragEventName,{detail:{value:n},bubbles:!1,cancelable:!0});this.dispatchEvent(e)}}addLocation([e,t]){this.setLocation([this.locationX+e,this.locationY+t])}dispatchDragEvent(e){const t=new CustomEvent(this.constructor.dragGeneralEventName,{detail:{value:e},bubbles:!0,cancelable:!0});this.dispatchEvent(t)}snapToGrid(){const e=ie.snapToGrid([this.locationX,this.locationY],J.gridSize);this.locationX==e[0]&&this.locationY==e[1]||this.setLocation(e)}}class Ue extends Ve{static properties={...super.properties,selected:{type:Boolean,attribute:"data-selected",reflect:!0,converter:ie.booleanConverter}};constructor(...e){super(...e),this.selected=!1,this.listeningDrag=!1;let t=this;this.dragHandler=e=>t.addLocation(e.detail.value)}connectedCallback(){super.connectedCallback(),this.setSelected(this.selected)}disconnectedCallback(){super.disconnectedCallback(),this.blueprint.removeEventListener(J.nodeDragGeneralEventName,this.dragHandler)}setSelected(e=!0){this.selected=e,this.blueprint&&(this.selected?(this.listeningDrag=!0,this.blueprint.addEventListener(J.nodeDragGeneralEventName,this.dragHandler)):(this.blueprint.removeEventListener(J.nodeDragGeneralEventName,this.dragHandler),this.listeningDrag=!1))}}class We extends ze{clicked(e){this.options.repositionOnClick&&(this.target.setLocation(this.stepSize>1?ie.snapToGrid(e,this.stepSize):e),this.clickedOffset=[0,0])}dragTo(e,t){const n=[this.target.locationX,this.target.locationY],[i,r]=this.stepSize>1?[ie.snapToGrid(e,this.stepSize),ie.snapToGrid(n,this.stepSize)]:[e,n];0==(t=[i[0]-this.mouseLocation[0],i[1]-this.mouseLocation[1]])[0]&&0==t[1]||(t[0]+=r[0]-this.target.locationX,t[1]+=r[1]-this.target.locationY,this.dragAction(i,t),this.mouseLocation=i)}dragAction(e,t){this.target.setLocation([e[0]-this.clickedOffset[0],e[1]-this.clickedOffset[1]])}}class qe extends Te{getDraggableElement(){return this.element}createDraggableObject(){return new We(this.element,this.element.blueprint,{draggableElement:this.getDraggableElement()})}createInputObjects(){return[...super.createInputObjects(),this.createDraggableObject()]}}class Ke extends qe{update(e){super.update(e),e.has("locationX")&&(this.element.style.left=`${this.element.locationX}px`),e.has("locationY")&&(this.element.style.top=`${this.element.locationY}px`)}}class Xe extends We{startDrag(){this.target.selected||(this.blueprint.unselectAll(),this.target.setSelected(!0))}dragAction(e,t){this.target.dispatchDragEvent(t)}unclicked(){this.started||(this.blueprint.unselectAll(),this.target.setSelected(!0))}}class Ye extends Ke{getDraggableElement(){return this.element}createDraggableObject(){return new Xe(this.element,this.element.blueprint,{draggableElement:this.getDraggableElement()})}firstUpdated(e){super.firstUpdated(e),this.element.selected&&!this.element.listeningDrag&&this.element.setSelected(!0)}}class Ze extends ze{constructor(e,t,n={}){n.consumeEvent=!0,super(e,t,n)}}class Je extends je{static properties={...super.properties,fromX:{type:Number,attribute:!1},fromY:{type:Number,attribute:!1},toX:{type:Number,attribute:!1},toY:{type:Number,attribute:!1}};constructor(...e){super(...e),this.fromX=0,this.fromY=0,this.toX=0,this.toY=0}setBothLocations([e,t]){this.fromX=e,this.fromY=t,this.toX=e,this.toY=t}addSourceLocation([e,t]){this.fromX+=e,this.fromY+=t}addDestinationLocation([e,t]){this.toX+=e,this.toY+=t}}class Qe extends Te{update(e){super.update(e);const[t,n,i,r]=[Math.round(this.element.fromX),Math.round(this.element.fromY),Math.round(this.element.toX),Math.round(this.element.toY)],[s,o,a,l]=[Math.min(t,i),Math.min(n,r),Math.abs(t-i),Math.abs(n-r)];(e.has("fromX")||e.has("toX"))&&(this.element.style.left=`${s}px`,this.element.style.width=`${a}px`),(e.has("fromY")||e.has("toY"))&&(this.element.style.top=`${o}px`,this.element.style.height=`${l}px`)}}class et extends Qe{static decreasingValue(e,t){const n=-e*t[0]**2,i=t[1]-n/t[0];return e=>n/e+i}static clampedLine(e,t){if(e[0]>t[0]){const n=e;e=t,t=n}const n=(t[1]-e[1])/(t[0]-e[0]),i=e[1]-n*e[0];return r=>rt[0]?t[1]:n*r+i}static c1DecreasingValue=et.decreasingValue(-.15,[100,15]);static c2DecreasingValue=et.decreasingValue(-.06,[500,130]);static c2Clamped=et.clampedLine([0,100],[200,30]);willUpdate(e){super.willUpdate(e);const t=Math.max(Math.abs(this.element.fromX-this.element.toX),1),n=Math.max(t,J.linkMinWidth),i=t/n,r=this.element.originatesFromInput?this.element.fromXthis.element.toY?1:0)),this.element.style.setProperty("--ueb-start-percentage",`${Math.round(this.element.startPercentage)}%`),this.element.style.setProperty("--ueb-link-start",`${Math.round(this.element.startPixels)}`)}render(){const e="ueb-id-"+Math.floor(1e12*Math.random());return M` ${""!=this.element.linkMessageIcon||""!=this.element.linkMessageText?M`
${this.element.linkMessageText}
`:O}`}}class tt extends Je{static properties={...super.properties,source:{type:String,reflect:!0},destination:{type:String,reflect:!0},dragging:{type:Boolean,attribute:"data-dragging",converter:ie.booleanConverter,reflect:!0},originatesFromInput:{type:Boolean,attribute:!1},svgPathD:{type:String,attribute:!1},linkMessageIcon:{type:String,attribute:!1},linkMessageText:{type:String,attribute:!1}};#H;get sourcePin(){return this.#H}set sourcePin(e){this.#_(e,!1)}#I;get destinationPin(){return this.#I}set destinationPin(e){this.#_(e,!0)}#B;#R;#z;#G;#F;pathElement;constructor(e,t){super({},new et);const n=this;this.#B=()=>n.remove(),this.#R=e=>n.addSourceLocation(e.detail.value),this.#z=e=>n.addDestinationLocation(e.detail.value),this.#G=e=>n.setSourceLocation(),this.#F=e=>n.setDestinationLocation(),this.source=null,this.destination=null,this.dragging=!1,this.originatesFromInput=!1,this.startPercentage=0,this.svgPathD="",this.startPixels=0,this.linkMessageIcon="",this.linkMessageText="",e&&(this.sourcePin=e,t||(this.toX=this.fromX,this.toY=this.fromY)),t&&(this.destinationPin=t,e||(this.fromX=this.toX,this.fromY=this.toY)),this.#j()}#_(e,t){const n=()=>t?this.destinationPin:this.sourcePin;if(n()!=e){if(n()){const e=n().getNodeElement();e.removeEventListener(J.nodeDeleteEventName,this.#B),e.removeEventListener(J.nodeDragEventName,t?this.#z:this.#R),e.removeEventListener(J.nodeReflowEventName,t?this.#F:this.#G),this.#V()}if(t?this.#I=e:this.#H=e,n()){const e=n().getNodeElement();e.addEventListener(J.nodeDeleteEventName,this.#B),e.addEventListener(J.nodeDragEventName,t?this.#z:this.#R),e.addEventListener(J.nodeReflowEventName,t?this.#F:this.#G),t?this.setDestinationLocation():(this.setSourceLocation(),this.originatesFromInput=this.sourcePin.isInput()),this.#j()}}}#j(){this.sourcePin&&this.destinationPin&&(this.sourcePin.linkTo(this.destinationPin),this.destinationPin.linkTo(this.sourcePin))}#V(){this.sourcePin&&this.destinationPin&&(this.sourcePin.unlinkFrom(this.destinationPin),this.destinationPin.unlinkFrom(this.sourcePin))}disconnectedCallback(){super.disconnectedCallback(),this.#V(),this.sourcePin=null,this.destinationPin=null}setSourceLocation(e=null){if(null==e){const t=this;if(!this.hasUpdated||!this.sourcePin.hasUpdated)return void Promise.all([this.updateComplete,this.sourcePin.updateComplete]).then((()=>t.setSourceLocation()));e=this.sourcePin.template.getLinkLocation()}const[t,n]=e;this.fromX=t,this.fromY=n}setDestinationLocation(e=null){if(null==e){const t=this;if(!this.hasUpdated||!this.destinationPin.hasUpdated)return void Promise.all([this.updateComplete,this.destinationPin.updateComplete]).then((()=>t.setDestinationLocation()));e=this.destinationPin.template.getLinkLocation()}this.toX=e[0],this.toY=e[1]}startDragging(){this.dragging=!0}finishDragging(){this.dragging=!1}removeMessage(){this.linkMessageIcon="",this.linkMessageText=""}setMessageConvertType(){this.linkMessageIcon="ueb-icon-conver-type",this.linkMessageText=`Convert ${this.sourcePin.pinType} to ${this.destinationPin.pinType}.`}setMessageCorrect(){this.linkMessageIcon="ueb-icon-correct",this.linkMessageText=""}setMessageDirectionsIncompatible(){this.linkMessageIcon="ueb-icon-directions-incompatible",this.linkMessageText="Directions are not compatbile."}setMessagePlaceNode(){this.linkMessageIcon="ueb-icon-place-node",this.linkMessageText="Place a new node."}setMessageReplaceLink(){this.linkMessageIcon="ueb-icon-replace-link",this.linkMessageText="Replace existing input connections."}setMessageSameNode(){this.linkMessageIcon="ueb-icon-same-node",this.linkMessageText="Both are on the same node."}setMEssagetypesIncompatible(){this.linkMessageIcon="ueb-icon-types-incompatible",this.linkMessageText=`${this.sourcePin.pinType} is not compatible with ${this.destinationPin.pinType}.`}}customElements.define("ueb-link",tt);class nt extends ze{#U;#W;#q;link;enteredPin;linkValid=!1;constructor(e,t,n){super(e,t,n);let i=this;this.#W=e=>{if(!i.enteredPin){i.linkValid=!1,i.enteredPin=e.target;const t=i.enteredPin,n=i.target;t.getNodeElement()==n.getNodeElement()?i.link.setMessageSameNode():t.isOutput()==n.isOutput()||t.isOutput()==n.isOutput()?i.link.setMessageDirectionsIncompatible():i.blueprint.getLinks([t,n]).length?(i.link.setMessageReplaceLink(),i.linkValid=!0):(i.link.setMessageCorrect(),i.linkValid=!0)}},this.#q=e=>{i.enteredPin==e.target&&(i.enteredPin=null,i.linkValid=!1,i.link?.setMessagePlaceNode())}}startDrag(e){this.link=new tt(this.target,null),this.blueprint.linksContainerElement.prepend(this.link),this.link.setMessagePlaceNode(),this.#U=this.blueprint.querySelectorAll("ueb-pin"),this.#U.forEach((e=>{e!=this.target&&(e.getClickableElement().addEventListener("mouseenter",this.#W),e.getClickableElement().addEventListener("mouseleave",this.#q))})),this.link.startDragging(),this.link.setDestinationLocation(e)}dragTo(e,t){this.link.setDestinationLocation(e)}endDrag(){this.#U.forEach((e=>{e.removeEventListener("mouseenter",this.#W),e.removeEventListener("mouseleave",this.#q)})),this.enteredPin&&this.linkValid?(this.blueprint.addGraphElement(this.link),this.link.destinationPin=this.enteredPin,this.link.removeMessage(),this.link.finishDragging()):(this.link.finishDragging(),this.link.remove()),this.enteredPin=null,this.link=null,this.#U=null}}class it extends Te{connectedCallback(){super.connectedCallback(),this.element.nodeElement=this.element.closest("ueb-node")}createInputObjects(){return[new nt(this.element.clickableElement,this.element.blueprint,{moveEverywhere:!0})]}render(){const e=M`
`}renderIcon(){return M``}renderInput(){return M``}firstUpdated(e){super.firstUpdated(e),this.element.dataset.id=this.element.GetPinIdValue(),this.element.clickableElement=this.element}getLinkLocation(){const e=this.element.querySelector(".ueb-pin-icon").getBoundingClientRect(),t=ie.convertLocation([(e.left+e.right)/2,(e.top+e.bottom)/2],this.element.blueprint.gridElement);return this.element.blueprint.compensateTranslation(t)}}class rt extends it{#K;firstUpdated(e){super.firstUpdated(e),this.#K=this.element.querySelector(".ueb-pin-input");let t=this;this.onChangeHandler=e=>this.element.setDefaultValue(t.#K.checked),this.#K.addEventListener("change",this.onChangeHandler)}cleanup(){super.cleanup(),this.#K.removeEventListener("change",this.onChangeHandler)}createInputObjects(){return[...super.createInputObjects(),new Ze(this.#K,this.element.blueprint)]}renderInput(){return this.element.isInput()?M``:super.renderInput()}}class st extends it{renderIcon(){return M``}}
/**
* @license
* Copyright 2017 Google LLC
@@ -31,4 +31,4 @@ var K,X;null==q||q(I,z),(null!==(m=globalThis.litHtmlVersions)&&void 0!==m?m:glo
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
-const at=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}{constructor(e){var t;if(super(e),e.type!==ot||"style"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,n)=>{const i=e[n];return null==i?t:t+`${n=n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(e,[t]){const{style:n}=e.element;if(void 0===this.vt){this.vt=new Set;for(const e in t)this.vt.add(e);return this.render(t)}this.vt.forEach((e=>{null==t[e]&&(this.vt.delete(e),e.includes("-")?n.removeProperty(e):n[e]="")}));for(const e in t){const i=t[e];null!=i&&(this.vt.add(e),e.includes("-")?n.setProperty(e,i):n[e]=i)}return T}});class lt extends qe{#X;get locationChangeCallback(){return this.#X}set locationChangeCallback(e){this.#X=e}movementSpace;movementSpaceSize=[0,0];connectedCallback(){super.connectedCallback(),this.movementSpace=this.element.parentElement;const e=this.movementSpace.getBoundingClientRect();this.movementSpaceSize=[e.width,e.height]}createDraggableObject(){return new We(this.element,this.element.blueprint,{draggableElement:this.movementSpace,ignoreTranslateCompensate:!0,moveEverywhere:!0,movementSpace:this.movementSpace,repositionOnClick:!0,stepSize:1})}adjustLocation([e,t]){return this.locationChangeCallback?.(e,t),[e,t]}}class ut extends lt{adjustLocation([e,t]){const n=Math.round(this.movementSpaceSize[0]/2);e-=n,t=-(t-n);let[i,r]=ie.getPolarCoordinates([e,t]);return i=Math.min(i,n),[e,t]=ie.getCartesianCoordinates([i,r]),this.locationChangeCallback?.(e/n,t/n),[e=Math.round(e+n),t=Math.round(-t+n)]}}class ct extends Ve{windowElement;constructor(e,t){super(e,t)}connectedCallback(){super.connectedCallback(),this.windowElement=this.closest("ueb-window")}setLocation([e,t]){super.setLocation(this.template.adjustLocation([e,t]))}}class ht extends ct{constructor(){super({},new ut)}}customElements.define("ueb-color-handler",ht);class dt extends lt{adjustLocation([e,t]){return e=ie.clamp(e,0,this.movementSpaceSize[0]),t=ie.clamp(t,0,this.movementSpaceSize[1]),this.locationChangeCallback?.(e/this.movementSpaceSize[0],1-t/this.movementSpaceSize[1]),[e,t]}}class pt extends ct{constructor(){super({},new dt)}}customElements.define("ueb-ui-slider",pt);class mt extends Ke{toggleAdvancedDisplayHandler;getDraggableElement(){return this.element.querySelector(".ueb-window-top")}createDraggableObject(){return new We(this.element,this.element.blueprint,{draggableElement:this.getDraggableElement(),ignoreTranslateCompensate:!0,movementSpace:this.element.blueprint,stepSize:1})}render(){return M`
`:M``}}class bt extends He{#w;#P;constructor(e,t,n={}){n.clickButton??=0,n.consumeEvent??=!0,n.exitAnyButton??=!0,n.strictTarget??=!1,super(e,t,n),this.clickedPosition=[0,0];let i=this;this.#w=e=>{if(i.blueprint.setFocused(!0),e.button===i.options.clickButton)i.options.strictTarget&&e.target!=e.currentTarget||(i.options.consumeEvent&&e.stopImmediatePropagation(),document.addEventListener("mouseup",i.#P),i.clickedPosition=i.locationFromEvent(e),i.clicked(i.clickedPosition));else i.options.exitAnyButton||i.#P(e)},this.#P=e=>{i.options.exitAnyButton&&e.button!=i.options.clickButton||(i.options.consumeEvent&&e.stopImmediatePropagation(),document.removeEventListener("mouseup",i.#P),i.unclicked())},this.listenEvents()}listenEvents(){this.target.addEventListener("mousedown",this.#w),2==this.options.clickButton&&this.target.addEventListener("contextmenu",(e=>e.preventDefault()))}unlistenEvents(){this.target.removeEventListener("mousedown",this.#w)}clicked(e){}unclicked(e){}}class ft extends bt{static#me=e=>{};constructor(e,t,n,i=ft.#me,r=ft.#me){super(e,t,n),this.onMouseDown=i,this.onMouseUp=r}clicked(){this.onMouseDown(this)}unclicked(){this.onMouseUp(this)}}class yt extends Ve{static#ge={window:mt,"color-picker":gt};static properties={...Ve.properties,type:{type:mt,attribute:"data-type",reflect:!0,converter:{fromAttribute:(e,t)=>yt.#ge[e],toAttribute:(e,t)=>Object.entries(yt.#ge).find((([t,n])=>e==n))[0]}}};constructor(e={}){e.type.constructor==String&&(e.type=yt.#ge[e.type]),e.type??=mt,e.windowOptions??={},super({},new e.type),this.type=e.type,this.windowOptions=e.windowOptions}disconnectedCallback(){super.disconnectedCallback(),this.dispatchCloseEvent()}dispatchCloseEvent(){let e=new CustomEvent(J.windowCloseEventName);this.dispatchEvent(e)}}customElements.define("ueb-window",yt);class Et extends vt{#K;#ve;firstUpdated(e){super.firstUpdated(e),this.#K=this.element.querySelector(".ueb-pin-input")}createInputObjects(){return[...super.createInputObjects(),new ft(this.#K,this.element.blueprint,void 0,(e=>{this.#ve=new yt({type:gt,windowOptions:{getPinColor:()=>this.element.defaultValue,setPinColor:e=>this.element.setDefaultValue(e)}}),this.element.blueprint.append(this.#ve);const t=()=>{this.element.setDefaultValue(this.#ve.template.color)},n=()=>{this.#ve.removeEventListener(J.windowApplyEventName,t),this.#ve.removeEventListener(J.windowCloseEventName,n),this.#ve=null};this.#ve.addEventListener(J.windowApplyEventName,t),this.#ve.addEventListener(J.windowCloseEventName,n)}))]}getInputs(){return[this.#K.dataset.linearColor]}setInputs(e=[]){}renderInput(){return this.element.isInput()?M``:super.renderInput()}}class wt extends vt{onInputHandler;firstUpdated(e){super.firstUpdated(e),this.onInputHandler=e=>{e.stopPropagation(),("insertParagraph"==e.inputType||"insertLineBreak"==e.inputType||"insertFromPaste"==e.inputType&&e.target.innerText.includes("\n"))&&(e.target.blur(),this.inputContentElements.forEach((e=>e.innerText=e.innerText.replaceAll("\n",""))))},this.inputContentElements.forEach((e=>{e.addEventListener("input",this.onInputHandler)}))}cleanup(){super.cleanup(),this.inputContentElements.forEach((e=>{e.removeEventListener("input",this.onInputHandler)}))}getInputs(){return this.inputContentElements.map((e=>e.textContent))}setInputs(e=[],t=!0){e=e.map((e=>e.replaceAll("\n",""))),super.setInputs(e,t)}}class St extends vt{setInputs(e=[],t=!1){e&&0!=e.length||(e=[this.getInput()]);let n=[];for(const t of e){let e=parseFloat(t);isNaN(e)&&(e=0,!1),n.push(e)}super.setInputs(e,!1),this.setDefaultValue(n,e)}setDefaultValue(e=[],t){this.element.setDefaultValue(e[0])}}class kt extends St{setDefaultValue(e=[],t=e){this.element.setDefaultValue(e[0])}renderInput(){return this.element.isInput()?M`
`:M``}}class Pt extends it{renderIcon(){return M``}}class xt extends St{setDefaultValue(e=[],t=e){if(!(this.element.entity.DefaultValue instanceof be))throw new TypeError("Expected DefaultValue to be a VectorEntity");let n=this.element.entity.DefaultValue;n.R=e[0],n.P=e[1],n.Y=e[2]}renderInput(){return this.element.isInput()?M`
X
Y
Z
`:M``}}class Ct extends vt{}class At extends St{setDefaultValue(e,t){if(!(this.element.entity.DefaultValue instanceof ye))throw new TypeError("Expected DefaultValue to be a VectorEntity");let n=this.element.entity.DefaultValue;n.X=e[0],n.Y=e[1],n.Z=e[2]}renderInput(){return this.element.isInput()?M`
`:M``}}class bt extends He{#w;#P;constructor(e,t,n={}){n.clickButton??=0,n.consumeEvent??=!0,n.exitAnyButton??=!0,n.strictTarget??=!1,super(e,t,n),this.clickedPosition=[0,0];let i=this;this.#w=e=>{if(i.blueprint.setFocused(!0),e.button===i.options.clickButton)i.options.strictTarget&&e.target!=e.currentTarget||(i.options.consumeEvent&&e.stopImmediatePropagation(),document.addEventListener("mouseup",i.#P),i.clickedPosition=i.locationFromEvent(e),i.clicked(i.clickedPosition));else i.options.exitAnyButton||i.#P(e)},this.#P=e=>{i.options.exitAnyButton&&e.button!=i.options.clickButton||(i.options.consumeEvent&&e.stopImmediatePropagation(),document.removeEventListener("mouseup",i.#P),i.unclicked())},this.listenEvents()}listenEvents(){this.target.addEventListener("mousedown",this.#w),2==this.options.clickButton&&this.target.addEventListener("contextmenu",(e=>e.preventDefault()))}unlistenEvents(){this.target.removeEventListener("mousedown",this.#w)}clicked(e){}unclicked(e){}}class ft extends bt{static#ge=e=>{};constructor(e,t,n,i=ft.#ge,r=ft.#ge){super(e,t,n),this.onMouseDown=i,this.onMouseUp=r}clicked(){this.onMouseDown(this)}unclicked(){this.onMouseUp(this)}}class yt extends Ve{static#ve={window:mt,"color-picker":gt};static properties={...Ve.properties,type:{type:mt,attribute:"data-type",reflect:!0,converter:{fromAttribute:(e,t)=>yt.#ve[e],toAttribute:(e,t)=>Object.entries(yt.#ve).find((([t,n])=>e==n))[0]}}};constructor(e={}){e.type.constructor==String&&(e.type=yt.#ve[e.type]),e.type??=mt,e.windowOptions??={},super({},new e.type),this.type=e.type,this.windowOptions=e.windowOptions}disconnectedCallback(){super.disconnectedCallback(),this.dispatchCloseEvent()}dispatchCloseEvent(){let e=new CustomEvent(J.windowCloseEventName);this.dispatchEvent(e)}}customElements.define("ueb-window",yt);class Et extends vt{#K;#be;firstUpdated(e){super.firstUpdated(e),this.#K=this.element.querySelector(".ueb-pin-input")}createInputObjects(){return[...super.createInputObjects(),new ft(this.#K,this.element.blueprint,void 0,(e=>{this.#be=new yt({type:gt,windowOptions:{getPinColor:()=>this.element.defaultValue,setPinColor:e=>this.element.setDefaultValue(e)}}),this.element.blueprint.append(this.#be);const t=()=>{this.element.setDefaultValue(this.#be.template.color)},n=()=>{this.#be.removeEventListener(J.windowApplyEventName,t),this.#be.removeEventListener(J.windowCloseEventName,n),this.#be=null};this.#be.addEventListener(J.windowApplyEventName,t),this.#be.addEventListener(J.windowCloseEventName,n)}))]}getInputs(){return[this.#K.dataset.linearColor]}setInputs(e=[]){}renderInput(){return this.element.isInput()?M``:super.renderInput()}}class wt extends vt{onInputHandler;firstUpdated(e){super.firstUpdated(e),this.onInputHandler=e=>{e.stopPropagation(),("insertParagraph"==e.inputType||"insertLineBreak"==e.inputType||"insertFromPaste"==e.inputType&&e.target.innerText.includes("\n"))&&(e.target.blur(),this.inputContentElements.forEach((e=>e.innerText=e.innerText.replaceAll("\n",""))))},this.inputContentElements.forEach((e=>{e.addEventListener("input",this.onInputHandler)}))}cleanup(){super.cleanup(),this.inputContentElements.forEach((e=>{e.removeEventListener("input",this.onInputHandler)}))}getInputs(){return this.inputContentElements.map((e=>e.textContent))}setInputs(e=[],t=!0){e=e.map((e=>e.replaceAll("\n",""))),super.setInputs(e,t)}}class St extends vt{setInputs(e=[],t=!1){e&&0!=e.length||(e=[this.getInput()]);let n=[];for(const t of e){let e=parseFloat(t);isNaN(e)&&(e=0,!1),n.push(e)}super.setInputs(e,!1),this.setDefaultValue(n,e)}setDefaultValue(e=[],t){this.element.setDefaultValue(e[0])}}class kt extends St{setDefaultValue(e=[],t=e){this.element.setDefaultValue(e[0])}renderInput(){return this.element.isInput()?M`
`:M``}}class Pt extends it{renderIcon(){return M``}}class xt extends St{setDefaultValue(e=[],t=e){if(!(this.element.entity.DefaultValue instanceof be))throw new TypeError("Expected DefaultValue to be a VectorEntity");let n=this.element.entity.DefaultValue;n.R=e[0],n.P=e[1],n.Y=e[2]}renderInput(){return this.element.isInput()?M`
X
Y
Z
`:M``}}class Ct extends vt{}class At extends St{setDefaultValue(e,t){if(!(this.element.entity.DefaultValue instanceof ye))throw new TypeError("Expected DefaultValue to be a VectorEntity");let n=this.element.entity.DefaultValue;n.X=e[0],n.Y=e[1],n.Z=e[2]}renderInput(){return this.element.isInput()?M`