!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=141)}([function(t,n){t.exports=e},function(e,t,n){"use strict";e.exports=n(142)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReactCSS=t.loop=t.handleActive=t.handleHover=t.hover=void 0;var r=c(n(155)),o=c(n(213)),a=c(n(230)),i=c(n(231)),l=c(n(232)),s=c(n(233));function c(e){return e&&e.__esModule?e:{default:e}}t.hover=i.default,t.handleHover=i.default,t.handleActive=l.default,t.loop=s.default;var u=t.ReactCSS=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;iMath.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(292),constant:n(73),each:n(74),filter:n(125),has:n(126),isArray:n(6),isEmpty:n(295),isFunction:n(34),isUndefined:n(127),keys:n(19),map:n(15),reduce:n(128),size:n(298),transform:n(303),union:n(304),values:n(130)}}catch(e){}r||(r=window._),e.exports=r},function(e,t,n){var r=n(82),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.red=t.getContrastingColor=t.isValidHex=t.toState=t.simpleCheckForValidColor=void 0;var r=a(n(74)),o=a(n(251));function a(e){return e&&e.__esModule?e:{default:e}}t.simpleCheckForValidColor=function(e){var t=0,n=0;return(0,r.default)(["r","g","b","a","h","s","l","v"],(function(r){if(e[r]&&(t+=1,isNaN(e[r])||(n+=1),"s"===r||"l"===r)){/^\d+%$/.test(e[r])&&(n+=1)}})),t===n&&e};var i=t.toState=function(e,t){var n=e.hex?(0,o.default)(e.hex):(0,o.default)(e),r=n.toHsl(),a=n.toHsv(),i=n.toRgb(),l=n.toHex();return 0===r.s&&(r.h=t||0,a.h=t||0),{hsl:r,hex:"000000"===l&&0===i.a?"transparent":"#"+l,rgb:i,hsv:a,oldHue:e.h||t||r.h,source:e.source}};t.isValidHex=function(e){var t="#"===String(e).charAt(0)?1:0;return e.length!==4+t&&e.length<7+t&&(0,o.default)(e).isValid()},t.getContrastingColor=function(e){if(!e)return"#fff";var t=i(e);return"transparent"===t.hex?"rgba(0,0,0,0.4)":(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=128?"#000":"#fff"},t.red={hsl:{a:1,h:0,l:.5,s:1},hex:"#ff0000",rgb:{r:255,g:0,b:0,a:1},hsv:{h:0,s:1,v:1,a:1}};t.default=t},function(e,t,n){var r;try{r=n(290)}catch(e){}r||(r=window.graphlib),e.exports=r},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(42),o=n(17),a=n(103),i=n(6);e.exports=function(e,t){return(i(e)?r:a)(e,o(t,3))}},function(e,t,n){var r=n(34),o=n(59);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(164),o=n(203),a=n(21),i=n(6),l=n(210);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){"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(143)},function(e,t,n){var r=n(83),o=n(61),a=n(16);e.exports=function(e){return a(e)?r(e):o(e)}},function(e,t,n){var r=n(23),o=n(156),a=n(157),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(176),o=n(179);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(11).Symbol;e.exports=r},function(e,t,n){(function(e){var r=n(11),o=n(161),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(58)(e))},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(199),o=n(63),a=n(200),i=n(96),l=n(201),s=n(20),c=n(86),u=c(r),p=c(o),d=c(a),f=c(i),h=c(l),g=s;(r&&"[object DataView]"!=g(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=g(new o)||a&&"[object Promise]"!=g(a.resolve())||i&&"[object Set]"!=g(new i)||l&&"[object WeakMap]"!=g(new l))&&(g=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=g},function(e,t,n){var r=n(20),o=n(14);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},function(e,t,n){var r=n(83),o=n(216),a=n(16);e.exports=function(e){return a(e)?r(e,!0):o(e)}},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),g(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),g(e,t),t}(t),r=k.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),r=C.bind(null,n),o=function(){m(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?m({},e,t):{}}function E(e){var t=e.icon,n=e.mask,r=e.symbol,o=e.className,a=e.title,i=C(t),l=k("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=(m(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),m(t,"fa-rotate-".concat(u),void 0!==u),m(t,"fa-pull-".concat(p),void 0!==p),m(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=k("transform","string"==typeof e.transform?d.b.transform(e.transform):e.transform),c=k("mask",C(n)),u=Object(d.a)(i,v({},l,s,c,{symbol:r,title:a}));if(!u)return function(){var e;!_&&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){E.defaultProps.hasOwnProperty(t)||(f[t]=e[t])})),S(p[0],f)}E.displayName="FontAwesomeIcon",E.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},E.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 S=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=w(r);break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?e.attrs[t.toLowerCase()]=r:e.attrs[x(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),P={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"]},O={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"]},B={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"]},M=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(E,{icon:P})))},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),N=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(151);var L=function(e){function t(t){var n=e.call(this,t)||this;return n.state={filter:""},n._onResetRequiredObserver=n.props.globalState.onResetRequiredObservable.add((function(){n.forceUpdate()})),n}return u(t,e),t.prototype.componentWillUnmount=function(){this.props.globalState.onResetRequiredObservable.remove(this._onResetRequiredObserver)},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","FragCoordBlock","ScreenSizeBlock"],Interpolation:["LerpBlock","StepBlock","SmoothStepBlock","NLerpBlock"],Math__Standard:["AddBlock","DivideBlock","MaxBlock","MinBlock","ModBlock","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"],Particle:["ParticleBlendMultiplyBlock","ParticleColorBlock","ParticlePositionWorldBlock","ParticleRampGradientBlock","ParticleTextureBlock","ParticleTextureMaskBlock","ParticleUVBlock"],PBR:["PBRMetallicRoughnessBlock","AmbientOcclusionBlock","AnisotropyBlock","ClearCoatBlock","ReflectionBlock","ReflectivityBlock","RefractionBlock","SheenBlock","SubSurfaceBlock"],PostProcess:["Position2DBlock","CurrentScreenBlock"],Range:["ClampBlock","RemapBlock","NormalizeBlock"],Round:["RoundBlock","CeilingBlock","FloorBlock"],Scene:["FogBlock","CameraPositionBlock","FogColorBlock","ImageProcessingBlock","LightBlock","LightInformationBlock","ViewDirectionBlock"]};switch(this.props.globalState.mode){case l.NodeMaterialModes.Material:delete n.PostProcess,delete n.Particle;break;case l.NodeMaterialModes.PostProcess:delete n.Animation,delete n.Mesh,delete n.Particle;break;case l.NodeMaterialModes.Particle:delete n.Animation,delete n.Mesh,delete n.PostProcess,n.Output_Nodes.splice(n.Output_Nodes.indexOf("VertexOutputBlock"),1)}var 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(N,{key:e,data:e,tooltip:r})}));i.length&&r.push(o.createElement(M,{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",ModBlock:"Outputs the value of one parameter modulo another",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.",PBRMetallicRoughnessBlock:"PBR metallic/roughness material",SheenBlock:"PBR Sheen block",AmbientOcclusionBlock:"PBR Ambient occlusion block",ReflectivityBlock:"PBR Reflectivity block",AnisotropyBlock:"PBR Anisotropy block",ReflectionBlock:"PBR Reflection block",ClearCoatBlock:"PBR ClearCoat block",RefractionBlock:"PBR Refraction block",SubSurfaceBlock:"PBR SubSurface block",Position2DBlock:"A Vector2 representing the position of each vertex of the screen quad",CurrentScreenBlock:"The screen buffer used as input for the post process",ParticleUVBlock:"The particle uv texture coordinate",ParticleTextureBlock:"The particle texture",ParticleColorBlock:"The particle color",ParticleTextureMaskBlock:"The particle texture mask",ParticleRampGradientBlock:"The particle ramp gradient block",ParticleBlendMultiplyBlock:"The particle blend multiply block",ParticlePositionWorldBlock:"The world position of the particle",FragCoordBlock:"The gl_FragCoord predefined variable that contains the window relative coordinate (x, y, z, 1/w)",ScreenSizeBlock:"The size (in pixels) of the screen window"},t}(o.Component),R=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),j=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}(),A=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:this.props.uploadName?this.props.uploadName:"file-upload",className:"file-upload"},this.props.label),o.createElement("input",{ref:this.uploadRef,id:this.props.uploadName?this.props.uploadName:"file-upload",type:"file",accept:this.props.accept,onChange:function(t){return e.onChange(t)}}))},t}(o.Component),I=function(){function e(){}return e.UpdateLocations=function(e,t,n){e.editorData={locations:[]};for(var r=0,o=n?n.nodes.map((function(e){return e.block})):e.attachedBlocks;rwindow.innerHeight&&(n=window.innerHeight-r-10),e.style.top=n+"px",e.style.left=t.getBoundingClientRect().left-e.getBoundingClientRect().width+"px"}},t.prototype.shouldComponentUpdate=function(e,t){return e.value.toHexString()!==this.props.value.toHexString()||e.disableAlpha!==this.props.disableAlpha||t.hex!==this.state.hex||t.pickerEnabled!==this.state.pickerEnabled},t.prototype.componentDidUpdate=function(){this.syncPositions()},t.prototype.componentDidMount=function(){this.syncPositions()},t.prototype.setPickerState=function(e){this.setState({pickerEnabled:e}),this.props.globalState.blockKeyboardEvents=e},t.prototype.render=function(){var e=this,t=this.state.color;return o.createElement("div",{className:"color-picker"},o.createElement("div",{className:"color-rect",ref:this._floatHostRef,style:{background:this.state.hex},onClick:function(){return e.setPickerState(!0)}}),this.state.pickerEnabled&&o.createElement(o.Fragment,null,o.createElement("div",{className:"color-picker-cover",onClick:function(){return e.setPickerState(!1)}}),o.createElement("div",{className:"color-picker-float",ref:this._floatRef},o.createElement(X.SketchPicker,{color:t,disableAlpha:this.props.disableAlpha,onChange:function(t){var n;e.props.disableAlpha?n=l.Color3.FromInts(t.rgb.r,t.rgb.g,t.rgb.b).toHexString():n=l.Color4.FromInts(t.rgb.r,t.rgb.g,t.rgb.b,255*(t.rgb.a||0)).toHexString();e.setState({hex:n,color:t.rgb}),e.props.onColorChanged(n)}}))))},t}(o.Component),G=n(124),q=function(e){function t(t){var n=e.call(this,t)||this;return n._localChange=!1,n.state={isExpanded:!1,color:n.props.target[n.props.propertyName].clone()},n}return u(t,e),t.prototype.shouldComponentUpdate=function(e,t){var n=e.target[e.propertyName];return!(n.equals(t.color)&&!this._localChange)&&(t.color=n.clone(),this._localChange=!1,!0)},t.prototype.onChange=function(e){this._localChange=!0;var t=l.Color3.FromHexString(e);this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:t,initialValue:this.state.color}),"Color4"===this.props.target[this.props.propertyName].getClassName()?this.props.target[this.props.propertyName]=new l.Color4(t.r,t.g,t.b,1):this.props.target[this.props.propertyName]=t,this.setState({color:t}),this.props.onChange&&this.props.onChange()},t.prototype.switchExpandState=function(){this._localChange=!0,this.setState({isExpanded:!this.state.isExpanded})},t.prototype.raiseOnPropertyChanged=function(e){this.props.onChange&&this.props.onChange(),this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:this.state.color,initialValue:e})},t.prototype.updateStateR=function(e){this._localChange=!0;var t=this.state.color.clone();this.props.target[this.props.propertyName].x=e,this.state.color.r=e,this.props.target[this.props.propertyName]=this.state.color,this.setState({color:this.state.color}),this.raiseOnPropertyChanged(t)},t.prototype.updateStateG=function(e){this._localChange=!0;var t=this.state.color.clone();this.props.target[this.props.propertyName].g=e,this.state.color.g=e,this.props.target[this.props.propertyName]=this.state.color,this.setState({color:this.state.color}),this.raiseOnPropertyChanged(t)},t.prototype.updateStateB=function(e){this._localChange=!0;var t=this.state.color.clone();this.props.target[this.props.propertyName].b=e,this.state.color.b=e,this.props.target[this.props.propertyName]=this.state.color,this.setState({color:this.state.color}),this.raiseOnPropertyChanged(t)},t.prototype.copyToClipboard=function(){var e=document.createElement("div");if(e.textContent=this.state.color.toHexString(),document.body.appendChild(e),window.getSelection){var t=document.createRange();t.selectNode(e),window.getSelection().removeAllRanges(),window.getSelection().addRange(t)}document.execCommand("copy"),e.remove()},t.prototype.render=function(){var e=this,t=this.state.isExpanded?o.createElement(E,{icon:O}):o.createElement(E,{icon:T});return o.createElement("div",{className:"color3Line"},o.createElement("div",{className:"firstLine"},o.createElement("div",{className:"label"},this.props.label),o.createElement("div",{className:"color3"},o.createElement(Y,{value:this.state.color,disableAlpha:!0,globalState:this.props.globalState,onColorChanged:function(t){e.onChange(t)}})),o.createElement("div",{className:"copy hoverIcon",onClick:function(){return e.copyToClipboard()},title:"Copy to clipboard"},o.createElement("img",{src:G,alt:""})),o.createElement("div",{className:"expand hoverIcon",onClick:function(){return e.switchExpandState()},title:"Expand"},t)),this.state.isExpanded&&o.createElement("div",{className:"secondLine"},o.createElement(V,{globalState:this.props.globalState,label:"r",value:this.state.color.r,onChange:function(t){return e.updateStateR(t)}}),o.createElement(V,{globalState:this.props.globalState,label:"g",value:this.state.color.g,onChange:function(t){return e.updateStateG(t)}}),o.createElement(V,{globalState:this.props.globalState,label:"b",value:this.state.color.b,onChange:function(t){return e.updateStateB(t)}})))},t}(o.Component),Z=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this;return o.createElement(q,{globalState:this.props.globalState,label:"Value",target:this.props.inputBlock,propertyName:"value",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}})},t}(o.Component),Q=function(e){function t(t){var n=e.call(this,t)||this;return n._localChange=!1,n.state={isExpanded:!1,value:n.props.target[n.props.propertyName].clone()},n}return u(t,e),t.prototype.shouldComponentUpdate=function(e,t){var n=e.target[e.propertyName];return!(n.equals(t.value)&&!this._localChange)&&(t.value=n.clone(),this._localChange=!1,!0)},t.prototype.switchExpandState=function(){this._localChange=!0,this.setState({isExpanded:!this.state.isExpanded})},t.prototype.raiseOnPropertyChanged=function(e){this.props.onChange&&this.props.onChange(this.state.value),this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:this.state.value,initialValue:e})},t.prototype.updateVector3=function(){var e=this.props.target[this.props.propertyName].clone();this.props.target[this.props.propertyName]=this.state.value,this.setState({value:e}),this.raiseOnPropertyChanged(e)},t.prototype.updateStateX=function(e){this._localChange=!0,this.state.value.x=e,this.updateVector3()},t.prototype.updateStateY=function(e){this._localChange=!0,this.state.value.y=e,this.updateVector3()},t.prototype.updateStateZ=function(e){this._localChange=!0,this.state.value.z=e,this.updateVector3()},t.prototype.render=function(){var e=this,t=this.state.isExpanded?o.createElement(E,{icon:O}):o.createElement(E,{icon:T});return o.createElement("div",{className:"vector3Line"},o.createElement("div",{className:"firstLine"},o.createElement("div",{className:"label"},this.props.label),o.createElement("div",{className:"vector"},"X: "+this.state.value.x.toFixed(2)+", Y: "+this.state.value.y.toFixed(2)+", Z: "+this.state.value.z.toFixed(2)),o.createElement("div",{className:"expand hoverIcon",onClick:function(){return e.switchExpandState()},title:"Expand"},t)),this.state.isExpanded&&o.createElement("div",{className:"secondLine"},o.createElement(V,{globalState:this.props.globalState,label:"x",step:this.props.step,value:this.state.value.x,onChange:function(t){return e.updateStateX(t)}}),o.createElement(V,{globalState:this.props.globalState,label:"y",step:this.props.step,value:this.state.value.y,onChange:function(t){return e.updateStateY(t)}}),o.createElement(V,{globalState:this.props.globalState,label:"z",step:this.props.step,value:this.state.value.z,onChange:function(t){return e.updateStateZ(t)}})))},t.defaultProps={step:.001},t}(o.Component),K=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this;return o.createElement(Q,{globalState:this.props.globalState,label:"Value",target:this.props.inputBlock,propertyName:"value",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}})},t}(o.Component),$=function(e){function t(t){var n=e.call(this,t)||this;return n._localChange=!1,n.state={isExpanded:!1,value:(n.props.value||n.props.target[n.props.propertyName]).clone()},n}return u(t,e),t.prototype.shouldComponentUpdate=function(e,t){var n=e.value||e.target[e.propertyName];return!(n.equals(t.value)&&!this._localChange)&&(t.value=n.clone(),this._localChange=!1,!0)},t.prototype.switchExpandState=function(){this._localChange=!0,this.setState({isExpanded:!this.state.isExpanded})},t.prototype.raiseOnPropertyChanged=function(e){this.props.onChange&&this.props.onChange(this.state.value),this.props.onPropertyChangedObservable&&this.props.propertyName&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:this.state.value,initialValue:e})},t.prototype.updateVector4=function(){var e=(this.props.value||this.props.target[this.props.propertyName]).clone();this.props.value?this.props.value.copyFrom(this.state.value):this.props.target[this.props.propertyName]=this.state.value,this.forceUpdate(),this.raiseOnPropertyChanged(e)},t.prototype.updateStateX=function(e){this._localChange=!0,this.state.value.x=e,this.updateVector4()},t.prototype.updateStateY=function(e){this._localChange=!0,this.state.value.y=e,this.updateVector4()},t.prototype.updateStateZ=function(e){this._localChange=!0,this.state.value.z=e,this.updateVector4()},t.prototype.updateStateW=function(e){this._localChange=!0,this.state.value.w=e,this.updateVector4()},t.prototype.render=function(){var e=this,t=this.state.isExpanded?o.createElement(E,{icon:O}):o.createElement(E,{icon:T});return o.createElement("div",{className:"vector3Line"},o.createElement("div",{className:"firstLine"},o.createElement("div",{className:"label"},this.props.label),o.createElement("div",{className:"vector"},"X: "+this.state.value.x.toFixed(2)+", Y: "+this.state.value.y.toFixed(2)+", Z: "+this.state.value.z.toFixed(2)+", W: "+this.state.value.w.toFixed(2)),o.createElement("div",{className:"expand hoverIcon",onClick:function(){return e.switchExpandState()},title:"Expand"},t)),this.state.isExpanded&&o.createElement("div",{className:"secondLine"},o.createElement(V,{globalState:this.props.globalState,label:"x",step:this.props.step,value:this.state.value.x,onChange:function(t){return e.updateStateX(t)}}),o.createElement(V,{globalState:this.props.globalState,label:"y",step:this.props.step,value:this.state.value.y,onChange:function(t){return e.updateStateY(t)}}),o.createElement(V,{globalState:this.props.globalState,label:"z",step:this.props.step,value:this.state.value.z,onChange:function(t){return e.updateStateZ(t)}}),o.createElement(V,{globalState:this.props.globalState,label:"w",step:this.props.step,value:this.state.value.w,onChange:function(t){return e.updateStateW(t)}})))},t.defaultProps={step:.001},t}(o.Component),J=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this;return o.createElement($,{globalState:this.props.globalState,label:"Value",target:this.props.inputBlock,propertyName:"value",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}})},t}(o.Component),ee=function(e){function t(t){var n=e.call(this,t)||this;return n._localChange=!1,n.state={value:n._getValue(t)},n}return u(t,e),t.prototype._getValue=function(e){return e.getSelection?e.getSelection(e.target):e.target&&e.propertyName?e.target[e.propertyName]:e.options[e.defaultIfNull||0]},t.prototype.setValue=function(e){this.setState({value:e})},t.prototype.shouldComponentUpdate=function(e,t){if(this._localChange)return this._localChange=!1,!0;var n=this._getValue(e);return null!=n&&n!==t.value&&(t.value=n,!0)},t.prototype.raiseOnPropertyChanged=function(e,t){this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:e,initialValue:t})},t.prototype.updateValue=function(e){var t=this.props.valuesAreStrings?e:parseInt(e);this._localChange=!0;var n=this.state.value;this.props.noDirectUpdate||(this.props.target[this.props.propertyName]=t),this.setState({value:t}),this.raiseOnPropertyChanged(t,n),this.props.onSelect&&this.props.onSelect(t)},t.prototype.render=function(){var e,t=this;return o.createElement("div",{className:"listLine"},o.createElement("div",{className:"label"},this.props.label),o.createElement("div",{className:"options"+(this.props.className?" "+this.props.className:"")},o.createElement("select",{onChange:function(e){return t.updateValue(e.target.value)},value:null!==(e=this.state.value)&&void 0!==e?e:""},this.props.options.map((function(e){return o.createElement("option",{key:e.label,value:e.value},e.label)})))))},t}(o.Component),te=function(e){function t(t){var n=e.call(this,t)||this;n._localChange=!1;var r=n.props.target[n.props.propertyName].clone(),o=0;if(n.props.mode){var a=new l.Quaternion;r.decompose(void 0,a);var i=a.toEulerAngles();switch(n.props.mode){case 1:o=i.x;break;case 2:o=i.y;break;case 3:o=i.z}}return n.state={value:r,mode:n.props.mode||0,angle:o},n}return u(t,e),t.prototype.shouldComponentUpdate=function(e,t){var n=e.target[e.propertyName];return!n.equals(t.value)||this._localChange?(t.value=n.clone(),this._localChange=!1,!0):t.mode!==this.state.mode||t.angle!==this.state.angle},t.prototype.raiseOnPropertyChanged=function(e){this.props.onChange&&this.props.onChange(this.state.value),this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:this.state.value,initialValue:e})},t.prototype.updateMatrix=function(){var e=this.props.target[this.props.propertyName].clone();this.props.target[this.props.propertyName]=this.state.value,this.setState({value:e}),this.raiseOnPropertyChanged(e)},t.prototype.updateRow=function(e,t){this._localChange=!0,this.state.value.setRow(t,e),this.updateMatrix()},t.prototype.updateBasedOnMode=function(e){switch(this.state.mode){case 1:l.Matrix.RotationXToRef(this.state.angle,this.state.value);break;case 2:l.Matrix.RotationYToRef(this.state.angle,this.state.value);break;case 3:l.Matrix.RotationZToRef(this.state.angle,this.state.value)}this.updateMatrix(),this.setState({angle:e})},t.prototype.render=function(){var e=this;return o.createElement("div",{className:"vector3Line"},o.createElement("div",{className:"firstLine"},o.createElement("div",{className:"label"},this.props.label)),o.createElement("div",{className:"secondLine"},o.createElement(ee,{label:"Mode",className:"no-right-margin",options:[{label:"User-defined",value:0},{label:"Rotation over X axis",value:1},{label:"Rotation over Y axis",value:2},{label:"Rotation over Z axis",value:3}],target:this,noDirectUpdate:!0,getSelection:function(){return e.state.mode},onSelect:function(t){e.props.target[e.props.propertyName]=l.Matrix.Identity(),l.Matrix.IdentityToRef(e.state.value),e.setState({mode:t,angle:0}),e.updateMatrix(),e.props.onModeChange&&e.props.onModeChange(t)}})),0===this.state.mode&&o.createElement("div",{className:"secondLine"},o.createElement($,{globalState:this.props.globalState,label:"Row #0",value:this.state.value.getRow(0),onChange:function(t){return e.updateRow(t,0)}}),o.createElement($,{globalState:this.props.globalState,label:"Row #1",value:this.state.value.getRow(1),onChange:function(t){return e.updateRow(t,1)}}),o.createElement($,{globalState:this.props.globalState,label:"Row #2",value:this.state.value.getRow(2),onChange:function(t){return e.updateRow(t,2)}}),o.createElement($,{globalState:this.props.globalState,label:"Row #3",value:this.state.value.getRow(3),onChange:function(t){return e.updateRow(t,3)}})),0!==this.state.mode&&o.createElement("div",{className:"secondLine"},o.createElement(U,{label:"Angle",minimum:0,maximum:2*Math.PI,useEuler:!0,step:.1,directValue:this.state.angle,onChange:function(t){return e.updateBasedOnMode(t)}})))},t}(o.Component),ne=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this;return o.createElement(te,{globalState:this.props.globalState,label:"Value",target:this.props.inputBlock,propertyName:"value",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()},mode:this.props.inputBlock.matrixMode,onModeChange:function(t){e.props.inputBlock.matrixMode=t}})},t}(o.Component),re=function(e){function t(t){var n=e.call(this,t)||this;return n._localChange=!1,n.state={value:void 0!==n.props.value?n.props.value:n.props.target[n.props.propertyName]||""},n}return u(t,e),t.prototype.shouldComponentUpdate=function(e,t){if(this._localChange)return this._localChange=!1,!0;var n=void 0!==e.value?e.value:e.target[e.propertyName];return n!==t.value&&(t.value=n||"",!0)},t.prototype.raiseOnPropertyChanged=function(e,t){this.props.onChange?this.props.onChange(e):this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:e,initialValue:t})},t.prototype.updateValue=function(e,t){this._localChange=!0;var n=void 0!==this.props.value?this.props.value:this.props.target[this.props.propertyName];this.setState({value:e}),t&&this.raiseOnPropertyChanged(e,n),this.props.propertyName&&(this.props.target[this.props.propertyName]=e)},t.prototype.render=function(){var e=this;return o.createElement("div",{className:"textInputLine"},o.createElement("div",{className:"label"},this.props.label),o.createElement("div",{className:"value"},o.createElement("input",{value:this.state.value,onFocus:function(){return e.props.globalState.blockKeyboardEvents=!0},onChange:function(t){return e.updateValue(t.target.value,!1)},onKeyDown:function(t){13===t.keyCode&&e.updateValue(e.state.value,!0)},onBlur:function(t){e.updateValue(t.target.value,!0),e.props.globalState.blockKeyboardEvents=!1}})))},t}(o.Component),oe=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.onLink=function(){this.props.onLink&&this.props.onLink()},t.prototype.renderContent=function(){var e=this;return this.props.onLink?o.createElement("div",{className:"link-value",title:this.props.value,onClick:function(){return e.onLink()}},this.props.value||"no name"):o.createElement("div",{className:"value",title:this.props.value,style:{color:this.props.color?this.props.color:""}},this.props.value||"no name")},t.prototype.render=function(){return o.createElement("div",{className:this.props.underline?"textLine underline":"textLine"},o.createElement("div",{className:"label"},this.props.label),this.renderContent())},t}(o.Component),ae=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.render=function(){return o.createElement(o.Fragment,null,o.createElement(ie,{globalState:this.props.globalState,block:this.props.block}),o.createElement(le,{globalState:this.props.globalState,block:this.props.block}))},t}(o.Component),ie=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(M,{title:"GENERAL"},(!this.props.block.isInput||!this.props.block.isAttribute)&&o.createElement(re,{globalState:this.props.globalState,label:"Name",propertyName:"name",target:this.props.block,onChange:function(){return e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),o.createElement(oe,{label:"Type",value:this.props.block.getClassName()}),o.createElement(re,{globalState:this.props.globalState,label:"Comments",propertyName:"comments",target:this.props.block,onChange:function(){return e.props.globalState.onUpdateRequiredObservable.notifyObservers()}})))},t}(o.Component),le=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.forceRebuild=function(e){e&&!e.update||this.props.globalState.onUpdateRequiredObservable.notifyObservers(),e&&!e.rebuild||this.props.globalState.onRebuildRequiredObservable.notifyObservers()},t.prototype.render=function(){var e=this,t=this.props.block._propStore;if(!t)return o.createElement(o.Fragment,null);for(var n={},r=[],a=function(t,a,s,c,u){var p=n[c];switch(p||(p=[],n[c]=p,r.push(c)),s){case l.PropertyTypeForEdition.Boolean:p.push(o.createElement(F,{label:a,target:i.props.block,propertyName:t,onValueChanged:function(){return e.forceRebuild(u.notifiers)}}));break;case l.PropertyTypeForEdition.Float:isNaN(u.min)||isNaN(u.max)||u.min===u.max?p.push(o.createElement(D,{globalState:i.props.globalState,label:a,propertyName:t,target:i.props.block,onChange:function(){return e.forceRebuild(u.notifiers)}})):p.push(o.createElement(U,{label:a,target:i.props.block,propertyName:t,step:Math.abs(u.max-u.min)/100,minimum:Math.min(u.min,u.max),maximum:u.max,onChange:function(){return e.forceRebuild(u.notifiers)}}));break;case l.PropertyTypeForEdition.Vector2:p.push(o.createElement(H,{globalState:i.props.globalState,label:a,propertyName:t,target:i.props.block,onChange:function(){return e.forceRebuild(u.notifiers)}}));break;case l.PropertyTypeForEdition.List:p.push(o.createElement(ee,{label:a,options:u.options,target:i.props.block,propertyName:t,onSelect:function(){return e.forceRebuild(u.notifiers)}}))}},i=this,s=0,c=t;s0&&i.push({label:"Mesh attribute",value:1}),n.length>0&&i.push({label:"System value",value:2});return o.createElement("div",null,o.createElement(ie,{globalState:this.props.globalState,block:this.props.block}),o.createElement(M,{title:"PROPERTIES"},t.isUniform&&!t.isSystemValue&&t.animationType===l.AnimatedInputBlockTypes.None&&o.createElement(ee,{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(re,{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(ee,{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(ee,{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(ee,{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(ee,{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),de=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(ie,{globalState:this.props.globalState,block:this.props.block}),o.createElement(M,{title:"PROPERTIES"},o.createElement(F,{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),fe=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(E,{icon:B})))},t}(o.Component),he=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(ie,{globalState:this.props.globalState,block:this.props.block}),o.createElement(M,{title:"STEPS"},o.createElement(R,{label:"Add new step",onClick:function(){return e.addNewStep()}}),t.colorSteps.map((function(t,n){return o.createElement(fe,{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),ge=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(ie,{globalState:this.props.globalState,block:this.props.block}),o.createElement(M,{title:"PROPERTIES"},o.createElement(ee,{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),me=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(ie,{globalState:this.props.globalState,block:this.props.block}),o.createElement(M,{title:"PROPERTIES"},o.createElement(ee,{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),ve=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||this.textureBlock instanceof l.ReflectionBlock||this.textureBlock instanceof l.RefractionBlock||this.props.globalState.mode===l.NodeMaterialModes.PostProcess),(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||this.textureBlock instanceof l.ReflectionBlock||this.textureBlock instanceof l.RefractionBlock){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||this.textureBlock instanceof l.ReflectionBlock||this.textureBlock instanceof l.RefractionBlock,a=this.textureBlock instanceof l.CurrentScreenBlock||this.textureBlock instanceof l.ParticleTextureBlock,i=[{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(ie,{globalState:this.props.globalState,block:this.props.block}),o.createElement(M,{title:"PROPERTIES"},o.createElement(F,{label:"Auto select UV",propertyName:"autoSelectUV",target:this.props.block,onValueChanged:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(F,{label:"Convert to gamma space",propertyName:"convertToGammaSpace",target:this.props.block,onValueChanged:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(F,{label:"Convert to linear space",propertyName:"convertToLinearSpace",target:this.props.block,onValueChanged:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&r&&o.createElement(ee,{label:"Reflection mode",options:i,target:n,propertyName:"coordinatesMode",onSelect:function(t){n.coordinatesMode=t,e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&!a&&o.createElement(F,{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&&!a&&o.createElement(F,{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&&!a&&o.createElement(D,{globalState:this.props.globalState,label:"Offset U",target:n,propertyName:"uOffset",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&!a&&o.createElement(D,{globalState:this.props.globalState,label:"Offset V",target:n,propertyName:"vOffset",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&!a&&o.createElement(D,{globalState:this.props.globalState,label:"Scale U",target:n,propertyName:"uScale",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&!a&&o.createElement(D,{globalState:this.props.globalState,label:"Scale V",target:n,propertyName:"vScale",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&!a&&o.createElement(U,{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&&!a&&o.createElement(U,{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&&!a&&o.createElement(U,{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(M,{title:"SOURCE"},o.createElement(F,{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(F,{label:"Load as cube texture",isSelected:function(){return e.state.loadAsCubeTexture},onSelect:function(t){return e.setState({loadAsCubeTexture:t})}}),this.state.isEmbedded&&o.createElement(A,{label:"Upload",onClick:function(t){return e.replaceTexture(t)},accept:".jpg, .png, .tga, .dds, .env"}),!this.state.isEmbedded&&o.createElement(re,{label:"Link",globalState:this.props.globalState,value:t,onChange:function(t){return e.replaceTextureWithUrl(t)}}),!this.state.isEmbedded&&t&&o.createElement(R,{label:"Refresh",onClick:function(){return e.replaceTextureWithUrl(t+"?nocache="+e._generateRandomForCache())}}),n&&o.createElement(R,{label:"Remove",onClick:function(){return e.removeTexture()}})),o.createElement(le,{globalState:this.props.globalState,block:this.props.block}))},t}(o.Component),be=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(ie,{globalState:this.props.globalState,block:this.props.block}),o.createElement(M,{title:"PROPERTIES"},o.createElement(ee,{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),ye=function(){function e(){}return e.RegisteredControls={},e}();ye.RegisteredControls.TransformBlock=de,ye.RegisteredControls.InputBlock=pe,ye.RegisteredControls.GradientBlock=he,ye.RegisteredControls.LightBlock=ge,ye.RegisteredControls.LightInformationBlock=me,ye.RegisteredControls.TextureBlock=ve,ye.RegisteredControls.ReflectionTextureBlock=ve,ye.RegisteredControls.ReflectionBlock=ve,ye.RegisteredControls.RefractionBlock=ve,ye.RegisteredControls.CurrentScreenBlock=ve,ye.RegisteredControls.ParticleTextureBlock=ve,ye.RegisteredControls.TrigonometryBlock=be;var xe=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",n.mode===l.NodeMaterialModes.Particle);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"ModBlock":return new l.ModBlock("Mod");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 g=new l.TrigonometryBlock("Log");return g.operation=l.TrigonometryBlockOperations.Log,g;case"ExpBlock":var m=new l.TrigonometryBlock("Exp");return m.operation=l.TrigonometryBlockOperations.Exp,m;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 x=new l.TrigonometryBlock("Round");return x.operation=l.TrigonometryBlockOperations.Round,x;case"CeilingBlock":var w=new l.TrigonometryBlock("Ceiling");return w.operation=l.TrigonometryBlockOperations.Ceiling,w;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(X=new l.InputBlock("World")).setAsSystemValue(l.NodeMaterialSystemValues.World),X;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 O=new l.InputBlock("View");return O.setAsSystemValue(l.NodeMaterialSystemValues.View),O;case"ViewProjectionMatrixBlock":var T=new l.InputBlock("View x Projection");return T.setAsSystemValue(l.NodeMaterialSystemValues.ViewProjection),T;case"ProjectionMatrixBlock":var B=new l.InputBlock("Projection");return B.setAsSystemValue(l.NodeMaterialSystemValues.Projection),B;case"CameraPositionBlock":var M=new l.InputBlock("Camera position");return M.setAsSystemValue(l.NodeMaterialSystemValues.CameraPosition),M;case"FogColorBlock":var N=new l.InputBlock("Fog color");return N.setAsSystemValue(l.NodeMaterialSystemValues.FogColor),N;case"PositionBlock":return(L=new l.InputBlock("position")).setAsAttribute("position"),L;case"Position2DBlock":var L;return(L=new l.InputBlock("position")).setAsAttribute("position2d"),L;case"UVBlock":var R=new l.InputBlock("uv");return R.setAsAttribute("uv"),R;case"ColorBlock":var j=new l.InputBlock("color");return j.setAsAttribute("color"),j;case"NormalBlock":var A=new l.InputBlock("normal");return A.setAsAttribute("normal"),A;case"TangentBlock":var I=new l.InputBlock("tangent");return I.setAsAttribute("tangent"),I;case"MatrixIndicesBlock":var F=new l.InputBlock("matricesIndices");return F.setAsAttribute("matricesIndices"),F;case"MatrixWeightsBlock":var D=new l.InputBlock("matricesWeights");return D.setAsAttribute("matricesWeights"),D;case"TimeBlock":var z=new l.InputBlock("Time",void 0,l.NodeMaterialBlockConnectionPointTypes.Float);return z.animationType=l.AnimatedInputBlockTypes.Time,z;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"),(X=n.getInputBlockByPredicate((function(e){return e.isSystemValue&&e.systemValue===l.NodeMaterialSystemValues.World})))||(X=new l.InputBlock("World")).setAsSystemValue(l.NodeMaterialSystemValues.World);var H=new l.TransformBlock("World position");return V.connectTo(H),X.connectTo(H),H;case"WorldNormalBlock":var W=n.getInputBlockByPredicate((function(e){return e.isAttribute&&"normal"===e.name}));W||(W=new l.InputBlock("normal")).setAsAttribute("normal"),(X=n.getInputBlockByPredicate((function(e){return e.isSystemValue&&e.systemValue===l.NodeMaterialSystemValues.World})))||(X=new l.InputBlock("World")).setAsSystemValue(l.NodeMaterialSystemValues.World);H=new l.TransformBlock("World normal");return W.connectTo(H),X.connectTo(H),H;case"WorldTangentBlock":var X,Y=n.getInputBlockByPredicate((function(e){return e.isAttribute&&"tangent"===e.name}));Y||(Y=new l.InputBlock("tangent")).setAsAttribute("tangent"),(X=n.getInputBlockByPredicate((function(e){return e.isSystemValue&&e.systemValue===l.NodeMaterialSystemValues.World})))||(X=new l.InputBlock("World")).setAsSystemValue(l.NodeMaterialSystemValues.World);H=new l.TransformBlock("World tangent");return Y.connectTo(H),X.connectTo(H),H;case"PBRMetallicRoughnessBlock":return new l.PBRMetallicRoughnessBlock("PBRMetallicRoughness");case"SheenBlock":return new l.SheenBlock("Sheen");case"AmbientOcclusionBlock":return new l.AmbientOcclusionBlock("AmbientOcclusion");case"ReflectivityBlock":return new l.ReflectivityBlock("Reflectivity");case"AnisotropyBlock":return new l.AnisotropyBlock("Anisotropy");case"ReflectionBlock":return new l.ReflectionBlock("Reflection");case"ClearCoatBlock":return new l.ClearCoatBlock("ClearCoat");case"RefractionBlock":return new l.RefractionBlock("Refraction");case"SubSurfaceBlock":return new l.SubSurfaceBlock("SubSurface");case"CurrentScreenBlock":return new l.CurrentScreenBlock("CurrentScreen");case"ParticleUVBlock":var G=new l.InputBlock("uv");return G.setAsAttribute("particle_uv"),G;case"ParticleTextureBlock":return new l.ParticleTextureBlock("ParticleTexture");case"ParticleColorBlock":var q=new l.InputBlock("Color");return q.setAsAttribute("particle_color"),q;case"ParticleTextureMaskBlock":var Z=new l.InputBlock("TextureMask");return Z.setAsAttribute("particle_texturemask"),Z;case"ParticlePositionWorldBlock":var Q=new l.InputBlock("PositionWorld");return Q.setAsAttribute("particle_positionw"),Q;case"ParticleRampGradientBlock":return new l.ParticleRampGradientBlock("ParticleRampGradient");case"ParticleBlendMultiplyBlock":return new l.ParticleBlendMultiplyBlock("ParticleBlendMultiply");case"FragCoordBlock":return new l.FragCoordBlock("FragCoord");case"ScreenSizeBlock":return new l.ScreenSizeBlock("ScreenSize")}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={position2d:"position",particle_uv:"uv",particle_color:"color",particle_texturemask:"textureMask",particle_positionw:"positionW"},_e={position2d:"postprocess",particle_uv:"particle",particle_color:"particle",particle_texturemask:"particle",particle_positionw:"particle"},Ce=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+" ("+j.GetBaseType(t.output.type)+")";return t.isAttribute&&(n=j.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=xe.GetColorFromConnectionNodeType(n.type)}return t},e.prototype.updatePreviewContent=function(e,t){var n,r,o="",a=e;if(a.isAttribute){var i=null!==(n=we[a.name])&&void 0!==n?n:a.name;o=(null!==(r=_e[a.name])&&void 0!==r?r:"mesh")+"."+i}else if(a.isSystemValue)switch(a.systemValue){case l.NodeMaterialSystemValues.World:o="World";break;case l.NodeMaterialSystemValues.WorldView:o="World x View";break;case l.NodeMaterialSystemValues.WorldViewProjection:o="World x View x Projection";break;case l.NodeMaterialSystemValues.View:o="View";break;case l.NodeMaterialSystemValues.ViewProjection:o="View x Projection";break;case l.NodeMaterialSystemValues.Projection:o="Projection";break;case l.NodeMaterialSystemValues.CameraPosition:o="Camera position";break;case l.NodeMaterialSystemValues.FogColor:o="Fog color";break;case l.NodeMaterialSystemValues.DeltaTime:o="Delta time"}else switch(a.type){case l.NodeMaterialBlockConnectionPointTypes.Float:o=a.animationType!==l.AnimatedInputBlockTypes.None?l.AnimatedInputBlockTypes[a.animationType]:a.value.toFixed(2);break;case l.NodeMaterialBlockConnectionPointTypes.Vector2:var s=a.value;o="("+s.x.toFixed(2)+", "+s.y.toFixed(2)+")";break;case l.NodeMaterialBlockConnectionPointTypes.Vector3:var c=a.value;o="("+c.x.toFixed(2)+", "+c.y.toFixed(2)+", "+c.z.toFixed(2)+")";break;case l.NodeMaterialBlockConnectionPointTypes.Vector4:var u=a.value;o="("+u.x.toFixed(2)+", "+u.y.toFixed(2)+", "+u.z.toFixed(2)+", "+u.w.toFixed(2)+")"}t.innerHTML=o,t.classList.add("input-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"rgb(106, 44, 131)"},e.prototype.updatePreviewContent=function(e,t){t.classList.add("output-block")},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"#4086BB"},e.prototype.updatePreviewContent=function(e,t){var n=e;t.classList.add("clamp-block"),t.innerHTML="["+n.minimum+", "+n.maximum+"]"},e}(),Se=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}(),Pe=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}(),Oe=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}(),Te=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 g=new l.RenderTargetTexture("temp",{width:r,height:f},c,!1);s.onApply=function(e){e.setTexture("textureSampler",n)};var m=g.getInternalTexture();if(m){c.postProcessManager.directRender([s],m);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 x=0;xe.x||t.righte.y||t.bottomt.right||e.bottomt.bottom);n.isSelected=r})),this._onFrameCreatedObserver=this._globalState.onFrameCreatedObservable.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._upateNodePortNames()):this._visual.classList.add("hidden");for(var t=0,n=this._links;t-1&&this._ownerCanvas.selectedNodes.splice(t,1)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enclosingFrameId",{get:function(){return this._enclosingFrameId},set:function(e){this._enclosingFrameId=e},enumerable:!0,configurable:!0}),e.prototype.isOverlappingFrame=function(e){var t=this._visual.getBoundingClientRect(),n=e.element.getBoundingClientRect();n.width-=5,n.height-=5;var r=!(n.rightt.right||n.bottomt.bottom);return r&&(this.enclosingFrameId=e.id),r},e.prototype.getPortForConnectionPoint=function(e){for(var t=0,n=this._inputPorts;t-1&&this._links.splice(t,1),e.dispose()},t.prototype.appendBlock=function(e){var t=new Re(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 Ae(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){if(this._candidateLinkedHasMoved)this.processCandidatePort(),this.props.globalState.onCandidateLinkMoved.notifyObservers(null);else if(this._candidateLink.portA instanceof Ue){var t=this._candidateLink.portA,n=this.frames.find((function(e){return e.id===t.parentFrameId}));if(n){var r={frame:n,port:t};this.props.globalState.onSelectionChangedObservable.notifyObservers(r)}}else this._candidateLink.portA instanceof Le&&this.props.globalState.onSelectionChangedObservable.notifyObservers(this._candidateLink.portA);this._candidateLink.dispose(),this._candidateLink=null,this._candidatePort=null}if(this._selectionBox&&(this._selectionBox.parentElement.removeChild(this._selectionBox),this._selectionBox=null),this._frameCandidate){var o=new Ve(this._frameCandidate,this);this._frames.push(o),this._frameCandidate.parentElement.removeChild(this._frameCandidate),this._frameCandidate=null,this.props.globalState.onSelectionChangedObservable.notifyObservers(o)}},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.x0){var e=o._commentsElement.offsetHeight+40;o._minFrameHeight=e}},this._onRightHandlePointerDown=function(e){var t=o;t.isCollapsed||(o.initResizing(e),t._resizingDirection=Ie.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===Ie.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===Ie.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=Ie.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=Ie.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===Ie.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=Ie.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===Ie.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._onGraphNodeRemovalObserver=n.globalState.onGraphNodeRemovalObservable.add((function(e){var t=o._nodes.indexOf(e);-1!==t&&o._nodes.splice(t,1)})),this._onExposePortOnFrameObserver=n.globalState.onExposePortOnFrameObservable.add((function(e){-1!==o.nodes.indexOf(e)&&o._redrawFramePorts()})),this._commentsElement=document.createElement("div"),this._commentsElement.className="frame-comments",this._commentsElement.style.color="white",this._commentsElement.style.fontSize="16px";var g=document.createElement("span");g.className="frame-comment-span",this._commentsElement.appendChild(g),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(e){if(this._isCollapsed!==e){if(this._isCollapsed=e,this._ownerCanvas._frameIsMoving=!0,e)this.element.classList.add("collapsed"),this._moveFrame((this.width-this.CollapsedWidth)/2,0),this._createFramePorts(),this._markFramePortPositions();else{this.element.classList.remove("collapsed"),this._outputPortContainer.innerHTML="",this._inputPortContainer.innerHTML="",this._frameInPorts.forEach((function(e){e.dispose()})),this._frameOutPorts.forEach((function(e){e.dispose()})),this._controlledPorts.forEach((function(e){e.delegatedPort=null,e.refresh()})),this._frameInPorts=[],this._frameOutPorts=[],this._controlledPorts=[],this._onNodeLinkDisposedObservers=[];for(var t=0,n=this._nodes;tthis._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.children[0].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.onFrameCreatedObservable.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(){var e;this.isCollapsed=!1,this._onSelectionChangedObserver&&this._ownerCanvas.globalState.onSelectionChangedObservable.remove(this._onSelectionChangedObserver),this._onGraphNodeRemovalObserver&&this._ownerCanvas.globalState.onGraphNodeRemovalObservable.remove(this._onGraphNodeRemovalObserver),this._onExposePortOnFrameObserver&&this._ownerCanvas.globalState.onExposePortOnFrameObservable.remove(this._onExposePortOnFrameObserver),null===(e=this.element.parentElement)||void 0===e||e.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=I.Serialize(e.nodeMaterial,e,this);j.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]),t[0].enclosingFrameId=o.id)},s=0,c=t.blocks;s0&&(t.splice(0,0,{label:"Custom",value:r.Custom}),n.splice(0,0,{label:"Custom",value:r.Custom}));var a=this.props.globalState.mode===l.NodeMaterialModes.Particle?n:t,i=this.props.globalState.mode===l.NodeMaterialModes.Particle?".json":".gltf, .glb, .babylon, .obj";return o.createElement("div",{id:"preview-mesh-bar"},(this.props.globalState.mode===l.NodeMaterialModes.Material||this.props.globalState.mode===l.NodeMaterialModes.Particle)&&o.createElement(o.Fragment,null,o.createElement(ee,{label:"",options:a,target:this.props.globalState,propertyName:"previewType",noDirectUpdate:!0,onSelect:function(t){var n;t!==r.Custom+1?e.changeMeshType(t):null===(n=e.filePickerRef.current)||void 0===n||n.click()}}),o.createElement("div",{style:{display:"none"},title:"Preview with a custom mesh"},o.createElement("input",{ref:this.filePickerRef,id:"file-picker",type:"file",onChange:function(t){return e.useCustomMesh(t)},accept:i}))),this.props.globalState.mode===l.NodeMaterialModes.Material&&o.createElement(o.Fragment,null,o.createElement("div",{title:"Turn-table animation",onClick:function(){return e.changeAnimation()},className:"button",id:"play-button"},this.props.globalState.rotatePreview?o.createElement("img",{src:et,alt:""}):o.createElement("img",{src:tt,alt:""})),o.createElement("div",{id:"color-picker-button",title:"Background color",className:"button align",onClick:function(t){return e.changeBackgroundClick()}},o.createElement("img",{src:Je,alt:""}),o.createElement("label",{htmlFor:"color-picker",id:"color-picker-label"}),o.createElement("input",{ref:this.colorInputRef,id:"color-picker",type:"color",onChange:function(t){return e.changeBackground(t.target.value)}}))),o.createElement("div",{title:"Open preview in new window",id:"preview-new-window",onClick:function(){return e.onPopUp()},className:"button"},o.createElement("img",{src:$e,alt:""})))},t}(o.Component),rt=n(388),ot=n(389),at=n(390),it=n(391),lt=n(392),st=function(e){function t(t){var n=e.call(this,t)||this;return n.state={isLoading:!0},n._onIsLoadingChangedObserver=n.props.globalState.onIsLoadingChanged.add((function(e){return n.setState({isLoading:e})})),n._onResetRequiredObserver=n.props.globalState.onResetRequiredObservable.add((function(){n.forceUpdate()})),n}return u(t,e),t.prototype.componentWillUnmount=function(){this.props.globalState.onIsLoadingChanged.remove(this._onIsLoadingChangedObserver),this.props.globalState.onResetRequiredObservable.remove(this._onResetRequiredObserver)},t.prototype.changeBackFaceCulling=function(e){this.props.globalState.backFaceCulling=e,l.DataStorage.WriteBoolean("BackFaceCulling",e),this.props.globalState.onBackFaceCullingChanged.notifyObservers(),this.forceUpdate()},t.prototype.changeDepthPrePass=function(e){this.props.globalState.depthPrePass=e,l.DataStorage.WriteBoolean("DepthPrePass",e),this.props.globalState.onDepthPrePassChanged.notifyObservers(),this.forceUpdate()},t.prototype.render=function(){var e=this;return o.createElement(o.Fragment,null,o.createElement("div",{id:"preview",style:{height:this.props.width+"px"}},o.createElement("canvas",{id:"preview-canvas"}),o.createElement("div",{className:"waitPanel"+(this.state.isLoading?"":" hidden")},"Please wait, loading...")),this.props.globalState.mode===l.NodeMaterialModes.Material&&o.createElement(o.Fragment,null,o.createElement("div",{id:"preview-config-bar"},o.createElement("div",{title:"Render without back face culling",onClick:function(){return e.changeBackFaceCulling(!e.props.globalState.backFaceCulling)},className:"button back-face"+(this.props.globalState.backFaceCulling?"":" selected")},o.createElement("img",{src:rt,alt:""})),o.createElement("div",{title:"Render with depth pre-pass",onClick:function(){return e.changeDepthPrePass(!e.props.globalState.depthPrePass)},className:"button depth-pass"+(this.props.globalState.depthPrePass?" selected":"")},o.createElement("img",{src:ot,alt:""})),o.createElement("div",{title:"Turn on/off hemispheric light",onClick:function(){e.props.globalState.hemisphericLight=!e.props.globalState.hemisphericLight,l.DataStorage.WriteBoolean("HemisphericLight",e.props.globalState.hemisphericLight),e.props.globalState.onLightUpdated.notifyObservers(),e.forceUpdate()},className:"button hemispheric-light"+(this.props.globalState.hemisphericLight?" selected":"")},o.createElement("img",{src:at,alt:""})),o.createElement("div",{title:"Turn on/off direction light #1",onClick:function(){e.props.globalState.directionalLight1=!e.props.globalState.directionalLight1,l.DataStorage.WriteBoolean("DirectionalLight1",e.props.globalState.directionalLight1),e.props.globalState.onLightUpdated.notifyObservers(),e.forceUpdate()},className:"button direction-light-1"+(this.props.globalState.directionalLight1?" selected":"")},o.createElement("img",{src:it,alt:""})),o.createElement("div",{title:"Turn on/off direction light #0",onClick:function(){e.props.globalState.directionalLight0=!e.props.globalState.directionalLight0,l.DataStorage.WriteBoolean("DirectionalLight0",e.props.globalState.directionalLight0),e.props.globalState.onLightUpdated.notifyObservers(),e.forceUpdate()},className:"button direction-light-0"+(this.props.globalState.directionalLight0?" selected":"")},o.createElement("img",{src:lt,alt:""})))))},t}(o.Component);n(393);var ct=function(e){function t(t){var n=e.call(this,t)||this;return n.NodeWidth=100,n._leftWidth=l.DataStorage.ReadNumber("LeftWidth",200),n._rightWidth=l.DataStorage.ReadNumber("RightWidth",300),n._blocks=new Array,n._copiedNodes=[],n._copiedFrame=null,n._mouseLocationX=0,n._mouseLocationY=0,n.handlePopUp=function(){n.setState({showPreviewPopUp:!0}),n.createPopUp(),n.props.globalState.hostWindow.addEventListener("beforeunload",n.handleClosingPopUp)},n.handleClosingPopUp=function(){n._previewManager.dispose(),n._popUpWindow.close(),n.setState({showPreviewPopUp:!1},(function(){return n.initiatePreviewArea()}))},n.initiatePreviewArea=function(e){void 0===e&&(e=n.props.globalState.hostDocument.getElementById("preview-canvas")),n._previewManager=new Ke(e,n.props.globalState)},n.createPopUp=function(){var e=p({embedHostWidth:"100%",popup:!0},{original:!0,popup:!1,overlay:!1,embedMode:!1,enableClose:!0,handleResize:!0,enablePopup:!0}),t=n.createPopupWindow("PREVIEW AREA","_PreviewHostWindow");if(t){t.addEventListener("beforeunload",n.handleClosingPopUp);var r=t.document.getElementById("node-editor-graph-root");n.createPreviewMeshControlHost(e,r),n.createPreviewHost(e,r),r&&(n.fixPopUpStyles(r.ownerDocument),n.initiatePreviewArea(r.ownerDocument.getElementById("preview-canvas")))}},n.createPopupWindow=function(e,t,r,o){void 0===r&&(r=500),void 0===o&&(o=500);var a={width:r,height:o,top:(n.props.globalState.hostWindow.innerHeight-r)/2+window.screenY,left:(n.props.globalState.hostWindow.innerWidth-o)/2+window.screenX},i=Object.keys(a).map((function(e){return e+"="+a[e]})).join(","),l=n.props.globalState.hostWindow.open("",e,i);if(!l)return null;var s=l.document;s.title=e,s.body.style.width="100%",s.body.style.height="100%",s.body.style.margin="0",s.body.style.padding="0";var c=s.createElement("div");return c.style.width="100%",c.style.height="100%",c.style.margin="0",c.style.padding="0",c.style.display="grid",c.style.gridTemplateRows="40px auto",c.id="node-editor-graph-root",c.className="right-panel",l.document.body.appendChild(c),n.copyStyles(n.props.globalState.hostWindow.document,s),n[t]=l,n._popUpWindow=l,l},n.copyStyles=function(e,t){for(var n=[],r=0;r-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 Ve(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;if(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._graphCanvas._frameIsMoving=!0;var f=n.pasteSelection(n._copiedFrame.nodes,d,u);if(f)for(var h=0,g=f;h0){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;c-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){(function(e){var r=n(82),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(58)(e))},function(e,t,n){var r=n(40),o=n(163),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(21);e.exports=function(e){return"function"==typeof e?e:r}},function(e,t,n){var r=n(22)(n(11),"Map");e.exports=r},function(e,t,n){var r=n(180),o=n(187),a=n(189),i=n(190),l=n(191);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++ti){var l=a;a=i,i=l}return a+""+i+""+(r.isUndefined(o)?"\0":o)}function s(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 c(e,t){return l(e,t.v,t.w,t.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(e){return this._label=e,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return r.keys(this._nodes)},o.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},o.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},o.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},o.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]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},o.prototype.node=function(e){return this._nodes[e]},o.prototype.hasNode=function(e){return r.has(this._nodes,e)},o.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},o.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t="\0";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},o.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},o.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}},o.prototype.children=function(e){if(r.isUndefined(e)&&(e="\0"),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if("\0"===e)return this.nodes();if(this.hasNode(e))return[]}},o.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},o.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},o.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},o.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},o.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},o.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return r.values(this._edgeObjs)},o.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},o.prototype.setEdge=function(){var e,t,n,o,i=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(e=c.v,t=c.w,n=c.name,2===arguments.length&&(o=arguments[1],i=!0)):(e=c,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],i=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var u=l(this._isDirected,e,t,n);if(r.has(this._edgeLabels,u))return i&&(this._edgeLabels[u]=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[u]=i?o:this._defaultEdgeLabelFn(e,t,n);var p=s(this._isDirected,e,t,n);return e=p.v,t=p.w,Object.freeze(p),this._edgeObjs[u]=p,a(this._preds[t],e),a(this._sucs[e],t),this._in[t][u]=p,this._out[e][u]=p,this._edgeCount++,this},o.prototype.edge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(e,t,n){var o=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return r.has(this._edgeLabels,o)},o.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):l(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],i(this._preds[t],e),i(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},o.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}},o.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}},o.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(66),o=n(305);e.exports=function e(t,n,a,i,l){var s=-1,c=t.length;for(a||(a=o),l||(l=[]);++s0&&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(27);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 m.head.insertBefore(t,r),e}}function G(){for(var e=12,t="";e-- >0;)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[62*Math.random()|0];return t}function q(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function Z(e){return Object.keys(e||{}).reduce((function(t,n){return t+"".concat(n,": ").concat(e[n],";")}),"")}function Q(e){return e.size!==X.size||e.x!==X.x||e.y!==X.y||e.rotate!==X.rotate||e.flipX||e.flipY}function K(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 $={x:0,y:0,width:"100%",height:"100%"};function J(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 ee(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,g=f.height,m="fa-w-".concat(Math.ceil(h/g*16)),v=[k.replacementClass,a?"".concat(k.familyPrefix,"-").concat(a):"",m].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(g)})};d&&(b.attributes["data-fa-i2svg"]=""),c&&b.children.push({tag:"title",attributes:{id:b.attributes["aria-labelledby"]||"title-".concat(G())},children:[c]});var y=l({},b,{prefix:o,iconName:a,main:n,mask:r,transform:i,symbol:s,styles:u.styles}),x=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=K({transform:i,containerWidth:u,iconWidth:s}),f={tag:"rect",attributes:l({},$,{fill:"white"})},h=c.children?{children:c.children.map(J)}:{},g={tag:"g",attributes:l({},d.inner),children:[J(l({tag:c.tag,attributes:l({},c.attributes,d.path)},h))]},m={tag:"g",attributes:l({},d.outer),children:[g]},v="mask-".concat(G()),b="clip-".concat(G()),y={tag:"mask",attributes:l({},$,{id:v,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[f,m]},x={tag:"defs",children:[{tag:"clipPath",attributes:{id:b},children:(t=p,"g"===t.tag?t.children:[t])},y]};return n.push(x,{tag:"rect",attributes:l({fill:"currentColor","clip-path":"url(#".concat(b,")"),mask:"url(#".concat(v,")")},$)}),{children:n,attributes:r}}(y):function(e){var t=e.children,n=e.attributes,r=e.main,o=e.transform,a=Z(e.styles);if(a.length>0&&(n.style=a),Q(o)){var i=K({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=x.children,_=x.attributes;return y.children=w,y.attributes=_,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(k.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(Q(i)&&n.found&&!r.found){var s={x:n.width/n.height/2,y:.5};o.style=Z(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 te=function(){},ne=(k.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]:{},r=n.skipHooks,o=void 0!==r&&r,a=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 S.hooks.addPack||o?S.styles[e]=l({},S.styles[e]||{},a):S.hooks.addPack(e,a),"fas"===e&&re("fa",t)}var oe=S.styles,ae=S.shims,ie=function(){var e=function(e){return ne(oe,(function(t,n,r){return t[r]=ne(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 oe;ne(ae,(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}),{})};ie();S.styles;function le(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}function se(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?q(e):"<".concat(t," ").concat(function(e){return Object.keys(e||{}).reduce((function(t,n){return t+"".concat(n,'="').concat(q(e[n]),'" ')}),"").trim()}(r),">").concat(a.map(se).join(""),"")}var ce=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 ue(e){this.name="MissingIcon",this.message=e||"Icon unavailable",this.stack=(new Error).stack}ue.prototype=Object.create(Error.prototype),ue.prototype.constructor=ue;var pe={fill:"currentColor"},de={attributeType:"XML",repeatCount:"indefinite",dur:"2s"},fe={tag:"path",attributes:l({},pe,{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"})},he=l({},de,{attributeName:"opacity"});l({},pe,{cx:"256",cy:"364",r:"28"}),l({},de,{attributeName:"r",values:"28;14;28;28;14;28;"}),l({},he,{values:"1;0;1;1;0;1;"}),l({},pe,{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({},he,{values:"1;0;0;0;0;1;"}),l({},pe,{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({},he,{values:"0;0;1;1;0;0;"}),S.styles;function ge(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(k.familyPrefix,"-").concat(w.GROUP)},children:[{tag:"path",attributes:{class:"".concat(k.familyPrefix,"-").concat(w.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(k.familyPrefix,"-").concat(w.PRIMARY),fill:"currentColor",d:r[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:r}}}}S.styles;function me(){var e="svg-inline--fa",t=k.familyPrefix,n=k.replacementClass,r='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}';if("fa"!==t||n!==e){var o=new RegExp("\\.".concat("fa","\\-"),"g"),a=new RegExp("\\--".concat("fa","\\-"),"g"),i=new RegExp("\\.".concat(e),"g");r=r.replace(o,".".concat(t,"-")).replace(a,"--".concat(t,"-")).replace(i,".".concat(n))}return r}function ve(){k.autoAddCss&&!_e&&(Y(me()),_e=!0)}function be(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map((function(e){return se(e)}))}}),Object.defineProperty(e,"node",{get:function(){if(b){var t=m.createElement("div");return t.innerHTML=e.html,t.children}}}),e}function ye(e){var t=e.prefix,n=void 0===t?"fa":t,r=e.iconName;if(r)return le(we.definitions,n,r)||le(S.styles,n,r)}var xe,we=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?X: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,g=t.styles,m=void 0===g?{}:g;if(e){var v=e.prefix,b=e.iconName,y=e.icon;return be(l({type:"icon"},e),(function(){return ve(),k.autoA11y&&(u?h["aria-labelledby"]="".concat(k.replacementClass,"-title-").concat(G()):(h["aria-hidden"]="true",h.focusable="false")),ee({icons:{main:ge(y),mask:s?ge(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:v,iconName:b,transform:l({},X,r),symbol:a,title:u,extra:{attributes:h,styles:m,classes:d}})}))}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e||{}).icon?e:ye(e||{}),r=t.mask;return r&&(r=(r||{}).icon?r:ye(r||{})),xe(n,l({},t,{mask:r}))})}).call(this,n(29),n(146).setImmediate)},function(e,t,n){e.exports={graphlib:n(13),layout:n(326),debug:n(376),util:{time:n(9).time,notime:n(9).notime},version:n(377)}},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;cu))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var f=-1,h=!0,g=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++f=t||n<0||m&&e-h>=u}function w(){var e=o();if(x(e))return _(e);d=setTimeout(w,function(e){var n=t-(e-f);return m?l(n,u-(e-h)):n}(e))}function _(e){return d=void 0,v&&s?b(e):(s=c=void 0,p)}function C(){var e=o(),n=x(e);if(s=arguments,c=this,f=e,n){if(void 0===d)return y(f);if(m)return clearTimeout(d),d=setTimeout(w,t),b(f)}return void 0===d&&(d=setTimeout(w,t)),p}return t=a(t)||0,r(n)&&(g=!!n.leading,u=(m="maxWait"in n)?i(a(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),C.cancel=function(){void 0!==d&&clearTimeout(d),h=0,s=f=c=d=void 0},C.flush=function(){return void 0===d?p:_(o())},C}},function(e,t,n){var r=n(11);e.exports=function(){return r.Date.now()}},function(e,t,n){var r=n(7),o=n(27),a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=l.test(e);return n||s.test(e)?c(e.slice(2),n?2:8):i.test(e)?NaN:+e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorWrap=void 0;var r=Object.assign||function(e){for(var t=1;t0&&(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(10);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].priorityL.length&&L.push(e)}function A(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?"."+I(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}),ge=[9,13,27,32],me=Y&&"CompositionEvent"in window,ve=null;Y&&"documentMode"in document&&(ve=document.documentMode);var be=Y&&"TextEvent"in window&&!ve,ye=Y&&(!me||ve&&8=ve),xe=String.fromCharCode(32),we={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!==ge.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:we,extractEvents:function(e,t,n,r){var o=void 0,a=void 0;if(me)e:{switch(e){case"compositionstart":o=we.compositionStart;break e;case"compositionend":o=we.compositionEnd;break e;case"compositionupdate":o=we.compositionUpdate;break e}o=void 0}else Ee?Ce(e,n)&&(o=we.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=we.compositionStart);return o?(ye&&"ko"!==n.locale&&(Ee||o!==we.compositionStart?o===we.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),X(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,xe);case"textInput":return(e=t.data)===xe&&_e?null:e;default:return null}}(e,n):function(e,t){if(Ee)return"compositionend"===e||!me&&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