!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-node-editor",["babylonjs"],t):"object"==typeof exports?exports["babylonjs-node-editor"]=t(require("babylonjs")):e.NODEEDITOR=t(e.BABYLON)}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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=126)}([function(t,n){t.exports=e},function(e,t,n){"use strict";e.exports=n(127)},function(e,t,n){e.exports=n(134)()},function(e,t,n){var r;try{r={cloneDeep:n(266),constant:n(61),defaults:n(267),each:n(91),filter:n(94),find:n(268),flatten:n(121),forEach:n(92),forIn:n(273),has:n(105),isUndefined:n(106),last:n(274),map:n(107),mapValues:n(275),max:n(276),merge:n(278),min:n(284),minBy:n(285),now:n(286),pick:n(287),range:n(292),reduce:n(109),sortBy:n(295),uniqueId:n(300),values:n(114),zipObject:n(301)}}catch(e){}r||(r=window._),e.exports=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";var r=n(3),o=n(8).Graph;function a(e,t,n,o){var a;do{a=r.uniqueId(o)}while(e.hasNode(a));return n.dummy=t,e.setNode(a,n),a}function i(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:a,simplify:function(e){var t=(new o).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),t},asNonCompoundGraph:function(e){var t=new o({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,o=e.x,a=e.y,i=t.x-o,l=t.y-a,s=e.width/2,c=e.height/2;if(!i&&!l)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(l)*s>Math.abs(i)*c?(l<0&&(c=-c),n=c*i/l,r=c):(i<0&&(s=-s),n=s,r=s*l/i);return{x:o+n,y:a+r}},buildLayerMatrix:function(e){var t=r.map(r.range(i(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var o=e.node(n),a=o.rank;r.isUndefined(a)||(t[a][o.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var o=e.node(n);r.has(o,"rank")&&(o.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var o=e.node(r).rank-t;n[o]||(n[o]=[]),n[o].push(r)}));var o=0,a=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%a!=0?--o:o&&r.forEach(t,(function(t){e.node(t).rank+=o}))}))},addBorderNode:function(e,t,n,r){var o={width:0,height:0};arguments.length>=4&&(o.rank=n,o.order=r);return a(e,"border",o,t)},maxRank:i,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},function(e,t,n){var r;try{r={clone:n(154),constant:n(61),each:n(91),filter:n(94),has:n(105),isArray:n(4),isEmpty:n(230),isFunction:n(27),isUndefined:n(106),keys:n(14),map:n(107),reduce:n(109),size:n(233),transform:n(239),union:n(240),values:n(114)}}catch(e){}r||(r=window._),e.exports=r},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r;try{r=n(152)}catch(e){}r||(r=window.graphlib),e.exports=r},function(e,t,n){var r=n(74),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(128)},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(27),o=n(55);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(210),o=n(220),a=n(17),i=n(4),l=n(227);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?i(e)?o(e[0],e[1]):r(e):l(e)}},function(e,t,n){var r=n(77),o=n(57),a=n(12);e.exports=function(e){return a(e)?r(e):o(e)}},function(e,t,n){var r=n(165),o=n(170);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(19),o=n(166),a=n(167),i="[object Null]",l="[object Undefined]",s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?l:i:s&&s in Object(e)?o(e):a(e)}},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(9).Symbol;e.exports=r},function(e,t,n){(function(e){var r=n(9),o=n(186),a=t&&!t.nodeType&&t,i=a&&"object"==typeof e&&e&&!e.nodeType&&e,l=i&&i.exports===a?r.Buffer:void 0,s=(l?l.isBuffer:void 0)||o;e.exports=s}).call(this,n(54)(e))},function(e,t,n){var r=n(77),o=n(190),a=n(12);e.exports=function(e){return a(e)?r(e,!0):o(e)}},function(e,t,n){var r=n(195),o=n(51),a=n(196),i=n(86),l=n(197),s=n(16),c=n(75),u=c(r),p=c(o),d=c(a),f=c(i),h=c(l),m=s;(r&&"[object DataView]"!=m(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=m(new o)||a&&"[object Promise]"!=m(a.resolve())||i&&"[object Set]"!=m(new i)||l&&"[object WeakMap]"!=m(new l))&&(m=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case u:return"[object DataView]";case p:return"[object Map]";case d:return"[object Promise]";case f:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=m},function(e,t,n){var r=n(16),o=n(11),a="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||o(e)&&r(e)==a}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(i=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),a=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(a).concat([o]).join("\n")}var i;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o=0&&p.splice(t,1)}function v(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),b(t,e.attrs),m(e,t),t}function b(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function y(e,t){var n,r,o,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var i=u++;n=c||(c=v(t)),r=_.bind(null,n,i,!1),o=_.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",b(t,e.attrs),m(e,t),t}(t),r=k.bind(null,n,t),o=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),r=C.bind(null,n),o=function(){g(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=i()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return f(n,t),function(e){for(var r=[],o=0;o-1&&e%1==0&&e=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function y(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0||!Array.isArray(t)&&t?g({},e,t):{}}function k(e){var t=e.icon,n=e.mask,r=e.symbol,o=e.className,a=e.title,i=_(t),l=C("classes",[].concat(y(function(e){var t,n=e.spin,r=e.pulse,o=e.fixedWidth,a=e.inverse,i=e.border,l=e.listItem,s=e.flip,c=e.size,u=e.rotation,p=e.pull,d=(g(t={"fa-spin":n,"fa-pulse":r,"fa-fw":o,"fa-inverse":a,"fa-border":i,"fa-li":l,"fa-flip-horizontal":"horizontal"===s||"both"===s,"fa-flip-vertical":"vertical"===s||"both"===s},"fa-".concat(c),void 0!==c),g(t,"fa-rotate-".concat(u),void 0!==u),g(t,"fa-pull-".concat(p),void 0!==p),g(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(d).map((function(e){return d[e]?e:null})).filter((function(e){return e}))}(e)),y(o.split(" ")))),s=C("transform","string"==typeof e.transform?d.b.transform(e.transform):e.transform),c=C("mask",_(n)),u=Object(d.a)(i,v({},l,s,c,{symbol:r,title:a}));if(!u)return function(){var e;!x&&console&&"function"==typeof console.error&&(e=console).error.apply(e,arguments)}("Could not find icon",i),null;var p=u.abstract,f={};return Object.keys(e).forEach((function(t){k.defaultProps.hasOwnProperty(t)||(f[t]=e[t])})),E(p[0],f)}k.displayName="FontAwesomeIcon",k.propTypes={border:h.a.bool,className:h.a.string,mask:h.a.oneOfType([h.a.object,h.a.array,h.a.string]),fixedWidth:h.a.bool,inverse:h.a.bool,flip:h.a.oneOf(["horizontal","vertical","both"]),icon:h.a.oneOfType([h.a.object,h.a.array,h.a.string]),listItem:h.a.bool,pull:h.a.oneOf(["right","left"]),pulse:h.a.bool,rotation:h.a.oneOf([90,180,270]),size:h.a.oneOf(["lg","xs","sm","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:h.a.bool,symbol:h.a.oneOfType([h.a.bool,h.a.string]),title:h.a.string,transform:h.a.oneOfType([h.a.string,h.a.object]),swapOpacity:h.a.bool},k.defaultProps={border:!1,className:"",mask:null,fixedWidth:!1,inverse:!1,flip:null,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,symbol:!1,title:"",transform:null,swapOpacity:!1};var E=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof n)return n;var o=(n.children||[]).map((function(n){return e(t,n)})),a=Object.keys(n.attributes||{}).reduce((function(e,t){var r=n.attributes[t];switch(t){case"class":e.attrs.className=r,delete n.attributes.class;break;case"style":e.attrs.style=r.split(";").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var n,r=t.indexOf(":"),o=w(t.slice(0,r)),a=t.slice(r+1).trim();return o.startsWith("webkit")?e[(n=o,n.charAt(0).toUpperCase()+n.slice(1))]=a:e[o]=a,e}),{});break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?e.attrs[t.toLowerCase()]=r:e.attrs[w(t)]=r}return e}),{attrs:{}}),i=r.style,l=void 0===i?{}:i,s=b(r,["style"]);return a.attrs.style=v({},a.attrs.style,l),t.apply(void 0,[n.tag,v({},a.attrs,s)].concat(y(o)))}.bind(null,a.a.createElement),S={prefix:"fas",iconName:"chevron-down",icon:[448,512,[],"f078","M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"]},P={prefix:"fas",iconName:"minus",icon:[448,512,[],"f068","M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"]},T={prefix:"fas",iconName:"plus",icon:[448,512,[],"f067","M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"]},N={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M0 84V56c0-13.3 10.7-24 24-24h112l9.4-18.7c4-8.2 12.3-13.3 21.4-13.3h114.3c9.1 0 17.4 5.1 21.5 13.3L312 32h112c13.3 0 24 10.7 24 24v28c0 6.6-5.4 12-12 12H12C5.4 96 0 90.6 0 84zm415.2 56.7L394.8 467c-1.6 25.3-22.6 45-47.9 45H101.1c-25.3 0-46.3-19.7-47.9-45L32.8 140.7c-.4-6.9 5.1-12.7 12-12.7h358.5c6.8 0 12.3 5.8 11.9 12.7z"]},B=function(e){function t(t){var n=e.call(this,t)||this,r=l.DataStorage.ReadBoolean(n.props.title,!n.props.closed);return n.state={isExpanded:r},n}return u(t,e),t.prototype.switchExpandedState=function(){var e=!this.state.isExpanded;l.DataStorage.WriteBoolean(this.props.title,e),this.setState({isExpanded:e})},t.prototype.renderHeader=function(){var e=this,t=this.state.isExpanded?"collapse":"collapse closed";return o.createElement("div",{className:"header",onClick:function(){return e.switchExpandedState()}},o.createElement("div",{className:"title"},this.props.title),o.createElement("div",{className:t},o.createElement(k,{icon:S})))},t.prototype.render=function(){return this.state.isExpanded?o.createElement("div",{className:"paneContainer"},o.createElement("div",{className:"paneContainer-content"},this.renderHeader(),o.createElement("div",{className:"paneList"},this.props.children))):o.createElement("div",{className:"paneContainer"},o.createElement("div",{className:"paneContainer-content"},this.renderHeader()))},t}(o.Component),O=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.render=function(){var e=this;return o.createElement("div",{className:"draggableLine",title:this.props.tooltip,draggable:!0,onDragStart:function(t){t.dataTransfer.setData("babylonjs-material-node",e.props.data)}},this.props.data.replace("Block",""))},t}(o.Component); /*! * Font Awesome Free 5.4.2 by @fontawesome - https://fontawesome.com * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) */n(136);var L=function(e){function t(t){var n=e.call(this,t)||this;return n.state={filter:""},n}return u(t,e),t.prototype.filterContent=function(e){this.setState({filter:e})},t.prototype.render=function(){var e=this,n={Animation:["BonesBlock","MorphTargetsBlock"],Color_Management:["ReplaceColorBlock","PosterizeBlock","GradientBlock","DesaturateBlock"],Conversion_Blocks:["ColorMergerBlock","ColorSplitterBlock","VectorMergerBlock","VectorSplitterBlock"],Inputs:["Float","Vector2","Vector3","Vector4","Color3","Color4","TextureBlock","ReflectionTextureBlock","TimeBlock","DeltaTimeBlock"],Interpolation:["LerpBlock","StepBlock","SmoothStepBlock","NLerpBlock"],Math__Standard:["AddBlock","DivideBlock","MaxBlock","MinBlock","MultiplyBlock","NegateBlock","OneMinusBlock","ReciprocalBlock","ScaleBlock","SignBlock","SqrtBlock","SubtractBlock"],Math__Scientific:["AbsBlock","ArcCosBlock","ArcSinBlock","ArcTanBlock","ArcTan2Block","CosBlock","DegreesToRadiansBlock","ExpBlock","Exp2Block","FractBlock","LogBlock","PowBlock","RadiansToDegreesBlock","SawToothWaveBlock","SinBlock","SquareWaveBlock","TanBlock","TriangleWaveBlock"],Math__Vector:["CrossBlock","DerivativeBlock","DistanceBlock","DotBlock","FresnelBlock","LengthBlock","ReflectBlock","RefractBlock","Rotate2dBlock","TransformBlock"],Matrices:["Matrix","WorldMatrixBlock","WorldViewMatrixBlock","WorldViewProjectionMatrixBlock","ViewMatrixBlock","ViewProjectionMatrixBlock","ProjectionMatrixBlock"],Mesh:["InstancesBlock","PositionBlock","UVBlock","ColorBlock","NormalBlock","PerturbNormalBlock","NormalBlendBlock","TangentBlock","MatrixIndicesBlock","MatrixWeightsBlock","WorldPositionBlock","WorldNormalBlock","WorldTangentBlock","FrontFacingBlock"],Noises:["RandomNumberBlock","SimplexPerlin3DBlock","WorleyNoise3DBlock"],Output_Nodes:["VertexOutputBlock","FragmentOutputBlock","DiscardBlock"],Range:["ClampBlock","RemapBlock","NormalizeBlock"],Round:["RoundBlock","CeilingBlock","FloorBlock"],Scene:["FogBlock","CameraPositionBlock","FogColorBlock","ImageProcessingBlock","LightBlock","LightInformationBlock","ViewDirectionBlock"]},r=[];for(var a in n){var i=n[a].filter((function(t){return!e.state.filter||-1!==t.toLowerCase().indexOf(e.state.filter.toLowerCase())})).sort((function(e,t){return e.localeCompare(t)})).map((function(e,n){var r=t._Tooltips[e]||"";return o.createElement(O,{key:e,data:e,tooltip:r})}));i.length&&r.push(o.createElement(B,{key:a+" blocks",title:a.replace("__",": ").replace("_"," "),closed:!1},i))}return o.createElement("div",{id:"nodeList"},o.createElement("div",{className:"panes"},o.createElement("div",{className:"pane"},o.createElement("div",{className:"filter"},o.createElement("input",{type:"text",placeholder:"Filter",onFocus:function(){return e.props.globalState.blockKeyboardEvents=!0},onBlur:function(t){e.props.globalState.blockKeyboardEvents=!1},onChange:function(t){return e.filterContent(t.target.value)}})),o.createElement("div",{className:"list-container"},r))))},t._Tooltips={BonesBlock:"Provides a world matrix for each vertex, based on skeletal (bone/joint) animation",MorphTargetsBlock:"Provides the final positions, normals, tangents, and uvs based on morph targets in a mesh",AddBlock:"Adds the left and right inputs of the same type together",DistanceBlock:"Provides a distance vector based on the left and right input vectors",DivideBlock:"Divides the left input by the right input of the same type",LengthBlock:"Outputs the length of an input vector",MaxBlock:"Outputs the largest value between the left and right inputs of the same type",MinBlock:"Outputs the smallest value between the left and right inputs of the same type",MultiplyBlock:"Multiplies the left and right inputs of the same type together",NegateBlock:"Multiplies the input by -1",OneMinusBlock:"Subtracts each channel of the input value from 1 (1 - input)",RandomNumberBlock:"Provides a random number based on an input seed",ReciprocalBlock:"Quotient of 1 divided by the input",ScaleBlock:"Multiplies the input channels by a float factor",SubtractBlock:"Subtracts the right input from the left input of the same type",GradientBlock:"Returns the color in the gradient represented by the target value of the input",PosterizeBlock:"Reduces the number of values in each channel to the number in the corresponding channel of steps",ReplaceColorBlock:"Replaces a reference color in value with the color in replacement blended by distance",ColorMergerBlock:"Combines float input channels into a color",ColorSplitterBlock:"Separates color input channels into individual floats",VectorMergerBlock:"Combines up to four input floats into a vector",VectorSplitterBlock:"Separates vectors input channels into individual floats",Color3:"A color made up of red, green, and blue channel values",Color4:"A color made up of red, green, blue, and alpha channel values",DeltaTimeBlock:"A float representing the time that has passed since the last frame was rendered",Float:"A floating point number representing a value with a fractional component",TextureBlock:"A node for reading a linked or embedded texture file",TimeBlock:"A float value that represents the time that has passed since the scene was loaded",Vector2:"a vector composed of X and Y channels",Vector3:"a vector composed of X, Y, and Z channels",Vector4:"a vector composed of X, Y, Z, and W channels",LerpBlock:"Outputs a value that is a mix of the left and right inputs based on the target value",NLerpBlock:"Outputs a value that is a mix of the left and right inputs based on the target's normalized value",SmoothStepBlock:"Outputs a value based on a the input value's position on a curve between the two edge values",StepBlock:"Outputs 1 for any input value above the edge input, outputs 0 for any input value below the edge input",Matrix:"A 4x4 table of related values",ProjectionMatrixBlock:"A matrix to remap points in 3D space to 2D plane relative to the screen",ViewMatrixBlock:"A matrix to remap points in 3D space to 2D plane relative to the view of the scene camera",ViewProjectionMatrixBlock:"A matrix to remap points in 3D space to 2D view space before remapping to 2D screen space",WorldMatrixBlock:"A matrix to remap points in 3D local space to 3D world space",WorldViewProjectionMatrixBlock:"A matrix to remap points in 3D local space to 3D world space, then to 2D camera space, and ending in 2D screen space",ColorBlock:"Outputs the RGBA color of each vertex in the mesh",InstancesBlock:"Provides the world matrix for each instance to apply this material to all instances",MatrixIndicesBlock:"A Vector4 representing the vertex to bone skinning assignments",MatrixWeightsBlock:"A Vector4 representing the vertex to bone skinning weights",NormalBlock:"A Vector3 representing the normal of each vertex of the attached mesh",PositionBlock:"A Vector3 representing the position of each vertex of the attached mesh",TangentBlock:"A Vector3 representing the tangent of each vertex of the attached mesh",UVBlock:"A Vector2 representing the UV coordinates of each vertex of the attached mesh",WorldNormal:"A Vector4 representing the normal of each vertex of the attached mesh transformed into world space",WorldTangent:"A Vector4 representing the tangent of each vertex of the attached mesh transformed into world space",PerturbNormalBlock:"Creates high-frequency detail normal vectors based on a normal map, the world position, and world normal",NormalBlend:"Outputs the result of blending two normal maps together using a per-channel screen",WorldPosition:"A Vector4 representing the position of each vertex of the attached mesh transformed into world space",DiscardBlock:"A final node that will not output a pixel below the cutoff value",FragmentOutputBlock:"A mandatory final node for outputing the color of each pixel",VertexOutputBlock:"A mandatory final node for outputing the position of each vertex",ClampBlock:"Outputs values above the maximum or below minimum as maximum or minimum values respectively",NormalizeBlock:"Remaps the length of a vector or color to 1",RemapBlock:"Remaps input value between sourceMin and sourceMax to a new range between targetMin and targetMax",CeilingBlock:"Outputs fractional values as the next higher whole number",FloorBlock:"Outputs fractional values as the next lower whole number",RoundBlock:"Outputs fractional values rounded to the nearest whole number",CameraPositionBlock:"Outputs a Vector3 position of the active scene camera",FogBlock:"Applies fog to the scene with an increasing opacity based on distance from the camera",FogColorBlock:"The system value for fog color pulled from the scene",ImageProcessingBlock:"Provides access to all of the Babylon image processing properties",LightBlock:"Outputs diffuse and specular contributions from one or more scene lights",LightInformationBlock:"Provides the direction, color and intensity of a selected light based on its world position",ReflectionTextureBlock:"Creates a reflection from the input texture",ViewDirectionBlock:"Outputs the direction vector of where the camera is aimed",AbsBlock:"Outputs the absolute value of the input value",ArcCosBlock:"Outputs the inverse of the cosine value based on the input value",ArcSinBlock:"Outputs the inverse of the sine value based on the input value",ArcTan2Block:"Outputs the inverse of the tangent value based on the input value",ArcTanBlock:"Outputs the inverse of the tangent value based on the input value",CosBlock:"Outputs the cosine value based on the input value",DegreesToRadiansBlock:"Converts the input degrees value to radians",Exp2Block:"Outputs the input value multiplied by itself 1 time. (Exponent of 2)",ExpBlock:"Outputs the input value multiplied by itself 9 time. (Exponent of 10)",FractBlock:"Outputs only the fractional value of a floating point number",LogBlock:"The logarithmic value based on the input value",PowBlock:"Outputs the input value multiplied by itself the number of times equal to the power input (Exponent of power)",RadiansToDegreesBlock:"Converts the input radians value to degrees",SawToothWaveBlock:"Outputs a sawtooth pattern value between -1 and 1 based on the input value",SignBlock:"returns 1 if the input is positive, 0 if input is equal to 0, or -1 if the input is negative",SinBlock:"Outputs the the sine value based on the input value",SqrtBlock:"Outputs the the square root of the input value",SquareWaveBlock:"Outputs a stepped pattern value between -1 and 1 based on the input value",TanBlock:"Outputs the the tangent value based on the input value",TriangleWaveBlock:"Outputs a sawtooth pattern value between 0 and 1 based on the input value",CrossBlock:"Outputs a vector that is perpendicular to two input vectors",DotBlock:"Outputs the cos of the angle between two vectors",FresnelBlock:"Outputs the grazing angle of the surface of the mesh, relative to a camera influenced by the bias and power inputs",TransformBlock:"Transforms a input vector based on the input matrix",DerivativeBlock:"FRAGMENT SHADER ONLY. Provides the rate of change for an input on a given axis (x,y).",DesaturateBlock:"Convert a color input into a grayscale representation.",WorldViewMatrixBlock:"A matrix to remap points in 3D local space to 3D world space, and ending in 2D camera space.",FrontFacingBlock:"Returns 1 if a mesh triangle faces the normal direction and 0 if it does not.",SimplexPerlin3DBlock:"Creates a type of gradient noise with few directional artifacts.",WorleyNoise3DBlock:"Creates a random pattern resembling cells.",ReflectBlock:"Outputs the direction of the input vector reflected across the surface normal.",RefractBlock:"Outputs a direction simulating a deflection of the input vector.",Rotate2dBlock:"Rotates UV coordinates around the W axis."},t}(o.Component),M=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.render=function(){var e=this;return o.createElement("div",{className:"buttonLine"},o.createElement("button",{onClick:function(){return e.props.onClick()}},this.props.label))},t}(o.Component),R=function(){function e(){}return e._SaveAs=function(e,t,n){var r=this;if("download"in HTMLAnchorElement.prototype){var o=window.URL||window.webkitURL,a=n.createElement("a");return a.download=t,a.rel="noopener",a.href=o.createObjectURL(e),setTimeout((function(){o.revokeObjectURL(a.href)}),4e4),void setTimeout((function(){r._Click(a,n)}),0)}var i=open("","_blank");i&&(i.document.title=i.document.body.innerText="downloading...");var l="application/octet-stream"===e.type,s=/constructor/i.test(window.HTMLElement)||window.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||l&&s)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var p=(o=window.URL||window.webkitURL).createObjectURL(e);i?i.location.href=p:location.href=p,i=null,setTimeout((function(){o.revokeObjectURL(p)}),4e4)}},e._Click=function(e,t){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var n=t.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}},e.GetBaseType=function(e){return l.NodeMaterialBlockConnectionPointTypes[e]},e.DownloadAsFile=function(e,t,n){var r=new Blob([t],{type:"application/octet-stream"});this._SaveAs(r,n,e)},e}(),I=function(e){function t(t){var n=e.call(this,t)||this;return n.uploadRef=o.createRef(),n}return u(t,e),t.prototype.onChange=function(e){var t=e.target.files;t&&t.length&&this.props.onClick(t[0]),e.target.value=""},t.prototype.render=function(){var e=this;return o.createElement("div",{className:"buttonLine"},o.createElement("label",{htmlFor:"file-upload",className:"file-upload"},this.props.label),o.createElement("input",{ref:this.uploadRef,id:"file-upload",type:"file",accept:this.props.accept,onChange:function(t){return e.onChange(t)}}))},t}(o.Component),D=function(){function e(){}return e.UpdateLocations=function(e,t){e.editorData={locations:[]};for(var n=0,r=e.attachedBlocks;n0&&i.push({label:"Mesh attribute",value:1}),n.length>0&&i.push({label:"System value",value:2});return o.createElement("div",null,o.createElement(ne,{globalState:this.props.globalState,block:this.props.block}),o.createElement(B,{title:"PROPERTIES"},t.isUniform&&!t.isSystemValue&&t.animationType===l.AnimatedInputBlockTypes.None&&o.createElement(K,{label:"Type",options:[{label:"None",value:0},{label:"Visible in the inspector",value:1},{label:"Constant",value:2}],target:t,noDirectUpdate:!0,getSelection:function(e){return e.visibleInInspector?1:e.isConstant?2:0},onSelect:function(n){switch(n){case 0:t.visibleInInspector=!1,t.isConstant=!1;break;case 1:t.visibleInInspector=!0,t.isConstant=!1;break;case 2:t.visibleInInspector=!1,t.isConstant=!0}e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}}),t.visibleInInspector&&o.createElement(ee,{globalState:this.props.globalState,label:"Group",propertyName:"groupInInspector",target:this.props.block,onChange:function(){e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}}),o.createElement(K,{label:"Mode",options:i,target:t,noDirectUpdate:!0,getSelection:function(e){return e.isAttribute?1:e.isSystemValue?2:0},onSelect:function(o){switch(o){case 0:t.isUniform=!0,t.setAsSystemValue(null),e.setDefaultValue();break;case 1:t.setAsAttribute(r[0].value);break;case 2:t.setAsSystemValue(n[0].value)}e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}}),t.isAttribute&&o.createElement(K,{label:"Attribute",valuesAreStrings:!0,options:r,target:t,propertyName:"name",onSelect:function(n){t.setAsAttribute(n),e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}}),t.isUniform&&a.length>0&&o.createElement(K,{label:"Animation type",options:a,target:t,propertyName:"animationType",onSelect:function(t){e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}}),t.isUniform&&!t.isSystemValue&&t.animationType===l.AnimatedInputBlockTypes.None&&this.renderValue(this.props.globalState),t.isUniform&&t.isSystemValue&&o.createElement(K,{label:"System value",options:n,target:t,propertyName:"systemValue",onSelect:function(n){t.setAsSystemValue(n),e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}})))},t}(o.Component),le=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.render=function(){var e=this;return o.createElement(o.Fragment,null,o.createElement(ne,{globalState:this.props.globalState,block:this.props.block}),o.createElement(B,{title:"PROPERTIES"},o.createElement(A,{label:"Transform as direction",onSelect:function(t){var n=e.props.block;n.complementW=t?0:1,e.props.globalState.onRebuildRequiredObservable.notifyObservers()},isSelected:function(){return 0===e.props.block.complementW}})))},t}(o.Component),se=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.render=function(){var e=this;return o.createElement(o.Fragment,null,o.createElement(ne,{globalState:this.props.globalState,block:this.props.block}),o.createElement(B,{title:"PROPERTIES"},o.createElement(A,{label:"Invert X axis",target:this.props.block,propertyName:"invertX",onValueChanged:function(){return e.props.globalState.onRebuildRequiredObservable.notifyObservers()}}),o.createElement(A,{label:"Invert Y axis",target:this.props.block,propertyName:"invertY",onValueChanged:function(){return e.props.globalState.onRebuildRequiredObservable.notifyObservers()}})))},t}(o.Component),ce=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.render=function(){var e=this;return o.createElement(o.Fragment,null,o.createElement(ne,{globalState:this.props.globalState,block:this.props.block}),o.createElement(B,{title:"PROPERTIES"},o.createElement(A,{label:"Use Manhattan Distance",target:this.props.block,propertyName:"manhattanDistance",onValueChanged:function(){return e.props.globalState.onRebuildRequiredObservable.notifyObservers()}})))},t}(o.Component),ue=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.forceRebuild=function(){this.props.globalState.onUpdateRequiredObservable.notifyObservers(),this.props.globalState.onRebuildRequiredObservable.notifyObservers()},t.prototype.render=function(){var e=this,t=this.props.block;return o.createElement("div",null,o.createElement(ne,{globalState:this.props.globalState,block:this.props.block}),o.createElement(B,{title:"PROPERTIES"},o.createElement(z,{globalState:this.props.globalState,label:"Minimum",propertyName:"minimum",target:t,onChange:function(){return e.forceRebuild()}}),o.createElement(z,{globalState:this.props.globalState,label:"Maximum",propertyName:"maximum",target:t,onChange:function(){return e.forceRebuild()}})))},t}(o.Component),pe=function(e){function t(t){var n=e.call(this,t)||this;return n.state={gradient:t.step.step},n}return u(t,e),t.prototype.updateColor=function(e){this.props.step.color=l.Color3.FromHexString(e),this.props.onUpdateStep(),this.forceUpdate()},t.prototype.updateStep=function(e){this.props.step.step=e,this.setState({gradient:e}),this.props.onUpdateStep()},t.prototype.onPointerUp=function(){this.props.onCheckForReOrder()},t.prototype.render=function(){var e=this,t=this.props.step;return o.createElement("div",{className:"gradient-step"},o.createElement("div",{className:"step"},"#"+this.props.lineIndex),o.createElement("input",{type:"color",value:t.color.toHexString(),onChange:function(t){return e.updateColor(t.target.value)}}),o.createElement("div",{className:"step-value"},t.step.toFixed(2)),o.createElement("div",{className:"step-slider"},o.createElement("input",{className:"range",type:"range",step:.01,min:0,max:1,value:t.step,onPointerUp:function(t){return e.onPointerUp()},onChange:function(t){return e.updateStep(parseFloat(t.target.value))}})),o.createElement("div",{className:"gradient-delete",onClick:function(){return e.props.onDelete()}},o.createElement(k,{icon:N})))},t}(o.Component),de=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.forceRebuild=function(){this.props.globalState.onUpdateRequiredObservable.notifyObservers(),this.props.globalState.onRebuildRequiredObservable.notifyObservers()},t.prototype.deleteStep=function(e){var t=this.props.block,n=t.colorSteps.indexOf(e);n>-1&&(t.colorSteps.splice(n,1),this.forceRebuild(),this.forceUpdate())},t.prototype.addNewStep=function(){var e=this.props.block,t=new l.GradientBlockColorStep(1,l.Color3.White());e.colorSteps.push(t),this.forceRebuild(),this.forceUpdate()},t.prototype.checkForReOrder=function(){this.props.block.colorSteps.sort((function(e,t){return e.step===t.step?0:e.step>t.step?1:-1})),this.props.globalState.onUpdateRequiredObservable.notifyObservers(),this.forceUpdate()},t.prototype.render=function(){var e=this,t=this.props.block;return o.createElement("div",null,o.createElement(ne,{globalState:this.props.globalState,block:this.props.block}),o.createElement(B,{title:"STEPS"},o.createElement(M,{label:"Add new step",onClick:function(){return e.addNewStep()}}),t.colorSteps.map((function(t,n){return o.createElement(pe,{globalState:e.props.globalState,onCheckForReOrder:function(){return e.checkForReOrder()},onUpdateStep:function(){return e.forceRebuild()},key:"step-"+n,lineIndex:n,step:t,onDelete:function(){return e.deleteStep(t)}})}))))},t}(o.Component),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this,t=this.props.globalState.nodeMaterial.getScene(),n=t.lights.map((function(e){return{label:e.name,value:e.name}}));n.splice(0,0,{label:"All",value:""});var r=this.props.block;return o.createElement("div",null,o.createElement(ne,{globalState:this.props.globalState,block:this.props.block}),o.createElement(B,{title:"PROPERTIES"},o.createElement(K,{label:"Light",defaultIfNull:0,noDirectUpdate:!0,valuesAreStrings:!0,options:n,target:r,propertyName:"name",onSelect:function(n){r.light=""===n?null:t.getLightByName(n),e.forceUpdate(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}})))},t}(o.Component),he=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this,t=this.props.globalState.nodeMaterial.getScene(),n=t.lights.map((function(e){return{label:e.name,value:e.name}})),r=this.props.block;return o.createElement("div",null,o.createElement(ne,{globalState:this.props.globalState,block:this.props.block}),o.createElement(B,{title:"PROPERTIES"},o.createElement(K,{label:"Light",noDirectUpdate:!0,valuesAreStrings:!0,options:n,target:r,propertyName:"name",onSelect:function(n){r.light=t.getLightByName(n),e.forceUpdate(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}})))},t}(o.Component),me=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.forceRebuild=function(){this.props.globalState.onUpdateRequiredObservable.notifyObservers(),this.props.globalState.onRebuildRequiredObservable.notifyObservers()},t.prototype.render=function(){var e=this,t=this.props.block;return o.createElement("div",null,o.createElement(ne,{globalState:this.props.globalState,block:this.props.block}),o.createElement(B,{title:"PROPERTIES"},o.createElement(V,{globalState:this.props.globalState,label:"From",propertyName:"sourceRange",target:t,onChange:function(){return e.forceRebuild()}}),o.createElement(V,{globalState:this.props.globalState,label:"To",propertyName:"targetRange",target:t,onChange:function(){return e.forceRebuild()}})))},t}(o.Component),ge=function(e){function t(t){var n=e.call(this,t)||this,r=n.textureBlock.texture;return n.state={isEmbedded:!r||"data"===r.name.substring(0,4),loadAsCubeTexture:r&&r.isCube},n}return u(t,e),Object.defineProperty(t.prototype,"textureBlock",{get:function(){return this.props.block},enumerable:!0,configurable:!0}),t.prototype.UNSAFE_componentWillUpdate=function(e,t){if(e.block!==this.props.block){var n=e.block.texture;t.isEmbedded=!n||"data"===n.name.substring(0,4),t.loadAsCubeTexture=n&&n.isCube}},t.prototype._generateRandomForCache=function(){return"xxxxxxxxxxxxxxxxxxxx".replace(/[x]/g,(function(e){return(10*Math.random()|0).toString()}))},t.prototype.updateAfterTextureLoad=function(){this.props.globalState.onUpdateRequiredObservable.notifyObservers(),this.props.globalState.onRebuildRequiredObservable.notifyObservers(),this.forceUpdate()},t.prototype.removeTexture=function(){var e=this.textureBlock.texture;e&&(e.dispose(),e=null,this.textureBlock.texture=null),this.updateAfterTextureLoad()},t.prototype._prepareTexture=function(){var e=this.textureBlock.texture;e&&e.isCube!==this.state.loadAsCubeTexture&&(e.dispose(),e=null),e||(this.state.loadAsCubeTexture?(this.textureBlock.texture=new l.CubeTexture("",this.props.globalState.nodeMaterial.getScene()),(e=this.textureBlock.texture).coordinatesMode=l.Texture.CUBIC_MODE):(this.textureBlock.texture=new l.Texture(null,this.props.globalState.nodeMaterial.getScene(),!1,this.textureBlock instanceof l.ReflectionTextureBlock),(e=this.textureBlock.texture).coordinatesMode=l.Texture.EQUIRECTANGULAR_MODE))},t.prototype.replaceTexture=function(e){var t=this;this._prepareTexture();var n=this.textureBlock.texture;l.Tools.ReadFile(e,(function(r){var o=new Blob([r],{type:"octet/stream"}),a=new FileReader;a.readAsDataURL(o),a.onloadend=function(){var r=a.result,o=void 0;e.name.toLowerCase().indexOf(".dds")>0?o=".dds":e.name.toLowerCase().indexOf(".env")>0&&(o=".env"),n.updateURL(r,o,(function(){return t.updateAfterTextureLoad()}))}}),void 0,!0)},t.prototype.replaceTextureWithUrl=function(e){var t=this;this._prepareTexture();var n=this.textureBlock.texture;if(n.isCube||this.textureBlock instanceof l.ReflectionTextureBlock){var r=void 0;e.toLowerCase().indexOf(".dds")>0?r=".dds":e.toLowerCase().indexOf(".env")>0&&(r=".env"),n.updateURL(e,r,(function(){return t.updateAfterTextureLoad()}))}else n.updateURL(e,null,(function(){return t.updateAfterTextureLoad()}))},t.prototype.render=function(){var e=this,t="",n=this.textureBlock.texture;n&&n.name&&"data"!==n.name.substring(0,4)&&(t=n.name),t=t.replace(/\?nocache=\d+/,"");var r=this.textureBlock instanceof l.ReflectionTextureBlock,a=[{label:"Cubic",value:l.Texture.CUBIC_MODE},{label:"Equirectangular",value:l.Texture.EQUIRECTANGULAR_MODE},{label:"Explicit",value:l.Texture.EXPLICIT_MODE},{label:"Fixed equirectangular",value:l.Texture.FIXED_EQUIRECTANGULAR_MODE},{label:"Fixed mirrored equirectangular",value:l.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE},{label:"Planar",value:l.Texture.PLANAR_MODE},{label:"Projection",value:l.Texture.PROJECTION_MODE},{label:"Skybox",value:l.Texture.SKYBOX_MODE},{label:"Spherical",value:l.Texture.SPHERICAL_MODE}];return o.createElement("div",null,o.createElement(ne,{globalState:this.props.globalState,block:this.props.block}),o.createElement(B,{title:"PROPERTIES"},o.createElement(A,{label:"Auto select UV",propertyName:"autoSelectUV",target:this.props.block,onValueChanged:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(A,{label:"Convert to gamma space",propertyName:"convertToGammaSpace",target:this.props.block,onValueChanged:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&r&&o.createElement(K,{label:"Reflection mode",options:a,target:n,propertyName:"coordinatesMode",onSelect:function(t){n.coordinatesMode=t,e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(A,{label:"Clamp U",isSelected:function(){return n.wrapU===l.Texture.CLAMP_ADDRESSMODE},onSelect:function(t){n.wrapU=t?l.Texture.CLAMP_ADDRESSMODE:l.Texture.WRAP_ADDRESSMODE,e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(A,{label:"Clamp V",isSelected:function(){return n.wrapV===l.Texture.CLAMP_ADDRESSMODE},onSelect:function(t){n.wrapV=t?l.Texture.CLAMP_ADDRESSMODE:l.Texture.WRAP_ADDRESSMODE,e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(z,{globalState:this.props.globalState,label:"Offset U",target:n,propertyName:"uOffset",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(z,{globalState:this.props.globalState,label:"Offset V",target:n,propertyName:"vOffset",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(z,{globalState:this.props.globalState,label:"Scale U",target:n,propertyName:"uScale",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(z,{globalState:this.props.globalState,label:"Scale V",target:n,propertyName:"vScale",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(F,{label:"Rotation U",target:n,propertyName:"uAng",minimum:0,maximum:2*Math.PI,useEuler:!0,step:.1,onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(F,{label:"Rotation V",target:n,propertyName:"vAng",minimum:0,maximum:2*Math.PI,useEuler:!0,step:.1,onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(F,{label:"Rotation W",target:n,propertyName:"wAng",minimum:0,maximum:2*Math.PI,useEuler:!0,step:.1,onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}})),o.createElement(B,{title:"SOURCE"},o.createElement(A,{label:"Embed static texture",isSelected:function(){return e.state.isEmbedded},onSelect:function(t){e.setState({isEmbedded:t}),e.textureBlock.texture=null,e.updateAfterTextureLoad()}}),r&&o.createElement(A,{label:"Load as cube texture",isSelected:function(){return e.state.loadAsCubeTexture},onSelect:function(t){return e.setState({loadAsCubeTexture:t})}}),this.state.isEmbedded&&o.createElement(I,{label:"Upload",onClick:function(t){return e.replaceTexture(t)},accept:".jpg, .png, .tga, .dds, .env"}),!this.state.isEmbedded&&o.createElement(ee,{label:"Link",globalState:this.props.globalState,value:t,onChange:function(t){return e.replaceTextureWithUrl(t)}}),!this.state.isEmbedded&&t&&o.createElement(M,{label:"Refresh",onClick:function(){return e.replaceTextureWithUrl(t+"?nocache="+e._generateRandomForCache())}}),n&&o.createElement(M,{label:"Remove",onClick:function(){return e.removeTexture()}})))},t}(o.Component),ve=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.render=function(){var e=this,t=this.props.block,n=[{label:"Cos",value:l.TrigonometryBlockOperations.Cos},{label:"Sin",value:l.TrigonometryBlockOperations.Sin},{label:"Abs",value:l.TrigonometryBlockOperations.Abs},{label:"Exp",value:l.TrigonometryBlockOperations.Exp},{label:"Exp2",value:l.TrigonometryBlockOperations.Exp2},{label:"Round",value:l.TrigonometryBlockOperations.Round},{label:"Ceiling",value:l.TrigonometryBlockOperations.Ceiling},{label:"Floor",value:l.TrigonometryBlockOperations.Floor},{label:"ArcCos",value:l.TrigonometryBlockOperations.ArcCos},{label:"ArcSin",value:l.TrigonometryBlockOperations.ArcSin},{label:"ArcTan",value:l.TrigonometryBlockOperations.ArcTan},{label:"Tan",value:l.TrigonometryBlockOperations.Tan},{label:"Log",value:l.TrigonometryBlockOperations.Log},{label:"Fract",value:l.TrigonometryBlockOperations.Fract},{label:"Sign",value:l.TrigonometryBlockOperations.Sign},{label:"Radians to degrees",value:l.TrigonometryBlockOperations.Degrees},{label:"Degrees to radians",value:l.TrigonometryBlockOperations.Radians}];return n.sort((function(e,t){return e.label.localeCompare(t.label)})),o.createElement("div",null,o.createElement(ne,{globalState:this.props.globalState,block:this.props.block}),o.createElement(B,{title:"PROPERTIES"},o.createElement(K,{label:"Operation",options:n,target:t,propertyName:"operation",onSelect:function(t){e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers(),e.forceUpdate()}})))},t}(o.Component),be=function(){function e(){}return e.RegisteredControls={},e}();be.RegisteredControls.TransformBlock=le,be.RegisteredControls.InputBlock=ie,be.RegisteredControls.PerturbNormalBlock=se,be.RegisteredControls.WorleyNoise3DBlock=ce,be.RegisteredControls.ClampBlock=ue,be.RegisteredControls.GradientBlock=de,be.RegisteredControls.LightBlock=fe,be.RegisteredControls.LightInformationBlock=he,be.RegisteredControls.RemapBlock=me,be.RegisteredControls.TextureBlock=ge,be.RegisteredControls.ReflectionTextureBlock=ge,be.RegisteredControls.TrigonometryBlock=ve;var ye=function(){function e(){}return e.GetBlockFromString=function(e,t,n){switch(e){case"DesaturateBlock":return new l.DesaturateBlock("Desaturate");case"RefractBlock":return new l.RefractBlock("Refract");case"ReflectBlock":return new l.ReflectBlock("Reflect");case"DerivativeBlock":return new l.DerivativeBlock("Derivative");case"Rotate2dBlock":return new l.Rotate2dBlock("Rotate2d");case"NormalBlendBlock":return new l.NormalBlendBlock("NormalBlend");case"WorleyNoise3DBlock":return new l.WorleyNoise3DBlock("WorleyNoise3D");case"SimplexPerlin3DBlock":return new l.SimplexPerlin3DBlock("SimplexPerlin3D");case"BonesBlock":return new l.BonesBlock("Bones");case"InstancesBlock":return new l.InstancesBlock("Instances");case"MorphTargetsBlock":return new l.MorphTargetsBlock("MorphTargets");case"DiscardBlock":return new l.DiscardBlock("Discard");case"ImageProcessingBlock":return new l.ImageProcessingBlock("ImageProcessing");case"ColorMergerBlock":return new l.ColorMergerBlock("ColorMerger");case"VectorMergerBlock":return new l.VectorMergerBlock("VectorMerger");case"ColorSplitterBlock":return new l.ColorSplitterBlock("ColorSplitter");case"VectorSplitterBlock":return new l.VectorSplitterBlock("VectorSplitter");case"TextureBlock":return new l.TextureBlock("Texture");case"ReflectionTextureBlock":return new l.ReflectionTextureBlock("Reflection texture");case"LightBlock":return new l.LightBlock("Lights");case"FogBlock":return new l.FogBlock("Fog");case"VertexOutputBlock":return new l.VertexOutputBlock("VertexOutput");case"FragmentOutputBlock":return new l.FragmentOutputBlock("FragmentOutput");case"AddBlock":return new l.AddBlock("Add");case"ClampBlock":return new l.ClampBlock("Clamp");case"ScaleBlock":return new l.ScaleBlock("Scale");case"CrossBlock":return new l.CrossBlock("Cross");case"DotBlock":return new l.DotBlock("Dot");case"PowBlock":return new l.PowBlock("Pow");case"MultiplyBlock":return new l.MultiplyBlock("Multiply");case"TransformBlock":return new l.TransformBlock("Transform");case"TrigonometryBlock":return new l.TrigonometryBlock("Trigonometry");case"RemapBlock":return new l.RemapBlock("Remap");case"NormalizeBlock":return new l.NormalizeBlock("Normalize");case"FresnelBlock":return new l.FresnelBlock("Fresnel");case"LerpBlock":return new l.LerpBlock("Lerp");case"NLerpBlock":return new l.NLerpBlock("NLerp");case"DivideBlock":return new l.DivideBlock("Divide");case"SubtractBlock":return new l.SubtractBlock("Subtract");case"StepBlock":return new l.StepBlock("Step");case"SmoothStepBlock":return new l.SmoothStepBlock("Smooth step");case"OneMinusBlock":return new l.OneMinusBlock("One minus");case"ReciprocalBlock":return new l.ReciprocalBlock("Reciprocal");case"ViewDirectionBlock":return new l.ViewDirectionBlock("View direction");case"LightInformationBlock":var r=new l.LightInformationBlock("Light information");return r.light=t.lights.length?t.lights[0]:null,r;case"MaxBlock":return new l.MaxBlock("Max");case"MinBlock":return new l.MinBlock("Min");case"LengthBlock":return new l.LengthBlock("Length");case"DistanceBlock":return new l.DistanceBlock("Distance");case"NegateBlock":return new l.NegateBlock("Negate");case"PerturbNormalBlock":return new l.PerturbNormalBlock("Perturb normal");case"RandomNumberBlock":return new l.RandomNumberBlock("Random number");case"ReplaceColorBlock":return new l.ReplaceColorBlock("Replace color");case"PosterizeBlock":return new l.PosterizeBlock("Posterize");case"ArcTan2Block":return new l.ArcTan2Block("ArcTan2");case"GradientBlock":return new l.GradientBlock("Gradient");case"FrontFacingBlock":return new l.FrontFacingBlock("Front facing");case"CosBlock":var o=new l.TrigonometryBlock("Cos");return o.operation=l.TrigonometryBlockOperations.Cos,o;case"SinBlock":var a=new l.TrigonometryBlock("Sin");return a.operation=l.TrigonometryBlockOperations.Sin,a;case"AbsBlock":var i=new l.TrigonometryBlock("Abs");return i.operation=l.TrigonometryBlockOperations.Abs,i;case"SqrtBlock":var s=new l.TrigonometryBlock("Sqrt");return s.operation=l.TrigonometryBlockOperations.Sqrt,s;case"ArcCosBlock":var c=new l.TrigonometryBlock("ArcCos");return c.operation=l.TrigonometryBlockOperations.ArcCos,c;case"ArcSinBlock":var u=new l.TrigonometryBlock("ArcSin");return u.operation=l.TrigonometryBlockOperations.ArcSin,u;case"TanBlock":var p=new l.TrigonometryBlock("Tan");return p.operation=l.TrigonometryBlockOperations.Tan,p;case"ArcTanBlock":var d=new l.TrigonometryBlock("ArcTan");return d.operation=l.TrigonometryBlockOperations.ArcTan,d;case"FractBlock":var f=new l.TrigonometryBlock("Fract");return f.operation=l.TrigonometryBlockOperations.Fract,f;case"SignBlock":var h=new l.TrigonometryBlock("Sign");return h.operation=l.TrigonometryBlockOperations.Sign,h;case"LogBlock":var m=new l.TrigonometryBlock("Log");return m.operation=l.TrigonometryBlockOperations.Log,m;case"ExpBlock":var g=new l.TrigonometryBlock("Exp");return g.operation=l.TrigonometryBlockOperations.Exp,g;case"Exp2Block":var v=new l.TrigonometryBlock("Exp2");return v.operation=l.TrigonometryBlockOperations.Exp2,v;case"DegreesToRadiansBlock":var b=new l.TrigonometryBlock("Degrees to radians");return b.operation=l.TrigonometryBlockOperations.Radians,b;case"RadiansToDegreesBlock":var y=new l.TrigonometryBlock("Radians to degrees");return y.operation=l.TrigonometryBlockOperations.Degrees,y;case"RoundBlock":var w=new l.TrigonometryBlock("Round");return w.operation=l.TrigonometryBlockOperations.Round,w;case"CeilingBlock":var x=new l.TrigonometryBlock("Ceiling");return x.operation=l.TrigonometryBlockOperations.Ceiling,x;case"FloorBlock":var _=new l.TrigonometryBlock("Floor");return _.operation=l.TrigonometryBlockOperations.Floor,_;case"SawToothWaveBlock":var C=new l.WaveBlock("SawTooth wave");return C.kind=l.WaveBlockKind.SawTooth,C;case"SquareWaveBlock":var k=new l.WaveBlock("Square wave");return k.kind=l.WaveBlockKind.Square,k;case"TriangleWaveBlock":var E=new l.WaveBlock("Triangle wave");return E.kind=l.WaveBlockKind.Triangle,E;case"WorldMatrixBlock":return(Y=new l.InputBlock("World")).setAsSystemValue(l.NodeMaterialSystemValues.World),Y;case"WorldViewMatrixBlock":var S=new l.InputBlock("World x View");return S.setAsSystemValue(l.NodeMaterialSystemValues.WorldView),S;case"WorldViewProjectionMatrixBlock":var P=new l.InputBlock("World x View x Projection");return P.setAsSystemValue(l.NodeMaterialSystemValues.WorldViewProjection),P;case"ViewMatrixBlock":var T=new l.InputBlock("View");return T.setAsSystemValue(l.NodeMaterialSystemValues.View),T;case"ViewProjectionMatrixBlock":var N=new l.InputBlock("View x Projection");return N.setAsSystemValue(l.NodeMaterialSystemValues.ViewProjection),N;case"ProjectionMatrixBlock":var B=new l.InputBlock("Projection");return B.setAsSystemValue(l.NodeMaterialSystemValues.Projection),B;case"CameraPositionBlock":var O=new l.InputBlock("Camera position");return O.setAsSystemValue(l.NodeMaterialSystemValues.CameraPosition),O;case"FogColorBlock":var L=new l.InputBlock("Fog color");return L.setAsSystemValue(l.NodeMaterialSystemValues.FogColor),L;case"PositionBlock":var M=new l.InputBlock("position");return M.setAsAttribute("position"),M;case"UVBlock":var R=new l.InputBlock("uv");return R.setAsAttribute("uv"),R;case"ColorBlock":var I=new l.InputBlock("color");return I.setAsAttribute("color"),I;case"NormalBlock":var D=new l.InputBlock("normal");return D.setAsAttribute("normal"),D;case"TangentBlock":var A=new l.InputBlock("tangent");return A.setAsAttribute("tangent"),A;case"MatrixIndicesBlock":var z=new l.InputBlock("matricesIndices");return z.setAsAttribute("matricesIndices"),z;case"MatrixWeightsBlock":var j=new l.InputBlock("matricesWeights");return j.setAsAttribute("matricesWeights"),j;case"TimeBlock":var F=new l.InputBlock("Time",void 0,l.NodeMaterialBlockConnectionPointTypes.Float);return F.animationType=l.AnimatedInputBlockTypes.Time,F;case"DeltaTimeBlock":var U=new l.InputBlock("Delta time");return U.setAsSystemValue(l.NodeMaterialSystemValues.DeltaTime),U;case"WorldPositionBlock":var V=n.getInputBlockByPredicate((function(e){return e.isAttribute&&"position"===e.name}));V||(V=new l.InputBlock("position")).setAsAttribute("position"),(Y=n.getInputBlockByPredicate((function(e){return e.isSystemValue&&e.systemValue===l.NodeMaterialSystemValues.World})))||(Y=new l.InputBlock("World")).setAsSystemValue(l.NodeMaterialSystemValues.World);var W=new l.TransformBlock("World position");return V.connectTo(W),Y.connectTo(W),W;case"WorldNormalBlock":var H=n.getInputBlockByPredicate((function(e){return e.isAttribute&&"normal"===e.name}));H||(H=new l.InputBlock("normal")).setAsAttribute("normal"),(Y=n.getInputBlockByPredicate((function(e){return e.isSystemValue&&e.systemValue===l.NodeMaterialSystemValues.World})))||(Y=new l.InputBlock("World")).setAsSystemValue(l.NodeMaterialSystemValues.World);W=new l.TransformBlock("World normal");return H.connectTo(W),Y.connectTo(W),W;case"WorldTangentBlock":var Y,X=n.getInputBlockByPredicate((function(e){return e.isAttribute&&"tangent"===e.name}));X||(X=new l.InputBlock("tangent")).setAsAttribute("tangent"),(Y=n.getInputBlockByPredicate((function(e){return e.isSystemValue&&e.systemValue===l.NodeMaterialSystemValues.World})))||(Y=new l.InputBlock("World")).setAsSystemValue(l.NodeMaterialSystemValues.World);W=new l.TransformBlock("World tangent");return X.connectTo(W),Y.connectTo(W),W}return null},e.GetColorFromConnectionNodeType=function(e){var t="#880000";switch(e){case l.NodeMaterialBlockConnectionPointTypes.Float:t="#cb9e27";break;case l.NodeMaterialBlockConnectionPointTypes.Vector2:t="#16bcb1";break;case l.NodeMaterialBlockConnectionPointTypes.Vector3:case l.NodeMaterialBlockConnectionPointTypes.Color3:t="#b786cb";break;case l.NodeMaterialBlockConnectionPointTypes.Vector4:case l.NodeMaterialBlockConnectionPointTypes.Color4:t="#be5126";break;case l.NodeMaterialBlockConnectionPointTypes.Matrix:t="#591990"}return t},e.GetConnectionNodeTypeFromString=function(e){switch(e){case"Float":return l.NodeMaterialBlockConnectionPointTypes.Float;case"Vector2":return l.NodeMaterialBlockConnectionPointTypes.Vector2;case"Vector3":return l.NodeMaterialBlockConnectionPointTypes.Vector3;case"Vector4":return l.NodeMaterialBlockConnectionPointTypes.Vector4;case"Matrix":return l.NodeMaterialBlockConnectionPointTypes.Matrix;case"Color3":return l.NodeMaterialBlockConnectionPointTypes.Color3;case"Color4":return l.NodeMaterialBlockConnectionPointTypes.Color4}return l.NodeMaterialBlockConnectionPointTypes.AutoDetect},e.GetStringFromConnectionNodeType=function(e){switch(e){case l.NodeMaterialBlockConnectionPointTypes.Float:return"Float";case l.NodeMaterialBlockConnectionPointTypes.Vector2:return"Vector2";case l.NodeMaterialBlockConnectionPointTypes.Vector3:return"Vector3";case l.NodeMaterialBlockConnectionPointTypes.Vector4:return"Vector4";case l.NodeMaterialBlockConnectionPointTypes.Color3:return"Color3";case l.NodeMaterialBlockConnectionPointTypes.Color4:return"Color4";case l.NodeMaterialBlockConnectionPointTypes.Matrix:return"Matrix"}return""},e}(),we=function(){function e(){}return e.prototype.getHeaderClass=function(e){var t=e;return t.isConstant?"constant":t.visibleInInspector?"inspector":""},e.prototype.shouldDisplayPortLabels=function(e){return!1},e.prototype.getHeaderText=function(e){var t=e,n=t.name+" ("+R.GetBaseType(t.output.type)+")";return t.isAttribute&&(n=R.GetBaseType(t.output.type)),n},e.prototype.getBackgroundColor=function(e){var t="",n=e;switch(n.type){case l.NodeMaterialBlockConnectionPointTypes.Color3:case l.NodeMaterialBlockConnectionPointTypes.Color4:if(n.value){t=n.value.toHexString();break}default:t=ye.GetColorFromConnectionNodeType(n.type)}return t},e.prototype.updatePreviewContent=function(e,t){var n="",r=e;if(r.isAttribute)n="mesh."+r.name;else if(r.isSystemValue)switch(r.systemValue){case l.NodeMaterialSystemValues.World:n="World";break;case l.NodeMaterialSystemValues.WorldView:n="World x View";break;case l.NodeMaterialSystemValues.WorldViewProjection:n="World x View x Projection";break;case l.NodeMaterialSystemValues.View:n="View";break;case l.NodeMaterialSystemValues.ViewProjection:n="View x Projection";break;case l.NodeMaterialSystemValues.Projection:n="Projection";break;case l.NodeMaterialSystemValues.CameraPosition:n="Camera position";break;case l.NodeMaterialSystemValues.FogColor:n="Fog color";break;case l.NodeMaterialSystemValues.DeltaTime:n="Delta time"}else switch(r.type){case l.NodeMaterialBlockConnectionPointTypes.Float:n=r.animationType!==l.AnimatedInputBlockTypes.None?l.AnimatedInputBlockTypes[r.animationType]:r.value.toFixed(2);break;case l.NodeMaterialBlockConnectionPointTypes.Vector2:var o=r.value;n="("+o.x.toFixed(2)+", "+o.y.toFixed(2)+")";break;case l.NodeMaterialBlockConnectionPointTypes.Vector3:var a=r.value;n="("+a.x.toFixed(2)+", "+a.y.toFixed(2)+", "+a.z.toFixed(2)+")";break;case l.NodeMaterialBlockConnectionPointTypes.Vector4:var i=r.value;n="("+i.x.toFixed(2)+", "+i.y.toFixed(2)+", "+i.z.toFixed(2)+", "+i.w.toFixed(2)+")"}t.innerHTML=n,t.classList.add("input-block")},e}(),xe=function(){function e(){}return e.prototype.getHeaderClass=function(e){return""},e.prototype.shouldDisplayPortLabels=function(e){return!0},e.prototype.getHeaderText=function(e){return e.name},e.prototype.getBackgroundColor=function(e){return"rgb(106, 44, 131)"},e.prototype.updatePreviewContent=function(e,t){t.classList.add("output-block")},e}(),_e=function(){function e(){}return e.prototype.getHeaderClass=function(e){return""},e.prototype.shouldDisplayPortLabels=function(e){return!1},e.prototype.getHeaderText=function(e){return e.name},e.prototype.getBackgroundColor=function(e){return"#4086BB"},e.prototype.updatePreviewContent=function(e,t){var n=e;t.classList.add("clamp-block"),t.innerHTML="["+n.minimum+", "+n.maximum+"]"},e}(),Ce=function(){function e(){}return e.prototype.getHeaderClass=function(e){return""},e.prototype.shouldDisplayPortLabels=function(e){return!1},e.prototype.getHeaderText=function(e){return e.name},e.prototype.getBackgroundColor=function(e){var t=e.colorSteps.map((function(e){return"rgb("+255*e.color.r+", "+255*e.color.g+", "+255*e.color.b+") "+100*e.step+"%"}));return t.length?"linear-gradient(90deg, "+t.join(", ")+")":"black"},e.prototype.updatePreviewContent=function(e,t){t.classList.add("gradient-block")},e}(),ke=function(){function e(){}return e.prototype.getHeaderClass=function(e){return""},e.prototype.shouldDisplayPortLabels=function(e){return!0},e.prototype.getHeaderText=function(e){return e.name},e.prototype.getBackgroundColor=function(e){return"#4086BB"},e.prototype._extractInputValue=function(e){var t=e.connectedPoint.ownerBlock;if(t.isInput){var n=t;if(n.isUniform&&!n.isSystemValue)return n.value}return"?"},e.prototype.updatePreviewContent=function(e,t){var n=e,r=n.sourceMin.isConnected?this._extractInputValue(n.sourceMin):n.sourceRange.x,o=n.sourceMax.isConnected?this._extractInputValue(n.sourceMax):n.sourceRange.y,a=n.targetMin.isConnected?this._extractInputValue(n.targetMin):n.targetRange.x,i=n.targetMax.isConnected?this._extractInputValue(n.targetMax):n.targetRange.y;t.classList.add("remap-block"),t.innerHTML="["+r+", "+o+"] -> ["+a+", "+i+"]"},e}(),Ee=function(){function e(){}return e.prototype.getHeaderClass=function(e){return""},e.prototype.shouldDisplayPortLabels=function(e){return!1},e.prototype.getHeaderText=function(e){return e.name},e.prototype.getBackgroundColor=function(e){return"#405C86"},e.prototype.updatePreviewContent=function(e,t){var n=e;t.classList.add("trigonometry-block"),t.innerHTML=l.TrigonometryBlockOperations[n.operation]},e}(),Se=function(e){function t(t){var n=e.call(this,t)||this;return n.state={displayRed:!0,displayGreen:!0,displayBlue:!0,displayAlpha:!0,face:0},n.canvasRef=o.createRef(),n}return u(t,e),t.prototype.shouldComponentUpdate=function(e,t){return!0},t.prototype.componentDidMount=function(){this.updatePreview()},t.prototype.componentDidUpdate=function(){this.updatePreview()},t.prototype.updatePreview=function(){t.UpdatePreview(this.canvasRef.current,this.props.texture,this.props.width,this.state,void 0,this.props.globalState)},t.UpdatePreview=function(e,n,r,o,a,i){!n.isReady()&&n._texture&&n._texture.onLoadedObservable.addOnce((function(){t.UpdatePreview(e,n,r,o,a,i)}));var s,c=n.getScene(),u=c.getEngine(),p=n.getSize(),d=p.width/p.height,f=r/d|1;if(n.isCube){var h=new l.PassCubePostProcess("pass",1,null,l.Texture.NEAREST_SAMPLINGMODE,u,!1,l.Constants.TEXTURETYPE_UNSIGNED_INT);h.face=o.face,s=h}else s=new l.PassPostProcess("pass",1,null,l.Texture.NEAREST_SAMPLINGMODE,u,!1,l.Constants.TEXTURETYPE_UNSIGNED_INT);if(!s.getEffect().isReady())return s.dispose(),void setTimeout((function(){return t.UpdatePreview(e,n,r,o,a,i)}),250);i&&(i.blockMutationUpdates=!0);var m=new l.RenderTargetTexture("temp",{width:r,height:f},c,!1);s.onApply=function(e){e.setTexture("textureSampler",n)};var g=m.getInternalTexture();if(g){c.postProcessManager.directRender([s],g);var v=4*r,b=f/2,y=u.readPixels(0,0,r,f);if(!(n.isCube||o.displayRed&&o.displayGreen&&o.displayBlue))for(var w=0;we.x||t.righte.y||t.bottomt.right||e.bottomt.bottom);n.isSelected=r})),this._onFrameCreatedObserver=this._globalState.onFrameCreated.add((function(e){n._ownerCanvas.frames.some((function(e){return-1!==e.nodes.indexOf(n)}))||n.isOverlappingFrame(e)&&e.nodes.push(n)}))}return Object.defineProperty(e.prototype,"isVisible",{get:function(){return this._isVisible},set:function(e){this._isVisible=e,e?this._visual.classList.remove("hidden"):this._visual.classList.add("hidden");for(var t=0,n=this._links;t-1&&this._ownerCanvas.selectedNodes.splice(t,1)}},enumerable:!0,configurable:!0}),e.prototype.isOverlappingFrame=function(e){var t=this._visual.getBoundingClientRect(),n=e.element.getBoundingClientRect();return n.width-=5,n.height-=5,!(n.rightt.right||n.bottomt.bottom)},e.prototype.getPortForConnectionPoint=function(e){for(var t=0,n=this._inputPorts;t0){var e=o._commentsElement.offsetHeight+40;o._minFrameHeight=e}},this._onRightHandlePointerDown=function(e){var t=o;t.isCollapsed||(o.initResizing(e),t._resizingDirection=Be.Right,t.mouseXLimit=e.clientX-(t.width-t._minFrameWidth),t._ownerCanvas.hostCanvas.addEventListener("pointerup",t._onRightHandlePointerUp),t._ownerCanvas.hostCanvas.addEventListener("pointermove",t._onRightHandlePointerMove))},this._onRightHandlePointerMove=function(e){var t=(o.element.offsetWidth-o._minFrameWidth)*o._ownerCanvas.zoom,n=o._mouseStartPointX-t;o._moveRightHandle(e,n)},this._moveRightHandle=function(e,t){var n=o;if(n.mouseXLimit){if(!n._isResizingRight()||null===n._mouseStartPointX||null===n._mouseStartPointY||e.clientXt)return;if(n._resizingDirection===Be.Left){e.stopPropagation();var r=(e.clientX-n._mouseStartPointX)/n._ownerCanvas.zoom;n._expandLeft(r),n._mouseStartPointX=e.clientX}}},this._onLeftHandlePointerUp=function(e){var t=o;t._resizingDirection===Be.Left&&(t.x=parseFloat(t.element.style.left.replace("px","")),t.width=parseFloat(t.element.style.width.replace("px","")),t._ownerCanvas.hostCanvas.removeEventListener("pointerup",t._onLeftHandlePointerUp),t._ownerCanvas.hostCanvas.removeEventListener("pointermove",t._onLeftHandlePointerMove),t.cleanUpResizing(e))},this._onTopHandlePointerDown=function(e){var t=o;t.isCollapsed||(t.initResizing(e),t._resizingDirection=Be.Top,t._ownerCanvas.hostCanvas.addEventListener("pointerup",t._onTopHandlePointerUp),t._ownerCanvas.hostCanvas.addEventListener("pointermove",t._onTopHandlePointerMove))},this._onTopHandlePointerMove=function(e){var t=(o.element.offsetHeight-o._minFrameHeight)*o._ownerCanvas.zoom,n=o._mouseStartPointY+t;o._moveTopHandle(e,n)},this._moveTopHandle=function(e,t){var n=o;if(n._isResizingTop()&&null!==n._mouseStartPointX&&null!==n._mouseStartPointY&&!(e.clientY>t)&&n._isResizingTop()){e.stopPropagation();var r=(e.clientY-n._mouseStartPointY)/n._ownerCanvas.zoom;n._expandTop(r),n._mouseStartPointY=e.clientY}},this._onTopHandlePointerUp=function(e){var t=o;t._isResizingTop()&&(t.y=parseFloat(t.element.style.top.replace("px","")),t.height=parseFloat(t.element.style.height.replace("px","")),t._ownerCanvas.hostCanvas.removeEventListener("pointerup",t._onTopHandlePointerUp),t._ownerCanvas.hostCanvas.removeEventListener("pointermove",t._onTopHandlePointerMove),t.cleanUpResizing(e))},this._onTopRightHandlePointerDown=function(e){var t=o;t.isCollapsed||(t.initResizing(e),t._resizingDirection=Be.TopRight,t._ownerCanvas.hostCanvas.addEventListener("pointerup",t._onTopRightHandlePointerUp),t._ownerCanvas.hostCanvas.addEventListener("pointermove",t._onTopRightHandlePointerMove))},this._onTopRightHandlePointerMove=function(e){var t=(o.element.offsetHeight-o._minFrameHeight)*o._ownerCanvas.zoom,n=o._mouseStartPointY+t,r=(o.element.offsetWidth-o._minFrameWidth)*o._ownerCanvas.zoom,a=o._mouseStartPointX-r;o._moveTopRightHandle(e,a,n)},this._moveTopRightHandle=function(e,t,n){var r=o;if(r._isResizingTop()&&r._isResizingRight()&&null!==r._mouseStartPointX&&null!==r._mouseStartPointY&&r._isResizingRight()&&r._isResizingTop())if(e.stopPropagation(),e.clientYt){var a=(e.clientX-r._mouseStartPointX)/r._ownerCanvas.zoom;r._expandRight(a,e.clientX),r._mouseStartPointX=e.clientX;var i=(e.clientY-r._mouseStartPointY)/r._ownerCanvas.zoom;r._expandTop(i),r._mouseStartPointY=e.clientY}else if(e.clientY>n&&e.clientX>t){a=(e.clientX-r._mouseStartPointX)/r._ownerCanvas.zoom;r._expandRight(a,e.clientX),r._mouseStartPointX=e.clientX}else if(e.clientYn&&e.clientX>t){var a=(e.clientX-r._mouseStartPointX)/r._ownerCanvas.zoom;r._expandRight(a,e.clientX),r._mouseStartPointX=e.clientX;var i=(e.clientY-r._mouseStartPointY)/r._ownerCanvas.zoom;r._expandBottom(i),r._mouseStartPointY=e.clientY}else if(e.clientYt){a=(e.clientX-r._mouseStartPointX)/r._ownerCanvas.zoom;r._expandRight(a,e.clientX),r._mouseStartPointX=e.clientX}else if(e.clientY>n&&e.clientXn&&e.clientXn&&e.clientX>t){i=(e.clientY-r._mouseStartPointY)/r._ownerCanvas.zoom;r._expandBottom(i),r._mouseStartPointY=e.clientY}},this._onBottomLeftHandlePointerUp=function(e){e.stopPropagation();var t=o;t._resizingDirection===Be.BottomLeft&&(t.height=parseFloat(t.element.style.height.replace("px","")),t.x=parseFloat(t.element.style.left.replace("px","")),t.width=parseFloat(t.element.style.width.replace("px","")),t._ownerCanvas.hostCanvas.removeEventListener("pointerup",t._onBottomLeftHandlePointerUp),t._ownerCanvas.hostCanvas.removeEventListener("pointermove",t._onBottomLeftHandlePointerMove),t.cleanUpResizing(e))},this._onTopLeftHandlePointerDown=function(e){var t=o;t.isCollapsed||(t.initResizing(e),t._resizingDirection=Be.TopLeft,t.mouseXLimit=e.clientX+t.width-t._minFrameWidth,t._ownerCanvas.hostCanvas.addEventListener("pointerup",t._onTopLeftHandlePointerUp),t._ownerCanvas.hostCanvas.addEventListener("pointermove",t._onTopLeftHandlePointerMove))},this._onTopLeftHandlePointerMove=function(e){var t=(o.element.offsetHeight-o._minFrameHeight)*o._ownerCanvas.zoom,n=o._mouseStartPointY+t,r=(o.element.offsetWidth-o._minFrameWidth)*o._ownerCanvas.zoom,a=o._mouseStartPointX+r;o._moveTopLeftHandle(e,a,n)},this._moveTopLeftHandle=function(e,t,n){var r=o;if(r._isResizingTop()&&r._isResizingLeft()&&null!==r._mouseStartPointX&&null!==r._mouseStartPointY&&r._isResizingLeft()&&r._isResizingTop())if(e.stopPropagation(),e.clientYn&&e.clientXt){i=(e.clientY-r._mouseStartPointY)/r._ownerCanvas.zoom;r._expandTop(i),r._mouseStartPointY=e.clientY}},this._onTopLeftHandlePointerUp=function(e){e.stopPropagation();var t=o;t._resizingDirection===Be.TopLeft&&(t.y=parseFloat(t.element.style.top.replace("px","")),t.height=parseFloat(t.element.style.height.replace("px","")),t.x=parseFloat(t.element.style.left.replace("px","")),t.width=parseFloat(t.element.style.width.replace("px","")),t._ownerCanvas.hostCanvas.removeEventListener("pointerup",t._onTopLeftHandlePointerUp),t._ownerCanvas.hostCanvas.removeEventListener("pointermove",t._onTopLeftHandlePointerMove),t.cleanUpResizing(e))},this._id=e._FrameCounter++,this._ownerCanvas=n;var a=n.frameContainer;this.element=a.ownerDocument.createElement("div"),this.element.classList.add("frame-box"),a.appendChild(this.element),this._headerElement=a.ownerDocument.createElement("div"),this._headerElement.classList.add("frame-box-header"),this._headerElement.addEventListener("dblclick",(function(){o.isCollapsed=!o.isCollapsed})),this.element.appendChild(this._headerElement),this._borderElement=a.ownerDocument.createElement("div"),this._borderElement.classList.add("frame-box-border"),this.element.appendChild(this._borderElement);var i=a.ownerDocument.createElement("div");i.className="handle right-handle",this.element.appendChild(i),i.addEventListener("pointerdown",this._onRightHandlePointerDown);var s=a.ownerDocument.createElement("div");s.className="handle left-handle",this.element.appendChild(s),s.addEventListener("pointerdown",this._onLeftHandlePointerDown);var c=a.ownerDocument.createElement("div");c.className="handle bottom-handle",this.element.appendChild(c),c.addEventListener("pointerdown",this._onBottomHandlePointerDown);var u=a.ownerDocument.createElement("div");u.className="handle top-handle",this.element.appendChild(u),u.addEventListener("pointerdown",this._onTopHandlePointerDown);var p=a.ownerDocument.createElement("div");p.className="handle right-handle top-right-corner-handle",this.element.appendChild(p),p.addEventListener("pointerdown",this._onTopRightHandlePointerDown);var d=a.ownerDocument.createElement("div");d.className="handle right-handle bottom-right-corner-handle",this.element.appendChild(d),d.addEventListener("pointerdown",this._onBottomRightHandlePointerDown);var f=a.ownerDocument.createElement("div");f.className="handle left-handle top-left-corner-handle",this.element.appendChild(f),f.addEventListener("pointerdown",this._onTopLeftHandlePointerDown);var h=a.ownerDocument.createElement("div");h.className="handle left-handle bottom-left-corner-handle",this.element.appendChild(h),h.addEventListener("pointerdown",this._onBottomLeftHandlePointerDown),this._headerTextElement=a.ownerDocument.createElement("div"),this._headerTextElement.classList.add("frame-box-header-title"),this._headerElement.appendChild(this._headerTextElement),this._headerCollapseElement=a.ownerDocument.createElement("div"),this._headerCollapseElement.classList.add("frame-box-header-collapse"),this._headerCollapseElement.classList.add("frame-box-header-button"),this._headerCollapseElement.title="Collapse",this._headerCollapseElement.ondragstart=function(){return!1},this._headerCollapseElement.addEventListener("pointerdown",(function(e){o._headerCollapseElement.classList.add("down"),e.stopPropagation()})),this._headerCollapseElement.addEventListener("pointerup",(function(e){e.stopPropagation(),o._headerCollapseElement.classList.remove("down"),o.isCollapsed=!o.isCollapsed})),this._headerCollapseElement.innerHTML=this.CollapseSVG,this._headerElement.appendChild(this._headerCollapseElement),this._headerCloseElement=a.ownerDocument.createElement("div"),this._headerCloseElement.classList.add("frame-box-header-close"),this._headerCloseElement.classList.add("frame-box-header-button"),this._headerCloseElement.title="Close",this._headerCloseElement.ondragstart=function(){return!1},this._headerCloseElement.addEventListener("pointerdown",(function(e){e.stopPropagation()})),this._headerCloseElement.addEventListener("pointerup",(function(e){e.stopPropagation(),o.dispose()})),this._headerCloseElement.innerHTML=this.CloseSVG,this._headerElement.appendChild(this._headerCloseElement),this._portContainer=a.ownerDocument.createElement("div"),this._portContainer.classList.add("port-container"),this.element.appendChild(this._portContainer),this._outputPortContainer=a.ownerDocument.createElement("div"),this._outputPortContainer.classList.add("outputsContainer"),this._portContainer.appendChild(this._outputPortContainer),this._inputPortContainer=a.ownerDocument.createElement("div"),this._inputPortContainer.classList.add("inputsContainer"),this._portContainer.appendChild(this._inputPortContainer),this.name="Frame",this.color=l.Color3.FromInts(72,72,72),t&&(this.x=parseFloat(t.style.left.replace("px","")),this.y=parseFloat(t.style.top.replace("px","")),this.width=parseFloat(t.style.width.replace("px","")),this.height=parseFloat(t.style.height.replace("px","")),this.cleanAccumulation()),this._headerTextElement.addEventListener("pointerdown",(function(e){return o._onDown(e)})),this._headerTextElement.addEventListener("pointerup",(function(e){return o._onUp(e)})),this._headerTextElement.addEventListener("pointermove",(function(e){return o._onMove(e)})),this._onSelectionChangedObserver=n.globalState.onSelectionChangedObservable.add((function(e){e===o?o.element.classList.add("selected"):o.element.classList.remove("selected")})),this._commentsElement=document.createElement("div"),this._commentsElement.className="frame-comments",this._commentsElement.style.color="white",this._commentsElement.style.fontSize="16px",this.element.appendChild(this._commentsElement),r||this.refresh()}return Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCollapsed",{get:function(){return this._isCollapsed},set:function(t){if(this._isCollapsed!==t){if(this._isCollapsed=t,this._ownerCanvas._frameIsMoving=!0,t){this.element.classList.add("collapsed"),this._moveFrame((this.width-this.CollapsedWidth)/2,0);for(var n=0,r=this._nodes;nthis._minFrameWidth?e:this._minFrameWidth;this._width=t;var n=this._ownerCanvas.getGridPositionCeil(t+this._gridAlignedX);this.element.style.width=n-this._gridAlignedX+"px"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(e){if(this._height!==e){this._height=e;var t=this._ownerCanvas.getGridPositionCeil(e+this._gridAlignedY);this.element.style.height=t-this._gridAlignedY+"px"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comments",{get:function(){return this._comments},set:function(e){e&&!this._comments&&e.length>0?(this.element.style.gridTemplateRows="40px min-content 1fr",this._borderElement.style.gridRow="1 / span 3",this._portContainer.style.gridRow="3",this._commentsElement.classList.add("has-comments")):e||(this.element.style.gridTemplateRows="40px calc(100% - 40px)",this._borderElement.style.gridRow="1 / span 2",this._portContainer.style.gridRow="2",this._commentsElement.classList.remove("has-comments")),(""===e||e&&e.length>=0)&&(this._commentsElement.innerText=e),this.height=this._borderElement.offsetHeight,this._comments=e,this.updateMinHeightWithComments()},enumerable:!0,configurable:!0}),e.prototype.refresh=function(){this._nodes=[],this._ownerCanvas.globalState.onFrameCreated.notifyObservers(this)},e.prototype.addNode=function(e){-1===this.nodes.indexOf(e)&&this.nodes.push(e)},e.prototype.removeNode=function(e){var t=this.nodes.indexOf(e);t>-1&&this.nodes.splice(t,1)},e.prototype.syncNode=function(e){this.isCollapsed||(e.isOverlappingFrame(this)?this.addNode(e):this.removeNode(e))},e.prototype.cleanAccumulation=function(){for(var e=0,t=this._nodes;e20&&(this._mouseStartPointX=t,this.element.style.width=n+e+"px"),this.updateMinHeightWithComments()},e.prototype._expandBottom=function(e){var t=parseFloat(this.element.style.height.replace("px",""));this.element.style.height=t+e+"px"},e.prototype.dispose=function(){this.isCollapsed=!1,this._onSelectionChangedObserver&&this._ownerCanvas.globalState.onSelectionChangedObservable.remove(this._onSelectionChangedObserver),this.element.parentElement.removeChild(this.element),this._ownerCanvas.frames.splice(this._ownerCanvas.frames.indexOf(this),1),this.onExpandStateChanged.clear()},e.prototype.serialize=function(){return{x:this._x,y:this._y,width:this._width,height:this._height,color:this._color.asArray(),name:this.name,isCollapsed:this.isCollapsed,blocks:this.nodes.map((function(e){return e.block.uniqueId})),comments:this._comments}},e.prototype.export=function(){var e=this._ownerCanvas.globalState,t=D.Serialize(e.nodeMaterial,e,this.nodes.map((function(e){return e.block})));R.DownloadAsFile(e.hostDocument,t,this._name+".json")},e.Parse=function(t,n,r){var o=new e(null,n,!0),a=!!t.isCollapsed;if(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height,o.name=t.name,o.color=l.Color3.FromArray(t.color),o.comments=t.comments,t.blocks&&r)for(var i=function(){var e=r[u],t=n.nodes.filter((function(t){return t.block.uniqueId===e}));t.length&&o.nodes.push(t[0])},s=0,c=t.blocks;s-1&&this._links.splice(t,1),e.dispose()},t.prototype.appendBlock=function(e){var t=new Le(e,this.props.globalState);return t.appendVisual(this._graphCanvas,this),this._nodes.push(t),t},t.prototype.distributeGraph=function(){var e=this;this.x=0,this.y=0,this.zoom=1;var t=new Je.graphlib.Graph;t.setGraph({}),t.setDefaultEdgeLabel((function(){return{}})),t.graph().rankdir="LR",this._nodes.forEach((function(n){e._frames.some((function(e){return-1!==e.nodes.indexOf(n)}))||t.setNode(n.id.toString(),{id:n.id,type:"node",width:n.width,height:n.height})})),this._frames.forEach((function(e){t.setNode(e.id.toString(),{id:e.id,type:"frame",width:e.element.clientWidth,height:e.element.clientHeight})})),this._nodes.forEach((function(n){n.block.outputs.forEach((function(r){r.hasEndpoints&&r.endpoints.forEach((function(r){var o=e._frames.filter((function(e){return-1!==e.nodes.indexOf(n)})),a=e._frames.filter((function(e){return e.nodes.some((function(e){return e.block===r.ownerBlock}))})),i=o.length>0?o[0].id:n.id,l=a.length>0?a[0].id:r.ownerBlock.uniqueId;t.setEdge(i.toString(),l.toString())}))}))})),Je.layout(t),t.nodes().map((function(e){return t.node(e)})).forEach((function(t){if("node"!==t.type)for(var n=0,r=e._frames;nthis._selectionStartX?(this._selectionBox.style.left=this._selectionStartX/this.zoom+"px",this._selectionBox.style.width=(n-this._selectionStartX)/this.zoom+"px"):(this._selectionBox.style.left=n/this.zoom+"px",this._selectionBox.style.width=(this._selectionStartX-n)/this.zoom+"px"),r>this._selectionStartY?(this._selectionBox.style.top=this._selectionStartY/this.zoom+"px",this._selectionBox.style.height=(r-this._selectionStartY)/this.zoom+"px"):(this._selectionBox.style.top=r/this.zoom+"px",this._selectionBox.style.height=(this._selectionStartY-r)/this.zoom+"px"),void this.props.globalState.onSelectionBoxMoved.notifyObservers(this._selectionBox.getBoundingClientRect())}if(this._frameCandidate){t=this.canvasContainer.getBoundingClientRect(),n=e.pageX-t.left,r=e.pageY-t.top;return n>this._selectionStartX?(this._frameCandidate.style.left=this._selectionStartX/this.zoom+"px",this._frameCandidate.style.width=(n-this._selectionStartX)/this.zoom+"px"):(this._frameCandidate.style.left=n/this.zoom+"px",this._frameCandidate.style.width=(this._selectionStartX-n)/this.zoom+"px"),void(r>this._selectionStartY?(this._frameCandidate.style.top=this._selectionStartY/this.zoom+"px",this._frameCandidate.style.height=(r-this._selectionStartY)/this.zoom+"px"):(this._frameCandidate.style.top=r/this.zoom+"px",this._frameCandidate.style.height=(this._selectionStartY-r)/this.zoom+"px"))}if(this._candidateLink){t=this.canvasContainer.getBoundingClientRect();return this._candidatePort=null,this.props.globalState.onCandidateLinkMoved.notifyObservers(new l.Vector2(e.pageX,e.pageY)),this._dropPointX=(e.pageX-t.left)/this.zoom,this._dropPointY=(e.pageY-t.top)/this.zoom,this._candidateLink.update(this._dropPointX,this._dropPointY,!0),void(this._candidateLinkedHasMoved=!0)}if(this._altKeyIsPressed&&1===e.buttons){this._oldY<0&&(this._oldY=e.pageY);var o=(e.pageY-this._oldY)/10;if(Math.abs(o)>5){var a=this.zoom;this.zoom=Math.max(Math.min(this.MaxZoom,this.zoom+o/100),this.MinZoom);var i=e.currentTarget.getBoundingClientRect(),s=i.width,c=s*this.zoom-s*a,u=(e.clientX-i.left-this.x)/a/s;this.x=this.x-c*u,this._oldY=e.pageY}}else this._rootContainer.style.cursor="move",null!==this._mouseStartPointX&&null!==this._mouseStartPointY&&(this.x+=e.clientX-this._mouseStartPointX,this.y+=e.clientY-this._mouseStartPointY,this._mouseStartPointX=e.clientX,this._mouseStartPointY=e.clientY)},t.prototype.onDown=function(e){if(this._rootContainer.setPointerCapture(e.pointerId),e.currentTarget===this._hostCanvas&&e.ctrlKey){this._selectionBox=this.props.globalState.hostDocument.createElement("div"),this._selectionBox.classList.add("selection-box"),this._selectionContainer.appendChild(this._selectionBox);var t=this.canvasContainer.getBoundingClientRect();return this._selectionStartX=e.pageX-t.left,this._selectionStartY=e.pageY-t.top,this._selectionBox.style.left=this._selectionStartX/this.zoom+"px",this._selectionBox.style.top=this._selectionStartY/this.zoom+"px",this._selectionBox.style.width="0px",void(this._selectionBox.style.height="0px")}if(e.currentTarget===this._hostCanvas&&e.shiftKey){this._frameCandidate=this.props.globalState.hostDocument.createElement("div"),this._frameCandidate.classList.add("frame-box"),this._frameContainer.appendChild(this._frameCandidate);t=this.canvasContainer.getBoundingClientRect();return this._selectionStartX=e.pageX-t.left,this._selectionStartY=e.pageY-t.top,this._frameCandidate.style.left=this._selectionStartX/this.zoom+"px",this._frameCandidate.style.top=this._selectionStartY/this.zoom+"px",this._frameCandidate.style.width="0px",void(this._frameCandidate.style.height="0px")}if(e.nativeEvent.srcElement&&"IMG"===e.nativeEvent.srcElement.nodeName){if(!this._candidateLink){var n=e.nativeEvent.srcElement.parentElement.port;this._candidateLink=new et(this,n,n.node),this._candidateLinkedHasMoved=!1}}else this.props.globalState.onSelectionChangedObservable.notifyObservers(null),this._mouseStartPointX=e.clientX,this._mouseStartPointY=e.clientY},t.prototype.onUp=function(e){if(this._mouseStartPointX=null,this._mouseStartPointY=null,this._rootContainer.releasePointerCapture(e.pointerId),this._oldY=-1,this._candidateLink&&(this._candidateLinkedHasMoved?(this.processCandidatePort(),this.props.globalState.onCandidateLinkMoved.notifyObservers(null)):null!==this._candidateLink.portA.frameId&&this.props.globalState.onSelectionChangedObservable.notifyObservers(this._candidateLink.portA),this._candidateLink.dispose(),this._candidateLink=null,this._candidatePort=null),this._selectionBox&&(this._selectionBox.parentElement.removeChild(this._selectionBox),this._selectionBox=null),this._frameCandidate){var t=new Me(this._frameCandidate,this);this._frames.push(t),this._frameCandidate.parentElement.removeChild(this._frameCandidate),this._frameCandidate=null,this.props.globalState.onSelectionChangedObservable.notifyObservers(t)}},t.prototype.onWheel=function(e){var t=e.deltaY<0?.1:-.1,n=this.zoom;this.zoom=Math.min(Math.max(this.MinZoom,this.zoom+t*this.zoom),this.MaxZoom);var r=e.currentTarget.getBoundingClientRect(),o=r.width,a=r.height,i=o*this.zoom-o*n,l=a*this.zoom-a*n,s=e.clientX-r.left,c=e.clientY-r.top,u=(s-this.x)/n/o,p=(c-this.y)/n/a;this.x=this.x-i*u,this.y=this.y-l*p,e.stopPropagation()},t.prototype.zoomToFit=function(){var e=this,t=0,n=0;this._nodes.forEach((function(r){e._frames.some((function(e){return-1!==e.nodes.indexOf(r)}))||(r.x-1&&n._blocks.splice(i,1)}return n._graphCanvas.selectedLink&&n._graphCanvas.selectedLink.dispose(),n._graphCanvas.selectedFrame&&n._graphCanvas.selectedFrame.dispose(),n.props.globalState.onSelectionChangedObservable.notifyObservers(null),void n.props.globalState.onRebuildRequiredObservable.notifyObservers()}if(e.ctrlKey&&!n.props.globalState.blockKeyboardEvents)if("c"===e.key){if(n._copiedNodes=[],n._copiedFrame=null,n._graphCanvas.selectedFrame)return void(n._copiedFrame=n._graphCanvas.selectedFrame);var l;if(!(l=n._graphCanvas.selectedNodes).length)return;if(!l[0].block)return;n._copiedNodes=l.slice(0)}else if("v"===e.key){var s=n.props.globalState.hostDocument.querySelector(".diagram-container"),c=n._graphCanvas.zoom,u=(n._mouseLocationY-s.offsetTop-n._graphCanvas.y-20)/c;if(n._copiedFrame){var p=new Me(null,n._graphCanvas,!0);n._graphCanvas.frames.push(p),p.width=n._copiedFrame.width,p.height=n._copiedFrame.height,p.width,p.name=n._copiedFrame.name,p.color=n._copiedFrame.color;var d=(n._mouseLocationX-s.offsetLeft-n._graphCanvas.x)/c;return p.x=d-p.width/2,p.y=u,n._copiedFrame.nodes.length&&(d=p.x+n._copiedFrame.nodes[0].x-n._copiedFrame.x,u=p.y+n._copiedFrame.nodes[0].y-n._copiedFrame.y,n.pasteSelection(n._copiedFrame.nodes,d,u)),void(n._copiedFrame.isCollapsed&&(p.isCollapsed=!0))}if(!n._copiedNodes.length)return;var f=(n._mouseLocationX-s.offsetLeft-n._graphCanvas.x-n.NodeWidth)/c;n.pasteSelection(n._copiedNodes,f,u)}}),!1),n}return u(t,e),t.prototype.createNodeFromObject=function(e,t){if(void 0===t&&(t=!0),-1!==this._blocks.indexOf(e))return this._graphCanvas.nodes.filter((function(t){return t.block===e}))[0];if(this._blocks.push(e),-1===this.props.globalState.nodeMaterial.attachedBlocks.indexOf(e)&&this.props.globalState.nodeMaterial.attachedBlocks.push(e),e.isFinalMerger&&this.props.globalState.nodeMaterial.addOutputNode(e),e.inputs.length)for(var n=0,r=e.inputs;n0){var p=u[0],d=n.indexOf(p);s.reconnectNewNodes(d,t,n,r);var f=l.outputs.indexOf(e.connectedPoint);t[d].block.outputs[f].connectTo(o)}else e._connectedPoint.connectTo(o);s._graphCanvas.connectPorts(o.connectedPoint,o)},s=this,c=0;cs){var c=l;l=s,s=c}return l+i+s+i+(r.isUndefined(a)?o:a)}function p(e,t,n,r){var o=""+t,a=""+n;if(!e&&o>a){var i=o;o=a,a=i}var l={v:o,w:a};return r&&(l.name=r),l}function d(e,t){return u(e,t.v,t.w,t.name)}l.prototype._nodeCount=0,l.prototype._edgeCount=0,l.prototype.isDirected=function(){return this._isDirected},l.prototype.isMultigraph=function(){return this._isMultigraph},l.prototype.isCompound=function(){return this._isCompound},l.prototype.setGraph=function(e){return this._label=e,this},l.prototype.graph=function(){return this._label},l.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},l.prototype.nodeCount=function(){return this._nodeCount},l.prototype.nodes=function(){return r.keys(this._nodes)},l.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},l.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},l.prototype.setNodes=function(e,t){var n=arguments,o=this;return r.each(e,(function(e){n.length>1?o.setNode(e,t):o.setNode(e)})),this},l.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=a,this._children[e]={},this._children[a][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},l.prototype.node=function(e){return this._nodes[e]},l.prototype.hasNode=function(e){return r.has(this._nodes,e)},l.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},l.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=a;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},l.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},l.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==a)return t}},l.prototype.children=function(e){if(r.isUndefined(e)&&(e=a),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===a)return this.nodes();if(this.hasNode(e))return[]}},l.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},l.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},l.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},l.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},l.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var o={};return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,function e(r){var a=n.parent(r);return void 0===a||t.hasNode(a)?(o[r]=a,a):a in o?o[a]:e(a)}(e))})),t},l.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},l.prototype.edgeCount=function(){return this._edgeCount},l.prototype.edges=function(){return r.values(this._edgeObjs)},l.prototype.setPath=function(e,t){var n=this,o=arguments;return r.reduce(e,(function(e,r){return o.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},l.prototype.setEdge=function(){var e,t,n,o,a=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,t=i.w,n=i.name,2===arguments.length&&(o=arguments[1],a=!0)):(e=i,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],a=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var l=u(this._isDirected,e,t,n);if(r.has(this._edgeLabels,l))return a&&(this._edgeLabels[l]=o),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[l]=a?o:this._defaultEdgeLabelFn(e,t,n);var c=p(this._isDirected,e,t,n);return e=c.v,t=c.w,Object.freeze(c),this._edgeObjs[l]=c,s(this._preds[t],e),s(this._sucs[e],t),this._in[t][l]=c,this._out[e][l]=c,this._edgeCount++,this},l.prototype.edge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):u(this._isDirected,e,t,n);return this._edgeLabels[r]},l.prototype.hasEdge=function(e,t,n){var o=1===arguments.length?d(this._isDirected,arguments[0]):u(this._isDirected,e,t,n);return r.has(this._edgeLabels,o)},l.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):u(this._isDirected,e,t,n),o=this._edgeObjs[r];return o&&(e=o.v,t=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],c(this._preds[t],e),c(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},l.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var o=r.values(n);return t?r.filter(o,(function(e){return e.v===t})):o}},l.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var o=r.values(n);return t?r.filter(o,(function(e){return e.w===t})):o}},l.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},function(e,t,n){var r=n(15)(n(9),"Map");e.exports=r},function(e,t,n){var r=n(171),o=n(178),a=n(180),i=n(181),l=n(182);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=n}},function(e,t,n){(function(e){var r=n(74),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,l=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=l}).call(this,n(54)(e))},function(e,t,n){var r=n(41),o=n(188),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(81),o=n(82),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,l=i?function(e){return null==e?[]:(e=Object(e),r(i(e),(function(t){return a.call(e,t)})))}:o;e.exports=l},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n0&&a(u)?n>1?e(u,n-1,a,i,l):r(l,u):i||(l[l.length]=u)}return l}},function(e,t,n){var r=n(23);e.exports=function(e,t,n){for(var o=-1,a=e.length;++o-1;o--){var a=n[o],i=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(i)>-1&&(r=a)}return g.head.insertBefore(t,r),e}}var ee="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function te(){for(var e=12,t="";e-- >0;)t+=ee[62*Math.random()|0];return t}function ne(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function re(e){return Object.keys(e||{}).reduce((function(t,n){return t+"".concat(n,": ").concat(e[n],";")}),"")}function oe(e){return e.size!==$.size||e.x!==$.x||e.y!==$.y||e.rotate!==$.rotate||e.flipX||e.flipY}function ae(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth,o={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(32*t.x,", ").concat(32*t.y,") "),i="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),l="rotate(".concat(t.rotate," 0 0)");return{outer:o,inner:{transform:"".concat(a," ").concat(i," ").concat(l)},path:{transform:"translate(".concat(r/2*-1," -256)")}}}var ie={x:0,y:0,width:"100%",height:"100%"};function le(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function se(e){var t=e.icons,n=t.main,r=t.mask,o=e.prefix,a=e.iconName,i=e.transform,s=e.symbol,c=e.title,u=e.extra,p=e.watchable,d=void 0!==p&&p,f=r.found?r:n,h=f.width,m=f.height,g="fa-w-".concat(Math.ceil(h/m*16)),v=[P.replacementClass,a?"".concat(P.familyPrefix,"-").concat(a):"",g].filter((function(e){return-1===u.classes.indexOf(e)})).concat(u.classes).join(" "),b={children:[],attributes:l({},u.attributes,{"data-prefix":o,"data-icon":a,class:v,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(h," ").concat(m)})};d&&(b.attributes[x]=""),c&&b.children.push({tag:"title",attributes:{id:b.attributes["aria-labelledby"]||"title-".concat(te())},children:[c]});var y=l({},b,{prefix:o,iconName:a,main:n,mask:r,transform:i,symbol:s,styles:u.styles}),w=r.found&&n.found?function(e){var t,n=e.children,r=e.attributes,o=e.main,a=e.mask,i=e.transform,s=o.width,c=o.icon,u=a.width,p=a.icon,d=ae({transform:i,containerWidth:u,iconWidth:s}),f={tag:"rect",attributes:l({},ie,{fill:"white"})},h=c.children?{children:c.children.map(le)}:{},m={tag:"g",attributes:l({},d.inner),children:[le(l({tag:c.tag,attributes:l({},c.attributes,d.path)},h))]},g={tag:"g",attributes:l({},d.outer),children:[m]},v="mask-".concat(te()),b="clip-".concat(te()),y={tag:"mask",attributes:l({},ie,{id:v,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[f,g]},w={tag:"defs",children:[{tag:"clipPath",attributes:{id:b},children:(t=p,"g"===t.tag?t.children:[t])},y]};return n.push(w,{tag:"rect",attributes:l({fill:"currentColor","clip-path":"url(#".concat(b,")"),mask:"url(#".concat(v,")")},ie)}),{children:n,attributes:r}}(y):function(e){var t=e.children,n=e.attributes,r=e.main,o=e.transform,a=re(e.styles);if(a.length>0&&(n.style=a),oe(o)){var i=ae({transform:o,containerWidth:r.width,iconWidth:r.width});t.push({tag:"g",attributes:l({},i.outer),children:[{tag:"g",attributes:l({},i.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:l({},r.icon.attributes,i.path)}]}]})}else t.push(r.icon);return{children:t,attributes:n}}(y),_=w.children,C=w.attributes;return y.children=_,y.attributes=C,s?function(e){var t=e.prefix,n=e.iconName,r=e.children,o=e.attributes,a=e.symbol;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:l({},o,{id:!0===a?"".concat(t,"-").concat(P.familyPrefix,"-").concat(n):a}),children:r}]}]}(y):function(e){var t=e.children,n=e.main,r=e.mask,o=e.attributes,a=e.styles,i=e.transform;if(oe(i)&&n.found&&!r.found){var s={x:n.width/n.height/2,y:.5};o.style=re(l({},a,{"transform-origin":"".concat(s.x+i.x/16,"em ").concat(s.y+i.y/16,"em")}))}return[{tag:"svg",attributes:o,children:t}]}(y)}var ce=function(){},ue=(P.measurePerformance&&v&&v.mark&&v.measure,function(e,t,n,r){var o,a,i,l=Object.keys(e),s=l.length,c=void 0!==r?function(e,t){return function(n,r,o,a){return e.call(t,n,r,o,a)}}(t,r):t;for(void 0===n?(o=1,i=e[l[0]]):(o=0,i=n);o2&&void 0!==arguments[2]?arguments[2]:{}).skipHooks,r=void 0!==n&&n,o=Object.keys(t).reduce((function(e,n){var r=t[n];return!!r.icon?e[r.iconName]=r.icon:e[n]=r,e}),{});"function"!=typeof N.hooks.addPack||r?N.styles[e]=l({},N.styles[e]||{},o):N.hooks.addPack(e,o),"fas"===e&&pe("fa",t)}var de=N.styles,fe=N.shims,he=function(){var e=function(e){return ue(de,(function(t,n,r){return t[r]=ue(n,e,{}),t}),{})};e((function(e,t,n){return t[3]&&(e[t[3]]=n),e})),e((function(e,t,n){var r=t[2];return e[n]=n,r.forEach((function(t){e[t]=n})),e}));var t="far"in de;ue(fe,(function(e,n){var r=n[0],o=n[1],a=n[2];return"far"!==o||t||(o="fas"),e[r]={prefix:o,iconName:a},e}),{})};he();N.styles;function me(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}function ge(e){var t=e.tag,n=e.attributes,r=void 0===n?{}:n,o=e.children,a=void 0===o?[]:o;return"string"==typeof e?ne(e):"<".concat(t," ").concat(function(e){return Object.keys(e||{}).reduce((function(t,n){return t+"".concat(n,'="').concat(ne(e[n]),'" ')}),"").trim()}(r),">").concat(a.map(ge).join(""),"")}var ve=function(e){var t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e?e.toLowerCase().split(" ").reduce((function(e,t){var n=t.toLowerCase().split("-"),r=n[0],o=n.slice(1).join("-");if(r&&"h"===o)return e.flipX=!0,e;if(r&&"v"===o)return e.flipY=!0,e;if(o=parseFloat(o),isNaN(o))return e;switch(r){case"grow":e.size=e.size+o;break;case"shrink":e.size=e.size-o;break;case"left":e.x=e.x-o;break;case"right":e.x=e.x+o;break;case"up":e.y=e.y-o;break;case"down":e.y=e.y+o;break;case"rotate":e.rotate=e.rotate+o}return e}),t):t};function be(e){this.name="MissingIcon",this.message=e||"Icon unavailable",this.stack=(new Error).stack}be.prototype=Object.create(Error.prototype),be.prototype.constructor=be;var ye={fill:"currentColor"},we={attributeType:"XML",repeatCount:"indefinite",dur:"2s"},xe={tag:"path",attributes:l({},ye,{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})},_e=l({},we,{attributeName:"opacity"});l({},ye,{cx:"256",cy:"364",r:"28"}),l({},we,{attributeName:"r",values:"28;14;28;28;14;28;"}),l({},_e,{values:"1;0;1;1;0;1;"}),l({},ye,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),l({},_e,{values:"1;0;0;0;0;1;"}),l({},ye,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),l({},_e,{values:"0;0;1;1;0;0;"}),N.styles;function Ce(e){var t=e[0],n=e[1],r=s(e.slice(4),1)[0];return{found:!0,width:t,height:n,icon:Array.isArray(r)?{tag:"g",attributes:{class:"".concat(P.familyPrefix,"-").concat(k.GROUP)},children:[{tag:"path",attributes:{class:"".concat(P.familyPrefix,"-").concat(k.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(P.familyPrefix,"-").concat(k.PRIMARY),fill:"currentColor",d:r[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:r}}}}N.styles;var ke='svg:not(:root).svg-inline--fa {\n overflow: visible;\n}\n\n.svg-inline--fa {\n display: inline-block;\n font-size: inherit;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-border {\n height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n width: 2em;\n}\n.svg-inline--fa.fa-fw {\n width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: #ff253a;\n border-radius: 1em;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: #fff;\n height: 1.5em;\n line-height: 1;\n max-width: 5em;\n min-width: 1.5em;\n overflow: hidden;\n padding: 0.25em;\n right: 0;\n text-overflow: ellipsis;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: 0;\n right: 0;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: 0;\n left: 0;\n right: auto;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n right: 0;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: 0;\n right: auto;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-lg {\n font-size: 1.3333333333em;\n line-height: 0.75em;\n vertical-align: -0.0667em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: 2.5em;\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: -2em;\n position: absolute;\n text-align: center;\n width: 2em;\n line-height: inherit;\n}\n\n.fa-border {\n border: solid 0.08em #eee;\n border-radius: 0.1em;\n padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n float: left;\n}\n\n.fa-pull-right {\n float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n margin-left: 0.3em;\n}\n\n.fa-spin {\n -webkit-animation: fa-spin 2s infinite linear;\n animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n -webkit-animation: fa-spin 1s infinite steps(8);\n animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n -webkit-filter: none;\n filter: none;\n}\n\n.fa-stack {\n display: inline-block;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: #fff;\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n clip: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n position: static;\n width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse {\n color: #fff;\n}';function Ee(){var e=y,t=w,n=P.familyPrefix,r=P.replacementClass,o=ke;if(n!==e||r!==t){var a=new RegExp("\\.".concat(e,"\\-"),"g"),i=new RegExp("\\--".concat(e,"\\-"),"g"),l=new RegExp("\\.".concat(t),"g");o=o.replace(a,".".concat(n,"-")).replace(i,"--".concat(n,"-")).replace(l,".".concat(r))}return o}function Se(){P.autoAddCss&&!Oe&&(J(Ee()),Oe=!0)}function Pe(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map((function(e){return ge(e)}))}}),Object.defineProperty(e,"node",{get:function(){if(b){var t=g.createElement("div");return t.innerHTML=e.html,t.children}}}),e}function Te(e){var t=e.prefix,n=void 0===t?"fa":t,r=e.iconName;if(r)return me(Be.definitions,n,r)||me(N.styles,n,r)}var Ne,Be=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.definitions={}}var t,n,r;return t=e,(n=[{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=t.transform,r=void 0===n?$:n,o=t.symbol,a=void 0!==o&&o,i=t.mask,s=void 0===i?null:i,c=t.title,u=void 0===c?null:c,p=t.classes,d=void 0===p?[]:p,f=t.attributes,h=void 0===f?{}:f,m=t.styles,g=void 0===m?{}:m;if(e){var v=e.prefix,b=e.iconName,y=e.icon;return Pe(l({type:"icon"},e),(function(){return Se(),P.autoA11y&&(u?h["aria-labelledby"]="".concat(P.replacementClass,"-title-").concat(te()):(h["aria-hidden"]="true",h.focusable="false")),se({icons:{main:Ce(y),mask:s?Ce(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:v,iconName:b,transform:l({},$,r),symbol:a,title:u,extra:{attributes:h,styles:g,classes:d}})}))}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e||{}).icon?e:Te(e||{}),r=t.mask;return r&&(r=(r||{}).icon?r:Te(r||{})),Ne(n,l({},t,{mask:r}))})}).call(this,n(24),n(131).setImmediate)},function(e,t,n){e.exports={graphlib:n(8),layout:n(265),debug:n(324),util:{time:n(5).time,notime:n(5).notime},version:n(325)}},function(e,t,n){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,s=i(e),c=1;cd))return!1;var h=u.get(e);if(h&&u.get(t))return h==t;var m=-1,g=!0,v=n&l?new r:void 0;for(u.set(e,t),u.set(t,e);++m0&&(a=s.removeMin(),(i=l[a]).distance!==Number.POSITIVE_INFINITY);)r(a).forEach(c);return l}(e,String(t),n||a,r||function(t){return e.outEdges(t)})};var a=r.constant(1)},function(e,t,n){var r=n(6);function o(){this._arr=[],this._keyIndices={}}e.exports=o,o.prototype.size=function(){return this._arr.length},o.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},o.prototype.has=function(e){return r.has(this._keyIndices,e)},o.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},o.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},o.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var o=this._arr,a=o.length;return n[e]=a,o.push({key:e,priority:t}),this._decrease(a),!0}return!1},o.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},o.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},o.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,o=e;n>1].priorityM.length&&M.push(e)}function D(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var s=!1;if(null===t)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case a:case i:s=!0}}if(s)return r(o,t,""===n?"."+A(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;cthis.eventPool.length&&this.eventPool.push(e)}function de(e){e.eventPool=[],e.getPooled=ue,e.release=pe}o(ce.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=le)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=le)},persist:function(){this.isPersistent=le},isPersistent:se,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=se,this._dispatchInstances=this._dispatchListeners=null}}),ce.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},ce.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var a=new t;return o(a,n.prototype),n.prototype=a,n.prototype.constructor=n,n.Interface=o({},r.Interface,e),n.extend=r.extend,de(n),n},de(ce);var fe=ce.extend({data:null}),he=ce.extend({data:null}),me=[9,13,27,32],ge=X&&"CompositionEvent"in window,ve=null;X&&"documentMode"in document&&(ve=document.documentMode);var be=X&&"TextEvent"in window&&!ve,ye=X&&(!ge||ve&&8=ve),we=String.fromCharCode(32),xe={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},_e=!1;function Ce(e,t){switch(e){case"keyup":return-1!==me.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function ke(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ee=!1;var Se={eventTypes:xe,extractEvents:function(e,t,n,r){var o=void 0,a=void 0;if(ge)e:{switch(e){case"compositionstart":o=xe.compositionStart;break e;case"compositionend":o=xe.compositionEnd;break e;case"compositionupdate":o=xe.compositionUpdate;break e}o=void 0}else Ee?Ce(e,n)&&(o=xe.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=xe.compositionStart);return o?(ye&&"ko"!==n.locale&&(Ee||o!==xe.compositionStart?o===xe.compositionEnd&&Ee&&(a=ie()):(oe="value"in(re=r)?re.value:re.textContent,Ee=!0)),o=fe.getPooled(o,t,n,r),a?o.data=a:null!==(a=ke(n))&&(o.data=a),Y(o),a=o):a=null,(e=be?function(e,t){switch(e){case"compositionend":return ke(t);case"keypress":return 32!==t.which?null:(_e=!0,we);case"textInput":return(e=t.data)===we&&_e?null:e;default:return null}}(e,n):function(e,t){if(Ee)return"compositionend"===e||!ge&&Ce(e,t)?(e=ie(),ae=oe=re=null,Ee=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1