vendor: 5,068 bytes, lines 1-28
1var CABLES=function(t){var e={};function i(s){if(e[s])return e[s].exports;var r=e[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(s,r,function(e){return t[e]}.bind(null,r));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,i){t.exports=i(2)},function(t,e,i){ 2/**! 3 4 @license 5 handlebars v4.5.3 6 7Copyright (C) 2011-2017 by Yehuda Katz 8 9Permission is hereby granted, free of charge, to any person obtaining a copy 10of this software and associated documentation files (the "Software"), to deal 11in the Software without restriction, including without limitation the rights 12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13copies of the Software, and to permit persons to whom the Software is 14furnished to do so, subject to the following conditions: 15 16The above copyright notice and this permission notice shall be included in 17all copies or substantial portions of the Software. 18 19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25THE SOFTWARE. 26 27*/ 28var s;s=function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var r=e[s]={exports:{},id:s,loaded:!1};return t[s].call(r.exports,r,r.exports,i),r.loaded=!0,r.exports}return i.m=t,i.c=e,i.p="",i(0)}([function(t,e,i){"use strict";var s=i(1).default;e.__esModule=!0;var r=s(i(2)),n=s(i(40)),o=i(41),a=i(46),h=s(i(49)),l=s(i(44)),u=s(i(39)),c=r.default.create;function p(){var t=c();return t.compile=function(e,i){return a.compile(e,i,t)},t.precompile=function(e,i){return a.precompile(e,i,t)},t.AST=n.default,t.Compiler=a.Compiler,t.JavaScriptCompiler=h.default,t.Parser=o.parser,t.parse=o.parse,t.parseWithoutProcessing=o.parseWithoutProcessing,t}var d=p();d.create=p,u.default(d),d.Visitor=l.default,d.default=d,e.default=d,t.exports=e.default},function(t,e){"use strict";e.default=function(t){return t&&t.__esModule?t:{default:t}},e.__esModule=!0},function(t,e,i){"use strict";var s=i(3).default,r=i(1).default;e.__esModule=!0;var n=s(i(4)),o=r(i(33)),a=r(i(6)),h=s(i(5)),l=s(i(34)),u=r(i(39));function c(){var t=new n.HandlebarsEnvironment;return h.extend(t,n),t.SafeString=o.default,t.Exception=a.default,t.Utils=h,t.escapeExpression=h.escapeExpression,t.VM=l,t.template=function(e){return l.template(e,t)},t}var p=c();p.create=c,u.default(p),p.default=p,e.default=p,t.exports=e.default},function(t,e){"use strict";e.default=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e},e.__esModule=!0},function(t,e,i){"use strict";var s=i(1).default;e.__esModule=!0,e.HandlebarsEnvironment=l;var r=i(5),n=s(i(6)),o=i(10),a=i(30),h=s(i(32));function l(t,e,i){this.helpers=t||{},this.partials=e||{},this.decorators=i||{},o.registerDefaultHelpers(this),a.registerDefaultDecorators(this)}e.VERSION="4.5.3",e.COMPILER_REVISION=8,e.LAST_COMPATIBLE_COMPILER_REVISION=7,e.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"},l.prototype={constructor:l,logger:h.default,log:h.default.log,registerHelper:function(t,e){if("[object Object]"===r.toString.call(t)){if(e)throw new n.default("Arg not supported with multiple helpers");r.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if("[object Object]"===r.toString.call(t))r.extend(this.partials,t);else{if(void 0===e)throw new n.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if("[object Object]"===r.toString.call(t)){if(e)throw new n.default("Arg not supported with multiple decorators");r.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]}};var u=h.default.log;e.log=u,e.createFrame=r.createFrame,e.logger=h.default},function(t,e){"use strict";
vendor: 4,157 bytes, line 28
28e.__esModule=!0,e.extend=o,e.indexOf=function(t,e){for(var i=0,s=t.length;i<s;i++)if(t[i]===e)return i;return-1},e.escapeExpression=function(t){if("string"!=typeof t){if(t&&t.toHTML)return t.toHTML();if(null==t)return"";if(!t)return t+"";t=""+t}return r.test(t)?t.replace(s,n):t},e.isEmpty=function(t){return!t&&0!==t||!(!l(t)||0!==t.length)},e.createFrame=function(t){var e=o({},t);return e._parent=t,e},e.blockParams=function(t,e){return t.path=e,t},e.appendContextPath=function(t,e){return(t?t+".":"")+e};var i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},s=/[&<>"'`=]/g,r=/[&<>"'`=]/;function n(t){return i[t]}function o(t){for(var e=1;e<arguments.length;e++)for(var i in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],i)&&(t[i]=arguments[e][i]);return t}var a=Object.prototype.toString;e.toString=a;var h=function(t){return"function"==typeof t};h(/x/)&&(e.isFunction=h=function(t){return"function"==typeof t&&"[object Function]"===a.call(t)}),e.isFunction=h;var l=Array.isArray||function(t){return!(!t||"object"!=typeof t)&&"[object Array]"===a.call(t)};e.isArray=l},function(t,e,i){"use strict";var s=i(7).default;e.__esModule=!0;var r=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function n(t,e){var i=e&&e.loc,o=void 0,a=void 0,h=void 0,l=void 0;i&&(o=i.start.line,a=i.end.line,h=i.start.column,l=i.end.column,t+=" - "+o+":"+h);for(var u=Error.prototype.constructor.call(this,t),c=0;c<r.length;c++)this[r[c]]=u[r[c]];Error.captureStackTrace&&Error.captureStackTrace(this,n);try{i&&(this.lineNumber=o,this.endLineNumber=a,s?(Object.defineProperty(this,"column",{value:h,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:l,enumerable:!0})):(this.column=h,this.endColumn=l))}catch(t){}}n.prototype=new Error,e.default=n,t.exports=e.default},function(t,e,i){t.exports={default:i(8),__esModule:!0}},function(t,e,i){var s=i(9);t.exports=function(t,e,i){return s.setDesc(t,e,i)}},function(t,e){var i=Object;t.exports={create:i.create,getProto:i.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:i.getOwnPropertyDescriptor,setDesc:i.defineProperty,setDescs:i.defineProperties,getKeys:i.keys,getNames:i.getOwnPropertyNames,getSymbols:i.getOwnPropertySymbols,each:[].forEach}},function(t,e,i){"use strict";var s=i(1).default;e.__esModule=!0,e.registerDefaultHelpers=function(t){r.default(t),n.default(t),o.default(t),a.default(t),h.default(t),l.default(t),u.default(t)},e.moveHelperToHooks=function(t,e,i){t.helpers[e]&&(t.hooks[e]=t.helpers[e],i||delete t.helpers[e])};var r=s(i(11)),n=s(i(12)),o=s(i(25)),a=s(i(26)),h=s(i(27)),l=s(i(28)),u=s(i(29))},function(t,e,i){"use strict";e.__esModule=!0;var s=i(5);e.default=function(t){t.registerHelper("blockHelperMissing",function(e,i){var r=i.inverse,n=i.fn;if(!0===e)return n(this);if(!1===e||null==e)return r(this);if(s.isArray(e))return e.length>0?(i.ids&&(i.ids=[i.name]),t.helpers.each(e,i)):r(this);if(i.data&&i.ids){var o=s.createFrame(i.data);o.contextPath=s.appendContextPath(i.data.contextPath,i.name),i={data:o}}return n(e,i)})},t.exports=e.default},function(t,e,i){(function(s){"use strict";var r=i(13).default,n=i(1).default;e.__esModule=!0;var o=i(5),a=n(i(6));e.default=function(t){t.registerHelper("each",function(t,e){if(!e)throw new a.default("Must pass iterator to #each");var i,n=e.fn,h=e.inverse,l=0,u="",c=void 0,p=void 0;function d(e,i,s){c&&(c.key=e,c.index=i,c.first=0===i,c.last=!!s,p&&(c.contextPath=p+e)),u+=n(t[e],{data:c,blockParams:o.blockParams([t[e],e],[p+e,null])})}if(e.data&&e.ids&&(p=o.appendContextPath(e.data.contextPath,e.ids[0])+"."),o.isFunction(t)&&(t=t.call(this)),e.data&&(c=o.createFrame(e.data)),t&&"object"==typeof t)if(o.isArray(t))for(var f=t.length;l<f;l++)l in t&&d(l,l,l===t.length-1);else if(s.Symbol&&t[s.Symbol.iterator]){for(var g=[],_=t[s.Symbol.iterator](),m=_.next();!m.done;m=_.next())g.push(m.value);for(f=(t=g).length;l<f;l++)d(l,l,l===t.length-1)}else i=void 0,r(t).forEach(function(t){void 0!==i&&d(i,l-1),i=t,l++}),void 0!==i&&d(i,l-1,!0);return 0===l&&(u=h(this)),u})},t.exports=e.default}).call(e,function(){return this}())}
28,function(t,e,i){t.exports={default:i(14),__esModule:!0}},function(t,e,i){i(15),t.exports=i(21).Object.keys},function(t,e,i){var s=i(16);i(18)("keys",function(t){return function(e){return t(s(e))}})},function(t,e,i){var s=i(17);t.exports=function(t){return Object(s(t))}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var s=i(19),r=i(21),n=i(24);t.exports=function(t,e){var i=(r.Object||{})[t]||Object[t],o={};o[t]=e(i),s(s.S+s.F*n(function(){i(1)}),"Object",o)}},function(t,e,i){var s=i(20),r=i(21),n=i(22),o=function(t,e,i){var a,h,l,u=t&o.F,c=t&o.G,p=t&o.S,d=t&o.P,f=t&o.B,g=t&o.W,_=c?r:r[e]||(r[e]={}),m=c?s:p?s[e]:(s[e]||{}).prototype;for(a in c&&(i=e),i)(h=!u&&m&&a in m)&&a in _||(l=h?m[a]:i[a],_[a]=c&&"function"!=typeof m[a]?i[a]:f&&h?n(l,s):g&&m[a]==l?function(t){var e=function(e){return this instanceof t?new t(e):t(e)};return e.prototype=t.prototype,e}(l):d&&"function"==typeof l?n(Function.call,l):l,d&&((_.prototype||(_.prototype={}))[a]=l))};o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,t.exports=o},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){var i=t.exports={version:"1.2.6"};"number"==typeof __e&&(__e=i)},function(t,e,i){var s=i(23);t.exports=function(t,e,i){if(s(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,s){return t.call(e,i,s)};case 3:return function(i,s,r){return t.call(e,i,s,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,i){"use strict";var s=i(1).default;e.__esModule=!0;var r=s(i(6));e.default=function(t){t.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new r.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},t.exports=e.default},function(t,e,i){"use strict";var s=i(1).default;e.__esModule=!0;var r=i(5),n=s(i(6));e.default=function(t){t.registerHelper("if",function(t,e){if(2!=arguments.length)throw new n.default("#if requires exactly one argument");return r.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||r.isEmpty(t)?e.inverse(this):e.fn(this)}),t.registerHelper("unless",function(e,i){if(2!=arguments.length)throw new n.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:i.inverse,inverse:i.fn,hash:i.hash})})},t.exports=e.default},function(t,e){"use strict";e.__esModule=!0,e.default=function(t){t.registerHelper("log",function(){for(var e=[void 0],i=arguments[arguments.length-1],s=0;s<arguments.length-1;s++)e.push(arguments[s]);var r=1;null!=i.hash.level?r=i.hash.level:i.data&&null!=i.data.level&&(r=i.data.level),e[0]=r,t.log.apply(t,e)})},t.exports=e.default},function(t,e){"use strict";e.__esModule=!0;var i=/^(constructor|__defineGetter__|__defineSetter__|__lookupGetter__|__proto__)$/;e.dangerousPropertyRegex=i,e.default=function(t){t.registerHelper("lookup",function(t,e){return t?!i.test(String(e))||Object.prototype.propertyIsEnumerable.call(t,e)?t[e]:void 0:t})}},function(t,e,i){"use strict";var s=i(1).default;e.__esModule=!0;var r=i(5),n=s(i(6));e.default=function(t){t.registerHelper("with",function(t,e){if(2!=arguments.length)throw new n.default("#with requires exactly one argument");r.isFunction(t)&&(t=t.call(this));var i=e.fn;if(r.isEmpty(t))return e.inverse(this);var s=e.data;return e.data&&e.ids&&((s=r.createFrame(e.data)).contextPath=r.appendContextPath(e.data.contextPath,e.ids[0])),i(t,{data:s,blockParams:r.blockParams([t],[s&&s.contextPath])})})},t.exports=e.default},function(t,e,i){"use strict";var s=i(1).default;e.__esModule=!0,e.registerDefaultDecorators=function(t){r.default(t)};var r=s(i(31))},function(t,e,i){"use strict";e.__esModule=!0;var s=i(5);e.default=function(t){t.registerDecorator("inline",function(t,e,i,r){var n=t;return e.partials||(e.partials={},n=function(r,n){var o=i.partials;i.partials=s.extend({},o,e.partials);var a=t(r,n);return i.partials=o,a}),e.partials[r.args[0]]=r.fn,n})},t.exports=e.default}
vendor: 3,926 bytes, line 28
28,function(t,e,i){"use strict";e.__esModule=!0;var s=i(5),r={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(t){if("string"==typeof t){var e=s.indexOf(r.methodMap,t.toLowerCase());t=e>=0?e:parseInt(t,10)}return t},log:function(t){if(t=r.lookupLevel(t),"undefined"!=typeof console&&r.lookupLevel(r.level)<=t){var e=r.methodMap[t];console[e]||(e="log");for(var i=arguments.length,s=Array(i>1?i-1:0),n=1;n<i;n++)s[n-1]=arguments[n];console[e].apply(console,s)}}};e.default=r,t.exports=e.default},function(t,e){"use strict";function i(t){this.string=t}e.__esModule=!0,i.prototype.toString=i.prototype.toHTML=function(){return""+this.string},e.default=i,t.exports=e.default},function(t,e,i){"use strict";var s=i(35).default,r=i(3).default,n=i(1).default;e.__esModule=!0,e.checkRevision=function(t){var e=t&&t[0]||1,i=h.COMPILER_REVISION;if(!(e>=h.LAST_COMPATIBLE_COMPILER_REVISION&&e<=h.COMPILER_REVISION)){if(e<h.LAST_COMPATIBLE_COMPILER_REVISION){var s=h.REVISION_CHANGES[i],r=h.REVISION_CHANGES[e];throw new a.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+s+") or downgrade your runtime to an older version ("+r+").")}throw new a.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")}},e.template=function(t,e){if(!e)throw new a.default("No environment passed to template");if(!t||!t.main)throw new a.default("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var i=t.compiler&&7===t.compiler[0],r={strict:function(t,e,i){if(!(t&&e in t))throw new a.default('"'+e+'" not defined in '+t,{loc:i});return t[e]},lookup:function(t,e){for(var i=t.length,s=0;s<i;s++)if(t[s]&&null!=t[s][e])return t[s][e]},lambda:function(t,e){return"function"==typeof t?t.call(e):t},escapeExpression:o.escapeExpression,invokePartial:function(i,s,r){r.hash&&(s=o.extend({},s,r.hash),r.ids&&(r.ids[0]=!0)),i=e.VM.resolvePartial.call(this,i,s,r);var n=o.extend({},r,{hooks:this.hooks}),h=e.VM.invokePartial.call(this,i,s,n);if(null==h&&e.compile&&(r.partials[r.name]=e.compile(i,t.compilerOptions,e),h=r.partials[r.name](s,n)),null!=h){if(r.indent){for(var l=h.split("\n"),u=0,c=l.length;u<c&&(l[u]||u+1!==c);u++)l[u]=r.indent+l[u];h=l.join("\n")}return h}throw new a.default("The partial "+r.name+" could not be compiled when running in runtime-only mode")},fn:function(e){var i=t[e];return i.decorator=t[e+"_d"],i},programs:[],program:function(t,e,i,s,r){var n=this.programs[t],o=this.fn(t);return e||r||s||i?n=u(this,t,o,e,i,s,r):n||(n=this.programs[t]=u(this,t,o)),n},data:function(t,e){for(;t&&e--;)t=t._parent;return t},nullContext:s({}),noop:e.VM.noop,compilerInfo:t.compiler};function n(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],s=i.data;n._setup(i),!i.partial&&t.useData&&(s=function(t,e){return e&&"root"in e||((e=e?h.createFrame(e):{}).root=t),e}(e,s));var o=void 0,a=t.useBlockParams?[]:void 0;function l(e){return""+t.main(r,e,r.helpers,r.partials,s,a,o)}return t.useDepths&&(o=i.depths?e!=i.depths[0]?[e].concat(i.depths):i.depths:[e]),(l=p(t.main,l,r,i.depths||[],s,a))(e,i)}return n.isTop=!0,n._setup=function(s){if(s.partial)r.helpers=s.helpers,r.partials=s.partials,r.decorators=s.decorators,r.hooks=s.hooks;else{r.helpers=o.extend({},e.helpers,s.helpers),t.usePartial&&(r.partials=o.extend({},e.partials,s.partials)),(t.usePartial||t.useDecorators)&&(r.decorators=o.extend({},e.decorators,s.decorators)),r.hooks={};var n=s.allowCallsToHelperMissing||i;l.moveHelperToHooks(r,"helperMissing",n),l.moveHelperToHooks(r,"blockHelperMissing",n)}},n._child=function(e,i,s,n){if(t.useBlockParams&&!s)throw new a.default("must pass block params");if(t.useDepths&&!n)throw new a.default("must pass parent depths");return u(r,e,t[e],i,0,s,n)},n}
vendor: 3,961 bytes, line 28
28,e.wrapProgram=u,e.resolvePartial=function(t,e,i){return t?t.call||i.name||(i.name=t,t=i.partials[t]):t="@partial-block"===i.name?i.data["partial-block"]:i.partials[i.name],t},e.invokePartial=function(t,e,i){var s=i.data&&i.data["partial-block"];i.partial=!0,i.ids&&(i.data.contextPath=i.ids[0]||i.data.contextPath);var r=void 0;if(i.fn&&i.fn!==c&&function(){i.data=h.createFrame(i.data);var t=i.fn;r=i.data["partial-block"]=function(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return i.data=h.createFrame(i.data),i.data["partial-block"]=s,t(e,i)},t.partials&&(i.partials=o.extend({},i.partials,t.partials))}(),void 0===t&&r&&(t=r),void 0===t)throw new a.default("The partial "+i.name+" could not be found");if(t instanceof Function)return t(e,i)},e.noop=c;var o=r(i(5)),a=n(i(6)),h=i(4),l=i(10);function u(t,e,i,s,r,n,o){function a(e){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=o;return!o||e==o[0]||e===t.nullContext&&null===o[0]||(a=[e].concat(o)),i(t,e,t.helpers,t.partials,r.data||s,n&&[r.blockParams].concat(n),a)}return(a=p(i,a,t,o,s,n)).program=e,a.depth=o?o.length:0,a.blockParams=r||0,a}function c(){return""}function p(t,e,i,s,r,n){if(t.decorator){var a={};e=t.decorator(e,a,i,s&&s[0],r,n,s),o.extend(e,a)}return e}},function(t,e,i){t.exports={default:i(36),__esModule:!0}},function(t,e,i){i(37),t.exports=i(21).Object.seal},function(t,e,i){var s=i(38);i(18)("seal",function(t){return function(e){return t&&s(e)?t(e):e}})},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){(function(i){"use strict";e.__esModule=!0,e.default=function(t){var e=void 0!==i?i:window,s=e.Handlebars;t.noConflict=function(){return e.Handlebars===t&&(e.Handlebars=s),t}},t.exports=e.default}).call(e,function(){return this}())},function(t,e){"use strict";e.__esModule=!0;var i={helpers:{helperExpression:function(t){return"SubExpression"===t.type||("MustacheStatement"===t.type||"BlockStatement"===t.type)&&!!(t.params&&t.params.length||t.hash)},scopedId:function(t){return/^\.|this\b/.test(t.original)},simpleId:function(t){return 1===t.parts.length&&!i.helpers.scopedId(t)&&!t.depth}}};e.default=i,t.exports=e.default},function(t,e,i){"use strict";var s=i(1).default,r=i(3).default;e.__esModule=!0,e.parseWithoutProcessing=u,e.parse=function(t,e){var i=u(t,e);return new o.default(e).accept(i)};var n=s(i(42)),o=s(i(43)),a=r(i(45)),h=i(5);e.parser=n.default;var l={};function u(t,e){return"Program"===t.type?t:(n.default.yy=l,l.locInfo=function(t){return new l.SourceLocation(e&&e.srcName,t)},n.default.parse(t))}h.extend(l,a)},function(t,e){"use strict";e.__esModule=!0;var i=function(){var t={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,
vendor: 4,981 bytes, line 28
28EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(t,e,i,s,r,n,o){var a=n.length-1;switch(r){case 1:return n[a-1];case 2:this.$=s.prepareProgram(n[a]);break;case 3:case 4:case 5:case 6:case 7:case 8:this.$=n[a];break;case 9:this.$={type:"CommentStatement",value:s.stripComment(n[a]),strip:s.stripFlags(n[a],n[a]),loc:s.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:n[a],value:n[a],loc:s.locInfo(this._$)};break;case 11:this.$=s.prepareRawBlock(n[a-2],n[a-1],n[a],this._$);break;case 12:this.$={path:n[a-3],params:n[a-2],hash:n[a-1]};break;case 13:this.$=s.prepareBlock(n[a-3],n[a-2],n[a-1],n[a],!1,this._$);break;case 14:this.$=s.prepareBlock(n[a-3],n[a-2],n[a-1],n[a],!0,this._$);break;case 15:this.$={open:n[a-5],path:n[a-4],params:n[a-3],hash:n[a-2],blockParams:n[a-1],strip:s.stripFlags(n[a-5],n[a])};break;case 16:case 17:this.$={path:n[a-4],params:n[a-3],hash:n[a-2],blockParams:n[a-1],strip:s.stripFlags(n[a-5],n[a])};break;case 18:this.$={strip:s.stripFlags(n[a-1],n[a-1]),program:n[a]};break;case 19:var h=s.prepareBlock(n[a-2],n[a-1],n[a],n[a],!1,this._$),l=s.prepareProgram([h],n[a-1].loc);l.chained=!0,this.$={strip:n[a-2].strip,program:l,chain:!0};break;case 20:this.$=n[a];break;case 21:this.$={path:n[a-1],strip:s.stripFlags(n[a-2],n[a])};break;case 22:case 23:this.$=s.prepareMustache(n[a-3],n[a-2],n[a-1],n[a-4],s.stripFlags(n[a-4],n[a]),this._$);break;case 24:this.$={type:"PartialStatement",name:n[a-3],params:n[a-2],hash:n[a-1],indent:"",strip:s.stripFlags(n[a-4],n[a]),loc:s.locInfo(this._$)};break;case 25:this.$=s.preparePartialBlock(n[a-2],n[a-1],n[a],this._$);break;case 26:this.$={path:n[a-3],params:n[a-2],hash:n[a-1],strip:s.stripFlags(n[a-4],n[a])};break;case 27:case 28:this.$=n[a];break;case 29:this.$={type:"SubExpression",path:n[a-3],params:n[a-2],hash:n[a-1],loc:s.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:n[a],loc:s.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:s.id(n[a-2]),value:n[a],loc:s.locInfo(this._$)};break;case 32:this.$=s.id(n[a-1]);break;case 33:case 34:this.$=n[a];break;case 35:this.$={type:"StringLiteral",value:n[a],original:n[a],loc:s.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(n[a]),original:Number(n[a]),loc:s.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===n[a],original:"true"===n[a],loc:s.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:s.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:s.locInfo(this._$)};break;case 40:case 41:this.$=n[a];break;case 42:this.$=s.preparePath(!0,n[a],this._$);break;case 43:this.$=s.preparePath(!1,n[a],this._$);break;case 44:n[a-2].push({part:s.id(n[a]),original:n[a],separator:n[a-1]}),this.$=n[a-2];break;case 45:this.$=[{part:s.id(n[a]),original:n[a]}];break;case 46:this.$=[];break;case 47:n[a-1].push(n[a]);break;case 48:this.$=[];break;case 49:n[a-1].push(n[a]);break;case 50:this.$=[];break;case 51:n[a-1].push(n[a]);break;case 58:this.$=[];break;case 59:n[a-1].push(n[a]);break;case 64:this.$=[];break;case 65:n[a-1].push(n[a]);break;case 70:this.$=[];break;case 71:n[a-1].push(n[a]);break;case 78:this.$=[];break;case 79:n[a-1].push(n[a]);break;case 82:this.$=[];break;case 83:n[a-1].push(n[a]);break;case 86:this.$=[];break;case 87:n[a-1].push(n[a]);break;case 90:this.$=[];break;case 91:n[a-1].push(n[a]);break;case 94:this.$=[];break;case 95:n[a-1].push(n[a]);break;case 98:this.$=[n[a]];break;case 99:n[a-1].push(n[a]);break;case 100:this.$=[n[a]];break;case 101:n[a-1].push(n
vendor: 11,538 bytes, line 28
28[a])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(t,e){throw new Error(t)},parse:function(t){var e=this,
vendor: 644 bytes, line 28
28i=[0],s=[null],r=[],n=this.table,o="",a=0,h=0,l=0;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var u=this.lexer.yylloc;r.push(u);var c=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var p,d,f,g,_,m,v,E,b,y,T={};;){if(f=i[i.length-1],this.defaultActions[f]?g=this.defaultActions[f]:(null==p&&(y=void 0,"number"!=typeof(y=e.lexer.lex()||1)&&(y=e.symbols_[y]||y),p=y),g=n[f]&&n[f][p]),void 0===g||!g.length||!g[0]){var A="";if(!l){for(m in b=[],n[f])this.terminals_[m]&&m>
vendor: 4,781 bytes, line 28
282&&b.push("'"+this.terminals_[m]+"'");A=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+b.join(", ")+", got '"+(this.terminals_[p]||p)+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==p?"end of input":"'"+(this.terminals_[p]||p)+"'"),this.parseError(A,{text:this.lexer.match,token:this.terminals_[p]||p,line:this.lexer.yylineno,loc:u,expected:b})}}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+f+", token: "+p);switch(g[0]){case 1:i.push(p),s.push(this.lexer.yytext),r.push(this.lexer.yylloc),i.push(g[1]),p=null,d?(p=d,d=null):(h=this.lexer.yyleng,o=this.lexer.yytext,a=this.lexer.yylineno,u=this.lexer.yylloc,l>0&&l--);break;case 2:if(v=this.productions_[g[1]][1],T.$=s[s.length-v],T._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},c&&(T._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),void 0!==(_=this.performAction.call(T,o,h,a,this.yy,g[1],s,r)))return _;v&&(i=i.slice(0,-1*v*2),s=s.slice(0,-1*v),r=r.slice(0,-1*v)),i.push(this.productions_[g[1]][0]),s.push(T.$),r.push(T._$),E=n[i[i.length-2]][i[i.length-1]],i.push(E);break;case 3:return!0}}return!0}},e=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===s.length?this.yylloc.first_column:0)+s[s.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this},more:function(){return this._more=!0,this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;var t,e,i,s,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),o=0;o<n.length&&(!(i=this._input.match(this.rules[n[o]]))||e&&!(i[0].length>e[0].length)||(e=i,s=o,this.options.flex));o++);return e?((r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],t=this.performAction.call(this,this.yy,this,n[s],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return void 0!==t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)},options:{}
vendor: 13,666 bytes, line 28
28,performAction:function(t,e,i,s){function r(t,i){return e.yytext=e.yytext.substring(t,e.yyleng-i+t)}switch(i){case 0:if("\\\\"===e.yytext.slice(-2)?(r(0,1),this.begin("mu")):"\\"===e.yytext.slice(-1)?(r(0,1),this.begin("emu")):this.begin("mu"),e.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(r(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(e.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return e.yytext=r(1,2).replace(/\\"/g,'"'),80;case 32:return e.yytext=r(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return e.yytext=e.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};return t}();function i(){this.yy={}}return t.lexer=e,i.prototype=t,t.Parser=i,new i}();e.default=i,t.exports=e.default},function(t,e,i){"use strict";var s=i(1).default;e.__esModule=!0;var r=s(i(44));function n(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=t}function o(t,e,i){void 0===e&&(e=t.length);var s=t[e-1],r=t[e-2];return s?"ContentStatement"===s.type?(r||!i?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(s.original):void 0:i}function a(t,e,i){void 0===e&&(e=-1);var s=t[e+1],r=t[e+2];return s?"ContentStatement"===s.type?(r||!i?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(s.original):void 0:i}function h(t,e,i){var s=t[null==e?0:e+1];if(s&&"ContentStatement"===s.type&&(i||!s.rightStripped)){var r=s.value;s.value=s.value.replace(i?/^\s+/:/^[ \t]*\r?\n?/,""),s.rightStripped=s.value!==r}}function l(t,e,i){var s=t[null==e?t.length-1:e-1];if(s&&"ContentStatement"===s.type&&(i||!s.leftStripped)){var r=s.value;return s.value=s.value.replace(i?/\s+$/:/[ \t]+$/,""),s.leftStripped=s.value!==r,s.leftStripped}}n.prototype=new r.default,n.prototype.Program=function(t){var e=!this.options.ignoreStandalone,i=!this.isRootSeen;this.isRootSeen=!0;for(var s=t.body,r=0,n=s.length;r<n;r++){var u=s[r],c=this.accept(u);if(c){var p=o(s,r,i),d=a(s,r,i),f=c.openStandalone&&p,g=c.closeStandalone&&d,_=c.inlineStandalone&&p&&d;c.close&&h(s,r,!0),c.open&&l(s,r,!0),e&&_&&(h(s,r),l(s,r)&&"PartialStatement"===u.type&&(u.indent=/([ \t]+$)/.exec(s[r-1].original)[1])),e&&f&&(h((u.program||u.inverse).body),l(s,r)),e&&g&&(h(s,r),l((u.inverse||u.program).body))}}return t},n.prototype.BlockStatement=n.prototype.DecoratorBlock=n.prototype.PartialBlockStatement=function(t){this.accept(t.program),this.accept(t.inverse);var e=t.program||t.inverse,i=t.program&&t.inverse,s=i,r=i;if(i&&i.chained)for(s=i.body[0].program;r.chained;)r=r.body[r.body.length-1].program;var n={open:t.openStrip.open,close:t.closeStrip.close,openStandalone:a(e.body),closeStandalone:o((s||e).body)};if(t.openStrip.close&&h(e.body,null,!0),i){var u=t.inverseStrip;u.open&&l(e.body,null,!0),u.close&&h(s.body,null,!0),t.closeStrip.open&&l(r.body,null,!0),!this.options.ignoreStandalone&&o(e.body)&&a(s.body)&&(l(e.body),h(s.body))}else t.closeStrip.open&&l(e.body,null,!0);return n},n.prototype.Decorator=n.prototype.MustacheStatement=function(t){return t.strip},n.prototype.PartialStatement=n.prototype.CommentStatement=function(t){var e=t.strip||{};return{inlineStandalone:!0,open:e.open,close:e.close}},e.default=n,t.exports=e.default},function(t,e,i){"use strict";var s=i(1).default;e.__esModule=!0;var r=s(i(6));function n(){this.parents=[]}function o(t){this.acceptRequired(t,"path"),this.acceptArray(t.params),this.acceptKey(t,"hash")}function a(t){o.call(this,t),this.acceptKey(t,"program"),this.acceptKey(t,"inverse")}function h(t){this.acceptRequired(t,"name"),this.acceptArray(t.params),this.acceptKey(t,"hash")}n.prototype={constructor:n,mutating:!1,acceptKey:function(t,e){var i=this.accept(t[e]);if(this.mutating){if(i&&!n.prototype[i.type])throw new r.default('Unexpected node type "'+i.type+'" found when accepting '+e+" on "+t.type);t[e]=i}},acceptRequired:function(t,e){if(this.acceptKey(t,e),!t[e])throw new r.default(t.type+" requires "+e)},acceptArray:function(t){for(var e=0,i=t.length;e<i;e++)this.acceptKey(t,e),t[e]||(t.splice(e,1),e--,i--)},accept:function(t){if(t){if(!this[t.type])throw new r.default("Unknown type: "+t.type,t);this.current&&this.parents.unshift(this.current),this.current=t;var e=this[t.type](t);return this.current=this.parents.shift(),!this.mutating||e?e:!1!==e?t:void 0}},Program:function(t){this.acceptArray(t.body)},MustacheStatement:o,Decorator:o,BlockStatement:a,DecoratorBlock:a,PartialStatement:h,PartialBlockStatement:function(t){h.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:o,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(t){this.acceptArray(t.pairs)},HashPair:function(t){this.acceptRequired(t,"value")}},e.default=n,t.exports=e.default},function(t,e,i){"use strict";var s=i(1).default;e.__esModule=!0,e.SourceLocation=function(t,e){this.source=t,this.start={line:e.first_line,column:e.first_column},this.end={line:e.last_line,column:e.last_column}},e.id=function(t){return/^\[.*\]$/.test(t)?t.substring(1,t.length-1):t},e.stripFlags=function(t,e){return{open:"~"===t.charAt(2),close:"~"===e.charAt(e.length-3)}},e.stripComment=function(t){return t.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")},e.preparePath=function(t,e,i){i=this.locInfo(i);for(var s=t?"@":"",n=[],o=0,a=0,h=e.length;a<h;a++){var l=e[a].part,u=e[a].original!==l;if(s+=(e[a].separator||"")+l,u||".."!==l&&"."!==l&&"this"!==l)n.push(l);else{if(n.length>0)throw new r.default("Invalid path: "+s,{loc:i});".."===l&&o++}}return{type:"PathExpression",data:t,depth:o,parts:n,original:s,loc:i}},e.prepareMustache=function(t,e,i,s,r,n){var o=s.charAt(3)||s.charAt(2),a="{"!==o&&"&"!==o;return{type:/\*/.test(s)?"Decorator":"MustacheStatement",path:t,params:e,hash:i,escaped:a,strip:r,loc:this.locInfo(n)}},e.prepareRawBlock=function(t,e,i,s){n(t,i),s=this.locInfo(s);var r={type:"Program",body:e,strip:{},loc:s};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:r,openStrip:{},inverseStrip:{},closeStrip:{},loc:s}},e.prepareBlock=function(t,e,i,s,o,a){s&&s.path&&n(t,s);var h=/\*/.test(t.open);e.blockParams=t.blockParams;var l=void 0,u=void 0;if(i){if(h)throw new r.default("Unexpected inverse block on decorator",i);i.chain&&(i.program.body[0].closeStrip=s.strip),u=i.strip,l=i.program}return o&&(o=l,l=e,e=o),{type:h?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:l,openStrip:t.strip,inverseStrip:u,closeStrip:s&&s.strip,loc:this.locInfo(a)}},e.prepareProgram=function(t,e){if(!e&&t.length){var i=t[0].loc,s=t[t.length-1].loc;i&&s&&(e={source:i.source,start:{line:i.start.line,column:i.start.column},end:{line:s.end.line,column:s.end.column}})}return{type:"Program",body:t,strip:{},loc:e}},e.preparePartialBlock=function(t,e,i,s){return n(t,i),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:i&&i.strip,loc:this.locInfo(s)}};var r=s(i(6));function n(t,e){if(e=e.path?e.path.original:e,t.path.original!==e){var i={loc:t.path.loc};throw new r.default(t.path.original+" doesn't match "+e,i)}}},function(t,e,i){"use strict";var s=i(47).default,r=i(1).default;e.__esModule=!0,e.Compiler=l,e.precompile=function(t,e,i){if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new n.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+t);"data"in(e=e||{})||(e.data=!0),e.compat&&(e.useDepths=!0);var s=i.parse(t,e),r=(new i.Compiler).compile(s,e);return(new i.JavaScriptCompiler).compile(r,e)},e.compile=function(t,e,i){if(void 0===e&&(e={}),null==t||"string"!=typeof t&&"Program"!==t.type)throw new n.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+t);"data"in(e=o.extend({},e))||(e.data=!0),e.compat&&(e.useDepths=!0);var s=void 0;function r(){var s=i.parse(t,e),r=(new i.Compiler).compile(s,e),n=(new i.JavaScriptCompiler).compile(r,e,void 0,!0);return i.template(n)}function a(t,e){return s||(s=r()),s.call(this,t,e)}return a._setup=function(t){return s||(s=r()),s._setup(t)},a._child=function(t,e,i,n){return s||(s=r()),s._child(t,e,i,n)},a};var n=r(i(6)),o=i(5),a=r(i(40)),h=[].slice;function l(){}function u(t,e){if(t===e)return!0;if(o.isArray(t)&&o.isArray(e)&&t.length===e.length){for(var i=0;i<t.length;i++)if(!u(t[i],e[i]))return!1;return!0}}function c(t){if(!t.path.parts){var e=t.path;t.path={type:"PathExpression",data:!1,depth:0,parts:[e.original+""],original:e.original+"",loc:e.loc}}}l.prototype={compiler:l,equals:function(t){var e=this.opcodes.length;if(t.opcodes.length!==e)return!1;for(var i=0;i<e;i++){var s=this.opcodes[i],r=t.opcodes[i];if(s.opcode!==r.opcode||!u(s.args,r.args))return!1}for(e=this.children.length,i=0;i<e;i++)if(!this.children[i].equals(t.children[i]))return!1;return!0},guid:0,compile:function(t,e){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=e,this.stringParams=e.stringParams,this.trackIds=e.trackIds,e.blockParams=e.blockParams||[],e.knownHelpers=o.extend(s(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},e.knownHelpers),this.accept(t)},compileProgram:function(t){var e=(new this.compiler).compile(t,this.options),i=this.guid++;return this.usePartial=this.usePartial||e.usePartial,this.children[i]=e,this.useDepths=this.useDepths||e.useDepths,i},accept:function(t){if(!this[t.type])throw new n.default("Unknown type: "+t.type,t);this.sourceNode.unshift(t);var e=this[t.type](t);return this.sourceNode.shift(),e},Program:function(t){this.options.blockParams.unshift(t.blockParams);for(var e=t.body,i=e.length,s=0;s<i;s++)this.accept(e[s]);return this.options.blockParams.shift(),this.isSimple=1===i,this.blockParams=t.blockParams?t.blockParams.length:0,this},BlockStatement:function(t){c(t);var e=t.program,i=t.inverse;e=e&&this.compileProgram(e),i=i&&this.compileProgram(i);var s=this.classifySexpr(t);"helper"===s?this.helperSexpr(t,e,i):"simple"===s?(this.simpleSexpr(t),this.opcode("pushProgram",e),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("blockValue",t.path.original)):(this.ambiguousSexpr(t,e,i),this.opcode("pushProgram",e),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(t){var e=t.program&&this.compileProgram(t.program),i=this.setupFullMustacheParams(t,e,void 0),s=t.path;this.useDecorators=!0,this.opcode("registerDecorator",i.length,s.original)},PartialStatement:function(t){this.usePartial=!0;var e=t.program;e&&(e=this.compileProgram(t.program));var i=t.params;if(i.length>1)throw new n.default("Unsupported number of partial arguments: "+i.length,t);i.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):i.push({type:"PathExpression",parts:[],depth:0}));var s=t.name.original,r="SubExpression"===t.name.type;r&&this.accept(t.name),this.setupFullMustacheParams(t,e,void 0,!0);var o=t.indent||"";this.options.preventIndent&&o&&(this.opcode("appendContent",o),o=""),this.opcode("invokePartial",r,s,o),this.opcode("append")},PartialBlockStatement:function(t){this.PartialStatement(t)},MustacheStatement:function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(t){this.DecoratorBlock(t)},ContentStatement:function(t){t.value&&this.opcode("appendContent",t.value)},CommentStatement:function(){},SubExpression:function(t){c(t);var e=this.classifySexpr(t);
vendor: 4,260 bytes, line 28
28"simple"===e?this.simpleSexpr(t):"helper"===e?this.helperSexpr(t):this.ambiguousSexpr(t)},ambiguousSexpr:function(t,e,i){var s=t.path,r=s.parts[0],n=null!=e||null!=i;this.opcode("getContext",s.depth),this.opcode("pushProgram",e),this.opcode("pushProgram",i),s.strict=!0,this.accept(s),this.opcode("invokeAmbiguous",r,n)},simpleSexpr:function(t){var e=t.path;e.strict=!0,this.accept(e),this.opcode("resolvePossibleLambda")},helperSexpr:function(t,e,i){var s=this.setupFullMustacheParams(t,e,i),r=t.path,o=r.parts[0];if(this.options.knownHelpers[o])this.opcode("invokeKnownHelper",s.length,o);else{if(this.options.knownHelpersOnly)throw new n.default("You specified knownHelpersOnly, but used the unknown helper "+o,t);r.strict=!0,r.falsy=!0,this.accept(r),this.opcode("invokeHelper",s.length,r.original,a.default.helpers.simpleId(r))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var e=t.parts[0],i=a.default.helpers.scopedId(t),s=!t.depth&&!i&&this.blockParamIndex(e);s?this.opcode("lookupBlockParam",s,t.parts):e?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,i):this.opcode("pushContext")},StringLiteral:function(t){this.opcode("pushString",t.value)},NumberLiteral:function(t){this.opcode("pushLiteral",t.value)},BooleanLiteral:function(t){this.opcode("pushLiteral",t.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(t){var e=t.pairs,i=0,s=e.length;for(this.opcode("pushHash");i<s;i++)this.pushParam(e[i].value);for(;i--;)this.opcode("assignToHash",e[i].key);this.opcode("popHash")},opcode:function(t){this.opcodes.push({opcode:t,args:h.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(t){t&&(this.useDepths=!0)},classifySexpr:function(t){var e=a.default.helpers.simpleId(t.path),i=e&&!!this.blockParamIndex(t.path.parts[0]),s=!i&&a.default.helpers.helperExpression(t),r=!i&&(s||e);if(r&&!s){var n=t.path.parts[0],o=this.options;o.knownHelpers[n]?s=!0:o.knownHelpersOnly&&(r=!1)}return s?"helper":r?"ambiguous":"simple"},pushParams:function(t){for(var e=0,i=t.length;e<i;e++)this.pushParam(t[e])},pushParam:function(t){var e=null!=t.value?t.value:t.original||"";if(this.stringParams)e.replace&&(e=e.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",e,t.type),"SubExpression"===t.type&&this.accept(t);else{if(this.trackIds){var i=void 0;if(!t.parts||a.default.helpers.scopedId(t)||t.depth||(i=this.blockParamIndex(t.parts[0])),i){var s=t.parts.slice(1).join(".");this.opcode("pushId","BlockParam",i,s)}else(e=t.original||e).replace&&(e=e.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",t.type,e)}this.accept(t)}},setupFullMustacheParams:function(t,e,i,s){var r=t.params;return this.pushParams(r),this.opcode("pushProgram",e),this.opcode("pushProgram",i),t.hash?this.accept(t.hash):this.opcode("emptyHash",s),r},blockParamIndex:function(t){for(var e=0,i=this.options.blockParams.length;e<i;e++){var s=this.options.blockParams[e],r=s&&o.indexOf(s,t);if(s&&r>=0)return[e,r]}}}},function(t,e,i){t.exports={default:i(48),__esModule:!0}},function(t,e,i){var s=i(9);t.exports=function(t,e){return s.create(t,e)}},function(t,e,i){"use strict";var s=i(13).default,r=i(1).default;e.__esModule=!0;var n=i(4),o=r(i(6)),a=i(5),h=r(i(50)),l=i(28);function u(t){this.value=t}function c(){}c.prototype={nameLookup:function(t,e){return l.dangerousPropertyRegex.test(e)?["(",[this.aliasable("container.propertyIsEnumerable"),".call(",t,",",JSON.stringify(e),")"],"?",i()," : undefined)"]:i();function i(){return c.isValidJavaScriptVariableName(e)?[t,".",e]:[t,"[",JSON.stringify(e),"]"]}},depthedLookup:function(t){return[this.aliasable("container.lookup"),'(depths, "',t,'")']},compilerInfo:function(){var t=n.COMPILER_REVISION;return[t,n.REVISION_CHANGES[t]]},appendToBuffer:function(t,e,i){return a.isArray(t)||(t=[t]),t=this.source.wrap(t,e),this.environment.isSimple?["return ",t,";"]:i?["buffer += ",t,";"]:(t.appendToBuffer=!0,t)},initializeBuffer:function(){return this.quotedString("")}
vendor: 3,350 bytes, line 28
28,compile:function(t,e,i,s){this.environment=t,this.options=e,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!s,this.name=this.environment.name,this.isChild=!!i,this.context=i||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(t,e),this.useDepths=this.useDepths||t.useDepths||t.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||t.useBlockParams;var r=t.opcodes,n=void 0,a=void 0,h=void 0,l=void 0;for(h=0,l=r.length;h<l;h++)n=r[h],this.source.currentLocation=n.loc,a=a||n.loc,this[n.opcode].apply(this,n.args);if(this.source.currentLocation=a,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new o.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend("var decorators = container.decorators;\n"),this.decorators.push("return fn;"),s?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var u=this.createFunctionContext(s);if(this.isChild)return u;var c={compiler:this.compilerInfo(),main:u};this.decorators&&(c.main_d=this.decorators,c.useDecorators=!0);var p=this.context,d=p.programs,f=p.decorators;for(h=0,l=d.length;h<l;h++)d[h]&&(c[h]=d[h],f[h]&&(c[h+"_d"]=f[h],c.useDecorators=!0));return this.environment.usePartial&&(c.usePartial=!0),this.options.data&&(c.useData=!0),this.useDepths&&(c.useDepths=!0),this.useBlockParams&&(c.useBlockParams=!0),this.options.compat&&(c.compat=!0),s?c.compilerOptions=this.options:(c.compiler=JSON.stringify(c.compiler),this.source.currentLocation={start:{line:1,column:0}},c=this.objectLiteral(c),e.srcName?(c=c.toStringWithSourceMap({file:e.destName})).map=c.map&&c.map.toString():c=c.toString()),c},preamble:function(){this.lastContext=0,this.source=new h.default(this.options.srcName),this.decorators=new h.default(this.options.srcName)},createFunctionContext:function(t){var e=this,i="",r=this.stackVars.concat(this.registers.list);r.length>0&&(i+=", "+r.join(", "));var n=0;s(this.aliases).forEach(function(t){var s=e.aliases[t];s.children&&s.referenceCount>1&&(i+=", alias"+ ++n+"="+t,s.children[0]="alias"+n)});var o=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&o.push("blockParams"),this.useDepths&&o.push("depths");var a=this.mergeSource(i);return t?(o.push(a),Function.apply(this,o)):this.source.wrap(["function(",o.join(","),") {\n ",a,"}"])},mergeSource:function(t){var e=this.environment.isSimple,i=!this.forceBuffer,s=void 0,r=void 0,n=void 0,o=void 0;return this.source.each(function(t){t.appendToBuffer?(n?t.prepend(" + "):n=t,o=t):(n&&(r?n.prepend("buffer += "):s=!0,o.add(";"),n=o=void 0),r=!0,e||(i=!1))}),i?n?(n.prepend("return "),o.add(";")):r||this.source.push('return "";'):(t+=", buffer = "+(s?"":this.initializeBuffer()),n?(n.prepend("return buffer + "),o.add(";")):this.source.push("return buffer;
28")),t&&this.source.prepend("var "+t.substring(2)+(s?"":";\n")),this.source.merge()},blockValue:function(t){var e=this.aliasable("container.hooks.blockHelperMissing"),i=[this.contextName(0)];this.setupHelperArgs(t,0,i);var s=this.popStack();i.splice(1,0,s),this.push(this.source.functionCall(e,"call",i))},ambiguousBlockValue:function(){var t=this.aliasable("container.hooks.blockHelperMissing"),e=[this.contextName(0)];this.setupHelperArgs("",0,e,!0),this.flushInline();var i=this.topStack();e.splice(1,0,i),this.pushSource(["if (!",this.lastHelper,") { ",i," = ",this.source.functionCall(t,"call",e),"}"])},appendContent:function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},append:function(){if(this.isInline())this.replaceStack(function(t){return[" != null ? ",t,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(t){this.lastContext=t},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(t,e,i,s){var r=0;s||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(t[r++])),this.resolvePath("context",t,r,e,i)},lookupBlockParam:function(t,e){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",e,1)},lookupData:function(t,e,i){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",e,0,!0,i)},resolvePath:function(t,e,i,s,r){var n=this;if(this.options.strict||this.options.assumeObjects)this.push(function(t,e,i,s){var r=e.popStack(),n=0,o=i.length;for(t&&o--;n<o;n++)r=e.nameLookup(r,i[n],s);return t?[e.aliasable("container.strict"),"(",r,", ",e.quotedString(i[n]),", ",JSON.stringify(e.source.currentLocation)," )"]:r}(this.options.strict&&r,this,e,t));else for(var o=e.length;i<o;i++)this.replaceStack(function(r){var o=n.nameLookup(r,e[i],t);return s?[" && ",o]:[" != null ? ",o," : ",r]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(t,e){this.pushContext(),this.pushString(e),"SubExpression"!==e&&("string"==typeof t?this.pushString(t):this.pushStackLiteral(t))},emptyHash:function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},pushString:function(t){this.pushStackLiteral(this.quotedString(t))},pushLiteral:function(t){this.pushStackLiteral(t)},pushProgram:function(t){null!=t?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},registerDecorator:function(t,e){var i=this.nameLookup("decorators",e,"decorator"),s=this.setupHelperArgs(e,t);this.decorators.push(["fn = ",this.decorators.functionCall(i,"",["fn","props","container",s])," || fn;"])},invokeHelper:function(t,e,i){var s=this.popStack(),r=this.setupHelper(t,e),n=[];i&&n.push(r.name),n.push(s),this.options.strict||n.push(this.aliasable("container.hooks.helperMissing"));var o=["(",this.itemsSeparatedBy(n,"||"),")"],a=this.source.functionCall(o,"call",r.callParams);this.push(a)},itemsSeparatedBy:function(t,e){var i=[];i.push(t[0]);for(var s=1;s<t.length;s++)i.push(e,t[s]);return i},invokeKnownHelper:function(t,e){var i=this.setupHelper(t,e);this.push(this.source.functionCall(i.name,"call",i.callParams))},invokeAmbiguous:function(t,e){this.useRegister("helper");var i=this.popStack();this.emptyHash();var s=this.setupHelper(0,t,e),r=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",t,"helper")," || ",i,")"];this.options.strict||(r[0]="(helper = ",r.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",r,s.paramsInit?["),(",s.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",s.callParams)," : helper))"])}
vendor: 4,328 bytes, line 28
28,invokePartial:function(t,e,i){var s=[],r=this.setupParams(e,1,s);t&&(e=this.popStack(),delete r.name),i&&(r.indent=JSON.stringify(i)),r.helpers="helpers",r.partials="partials",r.decorators="container.decorators",t?s.unshift(e):s.unshift(this.nameLookup("partials",e,"partial")),this.options.compat&&(r.depths="depths"),r=this.objectLiteral(r),s.push(r),this.push(this.source.functionCall("container.invokePartial","",s))},assignToHash:function(t){var e=this.popStack(),i=void 0,s=void 0,r=void 0;this.trackIds&&(r=this.popStack()),this.stringParams&&(s=this.popStack(),i=this.popStack());var n=this.hash;i&&(n.contexts[t]=i),s&&(n.types[t]=s),r&&(n.ids[t]=r),n.values[t]=e},pushId:function(t,e,i){"BlockParam"===t?this.pushStackLiteral("blockParams["+e[0]+"].path["+e[1]+"]"+(i?" + "+JSON.stringify("."+i):"")):"PathExpression"===t?this.pushString(e):"SubExpression"===t?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:c,compileChildren:function(t,e){for(var i=t.children,s=void 0,r=void 0,n=0,o=i.length;n<o;n++){s=i[n],r=new this.compiler;var a=this.matchExistingProgram(s);if(null==a){this.context.programs.push("");var h=this.context.programs.length;s.index=h,s.name="program"+h,this.context.programs[h]=r.compile(s,e,this.context,!this.precompile),this.context.decorators[h]=r.decorators,this.context.environments[h]=s,this.useDepths=this.useDepths||r.useDepths,this.useBlockParams=this.useBlockParams||r.useBlockParams,s.useDepths=this.useDepths,s.useBlockParams=this.useBlockParams}else s.index=a.index,s.name="program"+a.index,this.useDepths=this.useDepths||a.useDepths,this.useBlockParams=this.useBlockParams||a.useBlockParams}},matchExistingProgram:function(t){for(var e=0,i=this.context.environments.length;e<i;e++){var s=this.context.environments[e];if(s&&s.equals(t))return s}},programExpression:function(t){var e=this.environment.children[t],i=[e.index,"data",e.blockParams];return(this.useBlockParams||this.useDepths)&&i.push("blockParams"),this.useDepths&&i.push("depths"),"container.program("+i.join(", ")+")"},useRegister:function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},push:function(t){return t instanceof u||(t=this.source.wrap(t)),this.inlineStack.push(t),t},pushStackLiteral:function(t){this.push(new u(t))},pushSource:function(t){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),t&&this.source.push(t)},replaceStack:function(t){var e=["("],i=void 0,s=void 0,r=void 0;if(!this.isInline())throw new o.default("replaceStack on non-inline");var n=this.popStack(!0);if(n instanceof u)e=["(",i=[n.value]],r=!0;else{s=!0;var a=this.incrStack();e=["((",this.push(a)," = ",n,")"],i=this.topStack()}var h=t.call(this,i);r||this.popStack(),s&&this.stackSlot--,this.push(e.concat(h,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var t=this.inlineStack;this.inlineStack=[];for(var e=0,i=t.length;e<i;e++){var s=t[e];if(s instanceof u)this.compileStack.push(s);else{var r=this.incrStack();this.pushSource([r," = ",s,";"]),this.compileStack.push(r)}}},isInline:function(){return this.inlineStack.length},popStack:function(t){var e=this.isInline(),i=(e?this.inlineStack:this.compileStack).pop();if(!t&&i instanceof u)return i.value;if(!e){if(!this.stackSlot)throw new o.default("Invalid stack pop");this.stackSlot--}return i},topStack:function(){var t=this.isInline()?this.inlineStack:this.compileStack,e=t[t.length-1];return e instanceof u?e.value:e},contextName:function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},quotedString:function(t){return this.source.quotedString(t)},objectLiteral:function(t){return this.source.objectLiteral(t)},aliasable:function(t){var e=this.aliases[t];return e?(e.referenceCount++,e):((e=this.aliases[t]=this.source.wrap(t)).aliasable=!0,e.referenceCount=1,e)},setupHelper:function(t,e,i){var s=[];return{params:s,paramsInit:this.setupHelperArgs(e,t,s,i),name:this.nameLookup("helpers",e,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(s)}}
vendor: 3,546 bytes, line 28
28,setupParams:function(t,e,i){var s={},r=[],n=[],o=[],a=!i,h=void 0;a&&(i=[]),s.name=this.quotedString(t),s.hash=this.popStack(),this.trackIds&&(s.hashIds=this.popStack()),this.stringParams&&(s.hashTypes=this.popStack(),s.hashContexts=this.popStack());var l=this.popStack(),u=this.popStack();(u||l)&&(s.fn=u||"container.noop",s.inverse=l||"container.noop");for(var c=e;c--;)h=this.popStack(),i[c]=h,this.trackIds&&(o[c]=this.popStack()),this.stringParams&&(n[c]=this.popStack(),r[c]=this.popStack());return a&&(s.args=this.source.generateArray(i)),this.trackIds&&(s.ids=this.source.generateArray(o)),this.stringParams&&(s.types=this.source.generateArray(n),s.contexts=this.source.generateArray(r)),this.options.data&&(s.data="data"),this.useBlockParams&&(s.blockParams="blockParams"),s},setupHelperArgs:function(t,e,i,s){var r=this.setupParams(t,e,i);return r.loc=JSON.stringify(this.source.currentLocation),r=this.objectLiteral(r),s?(this.useRegister("options"),i.push("options"),["options=",r]):i?(i.push(r),""):r}},function(){for(var t="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),e=c.RESERVED_WORDS={},i=0,s=t.length;i<s;i++)e[t[i]]=!0}(),c.isValidJavaScriptVariableName=function(t){return!c.RESERVED_WORDS[t]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t)},e.default=c,t.exports=e.default},function(t,e,i){"use strict";var s=i(13).default;e.__esModule=!0;var r=i(5),n=void 0;function o(t,e,i){if(r.isArray(t)){for(var s=[],n=0,o=t.length;n<o;n++)s.push(e.wrap(t[n],i));return s}return"boolean"==typeof t||"number"==typeof t?t+"":t}function a(t){this.srcFile=t,this.source=[]}n||((n=function(t,e,i,s){this.src="",s&&this.add(s)}).prototype={add:function(t){r.isArray(t)&&(t=t.join("")),this.src+=t},prepend:function(t){r.isArray(t)&&(t=t.join("")),this.src=t+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),a.prototype={isEmpty:function(){return!this.source.length},prepend:function(t,e){this.source.unshift(this.wrap(t,e))},push:function(t,e){this.source.push(this.wrap(t,e))},merge:function(){var t=this.empty();return this.each(function(e){t.add([" ",e,"\n"])}),t},each:function(t){for(var e=0,i=this.source.length;e<i;e++)t(this.source[e])},empty:function(){var t=this.currentLocation||{start:{}};return new n(t.start.line,t.start.column,this.srcFile)},wrap:function(t){var e=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return t instanceof n?t:(t=o(t,this,e),new n(e.start.line,e.start.column,this.srcFile,t))},functionCall:function(t,e,i){return i=this.generateList(i),this.wrap([t,e?"."+e+"(":"(",i,")"])},quotedString:function(t){return'"'+(t+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(t){var e=this,i=[];s(t).forEach(function(s){var r=o(t[s],e);"undefined"!==r&&i.push([e.quotedString(s),":",r])});var r=this.generateList(i);return r.prepend("{"),r.add("}"),r},generateList:function(t){for(var e=this.empty(),i=0,s=t.length;i<s;i++)i&&e.add(","),e.add(o(t[i],this));return e},generateArray:function(t){var e=this.generateList(t);
28return e.prepend("["),e.add("]"),e}},e.default=a,t.exports=e.default}])},t.exports=s()},function(t,e,s){"use strict";s.r(e);var r={};s.r(r),s.d(r,"base64Chars",function(){return h}),s.d(r,"base64lookup",function(){return c}),s.d(r,"b64encTypesArray",function(){return p}),s.d(r,"b64decTypedArray",function(){return d});var n={};s.r(n),s.d(n,"shuffleArray",function(){return v}),s.d(n,"shortId",function(){return y}),s.d(n,"uuid",function(){return A}),s.d(n,"generateUUID",function(){return x}),s.d(n,"simpleId",function(){return I}),s.d(n,"smoothStep",function(){return O}),s.d(n,"smootherStep",function(){return S}),s.d(n,"map",function(){return R}),s.d(n,"cacheBust",function(){return N}),s.d(n,"jsonp",function(){return M}),s.d(n,"ajaxSync",function(){return F}),s.d(n,"ajax",function(){return C}),s.d(n,"request",function(){return w}),s.d(n,"UTILS",function(){return m});var o={};s.r(o),s.d(o,"easeExpoIn",function(){return G}),s.d(o,"easeExpoOut",function(){return H}),s.d(o,"easeExpoInOut",function(){return W}),s.d(o,"easeCubicIn",function(){return Y}),s.d(o,"easeCubicOut",function(){return z}),s.d(o,"easeCubicInOut",function(){return K}),s.d(o,"ANIM",function(){return V}),s.d(o,"Anim",function(){return X}),s.d(o,"TL",function(){return j});var a={};s.r(a),s.d(a,"togglePacoRenderer",function(){return Bt}),s.d(a,"showPacoRenderer",function(){return Ut}),s.d(a,"PatchConnectionReceiver",function(){return Dt}),s.d(a,"PatchConnectionSender",function(){return Vt}),s.d(a,"PatchConnectorBroadcastChannel",function(){return Gt});const h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=new Uint8Array(256);for(var u=0;u<h.length;u++)l[h.charCodeAt(u)]=u;const c=l,p=function(t){t.buffer&&(t=t.buffer);var e,i=new Uint8Array(t),s=i.length,r="";for(e=0;e<s;e+=3)r+=h[i[e]>>2],r+=h[(3&i[e])<<4|i[e+1]>>4],r+=h[(15&i[e+1])<<2|i[e+2]>>6],r+=h[63&i[e+2]];return s%3==2?r=r.substring(0,r.length-1)+"=":s%3==1&&(r=r.substring(0,r.length-2)+"=="),r},d=function(t){var e,i,s,r,n,o=.75*t.length,a=t.length,h=0;"="===t[t.length-1]&&(o--,"="===t[t.length-2]&&o--);var l=new ArrayBuffer(o),u=new Uint8Array(l);for(e=0;e<a;e+=4)i=c[t.charCodeAt(e)],s=c[t.charCodeAt(e+1)],r=c[t.charCodeAt(e+2)],n=c[t.charCodeAt(e+3)],u[h++]=i<<2|s>>4,u[h++]=(15&s)<<4|r>>2,u[h++]=(3&r)<<6|63&n;return l};var f=!1;const g={log:function(){if(f)return;const t=["[core]"];t.push.apply(t,arguments),Function.prototype.apply.apply(console.log,[console,t])},warn:function(t){if(!f){var e=["[core]"];e.push.apply(e,arguments),Function.prototype.apply.apply(console.warn,[console,e])}},error:function(t){var e=["[core]"];e.push.apply(e,arguments),Function.prototype.apply.apply(console.error,[console,e])},setSilent:function(t){f=t}},_=function(){this._eventCallbacks={},this._logName="",this._log=!1,this.addEventListener=this.on=function(t,e){this._eventCallbacks[t]?this._eventCallbacks[t].push(e):this._eventCallbacks[t]=[e]},this.hasEventListener=function(t,e){if(t&&e){if(this._eventCallbacks[t])return-1!=this._eventCallbacks[t].indexOf(e)}else g.warn("hasListener: missing parameters")},this.removeEventListener=function(t,e){if(this._eventCallbacks[t]){var i=this._eventCallbacks[t].indexOf(e);-1==i?g.warn("eventlistener "+t+" not found..."):this._eventCallbacks[t].splice(i)}},this.logEvents=function(t,e){this._log=t,this._logName=e},this.emitEvent=function(t,e,i,s,r,n,o){if(this._log&&console.log("[event] ",this._logName,t,this._eventCallbacks),this._eventCallbacks[t])for(var a=0;a<this._eventCallbacks[t].length;a++)this._eventCallbacks[t][a]&&this._eventCallbacks[t][a](e,i,s,r,n,o)}},m={float32Concat:function(t,e){t instanceof Float32Array||(t=new Float32Array(t)),e instanceof Float32Array||(e=new Float32Array(e));var i=t.length,s=new Float32Array(i+e.length);return s.set(t),s.set(e,i),s}},v=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.seededRandom()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t},E={},b=function(){const t=Math.random().toString(36).substr(2,9);return E.hasOwnProperty(t)&&(t=b()),E[t]=!0,t},y=b,T=function(){var t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?i:3&i|8).toString(16)})},A=T,x=T;var P=0;const I=function(){return++P},O=function(t){var e=Math.max(0,Math.min(1,(t-0)/1));return t=e*e*(3-2*e)},S=function(t){var e=Math.max(0,Math.min(1,(t-0)/1));return t=e*e*e*(e*(6*e-15)+10)}
28,R=function(t,e,i,s,r,n){if(t>=i)return r;if(t<=e)return s;var o=!1,a=Math.min(e,i),h=Math.max(e,i);a!=e&&(o=!0);var l=!1,u=Math.min(s,r),c=Math.max(s,r);u!=s&&(l=!0);var p=0,d=0;return p=o?(h-t)*(c-u)/(h-a):(t-a)*(c-u)/(h-a),d=l?c-p:p+u,n?1==n?s+(t=Math.max(0,Math.min(1,(d-s)/(r-s))))*t*(3-2*t)*(r-s):2==n?s+(t=Math.max(0,Math.min(1,(d-s)/(r-s))))*t*t*(t*(6*t-15)+10)*(r-s):d:d};Math.randomSeed=1,Math.seededRandom=function(t,e){return 0===Math.randomSeed&&(Math.randomSeed=999*Math.random()),t=t||1,e=e||0,Math.randomSeed=(9301*Math.randomSeed+49297)%233280,e+Math.randomSeed/233280*(t-e)},m.arrayWriteToEnd=function(t,e){for(var i=1;i<t.length;i++)t[i-1]=t[i];t[t.length-1]=e},m.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},m.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},String.prototype.endl=function(){return this+"\n"},String.prototype.startsWith=function(t){return 0===this.indexOf(t)},String.prototype.endsWith=function(t){return this.match(t+"$")==t};const N=function(t){return t.indexOf("?")>-1?t+="&":t+="?",t+"cb="+CABLES.uuid()};var k=null;const M=function(t,e){k=k||0;var i=++k;CABLES["jsonpFunc"+i]=function(t){e(!1,t)};var s="?";t.indexOf(s)>-1&&(s="&");var r=document.createElement("script");r.setAttribute("src",t+s+"callback=CABLES.jsonpFunc"+i),document.body.appendChild(r)},F=function(t,e,i,s,r){w({url:t,cb:e,method:i,data:s,contenttype:r,sync:!0})},C=function(t,e,i,s,r,n,o={}){w({url:t,cb:e,method:i,"data:":s,contenttype:r,sync:!1,jsonp:n,headers:o})},w=function(t){var e;t.hasOwnProperty("asynch")||(t.asynch=!0);try{e=new XMLHttpRequest}catch(t){}if(e.onreadystatechange=function(){4==e.readyState&&t.cb&&(200==e.status||0==e.status?t.cb(!1,e.responseText,e):t.cb(!0,e.responseText,e))},e.addEventListener("progress",t=>{}),e.open(t.method?t.method.toUpperCase():"GET",t.url,!t.sync),"object"==typeof t.headers){const i=Object.keys(t.headers);for(let s=0;s<i.length;s++){const r=i[s],n=t.headers[r];e.setRequestHeader(r,n)}}t.post||t.data?(e.setRequestHeader("Content-type",t.contenttype?t.contenttype:"application/x-www-form-urlencoded"),e.send(t.data||t.post)):e.send()};window.performance=window.performance||{offset:Date.now(),now:function(){return Date.now()-this.offset}};const L={ANIM:{EASINGS:["linear","absolute","smoothstep","smootherstep","Cubic In","Cubic Out","Cubic In Out","Expo In","Expo Out","Expo In Out","Sin In","Sin Out","Sin In Out","Quart In","Quart Out","Quart In Out","Quint In","Quint Out","Quint In Out","Back In","Back Out","Back In Out","Elastic In","Elastic Out","Elastic In Out","Bounce In","Bounce Out"],EASING_LINEAR:0,EASING_ABSOLUTE:1,EASING_SMOOTHSTEP:2,EASING_SMOOTHERSTEP:3,EASING_BEZIER:4,EASING_CUBIC_IN:5,EASING_CUBIC_OUT:6,EASING_CUBIC_INOUT:7,EASING_EXPO_IN:8,EASING_EXPO_OUT:9,EASING_EXPO_INOUT:10,EASING_SIN_IN:11,EASING_SIN_OUT:12,EASING_SIN_INOUT:13,EASING_BACK_IN:14,EASING_BACK_OUT:15,EASING_BACK_INOUT:16,EASING_ELASTIC_IN:17,EASING_ELASTIC_OUT:18,EASING_BOUNCE_IN:19,EASING_BOUNCE_OUT:21,EASING_QUART_IN:22,EASING_QUART_OUT:23,EASING_QUART_INOUT:24,EASING_QUINT_IN:25,EASING_QUINT_OUT:26,EASING_QUINT_INOUT:27},OP:{OP_PORT_TYPE_VALUE:0,OP_PORT_TYPE_FUNCTION:1,OP_PORT_TYPE_OBJECT:2,OP_PORT_TYPE_TEXTURE:2,OP_PORT_TYPE_ARRAY:3,OP_PORT_TYPE_DYNAMIC:4,OP_PORT_TYPE_STRING:5,OP_VERSION_PREFIX:"_v"},PORT:{PORT_DIR_IN:0,PORT_DIR_OUT:1},PACO:{PACO_CLEAR:0,PACO_VALUECHANGE:1,PACO_OP_DELETE:2,PACO_UNLINK:3,PACO_LINK:4,PACO_LOAD:5,PACO_OP_CREATE:6,PACO_OP_ENABLE:7,PACO_OP_DISABLE:8}},B=function(t,e,i,s){_.apply(this),this.data={},this.direction=L.PORT.PORT_DIR_IN,this.id=x(),this.parent=t,this.links=[],this.value=0,this.name=e,this.type=i||L.OP.OP_PORT_TYPE_VALUE,this.uiAttribs=s||{},this.anim=null,this._oldAnimVal=-5711,this.defaultValue=null,this._uiActiveState=!0,this.ignoreValueSerialize=!1,this.onLinkChanged=null,this.crashed=!1,this._valueBeforeLink=null,this._lastAnimFrame=-1,this._animated=!1,this.onValueChanged=null,this.onTriggered=null,this.onUiActiveStateChange=null,this.changeAlways=!1,this._warnedDeprecated=!1,this._useVariableName=null,Object.defineProperty(this,"val",{get(){return this._warnedDeprecated=!0,this.get()},set(t){this.setValue(t),this._warnedDeprecated=!0}})};B.prototype.onAnimToggle=function(){},B.prototype._onAnimToggle=function(){this.onAnimToggle()},B.prototype.hidePort=function(){this.setUiAttribs({hidePort:!0})},B.prototype.remove=function(){this.removeLinks(),this.parent.removePort(this)},B.prototype.setUiAttribs=function(t){for(var e in this.uiAttribs||(this.uiAttribs={}),t)this.uiAttribs[e]=t[e];this.emitEvent("onUiAttrChange",t)},B.prototype.getUiAttribs=function(){return this.uiAttribs},B.prototype.getUiAttrib=function(t){return this.uiAttribs&&this.uiAttribs.hasOwnProperty(t)?this.uiAttribs[t]:null},B.prototype.get=function(){return this._animated&&this._lastAnimFrame!=this.parent.patch.getFrameNum()&&
28(this._lastAnimFrame=this.parent.patch.getFrameNum(),this.value=this.anim.getValue(this.parent.patch.timer.getTime()),this._oldAnimVal=this.value,this.forceChange()),this.value},B.prototype.set=B.prototype.setValue=function(t){if(void 0!==t&&this.parent.enabled&&!this.crashed&&(t!==this.value||this.changeAlways||this.type==L.OP.OP_PORT_TYPE_TEXTURE||this.type==L.OP.OP_PORT_TYPE_ARRAY)){if(this._animated)this.anim.setValue(this.parent.patch.timer.getTime(),t);else{try{this.value=t,this.forceChange()}catch(t){this.crashed=!0,this.setValue=function(t){},this.onTriggered=function(){},console.error("onvaluechanged exception cought",t),g.log(t.stack),g.log("exception in: "+this.parent.name),this.parent.patch.isEditorMode()&&gui.showOpCrash(this.parent),this.parent.patch.emitEvent("exception".ex,this.parent)}this.parent.patch.isEditorMode()&&this.type==L.OP.OP_PORT_TYPE_TEXTURE&&gui.texturePreview().updateTexturePort(this)}if(this.direction==L.PORT.PORT_DIR_OUT)for(var e=0;e<this.links.length;++e)this.links[e].setValue()}},B.prototype.updateAnim=function(){this._animated&&(this.value=this.get(),(this._oldAnimVal!=this.value||this.changeAlways)&&(this._oldAnimVal=this.value,this.forceChange()),this._oldAnimVal=this.value)},B.args=function(t){return(t+"").replace(/[\/][\/].*$/gm,"").replace(/\s+/g,"").replace(/[\/][*][^\/*]*[*][\/]/g,"").split("){",1)[0].replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean)},B.prototype.forceChange=function(){this.onValueChanged||this.onChange,this.onChange?this.onChange(this,this.value):this.onValueChanged&&this.onValueChanged(this,this.value)},B.prototype.getTypeString=function(){return this.type==L.OP.OP_PORT_TYPE_VALUE?"Number":this.type==L.OP.OP_PORT_TYPE_FUNCTION?"Trigger":this.type==L.OP.OP_PORT_TYPE_OBJECT?"Object":this.type==L.OP.OP_PORT_TYPE_DYNAMIC?"Dynamic":this.type==L.OP.OP_PORT_TYPE_ARRAY?"Array":this.type==L.OP.OP_PORT_TYPE_STRING?"String":"Unknown"},B.prototype.getSerialized=function(){var t={};if(t.name=this.getName(),this.ignoreValueSerialize||0!==this.links.length||this.type==L.OP.OP_PORT_TYPE_OBJECT&&this.value&&this.value.tex||(t.value=this.value),this._useVariableName&&(t.useVariable=this._useVariableName),this._animated&&(t.animated=!0),this.anim&&(t.anim=this.anim.getSerialized()),"file"==this.uiAttribs.display&&(t.display=this.uiAttribs.display),this.direction==L.PORT.PORT_DIR_IN&&this.links.length>0)for(var e in t.links=[],this.links)this.links[e].portIn&&this.links[e].portOut&&t.links.push(this.links[e].getSerialized());return t},B.prototype.shouldLink=function(){return!0},B.prototype.removeLinks=function(){for(var t=0;this.links.length>0;){if(++t>5e3){console.warn("could not delete links... / infinite loop"),this.links.length=0;break}this.links[0].remove()}},B.prototype.removeLink=function(t){for(var e in this.links)this.links[e]==t&&this.links.splice(e,1);this.direction==L.PORT.PORT_DIR_IN&&(this.type==L.OP.OP_PORT_TYPE_VALUE?this.setValue(this._valueBeforeLink||0):this.setValue(this._valueBeforeLink||null)),this.onLinkChanged&&this.onLinkChanged(),this.emitEvent("onLinkChanged")},B.prototype.getName=function(){return this.name},B.prototype.addLink=function(t){this._valueBeforeLink=this.value,this.links.push(t),this.onLinkChanged&&this.onLinkChanged(),this.emitEvent("onLinkChanged")},B.prototype.getLinkTo=function(t){for(var e in this.links)if(this.links[e].portIn==t||this.links[e].portOut==t)return this.links[e]},B.prototype.removeLinkTo=function(t){for(var e in this.links)if(this.links[e].portIn==t||this.links[e].portOut==t)return this.links[e].remove(),this.onLinkChanged&&this.onLinkChanged(),void this.emitEvent("onLinkChanged")},B.prototype.isLinkedTo=function(t){for(var e in this.links)if(this.links[e].portIn==t||this.links[e].portOut==t)return!0;return!1},B.prototype.trigger=function(){if(0!==this.links.length&&this.parent.enabled){var t=null;try{for(var e=0;e<this.links.length;++e)this.links[e].portIn&&(t=this.links[e].portIn)._onTriggered(),this.links[e]&&this.links[e].activity()}catch(e){this.parent.enabled=!1,this.parent.patch.isEditorMode()&&(this.parent.patch.emitEvent("exception".ex,t.parent),window.gui&&gui.showOpCrash(t.parent)),g.log("exception!"),console.error("ontriggered exception cought",e),g.log(e.stack),g.log("exception in: "+t.parent.name)}}},B.prototype.call=function(){g.log("call deprecated - use trigger() "),this.trigger()},B.prototype.execute=function(){g.log("### execute port: "+this.getName(),this.goals.length)},B.prototype.setVariableName=function(t){this._useVariableName=t},B.prototype.getVariableName=function(){return this._useVariableName},B.prototype.setVariable=function(t){this.setAnimated(!1);var e={useVariable:!1};this._variableIn&&(this._variableIn.removeListener(this.set.bind(this)),this._variableIn=null),t?(this._variableIn=this.parent.patch.getVar(t),this._variableIn?(this._variableIn.addListener(this.set.bind(this)),this.set(this._variableIn.getValue())):console.log("PORT VAR NOT FOUND!!!"),this._useVariableName=t,e.useVariable=!0,e.variableName=this._useVariableName):(e.variableName=this._useVariableName=null,e.useVariable=!1),this.setUiAttribs(e)},B.prototype.setAnimated=function(t){this._animated!=t&&(this._animated=t,this._animated&&!this.anim&&(this.anim=new X),this._onAnimToggle()),this.setUiAttribs({isAnimated:this._animated})},B.prototype.toggleAnim=function(t){this._animated=!this._animated,this._animated&&!this.anim&&(this.anim=new X),this.setAnimated(this._animated),this._onAnimToggle(),this.setUiAttribs({isAnimated:this._animated})},B.prototype.getType=function(){return this.type},B.prototype.isLinked=function(){return this.links.length>0},B.prototype.isBoundToVar=function(){return null!=this._useVariableName},B.prototype.isAnimated=function(){return this._animated},B.prototype.isHidden=function(){return this.uiAttribs.hidePort},B.prototype._onTriggered=function(){this.parent.updateAnims(),this.parent.enabled&&this.onTriggered&&this.onTriggered()},B.prototype._onSetProfiling=function(t){this.parent.patch.profiler.add("port",this),this.setValue(t),this.parent.patch.profiler.add("port",null)},B.prototype._onTriggeredProfiling=function(){this.parent.patch.profiler.add("port",this),this.parent.enabled&&this.onTriggered&&this.onTriggered(),this.parent.patch.profiler.add("port",null)},B.prototype.onValueChange=function(t){this.onChange=t},B.prototype.getUiActiveState=function(){return this._uiActiveState},B.prototype.setUiActiveState=function(t){this._uiActiveState=t,this.onUiActiveStateChange&&this.onUiActiveStateChange()},B.portTypeNumberToString=function(t){return t==L.OP.OP_PORT_TYPE_VALUE?"value":t==L.OP.OP_PORT_TYPE_FUNCTION?"function":t==L.OP.OP_PORT_TYPE_OBJECT?"object":t==L.OP.OP_PORT_TYPE_ARRAY?"array":t==L.OP.OP_PORT_TYPE_STRING?"string":t==L.OP.OP_PORT_TYPE_DYNAMIC?"dynamic":"unknown"};class U extends B{constructor(t,e,i,s,r){super(t,e,i,s),r.set=t=>{const e=s.values;if(!e)return void console.log("has no values");let i=Math.floor(t);i=Math.min(i,e.length-1),i=Math.max(i,0),r.setValue(i),this.set(e[i]),this.parent.patch.isEditorMode()&&window.gui&&gui.patch().isCurrentOp(this.parent)&&gui.patch().showOpParams(this.parent)}}}class D extends U{}const V={Key:function(t){this.time=0,this.value=0,this.ui={},this.onChange=null,this._easing=0,this.bezTime=.5,this.bezValue=0,this.bezTimeIn=-.5,this.bezValueIn=0,this.cb=null,this.cbTriggered=!1;this._updateBezier=!1,this.setEasing(L.ANIM.EASING_LINEAR),this.set(t)}};
28V.Key.linear=function(t,e,i){return parseFloat(e.value)+parseFloat(i.value-e.value)*t},V.Key.easeLinear=function(t,e){return V.Key.linear(t,this,e)},V.Key.easeAbsolute=function(t,e){return this.value};const G=function(t){return Math.pow(2,10*(t-1))};V.Key.easeExpoIn=function(t,e){return t=G(t),V.Key.linear(t,this,e)};const H=function(t){return t=1-Math.pow(2,-10*t)};V.Key.easeExpoOut=function(t,e){return t=H(t),V.Key.linear(t,this,e)};const W=function(t){return(t*=2)<1?t=.5*Math.pow(2,10*(t-1)):(t--,t=.5*(2-Math.pow(2,-10*t))),t};V.Key.easeExpoInOut=function(t,e){return t=W(t),V.Key.linear(t,this,e)},V.Key.easeSinIn=function(t,e){return t=-1*Math.cos(t*Math.PI/2)+1,V.Key.linear(t,this,e)},V.Key.easeSinOut=function(t,e){return t=Math.sin(t*Math.PI/2),V.Key.linear(t,this,e)},V.Key.easeSinInOut=function(t,e){return t=-.5*(Math.cos(Math.PI*t)-1),V.Key.linear(t,this,e)};const Y=function(t){return t*=t*t};V.Key.easeCubicIn=function(t,e){return t=Y(t),V.Key.linear(t,this,e)},V.Key.easeInQuint=function(t,e){return t*=t*t*t*t,V.Key.linear(t,this,e)},V.Key.easeOutQuint=function(t,e){return t=(t-=1)*t*t*t*t+1,V.Key.linear(t,this,e)},V.Key.easeInOutQuint=function(t,e){return(t/=.5)<1?t*=.5*t*t*t*t:t=.5*((t-=2)*t*t*t*t+2),V.Key.linear(t,this,e)},V.Key.easeInQuart=function(t,e){return t*=t*t*t,V.Key.linear(t,this,e)},V.Key.easeOutQuart=function(t,e){return t=-1*((t-=1)*t*t*t-1),V.Key.linear(t,this,e)},V.Key.easeInOutQuart=function(t,e){return(t/=.5)<1?t*=.5*t*t*t:t=-.5*((t-=2)*t*t*t-2),V.Key.linear(t,this,e)},V.Key.bounce=function(t){return(t/=1)<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,t},V.Key.easeInBounce=function(t,e){return V.Key.linear(V.Key.bounce(t),this,e)},V.Key.easeOutBounce=function(t,e){return V.Key.linear(V.Key.bounce(t),this,e)},V.Key.easeInElastic=function(t,e){var i=1.70158,s=0,r=1;return 0===t?t=0:1==(t/=1)?t=1:(s||(s=.3),r<Math.abs(1)?(r=1,i=s/4):i=s/(2*Math.PI)*Math.asin(1/r),t=-r*Math.pow(2,10*(t-=1))*Math.sin((1*t-i)*(2*Math.PI)/s)+0),V.Key.linear(t,this,e)},V.Key.easeOutElastic=function(t,e){var i=1.70158,s=0,r=1;return 0===t?t=0:1==(t/=1)?t=1:(s||(s=.3),r<Math.abs(1)?(r=1,i=s/4):i=s/(2*Math.PI)*Math.asin(1/r),t=r*Math.pow(2,-10*t)*Math.sin((1*t-i)*(2*Math.PI)/s)+1+0),V.Key.linear(t,this,e)},V.Key.easeInBack=function(t,e){var i=1.70158;return t=t*t*((i+1)*t-i),V.Key.linear(t,this,e)},V.Key.easeOutBack=function(t,e){var i=1.70158;return t=(t=t/1-1)*t*((i+1)*t+i)+1,V.Key.linear(t,this,e)},V.Key.easeInOutBack=function(t,e){var i=1.70158;return t=(t/=.5)<1?t*t*((1+(i*=1.525))*t-i)*.5:.5*((t-=2)*t*((1+(i*=1.525))*t+i)+2),V.Key.linear(t,this,e)};const z=function(t){return t=--t*t*t+1};V.Key.easeCubicOut=function(t,e){return t=z(t),V.Key.linear(t,this,e)};const K=function(t){return(t*=2)<1?t*=.5*t*t:t=.5*((t-=2)*t*t+2),t};V.Key.easeCubicInOut=function(t,e){return t=K(t),V.Key.linear(t,this,e)},V.Key.easeSmoothStep=function(t,e){var i=Math.max(0,Math.min(1,t));return t=i*i*(3-2*i),V.Key.linear(t,this,e)},V.Key.easeSmootherStep=function(t,e){var i=Math.max(0,Math.min(1,(t-0)/1));return t=i*i*i*(i*(6*i-15)+10),V.Key.linear(t,this,e)},V.Key.prototype.setEasing=function(t){this._easing=t,this._easing==L.ANIM.EASING_ABSOLUTE?this.ease=V.Key.easeAbsolute:this._easing==L.ANIM.EASING_SMOOTHSTEP?this.ease=V.Key.easeSmoothStep:this._easing==L.ANIM.EASING_SMOOTHERSTEP?this.ease=V.Key.easeSmootherStep:this._easing==L.ANIM.EASING_CUBIC_IN?this.ease=V.Key.easeCubicIn:this._easing==L.ANIM.EASING_CUBIC_OUT?this.ease=V.Key.easeCubicOut:this._easing==L.ANIM.EASING_CUBIC_INOUT?this.ease=V.Key.easeCubicInOut:this._easing==L.ANIM.EASING_EXPO_IN?this.ease=V.Key.easeExpoIn:this._easing==L.ANIM.EASING_EXPO_OUT?this.ease=V.Key.easeExpoOut:this._easing==L.ANIM.EASING_EXPO_INOUT?this.ease=V.Key.easeExpoInOut:this._easing==L.ANIM.EASING_SIN_IN?this.ease=V.Key.easeSinIn:this._easing==L.ANIM.EASING_SIN_OUT?this.ease=V.Key.easeSinOut:this._easing==L.ANIM.EASING_SIN_INOUT?this.ease=V.Key.easeSinInOut:this._easing==L.ANIM.EASING_BACK_OUT?this.ease=V.Key.easeOutBack:this._easing==L.ANIM.EASING_BACK_IN?this.ease=V.Key.easeInBack:this._easing==L.ANIM.EASING_BACK_INOUT?this.ease=V.Key.easeInOutBack:this._easing==L.ANIM.EASING_ELASTIC_IN?this.ease=V.Key.easeInElastic:this._easing==L.ANIM.EASING_ELASTIC_OUT?this.ease=V.Key.easeOutElastic:this._easing==L.ANIM.EASING_BOUNCE_IN?this.ease=V.Key.easeInBounce:this._easing==L.ANIM.EASING_BOUNCE_OUT?this.ease=V.Key.easeOutBounce:this._easing==L.ANIM.EASING_QUART_OUT?this.ease=V.Key.easeOutQuart:this._easing==L.ANIM.EASING_QUART_IN?this.ease=V.Key.easeInQuart:this._easing==L.ANIM.EASING_QUART_INOUT?this.ease=V.Key.easeInOutQuart:this._easing==L.ANIM.EASING_QUINT_OUT?this.ease=V.Key.easeOutQuint:this._easing==L.ANIM.EASING_QUINT_IN?this.ease=V.Key.easeInQuint:this._easing==L.ANIM.EASING_QUINT_INOUT?this.ease=V.Key.easeInOutQuint:this._easing==L.ANIM.EASING_BEZIER?(this._updateBezier=!0,this.ease=V.Key.easeBezier):(this._easing=L.ANIM.EASING_LINEAR,this.ease=V.Key.easeLinear)},V.Key.prototype.trigger=function(){this.cb(),this.cbTriggered=!0},V.Key.prototype.setValue=function(t){this.value=t,this._updateBezier=!0,null!==this.onChange&&this.onChange()},V.Key.prototype.set=function(t){t&&(t.e&&this.setEasing(t.e),t.cb&&(this.cb=t.cb,this.cbTriggered=!1),t.b&&(this.bezTime=t.b[0],this.bezValue=t.b[1],this.bezTimeIn=t.b[2],this.bezValueIn=t.b[3],this._updateBezier=!0),t.hasOwnProperty("t")&&(this.time=t.t),t.hasOwnProperty("time")&&(this.time=t.time),t.hasOwnProperty("v")?this.value=t.v:t.hasOwnProperty("value")&&(this.value=t.value)),null!==this.onChange&&this.onChange()},V.Key.prototype.getSerialized=function(){var t={};return t.t=this.time,t.v=this.value,t.e=this._easing,this._easing==L.ANIM.EASING_BEZIER&&(t.b=[this.bezTime,this.bezValue,this.bezTimeIn,this.bezValueIn]),t},V.Key.prototype.getEasing=function(){return this._easing};const X=function(t){this.keys=[],this.onChange=null,this.stayInTimeline=!1,this.loop=!1,this.defaultEasing=L.ANIM.EASING_LINEAR,this.onLooped=null,this._timesLooped=0,this._needsSort=!1};X.prototype.forceChangeCallback=function(){null!==this.onChange&&this.onChange()},X.prototype.hasEnded=function(t){return 0===this.keys.length||this.keys[this.keys.length-1].time<=t},X.prototype.isRising=function(t){if(this.hasEnded(t))return!1;var e=this.getKeyIndex(t);return this.keys[e].value<this.keys[e+1].value},X.prototype.clear=function(t){var e=0;t&&(e=this.getValue(t)),this.keys.length=0,t&&this.setValue(t,e),null!==this.onChange&&this.onChange()},X.prototype.sortKeys=function(){this.keys.sort((t,e)=>parseFloat(t.time)-parseFloat(e.time)),this._needsSort=!1},X.prototype.getLength=function(){return 0===this.keys.length?0:this.keys[this.keys.length-1].time},X.prototype.getKeyIndex=function(t){for(var e=0,i=0;i<this.keys.length;i++)if(t>=this.keys[i].time&&(e=i),this.keys[i].time>t)return e;return e}
28,X.prototype.setValue=function(t,e,i){var s=!1;for(var r in this.keys)if(this.keys[r].time==t){s=this.keys[r],this.keys[r].setValue(e),this.keys[r].cb=i;break}s||this.keys.push(new V.Key({time:t,value:e,e:this.defaultEasing,cb:i})),this.onChange&&this.onChange(),this._needsSort=!0},X.prototype.getSerialized=function(){var t={keys:[]};for(var e in t.loop=this.loop,this.keys)t.keys.push(this.keys[e].getSerialized());return t},X.prototype.getKey=function(t){var e=this.getKeyIndex(t);return this.keys[e]},X.prototype.getNextKey=function(t){var e=this.getKeyIndex(t)+1;return e>=this.keys.length&&(e=this.keys.length-1),this.keys[e]},X.prototype.isFinished=function(t){return this.keys.length<=0||t>this.keys[this.keys.length-1].time},X.prototype.isStarted=function(t){return!(this.keys.length<=0)&&t>=this.keys[0].time},X.prototype.getValue=function(t){if(0===this.keys.length)return 0;if(this._needsSort&&this.sortKeys(),t<this.keys[0].time)return this.keys[0].value;var e=this.keys.length-1;this.loop&&t>this.keys[e].time&&(t/this.keys[e].time>this._timesLooped&&(this._timesLooped++,this.onLooped&&this.onLooped()),t=(t-this.keys[0].time)%(this.keys[e].time-this.keys[0].time),t+=this.keys[0].time);var i=this.getKeyIndex(t);if(i>=e)return this.keys[e].cb&&!this.keys[e].cbTriggered&&this.keys[e].trigger(),this.keys[e].value;var s=parseInt(i,10)+1,r=this.keys[i],n=this.keys[s];if(r.cb&&!r.cbTriggered&&r.trigger(),!n)return-1;var o=(t-r.time)/(n.time-r.time);return r.ease(o,n)},X.prototype.addKey=function(t){void 0===t.time?g.log("key time undefined, ignoring!"):(this.keys.push(t),null!==this.onChange&&this.onChange())},X.prototype.easingFromString=function(t){return"linear"==t?L.ANIM.EASING_LINEAR:"absolute"==t?L.ANIM.EASING_ABSOLUTE:"smoothstep"==t?L.ANIM.EASING_SMOOTHSTEP:"smootherstep"==t?L.ANIM.EASING_SMOOTHERSTEP:"Cubic In"==t?L.ANIM.EASING_CUBIC_IN:"Cubic Out"==t?L.ANIM.EASING_CUBIC_OUT:"Cubic In Out"==t?L.ANIM.EASING_CUBIC_INOUT:"Expo In"==t?L.ANIM.EASING_EXPO_IN:"Expo Out"==t?L.ANIM.EASING_EXPO_OUT:"Expo In Out"==t?L.ANIM.EASING_EXPO_INOUT:"Sin In"==t?L.ANIM.EASING_SIN_IN:"Sin Out"==t?L.ANIM.EASING_SIN_OUT:"Sin In Out"==t?L.ANIM.EASING_SIN_INOUT:"Back In"==t?L.ANIM.EASING_BACK_IN:"Back Out"==t?L.ANIM.EASING_BACK_OUT:"Back In Out"==t?L.ANIM.EASING_BACK_INOUT:"Elastic In"==t?L.ANIM.EASING_ELASTIC_IN:"Elastic Out"==t?L.ANIM.EASING_ELASTIC_OUT:"Bounce In"==t?L.ANIM.EASING_BOUNCE_IN:"Bounce Out"==t?L.ANIM.EASING_BOUNCE_OUT:"Quart Out"==t?L.ANIM.EASING_QUART_OUT:"Quart In"==t?L.ANIM.EASING_QUART_IN:"Quart In Out"==t?L.ANIM.EASING_QUART_INOUT:"Quint Out"==t?L.ANIM.EASING_QUINT_OUT:"Quint In"==t?L.ANIM.EASING_QUINT_IN:"Quint In Out"==t?L.ANIM.EASING_QUINT_INOUT:void 0},X.prototype.createPort=function(t,e,i){var s=t.addInPort(new B(t,e,L.OP.OP_PORT_TYPE_VALUE,{display:"dropdown",values:L.ANIM.EASINGS}));return s.set("linear"),s.defaultValue="linear",s.onChange=function(){this.defaultEasing=this.easingFromString(s.get()),i&&i()}.bind(this),s},X.slerpQuaternion=function(t,e,i,s,r,n){X.slerpQuaternion.q1||(X.slerpQuaternion.q1=quat.create(),X.slerpQuaternion.q2=quat.create());var o=i.getKeyIndex(t),a=o+1;if(a>=i.keys.length&&(a=i.keys.length-1),o==a)quat.set(e,i.keys[o].value,s.keys[o].value,r.keys[o].value,n.keys[o].value);else{var h=i.keys[o].time,l=(t-h)/(i.keys[a].time-h);quat.set(X.slerpQuaternion.q1,i.keys[o].value,s.keys[o].value,r.keys[o].value,n.keys[o].value),quat.set(X.slerpQuaternion.q2,i.keys[a].value,s.keys[a].value,r.keys[a].value,n.keys[a].value),quat.slerp(e,X.slerpQuaternion.q1,X.slerpQuaternion.q2,l)}return e};const j=V;j.Anim=X;const $=function(t){_.apply(this),this.id=CABLES.uuid(),this.portIn=null,this.portOut=null,this.scene=t,this.activityCounter=0};$.prototype.setValue=function(t){void 0===t?this._setValue():this.portIn.set(t)},$.prototype.activity=function(){this.activityCounter++},$.prototype._setValue=function(){if(this.portOut){var t=this.portOut.get();t==t&&(this.portIn.type!=L.OP.OP_PORT_TYPE_FUNCTION&&this.activity(),this.portIn.get()!==t?this.portIn.set(t):this.portIn.changeAlways&&this.portIn.set(t))}else this.remove()},$.prototype.getOtherPort=function(t){return t==this.portIn?this.portOut:this.portIn},$.prototype.remove=function(){this.portIn&&this.portIn.removeLink(this),this.portOut&&this.portOut.removeLink(this),this.scene&&this.scene.emitEvent("onUnLink",this.portIn,this.portOut,this),!this.portIn||this.portIn.type!=L.OP.OP_PORT_TYPE_OBJECT&&this.portIn.type!=L.OP.OP_PORT_TYPE_ARRAY||(this.portIn.set(null),this.portIn.links.length>0&&this.portIn.set(this.portIn.links[0].getOtherPort(this.portIn).get())),this.portIn&&this.portIn.parent._checkLinksNeededToWork(),this.portOut&&this.portOut.parent._checkLinksNeededToWork(),this.portIn=null,this.portOut=null,this.scene=null},$.prototype.link=function(t,e){if(!$.canLink(t,e))return g.log("cannot link ports!"),!1;t.direction==L.PORT.PORT_DIR_IN?(this.portIn=t,this.portOut=e):(this.portIn=e,this.portOut=t),t.addLink(this),e.addLink(this),this.setValue(),t.onLink&&t.onLink(this),e.onLink&&e.onLink(this),t.parent._checkLinksNeededToWork(),e.parent._checkLinksNeededToWork()},$.prototype.getSerialized=function(){var t={};return t.portIn=this.portIn.getName(),t.portOut=this.portOut.getName(),t.objIn=this.portIn.parent.id,t.objOut=this.portOut.parent.id,t},$.canLinkText=function(t,e){if(t.direction==e.direction){var i="(out)";return e.direction==L.PORT.PORT_DIR_IN&&(i="(in)"),"can not link: same direction "+i}return t.parent==e.parent?"can not link: same op":t.type!=L.OP.OP_PORT_TYPE_DYNAMIC&&e.type!=L.OP.OP_PORT_TYPE_DYNAMIC&&t.type!=e.type?"can not link: different type":t?e?t.direction==L.PORT.PORT_DIR_IN&&t.isAnimated()?"can not link: is animated":e.direction==L.PORT.PORT_DIR_IN&&e.isAnimated()?"can not link: is animated":t.isLinkedTo(e)?"ports already linked":t.canLink&&!t.canLink(e)||e.canLink&&!e.canLink(t)?"Incompatible":"can link":"can not link: port 2 invalid":"can not link: port 1 invalid"},$.canLink=function(t,e){return!!t&&(!!e&&((t.direction!=L.PORT.PORT_DIR_IN||!t.isAnimated())&&((e.direction!=L.PORT.PORT_DIR_IN||!e.isAnimated())&&(!t.isHidden()&&!e.isHidden()&&(!t.isLinkedTo(e)&&(t.direction!=e.direction&&((t.type==e.type||t.type==L.OP.OP_PORT_TYPE_DYNAMIC||e.type==L.OP.OP_PORT_TYPE_DYNAMIC)&&(t.type==L.OP.OP_PORT_TYPE_DYNAMIC||e.type==L.OP.OP_PORT_TYPE_DYNAMIC||t.parent!=e.parent&&(!(t.canLink&&!t.canLink(e))&&!(e.canLink&&!e.canLink(t)))))))))))};const q=function(){if(this.data={},this.objName="",this.portsOut=[],this.portsIn=[],this.portsInData=[],this.opId="",this.uiAttribs={},this.enabled=!0,this.patch=arguments[0],this.name=arguments[1],this.errors={},this._needsLinkedToWork=[],this._needsParentOp=null,this._shortOpName="",arguments[1]){if
28(this._shortOpName=arguments[1].split(".")[arguments[1].split(".").length-1],this._shortOpName.indexOf(L.OP.OP_VERSION_PREFIX)>0){var t=this._shortOpName.split(L.OP.OP_VERSION_PREFIX)[1];this._shortOpName=this._shortOpName.substring(0,this._shortOpName.length-(L.OP.OP_VERSION_PREFIX+t).length)}this.uiAttribs.title=this._shortOpName}this.id=arguments[2]||A(),this.onAddPort=null,this.onCreate=null,this.onResize=null,this.onLoaded=null,this.onDelete=null,this.onUiAttrChange=null,this._eventCallbacks={},this._instances=null,this.preRender=null,this.init=null};{q.prototype.clearUiAttrib=function(t){var e={name:null};this.uiAttrib(e)},q.prototype.setTitle=function(t){var e=this.name!=t;this.name=t,this.uiAttr({title:t}),e&&this.fireEvent("onTitleChange",t)};const t=function(t){for(var e in this.uiAttribs||(this.uiAttribs={}),t)this.uiAttribs[e]=t[e];this.fireEvent("onUiAttribsChange",t)};q.prototype.setUiAttrib=t,q.prototype.uiAttr=t,q.prototype.getName=function(){return this.uiAttribs.name?this.uiAttribs.name:this.objName.split(".")},q.prototype.addOutPort=function(t){return t.direction=L.PORT.PORT_DIR_OUT,t.parent=this,this.portsOut.push(t),this.onAddPort&&this.onAddPort(t),t},q.prototype.hasPort=function(t){for(var e=0;e<this.portsIn.length;e++)if(this.portsIn[i].getName()==t)return!0;return!1},q.prototype.hasDynamicPort=function(){var t=0;for(t=0;t<this.portsIn.length;t++){if(this.portsIn[t].type==L.OP.OP_PORT_TYPE_DYNAMIC)return!0;if("dyn"==this.portsIn[t].getName())return!0}for(t=0;t<this.portsOut.length;t++){if(this.portsOut[t].type==L.OP.OP_PORT_TYPE_DYNAMIC)return!0;if("dyn"==this.portsOut[t].getName())return!0}return!1},q.prototype.addInPort=function(t){if(!(t instanceof B))throw new Error("parameter is not a port!");return t.direction=L.PORT.PORT_DIR_IN,t.parent=this,this.portsIn.push(t),this.onAddPort&&this.onAddPort(t),t},q.prototype.inFunction=q.prototype.inTrigger=function(t,e){var i=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_FUNCTION));return void 0!==e&&i.set(e),i},q.prototype.inFunctionButton=q.prototype.inTriggerButton=function(t,e){var i=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_FUNCTION,{display:"button"}));return void 0!==e&&i.set(e),i},q.prototype.inValueFloat=q.prototype.inValue=q.prototype.inFloat=function(t,e){var i=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_VALUE));return void 0!==e&&(i.set(e),i.defaultValue=e),i},q.prototype.inValueBool=q.prototype.inBool=function(t,e){var i=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_VALUE,{display:"bool"}));return void 0!==e&&(i.set(e),i.defaultValue=e),i},q.prototype.inValueString=function(t,e){var i=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_VALUE,{type:"string"}));return i.value="",void 0!==e&&(i.set(e),i.defaultValue=e),i},q.prototype.inString=function(t,e){var i=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_STRING,{type:"string"}));return e=e||"",i.value=e,i.set(e),i.defaultValue=e,i},q.prototype.inValueText=function(t,e){var i=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_VALUE,{type:"string",display:"text"}));return i.value="",void 0!==e&&(i.set(e),i.defaultValue=e),i},q.prototype.inStringEditor=function(t,e,i){var s=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_STRING,{type:"string",display:"editor",editorSyntax:i}));return s.value="",void 0!==e&&(s.set(e),s.defaultValue=e),s},q.prototype.inValueEditor=function(t,e,i){var s=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_VALUE,{type:"string",display:"editor",editorSyntax:i}));return s.value="",void 0!==e&&(s.set(e),s.defaultValue=e),s},q.prototype.inValueSelect=q.prototype.inDropDown=function(t,e,i,s){var r=null;if(s){const i=new B(this,t,L.OP.OP_PORT_TYPE_VALUE,{display:"dropdown",hidePort:!0,type:"string",values:e});r=this.addInPort(i)}else{const s=new B(this,t+" index",L.OP.OP_PORT_TYPE_VALUE,{increment:"integer",hideParam:!0}),n=this.addInPort(s),o=new D(this,t,L.OP.OP_PORT_TYPE_VALUE,{display:"dropdown",hidePort:!0,type:"string",values:e},n);if(s.onLinkChanged=function(){o.setUiAttribs({greyout:s.isLinked()})},r=this.addInPort(o),void 0!==i){r.set(i);const t=e.findIndex(t=>t==i);n.setValue(t),r.defaultValue=i,n.defaultValue=t}}return r}
28,q.prototype.inSwitch=function(t,e,i,s){var r=null;if(s){const i=new B(this,t,L.OP.OP_PORT_TYPE_STRING,{display:"switch",hidePort:!0,type:"string",values:e});r=this.addInPort(i)}else{const s=new B(this,t+" index",L.OP.OP_PORT_TYPE_VALUE,{increment:"integer",hideParam:!0}),n=this.addInPort(s),o=new U(this,t,L.OP.OP_PORT_TYPE_STRING,{display:"switch",hidePort:!0,type:"string",values:e},n);if(s.onLinkChanged=function(){o.setUiAttribs({greyout:s.isLinked()})},r=this.addInPort(o),void 0!==i){r.set(i);const t=e.findIndex(t=>t==i);n.setValue(t),r.defaultValue=i,n.defaultValue=t}}return r},q.prototype.inValueInt=q.prototype.inInt=function(t,e){var i=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_VALUE,{increment:"integer"}));return void 0!==e&&(i.set(e),i.defaultValue=e),i},q.prototype.inFile=function(t,e,i){var s=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_VALUE,{display:"file",filter:e}));return void 0!==i&&(s.set(i),s.defaultValue=i),s},q.prototype.inUrl=function(t,e,i){var s=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_STRING,{display:"file",filter:e}));return void 0!==i&&(s.set(i),s.defaultValue=i),s},q.prototype.inTexture=function(t,e){var i=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_OBJECT,{display:"texture",preview:!0}));return void 0!==e&&i.set(e),i},q.prototype.inObject=function(t,e,i){var s=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_OBJECT,i));return void 0!==e&&s.set(e),s},q.prototype.inGradient=function(t,e){var i=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_VALUE,{display:"gradient",hidePort:!0}));return void 0!==e&&i.set(e),i},q.prototype.inArray=function(t,e){var i=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_ARRAY));return void 0!==e&&i.set(e),i},q.prototype.inValueSlider=q.prototype.inFloatSlider=function(t,e){var i=this.addInPort(new B(this,t,L.OP.OP_PORT_TYPE_VALUE,{display:"range"}));return void 0!==e&&(i.set(e),i.defaultValue=e),i},q.prototype.outFunction=q.prototype.outTrigger=function(t,e){var i=this.addOutPort(new B(this,t,L.OP.OP_PORT_TYPE_FUNCTION));return void 0!==e&&i.set(e),i},q.prototype.outValue=q.prototype.outNumber=function(t,e){var i=this.addOutPort(new B(this,t,L.OP.OP_PORT_TYPE_VALUE));return void 0!==e&&i.set(e),i},q.prototype.outValueBool=q.prototype.outBool=function(t,e){var i=this.addOutPort(new B(this,t,L.OP.OP_PORT_TYPE_VALUE,{display:"bool"}));return void 0!==e?i.set(e):i.set(!1),i},q.prototype.outValueString=function(t,e){var i=this.addOutPort(new B(this,t,L.OP.OP_PORT_TYPE_VALUE,{type:"string"}));return void 0!==e&&i.set(e),i},q.prototype.outString=function(t,e){var i=this.addOutPort(new B(this,t,L.OP.OP_PORT_TYPE_STRING,{type:"string"}));return void 0!==e?i.set(e):i.set(""),i},q.prototype.outObject=function(t,e){var i=this.addOutPort(new B(this,t,L.OP.OP_PORT_TYPE_OBJECT));return void 0!==e&&i.set(e),i.ignoreValueSerialize=!0,i},q.prototype.outArray=function(t,e){var i=this.addOutPort(new B(this,t,L.OP.OP_PORT_TYPE_ARRAY));return void 0!==e&&i.set(e),i.ignoreValueSerialize=!0,i},q.prototype.outTexture=function(t,e){var i=this.addOutPort(new B(this,t,L.OP.OP_PORT_TYPE_OBJECT,{preview:!0}));return void 0!==e&&i.set(e),i.ignoreValueSerialize=!0,i},q.prototype.inDynamic=function(t,e,i,s){var r=new B(this,t,L.OP.OP_PORT_TYPE_DYNAMIC,i);return r.shouldLink=function(t,i){if(e&&m.isArray(e)){for(var s=0;s<e.length;s++){if(t==this&&i.type===e[s])return!0;if(i==this&&t.type===e[s])return!0}return!1}return!0},this.addInPort(r),void 0!==s&&(r.set(s),r.defaultValue=s),r},q.prototype.printInfo=function(){for(var t=0;t<this.portsIn.length;t++)g.log("in: "+this.portsIn[t].getName());for(var e in this.portsOut)g.log("out: "+this.portsOut[e].getName())},q.prototype.getOutChilds=function(){var t=[];for(var e in this.portsOut)for(var i in this.portsOut[e].links)this.portsOut[e].type==L.OP.OP_PORT_TYPE_FUNCTION&&t.push(this.portsOut[e].links[i].portIn.parent);return t},q.prototype.markChilds=function(){for(var t in this.marked=!0,this.portsOut)for(var e in this.portsOut[t].links)this.portsOut[t].parent.marked=!0,this.portsOut[t].links[e].portIn.parent!=this&&this.portsOut[t].links[e].portIn.parent.markChilds()},q.prototype.deleteChilds=function(){var t=[];for(var e in this.portsOut)for(var i in this.portsOut[e].links)this.portsOut[e].links[i].portIn.parent!=this&&(this.portsOut[e].parent!=this&&t.push(this.portsOut[e].parent),t.push(this.portsOut[e].links[i].portIn.parent),this.portsOut[e].links[i].portIn.parent.deleteChilds());for(var s in t)this.patch.deleteOp(t[s].id)},q.prototype.removeLinks=function(){for(var t=0;t<this.portsIn.length;t++)this.portsIn[t].removeLinks();for(var e=0;e<this.portsOut.length;e++)this.portsOut[e].removeLinks()},q.prototype.countFittingPorts=function(t){var e=0;for(var i in this.portsOut)$.canLink(t,this.portsOut[i])&&e++;for(var s in this.portsIn)$.canLink(t,this.portsIn[s])&&e++;return e},q.prototype.findFittingPort=function(t){for(var e in this.portsOut)if($.canLink(t,this.portsOut[e]))return this.portsOut[e];for(var i in this.portsIn)if($.canLink(t,this.portsIn[i]))return this.portsIn[i]},q.prototype.getSerialized=function(){var t={};this.opId&&(t.opId=this.opId),t.objName=this.objName,t.id=this.id,t.uiAttribs=this.uiAttribs,this.uiAttribs.title==this._shortOpName&&delete this.uiAttribs.title,this.uiAttribs.hasOwnProperty("working")&&1==this.uiAttribs.working&&delete this.uiAttribs.working,t.portsIn=[],t.portsOut=[];for(var e=0;e<this.portsIn.length;
28e++)t.portsIn.push(this.portsIn[e].getSerialized());for(var i in this.portsOut)t.portsOut.push(this.portsOut[i].getSerialized());return t},q.prototype.getFirstOutPortByType=function(t){for(var e in this.portsOut)if(this.portsOut[e].type==t)return this.portsOut[e]},q.prototype.getPort=q.prototype.getPortByName=function(t){for(var e=0;e<this.portsIn.length;e++)if(this.portsIn[e].getName()==t)return this.portsIn[e];for(var i=0;i<this.portsOut.length;i++)if(this.portsOut[i].getName()==t)return this.portsOut[i]},q.prototype.getPortById=function(t){for(var e=0;e<this.portsIn.length;e++)if(this.portsIn[e].id==t)return this.portsIn[e];for(var i=0;i<this.portsOut.length;i++)if(this.portsOut[i].id==t)return this.portsOut[i]},q.prototype.updateAnims=function(){for(var t=0;t<this.portsIn.length;t++)this.portsIn[t].updateAnim()},q.prototype.log=function(){if(!this.patch.silent){var t=["[op "+this._shortOpName+"]"];t.push.apply(t,arguments),Function.prototype.apply.apply(console.log,[console,t])}},q.prototype.error=function(){if(!this.patch.silent){var t=["[op "+this._shortOpName+"]"];t.push.apply(t,arguments),Function.prototype.apply.apply(console.error,[console,t])}},q.prototype.warn=function(){if(!this.patch.silent){var t=["[op "+this._shortOpName+"]"];t.push.apply(t,arguments),Function.prototype.apply.apply(console.warn,[console,t])}},q.prototype.unLink=function(){for(var t=0;t<this.portsOut.length;t++)this.portsOut[t].removeLinks();for(var e=0;e<this.portsIn.length;e++)this.portsIn[e].removeLinks()},q.unLinkTempReLinkP1=null,q.unLinkTempReLinkP2=null,q.prototype.undoUnLinkTemporary=function(){if(this.shakeLink&&this.shakeLink.remove(),this.shakeLink=null,this.oldLinks){for(var t=0;t<this.oldLinks.length;t++)this.patch.link(this.oldLinks[t].in.parent,this.oldLinks[t].in.getName(),this.oldLinks[t].out.parent,this.oldLinks[t].out.getName());this.oldLinks.length=0}q.unLinkTempReLinkP1=null,q.unLinkTempReLinkP2=null},q.prototype.unLinkTemporary=function(){var t=0;this.shakeLink=null,this.oldLinks=[],this.portsIn.length>0&&this.portsIn[0].isLinked()&&this.portsOut.length>0&&this.portsOut[0].isLinked()&&this.portsIn[0].getType()==this.portsOut[0].getType()&&(q.unLinkTempReLinkP1=this.portsIn[0].links[0].getOtherPort(this.portsIn[0]),q.unLinkTempReLinkP2=this.portsOut[0].links[0].getOtherPort(this.portsOut[0]));for(var e=0;e<this.portsIn.length;e++)for(t=0;t<this.portsIn[e].links.length;t++)this.oldLinks.push({in:this.portsIn[e].links[t].portIn,out:this.portsIn[e].links[t].portOut});for(var i=0;i<this.portsOut.length;i++)for(t=0;t<this.portsOut[i].links.length;t++)this.oldLinks.push({in:this.portsOut[i].links[t].portIn,out:this.portsOut[i].links[t].portOut});this.unLink(),q.unLinkTempReLinkP1&&q.unLinkTempReLinkP2&&(this.shakeLink=this.patch.link(q.unLinkTempReLinkP1.parent,q.unLinkTempReLinkP1.getName(),q.unLinkTempReLinkP2.parent,q.unLinkTempReLinkP2.getName()))},q.prototype.profile=function(t){for(var e=0;e<this.portsIn.length;e++)this.portsIn[e]._onTriggered=this.portsIn[e]._onTriggeredProfiling,this.portsIn[e].set=this.portsIn[e]._onSetProfiling},q.prototype.findParent=function(t){for(var e=0;e<this.portsIn.length;e++)if(this.portsIn[e].isLinked()){if(this.portsIn[e].links[0].portOut.parent.objName==t)return this.portsIn[e].links[0].portOut.parent;var i;if(i=this.portsIn[e].links[0].portOut.parent.findParent(t))return i}return null},q.prototype.cleanUp=function(){if(this._instances){for(var t=0;t<this._instances.length;t++)this._instances[t].onDelete&&this._instances[t].onDelete();this._instances.length=0}},q.prototype.instanced=function(t){if(0===this.patch.instancing.numCycles())return!1;var e=0,i=0;if(!this._instances||this._instances.length!=this.patch.instancing.numCycles()){for(this._instances||(this._instances=[]),g.log("creating instances of ",this.objName,this.patch.instancing.numCycles(),this._instances.length),this._instances.length=this.patch.instancing.numCycles(),e=0;e<this._instances.length;e++){this._instances[e]=this.patch.createOp(this.objName,!0),this._instances[e].instanced=function(){return!1},this._instances[e].uiAttr(this.uiAttribs);for(var s=0;s<this.portsOut.length;s++)this.portsOut[s].type==L.OP.OP_PORT_TYPE_FUNCTION&&(this._instances[e].getPortByName(this.portsOut[s].name).trigger=this.portsOut[s].trigger.bind(this.portsOut[s]))}for(i=0;i<this.portsIn.length;i++)this.portsIn[i].onChange=null,this.portsIn[i].onValueChanged=null}for(i=0;i<this.portsIn.length;i++)this.portsIn[i].type!=L.OP.OP_PORT_TYPE_VALUE&&this.portsIn[i].type!=L.OP.OP_PORT_TYPE_ARRAY||this._instances[this.patch.instancing.index()].portsIn[i].set(this.portsIn[i].get()),this.portsIn[i].type,L.OP.OP_PORT_TYPE_FUNCTION;for(i=0;i<this.portsOut.length;i++)this.portsOut[i].type==L.OP.OP_PORT_TYPE_VALUE&&this.portsOut[i].set(this._instances[this.patch.instancing.index()].portsOut[i].get());return!0},q.prototype.initInstancable=function(){},q.prototype.setValues=function(t){for(var e in t){var i=this.getPortByName(e);i?i.set(t[e]):g.log("op.setValues: port not found:",e)}},q.prototype.setError=q.prototype.error=function(t,e){if(void 0===e)this.uiAttr({error:t});else if(this.errors[t]!=e){this.errors[t]=e,e||delete this.errors[t];var i=[];for(var s in this.errors)i.push(this.errors[s]);this.uiAttr({errors:i}),console.log(i)}},q.prototype.setHint=function(t){t!=this.uiAttribs.hint&&this.uiAttr({hint:t})},q.prototype.setWarning=function(t){t!=this.uiAttribs.warning&&this.uiAttr({warning:t})},q.prototype.addListener=q.prototype.addEventListener=function(t,e){this._eventCallbacks[t]?this._eventCallbacks[t].push(e):this._eventCallbacks[t]=[e]},q.prototype.hasEventListener=function(t,e){if(t&&e){if(this._eventCallbacks[t])return-1!=this._eventCallbacks[t].indexOf(e)}else g.log("hasListener: missing parameters")},q.prototype.removeEventListener=function(t,e){if(this._eventCallbacks[t]){var i=this._eventCallbacks[t].indexOf(e);-1==i?g.log("eventlistener "+t+" not found..."):this._eventCallbacks[t].slice(i)}},q.prototype.fireEvent=function(t,e){if(this._eventCallbacks[t])for(var i=0;i<this._eventCallbacks[t].length;i++)this._eventCallbacks[t][i]&&this._eventCallbacks[t][i](e);this.onUiAttrChange&&"onUiAttribsChange"==t&&this.onUiAttrChange(e)},q.prototype.setEnabled=function(t){this.enabled=t,this.fireEvent("onEnabledChange",t)},q.prototype.setPortGroup=function(t,e){for(var i=0;i<e.length;i++)e[i]&&e[i].setUiAttribs?e[i].setUiAttribs({group:t}
28):console.error("setPortGroup: invalid port!")},q.prototype.setUiAxisPorts=function(t,e,i){t&&t.setUiAttribs({axis:"X"}),e&&e.setUiAttribs({axis:"Y"}),i&&i.setUiAttribs({axis:"Z"})},q.prototype.removePort=function(t){for(var e=0;e<this.portsIn.length;e++)if(this.portsIn[e]==t)return this.portsIn.splice(e,1),this.fireEvent("onUiAttribsChange",{}),void this.fireEvent("onPortRemoved",{})},q.prototype.checkLinkTimeWarnings=function(){function t(e,i,s){for(var r=0;r<e.portsIn.length;r++)if(e.portsIn[r].type==i&&e.portsIn[r].isLinked())for(var n=e.portsIn[r],o=0;o<n.links.length;o++)if(n.links[o]){if(n.links[o].portOut.parent.objName.indexOf(s)>-1)return!0;if(t(n.links[o].portOut.parent,i,s))return!0}return!1}var e,i=null,s=!0;if(s&&0==this.objName.indexOf("Ops.Gl.TextureEffects")&&((e=this).portsIn.length>0&&e.portsIn[0].type==L.OP.OP_PORT_TYPE_FUNCTION)&&-1==this.objName.indexOf("TextureEffects.ImageCompose")&&((s=t(this,L.OP.OP_PORT_TYPE_FUNCTION,"TextureEffects.ImageCompose"))||(i=CABLES.UI.TEXTS.working_connected_to+"ImageCompose")),this._needsParentOp&&s&&((s=t(this,L.OP.OP_PORT_TYPE_OBJECT,this._needsParentOp))||(i=CABLES.UI.TEXTS.working_connected_to+this._needsParentOp)),this._needsLinkedToWork.length>0)for(var r=0;r<this._needsLinkedToWork.length;r++){var n=this._needsLinkedToWork[r];n?n.isLinked()||(s=!1,i?i+=", ":i=CABLES.UI.TEXTS.working_connected_needs_connections_to,i+=n.name.toUpperCase()):console.warn("[needsLinkedToWork] port not found")}s?this.uiAttribs.working||this.setUiAttrib({working:!0,notWorkingMsg:null}):this.setUiAttrib({working:s,notWorkingMsg:i})},q.prototype._checkLinksNeededToWork=function(){},q.prototype.toWorkNeedsParent=function(t){this.patch.isEditorMode()&&(this._needsParentOp=t)},q.prototype.toWorkPortsNeedToBeLinked=function(){if(this.patch.isEditorMode())for(var t=0;t<arguments.length;t++)-1==this._needsLinkedToWork.indexOf(arguments[t])&&this._needsLinkedToWork.push(arguments[t])},q.prototype.toWorkPortsNeedToBeLinkedReset=function(){this.patch.isEditorMode()&&(this._needsLinkedToWork.length=0,this.checkLinkTimeWarnings())},q.prototype.initVarPorts=function(){for(var t=0;t<this.portsIn.length;t++)this.portsIn[t].getVariableName()&&this.portsIn[t].setVariable(this.portsIn[t].getVariableName())},q.prototype.refreshParams=function(){this.patch&&this.patch.isEditorMode()&&gui.patch().refreshOpParams(this)}}q.getNamespaceClassName=function(t){return t?t.startsWith("Ops.Gl")?"gl":t.startsWith("Ops.WebAudio")?"audio":t.startsWith("Ops.Devices")?"devices":t.startsWith("Ops.Html")?"html":t.startsWith("Ops.Sidebar")?"html":t.startsWith("Ops.Math")?"math":t.startsWith("Ops.User")?"user":"default":"default"},q.isSubpatchOp=function(t){return"Ops.Ui.Patch"==t||"Ops.Ui.SubPatch"==t};const Q=new function(){this.profileUniformCount=0,this.profileShaderBinds=0,this.profileUniformCount=0,this.profileShaderCompiles=0,this.profileVideosPlaying=0,this.profileMVPMatrixCount=0,this.profileEffectBuffercreate=0,this.profileShaderGetUniform=0,this.profileFrameBuffercreate=0,this.profileMeshSetGeom=0};var J=null,Z=null,tt=null;const et=function(t,e){if(!t)throw"no cgl";this._cgl=t,this.tex=this._cgl.gl.createTexture(),this.id=A(),this.width=0,this.height=0,this.flip=!0,this.shadowMap=!1,this.anisotropic=0,this.filter=et.FILTER_NEAREST,this.wrap=et.WRAP_CLAMP_TO_EDGE,this.texTarget=this._cgl.gl.TEXTURE_2D,e&&e.type&&(this.texTarget=e.type),this.textureType=et.TYPE_DEFAULT,this.unpackAlpha=!0,this._fromData=!0,this.name="unknown",e?(this.name=e.name||this.name,e.isDepthTexture&&(this.textureType=et.TYPE_DEPTH),e.isFloatingPointTexture&&(this.textureType=et.TYPE_FLOAT),"textureType"in e&&(this.textureType=e.textureType),"filter"in e&&(this.filter=e.filter),"wrap"in e&&(this.wrap=e.wrap),"unpackAlpha"in e&&(this.unpackAlpha=e.unpackAlpha),"flip"in e&&(this.flip=e.flip),"shadowMap"in e&&(this.shadowMap=e.shadowMap),"anisotropic"in e&&(this.anisotropic=e.anisotropic)):e={width:8,height:8},this.setSize(e.width,e.height)};et.prototype.compareSettings=function(t){return!!t&&(t.width==this.width&&t.height==this.height&&t.filter==this.filter&&t.wrap==this.wrap&&t.textureType==this.textureType&&t.unpackAlpha==this.unpackAlpha&&t.flip==this.flip)},et.prototype.clone=function(){var t=new et(this._cgl,{name:this.name,filter:this.filter,wrap:this.wrap,textureType:this.textureType,unpackAlpha:this.unpackAlpha,flip:this.flip,width:this.width,height:this.height});return this.compareSettings(t)||(console.error("Cloned texture settings do not compare!"),g.log(this),g.log(t)),t},et.prototype.setSize=function(t,e){if((t!=t||t<=0||!t)&&(t=8),(e!=e||e<=0||!e)&&(e=8),t=Math.floor(t),e=Math.floor(e),this.width!=t||this.height!=e){this.width=t,this.height=e,this._cgl.gl.bindTexture(this.texTarget,this.tex),Q.profileTextureResize++;if(this.textureType!=et.TYPE_FLOAT||this.filter!=et.FILTER_LINEAR||this._cgl.gl.getExtension("OES_texture_float_linear")||(console.warn("this graphics card does not support floating point texture linear interpolation!"),this.filter=et.FILTER_NEAREST),this._setFilter(),this.textureType==et.TYPE_FLOAT)if(1==this._cgl.glVersion)if(this._cgl.glUseHalfFloatTex){var i=this._cgl.gl.getExtension("OES_texture_half_float");
28if(1==this._cgl.glVersion&&!i)throw"no half float texture extension";this._cgl.gl.texImage2D(this.texTarget,0,this._cgl.gl.RGBA,t,e,0,this._cgl.gl.RGBA,i.HALF_FLOAT_OES,null)}else{i=this._cgl.gl.getExtension("OES_texture_float");this._cgl.gl.texImage2D(this.texTarget,0,this._cgl.gl.RGBA,t,e,0,this._cgl.gl.RGBA,this._cgl.gl.FLOAT,null)}else this._cgl.gl.texImage2D(this.texTarget,0,this._cgl.gl.RGBA32F,t,e,0,this._cgl.gl.RGBA,this._cgl.gl.FLOAT,null);else if(this.textureType==et.TYPE_DEPTH)if(1==this._cgl.glVersion){var s=this._cgl.gl.DEPTH_COMPONENT;this._cgl.gl.texImage2D(this.texTarget,0,s,t,e,0,this._cgl.gl.DEPTH_COMPONENT,this._cgl.gl.UNSIGNED_SHORT,null)}else{s=this._cgl.gl.DEPTH_COMPONENT32F;this._cgl.gl.texImage2D(this.texTarget,0,s,t,e,0,this._cgl.gl.DEPTH_COMPONENT,this._cgl.gl.FLOAT,null)}else this._cgl.gl.texImage2D(this.texTarget,0,this._cgl.gl.RGBA,t,e,0,this._cgl.gl.RGBA,this._cgl.gl.UNSIGNED_BYTE,null);this.updateMipMap(),this._cgl.gl.bindTexture(this.texTarget,null)}},et.prototype.initFromData=function(t,e,i,s,r){this.filter=s,this.wrap=r,null==s&&(this.filter=et.FILTER_LINEAR),null==r&&(this.wrap=et.CLAMP_TO_EDGE),this.width=e,this.height=i,this._fromData=!0,this._cgl.gl.bindTexture(this.texTarget,this.tex),this._cgl.gl.texImage2D(this.texTarget,0,this._cgl.gl.RGBA,e,i,0,this._cgl.gl.RGBA,this._cgl.gl.UNSIGNED_BYTE,t),this._setFilter(),this.updateMipMap(),this._cgl.gl.bindTexture(this.texTarget,null)},et.prototype.updateMipMap=function(){2!=this._cgl.glVersion&&!this.isPowerOfTwo()||this.filter!=et.FILTER_MIPMAP||this._cgl.gl.generateMipmap(this.texTarget)},et.prototype.initTexture=function(t,e){this._fromData=!1,this._cgl.gl.pixelStorei(this._cgl.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.unpackAlpha),t.width&&(this.width=t.width),t.height&&(this.height=t.height),e&&(this.filter=e),this._cgl.gl.bindTexture(this.texTarget,this.tex),this._cgl.gl.pixelStorei(this._cgl.gl.UNPACK_FLIP_Y_WEBGL,!this.flip),this._cgl.gl.texImage2D(this.texTarget,0,this._cgl.gl.RGBA,this._cgl.gl.RGBA,this._cgl.gl.UNSIGNED_BYTE,t),this._setFilter(),this.updateMipMap(),this._cgl.gl.bindTexture(this.texTarget,null),this._cgl.gl.pixelStorei(this._cgl.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1)},et.prototype.delete=function(){this.width=0,this.height=0,Q.profileTextureDelete++,this._cgl.gl.deleteTexture(this.tex)},et.prototype.isPowerOfTwo=function(){return et.isPowerOfTwo(this.width)&&et.isPowerOfTwo(this.height)},et.prototype.printInfo=function(){g.log(this.getInfo())},et.prototype.getInfoReadable=function(){var t=this.getInfo(),e="";for(var i in t.name=t.name.substr(0,t.name.indexOf("?rnd=")),t)e+="* "+i+": **"+t[i]+"**\n";return e},et.prototype.getInfo=function(){var t={};t.name=this.name,t["power of two"]=this.isPowerOfTwo(),t.size=this.width+" x "+this.height;var e=this.texTarget;return this.texTarget==this._cgl.gl.TEXTURE_2D&&(e="TEXTURE_2D"),t.target=e,t.unpackAlpha=this.unpackAlpha,this.textureType==et.TYPE_FLOAT?t.textureType="TYPE_FLOAT":this.textureType==et.TYPE_DEPTH?t.textureType="TYPE_DEPTH":this.textureType==et.TYPE_DEFAULT?t.textureType="TYPE_DEFAULT":t.textureType="UNKNOWN",this.wrap==et.WRAP_CLAMP_TO_EDGE?t.wrap="CLAMP_TO_EDGE":this.wrap==et.WRAP_REPEAT?t.wrap="WRAP_REPEAT":this.wrap==et.WRAP_MIRRORED_REPEAT?t.wrap="WRAP_MIRRORED_REPEAT":t.wrap="UNKNOWN",this.filter==et.FILTER_NEAREST?t.filter="FILTER_NEAREST":this.filter==et.FILTER_LINEAR?t.filter="FILTER_LINEAR":this.filter==et.FILTER_MIPMAP?t.filter="FILTER_MIPMAP":t.filter="UNKNOWN",t},et.prototype._setFilter=function(){if(this._fromData||this._cgl.gl.pixelStorei(this._cgl.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.unpackAlpha),this.shadowMap&&(g.log("shadowmap tex"),this._cgl.gl.texParameteri(this._cgl.gl.TEXTURE_2D,this._cgl.gl.TEXTURE_COMPARE_MODE,this._cgl.gl.COMPARE_REF_TO_TEXTURE),this._cgl.gl.texParameteri(this._cgl.gl.TEXTURE_2D,this._cgl.gl.TEXTURE_COMPARE_FUNC,this._cgl.gl.LEQUAL)),this.textureType==et.TYPE_FLOAT&&this.filter==et.FILTER_MIPMAP&&(g.log("texture: HDR and mipmap filtering at the same time is not possible"),this.filter=et.FILTER_LINEAR),1!=this._cgl.glVersion||this.isPowerOfTwo()){if(this.wrap==et.WRAP_CLAMP_TO_EDGE?(this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_WRAP_S,this._cgl.gl.CLAMP_TO_EDGE),this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_WRAP_T,this._cgl.gl.CLAMP_TO_EDGE)):this.wrap==et.WRAP_REPEAT?(this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_WRAP_S,this._cgl.gl.REPEAT),this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_WRAP_T,this._cgl.gl.REPEAT)):this.wrap==et.WRAP_MIRRORED_REPEAT&&(this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_WRAP_S,this._cgl.gl.MIRRORED_REPEAT),this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_WRAP_T,this._cgl.gl.MIRRORED_REPEAT)),this.filter==et.FILTER_NEAREST)this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_MAG_FILTER,this._cgl.gl.NEAREST),this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_MIN_FILTER,this._cgl.gl.NEAREST);else if(this.filter==et.FILTER_LINEAR)this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_MIN_FILTER,this._cgl.gl.LINEAR),this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_MAG_FILTER,this._cgl.gl.LINEAR);else{if(this.filter!=et.FILTER_MIPMAP)throw g.log("unknown texture filter!",this.filter),new Error("unknown texture filter!"+this.filter);this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_MAG_FILTER,this._cgl.gl.LINEAR),this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_MIN_FILTER,this._cgl.gl.LINEAR_MIPMAP_LINEAR)}if(this.anisotropic){var t=this._cgl.gl.getExtension("EXT_texture_filter_anisotropic");if(t){var e=this._cgl.gl.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT);this._cgl.gl.texParameterf(this._cgl.gl.TEXTURE_2D,t.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e,this.anisotropic))}}}else this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_MAG_FILTER,this._cgl.gl.NEAREST),this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_MIN_FILTER,this._cgl.gl.NEAREST),this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_WRAP_S,this._cgl.gl.CLAMP_TO_EDGE),this._cgl.gl.texParameteri(this.texTarget,this._cgl.gl.TEXTURE_WRAP_T,this._cgl.gl.CLAMP_TO_EDGE),this.filter=et.FILTER_NEAREST,this.wrap=et.WRAP_CLAMP_TO_EDGE}
28,et.load=function(t,e,i,s){var r=t.patch.loading.start("texture",e),n=new et(t);return n.name=e,t.patch.isEditorMode()&&gui.jobs().start({id:"loadtexture"+r,title:"loading texture ("+e+")"}),n.image=new Image,n.image.crossOrigin="anonymous",s&&s.hasOwnProperty("filter")&&(n.filter=s.filter),s&&s.hasOwnProperty("flip")&&(n.flip=s.flip),s&&s.hasOwnProperty("wrap")&&(n.wrap=s.wrap),s&&s.hasOwnProperty("anisotropic")&&(n.anisotropic=s.anisotropic),s&&s.hasOwnProperty("unpackAlpha")&&(n.unpackAlpha=s.unpackAlpha),n.image.onabort=n.image.onerror=function(e){g.warn("[cgl.texture.load] error loading texture",e),t.patch.loading.finished(r);i&&i({error:!0}),t.patch.isEditorMode()&&gui.jobs().finish("loadtexture"+r)},n.image.onload=function(e){n.initTexture(n.image),t.patch.loading.finished(r),t.patch.isEditorMode()&&gui.jobs().finish("loadtexture"+r),i&&i()},n.image.src=e,n},et.getTempTexture=function(t){return J||(J=et.getTemporaryTexture(t,256,et.FILTER_LINEAR,et.REPEAT)),J},et.getEmptyTexture=function(t){if(t||console.error("[getEmptyTexture] no cgl!"),t.tempTextureEmpty)return t.tempTextureEmpty;t.tempTextureEmpty=new et(t);var e=new Uint8Array(256);return t.tempTextureEmpty.initFromData(e,8,8,et.FILTER_NEAREST,et.WRAP_REPEAT),t.tempTextureEmpty},et.getRandomTexture=function(t){if(Z)return Z;const e=new Uint8Array(262144);for(var i=0;i<65536;i++)e[4*i+0]=255*Math.random(),e[4*i+1]=255*Math.random(),e[4*i+2]=255*Math.random(),e[4*i+3]=255;return(Z=new et(t)).initFromData(e,256,256,et.FILTER_NEAREST,et.WRAP_REPEAT),Z},et.getTempGradientTexture=function(t){if(tt)return tt;var e=new et(t);for(var i=new Uint8Array(262144),s=0;s<256;s++)for(var r=0;r<256;r++)i[4*(r+256*s)+0]=i[4*(r+256*s)+1]=i[4*(r+256*s)+2]=255-s,i[4*(r+256*s)+3]=255;return e.initFromData(i,256,256,et.FILTER_NEAREST,et.WRAP_REPEAT),tt=e,e},et.getTemporaryTexture=function(t,e,i,s){for(var r=new et(t),n=[],o=0;o<e;o++)for(var a=0;a<e;a++)(a+o)%64<32?(n.push(200+o/e*25+a/e*25),n.push(200+o/e*25+a/e*25),n.push(200+o/e*25+a/e*25)):(n.push(40+o/e*25+a/e*25),n.push(40+o/e*25+a/e*25),n.push(40+o/e*25+a/e*25)),n.push(255);var h=new Uint8Array(n);return r.initFromData(h,e,e,i,s),r},et.createFromImage=function(t,e,i){var s=new et(t,i=i||{});return s.flip=!1,s.image=e,s.width=e.width,s.height=e.height,s.initTexture(e,i.filter),s},et.fromImage=function(t,e,i,s){g.error("deprecated texture from image...");var r=new et(t);return r.flip=!1,i&&(r.filter=i),s&&(r.wrap=s),r.image=e,r.initTexture(e),r},et.isPowerOfTwo=function(t){return 1==t||2==t||4==t||8==t||16==t||32==t||64==t||128==t||256==t||512==t||1024==t||2048==t||4096==t||8192==t||16384==t},et.FILTER_NEAREST=0,et.FILTER_LINEAR=1,et.FILTER_MIPMAP=2,et.WRAP_REPEAT=0,et.WRAP_MIRRORED_REPEAT=1,et.WRAP_CLAMP_TO_EDGE=2,et.TYPE_DEFAULT=0,et.TYPE_DEPTH=1,et.TYPE_FLOAT=2;const it=function(t,e,i,s){this.Framebuffer2DrawTargetsDefault=null,this.Framebuffer2BlittingFramebuffer=null,this.Framebuffer2FinalFramebuffer=null,this._cgl=t,this._width=0,this._height=0,this._depthRenderbuffer=null,this._frameBuffer=null,this._textureFrameBuffer=null,this._colorRenderbuffers=[],this._drawTargetArray=[],this.Framebuffer2BlittingFramebuffer||(this.Framebuffer2BlittingFramebuffer=t.gl.createFramebuffer()),this.Framebuffer2FinalFramebuffer||(this.Framebuffer2FinalFramebuffer=t.gl.createFramebuffer()),this.Framebuffer2DrawTargetsDefault||(this.Framebuffer2DrawTargetsDefault=[t.gl.COLOR_ATTACHMENT0]),this._options=s||{isFloatingPointTexture:!1},this._options.hasOwnProperty("numRenderBuffers")||(this._options.numRenderBuffers=1),this._options.hasOwnProperty("depth")||(this._options.depth=!0),this._options.hasOwnProperty("clear")||(this._options.clear=!0),this._options.hasOwnProperty("multisampling")||(this._options.multisampling=!1,this._options.multisamplingSamples=0),this._options.multisamplingSamples&&(this._cgl.gl.MAX_SAMPLES?this._options.multisamplingSamples=Math.min(this._cgl.gl.getParameter(this._cgl.gl.MAX_SAMPLES),this._options.multisamplingSamples):this._options.multisamplingSamples=0),this._options.hasOwnProperty("filter")||(this._options.filter=et.FILTER_LINEAR),this._numRen
28derBuffers=this._options.numRenderBuffers,this._colorTextures=[];for(var r=0;r<this._numRenderBuffers;r++)this._colorTextures[r]=new et(t,{name:"framebuffer2 texture "+r,isFloatingPointTexture:this._options.isFloatingPointTexture,filter:this._options.filter,wrap:this._options.wrap});var n=et.FILTER_NEAREST;this._options.shadowMap&&(n=et.FILTER_LINEAR),this._textureDepth=new et(t,{name:"framebuffer2 depth texture",isDepthTexture:!0,filter:n,shadowMap:this._options.shadowMap||!1}),this.setSize(e||512,i||512)};it.prototype.getWidth=function(){return this._width},it.prototype.getHeight=function(){return this._height},it.prototype.getGlFrameBuffer=function(){return this._frameBuffer},it.prototype.getDepthRenderBuffer=function(){return this._depthRenderbuffer},it.prototype.getTextureColor=function(){return this._colorTextures[0]},it.prototype.getTextureColorNum=function(t){return this._colorTextures[t]},it.prototype.getTextureDepth=function(){return this._textureDepth},it.prototype.setFilter=function(t){for(var e=0;e<this._numRenderBuffers;e++)this._colorTextures[e].filter=t,this._colorTextures[e].setSize(this._width,this._height)},it.prototype.delete=it.prototype.dispose=function(){for(var t=0;t<this._numRenderBuffers;t++)this._colorTextures[t].delete();this._textureDepth.delete();for(t=0;t<this._numRenderBuffers;t++)this._cgl.gl.deleteRenderbuffer(this._colorRenderbuffers[t]);this._cgl.gl.deleteRenderbuffer(this._depthRenderbuffer),this._cgl.gl.deleteFramebuffer(this._frameBuffer),this._cgl.gl.deleteFramebuffer(this._textureFrameBuffer)},it.prototype.setSize=function(t,e){if(this._width=Math.floor(t),this._height=Math.floor(e),Q.profileFrameBuffercreate++,this._frameBuffer){for(var i=0;i<this._numRenderBuffers;i++)this._cgl.gl.deleteRenderbuffer(this._colorRenderbuffers[i]);this._cgl.gl.deleteRenderbuffer(this._depthRenderbuffer),this._cgl.gl.deleteFramebuffer(this._frameBuffer),this._cgl.gl.deleteFramebuffer(this._textureFrameBuffer)}this._frameBuffer=this._cgl.gl.createFramebuffer(),this._textureFrameBuffer=this._cgl.gl.createFramebuffer();var s=this._options.depth;for(i=0;i<this._numRenderBuffers;i++)this._colorTextures[i].setSize(this._width,this._height);for(i=0;i<this._numRenderBuffers;i++){var r=this._cgl.gl.createRenderbuffer();this._cgl.gl.getExtension("EXT_color_buffer_float");this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this._frameBuffer),this._cgl.gl.bindRenderbuffer(this._cgl.gl.RENDERBUFFER,r),this._options.isFloatingPointTexture?this._options.multisampling?this._cgl.gl.renderbufferStorageMultisample(this._cgl.gl.RENDERBUFFER,this._options.multisamplingSamples,this._cgl.gl.RGBA32F,this._width,this._height):this._cgl.gl.renderbufferStorage(this._cgl.gl.RENDERBUFFER,this._cgl.gl.RGBA32F,this._width,this._height):this._options.multisampling?this._cgl.gl.renderbufferStorageMultisample(this._cgl.gl.RENDERBUFFER,this._options.multisamplingSamples,this._cgl.gl.RGBA8,this._width,this._height):this._cgl.gl.renderbufferStorage(this._cgl.gl.RENDERBUFFER,this._cgl.gl.RGBA8,this._width,this._height),this._cgl.gl.framebufferRenderbuffer(this._cgl.gl.FRAMEBUFFER,this._cgl.gl.COLOR_ATTACHMENT0+i,this._cgl.gl.RENDERBUFFER,r),this._colorRenderbuffers[i]=r}this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this._textureFrameBuffer);for(i=0;i<this._numRenderBuffers;i++)this._cgl.gl.framebufferTexture2D(this._cgl.gl.FRAMEBUFFER,this._cgl.gl.COLOR_ATTACHMENT0+i,this._cgl.gl.TEXTURE_2D,this._colorTextures[i].tex,0);this._options.depth&&this._cgl.gl.framebufferTexture2D(this._cgl.gl.FRAMEBUFFER,this._cgl.gl.DEPTH_ATTACHMENT,this._cgl.gl.TEXTURE_2D,this._textureDepth.tex,0),this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this._frameBuffer),s&&(this._textureDepth.setSize(this._width,this._height),this._depthRenderbuffer=this._cgl.gl.createRenderbuffer(),this._cgl.gl.bindRenderbuffer(this._cgl.gl.RENDERBUFFER,this._depthRenderbuffer),this._options.isFloatingPointTexture,this._options.multisampling?this._cgl.gl.renderbufferStorageMultisample(this._cgl.gl.RENDERBUFFER,this._options.multisamplingSamples,this._cgl.gl.DEPTH_COMPONENT32F,this._width,this._height):this._cgl.gl.renderbufferStorage(this._cgl.gl.RENDERBUFFER,this._cgl.gl.DEPTH_COMPONENT32F,this._width,this._height),this._cgl.gl.framebufferRenderbuffer(this._cgl.gl.FRAMEBUFFER,this._cgl.gl.DEPTH_ATTACHMENT,this._cgl.gl.RENDERBUFFER,this._depthRenderbuffer)),this._drawTargetArray.length=0;for(i=0;
28i<this._numRenderBuffers;i++)this._drawTargetArray.push(this._cgl.gl.COLOR_ATTACHMENT0+i);if(!this._cgl.gl.isFramebuffer(this._textureFrameBuffer))throw"Invalid framebuffer";var n=this._cgl.gl.checkFramebufferStatus(this._cgl.gl.FRAMEBUFFER);switch(n){case this._cgl.gl.FRAMEBUFFER_COMPLETE:break;case this._cgl.gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:throw g.log("FRAMEBUFFER_INCOMPLETE_ATTACHMENT..."),new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");case this._cgl.gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:throw g.log("FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"),new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");case this._cgl.gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:throw g.log("FRAMEBUFFER_INCOMPLETE_DIMENSIONS"),new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");case this._cgl.gl.FRAMEBUFFER_UNSUPPORTED:throw g.log("FRAMEBUFFER_UNSUPPORTED"),new Error("Incomplete framebuffer: FRAMEBUFFER_UNSUPPORTED");default:throw g.log("incomplete framebuffer",n),new Error("Incomplete framebuffer: "+n)}this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,null),this._cgl.gl.bindRenderbuffer(this._cgl.gl.RENDERBUFFER,null)},it.prototype.renderStart=function(){this._cgl.pushModelMatrix(),this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this._frameBuffer),this._cgl.pushGlFrameBuffer(this._frameBuffer),this._cgl.pushFrameBuffer(this),this._cgl.pushPMatrix(),this._cgl.gl.viewport(0,0,this._width,this._height),this._cgl.gl.drawBuffers(this._drawTargetArray),this._options.clear&&(this._cgl.gl.clearColor(0,0,0,0),this._cgl.gl.clear(this._cgl.gl.COLOR_BUFFER_BIT|this._cgl.gl.DEPTH_BUFFER_BIT))},it.prototype.renderEnd=function(){if(this._cgl.popPMatrix(),this._numRenderBuffers<=1)this._cgl.gl.bindFramebuffer(this._cgl.gl.READ_FRAMEBUFFER,this._frameBuffer),this._cgl.gl.bindFramebuffer(this._cgl.gl.DRAW_FRAMEBUFFER,this._textureFrameBuffer),this._cgl.gl.clearBufferfv(this._cgl.gl.COLOR,0,[0,0,0,1]),this._cgl.gl.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,this._cgl.gl.COLOR_BUFFER_BIT|this._cgl.gl.DEPTH_BUFFER_BIT,this._cgl.gl.NEAREST);else{this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this.Framebuffer2BlittingFramebuffer),this._cgl.gl.framebufferRenderbuffer(this._cgl.gl.FRAMEBUFFER,this._cgl.gl.DEPTH_ATTACHMENT,this._cgl.gl.RENDERBUFFER,this._depthRenderbuffer),this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this.Framebuffer2FinalFramebuffer),this._cgl.gl.framebufferTexture2D(this._cgl.gl.FRAMEBUFFER,this._cgl.gl.DEPTH_ATTACHMENT,this._cgl.gl.TEXTURE_2D,this._textureDepth.tex,0);for(var t=0;t<this._numRenderBuffers;t++){this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this.Framebuffer2BlittingFramebuffer),this._cgl.gl.framebufferRenderbuffer(this._cgl.gl.FRAMEBUFFER,this._cgl.gl.COLOR_ATTACHMENT0,this._cgl.gl.RENDERBUFFER,this._colorRenderbuffers[t]),this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this.Framebuffer2FinalFramebuffer),this._cgl.gl.framebufferTexture2D(this._cgl.gl.FRAMEBUFFER,this._cgl.gl.COLOR_ATTACHMENT0,this._cgl.gl.TEXTURE_2D,this._colorTextures[t].tex,0),this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,null),this._cgl.gl.bindFramebuffer(this._cgl.gl.READ_FRAMEBUFFER,this.Framebuffer2BlittingFramebuffer),this._cgl.gl.bindFramebuffer(this._cgl.gl.DRAW_FRAMEBUFFER,this.Framebuffer2FinalFramebuffer),this._cgl.gl.clearBufferfv(this._cgl.gl.COLOR,0,[0,0,0,1]);var e=this._cgl.gl.COLOR_BUFFER_BIT;0==t&&(e|=this._cgl.gl.DEPTH_BUFFER_BIT),this._cgl.gl.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,e,this._cgl.gl.NEAREST)}}if(this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this._cgl.popGlFrameBuffer()),this._cgl.popFrameBuffer(),this._cgl.popModelMatrix(),this._cgl.resetViewPort(),this._colorTextures[0].filter==et.FILTER_MIPMAP)for(t=0;t<this._numRenderBuffers;t++)this._cgl.gl.bindTexture(this._cgl.gl.TEXTURE_2D,this._colorTextures[t].tex),this._colorTextures[t].updateMipMap(),this._cgl.gl.bindTexture(this._cgl.gl.TEXTURE_2D,null)};s(1);class st{constructor(t){this._max=[-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE],this._min=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],this._center=[],this._size=[],this._first=!0,this._wireMesh=null,t&&this.apply(t)}get maxAxis(){return this._maxAxis}get size(){return this._size}get center(){return this._center}get x(){return this._center[0]}get y(){return this._center[1]}get z(){return this._center[2]}get minX(){return this._min[0]}get minY(){return this._min[1]}get minZ(){return this._min[2]}get maxX(){return this._max[0]}get maxY(){return this._max[1]}get maxZ(){return this._max[2]}apply(t,e){if(t){if(t instanceof st){const e=t;this.applyPos(e.maxX,e.maxY,e.maxZ),this.applyPos(e.minX,e.minY,e.minZ)}else{var i=0;for(i=0;i<t.vertices.length;i+=3)t.vertices[i+0]==t.vertices[i+0]&&this.applyPos(t.vertices[i+0],t.vertices[i+1],t.vertices[i+2])}this.calcCenterSize()}else console.warn("[boundingbox] no geom/vertices",t)}copy(){return new st(this)}get changed(){return!(this._max[0]==-Number.MAX_VALUE&&this._max[1]==-Number.MAX_VALUE&&this._max[2]==-Number.MAX_VALUE)}applyPos(t,e,i){if(this._first)return this._max[0]=t,this._max[1]=e,this._max[2]=i,this._min[0]=t,this._min[1]=e,this._min[2]=i,void(this._first=!1);this._max[0]=Math.max(this._max[0],t),this._max[1]=Math.max(this._max[1],e),this._max[2]=Math.max(this._max[2],i),this._min[0]=Math.min(this._min[0],t),this._min[1]=Math.min(this._min[1],e),this._min[2]=Math.min(this._min[2],i)}calcCenterSize(){this._size[0]=this._max[0]-this._min[0],this._size[1]=this._max[1]-this._min[1],this._size[2]=this._max[2]-this._min[2],this._center[0]=(this._min[0]+this._max[0])/2,this._center[1]=(this._min[1]+this._max[1])/2,this._center[2]=(this._min[2]+this._max[2])/2,this._maxAxis=Math.max(this._size[2],Math.max(this._size[0],this._size[1]))}mulMat4(t){vec3.transformMat4(this._max,this._max,t),vec3.transformMat4(this._min,this._min,t),this.calcCenterSize()}render(t,e){this._wireMesh||(this._wireMesh=new CGL.WireCube(t)),t.pushModelMatrix(),mat4.translate(t.mMatrix,t.mMatrix,this._center),this._wireMesh.render(t,this._size[0]/2,this._size[1]/2,this._size[2]/2),t.popModelMatrix()}}const rt=function(t){this.name=t,this.faceVertCount=3,this._vertices=[],this.verticesIndices=[],this.texCoords=new Float32Array,this.texCoordsIndices=[],this.vertexNormals=[],this.tangents=[],this.biTangents=[],this.barycentrics=[],this.morphTargets=[],this.vertexColors=[],this._attributes={},this.glPrimitive=null,Object.defineProperty(this,"vertices",{get(){return this._vertices},set(t){this.setVertices(t)}})};rt.prototype.clear=function(){this.vertices=new Float32Array([]),this.verticesIndices.length=0,this.texCoords=new Float32Array([]),this.texCoordsIndices.length=0,this.vertexNormals=new Float32Array([])},rt.prototype.getAttributes=function(){return this._attributes},rt.prototype.getAttribute=function(t){for(var e in this._attributes)if(this._attributes[e].name==t)return this._attributes[e];return null}
28,rt.prototype.setAttribute=function(t,e,i){var s="";1==i?s="float":2==i?s="vec2":3==i?s="vec3":4==i&&(s="vec4");var r={name:t,data:e,itemSize:i,type:s};this._attributes[t]=r},rt.prototype.setVertices=function(t){t instanceof Float32Array?this._vertices=t:this._vertices=new Float32Array(t)},rt.prototype.setTexCoords=function(t){t instanceof Float32Array?this.texCoords=t:this.texCoords=new Float32Array(t)},rt.prototype.calcNormals=function(t){t||this.unIndex(),this.calculateNormals({})},rt.prototype.setPointVertices=function(t){if(t.length%3==0){t instanceof Float32Array?this.vertices=t:this.vertices=new Float32Array(t),this.texCoords instanceof Float32Array||(this.texCoords=new Float32Array(t.length/3*2)),this.verticesIndices.length=t.length/3;for(var e=0;e<t.length/3;e++)this.verticesIndices[e]=e,this.texCoords[2*e]=0,this.texCoords[2*e+1]=0}else console.error("CGL MESH : SetPointVertices: Array must be multiple of three.")},rt.prototype.merge=function(t){if(t){var e=this.verticesIndices.length,i=this.vertices.length/3;this.verticesIndices.length=this.verticesIndices.length+t.verticesIndices.length;for(var s=0;s<t.verticesIndices.length;s++)this.verticesIndices[e+s]=t.verticesIndices[s]+i;this.vertices=m.float32Concat(this.vertices,t.vertices),this.texCoords=m.float32Concat(this.texCoords,t.texCoords),this.vertexNormals=m.float32Concat(this.vertexNormals,t.vertexNormals),this.tangents=m.float32Concat(this.vertexNormals,t.tangents),this.bitangents=m.float32Concat(this.vertexNormals,t.bitangents)}},rt.prototype.copy=function(){var t=0,e=new rt;if(e.faceVertCount=this.faceVertCount,e.setVertices(this._vertices.slice(0)),this.verticesIndices)for(e.verticesIndices.length=this.verticesIndices.length,t=0;t<this.verticesIndices.length;t++)e.verticesIndices[t]=this.verticesIndices[t];for(e.texCoords=new Float32Array(this.texCoords.length),t=0;t<this.texCoords.length;t++)e.texCoords[t]=this.texCoords[t];for(e.texCoordsIndices.length=this.texCoordsIndices.length,t=0;t<this.texCoordsIndices.length;t++)e.texCoordsIndices[t]=this.texCoordsIndices[t];for(e.vertexNormals=new Float32Array(this.vertexNormals.length),t=0;t<this.vertexNormals.length;t++)e.vertexNormals[t]=this.vertexNormals[t];if(this.tangents)for(e.tangents=[],e.tangents.length=this.tangents.length,t=0;t<this.tangents.length;t++)e.tangents[t]=this.tangents[t];if(this.biTangents)for(e.biTangents=[],e.biTangents.length=this.biTangents.length,t=0;t<this.biTangents.length;t++)e.biTangents[t]=this.biTangents[t];for(e.barycentrics.length=this.barycentrics.length,t=0;t<this.barycentrics.length;t++)e.barycentrics[t]=this.barycentrics[t];for(e.morphTargets.length=this.morphTargets.length,t=0;t<this.morphTargets.length;t++)e.morphTargets[t]=this.morphTargets[t];for(e.vertexColors.length=this.vertexColors.length,t=0;t<this.vertexColors.length;t++)e.vertexColors[t]=this.vertexColors[t];return e},rt.prototype.calculateNormals=function(t){var e=vec3.create(),i=vec3.create(),s=vec3.create(),r=0;function n(r){return vec3.subtract(e,r[0],r[1]),vec3.subtract(i,r[0],r[2]),vec3.cross(s,e,i),vec3.normalize(s,s),t&&t.forceZUp&&s[2]<0&&(s[0]*=-1,s[1]*=-1,s[2]*=-1),s}for(this.getVertexVec=function(t){var e=[0,0,0];return e[0]=this.vertices[3*t+0],e[1]=this.vertices[3*t+1],e[2]=this.vertices[3*t+2],e},this.vertexNormals instanceof Float32Array&&this.vertexNormals.length==this.vertices.length||(this.vertexNormals=new Float32Array(this.vertices.length)),r=0;r<this.vertices.length;r++)this.vertexNormals[r]=0;if(this.isIndexed()){var o=[];for(o.length=this.verticesIndices.length/3,r=0;r<this.verticesIndices.length;r+=3){u=[this.getVertexVec(this.verticesIndices[r+0]),this.getVertexVec(this.verticesIndices[r+1]),this.getVertexVec(this.verticesIndices[r+2])];o[r/3]=n(u),this.vertexNormals[3*this.verticesIndices[r+0]+0]+=o[r/3][0],this.vertexNormals[3*this.verticesIndices[r+0]+1]+=o[r/3][1],this.vertexNormals[3*this.verticesIndices[r+0]+2]+=o[r/3][2],this.vertexNormals[3*this.verticesIndices[r+1]+0]+=o[r/3][0],this.vertexNormals[3*this.verticesIndices[r+1]+1]+=o[r/3][1],this.vertexNormals[3*this.verticesIndices[r+1]+2]+=o[r/3][2],this.vertexNormals[3*this.verticesIndices[r+2]+0]+=o[r/3][0],this.vertexNormals[3*this.verticesIndices[r+2]+1]+=o[r/3][1],this.vertexNormals[3*this.verticesIndices[r+2]+2]+=o[r/3][2]}for(r=0;r<this.verticesIndices.length;r+=3)for(var a=0;a<3;a++){var h=[this.vertexNormals[3*this.verticesIndices[r+a]+0],this.vertexNormals[3*this.verticesIndices[r+a]+1],this.vertexNormals[3*this.verticesIndices[r+a]+2]];vec3.normalize(h,h),this.vertexNormals[3*this.verticesIndices[r+a]+0]=h[0],this.vertexNormals[3*this.verticesIndices[r+a]+1]=h[
281],this.vertexNormals[3*this.verticesIndices[r+a]+2]=h[2]}}else{var l=[];for(r=0;r<this.vertices.length;r+=9){var u;s=n(u=[[this.vertices[r+0],this.vertices[r+1],this.vertices[r+2]],[this.vertices[r+3],this.vertices[r+4],this.vertices[r+5]],[this.vertices[r+6],this.vertices[r+7],this.vertices[r+8]]]);l.push(s[0],s[1],s[2],s[0],s[1],s[2],s[0],s[1],s[2])}this.vertexNormals=l}},rt.prototype.calcTangentsBitangents=function(){if(!this.vertices.length)return void console.error("Cannot calculate tangents/bitangents without vertices.");if(!this.vertexNormals.length)return void console.error("Cannot calculate tangents/bitangents without normals.");if(!this.texCoords.length)return void console.error("Cannot calculate tangents/bitangents without texture coordinates.");if(!this.verticesIndices.length)return void console.error("Cannot calculate tangents/bitangents without vertex indices.");if(this.verticesIndices.length%3!=0)return void console.error("Vertex indices mismatch!");const t=this.verticesIndices.length/3,e=this.vertices.length/3;this.tangents=new Float32Array(this.vertexNormals.length),this.biTangents=new Float32Array(this.vertexNormals.length);var i=[];i.length=2*e;const s=vec3.create(),r=vec3.create(),n=vec3.create(),o=vec2.create(),a=vec2.create(),h=vec2.create(),l=vec3.create(),u=vec3.create();for(var c=0;c<t;c+=1){const t=this.verticesIndices[3*c],p=this.verticesIndices[3*c+1],d=this.verticesIndices[3*c+2];vec3.set(s,this.vertices[3*t],this.vertices[3*t+1],this.vertices[3*t+2]),vec3.set(r,this.vertices[3*p],this.vertices[3*p+1],this.vertices[3*p+2]),vec3.set(n,this.vertices[3*d],this.vertices[3*d+1],this.vertices[3*d+2]),vec2.set(o,this.texCoords[2*t],this.texCoords[2*t+1]),vec2.set(a,this.texCoords[2*p],this.texCoords[2*p+1]),vec2.set(h,this.texCoords[2*d],this.texCoords[2*d+1]);const f=r[0]-s[0],g=n[0]-s[0],_=r[1]-s[1],m=n[1]-s[1],v=r[2]-s[2],E=n[2]-s[2],b=a[0]-o[0],y=h[0]-o[0],T=a[1]-o[1],A=h[1]-o[1],x=1/(b*A-y*T);vec3.set(l,(A*f-T*g)*x,(A*_-T*m)*x,(A*v-T*E)*x),vec3.set(u,(b*g-y*f)*x,(b*m-y*_)*x,(b*E-y*v)*x),i[t]=l,i[p]=l,i[d]=l,i[t+e]=u,i[p+e]=u,i[d+e]=u}const p=vec3.create(),d=vec3.create(),f=vec3.create(),g=vec3.create(),_=vec3.create(),m=vec3.create(),v=vec3.create(),E=vec3.create();for(var b=0;b<e;b+=1){if(!i[b])continue;vec3.set(p,this.vertexNormals[3*b],this.vertexNormals[3*b+1],this.vertexNormals[3*b+2]),vec3.set(d,i[b][0],i[b][1],i[b][2]);const t=vec3.dot(p,d);vec3.scale(_,p,t),vec3.subtract(m,d,_),vec3.normalize(E,m),vec3.cross(v,p,d);const s=vec3.dot(v,i[b+e])<0?-1:1;vec3.scale(f,E,1/s),vec3.cross(g,p,f),this.tangents[3*b+0]=f[0],this.tangents[3*b+1]=f[1],this.tangents[3*b+2]=f[2],this.biTangents[3*b+0]=g[0],this.biTangents[3*b+1]=g[1],this.biTangents[3*b+2]=g[2]}},rt.prototype.isIndexed=function(){return 0!=this.verticesIndices.length},rt.prototype.unIndex=function(t){var e=[],i=[],s=[],r=[],n=0,o=0;for(this.vertexNormals=[],o=0;o<this.verticesIndices.length;o+=3)e.push(this.vertices[3*this.verticesIndices[o+0]+0]),e.push(this.vertices[3*this.verticesIndices[o+0]+1]),e.push(this.vertices[3*this.verticesIndices[o+0]+2]),r.push(this.vertexNormals[3*this.verticesIndices[o+0]+0]),r.push(this.vertexNormals[3*this.verticesIndices[o+0]+1]),r.push(this.vertexNormals[3*this.verticesIndices[o+0]+2]),this.texCoords?(s.push(this.texCoords[2*this.verticesIndices[o+0]+0]),s.push(this.texCoords[2*this.verticesIndices[o+0]+1])):(s.push(0),s.push(0)),i.push(n),n++,e.push(this.vertices[3*this.verticesIndices[o+1]+0]),e.push(this.vertices[3*this.verticesIndices[o+1]+1]),e.push(this.vertices[3*this.verticesIndices[o+1]+2]),r.push(this.vertexNormals[3*this.verticesIndices[o+1]+0]),r.push(this.vertexNormals[3*this.verticesIndices[o+1]+1]),r.push(this.vertexNormals[3*this.verticesIndices[o+1]+2]),this.texCoords?(s.push(this.texCoords[2*this.verticesIndices[o+1]+0]),s.push(this.texCoords[2*this.verticesIndices[o+1]+1])):(s.push(0),s.push(0)),i.push(n),n++,e.push(this.vertices[3*this.verticesIndices[o+2]+0]),e.push(this.vertices[3*this.verticesIndices[o+2]+1]),e.push(this.vertices[3*this.verticesIndices[o+2]+2]),r.push(this.vertexNormals[3*this.verticesIndices[o+2]+0]),r.push(this.vertexNormals[3*this.verticesIndices[o+2]+1]),r.push(this.vertexNormals[3*this.verticesIndices[o+2]+2]),this.texCoords?(s.push(this.texCoords[2*this.verticesIndices[o+2]+0]),s.push(this.texCoords[2*this.verticesIndices[o+2]+1])):(s.push(0),s.push(0)),i.push(n),n++;this.vertices=e,this.texCoords=s,this.vertexNormals=r,this.verticesIndices.length=0,t&&(this.verticesIndices=i),this.calculateNormals()},rt.prototype.calcBarycentric=function(){this.barycentrics.length=this.vertices.length;var t=0;for(t=0;t<this.vertices.length;t++)this.barycentrics[t]=0;var e=0;for(t=0;t<this.vertices.length;t+=3)this.barycentrics[t+e]=1,3==++e&&(e=0)},rt.prototype.getBounds=function(){return new st(this)}
28,rt.prototype.center=function(t,e,i){void 0===t&&(t=!0,e=!0,i=!0);var s=0;const r=this.getBounds(),n=[r.minX+(r.maxX-r.minX)/2,r.minY+(r.maxY-r.minY)/2,r.minZ+(r.maxZ-r.minZ)/2];for(s=0;s<this.vertices.length;s+=3)this.vertices[s+0]==this.vertices[s+0]&&(t&&(this.vertices[s+0]-=n[0]),e&&(this.vertices[s+1]-=n[1]),i&&(this.vertices[s+2]-=n[2]));return n},rt.prototype.mapTexCoords2d=function(){var t=this.getBounds(),e=this.vertices.length/3;this.texCoords=new Float32Array(length=2*e);for(var i=0;i<e;i++){var s=this.vertices[3*i+0],r=this.vertices[3*i+1];this.texCoords[2*i+0]=s/(t.maxX-t.minX)+.5,this.texCoords[2*i+1]=1-r/(t.maxY-t.minY)+.5}},rt.buildFromFaces=function(t){for(var e=[],i=[],s=0;s<t.length;s+=3){for(var r=t[s+0],n=t[s+1],o=t[s+2],a=[-1,-1,-1],h=0;h<e;h+=3)e[h+0]==r[0]&&e[h+1]==r[1]&&e[h+2]==r[2]&&(a[0]=h/3),e[h+0]==n[0]&&e[h+1]==n[1]&&e[h+2]==n[2]&&(a[1]=h/3),e[h+0]==o[0]&&e[h+1]==o[1]&&e[h+2]==o[2]&&(a[2]=h/3);-1==a[0]&&(e.push(r[0],r[1],r[2]),a[0]=(e.length-1)/3),-1==a[1]&&(e.push(n[0],n[1],n[2]),a[1]=(e.length-1)/3),-1==a[2]&&(e.push(o[0],o[1],o[2]),a[2]=(e.length-1)/3),i.push(parseInt(a[0],10)),i.push(parseInt(a[1],10)),i.push(parseInt(a[2],10))}var l=new rt;return l.vertices=e,l.verticesIndices=i,l},rt.json2geom=function(t){var e=new rt;if(e.verticesIndices=[],e.vertices=t.vertices||[],e.vertexNormals=t.normals||[],e.vertexColors=t.colors||[],e.tangents=t.tangents||[],e.biTangents=t.bitangents||[],t.texturecoords&&e.setTexCoords(t.texturecoords[0]),t.vertices_b64&&(e.vertices=new Float32Array(d(t.vertices_b64))),t.normals_b64&&(e.vertexNormals=new Float32Array(d(t.normals_b64))),t.tangents_b64&&(e.tangents=new Float32Array(d(t.tangents_b64))),t.bitangents_b64&&(e.biTangents=new Float32Array(d(t.bitangents_b64))),t.texturecoords_b64&&e.setTexCoords(new Float32Array(d(t.texturecoords_b64[0]))),t.faces_b64)e.verticesIndices=new Uint32Array(d(t.faces_b64));else{e.verticesIndices.length=3*t.faces.length;for(var i=0;i<t.faces.length;i++)e.verticesIndices[3*i]=t.faces[i][0],e.verticesIndices[3*i+1]=t.faces[i][1],e.verticesIndices[3*i+2]=t.faces[i][2]}return e};const nt=function(t,e,i,s,r,n,o){if(this._loc=-1,this._type=e,this._name=i,this._shader=t,this._value=1e-5,this._oldValue=null,this._port=null,this._shader.addUniform(this),this.needsUpdate=!0,"f"==e)this.set=this.setValue=this.setValueF.bind(this),this.updateValue=this.updateValueF.bind(this);else if("f[]"==e)this.set=this.setValue=this.setValueArrayF.bind(this),this.updateValue=this.updateValueArrayF.bind(this);else if("3f[]"==e)this.set=this.setValue=this.setValueArray3F.bind(this),this.updateValue=this.updateValueArray3F.bind(this);else if("i"==e)this.set=this.setValue=this.setValueI.bind(this),this.updateValue=this.updateValueI.bind(this);else if("2i"==e)this.set=this.setValue=this.setValue2I.bind(this),this.updateValue=this.updateValue2I.bind(this);else if("3i"==e)this.set=this.setValue=this.setValue3I.bind(this),this.updateValue=this.updateValue3I.bind(this);else if("4i"==e)this.set=this.setValue=this.setValue4I.bind(this),this.updateValue=this.updateValue4I.bind(this);else if("b"==e)this.set=this.setValue=this.setValueBool.bind(this),this.updateValue=this.updateValueBool.bind(this);else if("4f"==e)this.set=this.setValue=this.setValue4F.bind(this),this.updateValue=this.updateValue4F.bind(this);else if("3f"==e)this.set=this.setValue=this.setValue3F.bind(this),this.updateValue=this.updateValue3F.bind(this);else if("2f"==e)this.set=this.setValue=this.setValue2F.bind(this),this.updateValue=this.updateValue2F.bind(this);else if("t"==e)this.set=this.setValue=this.setValueT.bind(this),this.updateValue=this.updateValueT.bind(this);else if("t[]"==e)this.set=this.setValue=this.setValueArrayT.bind(this),this.updateValue=this.updateValueArrayT.bind(this);else{if("m4"!=e)throw new Error("Unknown uniform type");this.set=this.setValue=this.setValueM4.bind(this),this.updateValue=this.updateValueM4.bind(this)}"object"==typeof s&&s instanceof B?(this._port=s,this._value=this._port.get(),this._port.onValueChanged=this.updateFromPort.bind(this),r&&n&&o?(this._value=[0,0,0,0],this._port2=r,this._port3=n,this._port4=o,this._port.onChange=this._port2.onChange=this._port3.onChange=this._port4.onChange=this.updateFromPort4f.bind(this),this.updateFromPort4f()):r&&n?(this._value=[0,0,0],this._port2=r,this._port3=n,this._port.onChange=this._port2.onChange=this._port3.onChange=this.updateFromPort3f.bind(this),this.updateFromPort3f()):r&&(this._value=[0,0],this._port2=r,this._port.onChange=this._port2.onChange=this.updateFromPort2f.bind(this),this.updateFromPort2f())):this._value=s,this.setValue(this._value),this.needsUpdate=!0};nt.prototype.getType=function(){return this._type},nt.prototype.getName=function(){return this._name},nt.prototype.getValue=function(){return this._value},nt.prototype.resetLoc=function(){this._loc=-1,this.needsUpdate=!0},nt.prototype.bindTextures=function(){return this._value},nt.prototype.resetLoc=function(){this._loc=-1,this.needsUpdate=!0},nt.prototype.bindTextures=function(){},nt.prototype.getLoc=function(){return this._loc},nt.prototype.updateFromPort4f=function(){this._value[0]=this._port.get(),this._value[1]=this._port2.get(),this._value[2]=this._port3.get(),this._value[3]=this._port4.get(),this.setValue(this._value)},nt.prototype.updateFromPort3f=function(){this._value[0]=this._port.get(),this._value[1]=this._port2.get(),this._value[2]=this._port3.get(),this.setValue(this._value)},nt.prototype.updateFromPort2f=function(){this._value[0]=this._port.get(),this._value[1]=this._port2.get(),this.setValue(this._value)},nt.prototype.updateFromPort=function(){this.setValue(this._port.get())},nt.prototype.updateValueF=function(){-1==this._loc?this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name):this.needsUpdate=!1,this._shader.getCgl().gl.uniform1f(this._loc,this._value),Q.profileUniformCount++},nt.prototype.setValueF=function(t){t!=this._value&&(this.needsUpdate=!0,this._value=t)},nt.prototype.updateValueI=function(){-1==this._loc?this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name):this.needsUpdate=!1,this._shader.getCgl().gl.uniform1i(this._loc,this._value),Q.profileUniformCount++},nt.prototype.updateValue2I=function(){this._value&&(-1==this._loc&&(this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name),Q.profileShaderGetUniform++,Q.profileShaderGetUniformName=this._name),this._shader.getCgl().gl.uniform2i(this._loc,this._value[0],this._value[1]),this.needsUpdate=!1,Q.profileUniformCount++)},nt.prototype.updateValue3I=function(){this._value&&(-1==this._loc&&(this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name),Q.profileShaderGetUniform++,Q.profileShaderGetUniformName=this._name),this._shader.getCgl().gl.uniform3i(this._loc,this._value[0],this._value[1],this._value[2]),this.needsUpdate=!1,Q.profileUniformCount++)},nt.prototype.updateValue4I=function(){-1==this._loc&&(this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name),Q.profileShaderGetUniform++,Q.profileShaderGetUniformName=this._name),this._shader.getCgl().gl.uniform4i(this._loc,this._value[0],this._value[1],this._value[2],this._value[3]),Q.profileUniformCount++},nt.prototype.setValueI=function(t){t!=this._value&&(this.needsUpdate=!0,this._value=t)},nt.prototype.setValue2I=function(t){t&&(this._oldValue?t[0]==this._oldValue[0]&&t[1]==this._oldValue[1]||(this._oldValue[0]=t[0],this._oldValue[1]=t[1],this.needsUpdate=!0):(this._oldValue=[t[0]-1,1],this.needsUpdate=!0),this._value=t)},nt.prototype.setValue3I=function(t){t&&(this._oldValue?t[0]==this._oldValue[0]&&t[1]==this._oldValue[1]&&t[2]==this._oldValue[2]||(this._oldValue[0]=t[0],this._oldValue[1]=t[1],this._oldValue[2]=t[2],this.needsUpdate=!0):(this._oldValue=[t[0]-1,1,2],this.needsUpdate=!0),this._value=t)},nt.prototype.setValue4I=function(t){this.needsUpdate=!0,this._value=t||vec4.create()},nt.prototype.updateValueBool=function(){-1==this._loc?this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name):this.needsUpdate=!1,this._shader.getCgl().gl.uniform1i(this._loc,this._value?1:0),Q.profileUniformCount++},nt.prototype.setValueBool=function(t){t!=this._value&&(this.needsUpdate=!0,this._value=t)},nt.prototype.setValueArray3F=function(t){this.needsUpdate=!0,this._value=t},nt.prototype.updateValueArray3F=function(){-1==this._loc?this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name):this.needsUpdate=!1,this._value&&(this._shader.getCgl().gl.uniform3fv(this._loc,this._value),Q.profileUniformCount++)},nt.prototype.setValueArrayF=function(t){this.needsUpdate=!0,this._value=t},nt.prototype.updateValueArrayF=function(){-1==this._loc?this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name):this.needsUpdate=!1,this._value&&(this._shader.getCgl().gl.uniform1fv(this._loc,this._value),Q.profileUniformCount++)},nt.prototype.setValueArrayT=function(t){this.needsUpdate=!0,this._value=t},nt.prototype.updateValueArrayT=function(){-1==this._loc?this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name):this.needsUpdate=!1,this._value&&(this._shader.getCgl().gl.uniform1iv(this._loc,this._value),Q.profileUniformCount++)},nt.prototype.updateValue3F=function(){this._value&&(-1==this._loc&&(this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name),Q.profileShaderGetUniform++,Q.profileShaderGetUniformName=this._name),this._shader.getCgl().gl.uniform3f(this._loc,this._value[0],this._value[1],this._value[2]),this.needsUpdate=!1,Q.profileUniformCount++)},nt.prototype.setValue3F=function(t){t&&(this._oldValue?t[0]==this._oldValue[0]&&t[1]==this._oldValue[1]&&t[2]==this._oldValue[2]||(this._oldValue[0]=t[0],this._oldValue[1]=t[1],this._oldValue[2]=t[2],this.needsUpdate=!0):(this._oldValue=[t[0]-1,1,2],this.needsUpdate=!0),this._value=t)},nt.prototype.updateValue2F=function(){this._value&&(-1==this._loc&&(this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name),Q.profileShaderGetUniform++,Q.profileShaderGetUniformName=this._name),this._shader.getCgl().gl.uniform2f(this._loc,this._value[0],this._value[1]),this.needsUpdate=!1,Q.profileUniformCount++)},nt.prototype.setValue2F=function(t){t&&(this._oldValue?t[0]==this._oldValue[0]&&t[1]==this._oldValue[1]||(this._oldValue[0]=t[0],this._oldValue[1]=t[1],this.needsUpdate=!0):(this._oldValue=[t[0]-1,1],this.needsUpdate=!0),this._value=t)},nt.prototype.updateValueT=function(){-1==this._loc&&(this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name),Q.profileShaderGetUniform++,Q.profileShaderGetUniformName=this._name,-1==this._loc&&g.log("texture this._loc unknown!!")),Q.profileUniformCount++,this._shader.getCgl().gl.uniform1i(this._loc,this._value),this.needsUpdate=!1},nt.prototype.setValueT=function(t){this.needsUpdate=!0,this._value=t},nt.prototype.updateValue4F=function(){-1==this._loc&&(this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name),Q.profileShaderGetUniform++,Q.profileShaderGetUniformName=this._name),this._shader.getCgl().gl.uniform4f(this._loc,this._value[0],this._value[1],this._value[2],this._value[3]),Q.profileUniformCount++},nt.prototype.setValue4F=function(t){this.needsUpdate=!0,this._value=t||vec4.create()},nt.prototype.updateValueM4=function(){-1==this._loc&&(this._loc=this._shader.getCgl().gl.getUniformLocation(this._shader.getProgram(),this._name),Q.profileShaderGetUniform++,Q.profileShaderGetUniformName=this._name),this._shader.getCgl().gl.uniformMatrix4fv(this._loc,!1,this._value),Q.profileUniformCount++},nt.prototype.setValueM4=function(t){this.needsUpdate=!0,this._value=t||mat4.create()};const ot=180/Math.PI,at={MATH:{DEG2RAD:Math.PI/180,RAD2DEG:ot},SHADER:{SHADERVAR_VERTEX_POSITION:"vPosition",SHADERVAR_VERTEX_NUMBER:"attrVertIndex",SHADERVAR_VERTEX_NORMAL:"attrVertNormal",SHADERVAR_VERTEX_TEXCOORD:"attrTexCoord",SHADERVAR_INSTANCE_MMATRIX:"instMat",SHADERVAR_UNI_PROJMAT:"projMatrix",SHADERVAR_UNI_VIEWMAT:"viewMatrix",SHADERVAR_UNI_MODELMAT:"modelMatrix",SHADERVAR_UNI_NORMALMAT:"normalMatrix",SHADERVAR_UNI_INVVIEWMAT:"inverseViewMatrix",SHADERVAR_UNI_VIEWPOS:"camPos"},BLEND_MODES:{BLEND_NONE:0,BLEND_NORMAL:1,BLEND_ADD:2,BLEND_SUB:3,BLEND_MUL:4}};const ht={lastMesh:null}
28,lt=function(t,e,i){this._cgl=t,this._bufVertexAttrib=null,this._bufVerticesIndizes=this._cgl.gl.createBuffer(),this._attributes=[],this._attribLocs={},this._geom=null,this._lastShader=null,this._numInstances=0,this._glPrimitive=i,this._preWireframeGeom=null,this.addVertexNumbers=!1,this.feedBackAttributes=[],this.setGeom(e),this._feedBacks=[],this._feedBacksChanged=!1,this._transformFeedBackLoc=-1,this._lastAttrUpdate=0,Object.defineProperty(this,"numInstances",{get(){return this._numInstances},set(t){this.setNumInstances(t)}})};var ut;lt.prototype.updateVertices=function(t){this.setAttribute(at.SHADER.SHADERVAR_VERTEX_POSITION,t.vertices,3)},lt.prototype.setAttributePointer=function(t,e,i,s){for(var r=0;r<this._attributes.length;r++)this._attributes[r].name==t&&(this._attributes[r].pointer||(this._attributes[r].pointer=[]),this._attributes[r].pointer.push({loc:-1,name:e,stride:i,offset:s,instanced:t==at.SHADER.SHADERVAR_INSTANCE_MMATRIX}))},lt.prototype.getAttribute=function(t){for(var e=0;e<this._attributes.length;e++)if(this._attributes[e].name==t)return this._attributes[e]},lt.prototype.addAttribute=lt.prototype.updateAttribute=lt.prototype.setAttribute=function(t,e,i,s){var r=null,n=null,o=!1,a=0,h=e.length/i;for(0===h&&console.warn("CGL_MESH: num items in attribute "+t+" is ZERO"),"function"==typeof s&&(n=s),"object"==typeof s&&(s.cb&&(n=s.cb),s.instanced&&(o=s.instanced)),t==at.SHADER.SHADERVAR_INSTANCE_MMATRIX&&(o=!0),e instanceof Float32Array?r=e:(r=new Float32Array(e),Q.profileNonTypedAttrib++,Q.profileNonTypedAttribNames=this._geom.name+" "+t),a=0;a<this._attributes.length;a++)if(this._attributes[a].name==t)return this._attributes[a].numItems=h,this._cgl.gl.bindBuffer(this._cgl.gl.ARRAY_BUFFER,this._attributes[a].buffer),this._cgl.gl.bufferData(this._cgl.gl.ARRAY_BUFFER,r,this._cgl.gl.DYNAMIC_DRAW),this._attributes[a];var l=this._cgl.gl.createBuffer();this._cgl.gl.bindBuffer(this._cgl.gl.ARRAY_BUFFER,l),this._cgl.gl.bufferData(this._cgl.gl.ARRAY_BUFFER,r,this._cgl.gl.DYNAMIC_DRAW);var u=this._cgl.gl.FLOAT;s&&s.type&&(u=s.type);var c={buffer:l,name:t,cb:n,itemSize:i,numItems:h,startItem:0,instanced:o,type:u};return t==at.SHADER.SHADERVAR_VERTEX_POSITION&&(this._bufVertexAttrib=c),this._attributes.push(c),this._attribLocs={},c},lt.prototype.getAttributes=function(){return this._attributes},lt.prototype.updateTexCoords=function(t){if(t.texCoords&&t.texCoords.length>0)this.setAttribute(at.SHADER.SHADERVAR_VERTEX_TEXCOORD,t.texCoords,2);else{var e=new Float32Array(Math.round(t.vertices.length/3*2));this.setAttribute(at.SHADER.SHADERVAR_VERTEX_TEXCOORD,e,2)}},lt.prototype.updateNormals=function(t){if(t.vertexNormals&&t.vertexNormals.length>0)this.setAttribute("attrVertNormal",t.vertexNormals,3);else{var e=new Float32Array(Math.round(t.vertices.length));this.setAttribute("attrVertNormal",e,3)}},lt.prototype._setVertexNumbers=function(){var t=this._geom.vertices.length/3;if(!this._verticesNumbers||this._verticesNumbers.length!=t){this._verticesNumbers=new Float32Array(t);for(var e=0;e<t;e++)this._verticesNumbers[e]=e;this.setAttribute(at.SHADER.SHADERVAR_VERTEX_NUMBER,this._verticesNumbers,1,(e,i,s)=>{s.uniformNumVertices||(s.uniformNumVertices=new nt(s,"f","numVertices",t)),s.uniformNumVertices.setValue(t)})}},lt.prototype.setVertexIndices=function(t){if(t.length>0){for(var e=0;e<t.length;e++)if(t[e]>=this._geom.vertices.length/3)return void console.warn("invalid index in "+this._geom.name);this._cgl.gl.bindBuffer(this._cgl.gl.ELEMENT_ARRAY_BUFFER,this._bufVerticesIndizes),t instanceof Uint16Array?this.vertIndicesTyped=t:this.vertIndicesTyped=new Uint16Array(t),this._cgl.gl.bufferData(this._cgl.gl.ELEMENT_ARRAY_BUFFER,this.vertIndicesTyped,this._cgl.gl.DYNAMIC_DRAW),this._bufVerticesIndizes.itemSize=1,this._bufVerticesIndizes.numItems=t.length}else this._bufVerticesIndizes.numItems=0},lt.prototype.setGeom=function(t){this._geom=t,null!=t.glPrimitive&&(this._glPrimitive=t.glPrimitive),ht.lastMesh=null,Q.profileMeshSetGeom++,this._disposeAttributes(),this.updateVertices(this._geom),this.setVertexIndices(this._geom.verticesIndices),this.updateTexCoords(this._geom),this.updateNormals(this._geom),this._geom.hasOwnProperty("tangents")&&this._geom.tangents&&this._geom.tangents.length>0&&this.setAttribute("attrTangent",this._geom.tangents,3),this._geom.hasOwnProperty("biTangents")&&this._geom.biTangents&&this._geom.biTangents.length>0&&this.setAttribute("attrBiTangent",this._geom.biTangents,3),this._geom.vertexColors.length>0&&(this._geom.vertexColors.flat&&this._geom.vertexColors.flat(100),this.setAttribute("attrVertColor",this._geom.vertexColors,4)),this.addVertexNumbers&&this._setVertexNumbers();var e=this._geom.getAttributes();for(var i in e)this.setAttribute(i,e[i].data,e[i].itemSize)},lt.prototype._preBind=function(t){for(var e=0;e<this._attributes.length;e++)this._attributes[e].cb&&this._attributes[e].cb(this._attributes[e],this._geom,t)},lt.prototype._bind=function(t){t!=this._lastShader&&this.unBind();var e=[];this._attribLocs[t.id]?e=this._attribLocs[t.id]:this._attribLocs[t.id]=e,this._lastShader=t;var i=0;if(t.lastCompile>this._lastAttrUpdate||e.length!=this._attributes.length)for(this._lastAttrUpdate=t.lastCompile,i=0;i<this._attributes.length;i++)e[i]=-1;for(i=0;i<this._attributes.length;i++){var s=this._attributes[i];if(-1==e[i]&&s._attrLocationLastShaderTime!=t.lastCompile&&(s._attrLocationLastShaderTime=t.lastCompile,e[i]=this._cgl.glGetAttribLocation(t.getProgram(),s.name),Q.profileAttrLoc++),-1!=e[i])if(this._cgl.gl.enableVertexAttribArray(e[i]),this._cgl.gl.bindBuffer(this._cgl.gl.ARRAY_BUFFER,s.buffer),s.instanced)if(s.itemSize<=4)s.itemSize&&0!=s.itemSize||g.log("instanced attrib itemsize error",this._geom.name,s),this._cgl.gl.vertexAttribPointer(e[i],s.itemSize,s.type,!1,4*s.itemSize,0),this._cgl.gl.vertexAttribDivisor(e[i],1);else if(16==s.itemSize){const t=64;this._cgl.gl.vertexAttribPointer(e[i],4,s.type,!1,t,0),this._cgl.gl.enableVertexAttribArray(e[i]+1),this._cgl.gl.vertexAttribPointer(e[i]+1,4,s.type,!1,t,16),this._cgl.gl.enableVertexAttribArray(e[i]+2),this._cgl.gl.vertexAttribPointer(e[i]+2,4,s.type,!1,t,32),this._cgl.gl.enableVertexAttribArray(e[i]+3),this._cgl.gl.vertexAttribPointer(e[i]+3,4,s.type,!1,t,48),this._cgl.gl.vertexAttribDivisor(e[i],1),this._cgl.gl.vertexAttribDivisor(e[i]+1,1),this._cgl.gl.vertexAttribDivisor(e[i]+2,1),this._cgl.gl.vertexAttribDivisor(e[i]+3,1)}else g.log("unknown instance attrib size",s.name);else{if(s.itemSize&&0!=s.itemSize||g.log("attrib itemsize error",this._geom.name,s),this._cgl.gl.vertexAttribPointer(e[i],s.itemSize,s.type,!1,4*s.itemSize,0),s.pointer)for(var r=0;r<s.pointer.length;r++){var n=s.pointer[r];-1==n.loc&&(n.loc=this._cgl.glGetAttribLocation(t.getProgram(),n.name)),Q.profileAttrLoc++,this._cgl.gl.enableVertexAttribArray(n.loc),this._cgl.gl.vertexAttribPointer(n.loc,s.itemSize,s.type,!1,n.stride,n.offset)}this.bindFeedback(s)}}0!==this._bufVerticesIndizes.numItems&&this._cgl.gl.bindBuffer(this._cgl.gl.ELEMENT_ARRAY_BUFFER,this._bufVerticesIndizes)},lt.prototype.unBind=function(){var t=this._lastShader;if(this._lastShader=null,t){var e=[];this._attribLocs[t.id]?e=this._attribLocs[t.id]:this._attribLocs[t.id]=e,ht.lastMesh=null;for(var i=0;i<this._attributes.length;i++)this._attributes[i].instanced&&(this._attributes[i].itemSize<=4?(-1!=e[i]&&this._cgl.gl.vertexAttribDivisor(e[i],0),e[i]>=0&&this._cgl.gl.disableVertexAttribArray(e[i])):(this._cgl.gl.vertexAttribDivisor(e[i],0),this._cgl.gl.vertexAttribDivisor(e[i]+1,0),this._cgl.gl.vertexAttribDivisor(e[i]+2,0),this._cgl.gl.vertexAttribDivisor(e[i]+3,0),this._cgl.gl.disableVertexAttribArray(e[i]+1),this._cgl.gl.disableVertexAttribArray(e[i]+2),this._cgl.gl.disableVertexAttribArray(e[i]+3))),-1!=e[i]&&this._cgl.gl.disableVertexAttribArray(e[i])}},lt.prototype.meshChanged=function(){return this._cgl.lastMesh&&this._cgl.lastMesh!=this},lt.prototype.printDebug=function(t){for(g.log("--attributes"),i=0;i<this._attributes.length;i++)g.log("attribute "+i+" "+this._attributes[i].name)},lt.prototype.setNumVertices=function(t){this._bufVertexAttrib.numItems=t},lt.prototype.render=function(t){if(t){t.wireframe||this._geom.isIndexed()||!this._preWireframeGeom||this.setGeom(this._preWireframeGeom),t.wireframe&&this._geom.isIndexed()&&(this._preWireframeGeom=this._geom,this._geom=this._geom.copy(),this._geom.unIndex(),this._geom.calcBarycentric(),this.setGeom(this._geom),this.setAttribute("attrBarycentric",this._geom.barycentrics,3));var e=!1;ht.lastMesh!=this&&(ht.lastMesh&&ht.lastMesh.unBind(),e=!0),e&&this._preBind(t),t.bind(),t.bindTextures&&t.bindTextures(),this._bind(t),this.addVertexNumbers&&this._setVertexNumbers(),ht.lastMesh=this;var i=this._cgl.gl.TRIANGLES;void 0!==this._glPrimitive&&(i=this._glPrimitive),null!==t.glPrimitive&&(i=t.glPrimitive),this.hasFeedbacks()?this.drawFeedbacks(t,i):0===this._bufVerticesIndizes.numItems?0===this._numInstances?this._cgl.gl.drawArrays(i,this._bufVertexAttrib.startItem,this._bufVertexAttrib.numItems-this._bufVertexAttrib.startItem):this._cgl.gl.drawArraysInstanced(i,this._bufVertexAttrib.startItem,this._bufVertexAttrib.numItems,this._numInstances):0===this._numInstances?this._cgl.gl.drawElements(i,this._bufVerticesIndizes.numItems,this._cgl.gl.UNSIGNED_SHORT,0):this._cgl.gl.drawElementsInstanced(i,this._bufVerticesIndizes.numItems,this._cgl.gl.UNSIGNED_SHORT,0,this._numInstances)}},lt.prototype.setNumInstances=function(t){if(this._numInstances=t,t>0){for(var e=new Float32Array(t),i=0;i<t;i++)e[i]=i;this.setAttribute("instanceIndex",e,1,{instanced:!0})}},lt.prototype._disposeAttributes=function(){if(this._attributes){for(var t=0;t<this._attributes.length;t++)this._attributes[t].buffer&&(this._cgl.gl.deleteBuffer(this._attributes[t].buffer),this._attributes[t].buffer=null);this._attributes.length=0}},lt.prototype.dispose=function(){this._bufVertexAttrib&&this._bufVertexAttrib.buffer&&this._cgl.gl.deleteBuffer(this._bufVertexAttrib.buffer),this._bufVerticesIndizes&&this._cgl.gl.deleteBuffer(this._bufVerticesIndizes),this._disposeAttributes()},(ut=lt).prototype.hasFeedbacks=function(){return this._feedBacks.length>0},ut.prototype.removeFeedbacks=function(t){this._feedbacks&&(this._feedbacks.length=0,this._feedBacksChanged=!0)},ut.prototype.setAttributeFeedback=function(){}
28,ut.prototype.setFeedback=function(t,e,i){var s={nameOut:e},r=!1;this.unBindFeedbacks();for(var n=0;n<this._feedBacks.length;n++)this._feedBacks[n].nameOut==e&&(s=this._feedBacks[n],r=!0);return r||(this._feedBacksChanged=!0),s.initialArr=i,s.attrib=t,s.outBuffer&&this._cgl.gl.deleteBuffer(s.outBuffer),s.outBuffer=this._cgl.gl.createBuffer(),this._cgl.gl.bindBuffer(this._cgl.gl.ARRAY_BUFFER,s.outBuffer),this._cgl.gl.bufferData(this._cgl.gl.ARRAY_BUFFER,s.initialArr,this._cgl.gl.STATIC_DRAW),this._cgl.gl.bindBuffer(this._cgl.gl.ARRAY_BUFFER,s.attrib.buffer),this._cgl.gl.bufferData(this._cgl.gl.ARRAY_BUFFER,s.initialArr,this._cgl.gl.STATIC_DRAW),r||this._feedBacks.push(s),s},ut.prototype.bindFeedback=function(t){if(this._feedBacks&&0!==this._feedBacks.length){-1==this._transformFeedBackLoc&&(this._transformFeedBackLoc=this._cgl.gl.createTransformFeedback()),this._cgl.gl.bindTransformFeedback(this._cgl.gl.TRANSFORM_FEEDBACK,this._transformFeedBackLoc);for(var e=0;e<this._feedBacks.length;e++){var i=this._feedBacks[e];i.attrib==t&&this._cgl.gl.bindBufferBase(this._cgl.gl.TRANSFORM_FEEDBACK_BUFFER,e,i.outBuffer)}}},ut.prototype.drawFeedbacks=function(t,e){var i=0;if(this._feedBacksChanged){var s=[];for(this._cgl.gl.bindTransformFeedback(this._cgl.gl.TRANSFORM_FEEDBACK,this._transformFeedBackLoc),i=0;i<this._feedBacks.length;i++)s.push(this._feedBacks[i].nameOut);return t.setFeedbackNames(s),g.log("feedbacknames",s),t.compile(),this._feedBacksChanged=!1,this._cgl.gl.bindTransformFeedback(this._cgl.gl.TRANSFORM_FEEDBACK,null),void g.log("changed finished")}this._cgl.gl.beginTransformFeedback(this.glPrimitive),this._cgl.gl.drawArrays(e,0,this._feedBacks[0].attrib.numItems),this._cgl.gl.endTransformFeedback(),this.unBindFeedbacks(),this.feedBacksSwapBuffers()},ut.prototype.unBindFeedbacks=function(){for(var t=0;t<this._feedBacks.length;t++)this._cgl.gl.bindBufferBase(this._cgl.gl.TRANSFORM_FEEDBACK_BUFFER,t,null);this._cgl.gl.bindTransformFeedback(this._cgl.gl.TRANSFORM_FEEDBACK,null)},ut.prototype.feedBacksSwapBuffers=function(){for(var t=0;t<this._feedBacks.length;t++){var e=this._feedBacks[t].attrib.buffer;this._feedBacks[t].attrib.buffer=this._feedBacks[t].outBuffer,this._feedBacks[t].outBuffer=e}};const ct={getSimpleRect:function(t,e){var i=new rt(e);return i.vertices=[1,1,0,-1,1,0,1,-1,0,-1,-1,0],i.texCoords=[1,1,0,1,1,0,0,0],i.verticesIndices=[0,1,2,2,1,3],i.vertexNormals=[0,0,0,0,0,0,0,0,0,0,0,0],new lt(t,i)}},pt=function(t,e){this._cgl=t,t.TextureEffectMesh||this.createMesh(),this._textureSource=null,this._textureTarget=null,this._frameBuf=this._cgl.gl.createFramebuffer(),this._frameBuf2=this._cgl.gl.createFramebuffer(),this._renderbuffer=this._cgl.gl.createRenderbuffer(),this._renderbuffer2=this._cgl.gl.createRenderbuffer(),this.switched=!1,this.depth=!1};pt.prototype.setSourceTexture=function(t){t.textureType==et.TYPE_FLOAT&&this._cgl.gl.getExtension("EXT_color_buffer_float"),null===t?(this._textureSource=new et(this._cgl),this._textureSource.setSize(16,16)):this._textureSource=t,this._textureSource.compareSettings(this._textureTarget)||(this._textureTarget&&this._textureTarget.delete(),this._textureTarget=this._textureSource.clone(),Q.profileEffectBuffercreate++,this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this._frameBuf),this._cgl.gl.bindRenderbuffer(this._cgl.gl.RENDERBUFFER,this._renderbuffer),this.depth&&this._cgl.gl.renderbufferStorage(this._cgl.gl.RENDERBUFFER,this._cgl.gl.DEPTH_COMPONENT16,this._textureSource.width,this._textureSource.height),this._cgl.gl.framebufferTexture2D(this._cgl.gl.FRAMEBUFFER,this._cgl.gl.COLOR_ATTACHMENT0,this._cgl.gl.TEXTURE_2D,this._textureTarget.tex,0),this.depth&&this._cgl.gl.framebufferRenderbuffer(this._cgl.gl.FRAMEBUFFER,this._cgl.gl.DEPTH_ATTACHMENT,this._cgl.gl.RENDERBUFFER,this._renderbuffer),this._cgl.gl.bindTexture(this._cgl.gl.TEXTURE_2D,null),this._cgl.gl.bindRenderbuffer(this._cgl.gl.RENDERBUFFER,null),this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,null),this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this._frameBuf2),this._cgl.gl.bindRenderbuffer(this._cgl.gl.RENDERBUFFER,this._renderbuffer2),this.depth&&this._cgl.gl.renderbufferStorage(this._cgl.gl.RENDERBUFFER,this._cgl.gl.DEPTH_COMPONENT16,this._textureSource.width,this._textureSource.height),this._cgl.gl.framebufferTexture2D(this._cgl.gl.FRAMEBUFFER,this._cgl.gl.COLOR_ATTACHMENT0,this._cgl.gl.TEXTURE_2D,this._textureSource.tex,0),this.depth&&this._cgl.gl.framebufferRenderbuffer(this._cgl.gl.FRAMEBUFFER,this._cgl.gl.DEPTH_ATTACHMENT,this._cgl.gl.RENDERBUFFER,this._renderbuffer2),this._cgl.gl.bindTexture(this._cgl.gl.TEXTURE_2D,null),this._cgl.gl.bindRenderbuffer(this._cgl.gl.RENDERBUFFER,null),this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,null))},pt.prototype.startEffect=function(){this._textureTarget?(this.switched=!1,this._cgl.pushDepthTest(!1),this._cgl.pushModelMatrix(),this._cgl.pushPMatrix(),this._cgl.gl.viewport(0,0,this.getCurrentTargetTexture().width,this.getCurrentTargetTexture().height),mat4.perspective(this._cgl.pMatrix,45,this.getCurrentTargetTexture().width/this.getCurrentTargetTexture().height,.1,1100),this._cgl.pushPMatrix(),mat4.identity(this._cgl.pMatrix),this._cgl.pushViewMatrix(),mat4.identity(this._cgl.vMatrix),this._cgl.pushModelMatrix(),mat4.identity(this._cgl.mvMatrix)):g.log("effect has no target")},pt.prototype.endEffect=function(){this._cgl.popDepthTest(!1),this._cgl.popModelMatrix(),this._cgl.popPMatrix(),this._cgl.popModelMatrix(),this._cgl.popViewMatrix(),this._cgl.popPMatrix(),this._cgl.resetViewPort()},pt.prototype.bind=function(){null!==this._textureSource?this.switched?(this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this._frameBuf2),this._cgl.pushGlFrameBuffer(this._frameBuf2)):(this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this._frameBuf),this._cgl.pushGlFrameBuffer(this._frameBuf)):g.log("no base texture set!")},pt.prototype.finish=function(){null!==this._textureSource?(this._cgl.TextureEffectMesh.render(this._cgl.getShader()),this._cgl.gl.bindFramebuffer(this._cgl.gl.FRAMEBUFFER,this._cgl.popGlFrameBuffer()),this._textureTarget.filter==et.FILTER_MIPMAP&&(this.switched?(this._cgl.gl.bindTexture(this._cgl.gl.TEXTURE_2D,this._textureSource.tex),this._textureSource.updateMipMap()):(this._cgl.gl.bindTexture(this._cgl.gl.TEXTURE_2D,this._textureTarget.tex),this._textureTarget.updateMipMap()),this._cgl.gl.bindTexture(this._cgl.gl.TEXTURE_2D,null)),this.switched=!this.switched):g.log("no base texture set!")},pt.prototype.getCurrentTargetTexture=function(){return this.switched?this._textureSource:this._textureTarget},pt.prototype.getCurrentSourceTexture=function(){return this.switched?this._textureTarget:this._textureSource},pt.prototype.delete=function(){this._textureTarget&&this._textureTarget.delete(),this._textureSource&&this._textureSource.delete(),this._cgl.gl.deleteRenderbuffer(this._renderbuffer),this._cgl.gl.deleteFramebuffer(this._frameBuf)},pt.prototype.createMesh=function(){this._cgl.TextureEffectMesh=ct.getSimpleRect(this._cgl,"textureEffect rect")},pt.checkOpNotInTextureEffect=function(t){return t.uiAttribs.error&&!t.patch.cgl.currentTextureEffect?(t.uiAttr({error:null}),!0):!t.patch.cgl.currentTextureEffect||(t.patch.cgl.currentTextureEffect&&!t.uiAttribs.error?(t.uiAttr({error:"This op can not be a child of a ImageCompose/texture effect! imagecompose should only have textureeffect childs."}),!1):!t.patch.cgl.currentTextureEffect)},pt.checkOpInEffect=function(t){return t.patch.cgl.currentTextureEffect&&t.uiAttribs.error?(t.uiAttr({error:null}),!0):!!t.patch.cgl.currentTextureEffect||(t.patch.cgl.currentTextureEffect||t.uiAttribs.error?!!t.patch.cgl.currentTextureEffect:(t.uiAttr({error:'This op must be a child of a texture effect! More infos <a href="https://docs.cables.gl/image_composition/image_composition.html" target="_blank">here</a>.'}),!1))},pt.getBlendCode=function(){return"".endl()+"vec3 _blend(vec3 base,vec3 blend)".endl()+"{".endl()+" vec3 colNew=blend;".endl()+" #ifdef BM_MULTIPLY".endl()+" colNew=base*blend;".endl()+" #endif".endl()+" #ifdef BM_MULTIPLY_INV".endl()+" colNew=base* vec3(1.0)-blend;".endl()+" #endif".endl()+" #ifdef BM_AVERAGE".endl()+" colNew=((base + blend) / 2.0);".endl()+" #endif".endl()+" #ifdef BM_ADD".endl()+" colNew=min(base + blend, vec3(1.0));".endl()+" #endif".endl()+" #ifdef BM_SUBSTRACT".endl()+" colNew=max(base + blend - vec3(1.0), vec3(0.0));".endl()+" #endif".endl()+" #ifdef BM_DIFFERENCE".endl()+" colNew=abs(base - blend);".endl()+" #endif".endl()+" #ifdef BM_NEGATION".endl()+" colNew=(vec3(1.0) - abs(vec3(1.0) - base - blend));".endl()+" #endif".endl()+" #ifdef BM_EXCLUSION".endl()+" colNew=(base + blend - 2.0 * base * blend);".endl()+" #endif".endl()+" #ifdef BM_LIGHTEN".endl()+" colNew=max(blend, base);".endl()+" #endif".endl()+" #ifdef BM_DARKEN".endl()+" colNew=min(blend, base);".endl()+" #endif".endl()+" #ifdef BM_OVERLAY".endl()+" #define BlendOverlayf(base, blend) (base < 0.5 ? (2.0 * base * blend) : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)))".endl()+" colNew=vec3(BlendOverlayf(base.r, blend.r),BlendOverlayf(base.g, blend.g),BlendOverlayf(base.b, blend.b));".endl()+" #endif".endl()+" #ifdef BM_SCREEN".endl()+" #define BlendScreenf(base, blend) (1.0 - ((1.0 - base) * (1.0 - blend)))".endl()+" colNew=vec3(BlendScreenf(base.r, blend.r),BlendScreenf(base.g, blend.g),BlendScreenf(base.b, blend.b));".endl()+" #endif".endl()+" #ifdef BM_SOFTLIGHT".endl()+" #define BlendSoftLightf(base, blend) ((blend < 0.5) ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend)))".endl()+" colNew=vec3(BlendSoftLightf(base.r, blend.r),BlendSoftLightf(base.g, blend.g),BlendSoftLightf(base.b, blend.b));".endl()+" #endif".endl()+" #ifdef BM_HARDLIGHT".endl()+" #define BlendOverlayf(base, blend) (base < 0.5 ? (2.0 * base * blend) : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)))".endl()+" colNew=vec3(BlendOverlayf(base.r, blend.r),BlendOverlayf(base.g, blend.g),BlendOverlayf(base.b, blend.b));".endl()+" #endif".endl()+" #ifdef BM_COLORDODGE".endl()+" #define BlendColorDodgef(base, blend) ((blend == 1.0) ? blend : min(base / (1.0 - blend), 1.0))".endl()+" colNew=vec3(BlendColorDodgef(base.r, blend.r),BlendColorDodgef(base.g, blend.g),BlendColorDodgef(base.b, blend.b));".endl()+" #endif".endl()+" #ifdef BM_COLORBURN".endl()+" #define BlendColorBurnf(base, blend) ((blend == 0.0) ? blend : max((1.0 - ((1.0 - base) / blend)), 0.0))".endl()+" colNew=vec3(BlendColorBurnf(base.r, blend.r),BlendColorBurnf(base.g, blend.g),BlendColorBurnf(base.b, blend.b));
28".endl()+" #endif".endl()+" return colNew;".endl()+"}".endl()+"vec4 cgl_blend(vec4 oldColor,vec4 newColor,float amount)".endl()+"{".endl()+" vec4 col=vec4( _blend(oldColor.rgb,newColor.rgb) ,1.0);".endl()+" col=vec4( mix( col.rgb, oldColor.rgb ,1.0-oldColor.a*amount),1.0);".endl()+" return col;".endl()+"}"},pt.onChangeBlendSelect=function(t,e){"normal"==e?t.define("BM_NORMAL"):t.removeDefine("BM_NORMAL"),"multiply"==e?t.define("BM_MULTIPLY"):t.removeDefine("BM_MULTIPLY"),"multiply invert"==e?t.define("BM_MULTIPLY_INV"):t.removeDefine("BM_MULTIPLY_INV"),"average"==e?t.define("BM_AVERAGE"):t.removeDefine("BM_AVERAGE"),"add"==e?t.define("BM_ADD"):t.removeDefine("BM_ADD"),"substract"==e?t.define("BM_SUBSTRACT"):t.removeDefine("BM_SUBSTRACT"),"difference"==e?t.define("BM_DIFFERENCE"):t.removeDefine("BM_DIFFERENCE"),"negation"==e?t.define("BM_NEGATION"):t.removeDefine("BM_NEGATION"),"exclusion"==e?t.define("BM_EXCLUSION"):t.removeDefine("BM_EXCLUSION"),"lighten"==e?t.define("BM_LIGHTEN"):t.removeDefine("BM_LIGHTEN"),"darken"==e?t.define("BM_DARKEN"):t.removeDefine("BM_DARKEN"),"overlay"==e?t.define("BM_OVERLAY"):t.removeDefine("BM_OVERLAY"),"screen"==e?t.define("BM_SCREEN"):t.removeDefine("BM_SCREEN"),"softlight"==e?t.define("BM_SOFTLIGHT"):t.removeDefine("BM_SOFTLIGHT"),"hardlight"==e?t.define("BM_HARDLIGHT"):t.removeDefine("BM_HARDLIGHT"),"color dodge"==e?t.define("BM_COLORDODGE"):t.removeDefine("BM_COLORDODGE"),"color burn"==e?t.define("BM_COLORBURN"):t.removeDefine("BM_COLORBURN")},pt.AddBlendSelect=function(t,e){return t.inValueSelect(e,["normal","lighten","darken","multiply","multiply invert","average","add","substract","difference","negation","exclusion","overlay","screen","color dodge","color burn","softlight","hardlight"],"normal")},pt.setupBlending=function(t,e,i,s){t.setPortGroup("Blending",[i,s]),i.onChange=function(){pt.onChangeBlendSelect(e,i.get());var s=i.get();"normal"==s?s=null:"multiply"==s?s="mul":"multiply invert"==s?s="mulinv":"lighten"==s?s="light":"darken"==s?s="darken":"average"==s?s="avg":"substract"==s?s="sub":"difference"==s?s="diff":"negation"==s?s="neg":"negation"==s?s="neg":"negation"==s?s="neg":"exclusion"==s?s="exc":"overlay"==s?s="ovl":"color dodge"==s?s="dodge":"color burn"==s?s="burn":"softlight"==s?s="soft":"hardlight"==s&&(s="hard"),t.setUiAttrib({extendTitle:s})}};const dt={"CGL.BLENDMODES":function(){this.name="blendmodes",this.srcHeadFrag=pt.getBlendCode()},"CGL.RANDOM_OLD":function(){this.name="randomNumber",this.srcHeadFrag="".endl()+"float cgl_random(vec2 co)".endl()+"{".endl()+" return fract(sin(dot(co.xy ,vec2(12.9898,4.1414))) * 432758.5453);".endl()+"}".endl()+"vec3 cgl_random3(vec2 co)".endl()+"{".endl()+" return vec3( cgl_random(co),cgl_random(co+0.5711),cgl_random(co+1.5711));".endl()+"}"},"CGL.RANDOM_LOW":function(){this.name="randomNumber",this.srcHeadFrag="".endl()+"float cgl_random(vec2 co)".endl()+"{".endl()+" return fract(sin(dot(co.xy ,vec2(12.9898,4.1414))) * 358.5453);".endl()+"}".endl()+"vec3 cgl_random3(vec2 co)".endl()+"{".endl()+" return vec3( cgl_random(co),cgl_random(co+0.5711),cgl_random(co+1.5711));".endl()+"}"},"CGL.RANDOM_TEX":function(){this.name="randomNumbertex",this.srcHeadFrag="".endl()+"UNI sampler2D CGLRNDTEX;".endl()+"float cgl_random(vec2 co)".endl()+"{".endl()+" return texture(CGLRNDTEX,co*5711.0).r;".endl()+"}".endl()+"vec3 cgl_random3(vec2 co)".endl()+"{".endl()+" return texture(CGLRNDTEX,co*5711.0).rgb;".endl()+"}",this.initUniforms=function(t){return[new nt(t,"t","CGLRNDTEX",7)]},this.onBind=function(t,e){et.getRandomTexture(t),t.setTexture(7,et.getRandomTexture(t).tex)}}},ft=function(){return window.performance.now()},gt=function(){return ft()},_t=function(){this._timeStart=ft(),this._timeOffset=0,this._currentTime=0,this._lastTime=0,this._paused=!0,this._delay=0,this._eventsPaused=!1,this.overwriteTime=-1,this.cbPlayPause=[],this.cbTimeChange=[]};_t.prototype._getTime=function(){return this._lastTime=(ft()-this._timeStart)/1e3,this._lastTime+this._timeOffset},_t.prototype._eventPlayPause=function(){if(!this._eventsPaused)for(var t in this.cbPlayPause)this.cbPlayPause[t]()},_t.prototype._eventTimeChange=function(){if(!this._eventsPaused)for(var t in this.cbTimeChange)this.cbTimeChange[t]()},_t.prototype.setDelay=function(t){this._delay=t,this._eventTimeChange()},_t.prototype.isPlaying=function(){return!this._paused},_t.prototype.update=function(){if(!this._paused)return this._currentTime=this._getTime(),this._currentTime},_t.prototype.getMillis=function(){return 1e3*this.get()},_t.prototype.get=_t.prototype.getTime=function(){return this.overwriteTime>=0?this.overwriteTime-this._delay:this._currentTime-this._delay},_t.prototype.togglePlay=function(){this._paused?this.play():this.pause()},_t.prototype.setTime=function(t){t<0&&(t=0),this._timeStart=ft(),this._timeOffset=t,this._currentTime=t,this._eventTimeChange()},_t.prototype.setOffset=function(t){this._currentTime+t<0?(this._timeStart=ft(),this._timeOffset=0,this._currentTime=0):(this._timeOffset+=t,this._currentTime=this._lastTime+this._timeOffset),this._eventTimeChange()},_t.prototype.play=function(){this._timeStart=ft(),this._paused=!1,this._eventPlayPause()},_t.prototype.pause=function(){this._timeOffset=this._currentTime,this._paused=!0,this._eventPlayPause()},_t.prototype.pauseEvents=function(t){this._eventsPaused=t},_t.prototype.onPlayPause=function(t){t&&"function"==typeof t&&this.cbPlayPause.push(t)},_t.prototype.onTimeChange=function(t){t&&"function"==typeof t&&this.cbTimeChange.push(t)};const mt=Math.PI/180,vt=(Math.PI,-1!=window.navigator.userAgent.indexOf("Windows")),Et=function(t){var e;if(t.wheelDelta)e=t.wheelDelta%120-0==-0?t.wheelDelta/120:t.wheelDelta/30,e*=-1.5,vt&&(e*=2);else{var i=t.deltaY;t.shiftKey&&(i=t.deltaX);var s=i||t.detail;e=-(s%3?10*s:s/3),e*=-3}return e>20&&(e=20),e<-20&&(e=-20),e},bt=Et,yt=Et,Tt={"&":"&","<":"<",">":">",'"':""","'":"'"},At=/[&<>"']/g,xt=RegExp(At.source),Pt=function(t,e){if(!t)throw new Error("shader constructed without cgl "+e);this._cgl=t,this._name=e||"unknown",this.glslVersion=0,t.glVersion>1&&(this.glslVersion=300),this.id=I(),this._program=null,this._uniforms=[],this._drawBuffers=[!0],this._defines=[],this._needsRecompile=!0,this._projMatrixUniform=null,this._mvMatrixUniform=null,this._mMatrixUniform=null,this._vMatrixUniform=null,this._camPosUniform=null,this._normalMatrixUniform=null,this._inverseViewMatrixUniform=null,this._attrVertexPos=-1,this.precision=t.patch.config.glslPrecision||"highp",this._pMatrixState=-1,this._vMatrixState=-1,this._modGroupCount=0,this._feedBackNames=[],this._attributes=[],this.glPrimitive=null,this.offScreenPass=!1,this._extensions=[],this.srcVert=this.getDefaultVertexShader(),this.srcFrag=this.getDefaultFragmentShader(),this.lastCompile=0,this._moduleNames=[],this._modules=[],this._moduleNumId=0,this._libs=[],this._textureStackUni=[],this._textureStackTex=[],this._textureStackType=[],this._tempNormalMatrix=mat4.create(),this._tempCamPosMatrix=mat4.create(),this._tempInverseViewMatrix=mat4.create(),this.setModules(["MODULE_VERTEX_POSITION","MODULE_COLOR","MODULE_BEGIN_FRAG"])};Pt.prototype.getCgl=function(){return this._cgl},Pt.prototype.getName=function(){return this._name},Pt.prototype.enableExtension=function(t){this.setWhyCompile("enable extension "+t),this._needsRecompile=!0,this._extensions.push(t)},Pt.prototype.getAttrVertexPos=function(){return this._attrVertexPos},Pt.prototype.hasTextureUniforms=function(){for(var t=0;t<this._uniforms.length;t++)if("t"==this._uniforms[t].getType())return!0;return!1},Pt.prototype.setWhyCompile=function(t){},Pt.prototype.setSource=function(t,e){this.srcVert=t,this.srcFrag=e,this.setWhyCompile("Source changed"),this._needsRecompile=!0},Pt.prototype._addLibs=function(t){for(var e in dt)if(t.indexOf(e)>-1){var i=new dt[e];t=t.replace("{{"+e+"}}",i.srcHeadFrag),this._libs.push(i),i.initUniforms&&i.initUniforms(this)}return t},Pt.prototype.compile=function(){Q.profileShaderCompiles++,Q.profileShaderCompileName=this._name;var t="";if(this._extensions)for(i=0;i<this._extensions.length;i++)t+="#extension "+this._extensions[i]+" : enable".endl();var e="",i=0;for(i=0;i<this._defines.length;i++)e+="#define "+this._defines[i][0]+" "+this._defines[i][1]+"".endl();if(this._uniforms)for(i=0;i<this._uniforms.length;i++)this._uniforms[i].resetLoc();this.hasTextureUniforms()&&(e+="#define HAS_TEXTURES".endl());var s="",r="";if(300==this.glslVersion){var n="",o=0;if(this.srcFrag.indexOf("outColor0")>-1&&(this._drawBuffers[0]=!0),this.srcFrag.indexOf("outColor1")>-1&&(this._drawBuffers[1]=!0),this.srcFrag.indexOf("outColor2")>-1&&(this._drawBuffers[2]=!0),this.srcFrag.indexOf("outColor3")>-1&&(this._drawBuffers[3]=!0),1==this._drawBuffers.length)n="out vec4 outColor;".endl(),n+="#define gl_FragColor outColor".endl();else{o=0;n+="vec4 outColor;".endl();for(i=0;i<this._drawBuffers.length;i++)0==o&&(n+="#define gl_FragColor outColor"+i+"".endl()),n+="layout(location = "+i+") out vec4 outColor"+i+";".endl(),o++}s="#version 300 es".endl()+"// ".endl()+"// vertex shader "+this._name.endl()+"// ".endl()+"precision "+this.precision+" float;".endl()+"".endl()+"#define WEBGL2".endl()+"#define texture2D texture".endl()+"#define UNI uniform".endl()+"#define IN in".endl()+"#define OUT out".endl(),r="#ver
28sion 300 es".endl()+"// ".endl()+"// fragment shader "+this._name.endl()+"// ".endl()+"precision "+this.precision+" float;".endl()+"".endl()+"#define WEBGL2".endl()+"#define texture2D texture".endl()+"#define IN in".endl()+"#define UNI uniform".endl()+n.endl()}else r="".endl()+"// ".endl()+"// fragment shader "+this._name.endl()+"// ".endl()+"#define WEBGL1".endl()+"#define texture texture2D".endl()+"#define outColor gl_FragColor".endl()+"#define IN varying".endl()+"#define UNI uniform".endl(),s="".endl()+"// ".endl()+"// vertex shader "+this._name.endl()+"// ".endl()+"#define WEBGL1".endl()+"#define texture texture2D".endl()+"#define OUT varying".endl()+"#define IN attribute".endl()+"#define UNI uniform".endl();-1==r.indexOf("precision")&&(r="precision "+this.precision+" float;".endl()+r),-1==s.indexOf("precision")&&(s="precision "+this.precision+" float;".endl()+s),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(r+="#define MOBILE".endl(),s+="#define MOBILE".endl()),s=t+s+e+this.srcVert,r=t+r+e+this.srcFrag;var a="",h="";this._modules.sort(function(t,e){return t.group-e.group}),this._modules.sort(function(t,e){return t.priority||0-e.priority||0});var l=!1;for(i=0;i<this._moduleNames.length;i++){for(var u="",c="",p=0;p<this._modules.length;p++)if(this._modules[p].name==this._moduleNames[i]){if(a+="\n//---- MOD: "+this._modules[p].group+": "+p+" - "+this._modules[p].title+" ------\n",h+="\n//---- MOD: "+this._modules[p].group+": "+p+" - "+this._modules[p].title+" ------\n",u+="\n\n//---- MOD: "+this._modules[p].title+" ------\n",c+="\n\n//---- MOD: "+this._modules[p].title+" ------\n",!l){l=!0;for(var d=0;d<this._attributes.length;d++)this._attributes[d].name&&this._attributes[d].type&&(a+="".endl()+"#ifndef ATTRIB_"+this._attributes[d].name.endl()+" #define ATTRIB_"+this._attributes[d].name.endl()+" IN "+this._attributes[d].type+" "+this._attributes[d].name+";".endl()+"#endif",this._attributes[d].nameFrag&&(a+="".endl()+"#ifndef ATTRIB_"+this._attributes[d].nameFrag.endl()+" #define ATTRIB_"+this._attributes[d].nameFrag.endl()+" OUT "+this._attributes[d].type+" "+this._attributes[d].nameFrag+";".endl()+"#endif",u+="".endl()+this._attributes[d].nameFrag+"="+this._attributes[d].name+";"),h+="".endl()+"#ifndef ATTRIB_"+this._attributes[d].nameFrag.endl()+" #define ATTRIB_"+this._attributes[d].nameFrag.endl()+" IN "+this._attributes[d].type+" "+this._attributes[d].nameFrag+";".endl()+"#endif")}a+=this._modules[p].srcHeadVert||"",h+=this._modules[p].srcHeadFrag||"",u+=this._modules[p].srcBodyVert||"",c+=this._modules[p].srcBodyFrag||"",a+="\n//---- end mod ------\n",h+="\n//---- end mod ------\n",c+="\n//---- end mod ------\n",u=(u+="\n//---- end mod ------\n").replace(/{{mod}}/g,this._modules[p].prefix),c=c.replace(/{{mod}}/g,this._modules[p].prefix),a=a.replace(/{{mod}}/g,this._modules[p].prefix),h=h.replace(/{{mod}}/g,this._modules[p].prefix),u=u.replace(/MOD_/g,this._modules[p].prefix),c=c.replace(/MOD_/g,this._modules[p].prefix),a=a.replace(/MOD_/g,this._modules[p].prefix),h=h.replace(/MOD_/g,this._modules[p].prefix)}s=s.replace("{{"+this._moduleNames[i]+"}}",u),r=r.replace("{{"+this._moduleNames[i]+"}}",c)}if(s=s.replace("{{MODULES_HEAD}}",a),r=r.replace("{{MODULES_HEAD}}",h),s=this._addLibs(s),r=this._addLibs(r),this._program)for(this._program=this._createProgram(s,r),this._projMatrixUniform=null,i=0;i<this._uniforms.length;i++)this._uniforms[i].resetLoc();else this._program=this._createProgram(s,r);this.finalShaderFrag=r,this.finalShaderVert=s,ht.lastMesh=null,ht.lastShader=null,this._needsRecompile=!1,this.lastCompile=gt()},Pt.prototype.bind=function(){var t=0;if(ht.lastShader=this,this._program&&!this._needsRecompile||this.compile(),!this._projMatrixUniform)for(this._attrVertexPos=this._cgl.glGetAttribLocation(this._program,at.SHADER.SHADERVAR_VERTEX_POSITION),this._projMatrixUniform=this._cgl.gl.getUniformLocation(this._program,at.SHADER.SHADERVAR_UNI_PROJMAT),this._mvMatrixUniform=this._cgl.gl.getUniformLocation(this._program,"mvMatrix"),this._vMatrixUniform=this._cgl.gl.getUniformLocation(this._program,at.SHADER.SHADERVAR_UNI_VIEWMAT),this._mMatrixUniform=this._cgl.gl.getUniformLocation(this._program,at.SHADER.SHADERVAR_UNI_MODELMAT),this._camPosUniform=this._cgl.gl.getUniformLocation(this._program,at.SHADER.SHADERVAR_UNI_VIEWPOS),this._normalMatrixUniform=this._cgl.gl.getUniformLocation(this._program,at.SHADER.SHADERVAR_UNI_NORMALMAT),this._inverseViewMatrixUniform=this._cgl.gl.getUniformLocation(this._program,at.SHADER.SHADERVAR_UNI_INVVIEWMAT),t=0;t<this._uniforms.length;t++)this._uniforms[t].needsUpdate=!0;for(this._cgl.currentProgram!=this._program&&(Q.profileShaderBinds++,this._cgl.gl.useProgram(this._program),this._cgl.currentProgram=this._program),t=0;t<this._uniforms.length;
28t++)this._uniforms[t].needsUpdate&&this._uniforms[t].updateValue();if(this._pMatrixState!=this._cgl.getProjectionMatrixStateCount()&&(this._pMatrixState=this._cgl.getProjectionMatrixStateCount(),this._cgl.gl.uniformMatrix4fv(this._projMatrixUniform,!1,this._cgl.pMatrix),Q.profileMVPMatrixCount++),this._vMatrixUniform)this._vMatrixState!=this._cgl.getViewMatrixStateCount()&&(this._cgl.gl.uniformMatrix4fv(this._vMatrixUniform,!1,this._cgl.vMatrix),Q.profileMVPMatrixCount++,this._vMatrixState=this._cgl.getViewMatrixStateCount(),this._inverseViewMatrixUniform&&(mat4.invert(this._tempInverseViewMatrix,this._cgl.vMatrix),this._cgl.gl.uniformMatrix4fv(this._inverseViewMatrixUniform,!1,this._tempInverseViewMatrix),Q.profileMVPMatrixCount++)),this._cgl.gl.uniformMatrix4fv(this._mMatrixUniform,!1,this._cgl.mMatrix),Q.profileMVPMatrixCount++,this._camPosUniform&&(mat4.invert(this._tempCamPosMatrix,this._cgl.vMatrix),this._cgl.gl.uniform3f(this._camPosUniform,this._tempCamPosMatrix[12],this._tempCamPosMatrix[13],this._tempCamPosMatrix[14]),Q.profileMVPMatrixCount++);else{var e=mat4.create();mat4.mul(e,this._cgl.vMatrix,this._cgl.mMatrix),this._cgl.gl.uniformMatrix4fv(this._mvMatrixUniform,!1,e),Q.profileMVPMatrixCount++}this._normalMatrixUniform&&(mat4.invert(this._tempNormalMatrix,this._cgl.mMatrix),mat4.transpose(this._tempNormalMatrix,this._tempNormalMatrix),this._cgl.gl.uniformMatrix4fv(this._normalMatrixUniform,!1,this._tempNormalMatrix),Q.profileMVPMatrixCount++);for(t=0;t<this._libs.length;t++)this._libs[t].onBind&&this._libs[t].onBind.bind(this._libs[t])(this._cgl,this);this._bindTextures()},Pt.prototype.toggleDefine=function(t,e){e?this.define(t):this.removeDefine(t)},Pt.prototype.define=function(t,e){e||(e="");for(var i=0;i<this._defines.length;i++){if(this._defines[i][0]==t&&this._defines[i][1]==e)return;if(this._defines[i][0]==t)return this._defines[i][1]=e,void(this._needsRecompile=!0)}this._defines.push([t,e]),this._needsRecompile=!0,this.setWhyCompile("define "+t+" "+e)},Pt.prototype.getDefines=function(){return this._defines},Pt.prototype.getDefine=function(t){for(var e=0;e<this._defines.length;e++)if(this._defines[e][0]==t)return this._defines[e][1];return null},Pt.prototype.hasDefine=function(t){for(var e=0;e<this._defines.length;e++)if(this._defines[e][0]==t)return!0},Pt.prototype.removeDefine=function(t){for(var e=0;e<this._defines.length;e++)if(this._defines[e][0]==t)return this._defines.splice(e,1),void(this._needsRecompile=!0)},Pt.prototype.removeModule=function(t){for(var e=0;e<this._modules.length;e++)if(t&&t.id&&(this._modules[e].id==t.id||!this._modules[e])){for(var i=!0;i;){i=!1;for(var s=0;s<this._uniforms.length;s++)0!=this._uniforms[s].getName().indexOf(t.prefix)||(this._uniforms.splice(s,1),i=!0)}this._needsRecompile=!0,this.setWhyCompile("remove module "+t.title),this._modules.splice(e,1);break}},Pt.prototype.getNumModules=function(){return this._modules.length},Pt.prototype.getCurrentModules=function(){return this._modules},Pt.prototype.addModule=function(t,e){return t.id||(t.id=x()),t.numId||(t.numId=this._moduleNumId),t.num||(t.num=this._modules.length),t.group=e?e.group:this._modGroupCount++,t.prefix="mod"+t.group,this._modules.push(t),this._needsRecompile=!0,this.setWhyCompile("add module "+t.title),this._moduleNumId++,t},Pt.prototype.setModules=function(t){this._moduleNames=t},Pt.prototype.dispose=function(){this._cgl.gl.deleteProgram(this._program)},Pt.prototype.setDrawBuffers=function(t){this._drawBuffers=t,this._needsRecompile=!0},Pt.prototype.getUniforms=function(){return this._uniforms},Pt.prototype.getUniform=function(t){for(var e=0;e<this._uniforms.length;e++)if(this._uniforms[e].getName()==t)return this._uniforms[e];return null},Pt.prototype.removeUniform=function(t){for(var e=0;e<this._uniforms.length;e++)this._uniforms[e].getName()==t&&this._uniforms.splice(e,1);this._needsRecompile=!0,this.setWhyCompile("remove uniform "+t)},Pt.prototype.addUniform=function(t){this._uniforms.push(t),this.setWhyCompile("add uniform "+name),this._needsRecompile=!0},Pt.prototype._createProgram=function(t,e){var i=this._cgl.gl.createProgram();return this.vshader=Pt.createShader(this._cgl,t,this._cgl.gl.VERTEX_SHADER,this),this.fshader=Pt.createShader(this._cgl,e,this._cgl.gl.FRAGMENT_SHADER,this),this._cgl.gl.attachShader(i,this.vshader),this._cgl.gl.attachShader(i,this.fshader),this._linkProgram(i),i},Pt.prototype.hasErrors=function(){return this._hasErrors},Pt.prototype._linkProgram=function(t){this._feedBackNames.length>0&&this._cgl.gl.transformFeedbackVaryings(t,this._feedBackNames,this._cgl.gl.SEPARATE_ATTRIBS),this._cgl.gl.linkProgram(t),!1!==this._cgl.patch.config.glValidateShader&&(this._cgl.gl.validateProgram(t),this._cgl.gl.getProgramParameter(t,this._cgl.gl.LINK_STATUS)||(console.warn(this._cgl.gl.getShaderInfoLog(this.fshader)),console.warn(this._cgl.gl.getShaderInfoLog(this.vshader)),console.error(name+" shader linking fail..."),g.log("srcFrag",this.srcFrag),g.log("srcVert",this.srcVert),g.log(name+" programinfo: ",this._cgl.gl.getProgramInfoLog(t)),g.log("--------------------------------------"),g.log(this),g.log("--------------------------------------"),name="errorshader",this.setSource(Pt.getDefaultVertexShader(),Pt.getErrorFragmentShader())))},Pt.prototype.getProgram=function(){return this._program},Pt.prototype.setFeedbackNames=function(t){this._needsRecompile=!0,this._feedBackNames=t},Pt.prototype.getDefaultVertexShader=Pt.getDefaultVertexShader=function(){return"".endl()+"{{MODULES_HEAD}}".endl()+"IN vec3 vPosition;".endl()+"IN vec2 attrTexCoord;".endl()+"IN vec3 attrVertNormal;".endl()+"IN float attrVertIndex;".endl()+"OUT vec2 texCoord;".endl()+"OUT vec3 norm;".endl()+"UNI mat4 projMatrix;".endl()+"UNI mat4 viewMatrix;".endl()+"UNI mat4 modelMatrix;".endl()+"void main()".endl()+"{".endl()+" texCoord=attrTexCoord;".endl()+" norm=attrVertNormal;".endl()+" vec4 pos=vec4(vPosition, 1.0);".endl()+" mat4 mMatrix=modelMatrix;".endl()+" {{MODULE_VERTEX_POSITION}}".endl()+" gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;".endl()+"}"},Pt.prototype.getDefaultFragmentShader=Pt.getDefaultFragmentShader=function(t,e,
28i){return null==t&&(t=.5,e=.5,i=.5),"".endl()+"IN vec2 texCoord;".endl()+"{{MODULES_HEAD}}".endl()+"void main()".endl()+"{".endl()+" vec4 col=vec4("+t+","+e+","+i+",1.0);".endl()+" {{MODULE_COLOR}}".endl()+" outColor = col;".endl()+"}"},Pt.prototype.addAttribute=function(t){for(var e=0;e<this._attributes.length;e++)if(this._attributes[e].name==t.name&&this._attributes[e].nameFrag==t.nameFrag)return;this._attributes.push(t),this._needsRecompile=!0},Pt.prototype.bindTextures=Pt.prototype._bindTextures=function(){this._textureStackTex.length>this._cgl.maxTextureUnits&&console.log("[shader._bindTextures] too many textures bound",this._textureStackTex.length+"/"+this._cgl.maxTextureUnits);for(var t=0;t<this._textureStackTex.length;t++)this._textureStackTex[t]?this._textureStackUni[t]?(this._textureStackUni[t].setValue(t),this._cgl.setTexture(t,this._textureStackTex[t],this._textureStackType[t])):(console.log("no uniform for pushtexture",this._name),this._cgl.setTexture(t,this._textureStackTex[t],this._textureStackType[t])):console.log("no texture for pushtexture",this._name)},Pt.prototype.pushTexture=function(t,e,i){if(!t)throw new Error("no uniform given to texturestack");if(!e)throw new Error("no texture given to texturestack");this._textureStackUni.push(t),this._textureStackTex.push(e),this._textureStackType.push(i)},Pt.prototype.popTexture=function(){this._textureStackUni.pop(),this._textureStackTex.pop(),this._textureStackType.pop()},Pt.prototype.popTextures=function(){this._textureStackTex.length=this._textureStackType.length=this._textureStackUni.length=0},Pt.getErrorFragmentShader=function(){return"".endl()+"void main()".endl()+"{".endl()+" float g=mod((gl_FragCoord.y+gl_FragCoord.x),50.0)/50.0;".endl()+" g= step(0.1,g);".endl()+" outColor = vec4( g+0.5, 0.0, 0.0, 1.0);".endl()+"}"},Pt.createShader=function(t,e,i,s){var r,n=t.gl.createShader(i);if(t.gl.shaderSource(n,e),t.gl.compileShader(n),!t.gl.getShaderParameter(n,t.gl.COMPILE_STATUS)){g.log("compile status: "),i==t.gl.VERTEX_SHADER&&g.log("VERTEX_SHADER"),i==t.gl.FRAGMENT_SHADER&&g.log("FRAGMENT_SHADER"),console.warn(t.gl.getShaderInfoLog(n));var o=t.gl.getShaderInfoLog(n),a=function(t){var e=[],i=t.split("\n");for(var s in i){var r=i[s].split(":");parseInt(r[2],10)&&e.push(parseInt(r[2],10))}return e}(o),h='<div class="shaderErrorCode">',l=e.match(/^.*((\r\n|\n|\r)|$)/gm);for(var u in l){var c=parseInt(u,10)+1,p=c+": "+l[u];g.log(p);var d=!1;for(var f in a)a[f]==c&&(d=!0);d&&(h+='<span class="error">'),h+=(r=p)&&xt.test(r)?r.replace(At,function(t){return Tt[t]}):r||"",d&&(h+="</span>")}console.warn(o),h=(o=o.replace(/\n/g,"<br/>"))+"<br/>"+h+"<br/><br/>",t.patch.emitEvent("criticalError","Shader error "+name,h),t.patch.isEditorMode()&&g.log("Shader error "+name,h),h+="</div>",name="errorshader",s.setSource(Pt.getDefaultVertexShader(),Pt.getErrorFragmentShader())}return n};const It=function(){this._arr=[mat4.create()],this._index=0,this.stateCounter=0};It.prototype.push=function(t){if(this._index++,this.stateCounter++,this._index==this._arr.length){var e=mat4.create();this._arr.push(e)}return mat4.copy(this._arr[this._index],t||this._arr[this._index-1]),this._arr[this._index]},It.prototype.pop=function(){return this.stateCounter++,this._index--,this._index<0&&(this._index=0),this._arr[this._index]},It.prototype.length=function(){return this._index};const Ot=function(t){var e=this,i=[0,0,0,0];this.glVersion=0,this.glUseHalfFloatTex=!1,this.clearCanvasTransparent=!0,this.clearCanvasDepth=!0,this.patch=t,this.maxTextureUnits=0,this.currentProgram=null,this.temporaryTexture=null,this.frameStore={},this.gl=null,this.pMatrix=mat4.create(),this.mMatrix=mat4.create(),this.vMatrix=mat4.create(),this._textureslots=[],this._pMatrixStack=new It,this._mMatrixStack=new It,this._vMatrixStack=new It,this._glFrameBufferStack=[],this._frameBufferStack=[],this._shaderStack=[],Object.defineProperty(this,"mvMatrix",{get(){return this.mMatrix},set(t){this.mMatrix=t}}),this.canvas=null,this.pixelDensity=1,mat4.identity(this.mMatrix),mat4.identity(this.vMatrix);var s=new Pt(this,"simpleshader");s.setModules(["MODULE_VERTEX_POSITION","MODULE_COLOR","MODULE_BEGIN_FRAG"]),s.setSource(Pt.getDefaultVertexShader(),Pt.getDefaultFragmentShader());var r=s,n=[];this.addEventListener=function(t,e){"resize"==t&&n.push(e)},this.removeEventListener=function(t,e){if("resize"==t)for(var i in n)if(n[i]==e)return void n.splice(i,1)},this.exitError=function(t,e){this.patch.exitError(t,e),this.aborted=!0},this.setCanvas=function(t){if(this.canvas="string"==typeof t?document.getElementById(t):t,this.patch.config.canvas||(this.patch.config.canvas={}),this.patch.config.canvas.hasOwnProperty("preserveDrawingBuffer")||(this.patch.config.canvas.preserveDrawingBuffer=!1),this.patch.config.canvas.hasOwnProperty("premultipliedAlpha")||(this.patch.config.canvas.premultipliedAlpha=!1),this.patch.config.canvas.hasOwnProperty("alpha")||(this.patch.config.canvas.alpha=!1),this.patch.config.hasOwnProperty("clearCanvasColor")&&(this.clearCanvasTransparent=this.patch.config.clearCanvasColor),this.patch.config.hasOwnProperty("clearCanvasDepth")&&(this.clearCanvasDepth=this.patch.config.clearCanvasDepth),this.patch.config.canvas.forceWebGl1||(this.gl=this.canvas.getContext("webgl2",this.patch.config.canvas)),this.gl&&"WebGL 1.0"!=this.gl.getParameter(this.gl.VERSION)?this.glVersion=2:(this.gl=this.canvas.getContext("webgl",this.patch.config.canvas)||this.canvas.getContext("experimental-webgl",this.patch.config.canvas),this.glVersion=1,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&(this.glUseHalfFloatTex=!0),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&(this.patch.config.canvas.hasOwnProperty("powerPreference")||(this.patch.config.canvas.powerPreference="high-performance"))),this.gl){this.gl.getExtension("OES_standard_derivatives"),this.gl.getExtension("GL_OES_standard_derivatives");var i=this.gl.getExtension("ANGLE_instanced_arrays")||this.gl;this.maxTextureUnits=this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS),i.vertexAttribDivisorANGLE&&(this.gl.vertexAttribDivisor=i.vertexAttribDivisorANGLE.bind(i),this.gl.drawElementsInstanced=i.drawElementsInstancedANGLE.bind(i)),e.updateSize()}else this.exitError("NO_WEBGL","sorry, could not initialize WebGL. Please check if your Browser supports WebGL.")},this.updateSize=function(){this.canvas.width=this.canvasWidth=this.canvas.clientWidth*this.pixelDensity,this.canvas.height=this.canvasHeight=this.canvas.clientHeight*this.pixelDensity},this.canvasWidth=-1,this.canvasHeight=-1,this.canvasScale=1;var o=-1,a=-1;this.getViewPort=function(){return i},this.resetViewPort=function(){this.gl.viewport(i[0],i[1],i[2],i[3])},this.setViewPort=function(t,e,s,r){i[0]=Math.round(t),i[1]=Math.round(e),i[2]=Math.round(s),i[3]=Math.round(r),this.gl.viewport(i[0],i[1],i[2],i[3])},this.beginFrame=function(){this.patch.isEditorMode()&&(gui.metaTexturePreviewer.render(),CABLES.UI.patchPreviewer&&CABLES.UI.patchPreviewer.render()),e.setShader(s)}
28,this.screenShot=function(t,e,i,s){e&&(this.gl.clearColor(1,1,1,1),this.gl.colorMask(!1,!1,!1,!0),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.colorMask(!0,!0,!0,!0)),this.canvas&&this.canvas.toBlob&&this.canvas.toBlob(e=>{t?t(e):g.log("no screenshot callback...")},i,s)},this.endFrame=function(){if(this.patch.isEditorMode()&&CABLES.GL_MARKER.drawMarkerLayer(this),e.setPreviousShader(),this._vMatrixStack.length()>0&&g.warn("view matrix stack length !=0 at end of rendering..."),this._mMatrixStack.length()>0&&g.warn("mvmatrix stack length !=0 at end of rendering..."),this._pMatrixStack.length()>0&&g.warn("pmatrix stack length !=0 at end of rendering..."),this._glFrameBufferStack.length>0&&g.warn("glFrameBuffer stack length !=0 at end of rendering..."),this._stackDepthTest.length>0&&g.warn("depthtest stack length !=0 at end of rendering..."),this._stackDepthWrite.length>0&&g.warn("depthwrite stack length !=0 at end of rendering..."),this._stackDepthFunc.length>0&&g.warn("depthfunc stack length !=0 at end of rendering..."),this._stackBlend.length>0&&g.warn("blend stack length !=0 at end of rendering..."),this._stackBlendMode.length>0&&g.warn("blendMode stack length !=0 at end of rendering..."),this._shaderStack.length>0&&g.warn("this._shaderStack length !=0 at end of rendering..."),this._stackCullFace.length>0&&g.warn("this._stackCullFace length !=0 at end of rendering..."),this._stackCullFaceFacing.length>0&&g.warn("this._stackCullFaceFacing length !=0 at end of rendering..."),o!=e.canvasWidth||a!=e.canvasHeight){o=e.canvasWidth,a=e.canvasHeight,this.setSize(e.canvasWidth/this.pixelDensity,e.canvasHeight/this.pixelDensity),this.updateSize();for(var t=0;t<n.length;t++)n[t]()}}
28,this.getShader=function(){if(r&&(!this.frameStore||!0===this.frameStore.renderOffscreen==r.offScreenPass==!0))return r;for(var t=this._shaderStack.length-1;t>=0;t--)if(this._shaderStack[t]&&this.frameStore.renderOffscreen==this._shaderStack[t].offScreenPass)return this._shaderStack[t]},this.getDefaultShader=function(){return s},this.setShader=function(t){this._shaderStack.push(t),r=t},this.setPreviousShader=function(){if(0===this._shaderStack.length)throw"Invalid shader stack pop!";this._shaderStack.pop(),r=this._shaderStack[this._shaderStack.length-1]},this.pushGlFrameBuffer=function(t){this._glFrameBufferStack.push(t)},this.popGlFrameBuffer=function(){return 0==this._glFrameBufferStack.length?null:(this._glFrameBufferStack.pop(),this._glFrameBufferStack[this._glFrameBufferStack.length-1])},this.getCurrentGlFrameBuffer=function(){return 0===this._glFrameBufferStack.length?null:this._glFrameBufferStack[this._glFrameBufferStack.length-1]},this.pushFrameBuffer=function(t){this._frameBufferStack.push(t)},this.popFrameBuffer=function(){return 0==this._frameBufferStack.length?null:(this._frameBufferStack.pop(),this._frameBufferStack[this._frameBufferStack.length-1])},this.getCurrentFrameBuffer=function(){return 0===this._frameBufferStack.length?null:this._frameBufferStack[this._frameBufferStack.length-1]};var h=vec3.create();vec3.set(h,0,0,2);var l=vec3.create();vec3.set(l,0,0,0),this.renderStart=function(t,e,i){e||(e=l),i||(i=h),this.pushDepthTest(!0),this.pushDepthWrite(!0),this.pushDepthFunc(t.gl.LEQUAL),this.pushCullFaceFacing(t.gl.BACK),this.pushCullFace(!1),this.clearCanvasTransparent&&(t.gl.clearColor(0,0,0,0),t.gl.clear(t.gl.COLOR_BUFFER_BIT)),this.clearCanvasDepth&&t.gl.clear(t.gl.DEPTH_BUFFER_BIT),t.setViewPort(0,0,t.canvasWidth,t.canvasHeight),mat4.perspective(t.pMatrix,45,t.canvasWidth/t.canvasHeight,.1,1e3),mat4.identity(t.mMatrix),mat4.identity(t.vMatrix),mat4.translate(t.mMatrix,t.mMatrix,e),mat4.translate(t.vMatrix,t.vMatrix,i),t.pushPMatrix(),t.pushModelMatrix(),t.pushViewMatrix(),t.pushBlendMode(at.BLEND_MODES.BLEND_NORMAL,!1);for(var s=0;s<this._textureslots.length;s++)this._textureslots[s]=null;t.beginFrame()},this.renderEnd=function(t,e){t.popViewMatrix(),t.popModelMatrix(),t.popPMatrix(),this.popDepthTest(),this.popDepthWrite(),this.popDepthFunc(),this.popCullFaceFacing(),this.popCullFace(),this.popBlend(),this.popBlendMode(),t.endFrame()},this.getTexture=function(t){return this._textureslots[t]},this.setTexture=function(t,e,i){this._textureslots[t]!=e&&(this.gl.activeTexture(this.gl.TEXTURE0+t),this.gl.bindTexture(i||this.gl.TEXTURE_2D,e),this._textureslots[t]=e)},this.fullScreen=function(){this.canvas.requestFullscreen?this.canvas.requestFullscreen():this.canvas.mozRequestFullScreen?this.canvas.mozRequestFullScreen():this.canvas.webkitRequestFullscreen?this.canvas.webkitRequestFullscreen():this.canvas.msRequestFullscreen&&this.canvas.msRequestFullscreen()},this.setSize=function(t,e){this.canvas.style.width=t+"px",this.canvas.style.height=e+"px",this.canvas.width=t*this.pixelDensity,this.canvas.height=e*this.pixelDensity,this.updateSize()},this._resizeToWindowSize=function(){this.setSize(window.innerWidth,window.innerHeight),this.updateSize()},this._resizeToParentSize=function(){var t=this.canvas.parentElement;t?(this.setSize(t.clientWidth,t.clientHeight),this.updateSize()):console.error("cables: can not resize to container element")},this.setAutoResize=function(t){window.removeEventListener("resize",this._resizeToWindowSize.bind(this)),window.removeEventListener("resize",this._resizeToParentSize.bind(this)),"window"==t&&(window.addEventListener("resize",this._resizeToWindowSize.bind(this)),window.addEventListener("orientationchange",this._resizeToWindowSize.bind(this)),this._resizeToWindowSize()),"parent"==t&&(window.addEventListener("resize",this._resizeToParentSize.bind(this)),this._resizeToParentSize())},this.printError=function(t){var e=this.gl.getError();if(e!=this.gl.NO_ERROR){var i="";e==this.gl.OUT_OF_MEMORY&&(i="OUT_OF_MEMORY"),e==this.gl.INVALID_ENUM&&(i="INVALID_ENUM"),e==this.gl.INVALID_OPERATION&&(i="INVALID_OPERATION"),e==this.gl.INVALID_FRAMEBUFFER_OPERATION&&(i="INVALID_FRAMEBUFFER_OPERATION"),e==this.gl.INVALID_VALUE&&(i="INVALID_VALUE"),e==this.gl.CONTEXT_LOST_WEBGL&&(i="CONTEXT_LOST_WEBGL"),e==this.gl.NO_ERROR&&(i="NO_ERROR"),g.log("gl error: ",t,e,i)}}
28,this.saveScreenshot=function(t,e,i,s,r){this.patch.renderOneFrame();var n=this.canvas.clientWidth,o=this.canvas.clientHeight;function a(t,e,i){return Array(e-String(t).length+1).join(i||"0")+t}i&&(this.canvas.width=i,n=i),s&&(this.canvas.height=s,o=s);var h=new Date,l="".concat(String(h.getFullYear())+String(h.getMonth()+1)+String(h.getDate()),"_").concat(a(h.getHours(),2)).concat(a(h.getMinutes(),2)).concat(a(h.getSeconds(),2));t?t+=".png":t="cables_"+l+".png",this.patch.cgl.screenShot(function(i){if(this.canvas.width=n,this.canvas.height=o,i){var s=document.createElement("a");s.download=t,s.href=URL.createObjectURL(i),setTimeout(function(){s.click(),e&&e(i)},100)}else g.log("screenshot: no blob")}.bind(this),r)}};Ot.prototype.pushViewMatrix=function(){this.vMatrix=this._vMatrixStack.push(this.vMatrix)},Ot.prototype.popViewMatrix=function(){this.vMatrix=this._vMatrixStack.pop()},Ot.prototype.getViewMatrixStateCount=function(){return this._vMatrixStack.stateCounter},Ot.prototype.pushPMatrix=function(){this.pMatrix=this._pMatrixStack.push(this.pMatrix)},Ot.prototype.popPMatrix=function(){return this.pMatrix=this._pMatrixStack.pop(),this.pMatrix},Ot.prototype.getProjectionMatrixStateCount=function(){return this._pMatrixStack.stateCounter},Ot.prototype.pushMvMatrix=Ot.prototype.pushModelMatrix=function(){this.mMatrix=this._mMatrixStack.push(this.mMatrix)},Ot.prototype.popMvMatrix=Ot.prototype.popmMatrix=Ot.prototype.popModelMatrix=function(){return this.mMatrix=this._mMatrixStack.pop(),this.mMatrix},Ot.prototype.modelMatrix=function(){return this.mMatrix},Ot.prototype._stackDepthTest=[],Ot.prototype.pushDepthTest=function(t){this._stackDepthTest.push(t),t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST)},Ot.prototype.stateDepthTest=function(){return this._stackDepthTest[this._stackDepthTest.length-1]},Ot.prototype.popDepthTest=function(){this._stackDepthTest.pop(),this._stackDepthTest[this._stackDepthTest.length-1]?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST)},Ot.prototype._stackDepthWrite=[],Ot.prototype.pushDepthWrite=function(t){this._stackDepthWrite.push(t),this.gl.depthMask(t)},Ot.prototype.stateDepthWrite=function(){return this._stackDepthWrite[this._stackDepthWrite.length-1]},Ot.prototype.popDepthWrite=function(){this._stackDepthWrite.pop(),this.gl.depthMask(this._stackDepthWrite[this._stackDepthWrite.length-1])},Ot.prototype._stackCullFace=[],Ot.prototype.pushCullFace=function(t){this._stackCullFace.push(t),t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE)},Ot.prototype.stateCullFace=function(){return this._stackCullFace[this._stackCullFace.length-1]},Ot.prototype.popCullFace=function(){this._stackCullFace.pop(),this._stackCullFace[this._stackCullFace.length-1]?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE)},Ot.prototype._stackCullFaceFacing=[],Ot.prototype.pushCullFaceFacing=function(t){this._stackCullFaceFacing.push(t),this.gl.cullFace(this._stackCullFaceFacing[this._stackCullFaceFacing.length-1])},Ot.prototype.stateCullFaceFacing=function(){return this._stackCullFaceFacing[this._stackCullFaceFacing.length-1]},Ot.prototype.popCullFaceFacing=function(){this._stackCullFaceFacing.pop(),this._stackCullFaceFacing.length>0&&this.gl.cullFace(this._stackCullFaceFacing[this._stackCullFaceFacing.length-1])},Ot.prototype._stackDepthFunc=[],Ot.prototype.pushDepthFunc=function(t){this._stackDepthFunc.push(t),this.gl.depthFunc(t)},Ot.prototype.stateDepthFunc=function(){return this._stackDepthFunc.length>0&&this._stackDepthFunc[this._stackDepthFunc.length-1]},Ot.prototype.popDepthFunc=function(){this._stackDepthFunc.pop(),this._stackDepthFunc.length>0&&this.gl.depthFunc(this._stackDepthFunc[this._stackDepthFunc.length-1])},Ot.prototype._stackBlend=[],Ot.prototype.pushBlend=function(t){this._stackBlend.push(t),t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND)},Ot.prototype.popBlend=function(){this._stackBlend.pop(),this._stackBlend[this._stackBlend.length-1]?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND)},Ot.prototype.stateBlend=function(){return this._stackBlend[this._stackBlend.length-1]};Ot.prototype._stackBlendMode=[],Ot.prototype._stackBlendModePremul=[],Ot.prototype.pushBlendMode=function(t,e){this._stackBlendMode.push(t),this._stackBlendModePremul.push(e);const i=this._stackBlendMode.length-1;this.pushBlend(this._stackBlendMode[i]!==at.BLEND_MODES.BLEND_NONE),this._setBlendMode(this._stackBlendMode[i],this._stackBlendModePremul[i])},Ot.prototype.popBlendMode=function(){this._stackBlendMode.pop(),this._stackBlendModePremul.pop();const t=this._stackBlendMode.length-1;this.popBlend(this._stackBlendMode[t]!==at.BLEND_MODES.BLEND_NONE),t>0&&this._setBlendMode(this._stackBlendMode[t],this._stackBlendModePremul[t])},Ot.prototype.glGetAttribLocation=function(t,e){const i=this.gl.getAttribLocation(t,e);return i},Ot.prototype._setBlendMode=function(t,e){const i=this.gl;t==at.BLEND_MODES.BLEND_NONE||(t==at.BLEND_MODES.BLEND_ADD?e?(i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD),i.blendFuncSeparate(i.ONE,i.ONE,i.ONE,i.ONE)):(i.blendEquation(i.FUNC_ADD),i.blendFunc(i.SRC_ALPHA,i.ONE)):t==at.BLEND_MODES.BLEND_SUB?e?(i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD),i.blendFuncSeparate(i.ZERO,i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ONE_MINUS_SRC_ALPHA)):(i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ZERO,i.ONE_MINUS_SRC_COLOR)):t==at.BLEND_MODES.BLEND_MUL?e?(i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD),i.blendFuncSeparate(i.ZERO,i.SRC_COLOR,i.ZERO,i.SRC_ALPHA)):(i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ZERO,i.SRC_COLOR)):t==at.BLEND_MODES.BLEND_NORMAL?e?(i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD),i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA)):(i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD),i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA)):g.log("setblendmode: unknown blendmode"))};
28const St=Object.assign({Framebuffer:function(t,e,i,s){var r=t,n=r.gl.getExtension("WEBGL_depth_texture")||r.gl.getExtension("WEBKIT_WEBGL_depth_texture")||r.gl.getExtension("MOZ_WEBGL_depth_texture")||r.gl.DEPTH_TEXTURE;n||r.exitError("NO_DEPTH_TEXTURE","no depth texture support");var o=e||512,a=i||512;(s=s||{isFloatingPointTexture:!1}).hasOwnProperty("filter")||(s.filter=et.FILTER_LINEAR);var h=new et(r,{isFloatingPointTexture:s.isFloatingPointTexture,filter:s.filter,wrap:et.CLAMP_TO_EDGE}),l=null;n&&(l=new et(r,{isDepthTexture:!0}));var u=r.gl.createFramebuffer(),c=r.gl.createRenderbuffer();this.getWidth=function(){return o},this.getHeight=function(){return a},this.getGlFrameBuffer=function(){return u},this.getDepthRenderBuffer=function(){return c},this.getTextureColor=function(){return h},this.getTextureDepth=function(){return l},this.setFilter=function(t){h.filter=t,h.setSize(o,a)},this.setSize=function(t,e){if(t<2&&(t=2),e<2&&(e=2),o=Math.ceil(t),a=Math.ceil(e),Q.profileFrameBuffercreate++,r.gl.bindFramebuffer(r.gl.FRAMEBUFFER,u),r.gl.bindRenderbuffer(r.gl.RENDERBUFFER,c),h.setSize(o,a),l&&l.setSize(o,a),n&&r.gl.renderbufferStorage(r.gl.RENDERBUFFER,r.gl.DEPTH_COMPONENT16,o,a),r.gl.framebufferTexture2D(r.gl.FRAMEBUFFER,r.gl.COLOR_ATTACHMENT0,r.gl.TEXTURE_2D,h.tex,0),n&&(r.gl.framebufferRenderbuffer(r.gl.FRAMEBUFFER,r.gl.DEPTH_ATTACHMENT,r.gl.RENDERBUFFER,c),r.gl.framebufferTexture2D(r.gl.FRAMEBUFFER,r.gl.DEPTH_ATTACHMENT,r.gl.TEXTURE_2D,l.tex,0)),!r.gl.isFramebuffer(u))throw"Invalid framebuffer";var i=r.gl.checkFramebufferStatus(r.gl.FRAMEBUFFER);switch(i){case r.gl.FRAMEBUFFER_COMPLETE:break;case r.gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:throw g.log("FRAMEBUFFER_INCOMPLETE_ATTACHMENT...",o,a,h.tex,c),new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");case r.gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:throw g.log("FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"),new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");case r.gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:throw g.log("FRAMEBUFFER_INCOMPLETE_DIMENSIONS"),new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");case r.gl.FRAMEBUFFER_UNSUPPORTED:throw g.log("FRAMEBUFFER_UNSUPPORTED"),new Error("Incomplete framebuffer: FRAMEBUFFER_UNSUPPORTED");default:throw g.log("incomplete framebuffer",i),new Error("Incomplete framebuffer: "+i)}r.gl.bindTexture(r.gl.TEXTURE_2D,null),r.gl.bindRenderbuffer(r.gl.RENDERBUFFER,null),r.gl.bindFramebuffer(r.gl.FRAMEBUFFER,null)},this.renderStart=function(){r.pushModelMatrix(),r.gl.bindFramebuffer(r.gl.FRAMEBUFFER,u),r.pushGlFrameBuffer(u),r.pushFrameBuffer(this),r.pushPMatrix(),r.gl.viewport(0,0,o,a),r.gl.clearColor(0,0,0,0),r.gl.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT)},this.renderEnd=function(){r.popPMatrix(),r.gl.bindFramebuffer(r.gl.FRAMEBUFFER,r.popGlFrameBuffer()),r.popFrameBuffer(),r.popModelMatrix(),r.resetViewPort()},this.delete=function(){h.delete(),l&&l.delete(),r.gl.deleteRenderbuffer(c),r.gl.deleteFramebuffer(u)},this.setSize(o,a)},Framebuffer2:it,Geometry:rt,BoundingBox:st,Marker:function(t){var e=new rt("marker");e.setPointVertices([1e-5,0,0,1,0,0,0,1e-5,0,0,1,0,0,0,1e-5,0,0,1]);var i=new lt(t,e,t.gl.LINES);i.setGeom(e);var s=new Pt(t,"markermaterial"),r="".endl()+"precision highp float;".endl()+"IN vec3 axisColor;".endl()+"void main()".endl()+"{".endl()+" vec4 col=vec4(axisColor,1.0);".endl()+" outColor = col;".endl()+"}",n="".endl()+"IN vec3 vPosition;".endl()+"UNI mat4 projMatrix;".endl()+"UNI mat4 mvMatrix;".endl()+"OUT vec3 axisColor;".endl()+"void main()".endl()+"{".endl()+" vec4 pos=vec4(vPosition, 1.0
28);".endl()+" if(pos.x!=0.0)axisColor=vec3(1.0,0.3,0.0);".endl()+" if(pos.y!=0.0)axisColor=vec3(0.0,1.0,0.2);".endl()+" if(pos.z!=0.0)axisColor=vec3(0.0,0.5,1.0);".endl()+" gl_Position = projMatrix * mvMatrix * pos;".endl()+"}";s.setSource(n,r),this._vScale=vec3.create(),this.draw=function(t){t.pushModelMatrix(),t.setShader(s),vec3.set(this._vScale,2,2,2),mat4.scale(t.mvMatrix,t.mvMatrix,this._vScale),t.pushDepthTest(!1),i.render(t.getShader()),t.popDepthTest(),t.setPreviousShader(),t.popModelMatrix()}},WirePoint:function(t,e){var i=t.gl.createBuffer(),s=vec3.create();this.render=function(t,e){t.pushModelMatrix(),vec3.set(s,e,e,e),mat4.scale(t.mvMatrix,t.mvMatrix,s);var r=t.getShader();r.bind(),t.gl.bindBuffer(t.gl.ARRAY_BUFFER,i),t.gl.vertexAttribPointer(r.getAttrVertexPos(),i.itemSize,t.gl.FLOAT,!1,0,0),t.gl.enableVertexAttribArray(r.getAttrVertexPos()),t.gl.bindBuffer(t.gl.ARRAY_BUFFER,i),t.gl.drawArrays(t.gl.LINE_STRIP,0,i.numItems),t.popModelMatrix()},function(){var e=[],s=0,r=0;for(s=0;s<=Math.round(24);s++)r=360/Math.round(24)*s*mt,e.push(.5*Math.cos(r)),e.push(0),e.push(.5*Math.sin(r));for(s=0;s<=Math.round(24);s++)r=360/Math.round(24)*s*mt,e.push(.5*Math.cos(r)),e.push(.5*Math.sin(r)),e.push(0);for(s=0;s<=Math.round(24);s++)r=360/Math.round(24)*s*mt,e.push(0),e.push(.5*Math.cos(r)),e.push(.5*Math.sin(r));t.gl.bindBuffer(t.gl.ARRAY_BUFFER,i),t.gl.bufferData(t.gl.ARRAY_BUFFER,new Float32Array(e),t.gl.STATIC_DRAW),i.itemSize=3,i.numItems=e.length/i.itemSize}()},WireCube:function(t){var e,i=t.gl.createBuffer(),s=vec3.create();this.render=function(t,e,r,n){t.pushModelMatrix(),vec3.set(s,e||1,r||1,n||1),mat4.scale(t.mvMatrix,t.mvMatrix,s);var o=t.getShader();o.bind(),t.gl.bindBuffer(t.gl.ARRAY_BUFFER,i),t.gl.vertexAttribPointer(o.getAttrVertexPos(),i.itemSize,t.gl.FLOAT,!1,0,0),t.gl.enableVertexAttribArray(o.getAttrVertexPos()),t.gl.bindBuffer(t.gl.ARRAY_BUFFER,i),t.gl.drawArrays(t.gl.LINE_STRIP,0,i.numItems),t.popModelMatrix()},(e=[]).push(-1,-1,1),e.push(1,-1,1),e.push(1,1,1),e.push(-1,1,1),e.push(-1,-1,1),e.push(-1,-1,-1),e.push(1,-1,-1),e.push(1,1,-1),e.push(-1,1,-1),e.push(-1,-1,-1),e.push(-1,-1,-1),e.push(-1,1,-1),e.push(-1,1,1),e.push(-1,-1,1),e.push(-1,-1,-1),e.push(1,-1,-1),e.push(1,1,-1),e.push(1,1,1),e.push(1,-1,1),e.push(1,-1,-1),t.gl.bindBuffer(t.gl.ARRAY_BUFFER,i),t.gl.bufferData(t.gl.ARRAY_BUFFER,new Float32Array(e),t.gl.STATIC_DRAW),i.itemSize=3,i.numItems=e.length/i.itemSize},MatrixStack:It,Mesh:lt,MESH:ht,ShaderLibMods:dt,Shader:Pt,Uniform:nt,MESHES:ct,Context:Ot,Texture:et,TextureEffect:pt,isWindows:vt,getWheelSpeed:bt,getWheelDelta:yt,onLoadingAssetsFinished:null,profileData:Q},at.BLEND_MODES,at.SHADER,at.MATH,at.BLEND_MODES);window.CGL=St;const Rt=function(t){this._loadingAssets={},this._cbFinished=[],this._percent=0,this._count=0,this._countFinished=0,this._order=0,this._startTime=0,this._patch=t};Rt.prototype.setOnFinishedLoading=function(t){this._cbFinished.push(t)},Rt.prototype.getNumAssets=function(){return this._countFinished},Rt.prototype.getProgress=function(){return this._percent},Rt.prototype.checkStatus=function(){for(var t in this._countFinished=0,this._count=0,this._loadingAssets)this._count++,this._loadingAssets[t].finished||this._countFinished++;if(this._percent=(this._count-this._countFinished)/this._count,0===this._countFinished){for(var e=0;e<this._cbFinished.length;e++)setTimeout(this._cbFinished[e],200);this.print()}},Rt.prototype.print=function(){if(!this._patch.config.silent){var t=[];for(var e in this._loadingAssets)t.push([this._loadingAssets[e].order,this._loadingAssets[e].type,this._loadingAssets[e].name,(this._loadingAssets[e].timeEnd-this._loadingAssets[e].timeStart)/1e3+"s"]);console.groupCollapsed("finished loading "+this._order+" assets in "+(Date.now()-this._startTime)/1e3+"s"),console.table(t),console.groupEnd()}},Rt.prototype.finished=function(t){this._loadingAssets[t]&&(this._loadingAssets[t].finished=!0,this._loadingAssets[t].timeEnd=Date.now()),this.checkStatus()},Rt.prototype.start=function(t,e){0==this._startTime&&(this._startTime=Date.now());var i=x();return this._loadingAssets[i]={id:i,type:t,name:e,finished:!1,timeStart:Date.now(),order:this._order},this._order++,i};const Nt=function(){this._loops=[],this._indizes=[],this._index=0};Nt.prototype.pushLoop=function(t){this._loops.push(Math.abs(Math.floor(t))),this._indizes.push(this._index)},Nt.prototype.popLoop=function(){this._loops.pop(),this._index=this._indizes.pop(),0===this._loops.length&&(this._index=0)},Nt.prototype.numLoops=function(){return this._loops.length},Nt.prototype.numCycles=function(){if(0===this._loops.length)return 0;for(var t=this._loops[0],e=1;e<this._loops.length;e++)t*=this._loops[e];return t},Nt.prototype.inLoop=function(){return this._loops.length>0},Nt.prototype.increment=function(){this._index++},Nt.prototype.index=function(){return this._index};const kt=function(){var t={},e=null,i=0;this.getItems=function(){return t},this.clear=function(){t={}},this.add=function(s,r){null!==e&&(r&&r.id==e||t[e]&&(t[e].timeUsed+=performance.now()-i,(!t[e].peakTime||gt()-t[e].peakTime>5e3)&&(t[e].peak=0,t[e].peakTime=gt()),t[e].peak=Math.max(t[e].peak,performance.now()-i))),null!==r?(t[r.id]||(t[r.id]={numTriggers:0,timeUsed:0}),t[r.id].numTriggers++,t[r.id].title=r.parent.name+"."+r.name,e=r.id,i=performance.now()):e=null},this.print=function(){for(var e in g.log("--------"),t)g.log(t[e].title+": "+t[e].numTriggers+" / "+t[e].timeUsed)}},Mt=function(t){this._patch=t,this.result=[]};Mt.MIDI=0,Mt.POINTERLOCK=1,Mt.WEBAUDIO=2,Mt.WEBGL2=3,(Mt.infos=[])[Mt.POINTERLOCK]={title:"pointerLock",caniuse:"https://caniuse.com/#search=pointerlock"},Mt.infos[Mt.MIDI]={title:"midi API",caniuse:"https://caniuse.com/#search=midi"},Mt.infos[Mt.WEBAUDIO]={title:"web audio",caniuse:"https://caniuse.com/#search=webaudio"},Mt.infos[Mt.WEBGL2]={title:"WebGL 2"},Mt.prototype.checkRequirement=function(t,e){switch(this.result=[],t){case Mt.WEBGL2:return e.patch.cgl.glVersion>=2;case Mt.POINTERLOCK:return"exitPointerLock"in document;case Mt.MIDI:return"MIDIAccess"in window;case Mt.WEBAUDIO:var i=!1;return window.audioContext&&(i=!0),!i&&("webkitAudioContext"in window||"AudioContext"in window)&&(i=!0),i}},Mt.prototype.checkOp=function(t){if(t&&t.requirements)for(var e=0;e<t.requirements.length;e++){var i=t.requirements[e];
28if(!this.result[i]){var s=this.checkRequirement(i,t);if(!s){t.patch.cgl&&t.patch.cgl.canvas&&t.patch.cgl.canvas.remove();Mt.infos[i].title;throw Mt.infos[i].caniuse&&'<a href="'+Mt.infos[i].caniuse+'" target="_blank">'+Mt.infos[i].title+" ("+t.objName+")</a>","this browser does not meet requirement: "+Mt.infos[i].title+" ("+t.objName+")"}this.result[i]={success:s,info:Mt.infos[i]}}}};const Ft=function(t){_.apply(this),this.ops=[],this.settings={},this.timer=new _t,this.freeTimer=new _t,this.animFrameOps=[],this.animFrameCallbacks=[],this.gui=!1,this.silent=!1,this.profiler=null,this.onLoadStart=null,this.onLoadEnd=null,this.aborted=!1,this.loading=new Rt(this),this._crashedOps=[],this._renderOneFrame=!1,this._perf={fps:0,ms:0,_fpsFrameCount:0,_fpsMsCount:0,_fpsStart:0},this._volumeListeners=[],this._paused=!1,this._frameNum=0,this.instancing=new Nt,this.onOneFrameRendered=null,this.namedTriggers={},this._origData=null,this._frameNext=0,this._frameInterval=0,this._lastFrameTime=0,this._frameWasdelayed=!0,this.config=t||{glCanvasResizeToWindow:!1,prefixAssetPath:"",silent:!1,onError:null,onFinishedLoading:null,onFirstFrameRendered:null,onPatchLoaded:null,fpsLimit:0},function(){return!this}()||console.log("not in strict mode: core patch"),g.setSilent(this.config.silent),this.config.hasOwnProperty("doRequestAnimation")||(this.config.doRequestAnimation=!0),this.config.prefixAssetPath||(this.config.prefixAssetPath=""),this.config.masterVolume||(this.config.masterVolume=1),this._variables={},this._variableListeners=[],this.vars={},t&&t.vars&&(this.vars=t.vars),this.cgl=new Ot(this),this.cgl.setCanvas(this.config.glCanvasId||this.config.glCanvas||"glcanvas"),!0===this.config.glCanvasResizeToWindow&&this.cgl.setAutoResize("window"),!0===this.config.glCanvasResizeToParent&&this.cgl.setAutoResize("parent"),this.loading.setOnFinishedLoading(this.config.onFinishedLoading),this.cgl.aborted&&(this.aborted=!0),this.cgl.silent&&(this.silent=!0),this.freeTimer.play(),this.exec(),this.aborted||(this.config.patch?this.deSerialize(this.config.patch):this.config.patchFile&&C(this.config.patchFile,(t,e)=>{var i=JSON.parse(e);if(t){return g.error("err",t),g.error("data",i),void g.error("data",i.msg)}this.deSerialize(i)}),this.timer.play()),console.log("made with https://cables.gl")};Ft.prototype.isPlaying=function(){return!this._paused},Ft.prototype.isRenderingOneFrame=function(){return this._renderOneFrame},Ft.prototype.renderOneFrame=function(){this._paused=!0,this._renderOneFrame=!0,this.exec(),this._renderOneFrame=!1},Ft.prototype.getFPS=function(){return this._fps},Ft.prototype.isEditorMode=function(){return!0===this.config.editorMode},Ft.prototype.pause=function(){this._paused=!0,this.freeTimer.pause()},Ft.prototype.resume=function(){this._paused&&(this._paused=!1,this.freeTimer.play(),this.exec())},Ft.prototype.setVolume=function(t){this.config.masterVolume=t;for(var e=0;e<this._volumeListeners.length;e++)this._volumeListeners[e].onMasterVolumeChanged(t)},Ft.prototype.getFilePath=function(t){return t?0===t.indexOf("https:")||0===t.indexOf("http:")?t:(t=t.replace("//","/"),this.config.prefixAssetPath+t+(this.config.suffixAssetPath||"")):t},Ft.prototype.clear=function(){for(this.cgl.TextureEffectMesh=null,this.animFrameOps.length=0,this.timer=new _t;this.ops.length>0;)this.deleteOp(this.ops[0].id)},Ft.getOpClass=function(t){var e=t.split("."),i=null;try{return 2==e.length?i=window[e[0]][e[1]]:3==e.length?i=window[e[0]][e[1]][e[2]]:4==e.length?i=window[e[0]][e[1]][e[2]][e[3]]:5==e.length?i=window[e[0]][e[1]][e[2]][e[3]][e[4]]:6==e.length?i=window[e[0]][e[1]][e[2]][e[3]][e[4]][e[5]]:7==e.length?i=window[e[0]][e[1]][e[2]][e[3]][e[4]][e[5]][e[6]]:8==e.length?i=window[e[0]][e[1]][e[2]][e[3]][e[4]][e[5]][e[6]][e[7]]:9==e.length?i=window[e[0]][e[1]][e[2]][e[3]][e[4]][e[5]][e[6]][e[7]][e[8]]:10==e.length&&(i=window[e[0]][e[1]][e[2]][e[3]][e[4]][e[5]][e[6]][e[7]][e[8]][e[9]]),i}catch(t){return null}},Ft.prototype.createOp=function(t,e){var i=t.split("."),s=null,r="";try{if(-1==t.indexOf("Ops.")){var n=t;if(!CABLES.OPS[n])throw new Error("could not find op by id: "+n);r=CABLES.OPS[n].objName,(s=new CABLES.OPS[n].f(this,r,e,n)).opId=n}if(!s){if(!Ft.getOpClass(r=t))throw this.emitEvent("criticalError","unknown op","unknown op: "+r),g.error("unknown op: "+r),new Error("unknown op: "+r);if(2==i.length?s=new window[i[0]][i[1]](this,r,e):3==i.length?s=new window[i[0]][i[1]][i[2]](this,r,e):4==i.length?s=new window[i[0]][i[1]][i[2]][i[3]](this,r,e):5==i.length?s=new window[i[0]][i[1]][i[2]][i[3]][i[4]](this,r,e):6==i.length?s=new window[i[0]][i[1]][i[2]][i[3]][i[4]][i[5]](this,r,e):7==i.length?s=new window[i[0]][i[1]][i[2]][i[3]][i[4]][i[5]][i[6]](this,r,e):8==i.length?s=new window[i[0]][i[1]][i[2]][i[3]][i[4]][i[5]][i[6]][i[7]](this,r,e):9==i.length?s=new window[i[0]][i[1]][i[2]][i[3]][i[4]][i[5]][i[6]][i[7]][i[8]](this,r,e):10==i.length?s=new window[i[0]][i[1]][i[2]][i[3]][i[4]][i[5]][i[6]][i[7]][i[8]][i[9]](this,r,e):g.log("parts.length",i.length),s)for(var o in s.opId=null,CABLES.OPS)CABLES.OPS[o].objName==r&&(s.opId=o)}}catch(t){if(this._crashedOps.push(r),this.emitEvent("exceptionOp",t,r),!this.isEditorMode())throw g.log(t),g.error("[instancing error] "+r,t),CABLES.api&&CABLES.api.sendErrorReport(t),this.exitError("INSTANCE_ERR","Instancing Error "+r),"instancing error "+r}return s&&(s.objName=r,s.patch=this),s}
28,Ft.prototype.addOp=function(t,e,i){var s=this.createOp(t,i);return s&&(s.uiAttr(e),s.onCreate&&s.onCreate(),s.hasOwnProperty("onAnimFrame")&&this.animFrameOps.push(s),s.hasOwnProperty("onMasterVolumeChanged")&&this._volumeListeners.push(s),this.ops.push(s),this.emitEvent("onOpAdd",s),s.init&&s.init()),s},Ft.prototype.addOnAnimFrame=function(t){this.animFrameOps.push(t)},Ft.prototype.removeOnAnimFrame=function(t){for(var e=0;e<this.animFrameOps.length;e++)if(this.animFrameOps[e]==t)return void this.animFrameOps.splice(e,1)},Ft.prototype.addOnAnimFrameCallback=function(t){this.animFrameCallbacks.push(t)},Ft.prototype.removeOnAnimCallback=function(t){for(var e=0;e<this.animFrameCallbacks.length;e++)if(this.animFrameCallbacks[e]==t)return void this.animFrameCallbacks.splice(e,1)},Ft.prototype.deleteOp=function(t,e,i){for(var s in this.ops)if(this.ops[s].id==t){var r=null,n=null;if(this.ops[s]){e&&this.ops[s].portsIn.length>0&&this.ops[s].portsIn[0].isLinked()&&this.ops[s].portsOut.length>0&&this.ops[s].portsOut[0].isLinked()&&this.ops[s].portsIn[0].getType()==this.ops[s].portsOut[0].getType()&&(r=this.ops[s].portsIn[0].links[0].getOtherPort(this.ops[s].portsIn[0]),n=this.ops[s].portsOut[0].links[0].getOtherPort(this.ops[s].portsOut[0]));var o=this.ops[s];o.removeLinks(),this.onDelete&&(g.log("deprecated this.onDelete",this.onDelete),this.onDelete(o)),this.emitEvent("onOpDelete",o,i),this.ops.splice(s,1),o.onDelete&&o.onDelete(i),o.cleanUp(),null!==r&&null!==n&&this.link(r.parent,r.getName(),n.parent,n.getName())}}},Ft.prototype.getFrameNum=function(){return this._frameNum}
28,Ft.prototype.renderFrame=function(t){this.timer.update(),this.freeTimer.update();for(var e=this.timer.getTime(),i=0;i<this.animFrameCallbacks.length;++i)this.animFrameCallbacks[i]&&this.animFrameCallbacks[i](e,this._frameNum);for(i=0;i<this.animFrameOps.length;++i)this.animFrameOps[i].onAnimFrame&&this.animFrameOps[i].onAnimFrame(e);this.emitEvent("onRenderFrame",e),this._frameNum++,1==this._frameNum&&this.config.onFirstFrameRendered&&this.config.onFirstFrameRendered()},Ft.prototype.exec=function(t){if(this._renderOneFrame||!this._paused&&!this.aborted){this.config.fpsLimit=this.config.fpsLimit||0,this.config.fpsLimit&&(this._frameInterval=1e3/this.config.fpsLimit);var e=CABLES.now(),i=e-this._frameNext;if(this.isEditorMode()&&!this._renderOneFrame&&e-this._lastFrameTime>=500&&0!==this._lastFrameTime&&!this._frameWasdelayed)return this._lastFrameTime=0,setTimeout(this.exec.bind(this),500),this.emitEvent("renderDelayStart"),void(this._frameWasdelayed=!0);if(this._renderOneFrame||0===this.config.fpsLimit||i>this._frameInterval||this._frameWasdelayed){var s=CABLES.now();this.renderFrame(),this._perf._fpsMsCount+=CABLES.now()-s,this._frameInterval&&(this._frameNext=e-i%this._frameInterval)}this._frameWasdelayed&&(this.emitEvent("renderDelayEnd"),this._frameWasdelayed=!1),this._renderOneFrame&&(this.onOneFrameRendered&&this.onOneFrameRendered(),this.emitEvent("renderedOneFrame"),this._renderOneFrame=!1),CABLES.now()-this._perf._fpsStart>=1e3&&this._perf.fps!=this._perf._fpsFrameCount&&(this._perf.fps=this._perf._fpsFrameCount,this._perf.ms=Math.round(this._perf._fpsMsCount/this._perf._fpsFrameCount),this.emitEvent("performance",this._perf),this._perf._fpsFrameCount=0,this._perf._fpsMsCount=0,this._perf._fpsStart=CABLES.now()),this._perf._lastFrameTime=CABLES.now(),this._perf._fpsFrameCount++,this.config.doRequestAnimation&&requestAnimationFrame(this.exec.bind(this))}},Ft.prototype.link=function(t,e,i,s){if(!t)return void g.log("link: op1 is null ");if(!i)return void g.log("link: op2 is null");const r=t.getPort(e),n=i.getPort(s);if(r)if(n){if(!r.shouldLink(r,n)||!n.shouldLink(r,n))return!1;if($.canLink(r,n)){var o=new $(this);return o.link(r,n),this.emitEvent("onLink",r,n,o),o}}else console.warn("port not found! "+s+" of "+i.name+"("+i.objName+")");else console.warn("port not found! "+e+"("+t.objName+")")},Ft.prototype.serialize=function(t){var e={ops:[]};for(var i in e.settings=this.settings,this.ops)e.ops.push(this.ops[i].getSerialized());return t?e:JSON.stringify(e)},Ft.prototype.getOpById=function(t){for(var e in this.ops)if(this.ops[e].id==t)return this.ops[e]},Ft.prototype.getOpsById=function(t){var e=[];for(var i in this.ops)for(var s=0;s<t.length;s++)if(this.ops[i].id===t[s]){e.push(this.ops[i]);break}return e},Ft.prototype.getOpsByName=function(t){var e=[];for(var i in this.ops)this.ops[i].name==t&&e.push(this.ops[i]);return e},Ft.prototype.getOpsByObjName=function(t){var e=[];for(var i in this.ops)this.ops[i].objName==t&&e.push(this.ops[i]);return e},Ft.prototype.loadLib=function(t){F("/ui/libs/"+t+".js",(t,e)=>{var i=document.createElement("script");i.type="text/javascript",i.text=e,document.getElementsByTagName("head")[0].appendChild(i)},"GET")},Ft.prototype.reloadOp=function(t,e){var i=0,s=[],r=[];for(var n in this.ops)this.ops[n].objName==t&&r.push(this.ops[n]);for(n=0;n<r.length;n++){i++;var o=r[n];o.deleted=!0;var a,h,l=this.addOp(t,o.uiAttribs);for(a in s.push(l),o.portsIn)if(0===o.portsIn[a].links.length){var u=l.getPort(o.portsIn[a].name);u?u.set(o.portsIn[a].get()):g.error("[reloadOp] could not set port "+o.portsIn[a].name+", propably renamed port ?")}else for(;o.portsIn[a].links.length;){var c=o.portsIn[a].links[0].portIn.name,p=o.portsIn[a].links[0].portOut.name,d=o.portsIn[a].links[0].portOut.parent;o.portsIn[a].links[0].remove(),(h=this.link(l,c,d,p))?h.setValue():g.log("[reloadOp] relink after op reload not successfull for port "+p)}for(a in o.portsOut)for(;o.portsOut[a].links.length;){var f=o.portsOut[a].links[0].portOut.name,_=o.portsOut[a].links[0].portIn.name,m=o.portsOut[a].links[0].portIn.parent;o.portsOut[a].links[0].remove(),(h=this.link(l,f,m,_))?h.setValue():g.log("relink after op reload not successfull for port "+_)}this.deleteOp(o.id,!1,!0)}e(i,s)},Ft.prototype.getSubPatchOps=function(t){var e=[];for(var i in this.ops)this.ops[i].uiAttribs&&this.ops[i].uiAttribs.subPatch==t&&e.push(this.ops[i]);return e},Ft.prototype.getSubPatchOp=function(t,e){for(var i in this.ops)if(this.ops[i].uiAttribs&&this.ops[i].uiAttribs.subPatch==t&&this.ops[i].objName==e)return this.ops[i];return!1},Ft.prototype.deSerialize=function(t,e){if(!this.aborted){var i=this.loading.start("core","deserialize");this.onLoadStart&&this.onLoadStart(),this.namespace=t.namespace||"",this.name=t.name||"","string"==typeof t&&(t=JSON.parse(t));var s=this;this.settings=t.settings;var r,n,o,a,h=new Mt(this);for(var l in t.ops){var u=CABLES.now(),c=t.ops[l],p=null;try{p=c.opId?this.addOp(c.opId,c.uiAttribs,c.id):this.addOp(c.objName,c.uiAttribs,c.id)}catch(t){throw console.warn("[instancing error] op data:",c,t),"instancing error: "+c.objName}if(h.checkOp(p),p){for(var d in e&&(p.id=A()),p.portsInData=c.portsIn,p._origData=c,c.portsIn){var f=c.portsIn[d],g=p.getPort(f.name);if(!g||"bool"!=g.uiAttribs.display&&"bool"!=g.uiAttribs.type||isNaN(f.value)||(f.value=!0===f.value),g&&void 0!==f.value&&g.type!=L.OP.OP_PORT_TYPE_TEXTURE&&g.set(f.value),g&&f&&f.animated&&g.setAnimated(f.animated),g&&f&&f.useVariable&&g.setVariableName(f.useVariable),g&&f&&f.anim)for(var _ in g.anim||(g.anim=new X),f.anim.loop&&(g.anim.loop=f.anim.loop),f.anim.keys)g.anim.keys.push(new V.Key(f.anim.keys[_]))}for(var m in c.portsOut){var v=p.getPort(c.portsOut[m].name);v&&v.type!=L.OP.OP_PORT_TYPE_TEXTURE&&c.portsOut[m].hasOwnProperty("value")&&v.set(t.ops[l].portsOut[m].value)}}Math.round(100*(CABLES.now()-u))}for(var E in this.ops)this.ops[E].onLoadedValueSet&&(this.ops[E].onLoadedValueSet(this.ops[E]._origData),this.ops[E].onLoadedValueSet=null,this.ops[E]._origData=null);if(t.ops)for(l=0;l<t.ops.length;l++)if(t.ops[l].portsIn)for(var b=0;b<t.ops[l].portsIn.length;b++)if(t.ops[l].portsIn[b].links)for(var y=0;y<t.ops[l].portsIn[b].links.length;y++)t.ops[l].portsIn[b].links[y]&&(r=t.ops[l].portsIn[b].links[y].objIn,n=t.ops[l].portsIn[b].links[y].objOut,o=t.ops[l].portsIn[b].links[y].portIn,a=t.ops[l].portsIn[b].links[y].portOut,s.link(s.getOpById(r),o,s.getOpById(n),a));for(var E in this.ops)this.ops[E].onLoaded&&(this.ops[E].onLoaded(),this.ops[E].onLoaded=null);for(var E in this.ops)this.ops[E].init&&(this.ops[E].init(),this.ops[E].init=null);if(this.config.variables)for(var T in this.config.variables)this.setVarValue(T,this.config.variables[T]);for(var E in this.ops)this.ops[E].initVarPorts();setTimeout(()=>{this.loading.finished(i)},100),this.config.onPatchLoaded&&this.config.onPatchLoaded(),this.onLoadEnd&&this.onLoadEnd()}},Ft.prototype.profile=function(t){for(var e in this.profiler=new kt,this.ops)this.ops[e].profile(t)},(Ft.Variable=function(t,e){this._name=t,this._changeListeners=[],this.setValue(e)}).prototype.getValue=function(){return this._v},Ft.Variable.prototype.getName=function(){return this._name},Ft.Variable.prototype.setValue=function(t){this._v=t;for(var e=0;e<this._changeListeners.length;e++)this._changeListeners[e](t)},Ft.Variable.prototype.addListener=function(t){this._changeListeners.push(t)},Ft.Variable.prototype.removeListener=function(t){var e=this._changeListeners.indexOf(t);this._changeListeners.splice(e,1)},Ft.prototype.setVariable=function(t,e){this._variables.hasOwnProperty(t)?this._variables[t].setValue(e):console.warn("variable "+t+" not found!")},Ft.prototype.setVarValue=function(t,e){return this._variables.hasOwnProperty(t)?this._variables[t].setValue(e):(this._variables[t]=new Ft.Variable(t,e),this.emitEvent("variablesChanged")),this._variables[t]},Ft.prototype.getVarValue=function(t,e){if(this._variables.hasOwnProperty(t))return this._variables[t].getValue()},Ft.prototype.getVar=function(t){if(this._variables.hasOwnProperty(t))return this._variables[t]},Ft.prototype.getVars=function(){return this._variables},Ft.prototype.deleteVar=function(t){for(var e=0;e<this.ops.length;e++)for(var i=0;i<this.ops[e].portsIn.length;i++)this.ops[e].portsIn[i].getVariableName()==t&&(console.log("found!"),this.ops[e].portsIn[i].setVariable(null));delete this._variables[t]},Ft.prototype.getVars=function(){return this._variables},Ft.prototype.exitError=function(t,e){this&&this.config&&this.config.onError&&(this.config.onError(t,e),this.aborted=!0)},Ft.prototype.preRenderOps=function(){g.log("prerendering...");var t=null;CABLES.StopWatch&&(t=new CABLES.StopWatch("prerendering"));for(var e=0;e<this.ops.length;e++)this.ops[e].preRender&&(this.ops[e].preRender(),g.log("prerender "+this.ops[e].objName));t&&t.stop("prerendering")},Ft.prototype.dispose=function(){this.pause(),this.clear()};
28var Ct=Ft;const wt={addPatch:function(t,e){var i=t,s=x();if("string"!=typeof t||(s=t,i=document.getElementById(s))){var r=document.createElement("canvas");return r.id="glcanvas_"+s,r.width=i.clientWidth,r.height=i.clientHeight,window.addEventListener("resize",function(){this.setAttribute("width",i.clientWidth),this.height=i.clientHeight}.bind(r)),i.appendChild(r),(e=e||{}).glCanvasId=r.id,e.onError||(e.onError=function(t){g.log(t)}),CABLES.patch=new Ct(e),r}console.error(s+" Polyshape Container Element not found!")}},Lt={toneJsInitialized:!1,createAudioContext:function(t){if(window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext)return window.audioContext||(window.audioContext=new AudioContext),window.Tone&&!Lt.toneJsInitialized&&(Tone.setContext(window.audioContext),Lt.toneJsInitialized=!0),window.audioContext;t.patch.config.onError("NO_WEBAUDIO","Web Audio is not supported in this browser.")},getAudioContext:function(){return window.audioContext},createAudioInPort:function(t,e,i,s){if(!t||!e||!i){var r="ERROR: createAudioInPort needs three parameters, op, portName and audioNode";throw t.log(r),new Error(r)}s||(s=0),t.webAudio=t.webAudio||{},t.webAudio.audioInPorts=t.webAudio.audioInPorts||[];var n=t.inObject(e);return n.webAudio={},n.webAudio.previousAudioInNode=null,n.webAudio.audioNode=i,t.webAudio.audioInPorts[e]=n,n.onChange=function(){var e=n.get();if(e)try{e.connect(n.webAudio.audioNode,0,s)}catch(i){throw t.log("Error: Failed to connect web audio node!",i),t.log("port.webAudio.audioNode",n.webAudio.audioNode),t.log("audioInNode: ",e),t.log("inputChannelIndex:",s),t.log("audioInNode.connect: ",e.connect),i}else if(n.webAudio.previousAudioInNode)try{n.webAudio.previousAudioInNode.disconnect(n.webAudio.audioNode,0,s)}catch(e){try{n.webAudio.previousAudioInNode.disconnect(n.webAudio.audioNode)}catch(e){throw t.log("Disconnecting audio node with in/out port index, as well as without in/out-port-index did not work ",e),e.printStackTrace&&e.printStackTrace(),e}}n.webAudio.previousAudioInNode=e},n},replaceNodeInPort:function(t,e,i){var s=t.webAudio.previousAudioInNode;if(s&&s.disconnect){try{s.disconnect(e)}catch(t){throw t.printStackTrace&&t.printStackTrace(),new Error("replaceNodeInPort: Could not disconnect old audio node. "+t.name+" "+t.message)}t.webAudio.audioNode=i;try{s.connect(i)}catch(t){throw t.printStackTrace&&t.printStackTrace(),new Error("replaceNodeInPort: Could not connect to new node. "+t.name+" "+t.message)}}},createAudioOutPort:function(t,e,i){if(!t||!e||!i){var s="ERROR: createAudioOutPort needs three parameters, op, portName and audioNode";throw t.log(s),new Error(s)}
28var r=t.outObject(e);return r.set(i),r},createAudioParamInPort:function(t,e,i,s,r){if(!t||!e||!i)return t.log("ERROR: createAudioParamInPort needs three parameters, op, portName and audioNode"),t&&t.name&&t.log("opname: ",t.name),t.log("portName",e),void t.log("audioNode: ",i);t.webAudio=t.webAudio||{},t.webAudio.audioInPorts=t.webAudio.audioInPorts||[];var n=t.inDynamic(e,[L.OP.OP_PORT_TYPE_VALUE,L.OP.OP_PORT_TYPE_OBJECT],s,r);return n.webAudio={},n.webAudio.previousAudioInNode=null,n.webAudio.audioNode=i,t.webAudio.audioInPorts[e]=n,n.onChange=function(){var e=n.get(),i=n.webAudio.audioNode,s=Lt.getAudioContext();if(null!=e)if("object"==typeof e&&e.connect){try{e.connect(i)}catch(e){throw t.log("Could not connect audio node: ",e),e.printStackTrace&&e.printStackTrace(),e}n.webAudio.previousAudioInNode=e}else{if(i._param&&i._param.minValue&&i._param.maxValue)if(e>=i._param.minValue&&e<=i._param.maxValue)try{i.setValueAtTime?i.setValueAtTime(e,s.currentTime):i.value=e}catch(e){throw t.log("Possible AudioParam problem with tone.js op: ",e),e.printStackTrace&&e.printStackTrace(),e}else t.log("Warning: The value for an audio parameter is out of range!");else if(i.minValue&&i.maxValue)if(e>=i.minValue&&e<=i.maxValue)try{i.setValueAtTime?i.setValueAtTime(e,s.currentTime):i.value=e}catch(e){throw t.log("AudioParam has minValue / maxValue defined, and value is in range, but setting the value failed! ",e),e.printStackTrace&&e.printStackTrace(),e}else t.log("Warning: The value for an audio parameter is out of range!");else try{i.setValueAtTime?i.setValueAtTime(e,s.currentTime):i.value=e}catch(e){throw t.log("Possible AudioParam problem (without minValue / maxValue): ",e),e.printStackTrace&&e.printStackTrace(),e}if(n.webAudio.previousAudioInNode&&n.webAudio.previousAudioInNode.disconnect){try{n.webAudio.previousAudioInNode.disconnect(i)}catch(e){throw t.log("Could not disconnect previous audio node: ",e),e}n.webAudio.previousAudioInNode=void 0}}else n.webAudio.previousAudioInNode},n},loadAudioFile:function(t,e,i,s){var r=Lt.createAudioContext(),n=t.loading.start("audio",e);t.isEditorMode()&&gui.jobs().start({id:"loadaudio"+n,title:" loading audio ("+e+")"});var o=new XMLHttpRequest;e&&(o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){t.loading.finished(n),t.isEditorMode()&&gui.jobs().finish("loadaudio"+n),r.decodeAudioData(o.response,i,s)},o.send())},isValidToneTime:function(t){try{new Tone.Time(t)}catch(t){return!1}return!0},isValidToneNote:function(t){try{Tone.Frequency(t)}catch(t){return!1}return!0}},Bt=function(){var t=CABLES.UI.userSettings.get("pacoRenderer")||!1;CABLES.UI.userSettings.set("pacoRenderer",!t),document.location.reload()},Ut=function(){},Dt=function(t,e,i){this._patch=t,this.connector=i||new Gt,this.connector.receive(this)};Dt.prototype._receive=function(t){var e={};if((e=t.event?t:JSON.parse(t.data)).event==L.PACO.PACO_OP_CREATE)g.log("op create: data.vars.objName"),(o=this._patch.addOp(e.vars.objName)).id=e.vars.opId;else if(e.event==L.PACO.PACO_LOAD)g.log("load patch....."),this._patch.clear(),this._patch.deSerialize(e.vars.patch);else if(e.event==L.PACO.PACO_CLEAR)this._patch.clear(),g.log("clear");else if(e.event==L.PACO.PACO_OP_DELETE)g.log("op delete"),this._patch.deleteOp(e.vars.op,!0);else if(e.event==L.PACO.PACO_OP_ENABLE){(o=this._patch.getOpById(e.vars.op))&&(o.enabled=!0)}else if(e.event==L.PACO.PACO_OP_DISABLE){(o=this._patch.getOpById(e.vars.op))&&(o.enabled=!1)}else if(e.event==L.PACO.PACO_UNLINK){var i=this._patch.getOpById(e.vars.op1),s=this._patch.getOpById(e.vars.op2),r=i.getPort(e.vars.port1),n=s.getPort(e.vars.port2);r.removeLinkTo(n)}else if(e.event==L.PACO.PACO_LINK){i=this._patch.getOpById(e.vars.op1),s=this._patch.getOpById(e.vars.op2);this._patch.link(i,e.vars.port1,s,e.vars.port2)}else if(e.event==L.PACO.PACO_VALUECHANGE){var o;(o=this._patch.getOpById(e.vars.op)).getPort(e.vars.port).set(e.vars.v)}else g.log("unknown patchConnectionEvent!",t)};const Vt=function(t,e){this.connectors=[],this.connectors.push(new Gt)};Vt.prototype.send=function(t,e){for(var i=0;i<this.connectors.length;i++)this.connectors[i].send(t,e)};const Gt=function(){window.BroadcastChannel&&(this.bc=new BroadcastChannel("test_channel"))};Gt.prototype.receive=function(t){this.bc&&(g.log("init"),this.bc.onmessage=t._receive.bind(t))},Gt.prototype.send=function(t,e){if(this.bc){var i={};i.event=t,i.vars=e,this.bc.postMessage(JSON.stringify(i))}};const Ht=Object.assign({EventTarget:_,EMBED:wt,Link:$,Port:B,Op:q,Profiler:kt,Requirements:Mt,Patch:Ct,Instancing:Nt,Timer:_t,WEBAUDIO:Lt,Variable:function(){var t=null,e=[];this.onChanged=function(t){e.push(t)},this.getValue=function(){return t},this.setValue=function(e){t=e,i()};var i=function(){for(var t=0;t<e.length;t++)e[t]()}},LoadingStatus:Rt,now:gt,internalNow:ft},r,n,o,L.ANIM,a,L.PORT,L.PACO,L.ANIM,L.OP);e.default=Ht;(function(){return!this})()||console.log("not in strict mode: index core")}]).default; 29//# sourceMappingURL=cables.min.js.map 30/*! 31@fileoverview gl-matrix - High performance matrix and vector operations 32@author Brandon Jones 33@author Colin MacKenzie IV 34@version 3.1.0 35 36Copyright (c) 2015-2019, Brandon Jones, Colin MacKenzie IV. 37 38Permission is hereby granted, free of charge, to any person obtaining a copy 39of this software and associated documentation files (the "Software"), to deal 40in the Software without restriction, including without limitation the rights 41to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 42copies of the Software, and to permit persons to whom the Software is 43furnished to do so, subject to the following conditions: 44 45The above copyright notice and this permission notice shall be included in 46all copies or substantial portions of the Software. 47 48THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 51AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 54THE SOFTWARE. 55 56*/ 57!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).glMatrix={})}(this,function(t){"use strict";var n=1e-6,a="undefined"!=typeof Float32Array?Float32Array:Array,r=Math.random;var u=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)});var e=Object.freeze({EPSILON:n,get ARRAY_TYPE(){return a}
vendor: 29,241 bytes, line 57
57,RANDOM:r,setMatrixArrayType:function(t){a=t},toRadian:function(t){return t*u},equals:function(t,a){return Math.abs(t-a)<=n*Math.max(1,Math.abs(t),Math.abs(a))}});function o(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=a[0],c=a[1],h=a[2],s=a[3];return t[0]=r*i+e*c,t[1]=u*i+o*c,t[2]=r*h+e*s,t[3]=u*h+o*s,t}function i(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t}var c=o,h=i,s=Object.freeze({create:function(){var t=new a(4);return a!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},clone:function(t){var n=new a(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},fromValues:function(t,n,r,u){var e=new a(4);return e[0]=t,e[1]=n,e[2]=r,e[3]=u,e},set:function(t,n,a,r,u){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t},transpose:function(t,n){if(t===n){var a=n[1];t[1]=n[2],t[2]=a}else t[0]=n[0],t[1]=n[2],t[2]=n[1],t[3]=n[3];return t},invert:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=a*e-u*r;return o?(o=1/o,t[0]=e*o,t[1]=-r*o,t[2]=-u*o,t[3]=a*o,t):null},adjoint:function(t,n){var a=n[0];return t[0]=n[3],t[1]=-n[1],t[2]=-n[2],t[3]=a,t},determinant:function(t){return t[0]*t[3]-t[2]*t[1]},multiply:o,rotate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=Math.sin(a),c=Math.cos(a);return t[0]=r*c+e*i,t[1]=u*c+o*i,t[2]=r*-i+e*c,t[3]=u*-i+o*c,t},scale:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=a[0],c=a[1];return t[0]=r*i,t[1]=u*i,t[2]=e*c,t[3]=o*c,t},fromRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=a,t[2]=-a,t[3]=r,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t},str:function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3])},LDU:function(t,n,a,r){return t[2]=r[2]/r[0],a[0]=r[0],a[1]=r[1],a[3]=r[3]-t[2]*a[1],[t,n,a]},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t},subtract:i,exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=a[0],c=a[1],h=a[2],s=a[3];return Math.abs(r-i)<=n*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(u-c)<=n*Math.max(1,Math.abs(u),Math.abs(c))&&Math.abs(e-h)<=n*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(o-s)<=n*Math.max(1,Math.abs(o),Math.abs(s))},multiplyScalar:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t},multiplyScalarAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t},mul:c,sub:h});function M(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],c=n[5],h=a[0],s=a[1],M=a[2],f=a[3],l=a[4],v=a[5];return t[0]=r*h+e*s,t[1]=u*h+o*s,t[2]=r*M+e*f,t[3]=u*M+o*f,t[4]=r*l+e*v+i,t[5]=u*l+o*v+c,t}function f(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t[4]=n[4]-a[4],t[5]=n[5]-a[5],t}var l=M,v=f,b=Object.freeze({create:function(){var t=new a(6);return a!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},clone:function(t){var n=new a(6);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n},copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},fromValues:function(t,n,r,u,e,o){var i=new a(6);return i[0]=t,i[1]=n,i[2]=r,i[3]=u,i[4]=e,i[5]=o,i},set:function(t,n,a,r,u,e,o){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t[4]=e,t[5]=o,t},invert:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],c=a*e-r*u;return c?(c=1/c,t[0]=e*c,t[1]=-r*c,t[2]=-u*c,t[3]=a*c,t[4]=(u*i-e*o)*c,t[5]=(r*o-a*i)*c,t):null},determinant:function(t){return t[0]*t[3]-t[1]*t[2]},multiply:M,rotate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],c=n[5],h=Math.sin(a),s=Math.cos(a);return t[0]=r*s+e*h,t[1]=u*s+o*h,t[2]=r*-h+e*s,t[3]=u*-h+o*s,t[4]=i,t[5]=c,t},scale:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],c=n[5],h=a[0],s=a[1];return t[0]=r*h,t[1]=u*h,t[2]=e*s,t[3]=o*s,t[4]=i,t[5]=c,t},translate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],c=n[5],h=a[0],s=a[1];return t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=r*h+e*s+i,t[5]=u*h+o*s+c,t},fromRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=a,t[2]=-a,t[3]=r,t[4]=0,t[5]=0,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t[4]=0,t[5]=0,t},fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=n[0],t[5]=n[1],t},str:function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t[4]=n[4]+a[4],t[5]=n[5]+a[5],t},subtract:f,multiplyScalar:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t[4]=n[4]*a,t[5]=n[5]*a,t},multiplyScalarAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t[4]=n[4]+a[4]*r,t[5]=n[5]+a[5]*r,t},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]},equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=t[4],c=t[5],h=a[0],s=a[1],M=a[2],f=a[3],l=a[4],v=a[5];return Math.abs(r-h)<=n*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(u-s)<=n*Math.max(1,Math.abs(u),Math.abs(s))&&Math.abs(e-M)<=n*Math.max(1,Math.abs(e),Math.abs(M))&&Math.abs(o-f)<=n*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(i-l)<=n*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(c-v)<=n*Math.max(1,Math.abs(c),Math.abs(v))},mul:l,sub:v});function m(){var t=new a(9);return a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function d(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],c=n[5],h=n[6],s=n[7],M=n[8],f=a[0],l=a[1],v=a[2],b=a[3],m=a[4],d=a[5],x=a[6],p=a[7],y=a[8];return t[0]=f*r+l*o+v*h,t[1]=f*u+l*i+v*s,t[2]=f*e+l*c+v*M,t[3]=b*r+m*o+d*h,t[4]=b*u+m*i+d*s,t[5]=b*e+m*c+d*M,t[6]=x*r+p*o+y*h,t[7]=x*u+p*i+y*s,t[8]=x*e+p*c+y*M,t}function x(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t[4]=n[4]-a[4],t[5]=n[5]-a[5],t[6]=n[6]-a[6],t[7]=n[7]-a[7],t[8]=n[8]-a[8],t}var p=d,y=x,q=Object.freeze({create:m,fromMat4:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t},clone:function(t){var n=new a(9);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n},copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},fromValues:function(t,n,r,u,e,o,i,c,h){var s=new a(9);return s[0]=t,s[1]=n,s[2]=r,s[3]=u,s[4]=e,s[5]=o,s[6]=i,s[7]=c,s[8]=h,s},set:function(t,n,a,r,u,e,o,i,c,h){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t[4]=e,t[5]=o,t[6]=i,t[7]=c,t[8]=h,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},transpose:function(t,n){if(t===n){var a=n[1],r=n[2],u=n[5];t[1]=n[3],t[2]=n[6],t[3]=a,t[5]=n[7],t[6]=r,t[7]=u}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t},invert:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],c=n[6],h=n[7],s=n[8],M=s*o-i*h,f=-s*e+i*c,l=h*e-o*c,v=a*M+r*f+u*l;return v?(v=1/v,t[0]=M*v,t[1]=(-s*r+u*h)*v,t[2]=(i*r-u*o)*v,t[3]=f*v,t[4]=(s*a-u*c)*v,t[5]=(-i*a+u*e)*v,t[6]=l*v,t[7]=(-h*a+r*c)*v,t[8]=(o*a-r*e)*v,t):null},adjoint:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],c=n[6],h=n[7],s=n[8];return t[0]=o*s-i*h,t[1]=u*h-r*s,t[2]=r*i-u*o,t[3]=i*c-e*s,t[4]=a*s-u*c,t[5]=u*e-a*i,t[6]=e*h-o*c,t[7]=r*c-a*h,t[8]=a*o-r*e,t},determinant:function(t){var n=t[0],a=t[1],r=t[2],u=t[3],e=t[4],o=t[5],i=t[6],c=t[7],h=t[8];return n*(h*e-o*c)+a*(-h*u+o*i)+r*(c*u-e*i)},multiply:d,translate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],c=n[5],h=n[6],s=n[7],M=n[8],f=a[0],l=a[1];return t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=i,t[5]=c,t[6]=f*r+l*o+h,t[7]=f*u+l*i+s,t[8]=f*e+l*c+M,t},rotate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],c=n[5],h=n[6],s=n[7],M=n[8],f=Math.sin(a),l=Math.cos(a);return t[0]=l*r+f*o,t[1]=l*u+f*i,t[2]=l*e+f*c,t[3]=l*o-f*r,t[4]=l*i-f*u,t[5]=l*c-f*e,t[6]=h,t[7]=s,t[8]=M,t},scale:function(t,n,a){var r=a[0],u=a[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=u*n[3],t[4]=u*n[4],t[5]=u*n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t},fromRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromMat2d:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t},fromQuat:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=a+a,i=r+r,c=u+u,h=a*o,s=r*o,M=r*i,f=u*o,l=u*i,v=u*c,b=e*o,m=e*i,d=e*c;return t[0]=1-M-v,t[3]=s-d,t[6]=f+m,t[1]=s+d,t[4]=1-h-v,t[7]=l-b,t[2]=f-m,t[5]=l+b,t[8]=1-h-M,t},normalFromMat4:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],c=n[6],h=n[7],s=n[8],M=n[9],f=n[10],l=n[11],v=n[12],b=n[13],m=n[14],d=n[15],x=a*i-r*o,p=a*c-u*o,y=a*h-e*o,q=r*c-u*i,g=r*h-e*i,A=u*h-e*c,w=s*b-M*v,R=s*m-f*v,z=s*d-l*v,P=M*m-f*b,j=M*d-l*b,I=f*d-l*m,S=x*I-p*j+y*P+q*z-g*R+A*w;return S?(S=1/S,t[0]=(i*I-c*j+h*P)*S,t[1]=(c*z-o*I-h*R)*S,t[2]=(o*j-i*z+h*w)*S,t[3]=(u*j-r*I-e*P)*S,t[4]=(a*I-u*z+e*R)*S,t[5]=(r*z-a*j-e*w)*S,t[6]=(b*A-m*g+d*q)*S,t[7]=(m*y-v*A-d*p)*S,t[8]=(v*g-b*y+d*x)*S,t):null},projection:function(t,n,a){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/a,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t[4]=n[4]+a[4],t[5]=n[5]+a[5],t[6]=n[6]+a[6],t[7]=n[7]+a[7],t[8]=n[8]+a[8],t},subtract:x,multiplyScalar:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=n[7]*a,t[8]=n[8]*a,t},multiplyScalarAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t[4]=n[4]+a[4]*r,t[5]=n[5]+a[5]*r,t[6]=n[6]+a[6]*r,t[7]=n[7]+a[7]*r,t[8]=n[8]+a[8]*r,t},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=t[4],c=t[5],h=t[6],s=t[7],M=t[8],f=a[0],l=a[1],v=a[2],b=a[3],m=a[4],d=a[5],x=a[6],p=a[7],y=a[8];return Math.abs(r-f)<=n*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(u-l)<=n*Math.max(1,Math.abs(u),Math.abs(l))&&Math.abs(e-v)<=n*Math.max(1,Math.abs(e),Math.abs(v))&&Math.abs(o-b)<=n*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(i-m)<=n*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(c-d)<=n*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(h-x)<=n*Math.max(1,Math.abs(h),Math.abs(x))&&Math.abs(s-p)<=n*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(M-y)<=n*Math.max(1,Math.abs(M),Math.abs(y))},mul:p,sub:y});function g(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function A(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],c=n[5],h=n[6],s=n[7],M=n[8],f=n[9],l=n[10],v=n[11],b=n[12],m=n[13],d=n[14],x=n[15],p=a[0],y=a[1],q=a[2],g=a[3];return t[0]=p*r+y*i+q*M+g*b,t[1]=p*u+y*c+q*f+g*m,t[2]=p*e+y*h+q*l+g*d,t[3]=p*o+y*s+q*v+g*x,p=a[4],y=a[5],q=a[6],g=a[7],t[4]=p*r+y*i+q*M+g*b,t[5]=p*u+y*c+q*f+g*m,t[6]=p*e+y*h+q*l+g*d,t[7]=p*o+y*s+q*v+g*x,p=a[8],y=a[9],q=a[10],g=a[11],t[8]=p*r+y*i+q*M+g*b,t[9]=p*u+y*c+q*f+g*m,t[10]=p*e+y*h+q*l+g*d,t[11]=p*o+y*s+q*v+g*x,p=a[12],y=a[13],q=a[14],g=a[15],t[12]=p*r+y*i+q*M+g*b,t[13]=p*u+y*c+q*f+g*m,t[14]=p*e+y*h+q*l+g*d,t[15]=p*o+y*s+q*v+g*x,t}function w(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=r+r,c=u+u,h=e+e,s=r*i,M=r*c,f=r*h,l=u*c,v=u*h,b=e*h,m=o*i,d=o*c,x=o*h;return t[0]=1-(l+b),t[1]=M+x,t[2]=f-d,t[3]=0,t[4]=M-x,t[5]=1-(s+b),t[6]=v+m,t[7]=0,t[8]=f+d,t[9]=v-m,t[10]=1-(s+l),t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t}function R(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function z(t,n){var a=n[0],r=n[1],u=n[2],e=n[4],o=n[5],i=n[6],c=n[8],h=n[9],s=n[10];return t[0]=Math.hypot(a,r,u),t[1]=Math.hypot(e,o,i),t[2]=Math.hypot(c,h,s),t}function P(t,n){var r=new a(3);z(r,n);var u=1/r[0],e=1/r[1],o=1/r[2],i=n[0]*u,c=n[1]*e,h=n[2]*o,s=n[4]*u,M=n[5]*e,f=n[6]*o,l=n[8]*u,v=n[9]*e,b=n[10]*o,m=i+M+b,d=0;return m>0?(d=2*Math.sqrt(m+1),t[3]=.25*d,t[0]=(f-v)/d,t[1]=(l-h)/d,t[2]=(c-s)/d):i>M&&i>b?(d=2*Math.sqrt(1+i-M-b),t[3]=(f-v)/d,t[0]=.25*d,t[1]=(c+s)/d,t[2]=(l+h)/d):M>b?(d=2*Math.sqrt(1+M-i-b),t[3]=(l-h)/d,t[0]=(c+s)/d,t[1]=.25*d,t[2]=(f+v)/d):(d=2*Math.sqrt(1+b-i-M),t[3]=(c-s)/d,t[0]=(l+h)/d,t[1]=(f+v)/d,t[2]=.25*d),t}function j(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t[4]=n[4]-a[4],t[5]=n[5]-a[5],t[6]=n[6]-a[6],t[7]=n[7]-a[7],t[8]=n[8]-a[8],t[9]=n[9]-a[9],t[10]=n[10]-a[10],t[11]=n[11]-a[11],t[12]=n[12]-a[12],t[13]=n[13]-a[13],t[14]=n[14]-a[14],t[15]=n[15]-a[15],t}var I=A,S=j,E=Object.freeze({create:function(){var t=new a(16);return a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},clone:function(t){var n=new a(16);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t},fromValues:function(t,n,r,u,e,o,i,c,h,s,M,f,l,v,b,m){var d=new a(16);return d[0]=t,d[1]=n,d[2]=r,d[3]=u,d[4]=e,d[5]=o,d[6]=i,d[7]=c,d[8]=h,d[9]=s,d[10]=M,d[11]=f,d[12]=l,d[13]=v,d[14]=b,d[15]=m,d},set:function(t,n,a,r,u,e,o,i,c,h,s,M,f,l,v,b,m){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t[4]=e,t[5]=o,t[6]=i,t[7]=c,t[8]=h,t[9]=s,t[10]=M,t[11]=f,t[12]=l,t[13]=v,t[14]=b,t[15]=m,t},identity:g,transpose:function(t,n){if(t===n){var a=n[1],r=n[2],u=n[3],e=n[6],o=n[7],i=n[11];t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=a,t[6]=n[9],t[7]=n[13],t[8]=r,t[9]=e,t[11]=n[14],t[12]=u,t[13]=o,t[14]=i}else t[0]=n[0],t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=n[1],t[5]=n[5],t[6]=n[9],t[7]=n[13],t[8]=n[2],t[9]=n[6],t[10]=n[10],t[11]=n[14],t[12]=n[3],t[13]=n[7],t[14]=n[11],t[15]=n[15];return t},invert:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],c=n[6],h=n[7],s=n[8],M=n[9],f=n[10],l=n[11],v=n[12],b=n[13],m=n[14],d=n[15],x=a*i-r*o,p=a*c-u*o,y=a*h-e*o,q=r*c-u*i,g=r*h-e*i,A=u*h-e*c,w=s*b-M*v,R=s*m-f*v,z=s*d-l*v,P=M*m-f*b,j=M*d-l*b,I=f*d-l*m,S=x*I-p*j+y*P+q*z-g*R+A*w;return S?(S=1/S,t[0]=(i*I-c*j+h*P)*S,t[1]=(u*j-r*I-e*P)*S,t[2]=(b*A-m*g+d*q)*S,t[3]=(f*g-M*A-l*q)*S,t[4]=(c*z-o*I-h*R)*S,t[5]=(a*I-u*z+e*R)*S,t[6]=(m*y-v*A-d*p)*S,t[7]=(s*A-f*y+l*p)*S,t[8]=(o*j-i*z+h*w)*S,t[9]=(r*z-a*j-e*w)*S,t[10]=(v*g-b*y+d*x)*S,t[11]=(M*y-s*g-l*x)*S,t[12]=(i*R-o*P-c*w)*S,t[13]=(a*P-r*R+u*w)*S,t[14]=(b*p-v*q-m*x)*S,t[15]=(s*q-M*p+f*x)*S,t):null},adjoint:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],c=n[6],h=n[7],s=n[8],M=n[9],f=n[10],l=n[11],v=n[12],b=n[13],m=n[14],d=n[15];return t[0]=i*(f*d-l*m)-M*(c*d-h*m)+b*(c*l-h*f),t[1]=-(r*(f*d-l*m)-M*(u*d-e*m)+b*(u*l-e*f)),t[2]=r*(c*d-h*m)-i*(u*d-e*m)+b*(u*h-e*c),t[3]=-(r*(c*l-h*f)-i*(u*l-e*f)+M*(u*h-e*c)),t[4]=-(o*(f*d-l*m)-s*(c*d-h*m)+v*(c*l-h*f)),t[5]=a*(f*d-l*m)-s*(u*d-e*m)+v*(u*l-e*f),t[6]=-(a*(c*d-h*m)-o*(u*d-e*m)+v*(u*h-e*c)),t[7]=a*(c*l-h*f)-o*(u*l-e*f)+s*(u*h-e*c),t[8]=o*(M*d-l*b)-s*(i*d-h*b)+v*(i*l-h*M),t[9]=-(a*(M*d-l*b)-s*(r*d-e*b)+v*(r*l-e*M)),t[10]=a*(i*d-h*b)-o*(r*d-e*b)+v*(r*h-e*i),t[11]=-(a*(i*l-h*M)-o*(r*l-e*M)+s*(r*h-e*i)),t[12]=-(o*(M*m-f*b)-s*(i*m-c*b)+v*(i*f-c*M)),t[13]=a*(M*m-f*b)-s*(r*m-u*b)+v*(r*f-u*M),t[14]=-(a*(i*m-c*b)-o*(r*m-u*b)+v*(r*c-u*i)),t[15]=a*(i*f-c*M)-o*(r*f-u*M)+s*(r*c-u*i),t},determinant:function(t){var n=t[0],a=t[1],r=t[2],u=t[3],e=t[4],o=t[5],i=t[6],c=t[7],h=t[8],s=t[9],M=t[10],f=t[11],l=t[12],v=t[13],b=t[14],m=t[15];return(n*o-a*e)*(M*m-f*b)-(n*i-r*e)*(s*m-f*v)+(n*c-u*e)*(s*b-M*v)+(a*i-r*o)*(h*m-f*l)-(a*c-u*o)*(h*b-M*l)+(r*c-u*i)*(h*v-s*l)},multiply:A,translate:function(t,n,a){var r,u,e,o,i,c,h,s,M,f,l,v,b=a[0],m=a[1],d=a[2];return n===t?(t[12]=n[0]*b+n[4]*m+n[8]*d+n[12],t[13]=n[1]*b+n[5]*m+n[9]*d+n[13],t[14]=n[2]*b+n[6]*m+n[10]*d+n[14],t[15]=n[3]*b+n[7]*m+n[11]*d+n[15]):(r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],c=n[5],h=n[6],s=n[7],M=n[8],f=n[9],l=n[10],v=n[11],t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=i,t[5]=c,t[6]=h,t[7]=s,t[8]=M,t[9]=f,t[10]=l,t[11]=v,t[12]=r*b+i*m+M*d+n[12],t[13]=u*b+c*m+f*d+n[13],t[14]=e*b+h*m+l*d+n[14],t[15]=o*b+s*m+v*d+n[15]),t},scale:function(t,n,a){var r=a[0],u=a[1],e=a[2];return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*u,t[5]=n[5]*u,t[6]=n[6]*u,t[7]=n[7]*u,t[8]=n[8]*e,t[9]=n[9]*e,t[10]=n[10]*e,t[11]=n[11]*e,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t},rotate:function(t,a,r,u){var e,o,i,c,h,s,M,f,l,v,b,m,d,x,p,y,q,g,A,w,R,z,P,j,I=u[0],S=u[1],E=u[2],O=Math.hypot(I,S,E);return O<n?null:(I*=O=1/O,S*=O,E*=O,e=Math.sin(r),i=1-(o=Math.cos(r)),c=a[0],h=a[1],s=a[2],M=a[3],f=a[4],l=a[5],v=a[6],b=a[7],m=a[8],d=a[9],x=a[10],p=a[11],y=I*I*i+o,q=S*I*i+E*e,g=E*I*i-S*e,A=I*S*i-E*e,w=S*S*i+o,R=E*S*i+I*e,z=I*E*i+S*e,P=S*E*i-I*e,j=E*E*i+o,t[0]=c*y+f*q+m*g,t[1]=h*y+l*q+d*g,t[2]=s*y+v*q+x*g,t[3]=M*y+b*q+p*g,t[4]=c*A+f*w+m*R,t[5]=h*A+l*w+d*R,t[6]=s*A+v*w+x*R,t[7]=M*A+b*w+p*R,t[8]=c*z+f*P+m*j,t[9]=h*z+l*P+d*j,t[10]=s*z+v*P+x*j,t[11]=M*z+b*P+p*j,a!==t&&(t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t)},rotateX:function(t,n,a){var r=Math.sin(a),u=Math.cos(a),e=n[4],o=n[5],i=n[6],c=n[7],h=n[8],s=n[9],M=n[10],f=n[11];return n!==t&&(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[4]=e*u+h*r,t[5]=o*u+s*r,t[6]=i*u+M*r,t[7]=c*u+f*r,t[8]=h*u-e*r,t[9]=s*u-o*r,t[10]=M*u-i*r,t[11]=f*u-c*r,t},rotateY:function(t,n,a){var r=Math.sin(a),u=Math.cos(a),e=n[0],o=n[1],i=n[2],c=n[3],h=n[8],s=n[9],M=n[10],f=n[11];return n!==t&&(t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=e*u-h*r,t[1]=o*u-s*r,t[2]=i*u-M*r,t[3]=c*u-f*r,t[8]=e*r+h*u,t[9]=o*r+s*u,t[10]=i*r+M*u,t[11]=c*r+f*u,t},rotateZ:function(t,n,a){var r=Math.sin(a),u=Math.cos(a),e=n[0],o=n[1],i=n[2],c=n[3],h=n[4],s=n[5],M=n[6],f=n[7];return n!==t&&(t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=e*u+h*r,t[1]=o*u+s*r,t[2]=i*u+M*r,t[3]=c*u+f*r,t[4]=h*u-e*r,t[5]=s*u-o*r,t[6]=M*u-i*r,t[7]=f*u-c*r,t},fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=n[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotation:function(t,a,r){var u,e,o,i=r[0],c=r[1],h=r[2],s=Math.hypot(i,c,h);return s<n?null:(i*=s=1/s,c*=s,h*=s,u=Math.sin(a),o=1-(e=Math.cos(a)),t[0]=i*i*o+e,t[1]=c*i*o+h*u,t[2]=h*i*o-c*u,t[3]=0,t[4]=i*c*o-h*u,t[5]=c*c*o+e,t[6]=h*c*o+i*u,t[7]=0,t[8]=i*h*o+c*u,t[9]=c*h*o-i*u,t[10]=h*h*o+e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=a,t[7]=0,t[8]=0,t[9]=-a,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=a,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=a,t[2]=0,t[3]=0,t[4]=-a,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:w,fromQuat2:function(t,n){var r=new a(3),u=-n[0],e=-n[1],o=-n[2],i=n[3],c=n[4],h=n[5],s=n[6],M=n[7],f=u*u+e*e+o*o+i*i;return f>0?(r[0]=2*(c*i+M*u+h*o-s*e)/f,r[1]=2*(h*i+M*e+s*u-c*o)/f,r[2]=2*(s*i+M*o+c*e-h*u)/f):(r[0]=2*(c*i+M*u+h*o-s*e),r[1]=2*(h*i+M*e+s*u-c*o),r[2]=2*(s*i+M*o+c*e-h*u)),w(t,n,r),t},getTranslation:R,getScaling:z,getRotation:P,fromRotationTranslationScale:function(t,n,a,r){var u=n[0],e=n[1],o=n[2],i=n[3],c=u+u,h=e+e,s=o+o,M=u*c,f=u*h,l=u*s,v=e*h,b=e*s,m=o*s,d=i*c,x=i*h,p=i*s,y=r[0],q=r[1],g=r[2];return t[0]=(1-(v+m))*y,t[1]=(f+p)*y,t[2]=(l-x)*y,t[3]=0,t[4]=(f-p)*q,t[5]=(1-(M+m))*q,t[6]=(b+d)*q,t[7]=0,t[8]=(l+x)*g,t[9]=(b-d)*g,t[10]=(1-(M+v))*g,t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t},fromRotationTranslationScaleOrigin:function(t,n,a,r,u){var e=n[0],o=n[1],i=n[2],c=n[3],h=e+e,s=o+o,M=i+i,f=e*h,l=e*s,v=e*M,b=o*s,m=o*M,d=i*M,x=c*h,p=c*s,y=c*M,q=r[0],g=r[1],A=r[2],w=u[0],R=u[1],z=u[2],P=(1-(b+d))*q,j=(l+y)*q,I=(v-p)*q,S=(l-y)*g,E=(1-(f+d))*g,O=(m+x)*g,T=(v+p)*A,D=(m-x)*A,F=(1-(f+b))*A;return t[0]=P,t[1]=j,t[2]=I,t[3]=0,t[4]=S,t[5]=E,t[6]=O,t[7]=0,t[8]=T,t[9]=D,t[10]=F,t[11]=0,t[12]=a[0]+w-(P*w+S*R+T*z),t[13]=a[1]+R-(j*w+E*R+D*z),t[14]=a[2]+z-(I*w+O*R+F*z),t[15]=1,t},fromQuat:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=a+a,i=r+r,c=u+u,h=a*o,s=r*o,M=r*i,f=u*o,l=u*i,v=u*c,b=e*o,m=e*i,d=e*c;return t[0]=1-M-v,t[1]=s+d,t[2]=f-m,t[3]=0,t[4]=s-d,t[5]=1-h-v,t[6]=l+b,t[7]=0,t[8]=f+m,t[9]=l-b,t[10]=1-h-M,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},frustum:function(t,n,a,r,u,e,o){var i=1/(a-n),c=1/(u-r),h=1/(e-o);return t[0]=2*e*i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*e*c,t[6]=0,t[7]=0,t[8]=(a+n)*i,t[9]=(u+r)*c,t[10]=(o+e)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*e*2*h,t[15]=0,t},perspective:function(t,n,a,r,u){var e,o=1/Math.tan(n/2);return t[0]=o/a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=u&&u!==1/0?(e=1/(r-u),t[10]=(u+r)*e,t[14]=2*u*r*e):(t[10]=-1,t[14]=-2*r),t},perspectiveFromFieldOfView:function(t,n,a,r){var u=Math.tan(n.upDegrees*Math.PI/180),e=Math.tan(n.downDegrees*Math.PI/180),o=Math.tan(n.leftDegrees*Math.PI/180),i=Math.tan(n.rightDegrees*Math.PI/180),c=2/(o+i),h=2/(u+e);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(o-i)*c*.5,t[9]=(u-e)*h*.5,t[10]=r/(a-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*a/(a-r),t[15]=0,t},ortho:function(t,n,a,r,u,e,o){var i=1/(n-a),c=1/(r-u),h=1/(e-o);return t[0]=-2*i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(n+a)*i,t[13]=(u+r)*c,t[14]=(o+e)*h,t[15]=1,t},lookAt:function(t,a,r,u){var e,o,i,c,h,s,M,f,l,v,b=a[0],m=a[1],d=a[2],x=u[0],p=u[1],y=u[2],q=r[0],A=r[1],w=r[2];return Math.abs(b-q)<n&&Math.abs(m-A)<n&&Math.abs(d-w)<n?g(t):(M=b-q,f=m-A,l=d-w,e=p*(l*=v=1/Math.hypot(M,f,l))-y*(f*=v),o=y*(M*=v)-x*l,i=x*f-p*M,(v=Math.hypot(e,o,i))?(e*=v=1/v,o*=v,i*=v):(e=0,o=0,i=0),c=f*i-l*o,h=l*e-M*i,s=M*o-f*e,(v=Math.hypot(c,h,s))?(c*=v=1/v,h*=v,s*=v):(c=0,h=0,s=0),t[0]=e,t[1]=c,t[2]=M,t[3]=0,t[4]=o,t[5]=h,t[6]=f,t[7]=0,t[8]=i,t[9]=s,t[10]=l,t[11]=0,t[12]=-(e*b+o*m+i*d),t[13]=-(c*b+h*m+s*d),t[14]=-(M*b+f*m+l*d),t[15]=1,t)},targetTo:function(t,n,a,r){var u=n[0],e=n[1],o=n[2],i=r[0],c=r[1],h=r[2],s=u-a[0],M=e-a[1],f=o-a[2],l=s*s+M*M+f*f;l>0&&(s*=l=1/Math.sqrt(l),M*=l,f*=l);var v=c*f-h*M,b=h*s-i*f,m=i*M-c*s;return(l=v*v+b*b+m*m)>0&&(v*=l=1/Math.sqrt(l),b*=l,m*=l),t[0]=v,t[1]=b,t[2]=m,t[3]=0,t[4]=M*m-f*b,t[5]=f*v-s*m,t[6]=s*b-M*v,t[7]=0,t[8]=s,t[9]=M,t[10]=f,t[11]=0,t[12]=u,t[13]=e,t[14]=o,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t[4]=n[4]+a[4],t[5]=n[5]+a[5],t[6]=n[6]+a[6],t[7]=n[7]+a[7],t[8]=n[8]+a[8],t[9]=n[9]+a[9],t[10]=n[10]+a[10],t[11]=n[11]+a[11],t[12]=n[12]+a[12],t[13]=n[13]+a[13],t[14]=n[14]+a[14],t[15]=n[15]+a[15],t},subtract:j,multiplyScalar:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=n[7]*a,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=n[11]*a,t[12]=n[12]*a,t[13]=n[13]*a,t[14]=n[14]*a,t[15]=n[15]*a,t},multiplyScalarAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t[4]=n[4]+a[4]*r,t[5]=n[5]+a[5]*r,t[6]=n[6]+a[6]*r,t[7]=n[7]+a[7]*r,t[8]=n[8]+a[8]*r,t[9]=n[9]+a[9]*r,t[10]=n[10]+a[10]*r,t[11]=n[11]+a[11]*r,t[12]=n[12]+a[12]*r,t[13]=n[13]+a[13]*r,t[14]=n[14]+a[14]*r,t[15]=n[15]+a[15]*r,t},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[11]===n[11]&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[15]===n[15]},equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=t[4],c=t[5],h=t[6],s=t[7],M=t[8],f=t[9],l=t[10],v=t[11],b=t[12],m=t[13],d=t[14],x=t[15],p=a[0],y=a[1],q=a[2],g=a[3],A=a[4],w=a[5],R=a[6],z=a[7],P=a[8],j=a[9],I=a[10],S=a[11],E=a[12],O=a[13],T=a[14],D=a[15];return Math.abs(r-p)<=n*Math.max(1,Math.abs(r),Math.abs(p))&&Math.abs(u-y)<=n*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(e-q)<=n*Math.max(1,Math.abs(e),Math.abs(q))&&Math.abs(o-g)<=n*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(i-A)<=n*Math.max(1,Math.abs(i),Math.abs(A))&&Math.abs(c-w)<=n*Math.max(1,Math.abs(c),Math.abs(w))&&Math.abs(h-R)<=n*Math.max(1,Math.abs(h),Math.abs(R))&&Math.abs(s-z)<=n*Math.max(1,Math.abs(s),Math.abs(z))&&Math.abs(M-P)<=n*Math.max(1,Math.abs(M),Math.abs(P))&&Math.abs(f-j)<=n*Math.max(1,Math.abs(f),Math.abs(j))&&Math.abs(l-I)<=n*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(v-S)<=n*Math.max(1,Math.abs(v),Math.abs(S))&&Math.abs(b-E)<=n*Math.max(1,Math.abs(b),Math.abs(E))&&Math.abs(m-O)<=n*Math.max(1,Math.abs(m),Math.abs(O))&&Math.abs(d-T)<=n*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(x-D)<=n*Math.max(1,Math.abs(x),Math.abs(D))},mul:I,sub:S});function O(){var t=new a(3);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function T(t){var n=t[0],a=t[1],r=t[2];return Math.hypot(n,a,r)}function D(t,n,r){var u=new a(3);return u[0]=t,u[1]=n,u[2]=r,u}function F(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t}function L(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t}function V(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[2],t}function Q(t,n){var a=n[0]-t[0],r=n[1]-t[1],u=n[2]-t[2];return Math.hypot(a,r,u)}function Y(t,n){var a=n[0]-t[0],r=n[1]-t[1],u=n[2]-t[2];return a*a+r*r+u*u}function X(t){var n=t[0],a=t[1],r=t[2];return n*n+a*a+r*r}function Z(t,n){var a=n[0],r=n[1],u=n[2],e=a*a+r*r+u*u;return e>0&&(e=1/Math.sqrt(e)),t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function _(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function B(t,n,a){var r=n[0],u=n[1],e=n[2],o=a[0],i=a[1],c=a[2];return t[0]=u*c-e*i,t[1]=e*o-r*c,t[2]=r*i-u*o,t}var N,k=F,U=L,W=V,C=Q,G=Y,H=T,J=X,K=(N=O(),function(t,n,a,r,u,e){var o,i;for(n||(n=3),a||(a=0),i=r?Math.min(r*n+a,t.length):t.length,o=a;o<i;o+=n)N[0]=t[o],N[1]=t[o+1],N[2]=t[o+2],u(N,N,e),t[o]=N[0],t[o+1]=N[1],t[o+2]=N[2];return t}),$=Object.freeze({create:O,clone:function(t){var n=new a(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n},length:T,fromValues:D,copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t},set:function(t,n,a,r){return t[0]=n,t[1]=a,t[2]=r,t},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t},subtract:F,multiply:L,divide:V,ceil:function(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t},floor:function(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t},min:function(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t},max:function(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t},round:function(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t},scale:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t},scaleAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t},distance:Q,squaredDistance:Y,squaredLength:X,negate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t},inverse:function(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t},normalize:Z,dot:_,cross:B,lerp:function(t,n,a,r){var u=n[0],e=n[1],o=n[2];return t[0]=u+r*(a[0]-u),t[1]=e+r*(a[1]-e),t[2]=o+r*(a[2]-o),t},hermite:function(t,n,a,r,u,e){var o=e*e,i=o*(2*e-3)+1,c=o*(e-2)+e,h=o*(e-1),s=o*(3-2*e);return t[0]=n[0]*i+a[0]*c+r[0]*h+u[0]*s,t[1]=n[1]*i+a[1]*c+r[1]*h+u[1]*s,t[2]=n[2]*i+a[2]*c+r[2]*h+u[2]*s,t},bezier:function(t,n,a,r,u,e){var o=1-e,i=o*o,c=e*e,h=i*o,s=3*e*i,M=3*c*o,f=c*e;return t[0]=n[0]*h+a[0]*s+r[0]*M+u[0]*f,t[1]=n[1]*h+a[1]*s+r[1]*M+u[1]*f,t[2]=n[2]*h+a[2]*s+r[2]*M+u[2]*f,t},random:function(t,n){n=n||1;var a=2*r()*Math.PI,u=2*r()-1,e=Math.sqrt(1-u*u)*n;return t[0]=Math.cos(a)*e,t[1]=Math.sin(a)*e,t[2]=u*n,t},transformMat4:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=a[3]*r+a[7]*u+a[11]*e+a[15];
57return o=o||1,t[0]=(a[0]*r+a[4]*u+a[8]*e+a[12])/o,t[1]=(a[1]*r+a[5]*u+a[9]*e+a[13])/o,t[2]=(a[2]*r+a[6]*u+a[10]*e+a[14])/o,t},transformMat3:function(t,n,a){var r=n[0],u=n[1],e=n[2];return t[0]=r*a[0]+u*a[3]+e*a[6],t[1]=r*a[1]+u*a[4]+e*a[7],t[2]=r*a[2]+u*a[5]+e*a[8],t},transformQuat:function(t,n,a){var r=a[0],u=a[1],e=a[2],o=a[3],i=n[0],c=n[1],h=n[2],s=u*h-e*c,M=e*i-r*h,f=r*c-u*i,l=u*f-e*M,v=e*s-r*f,b=r*M-u*s,m=2*o;return s*=m,M*=m,f*=m,l*=2,v*=2,b*=2,t[0]=i+s+l,t[1]=c+M+v,t[2]=h+f+b,t},rotateX:function(t,n,a,r){var u=[],e=[];return u[0]=n[0]-a[0],u[1]=n[1]-a[1],u[2]=n[2]-a[2],e[0]=u[0],e[1]=u[1]*Math.cos(r)-u[2]*Math.sin(r),e[2]=u[1]*Math.sin(r)+u[2]*Math.cos(r),t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t},rotateY:function(t,n,a,r){var u=[],e=[];return u[0]=n[0]-a[0],u[1]=n[1]-a[1],u[2]=n[2]-a[2],e[0]=u[2]*Math.sin(r)+u[0]*Math.cos(r),e[1]=u[1],e[2]=u[2]*Math.cos(r)-u[0]*Math.sin(r),t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t},rotateZ:function(t,n,a,r){var u=[],e=[];return u[0]=n[0]-a[0],u[1]=n[1]-a[1],u[2]=n[2]-a[2],e[0]=u[0]*Math.cos(r)-u[1]*Math.sin(r),e[1]=u[0]*Math.sin(r)+u[1]*Math.cos(r),e[2]=u[2],t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t},angle:function(t,n){var a=D(t[0],t[1],t[2]),r=D(n[0],n[1],n[2]);Z(a,a),Z(r,r);var u=_(a,r);return u>1?0:u<-1?Math.PI:Math.acos(u)},zero:function(t){return t[0]=0,t[1]=0,t[2]=0,t},str:function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]},equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=a[0],i=a[1],c=a[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(u-i)<=n*Math.max(1,Math.abs(u),Math.abs(i))&&Math.abs(e-c)<=n*Math.max(1,Math.abs(e),Math.abs(c))},sub:k,mul:U,div:W,dist:C,sqrDist:G,len:H,sqrLen:J,forEach:K});function tt(){var t=new a(4);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function nt(t){var n=new a(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n}function at(t,n,r,u){var e=new a(4);return e[0]=t,e[1]=n,e[2]=r,e[3]=u,e}function rt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function ut(t,n,a,r,u){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t}function et(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t}function ot(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t}function it(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t[3]=n[3]*a[3],t}function ct(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[2],t[3]=n[3]/a[3],t}function ht(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t}function st(t,n){var a=n[0]-t[0],r=n[1]-t[1],u=n[2]-t[2],e=n[3]-t[3];return Math.hypot(a,r,u,e)}function Mt(t,n){var a=n[0]-t[0],r=n[1]-t[1],u=n[2]-t[2],e=n[3]-t[3];return a*a+r*r+u*u+e*e}function ft(t){var n=t[0],a=t[1],r=t[2],u=t[3];return Math.hypot(n,a,r,u)}function lt(t){var n=t[0],a=t[1],r=t[2],u=t[3];return n*n+a*a+r*r+u*u}function vt(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=a*a+r*r+u*u+e*e;return o>0&&(o=1/Math.sqrt(o)),t[0]=a*o,t[1]=r*o,t[2]=u*o,t[3]=e*o,t}function bt(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function mt(t,n,a,r){var u=n[0],e=n[1],o=n[2],i=n[3];return t[0]=u+r*(a[0]-u),t[1]=e+r*(a[1]-e),t[2]=o+r*(a[2]-o),t[3]=i+r*(a[3]-i),t}function dt(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function xt(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=a[0],c=a[1],h=a[2],s=a[3];return Math.abs(r-i)<=n*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(u-c)<=n*Math.max(1,Math.abs(u),Math.abs(c))&&Math.abs(e-h)<=n*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(o-s)<=n*Math.max(1,Math.abs(o),Math.abs(s))}var pt=ot,yt=it,qt=ct,gt=st,At=Mt,wt=ft,Rt=lt,zt=function(){var t=tt();return function(n,a,r,u,e,o){var i,c;for(a||(a=4),r||(r=0),c=u?Math.min(u*a+r,n.length):n.length,i=r;i<c;i+=a)t[0]=n[i],t[1]=n[i+1],t[2]=n[i+2],t[3]=n[i+3],e(t,t,o),n[i]=t[0],n[i+1]=t[1],n[i+2]=t[2],n[i+3]=t[3];return n}}(),Pt=Object.freeze({create:tt,clone:nt,fromValues:at,copy:rt,set:ut,add:et,subtract:ot,multiply:it,divide:ct,ceil:function(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t[3]=Math.ceil(n[3]),t},floor:function(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t[3]=Math.floor(n[3]),t},min:function(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t[3]=Math.min(n[3],a[3]),t},max:function(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t[3]=Math.max(n[3],a[3]),t},round:function(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t[3]=Math.round(n[3]),t},scale:ht,scaleAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t},distance:st,squaredDistance:Mt,length:ft,squaredLength:lt,negate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=-n[3],t},inverse:function(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t[3]=1/n[3],t},normalize:vt,dot:bt,cross:function(t,n,a,r){var u=a[0]*r[1]-a[1]
vendor: 14,532 bytes, line 57
57*r[0],e=a[0]*r[2]-a[2]*r[0],o=a[0]*r[3]-a[3]*r[0],i=a[1]*r[2]-a[2]*r[1],c=a[1]*r[3]-a[3]*r[1],h=a[2]*r[3]-a[3]*r[2],s=n[0],M=n[1],f=n[2],l=n[3];return t[0]=M*h-f*c+l*i,t[1]=-s*h+f*o-l*e,t[2]=s*c-M*o+l*u,t[3]=-s*i+M*e-f*u,t},lerp:mt,random:function(t,n){var a,u,e,o,i,c;n=n||1;do{i=(a=2*r()-1)*a+(u=2*r()-1)*u}while(i>=1);do{c=(e=2*r()-1)*e+(o=2*r()-1)*o}while(c>=1);var h=Math.sqrt((1-i)/c);return t[0]=n*a,t[1]=n*u,t[2]=n*e*h,t[3]=n*o*h,t},transformMat4:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3];return t[0]=a[0]*r+a[4]*u+a[8]*e+a[12]*o,t[1]=a[1]*r+a[5]*u+a[9]*e+a[13]*o,t[2]=a[2]*r+a[6]*u+a[10]*e+a[14]*o,t[3]=a[3]*r+a[7]*u+a[11]*e+a[15]*o,t},transformQuat:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=a[0],i=a[1],c=a[2],h=a[3],s=h*r+i*e-c*u,M=h*u+c*r-o*e,f=h*e+o*u-i*r,l=-o*r-i*u-c*e;return t[0]=s*h+l*-o+M*-c-f*-i,t[1]=M*h+l*-i+f*-o-s*-c,t[2]=f*h+l*-c+s*-i-M*-o,t[3]=n[3],t},zero:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},str:function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},exactEquals:dt,equals:xt,sub:pt,mul:yt,div:qt,dist:gt,sqrDist:At,len:wt,sqrLen:Rt,forEach:zt});function jt(){var t=new a(4);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function It(t,n,a){a*=.5;var r=Math.sin(a);return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=Math.cos(a),t}function St(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=a[0],c=a[1],h=a[2],s=a[3];return t[0]=r*s+o*i+u*h-e*c,t[1]=u*s+o*c+e*i-r*h,t[2]=e*s+o*h+r*c-u*i,t[3]=o*s-r*i-u*c-e*h,t}function Et(t,n,a){a*=.5;var r=n[0],u=n[1],e=n[2],o=n[3],i=Math.sin(a),c=Math.cos(a);return t[0]=r*c+o*i,t[1]=u*c+e*i,t[2]=e*c-u*i,t[3]=o*c-r*i,t}function Ot(t,n,a){a*=.5;var r=n[0],u=n[1],e=n[2],o=n[3],i=Math.sin(a),c=Math.cos(a);return t[0]=r*c-e*i,t[1]=u*c+o*i,t[2]=e*c+r*i,t[3]=o*c-u*i,t}function Tt(t,n,a){a*=.5;var r=n[0],u=n[1],e=n[2],o=n[3],i=Math.sin(a),c=Math.cos(a);return t[0]=r*c+u*i,t[1]=u*c-r*i,t[2]=e*c+o*i,t[3]=o*c-e*i,t}function Dt(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=Math.sqrt(a*a+r*r+u*u),i=Math.exp(e),c=o>0?i*Math.sin(o)/o:0;return t[0]=a*c,t[1]=r*c,t[2]=u*c,t[3]=i*Math.cos(o),t}function Ft(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=Math.sqrt(a*a+r*r+u*u),i=o>0?Math.atan2(o,e)/o:0;return t[0]=a*i,t[1]=r*i,t[2]=u*i,t[3]=.5*Math.log(a*a+r*r+u*u+e*e),t}function Lt(t,a,r,u){var e,o,i,c,h,s=a[0],M=a[1],f=a[2],l=a[3],v=r[0],b=r[1],m=r[2],d=r[3];return(o=s*v+M*b+f*m+l*d)<0&&(o=-o,v=-v,b=-b,m=-m,d=-d),1-o>n?(e=Math.acos(o),i=Math.sin(e),c=Math.sin((1-u)*e)/i,h=Math.sin(u*e)/i):(c=1-u,h=u),t[0]=c*s+h*v,t[1]=c*M+h*b,t[2]=c*f+h*m,t[3]=c*l+h*d,t}function Vt(t,n){var a,r=n[0]+n[4]+n[8];if(r>0)a=Math.sqrt(r+1),t[3]=.5*a,a=.5/a,t[0]=(n[5]-n[7])*a,t[1]=(n[6]-n[2])*a,t[2]=(n[1]-n[3])*a;else{var u=0;n[4]>n[0]&&(u=1),n[8]>n[3*u+u]&&(u=2);var e=(u+1)%3,o=(u+2)%3;a=Math.sqrt(n[3*u+u]-n[3*e+e]-n[3*o+o]+1),t[u]=.5*a,a=.5/a,t[3]=(n[3*e+o]-n[3*o+e])*a,t[e]=(n[3*e+u]+n[3*u+e])*a,t[o]=(n[3*o+u]+n[3*u+o])*a}return t}var Qt,Yt,Xt,Zt,_t,Bt,Nt=nt,kt=at,Ut=rt,Wt=ut,Ct=et,Gt=St,Ht=ht,Jt=bt,Kt=mt,$t=ft,tn=$t,nn=lt,an=nn,rn=vt,un=dt,en=xt,on=(Qt=O(),Yt=D(1,0,0),Xt=D(0,1,0),function(t,n,a){var r=_(n,a);return r<-.999999?(B(Qt,Yt,n),H(Qt)<1e-6&&B(Qt,Xt,n),Z(Qt,Qt),It(t,Qt,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(B(Qt,n,a),t[0]=Qt[0],t[1]=Qt[1],t[2]=Qt[2],t[3]=1+r,rn(t,t))}),cn=(Zt=jt(),_t=jt(),function(t,n,a,r,u,e){return Lt(Zt,n,u,e),Lt(_t,a,r,e),Lt(t,Zt,_t,2*e*(1-e)),t}),hn=(Bt=m(),function(t,n,a,r){return Bt[0]=a[0],Bt[3]=a[1],Bt[6]=a[2],Bt[1]=r[0],Bt[4]=r[1],Bt[7]=r[2],Bt[2]=-n[0],Bt[5]=-n[1],Bt[8]=-n[2],rn(t,Vt(t,Bt))}),sn=Object.freeze({create:jt,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},setAxisAngle:It,getAxisAngle:function(t,a){var r=2*Math.acos(a[3]),u=Math.sin(r/2);return u>n?(t[0]=a[0]/u,t[1]=a[1]/u,t[2]=a[2]/u):(t[0]=1,t[1]=0,t[2]=0),r},getAngle:function(t,n){var a=Jt(t,n);return Math.acos(2*a*a-1)},multiply:St,rotateX:Et,rotateY:Ot,rotateZ:Tt,calculateW:function(t,n){var a=n[0],r=n[1],u=n[2];return t[0]=a,t[1]=r,t[2]=u,t[3]=Math.sqrt(Math.abs(1-a*a-r*r-u*u)),t},exp:Dt,ln:Ft,pow:function(t,n,a){return Ft(t,n),Ht(t,t,a),Dt(t,t),t},slerp:Lt,random:function(t){var n=r(),a=r(),u=r(),e=Math.sqrt(1-n),o=Math.sqrt(n);return t[0]=e*Math.sin(2*Math.PI*a),t[1]=e*Math.cos(2*Math.PI*a),t[2]=o*Math.sin(2*Math.PI*u),t[3]=o*Math.cos(2*Math.PI*u),t},invert:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=a*a+r*r+u*u+e*e,i=o?1/o:0;return t[0]=-a*i,t[1]=-r*i,t[2]=-u*i,t[3]=e*i,t},conjugate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t},fromMat3:Vt,fromEuler:function(t,n,a,r){var u=.5*Math.PI/180;n*=u,a*=u,r*=u;var e=Math.sin(n),o=Math.cos(n),i=Math.sin(a),c=Math.cos(a),h=Math.sin(r),s=Math.cos(r);return t[0]=e*c*s-o*i*h,t[1]=o*i*s+e*c*h,t[2]=o*c*h-e*i*s,t[3]=o*c*s+e*i*h,t},str:function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},clone:Nt,fromValues:kt,copy:Ut,set:Wt,add:Ct,mul:Gt,scale:Ht,dot:Jt,lerp:Kt,length:$t,len:tn,squaredLength:nn,sqrLen:an,normalize:rn,exactEquals:un,equals:en,rotationTo:on,sqlerp:cn,setAxes:hn});function Mn(t,n,a){var r=.5*a[0],u=.5*a[1],e=.5*a[2],o=n[0],i=n[1],c=n[2],h=n[3];return t[0]=o,t[1]=i,t[2]=c,t[3]=h,t[4]=r*h+u*c-e*i,t[5]=u*h+e*o-r*c,t[6]=e*h+r*i-u*o,t[7]=-r*o-u*i-e*c,t}function fn(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t}var ln=Ut;var vn=Ut;function bn(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=a[4],c=a[5],h=a[6],s=a[7],M=n[4],f=n[5],l=n[6],v=n[7],b=a[0],m=a[1],d=a[2],x=a[3];return t[0]=r*x+o*b+u*d-e*m,t[1]=u*x+o*m+e*b-r*d,t[2]=e*x+o*d+r*m-u*b,t[3]=o*x-r*b-u*m-e*d,t[4]=r*s+o*i+u*h-e*c+M*x+v*b+f*d-l*m,t[5]=u*s+o*c+e*i-r*h+f*x+v*m+l*b-M*d,t[6]=e*s+o*h+r*c-u*i+l*x+v*d+M*m-f*b,t[7]=o*s-r*i-u*c-e*h+v*x-M*b-f*m-l*d,t}var mn=bn;var dn=Jt;var xn=$t,pn=xn,yn=nn,qn=yn;var gn=Object.freeze({create:function(){var t=new a(8);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t},clone:function(t){var n=new a(8);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n},fromValues:function(t,n,r,u,e,o,i,c){var h=new a(8);return h[0]=t,h[1]=n,h[2]=r,h[3]=u,h[4]=e,h[5]=o,h[6]=i,h[7]=c,h},fromRotationTranslationValues:function(t,n,r,u,e,o,i){var c=new a(8);c[0]=t,c[1]=n,c[2]=r,c[3]=u;var h=.5*e,s=.5*o,M=.5*i;return c[4]=h*u+s*r-M*n,c[5]=s*u+M*t-h*r,c[6]=M*u+h*n-s*t,c[7]=-h*t-s*n-M*r,c},fromRotationTranslation:Mn,fromTranslation:function(t,n){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*n[0],t[5]=.5*n[1],t[6]=.5*n[2],t[7]=0,t},fromRotation:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t},fromMat4:function(t,n){var r=jt();P(r,n);var u=new a(3);return R(u,n),Mn(t,r,u),t},copy:fn,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t},set:function(t,n,a,r,u,e,o,i,c){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t[4]=e,t[5]=o,t[6]=i,t[7]=c,t},getReal:ln,getDual:function(t,n){return t[0]=n[4],t[1]=n[5],t[2]=n[6],t[3]=n[7],t},setReal:vn,setDual:function(t,n){return t[4]=n[0],t[5]=n[1],t[6]=n[2],t[7]=n[3],t},getTranslation:function(t,n){var a=n[4],r=n[5],u=n[6],e=n[7],o=-n[0],i=-n[1],c=-n[2],h=n[3];return t[0]=2*(a*h+e*o+r*c-u*i),t[1]=2*(r*h+e*i+u*o-a*c),t[2]=2*(u*h+e*c+a*i-r*o),t},translate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=.5*a[0],c=.5*a[1],h=.5*a[2],s=n[4],M=n[5],f=n[6],l=n[7];return t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=o*i+u*h-e*c+s,t[5]=o*c+e*i-r*h+M,t[6]=o*h+r*c-u*i+f,t[7]=-r*i-u*c-e*h+l,t},rotateX:function(t,n,a){var r=-n[0],u=-n[1],e=-n[2],o=n[3],i=n[4],c=n[5],h=n[6],s=n[7],M=i*o+s*r+c*e-h*u,f=c*o+s*u+h*r-i*e,l=h*o+s*e+i*u-c*r,v=s*o-i*r-c*u-h*e;return Et(t,n,a),r=t[0],u=t[1],e=t[2],o=t[3],t[4]=M*o+v*r+f*e-l*u,t[5]=f*o+v*u+l*r-M*e,t[6]=l*o+v*e+M*u-f*r,t[7]=v*o-M*r-f*u-l*e,t},rotateY:function(t,n,a){var r=-n[0],u=-n[1],e=-n[2],o=n[3],i=n[4],c=n[5],h=n[6],s=n[7],M=i*o+s*r+c*e-h*u,f=c*o+s*u+h*r-i*e,l=h*o+s*e+i*u-c*r,v=s*o-i*r-c*u-h*e;return Ot(t,n,a),r=t[0],u=t[1],e=t[2],o=t[3],t[4]=M*o+v*r+f*e-l*u,t[5]=f*o+v*u+l*r-M*e,t[6]=l*o+v*e+M*u-f*r,t[7]=v*o-M*r-f*u-l*e,t},rotateZ:function(t,n,a){var r=-n[0],u=-n[1],e=-n[2],o=n[3],i=n[4],c=n[5],h=n[6],s=n[7],M=i*o+s*r+c*e-h*u,f=c*o+s*u+h*r-i*e,l=h*o+s*e+i*u-c*r,v=s*o-i*r-c*u-h*e;return Tt(t,n,a),r=t[0],u=t[1],e=t[2],o=t[3],t[4]=M*o+v*r+f*e-l*u,t[5]=f*o+v*u+l*r-M*e,t[6]=l*o+v*e+M*u-f*r,t[7]=v*o-M*r-f*u-l*e,t},rotateByQuatAppend:function(t,n,a){var r=a[0],u=a[1],e=a[2],o=a[3],i=n[0],c=n[1],h=n[2],s=n[3];return t[0]=i*o+s*r+c*e-h*u,t[1]=c*o+s*u+h*r-i*e,t[2]=h*o+s*e+i*u-c*r,t[3]=s*o-i*r-c*u-h*e,i=n[4],c=n[5],h=n[6],s=n[7],t[4]=i*o+s*r+c*e-h*u,t[5]=c*o+s*u+h*r-i*e,t[6]=h*o+s*e+i*u-c*r,t[7]=s*o-i*r-c*u-h*e,t},rotateByQuatPrepend:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=a[0],c=a[1],h=a[2],s=a[3];return t[0]=r*s+o*i+u*h-e*c,t[1]=u*s+o*c+e*i-r*h,t[2]=e*s+o*h+r*c-u*i,t[3]=o*s-r*i-u*c-e*h,i=a[4],c=a[5],h=a[6],s=a[7],t[4]=r*s+o*i+u*h-e*c,t[5]=u*s+o*c+e*i-r*h,t[6]=e*s+o*h+r*c-u*i,t[7]=o*s-r*i-u*c-e*h,t},rotateAroundAxis:function(t,a,r,u){if(Math.abs(u)<n)return fn(t,a);var e=Math.hypot(r[0],r[1],r[2]);u*=.5;var o=Math.sin(u),i=o*r[0]/e,c=o*r[1]/e,h=o*r[2]/e,s=Math.cos(u),M=a[0],f=a[1],l=a[2],v=a[3];t[0]=M*s+v*i+f*h-l*c,t[1]=f*s+v*c+l*i-M*h,t[2]=l*s+v*h+M*c-f*i,t[3]=v*s-M*i-f*c-l*h;var b=a[4],m=a[5],d=a[6],x=a[7];return t[4]=b*s+x*i+m*h-d*c,t[5]=m*s+x*c+d*i-b*h,t[6]=d*s+x*h+b*c-m*i,t[7]=x*s-b*i-m*c-d*h,t},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t[4]=n[4]+a[4],t[5]=n[5]+a[5],t[6]=n[6]+a[6],t[7]=n[7]+a[7],t},multiply:bn,mul:mn,scale:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=n[7]*a,t},dot:dn,lerp:function(t,n,a,r){var u=1-r;return dn(n,a)<0&&(r=-r),t[0]=n[0]*u+a[0]*r,t[1]=n[1]*u+a[1]*r,t[2]=n[2]*u+a[2]*r,t[3]=n[3]*u+a[3]*r,t[4]=n[4]*u+a[4]*r,t[5]=n[5]*u+a[5]*r,t[6]=n[6]*u+a[6]*r,t[7]=n[7]*u+a[7]*r,t},invert:function(t,n){var a=yn(n);return t[0]=-n[0]/a,t[1]=-n[1]/a,t[2]=-n[2]/a,t[3]=n[3]/a,t[4]=-n[4]/a,t[5]=-n[5]/a,t[6]=-n[6]/a,t[7]=n[7]/a,t},conjugate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t[4]=-n[4],t[5]=-n[5],t[6]=-n[6],t[7]=n[7],t},length:xn,len:pn,squaredLength:yn,sqrLen:qn,normalize:function(t,n){var a=yn(n);if(a>0){a=Math.sqrt(a);var r=n[0]/a,u=n[1]/a,e=n[2]/a,o=n[3]/a,i=n[4],c=n[5],h=n[6],s=n[7],M=r*i+u*c+e*h+o*s;t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=(i-r*M)/a,t[5]=(c-u*M)/a,t[6]=(h-e*M)/a,t[7]=(s-o*M)/a}return t},str:function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]},equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=t[4],c=t[5],h=t[6],s=t[7],M=a[0],f=a[1],l=a[2],v=a[3],b=a[4],m=a[5],d=a[6],x=a[7];return Math.abs(r-M)<=n*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(u-f)<=n*Math.max(1,Math.abs(u),Math.abs(f))&&Math.abs(e-l)<=n*Math.max(1,Math.abs(e),Math.abs(l))&&Math.abs(o-v)<=n*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(i-b)<=n*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-m)<=n*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(h-d)<=n*Math.max(1,Math.abs(h),Math.abs(d))&&Math.abs(s-x)<=n*Math.max(1,Math.abs(s),Math.abs(x))}});function An(){var t=new a(2);return a!=Float32Array&&(t[0]=0,t[1]=0),t}function wn(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t}function Rn(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t}function zn(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t}function Pn(t,n){var a=n[0]-t[0],r=n[1]-t[1];return Math.hypot(a,r)}function jn(t,n){var a=n[0]-t[0],r=n[1]-t[1];return a*a+r*r}function In(t){var n=t[0],a=t[1];return Math.hypot(n,a)}function Sn(t){var n=t[0],a=t[1];return n*n+a*a}var En=In,On=wn,Tn=Rn,Dn=zn,Fn=Pn,Ln=jn,Vn=Sn,Qn=function(){var t=An();return function(n,a,r,u,e,o){var i,c;for(a||(a=2),r||(r=0),c=u?Math.min(u*a+r,n.length):n.length,i=r;i<c;i+=a)t[0]=n[i],t[1]=n[i+1],e(t,t,o),n[i]=t[0],n[i+1]=t[1];return n}}(),Yn=Object.freeze({create:An,clone:function(t){var n=new a(2);return n[0]=t[0],n[1]=t[1],n},fromValues:function(t,n){var r=new a(2);return r[0]=t,r[1]=n,r},copy:function(t,n){return t[0]=n[0],t[1]=n[1],t},set:function(t,n,a){return t[0]=n,t[1]=a,t},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t},subtract:wn,multiply:Rn,divide:zn,ceil:function(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t},floor:function(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t},min:function(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t},max:function(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t},round:function(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t},scale:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t},scaleAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t},distance:Pn,squaredDistance:jn,length:In,squaredLength:Sn,negate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t},inverse:function(t,n){return t[0]=1/n[0],t[1]=1/n[1],t},normalize:function(t,n){var a=n[0],r=n[1],u=a*a+r*r;return u>0&&(u=1/Math.sqrt(u)),t[0]=n[0]*u,t[1]=n[1]*u,t},dot:function(t,n){return t[0]*n[0]+t[1]*n[1]},cross:function(t,n,a){var r=n[0]*a[1]-n[1]*a[0];return t[0]=t[1]=0,t[2]=r,t},lerp:function(t,n,a,r){var u=n[0],e=n[1];return t[0]=u+r*(a[0]-u),t[1]=e+r*(a[1]-e),t},random:function(t,n){n=n||1;var a=2*r()*Math.PI;return t[0]=Math.cos(a)*n,t[1]=Math.sin(a)*n,t},transformMat2:function(t,n,a){var r=n[0],u=n[1];return t[0]=a[0]*r+a[2]*u,t[1]=a[1]*r+a[3]*u,t},transformMat2d:function(t,n,a){var r=n[0],u=n[1];return t[0]=a[0]*r+a[2]*u+a[4],t[1]=a[1]*r+a[3]*u+a[5],t},transformMat3:function(t,n,a){var r=n[0],u=n[1];return t[0]=a[0]*r+a[3]*u+a[6],t[1]=a[1]*r+a[4]*u+a[7],t},transformMat4:function(t,n,a){var r=n[0],u=n[1];return t[0]=a[0]*r+a[4]*u+a[12],t[1]=a[1]*r+a[5]*u+a[13],t},rotate:function(t,n,a,r){var u=n[0]-a[0],e=n[1]-a[1],o=Math.sin(r),i=Math.cos(r);return t[0]=u*i-e*o+a[0],t[1]=u*o+e*i+a[1],t},angle:function(t,n){var a=t[0],r=t[1],u=n[0],e=n[1],o=a*a+r*r;o>0&&(o=1/Math.sqrt(o));var i=u*u+e*e;i>0&&(i=1/Math.sqrt(i));var c=(a*u+r*e)*o*i;return c>1?0:c<-1?Math.PI:Math.acos(c)},zero:function(t){return t[0]=0,t[1]=0,t},str:function(t){return"vec2("+t[0]+", "+t[1]+")"},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]},equals:function(t,a){var r=t[0],u=t[1],e=a[0],o=a[1];return Math.abs(r-e)<=n*Math.max(1,Math.abs(r),Math.abs(e))&&Math.abs(u-o)<=n*Math.max(1,Math.abs(u),Math.abs(o))},len:En,sub:On,mul:Tn,div:Dn,dist:Fn,sqrDist:Ln,sqrLen:Vn,forEach:Qn});t.glMatrix=e,t.mat2=s,t.mat2d=b,t.mat3=q,t.mat4=E,t.quat=sn,t.quat2=gn,t.vec2=Y
57n,t.vec3=$,t.vec4=Pt,Object.defineProperty(t,"__esModule",{value:!0})}); 58 59// ["glMatrix", "mat2", "mat2d", "mat3", "mat4", "quat", "quat2", "vec2", "vec3", "vec4"] 60window.glMatrix = glMatrix; 61window.mat2 = glMatrix.mat2; 62window.mat2d = glMatrix.mat2d; 63window.mat3 = glMatrix.mat3; 64window.mat4 = glMatrix.mat4; 65window.quat = glMatrix.quat; 66window.quat2 = glMatrix.quat2; 67window.vec2 = glMatrix.vec2; 68window.vec3 = glMatrix.vec3; 69window.vec4 = glMatrix.vec4; 70 71 72CABLES.exportedPatch={settings:{opExample:[],licence:"none",isPublic:!1},ops:[{opId:"b0472a1d-db16-4ba6-8787-f300fbdc77bb",objName:"Ops.Gl.MainLoop",id:"4aceec49-3577-4bef-a66b-ac7bf6bacf8e",uiAttribs:{translate:{x:312,y:-1180},subPatch:0,notWorkingMsg:null},portsIn:[{name:"FPS Limit",value:0},{name:"Reduce FPS loading",value:!1},{name:"Clear",value:!0},{name:"ClearAlpha",value:!0},{name:"Fullscreen Button",value:!1},{name:"Active",value:!0},{name:"Hires Displays",value:!1}],portsOut:[{name:"trigger"},{name:"width"},{name:"height"}]},{opId:"cf3544e4-e392-432b-89fd-fcfb5c974388",objName:"Ops.Trigger.TriggerOnce",id:"690547ce-e991-4237-a233-27733feaba7e",uiAttribs:{translate:{x:-324,y:320},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Exec",links:[{portIn:"Exec",portOut:"Trigger Out",objIn:"690547ce-e991-4237-a233-27733feaba7e",objOut:"8fc3cece-aa47-4351-8021-500db995e0e1"}]},{name:"Reset",value:0}],portsOut:[{name:"Next"},{name:"Was Triggered",value:!0}]},{opId:"a466bc1f-06e9-4595-8849-bffb9fe22f99",objName:"Ops.Sequence",id:"e962b868-4c07-43f4-879c-405ff720ecbc",uiAttribs:{translate:{x:324,y:-620},subPatch:0,notWorkingMsg:null},portsIn:[{name:"exe",links:[{portIn:"exe",portOut:"trigger",objIn:"e962b868-4c07-43f4-879c-405ff720ecbc",objOut:"4aceec49-3577-4bef-a66b-ac7bf6bacf8e"}]},{name:"exe 0",value:0},{name:"exe 1",value:0},{name:"exe 2",value:0},{name:"exe 3",value:0},{name:"exe 4",value:0},{name:"exe 5",value:0},{name:"exe 6",value:0},{name:"exe 7",value:0},{name:"exe 8",value:0},{name:"exe 9",value:0},{name:"exe 10",value:0},{name:"exe 11",value:0},{name:"exe 12",value:0},{name:"exe 13",value:0},{name:"exe 14",value:0}],portsOut:[{name:"trigger 0"},{name:"trigger 1",value:0},{name:"trigger 2",value:0},{name:"trigger 3"},{name:"trigger 4"},{name:"trigger 5",value:0},{name:"trigger 6",value:0},{name:"trigger 7",value:0},{name:"trigger 8",value:0},{name:"trigger 9",value:0},{name:"trigger 10"},{name:"trigger 11"},{name:"trigger 12"},{name:"trigger 13"},{name:"trigger 14",value:0},{name:"trigger 15"}]},{opId:"c7617717-3114-452f-9625-e4fefd841e88",objName:"Ops.Array.ArrayMath",id:"85291a06-d0c9-4537-a71a-36534a644d66",uiAttribs:{extendTitle:"*",translate:{x:504,y:300},subPatch:0,notWorkingMsg:null},portsIn:[{name:"array 0",links:[{portIn:"array 0",portOut:"Points",objIn:"85291a06-d0c9-4537-a71a-36534a644d66",objOut:"ec6aa55e-96b0-44ae-9dc0-f5253ccca9d8"}]},{name:"Number for math",value:14},{name:"Math function index",value:0},{name:"Math function",value:"*"}],portsOut:[{name:"Array result"},{name:"Array length",value:7500}]},{opId:"ff9bc6a6-2cb3-4a85-8fd7-c9c61f402869",objName:"Ops.Value.ValueOrAssignment",id:"6d9867bf-e7c2-4bac-98e0-19c44b5cac80",uiAttribs:{title:"width",translate:{x:780,y:-420},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Value",links:[{portIn:"Value",portOut:"Number",objIn:"6d9867bf-e7c2-4bac-98e0-19c44b5cac80",objOut:"a0861770-d2dd-404c-968c-241d500ebbd7"}]},{name:"Default Value",value:50}],portsOut:[{name:"Result"}]},{opId:"ff9bc6a6-2cb3-4a85-8fd7-c9c61f402869",objName:"Ops.Value.ValueOrAssignment",id:"69557558-8953-49f1-b1c3-13856ee5f752",uiAttribs:{title:"height",translate:{x:840,y:-420},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Value",links:[{portIn:"Value",portOut:"Number",objIn:"69557558-8953-49f1-b1c3-13856ee5f752",objOut:"a0861770-d2dd-404c-968c-241d500ebbd7"}]},{name:"Default Value",value:50}],portsOut:[{name:"Result"}]},{opId:"1bbdae06-fbb2-489b-9bcc-36c9d65bd441",objName:"Ops.Math.Multiply",id:"69ae2b45-a2d7-400f-94c3-66eb0e06870c",uiAttribs:{translate:{x:888,y:-340},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"Result",objIn:"69ae2b45-a2d7-400f-94c3-66eb0e06870c",objOut:"69557558-8953-49f1-b1c3-13856ee5f752"}]},{name:"number2",links:[{portIn:"number2",portOut:"Result",objIn:"69ae2b45-a2d7-400f-94c3-66eb0e06870c",objOut:"6d9867bf-e7c2-4bac-98e0-19c44b5cac80"}]}],portsOut:[{name:"result"}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"4ddb0dcf-7ded-4763-ba8e-572131135acb",uiAttribs:{title:"Position",translate:{x:492,y:-120},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"4ddb0dcf-7ded-4763-ba8e-572131135acb",objOut:"e565302a-3604-4094-9ba8-d873763c1bdb"}]},{name:"fragment",value:"\nUNI sampler2D uPos;\nUNI sampler2D uVel;\nUNI sampler2D uMouse;\n\nUNI sampler2D uInit;\nUNI sampler2D uTrig;\n\nUNI float reset;\n\n \nIN vec2 texCoord;\n{{MODULES_HEAD}}\nvoid main()\n{\n \n vec4 pos = texture2D(uPos,texCoord);\n vec4 velocity = texture2D(uVel,texCoord);\n vec4 mouse = texture2D(uMouse,texCoord);\n\n vec4 trig = texture2D(uTrig,texCoord);\n vec4 init = texture2D(uInit,texCoord) - vec4(0.5,0.5,0.5,0.0);\n \n\n if (reset == 1.0 || trig.r == 0.0){\n \n pos = vec4(texCoord.x-0.5,texCoord.y-0.5,init.z,1.0);\n \n }
72else{\n\n //update via velocity\n pos.xyz += velocity.xyz;\n pos.xyz += mouse.xyz;\n\n \n\n \n }\n \n {{MODULE_COLOR}}\n outColor = vec4(pos);\n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"reset",links:[{portIn:"reset",portOut:"number",objIn:"4ddb0dcf-7ded-4763-ba8e-572131135acb",objOut:"856563b1-dc6d-4053-b61a-f44010d719aa"}]},{name:"uPos",links:[{portIn:"uPos",portOut:"texture_out",objIn:"4ddb0dcf-7ded-4763-ba8e-572131135acb",objOut:"e8c59e95-4f88-41f5-8cad-7694694c1957"}]},{name:"uVel",links:[{portIn:"uVel",portOut:"Texture",objIn:"4ddb0dcf-7ded-4763-ba8e-572131135acb",objOut:"1deca171-a9cf-4b3f-ac54-ae6819285153"}]},{name:"uMouse",links:[{portIn:"uMouse",portOut:"Texture",objIn:"4ddb0dcf-7ded-4763-ba8e-572131135acb",objOut:"66384a25-f03f-4bbb-a12b-7635c3a4d42e"}]},{name:"uInit",links:[{portIn:"uInit",portOut:"texture_out",objIn:"4ddb0dcf-7ded-4763-ba8e-572131135acb",objOut:"f397a443-97f9-42a5-9f7a-61e59353848f"}]},{name:"uTrig",links:[{portIn:"uTrig",portOut:"Texture",objIn:"4ddb0dcf-7ded-4763-ba8e-572131135acb",objOut:"8dd3deeb-b71e-4270-8b91-785f340488a4"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"18a6d1f4-a7f8-4a3e-ab1d-0c2d2efe3861",objName:"Ops.Gl.Textures.CopyTexture",id:"e8c59e95-4f88-41f5-8cad-7694694c1957",uiAttribs:{translate:{x:672,y:-120},subPatch:0,notWorkingMsg:null,hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"e8c59e95-4f88-41f5-8cad-7694694c1957",objOut:"bd889c8e-b70b-484a-aef3-22cdea1f3a91"}]},{name:"Texture",links:[{portIn:"Texture",portOut:"Texture",objIn:"e8c59e95-4f88-41f5-8cad-7694694c1957",objOut:"f551b7ff-b5ad-4797-8f23-9f77b7b101da"}]},{name:"use original size",value:!0},{name:"width",value:50},{name:"height",value:50},{name:"filter index",value:0},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"HDR",value:!0}],portsOut:[{name:"trigger",value:0},{name:"texture_out"},{name:"Aspect Ratio",value:1}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"f551b7ff-b5ad-4797-8f23-9f77b7b101da",uiAttribs:{translate:{x:492,y:-60},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"f551b7ff-b5ad-4797-8f23-9f77b7b101da",objOut:"4ddb0dcf-7ded-4763-ba8e-572131135acb"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"f551b7ff-b5ad-4797-8f23-9f77b7b101da",objOut:"4ddb0dcf-7ded-4763-ba8e-572131135acb"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!1},{name:"Width",links:[{portIn:"Width",portOut:"Result",objIn:"f551b7ff-b5ad-4797-8f23-9f77b7b101da",objOut:"6d9867bf-e7c2-4bac-98e0-19c44b5cac80"}]},{name:"Height",links:[{portIn:"Height",portOut:"Result",objIn:"f551b7ff-b5ad-4797-8f23-9f77b7b101da",objOut:"69557558-8953-49f1-b1c3-13856ee5f752"}]},{name:"Floating Point",value:!0}],portsOut:[{name:"Next"},{name:"Texture"}]},{opId:"f069c0db-4051-4eae-989e-6ef7953787fd",objName:"Ops.Devices.Keyboard.KeyPressLearn",id:"5a1d0dc8-a4b4-43e3-8f1a-41b16445fe16",uiAttribs:{translate:{x:480,y:-920},subPatch:0,notWorkingMsg:null},portsIn:[{name:"key code",value:82},{name:"canvas only",value:!1},{name:"Mod Key index",value:0},{name:"Mod Key",value:"none"},{name:"Enabled",value:!0},{name:"Prevent Default",value:!1},{name:"learn",value:0}],portsOut:[{name:"on press"},{name:"on release",value:0},{name:"Pressed"}]},{opId:"450b4d68-2278-4d9f-9849-0abdfa37ef69",objName:"Ops.Gl.Meshes.Sphere_v2",id:"78bb1bdf-4596-4392-a58c-7fbc529722ce",uiAttribs:{translate:{x:-324,y:460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Next",objIn:"78bb1bdf-4596-4392-a58c-7fbc529722ce",objOut:"690547ce-e991-4237-a233-27733feaba7e"}]},{name:"radius",value:.1},{name:"stacks",value:32}
72,{name:"slices",value:32},{name:"Filloffset",value:1},{name:"Render",value:!0}],portsOut:[{name:"trigger",value:0},{name:"geometry"}]},{opId:"5c04608d-1e42-4e36-be00-1be4a81fc309",objName:"Ops.Gl.TextureEffects.ImageCompose",id:"455c97fe-4969-4482-b8ab-70fec9e3675b",uiAttribs:{hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null,translate:{x:1044,y:-260},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"455c97fe-4969-4482-b8ab-70fec9e3675b",objOut:"d5726eeb-5949-4109-842a-67e052d2db5f"}]},{name:"use viewport size",value:!1},{name:"width",links:[{portIn:"width",portOut:"Result",objIn:"455c97fe-4969-4482-b8ab-70fec9e3675b",objOut:"6d9867bf-e7c2-4bac-98e0-19c44b5cac80"}]},{name:"height",links:[{portIn:"height",portOut:"Result",objIn:"455c97fe-4969-4482-b8ab-70fec9e3675b",objOut:"69557558-8953-49f1-b1c3-13856ee5f752"}]},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"repeat"},{name:"HDR",value:!0},{name:"Background Alpha",value:1}],portsOut:[{name:"trigger"},{name:"texture_out"},{name:"Aspect Ratio",value:1}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"1deca171-a9cf-4b3f-ac54-ae6819285153",uiAttribs:{translate:{x:792,y:-60},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"1deca171-a9cf-4b3f-ac54-ae6819285153",objOut:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"1deca171-a9cf-4b3f-ac54-ae6819285153",objOut:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!1},{name:"Width",links:[{portIn:"Width",portOut:"Result",objIn:"1deca171-a9cf-4b3f-ac54-ae6819285153",objOut:"6d9867bf-e7c2-4bac-98e0-19c44b5cac80"}]},{name:"Height",links:[{portIn:"Height",portOut:"Result",objIn:"1deca171-a9cf-4b3f-ac54-ae6819285153",objOut:"69557558-8953-49f1-b1c3-13856ee5f752"}]},{name:"Floating Point",value:!0}],portsOut:[{name:"Next",value:0},{name:"Texture"}]},{opId:"18a6d1f4-a7f8-4a3e-ab1d-0c2d2efe3861",objName:"Ops.Gl.Textures.CopyTexture",id:"75771025-7e53-4e94-8a84-4fbf8a6d762e",uiAttribs:{translate:{x:924,y:-80},subPatch:0,notWorkingMsg:null,hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"75771025-7e53-4e94-8a84-4fbf8a6d762e",objOut:"bd889c8e-b70b-484a-aef3-22cdea1f3a91"}]},{name:"Texture",links:[{portIn:"Texture",portOut:"Texture",objIn:"75771025-7e53-4e94-8a84-4fbf8a6d762e",objOut:"1deca171-a9cf-4b3f-ac54-ae6819285153"}]},{name:"use original size",value:!0},{name:"width",value:50},{name:"height",value:50},{name:"filter index",value:0},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"HDR",value:!0}],portsOut:[{name:"trigger",value:0},{name:"texture_out"},{name:"Aspect Ratio",value:1}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6",uiAttribs:{title:"Velocity",translate:{x:792,y:-120},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6",objOut:"e565302a-3604-4094-9ba8-d873763c1bdb"}]},{name:"fragment",value:"\nUNI sampler2D uVel;\nUNI sampler2D uTurbx;\nUNI sampler2D uTurby;\nUNI sampler2D uTurbz;\nUNI sampler2D uPos;\n\nUNI sampler2D uInput;\nUNI sampler2D uFlow;\n\n// UNI float mouseX;\n// UNI float mouseY;\n// UNI float mouseDown;\n// UNI float thresh;\n\nUNI float reset;\nUNI float level;\nUNI float cam;\nUNI float flowLevel;\n\nIN vec2 texCoord;\n{{MODULES_HEAD}}\nvoid main()\n{\n \n \n vec4 velocity = texture2D(uVel,texCoord);\n vec4 pos = texture2D(uPos,texCoord);\n \n float turbx = texture2D(uTurbx,pos.xy+vec2(0.5)).r;\n float turby = texture2D(uTurby,pos.xy+vec2(0.5)).r;\n float turbz = texture2D(uTurbz,pos.xz+vec2(0.5)).r;\n\n\n vec2 flow = texture2D(uFlow, (pos.xy +vec2(0.5))).xy;\n vec2 camIn = texture2D(uInput, (pos.xy +vec2(0.5))).xy;\n\n // vec2 mouse = vec2(mouseX,mouseY);\n vec3 turb = vec3(turbx,turby,turbz);\n if (reset == 1.){\n \n velocity = vec4(vec3(0.0),1.0
72);\n \n }else{\n \n //turb\n velocity.xyz -= (turb - vec3(0.5)) * 0.0002 * level;\n \n //flow \n velocity.xy += flow * 0.0002 * flowLevel;\n \n //cam input\n velocity.xy += camIn * 0.0002 * cam;\n \n //pull\n // float dist = distance(mouse,pos.xy);\n \n // if (dist < thresh && mouseDown == 1.0){\n \n // velocity.xy += (mouse - pos.xy) * 0.01; \n \n // }\n \n \n velocity.xyz *= 0.99; //drag\n \n }\n \n {{MODULE_COLOR}}\n outColor = vec4(velocity);\n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"reset",links:[{portIn:"reset",portOut:"number",objIn:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6",objOut:"856563b1-dc6d-4053-b61a-f44010d719aa"}]},{name:"level",links:[{portIn:"level",portOut:"Result",objIn:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6",objOut:"0d5b9a64-6587-432e-aefe-afafb2f18e43"}]},{name:"cam",links:[{portIn:"cam",portOut:"Result",objIn:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6",objOut:"0daf6f7a-9bd6-40cd-a8fd-303ac2d72ba9"}]},{name:"flowLevel",links:[{portIn:"flowLevel",portOut:"result",objIn:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6",objOut:"35048f81-0f8c-428f-8df6-a38429c266c1"}]},{name:"uVel",links:[{portIn:"uVel",portOut:"texture_out",objIn:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6",objOut:"75771025-7e53-4e94-8a84-4fbf8a6d762e"}]},{name:"uTurbx",links:[{portIn:"uTurbx",portOut:"texture_out",objIn:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6",objOut:"455c97fe-4969-4482-b8ab-70fec9e3675b"}]},{name:"uTurby",links:[{portIn:"uTurby",portOut:"texture_out",objIn:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6",objOut:"0e5d2448-4379-470c-a7b8-1deabed50437"}]},{name:"uTurbz",links:[{portIn:"uTurbz",portOut:"texture_out",objIn:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6",objOut:"a9289b5f-f0d2-4017-b6ea-c1a156358a4a"}]},{name:"uPos",links:[{portIn:"uPos",portOut:"Texture",objIn:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6",objOut:"f551b7ff-b5ad-4797-8f23-9f77b7b101da"}]},{name:"uInput",links:[{portIn:"uInput",portOut:"Texture",objIn:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6",objOut:"96343d31-f564-45cd-bfcc-4a5497b87251"}]},{name:"uFlow",links:[{portIn:"uFlow",portOut:"Texture",objIn:"e3ac6286-c5c8-4ba0-8b3b-f13dd2e613a6",objOut:"28ce8c8f-df8f-4751-9e80-6b22dc355b55"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"85b0d8e5-f417-4349-aa35-fe45a6698183",objName:"Ops.Gl.TextureEffects.Noise.SimplexNoise",id:"17b5113f-e1ae-4988-882e-28aed38277fe",uiAttribs:{translate:{x:1044,y:-100},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"17b5113f-e1ae-4988-882e-28aed38277fe",objOut:"455c97fe-4969-4482-b8ab-70fec9e3675b"}]},{name:"Blend Mode index",value:0},{name:"Blend Mode",value:"normal"},{name:"Amount",value:1},{name:"smoothness",value:1},{name:"scale",value:5},{name:"x",value:0},{name:"y",value:0},{name:"time",links:[{portIn:"time",portOut:"Time",objIn:"17b5113f-e1ae-4988-882e-28aed38277fe",objOut:"f214ef72-eef8-4f4c-9c43-02dc7bdf3c91"}]}],portsOut:[{name:"trigger",value:0}]},{opId:"5c04608d-1e42-4e36-be00-1be4a81fc309",objName:"Ops.Gl.TextureEffects.ImageCompose",id:"0e5d2448-4379-470c-a7b8-1deabed50437",uiAttribs:{hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null,translate:{x:1164,y:-260},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"0e5d2448-4379-470c-a7b8-1deabed50437",objOut:"d5726eeb-5949-4109-842a-67e052d2db5f"}]},{name:"use viewport size",value:!1},{name:"width",links:[{portIn:"width",portOut:"Result",objIn:"0e5d2448-4379-470c-a7b8-1deabed50437",objOut:"6d9867bf-e7c2-4bac-98e0-19c44b5cac80"}]},{name:"height",links:[{portIn:"height",portOut:"Result",objIn:"0e5d2448-4379-470c-a7b8-1deabed50437",objOut:"69557558-8953-49f1-b1c3-13856ee5f752"}]},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"repeat"},{name:"HDR",value:!0}
72,{name:"Background Alpha",value:1}],portsOut:[{name:"trigger"},{name:"texture_out"},{name:"Aspect Ratio",value:1}]},{opId:"65ae3c2e-90d7-48fe-93df-30245f0bcf34",objName:"Ops.Anim.Timer",id:"f214ef72-eef8-4f4c-9c43-02dc7bdf3c91",uiAttribs:{translate:{x:1188,y:-180},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Play",value:!0},{name:"Reset",value:0},{name:"Speed",value:.1}],portsOut:[{name:"Time"}]},{opId:"85b0d8e5-f417-4349-aa35-fe45a6698183",objName:"Ops.Gl.TextureEffects.Noise.SimplexNoise",id:"0c4c46a4-106a-4c2d-9989-e1e366cd0c51",uiAttribs:{translate:{x:1164,y:-100},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"0c4c46a4-106a-4c2d-9989-e1e366cd0c51",objOut:"0e5d2448-4379-470c-a7b8-1deabed50437"}]},{name:"Blend Mode index",value:0},{name:"Blend Mode",value:"normal"},{name:"Amount",value:1},{name:"smoothness",value:1},{name:"scale",value:5},{name:"x",value:10},{name:"y",value:10},{name:"time",links:[{portIn:"time",portOut:"Time",objIn:"0c4c46a4-106a-4c2d-9989-e1e366cd0c51",objOut:"f214ef72-eef8-4f4c-9c43-02dc7bdf3c91"}]}],portsOut:[{name:"trigger",value:0}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"5dc72b10-59b0-432d-a589-2bfc5a49b741",uiAttribs:{title:"Life",translate:{x:240,y:-120},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"5dc72b10-59b0-432d-a589-2bfc5a49b741",objOut:"e565302a-3604-4094-9ba8-d873763c1bdb"}]},{name:"fragment",value:"\nUNI sampler2D uPos;\nUNI sampler2D uLife;\n\nUNI sampler2D uInit;\n\nUNI float reset;\nUNI float decay;\n\nIN vec2 texCoord;\n{{MODULES_HEAD}}\nvoid main()\n{\n \n //bounds\n vec2 xBounds = vec2(-3.,3.);\n vec2 yBounds = vec2(-3.,3.);\n // vec2 zBounds = vec2(-14.,14.);\n \n \n float life = texture2D(uLife,texCoord).r;\n vec4 pos = texture2D(uPos,texCoord);\n float init = texture2D(uInit,texCoord).b;\n \n //float trigger = 0.0;\n \n if (reset == 1.){\n \n life = init;\n \n }else{\n \n\n //timer trigger\n life += decay * (1.0 - (init * 0.4));\n if(life >= 1.1){\n life = 0.0;\n //trigger = 1.0;\n }\n \n //bounds loop\n if ( pos.x <= xBounds.x || pos.x >= xBounds.y || pos.y <= yBounds.x || pos.y >= yBounds.y){\n life = 1.0;\n }\n \n \n\n }\n \n {{MODULE_COLOR}}\n outColor = vec4(vec3(life),1.0);\n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"reset",links:[{portIn:"reset",portOut:"number",objIn:"5dc72b10-59b0-432d-a589-2bfc5a49b741",objOut:"856563b1-dc6d-4053-b61a-f44010d719aa"}]},{name:"decay",links:[{portIn:"decay",portOut:"result",objIn:"5dc72b10-59b0-432d-a589-2bfc5a49b741",objOut:"0efa208a-5fe5-4982-b57c-df14d96f8eaf"}]},{name:"uPos",links:[{portIn:"uPos",portOut:"Texture",objIn:"5dc72b10-59b0-432d-a589-2bfc5a49b741",objOut:"f551b7ff-b5ad-4797-8f23-9f77b7b101da"}]},{name:"uLife",links:[{portIn:"uLife",portOut:"texture_out",objIn:"5dc72b10-59b0-432d-a589-2bfc5a49b741",objOut:"e6c4e69c-a1f4-4a8f-a373-febc2611168a"}]},{name:"uInit",links:[{portIn:"uInit",portOut:"texture_out",objIn:"5dc72b10-59b0-432d-a589-2bfc5a49b741",objOut:"f397a443-97f9-42a5-9f7a-61e59353848f"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"d638c0a1-6c53-4c3f-a119-3853b4e66684",uiAttribs:{translate:{x:240,y:-60},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"d638c0a1-6c53-4c3f-a119-3853b4e66684",objOut:"5dc72b10-59b0-432d-a589-2bfc5a49b741"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"d638c0a1-6c53-4c3f-a119-3853b4e66684",objOut:"5dc72b10-59b0-432d-a589-2bfc5a49b741"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!1},{name:"Width",links:[{portIn:"Width",portOut:"Result",objIn:"d638c0a1-6c53-4c3f-a119-3853b4e66684",objOut:"6d9867bf-e7c2-4bac-98e0-19c44b5cac80"}]},{name:"Height",links:[{portIn:"Height",portOut:"Result",objIn:"d638c0a1-6c53-4c3f-a119-3853b4e66684",objOut:"69557558-8953-49f1-b1c3-13856ee5f752"}]},{name:"Floating Point",value:!0}],portsOut:[{name:"Next"},{name:"Texture"}]},{opId:"18a6d1f4-a7f8-4a3e-ab1d-0c2d2efe3861",objName:"Ops.Gl.Textures.CopyTexture",id:"e6c4e69c-a1f4-4a8f-a373-febc2611168a",uiAttribs:{translate:{x:372,y:-120},subPatch:0,notWorkingMsg:null,hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"e6c4e69c-a1f4-4a8f-a373-febc2611168a",objOut:"bd889c8e-b70b-484a-aef3-22cdea1f3a91"}]},{name:"Texture",links:[{portIn:"Texture",portOut:"Texture",objIn:"e6c4e69c-a1f4-4a8f-a373-febc2611168a",objOut:"d638c0a1-6c53-4c3f-a119-3853b4e66684"}]},{name:"use original size",value:!0},{name:"width",value:50},{name:"height",value:50},{name:"filter index",value:0},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"HDR",value:!0}],portsOut:[{name:"trigger",value:0},{name:"texture_out"},{name:"Aspect Ratio",value:1}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"8dd3deeb-b71e-4270-8b91-785f340488a4",uiAttribs:{translate:{x:240,y:80},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"8dd3deeb-b71e-4270-8b91-785f340488a4",objOut:"0e44272c-ff4a-4fb4-942f-3a114d301dfe"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"8dd3deeb-b71e-4270-8b91-785f340488a4",objOut:"0e44272c-ff4a-4fb4-942f-3a114d301dfe"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!1},{name:"Width",links:[{portIn:"Width",portOut:"Result",objIn:"8dd3deeb-b71e-4270-8b91-785f340488a4",objOut:"6d9867bf-e7c2-4bac-98e0-19c44b5cac80"}]},{name:"Height",links:[{portIn:"Height",portOut:"Result",objIn:"8dd3deeb-b71e-4270-8b91-785f340488a4",objOut:"69557558-8953-49f1-b1c3-13856ee5f752"}]},{name:"Floating Point",value:!0}],portsOut:[{name:"Next"},{name:"Texture"}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"0e44272c-ff4a-4fb4-942f-3a114d301dfe",uiAttribs:{title:"Scale",translate:{x:240,y:20},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Next",objIn:"0e44272c-ff4a-4fb4-942f-3a114d301dfe",objOut:"d638c0a1-6c53-4c3f-a119-3853b4e66684"}]},{name:"fragment",value:"\n\nUNI sampler2D tex;\nIN vec2 texCoord;\n\n\n{{MODULES_HEAD}}\nvoid main()\n{\n \n float scale = texture2D(tex,texCoord).r;\n\n if (scale < 0.5){\n scale = scale*2.0;\n }
72else{\n scale = 1.0-((scale-0.5)*2.0);\n }\n\n scale = clamp(scale,0.0,1.0);\n \n {{MODULE_COLOR}}\n outColor = vec4(vec3(scale),1.0);\n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"tex",links:[{portIn:"tex",portOut:"Texture",objIn:"0e44272c-ff4a-4fb4-942f-3a114d301dfe",objOut:"d638c0a1-6c53-4c3f-a119-3853b4e66684"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"c7617717-3114-452f-9625-e4fefd841e88",objName:"Ops.Array.ArrayMath",id:"36186400-755a-4c68-b623-b7a5e59c80a9",uiAttribs:{extendTitle:"*",translate:{x:252,y:300},subPatch:0,notWorkingMsg:null},portsIn:[{name:"array 0",links:[{portIn:"array 0",portOut:"Points",objIn:"36186400-755a-4c68-b623-b7a5e59c80a9",objOut:"e5b55982-0937-474b-9984-4019e42e0b0d"}]},{name:"Number for math",value:1},{name:"Math function index",value:0},{name:"Math function",value:"*"}],portsOut:[{name:"Array result"},{name:"Array length",value:7500}]},{opId:"85b0d8e5-f417-4349-aa35-fe45a6698183",objName:"Ops.Gl.TextureEffects.Noise.SimplexNoise",id:"d19c9feb-4b1a-41df-8d3f-aa2b0fffd724",uiAttribs:{translate:{x:1284,y:-100},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"d19c9feb-4b1a-41df-8d3f-aa2b0fffd724",objOut:"a9289b5f-f0d2-4017-b6ea-c1a156358a4a"}]},{name:"Blend Mode index",value:0},{name:"Blend Mode",value:"normal"},{name:"Amount",value:1},{name:"smoothness",value:1},{name:"scale",value:5},{name:"x",value:10},{name:"y",value:12.96},{name:"time",links:[{portIn:"time",portOut:"Time",objIn:"d19c9feb-4b1a-41df-8d3f-aa2b0fffd724",objOut:"f214ef72-eef8-4f4c-9c43-02dc7bdf3c91"}]}],portsOut:[{name:"trigger",value:0}]},{opId:"5c04608d-1e42-4e36-be00-1be4a81fc309",objName:"Ops.Gl.TextureEffects.ImageCompose",id:"a9289b5f-f0d2-4017-b6ea-c1a156358a4a",uiAttribs:{hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null,translate:{x:1284,y:-260},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"a9289b5f-f0d2-4017-b6ea-c1a156358a4a",objOut:"d5726eeb-5949-4109-842a-67e052d2db5f"}]},{name:"use viewport size",value:!1},{name:"width",links:[{portIn:"width",portOut:"Result",objIn:"a9289b5f-f0d2-4017-b6ea-c1a156358a4a",objOut:"6d9867bf-e7c2-4bac-98e0-19c44b5cac80"}]},{name:"height",links:[{portIn:"height",portOut:"Result",objIn:"a9289b5f-f0d2-4017-b6ea-c1a156358a4a",objOut:"69557558-8953-49f1-b1c3-13856ee5f752"}]},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"repeat"},{name:"HDR",value:!0},{name:"Background Alpha",value:1}],portsOut:[{name:"trigger"},{name:"texture_out"},{name:"Aspect Ratio",value:1}]},{opId:"322d8c8d-851b-481d-9bee-ec1cf7d57a35",objName:"Ops.Gl.MeshInstancer_v3",id:"e4cbabb4-dfc1-4d70-ba5e-77c592e1b2ff",uiAttribs:{translate:{x:-384,y:680},subPatch:0,notWorkingMsg:null},portsIn:[{name:"exe",links:[{portIn:"exe",portOut:"Trigger Out",objIn:"e4cbabb4-dfc1-4d70-ba5e-77c592e1b2ff",objOut:"8fc3cece-aa47-4351-8021-500db995e0e1"}]},{name:"geom",links:[{portIn:"geom",portOut:"geometry",objIn:"e4cbabb4-dfc1-4d70-ba5e-77c592e1b2ff",objOut:"78bb1bdf-4596-4392-a58c-7fbc529722ce"}]},{name:"Scale",value:1},{name:"Limit Instances",value:!1},{name:"Limit",value:100},{name:"positions",links:[{portIn:"positions",portOut:"Array result",objIn:"e4cbabb4-dfc1-4d70-ba5e-77c592e1b2ff",objOut:"85291a06-d0c9-4537-a71a-36534a644d66"}]},{name:"Scale Array",links:[{portIn:"Scale Array",portOut:"Array result",objIn:"e4cbabb4-dfc1-4d70-ba5e-77c592e1b2ff",objOut:"36186400-755a-4c68-b623-b7a5e59c80a9"}]},{name:"Rotations",value:0},{name:"Colors",links:[{portIn:"Colors",portOut:"Points",objIn:"e4cbabb4-dfc1-4d70-ba5e-77c592e1b2ff",objOut:"8eb4adbc-a29b-4225-8d83-40bdd94fc09f"}]}],portsOut:[{name:"Trigger Out",value:0},{name:"Num",value:2500}
72]},{objName:"Ops.User.sealex.TextureToPointsRGBv2",id:"e5b55982-0937-474b-9984-4019e42e0b0d",uiAttribs:{title:"scaleArray",translate:{x:240,y:200},subPatch:0,notWorkingMsg:null},portsIn:[{name:"update",links:[{portIn:"update",portOut:"Next",objIn:"e5b55982-0937-474b-9984-4019e42e0b0d",objOut:"8dd3deeb-b71e-4270-8b91-785f340488a4"}]},{name:"Num Points",links:[{portIn:"Num Points",portOut:"result",objIn:"e5b55982-0937-474b-9984-4019e42e0b0d",objOut:"69ae2b45-a2d7-400f-94c3-66eb0e06870c"}]},{name:"Seed",value:1},{name:"Z Position index",value:1},{name:"Z Position",value:"None"},{name:"Z Multiply",value:1},{name:"texture",links:[{portIn:"texture",portOut:"Texture",objIn:"e5b55982-0937-474b-9984-4019e42e0b0d",objOut:"8dd3deeb-b71e-4270-8b91-785f340488a4"}]}],portsOut:[{name:"trigger",value:0},{name:"Points"},{name:"NumPoints",value:2500}]},{objName:"Ops.User.sealex.TextureToPointsRGBv2",id:"ec6aa55e-96b0-44ae-9dc0-f5253ccca9d8",uiAttribs:{title:"posArray",translate:{x:492,y:200},subPatch:0,notWorkingMsg:null},portsIn:[{name:"update",links:[{portIn:"update",portOut:"Next",objIn:"ec6aa55e-96b0-44ae-9dc0-f5253ccca9d8",objOut:"f551b7ff-b5ad-4797-8f23-9f77b7b101da"}]},{name:"Num Points",links:[{portIn:"Num Points",portOut:"result",objIn:"ec6aa55e-96b0-44ae-9dc0-f5253ccca9d8",objOut:"69ae2b45-a2d7-400f-94c3-66eb0e06870c"}]},{name:"Seed",value:1},{name:"Z Position index",value:1},{name:"Z Position",value:"Red"},{name:"Z Multiply",value:1},{name:"texture",links:[{portIn:"texture",portOut:"Texture",objIn:"ec6aa55e-96b0-44ae-9dc0-f5253ccca9d8",objOut:"f551b7ff-b5ad-4797-8f23-9f77b7b101da"}]}],portsOut:[{name:"trigger",value:0},{name:"Points"},{name:"NumPoints",value:2500}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"a40df2fe-e3e4-42cf-9b09-fb2ec33ed91e",uiAttribs:{translate:{x:96,y:200},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"a40df2fe-e3e4-42cf-9b09-fb2ec33ed91e",objOut:"f896d04d-37c0-49d3-9959-3ff4dc6d7c82"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"a40df2fe-e3e4-42cf-9b09-fb2ec33ed91e",objOut:"f896d04d-37c0-49d3-9959-3ff4dc6d7c82"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!1},{name:"Width",links:[{portIn:"Width",portOut:"Result",objIn:"a40df2fe-e3e4-42cf-9b09-fb2ec33ed91e",objOut:"6d9867bf-e7c2-4bac-98e0-19c44b5cac80"}]},{name:"Height",links:[{portIn:"Height",portOut:"Result",objIn:"a40df2fe-e3e4-42cf-9b09-fb2ec33ed91e",objOut:"69557558-8953-49f1-b1c3-13856ee5f752"}]},{name:"Floating Point",value:!0}],portsOut:[{name:"Next"},{name:"Texture"}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"f896d04d-37c0-49d3-9959-3ff4dc6d7c82",uiAttribs:{title:"Lookup",translate:{x:96,y:140},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Next",objIn:"f896d04d-37c0-49d3-9959-3ff4dc6d7c82",objOut:"8dd3deeb-b71e-4270-8b91-785f340488a4"}]},{name:"fragment",value:"\n\nUNI sampler2D uIndex;\nUNI sampler2D uTable;\nIN vec2 texCoord;\n\n\n{{MODULES_HEAD}}\nvoid main()\n{\n \n float index = texture2D(uIndex,texCoord).r;\n vec4 col = texture2D(uTable,vec2(index,0.5));\n\n\n {{MODULE_COLOR}}\n outColor = col;\n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"uIndex",links:[{portIn:"uIndex",portOut:"Texture",objIn:"f896d04d-37c0-49d3-9959-3ff4dc6d7c82",objOut:"d638c0a1-6c53-4c3f-a119-3853b4e66684"}]},{name:"uTable",links:[{portIn:"uTable",portOut:"Texture",objIn:"f896d04d-37c0-49d3-9959-3ff4dc6d7c82",objOut:"6eb8a939-3aff-48c8-bfe4-70e42bded4f2"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"01380a50-2dbb-4465-ae80-86349b0b717a",objName:"Ops.Gl.GradientTexture",id:"6eb8a939-3aff-48c8-bfe4-70e42bded4f2",uiAttribs:{translate:{x:48,y:40},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Gradient",value:'{"keys":[{"pos":0,"r":0.011880874633789062,"g":0.41922514779227094,"b":0.7603759765625},{"pos":0.018,"r":0.011880874633789062,"g":0.41922514779227094,"b":0.7603759765625},{"pos":0.526,"r":0.34375,"g":0.65162037037037,"b":1},{"pos":0.976,"r":0.05269145965576172,"g":0.37557102385021385,"b":0.9635009765625},{"pos":1,"r":0.05269145965576172,"g":0.37557102385021385,"b":0.9635009765625}]}'},{name:"Smoothstep",value:!0},{name:"Size",value:256},{name:"Gradient Array",value:0},{name:"Direction index",value:0},{name:"Direction",value:"X"}],portsOut:[{name:"Texture"}]},{objName:"Ops.User.sealex.TextureToPointsRGBA",id:"8eb4adbc-a29b-4225-8d83-40bdd94fc09f",uiAttribs:{translate:{x:96,y:260},subPatch:0,notWorkingMsg:null},portsIn:[{name:"update",links:[{portIn:"update",portOut:"Next",objIn:"8eb4adbc-a29b-4225-8d83-40bdd94fc09f",objOut:"a40df2fe-e3e4-42cf-9b09-fb2ec33ed91e"}]},{name:"Num Points",links:[{portIn:"Num Points",portOut:"result",objIn:"8eb4adbc-a29b-4225-8d83-40bdd94fc09f",objOut:"69ae2b45-a2d7-400f-94c3-66eb0e06870c"}]},{name:"Seed",value:1},{name:"Z Position index",value:1},{name:"Z Position",value:"Red"},{name:"Z Multiply",value:1},{name:"texture",links:[{portIn:"texture",portOut:"Texture",objIn:"8eb4adbc-a29b-4225-8d83-40bdd94fc09f",objOut:"a40df2fe-e3e4-42cf-9b09-fb2ec33ed91e"}]}],portsOut:[{name:"trigger",value:0},{name:"Points"},{name:"NumPoints",value:2500}
72]},{opId:"0bf51f3e-3161-4cc5-aecf-6e9160089fd2",objName:"Ops.Devices.Mouse.Mouse",id:"9f7f74b8-2693-4349-b55d-395aee2e04ed",uiAttribs:{title:"mouse",translate:{x:1764,y:-840},subPatch:0,notWorkingMsg:null},portsIn:[{name:"relative",value:!1},{name:"normalize",value:!0},{name:"Active",value:!0},{name:"smooth",value:!1},{name:"smoothSpeed",value:20},{name:"Area index",value:0},{name:"Area",value:"Canvas"},{name:"multiply",value:1},{name:"flip y",value:!1},{name:"right click prevent default",value:!0}],portsOut:[{name:"x"},{name:"y"},{name:"button down"},{name:"click",value:0},{name:"Button Up",value:0},{name:"click right",value:0},{name:"mouseOver",value:!1},{name:"button",value:0}]},{opId:"2591c495-fceb-4f6e-937f-11b190c72ee5",objName:"Ops.Boolean.BoolToNumber",id:"48c03ae5-2b48-4251-b837-359a26783fb0",uiAttribs:{translate:{x:1716,y:-460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"bool",links:[{portIn:"bool",portOut:"button down",objIn:"48c03ae5-2b48-4251-b837-359a26783fb0",objOut:"9f7f74b8-2693-4349-b55d-395aee2e04ed"}]}],portsOut:[{name:"number"}]},{opId:"b9235490-eaf2-4960-b1be-4279a4051ec6",objName:"Ops.Gl.Orthogonal_v2",id:"723c29c8-dc24-4d2d-8474-93df4d58fc26",uiAttribs:{translate:{x:-432,y:-180},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger 0",objIn:"723c29c8-dc24-4d2d-8474-93df4d58fc26",objOut:"e962b868-4c07-43f4-879c-405ff720ecbc"}]},{name:"bounds",value:8},{name:"Axis index",links:[{portIn:"Axis index",portOut:"number",objIn:"723c29c8-dc24-4d2d-8474-93df4d58fc26",objOut:"ff11bcba-9db4-40cf-ae4c-be724469ded7"}]},{name:"Axis",value:"Y"},{name:"frustum near",value:.01},{name:"frustum far",value:100}],portsOut:[{name:"trigger"},{name:"Ratio",value:1.0506666666666666},{name:"Width",value:16.810666666666666},{name:"Height",value:16}]},{opId:"1bbdae06-fbb2-489b-9bcc-36c9d65bd441",objName:"Ops.Math.Multiply",id:"204810aa-f160-4109-9f6a-5c4a1fd867ca",uiAttribs:{title:"MultiplyY",translate:{x:1632,y:-460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"y",objIn:"204810aa-f160-4109-9f6a-5c4a1fd867ca",objOut:"9f7f74b8-2693-4349-b55d-395aee2e04ed"}]},{name:"number2",value:-.55}],portsOut:[{name:"result"}]},{opId:"1bbdae06-fbb2-489b-9bcc-36c9d65bd441",objName:"Ops.Math.Multiply",id:"8e27e840-ffa4-43e3-8b37-2482e54a436b",uiAttribs:{title:"MultiplyX",translate:{x:1452,y:-460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"x",objIn:"8e27e840-ffa4-43e3-8b37-2482e54a436b",objOut:"9f7f74b8-2693-4349-b55d-395aee2e04ed"}]},{name:"number2",value:.55}],portsOut:[{name:"result"}]},{opId:"0b3e04f7-323e-4ac8-8a22-a21e2f36e0e9",objName:"Ops.Gl.Matrix.TransformView",id:"331d60bc-8040-42a8-8a4d-1ea2465a3268",uiAttribs:{translate:{x:-432,y:-100},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"331d60bc-8040-42a8-8a4d-1ea2465a3268",objOut:"723c29c8-dc24-4d2d-8474-93df4d58fc26"}]},{name:"posX",value:0},{name:"posY",value:0},{name:"posZ",value:-30},{name:"scale",value:1},{name:"rotX",value:0},{name:"rotY",value:0},{name:"rotZ",value:0}],portsOut:[{name:"trigger"}]},{opId:"18a6d1f4-a7f8-4a3e-ab1d-0c2d2efe3861",objName:"Ops.Gl.Textures.CopyTexture",id:"bca6ac11-3e5e-4a8f-b3bf-2455ecbc630c",uiAttribs:{translate:{x:1584,y:-100},subPatch:0,notWorkingMsg:null,hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"bca6ac11-3e5e-4a8f-b3bf-2455ecbc630c",objOut:"8529265d-daec-4699-ae7e-81573ef45a04"}]},{name:"Texture",links:[{portIn:"Texture",portOut:"Texture",objIn:"bca6ac11-3e5e-4a8f-b3bf-2455ecbc630c",objOut:"66384a25-f03f-4bbb-a12b-7635c3a4d42e"}]},{name:"use original size",value:!0},{name:"width",value:50},{name:"height",value:50},{name:"filter index",value:0},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"HDR",value:!0}],portsOut:[{name:"trigger",value:0},{name:"texture_out"},{name:"Aspect Ratio",value:1}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"66384a25-f03f-4bbb-a12b-7635c3a4d42e",uiAttribs:{translate:{x:1428,y:0},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"66384a25-f03f-4bbb-a12b-7635c3a4d42e",objOut:"e6a8a99a-b315-4fec-8598-f9cc9e565c7a"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"66384a25-f03f-4bbb-a12b-7635c3a4d42e",objOut:"e6a8a99a-b315-4fec-8598-f9cc9e565c7a"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!1},{name:"Width",links:[{portIn:"Width",portOut:"Result",objIn:"66384a25-f03f-4bbb-a12b-7635c3a4d42e",objOut:"6d9867bf-e7c2-4bac-98e0-19c44b5cac80"}]},{name:"Height",links:[{portIn:"Height",portOut:"Result",objIn:"66384a25-f03f-4bbb-a12b-7635c3a4d42e",objOut:"69557558-8953-49f1-b1c3-13856ee5f752"}]},{name:"Floating Point",value:!0}],portsOut:[{name:"Next",value:0},{name:"Texture"}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"e6a8a99a-b315-4fec-8598-f9cc9e565c7a",uiAttribs:{title:"Mouse",translate:{x:1428,y:-100},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"e6a8a99a-b315-4fec-8598-f9cc9e565c7a",objOut:"b82620a1-23f8-49b9-ad85-d2689fc67a5f"}]},{name:"fragment",value:"\nUNI sampler2D uVel;\nUNI sampler2D uPos;\n\nUNI float mouseX;\nUNI float mouseY;\nUNI float mouseDown;\nUNI float thresh;\n\nUNI float reset;
72\n\nIN vec2 texCoord;\n{{MODULES_HEAD}}\nvoid main()\n{\n \n \n vec4 velocity = texture2D(uVel,texCoord);\n vec4 pos = texture2D(uPos,texCoord);\n \n vec2 mouse = vec2(mouseX,mouseY);\n // float dist = distance(mouse,pos.xy);\n \n // if (dist < thresh && mouseDown == 1.0){\n \n // velocity.xy += (mouse - pos.xy) * 0.001; \n \n // }\n\n //decay model\n \n \n if (reset == 1.){\n \n velocity = vec4(vec3(0.0),1.0);\n \n }else{\n \n float dist = distance(mouse,pos.xy);\n \n if (dist < thresh && mouseDown == 1.0){\n \n velocity.xy += (mouse - pos.xy) * 0.001; \n \n }\n \n velocity.xyz *= 0.99; //drag\n \n }\n \n {{MODULE_COLOR}}\n outColor = vec4(velocity);\n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"mouseX",links:[{portIn:"mouseX",portOut:"result",objIn:"e6a8a99a-b315-4fec-8598-f9cc9e565c7a",objOut:"8e613288-3640-4862-a608-4a1c29f3d853"}]},{name:"mouseY",links:[{portIn:"mouseY",portOut:"result",objIn:"e6a8a99a-b315-4fec-8598-f9cc9e565c7a",objOut:"ff763948-865d-4037-933a-92d343072e8a"}]},{name:"mouseDown",links:[{portIn:"mouseDown",portOut:"number",objIn:"e6a8a99a-b315-4fec-8598-f9cc9e565c7a",objOut:"48c03ae5-2b48-4251-b837-359a26783fb0"}]},{name:"thresh",links:[{portIn:"thresh",portOut:"Result",objIn:"e6a8a99a-b315-4fec-8598-f9cc9e565c7a",objOut:"e7d3d3d6-cf09-4493-bd6c-bd72d43fdfba"}]},{name:"reset",links:[{portIn:"reset",portOut:"number",objIn:"e6a8a99a-b315-4fec-8598-f9cc9e565c7a",objOut:"856563b1-dc6d-4053-b61a-f44010d719aa"}]},{name:"uVel",links:[{portIn:"uVel",portOut:"texture_out",objIn:"e6a8a99a-b315-4fec-8598-f9cc9e565c7a",objOut:"bca6ac11-3e5e-4a8f-b3bf-2455ecbc630c"}]},{name:"uPos",links:[{portIn:"uPos",portOut:"Texture",objIn:"e6a8a99a-b315-4fec-8598-f9cc9e565c7a",objOut:"f551b7ff-b5ad-4797-8f23-9f77b7b101da"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"b250d606-f7f8-44d3-b099-c29efff2608a",objName:"Ops.Math.Compare.GreaterThan",id:"9a76f87a-25d8-429d-aeab-2143aa222a55",uiAttribs:{translate:{x:-180,y:-560},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"width",objIn:"9a76f87a-25d8-429d-aeab-2143aa222a55",objOut:"4aceec49-3577-4bef-a66b-ac7bf6bacf8e"}]},{name:"number2",links:[{portIn:"number2",portOut:"height",objIn:"9a76f87a-25d8-429d-aeab-2143aa222a55",objOut:"4aceec49-3577-4bef-a66b-ac7bf6bacf8e"}]}],portsOut:[{name:"result"}]},{opId:"2591c495-fceb-4f6e-937f-11b190c72ee5",objName:"Ops.Boolean.BoolToNumber",id:"ff11bcba-9db4-40cf-ae4c-be724469ded7",uiAttribs:{translate:{x:-180,y:-520},subPatch:0,notWorkingMsg:null},portsIn:[{name:"bool",links:[{portIn:"bool",portOut:"result",objIn:"ff11bcba-9db4-40cf-ae4c-be724469ded7",objOut:"9a76f87a-25d8-429d-aeab-2143aa222a55"}]}],portsOut:[{name:"number"}]},{opId:"b250d606-f7f8-44d3-b099-c29efff2608a",objName:"Ops.Math.Compare.GreaterThan",id:"ec7692c1-0353-4481-84a7-75338a820a0d",uiAttribs:{translate:{x:1308,y:-620},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"width",objIn:"ec7692c1-0353-4481-84a7-75338a820a0d",objOut:"1d5f86bc-fffe-44d3-ad56-6b0bc19549a1"}]},{name:"number2",links:[{portIn:"number2",portOut:"height",objIn:"ec7692c1-0353-4481-84a7-75338a820a0d",objOut:"1d5f86bc-fffe-44d3-ad56-6b0bc19549a1"}]}],portsOut:[{name:"result"}]},{opId:"2591c495-fceb-4f6e-937f-11b190c72ee5",objName:"Ops.Boolean.BoolToNumber",id:"be2645e8-9bb5-4c24-a355-cb258d222236",uiAttribs:{translate:{x:1308,y:-580},subPatch:0,notWorkingMsg:null},portsIn:[{name:"bool",links:[{portIn:"bool",portOut:"result",objIn:"be2645e8-9bb5-4c24-a355-cb258d222236",objOut:"ec7692c1-0353-4481-84a7-75338a820a0d"}]}],portsOut:[{name:"number"}]},{opId:"2617b407-60a0-4ff6-b4a7-18136cfa7817",objName:"Ops.Math.MapRange",id:"5270d490-62b0-4e8f-babb-e0c6f87e7c40",uiAttribs:{translate:{x:1464,y:-580},subPatch:0,notWorkingMsg:null},portsIn:[{name:"value",links:[{portIn:"value",portOut:"number",objIn:"5270d490-62b0-4e8f-babb-e0c6f87e7c40",objOut:"be2645e8-9bb5-4c24-a355-cb258d222236"}]},{name:"old min",value:0},{name:"old max",value:1},{name:"new min",value:1},{name:"new max",value:0},{name:"Easing index",value:0},{name:"Easing",value:"Linear"}],portsOut:[{name:"result"}]},{opId:"94e499e5-b4ee-4861-ab48-6ab5098b2cc3",objName:"Ops.Gl.CanvasInfo",id:"1d5f86bc-fffe-44d3-ad56-6b0bc19549a1",uiAttribs:{translate:{x:1308,y:-680},subPatch:0,notWorkingMsg:null},portsIn:[],portsOut:[{name:"width"},{name:"height"},{name:"Pixel Ratio",value:1},{name:"Aspect Ratio"},{name:"Landscape",value:!0}]},{opId:"1bbdae06-fbb2-489b-9bcc-36c9d65bd441",objName:"Ops.Math.Multiply",id:"a66deb66-792f-4145-8a88-d64698ff44c5",uiAttribs:{translate:{x:1356,y:-460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"number",objIn:"a66deb66-792f-4145-8a88-d64698ff44c5",objOut:"be2645e8-9bb5-4c24-a355-cb258d222236"}]},{name:"number2",links:[{portIn:"number2",portOut:"Aspect Ratio",objIn:"a66deb66-792f-4145-8a88-d64698ff44c5",objOut:"1d5f86bc-fffe-44d3-ad56-6b0bc19549a1"}]}],portsOut:[{name:"result"}]},{opId:"1bbdae06-fbb2-489b-9bcc-36c9d65bd441",objName:"Ops.Math.Multiply",id:"8e613288-3640-4862-a608-4a1c29f3d853",uiAttribs:{translate:{x:1404,y:-360},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"result",objIn:"8e613288-3640-4862-a608-4a1c29f3d853",objOut:"d80f1579-9f4e-4b32-8ce6-da65508dd2f0"}]},{name:"number2",links:[{portIn:"number2",portOut:"result",objIn:"8e613288-3640-4862-a608-4a1c29f3d853",objOut:"8e27e840-ffa4-43e3-8b37-2482e54a436b"}]}],portsOut:[{name:"result"}]},{opId:"cda1a98e-5e16-40bd-9b18-a67e9eaad5a1",objName:"Ops.Math.Clamp",id:"d80f1579-9f4e-4b32-8ce6-da65508dd2f0",uiAttribs:{translate:{x:1356,y:-420},subPatch:0,notWorkingMsg:null},portsIn:[{name:"val",links:[{portIn:"val",portOut:"result",objIn:"d80f1579-9f4e-4b32-8ce6-da65508dd2f0",objOut:"a66deb66-792f-4145-8a88-d64698ff44c5"}]},{name:"min",value:1},{name:"max",value:1e3},{name:"ignore outside values",value:!1}],portsOut:[{name:"result"}]},{opId:"86fcfd8c-038d-4b91-9820-a08114f6b7eb",objName:"Ops.Math.Divide",id:"8c36092e-668b-46f2-948a-afa9e19ae714",uiAttribs:{translate:{x:1560,y:-580},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",value:1},{name:"number2",links:[{portIn:"number2",portOut:"Aspect Ratio",objIn:"8c36092e-668b-46f2-948a-afa9e19ae714",objOut:"1d5f86bc-fffe-44d3-ad56-6b0bc19549a1"}]}],portsOut:[{name:"result"}]},{opId:"1bbdae06-fbb2-489b-9bcc-36c9d65bd441",objName:"Ops.Math.Multiply",id:"ded30e42-e079-47e8-abdb-54bc0db55a85",uiAttribs:{translate:{x:1560,y:-520},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"result",objIn:"ded30e42-e079-47e8-abdb-54bc0db55a85",objOut:"5270d490-62b0-4e8f-babb-e0c6f87e7c40"}]},{name:"number2",links:[{portIn:"number2",portOut:"result",objIn:"ded30e42-e079-47e8-abdb-54bc0db55a85",objOut:"8c36092e-668b-46f2-948a-afa9e19ae714"}]}],portsOut:[{name:"result"}]},{opId:"cda1a98e-5e16-40bd-9b18-a67e9eaad5a1",objName:"Ops.Math.Clamp",id:"e2b07711-0aae-4025-aae4-c27cfd0d053e",uiAttribs:{translate:{x:1560,y:-480},subPatch:0,notWorkingMsg:null},portsIn:[{name:"val",links:[{portIn:"val",portOut:"result",objIn:"e2b07711-0aae-4025-aae4-c27cfd0d053e",objOut:"ded30e42-e079-47e8-abdb-54bc0db55a85"}]},{name:"min",value:1},{name:"max",value:1e3},{name:"ignore outside values",value:!1}],portsOut:[{name:"result"}]},{opId:"1bbdae06-fbb2-489b-9bcc-36c9d65bd441",objName:"Ops.Math.Multiply",id:"ff763948-865d-4037-933a-92d343072e8a",uiAttribs:{translate:{x:1572,y:-400},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"result",objIn:"ff763948-865d-4037-933a-92d343072e8a",objOut:"e2b07711-0aae-4025-aae4-c27cfd0d053e"}]},{name:"number2",links:[{portIn:"number2",portOut:"result",objIn:"ff763948-865d-4037-933a-92d343072e8a",objOut:"204810aa-f160-4109-9f6a-5c4a1fd867ca"}]}],portsOut:[{name:"result"}]},{opId:"eb3232e5-e947-4683-a17f-27a72d464b2c",objName:"Ops.Sidebar.Slider",id:"0d5b9a64-6587-432e-aefe-afafb2f18e43",uiAttribs:{title:"Slider: Turbulence",translate:{x:1224,y:-1460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"0d5b9a64-6587-432e-aefe-afafb2f18e43",objOut:"0360191f-2992-4f9c-a9bf-780a51f7481f"}]},{name:"Text",value:"Turbulence"},{name:"Min",value:0},{name:"Max",value:1},{name:"Step",value:1e-5},{name:"Grey Out",value:!1},{name:"Visible",value:!0},{name:"Input",value:.03},{name:"Set Default",value:0},{name:"Reset",value:0},{name:"Default",value:.03}],portsOut:[{name:"childs"},{name:"Result"}]},{opId:"5a681c35-78ce-4cb3-9858-bc79c34c6819",objName:"Ops.Sidebar.Sidebar",id:"09080f02-6893-4b40-a9a6-4a459bc511d4",uiAttribs:{translate:{x:348,y:-1760},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Visible",value:!0},{name:"Opacity",value:1},{name:"Default Minimized",value:!1},{name:"Minimized Opacity",value:.5},{name:"Title",value:"exploration of blue "},{name:"Side",value:!1}],portsOut:[{name:"childs"}]},{opId:"118df748-16d1-46f4-b8fc-38d7cc5a0aab",objName:"Ops.Sidebar.Button",id:"a560f219-d2d9-410a-a519-ce904fd572fb",uiAttribs:{title:"Button: Reset [ R ]",translate:{x:360,y:-1500},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"a560f219-d2d9-410a-a519-ce904fd572fb",objOut:"58f75a9f-26dc-4ac0-8bed-7986493e1b80"}]},{name:"Text",value:"Reset [ R ]"},{name:"Grey Out",value:!1},{name:"Visible",value:!0}],portsOut:[{name:"childs"},{name:"Pressed Trigger"}]},{opId:"7ef594f3-4907-47b0-a2d3-9854eda1679d",objName:"Ops.Trigger.TriggerExtender",id:"97ebf8cd-4f8a-4894-a432-3132fbb6916e",uiAttribs:{title:"reset",translate:{x:576,y:-680},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Execute",links:[{portIn:"Execute",portOut:"on press",objIn:"97ebf8cd-4f8a-4894-a432-3132fbb6916e",objOut:"5a1d0dc8-a4b4-43e3-8f1a-41b16445fe16"},{portIn:"Execute",portOut:"Next",objIn:"97ebf8cd-4f8a-4894-a432-3132fbb6916e",objOut:"7a656ecd-c83e-4659-83db-f6a9d7ac361a"}]}],portsOut:[{name:"Next",value:0}]},{opId:"b3b36238-4592-4e11-afe3-8361c4fd6be5",objName:"Ops.Boolean.Or",id:"dbb742da-5d46-4c65-a4f1-1ee0db35a693",uiAttribs:{translate:{x:636,y:-780},subPatch:0,notWorkingMsg:null},portsIn:[{name:"bool 1",links:[{portIn:"bool 1",portOut:"Pressed",objIn:"dbb742da-5d46-4c65-a4f1-1ee0db35a693",objOut:"5a1d0dc8-a4b4-43e3-8f1a-41b16445fe16"}]},{name:"bool 2",links:[{portIn:"bool 2",portOut:"result",objIn:"dbb742da-5d46-4c65-a4f1-1ee0db35a693",objOut:"f9b19786-3e15-4680-be0e-7249e55143d3"}]},{name:"bool 3",value:!1},{name:"bool 4",value:!1},{name:"bool 5",value:!1},{name:"bool 6",value:!1},{name:"bool 7",value:!1},{name:"bool 8",value:!1}],portsOut:[{name:"result"}]},{opId:"712a25f4-3a93-4042-b8c5-2f56169186cc",objName:"Ops.Boolean.ToggleBool",id:"f9b19786-3e15-4680-be0e-7249e55143d3",uiAttribs:{translate:{x:648,y:-860},subPatch:0,notWorkingMsg:null},portsIn:[{name:"trigger",links:[{portIn:"trigger",portOut:"Next",objIn:"f9b19786-3e15-4680-be0e-7249e55143d3",objOut:"7a656ecd-c83e-4659-83db-f6a9d7ac361a"}]},{name:"reset",links:[{portIn:"reset",portOut:"next",objIn:"f9b19786-3e15-4680-be0e-7249e55143d3",objOut:"4a3850cd-f62d-4f4b-9d92-0292e189e1da"}]}],portsOut:[{name:"result"}]},{opId:"f4ff66b0-8500-46f7-9117-832aea0c2750",objName:"Ops.Time.DelayedTrigger",id:"4a3850cd-f62d-4f4b-9d92-0292e189e1da",uiAttribs:{translate:{x:660,y:-920},subPatch:0,notWorkingMsg:null},portsIn:[{name:"exe",links:[{portIn:"exe",portOut:"Next",objIn:"4a3850cd-f62d-4f4b-9d92-0292e189e1da",objOut:"7a656ecd-c83e-4659-83db-f6a9d7ac361a"}]},{name:"delay",value:.01}],portsOut:[{name:"next"}]},{opId:"d01fa820-396c-4cb5-9d78-6b14762852af",objName:"Ops.Gl.Render2Texture",id:"407c726e-d5a0-4508-ad2d-ad99ec3a7bd6",uiAttribs:{title:"render to texture",subPatch:0,translate:{x:-384,y:100},notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"407c726e-d5a0-4508-ad2d-ad99ec3a7bd6",objOut:"331d60bc-8040-42a8-8a4d-1ea2465a3268"}]},{name:"use viewport size",value:!0},{name:"texture width",value:788},{name:"texture height",value:750},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"MSAA index",value:0},{name:"MSAA",value:"8x"},{name:"HDR",value:!0},{name:"Depth",value:!0},{name:"Clear",value:!0}],portsOut:[{name:"trigger"},{name:"texture"},{name:"textureDepth"}]},{opId:"255bd15b-cc91-4a12-9b4e-53c710cbb282",objName:"Ops.Gl.Meshes.FullscreenRectangle",id:"75d65f9b-0a85-4199-a17d-8f39a326643c",uiAttribs:{subPatch:0,translate:{x:1164,y:1100},notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Next",objIn:"75d65f9b-0a85-4199-a17d-8f39a326643c",objOut:"4d5de490-34bd-4f33-ac18-03bc5eca66
725f"}]},{name:"Center in Canvas",value:!1},{name:"Flip Y",value:!1},{name:"Flip X",value:!1},{name:"Texture",links:[{portIn:"Texture",portOut:"Texture",objIn:"75d65f9b-0a85-4199-a17d-8f39a326643c",objOut:"4d5de490-34bd-4f33-ac18-03bc5eca665f"}]}],portsOut:[{name:"trigger",value:0}]},{opId:"5c04608d-1e42-4e36-be00-1be4a81fc309",objName:"Ops.Gl.TextureEffects.ImageCompose",id:"15f3e937-d997-4e5d-8132-45ed3b4de575",uiAttribs:{hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null,subPatch:0,translate:{x:480,y:500},notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"15f3e937-d997-4e5d-8132-45ed3b4de575",objOut:"07931797-9a77-49bb-acb9-5d9525d4ed3d"}]},{name:"use viewport size",value:!0},{name:"width",value:788},{name:"height",value:750},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"HDR",value:!0},{name:"Background Alpha",value:1}],portsOut:[{name:"trigger"},{name:"texture_out"},{name:"Aspect Ratio",value:1.0506666666666666}]},{opId:"322d8c8d-851b-481d-9bee-ec1cf7d57a35",objName:"Ops.Gl.MeshInstancer_v3",id:"67aff8ae-eb70-4e9a-98a4-907e9b14c647",uiAttribs:{translate:{x:-84,y:680},subPatch:0,notWorkingMsg:null},portsIn:[{name:"exe",links:[{portIn:"exe",portOut:"trigger",objIn:"67aff8ae-eb70-4e9a-98a4-907e9b14c647",objOut:"a8b0a13c-fdc1-4514-8933-c6687d65fecb"}]},{name:"geom",links:[{portIn:"geom",portOut:"geometry",objIn:"67aff8ae-eb70-4e9a-98a4-907e9b14c647",objOut:"906a3f80-2978-4b63-9772-417459858ba5"}]},{name:"Scale",value:1},{name:"Limit Instances",value:!1},{name:"Limit",value:100},{name:"positions",links:[{portIn:"positions",portOut:"Array result",objIn:"67aff8ae-eb70-4e9a-98a4-907e9b14c647",objOut:"85291a06-d0c9-4537-a71a-36534a644d66"}]},{name:"Scale Array",links:[{portIn:"Scale Array",portOut:"Array result",objIn:"67aff8ae-eb70-4e9a-98a4-907e9b14c647",objOut:"36186400-755a-4c68-b623-b7a5e59c80a9"}]},{name:"Rotations",value:0},{name:"Colors",links:[{portIn:"Colors",portOut:"Points",objIn:"67aff8ae-eb70-4e9a-98a4-907e9b14c647",objOut:"8eb4adbc-a29b-4225-8d83-40bdd94fc09f"}]}],portsOut:[{name:"Trigger Out",value:0},{name:"Num",value:2500}]},{opId:"450b4d68-2278-4d9f-9849-0abdfa37ef69",objName:"Ops.Gl.Meshes.Sphere_v2",id:"906a3f80-2978-4b63-9772-417459858ba5",uiAttribs:{translate:{x:-48,y:460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Next",objIn:"906a3f80-2978-4b63-9772-417459858ba5",objOut:"690547ce-e991-4237-a233-27733feaba7e"}]},{name:"radius",value:.07},{name:"stacks",value:32},{name:"slices",value:32},{name:"Filloffset",value:1},{name:"Render",value:!0}],portsOut:[{name:"trigger",value:0},{name:"geometry"}]},{opId:"d01fa820-396c-4cb5-9d78-6b14762852af",objName:"Ops.Gl.Render2Texture",id:"a8b0a13c-fdc1-4514-8933-c6687d65fecb",uiAttribs:{title:"render to texture",subPatch:0,translate:{x:-84,y:100},notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"a8b0a13c-fdc1-4514-8933-c6687d65fecb",objOut:"331d60bc-8040-42a8-8a4d-1ea2465a3268"}]},{name:"use viewport size",value:!0},{name:"texture width",value:788},{name:"texture height",value:750},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"MSAA index",value:0},{name:"MSAA",value:"8x"},{name:"HDR",value:!1},{name:"Depth",value:!0},{name:"Clear",value:!0}],portsOut:[{name:"trigger"},{name:"texture"},{name:"textureDepth"}]},{opId:"5c04608d-1e42-4e36-be00-1be4a81fc309",objName:"Ops.Gl.TextureEffects.ImageCompose",id:"dbb10b06-c6d0-45d7-a4ef-88c296989d0a",uiAttribs:{hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null,subPatch:0,translate:{x:96,y:520},notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"dbb10b06-c6d0-45d7-a4ef-88c296989d0a",objOut:"bd783726-e642-416f-9beb-ee3db3cfea58"}]},{name:"use viewport size",value:!0},{name:"width",value:788},{name:"height",value:750},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"HDR",value:!0}
72,{name:"Background Alpha",value:1}],portsOut:[{name:"trigger"},{name:"texture_out"},{name:"Aspect Ratio",value:1.0506666666666666}]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"bd783726-e642-416f-9beb-ee3db3cfea58",uiAttribs:{title:">seq4",translate:{x:96,y:460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"seq4"}],portsOut:[{name:"Triggered"}]},{opId:"ce1eaf2b-943b-4dc0-ab5e-ee11b63c9ed0",objName:"Ops.Trigger.TriggerSend",id:"9ca5df31-67a5-4b30-b8f3-b076a2c5d805",uiAttribs:{title:">seq3",translate:{x:528,y:-540},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Trigger",links:[{portIn:"Trigger",portOut:"trigger 11",objIn:"9ca5df31-67a5-4b30-b8f3-b076a2c5d805",objOut:"e962b868-4c07-43f4-879c-405ff720ecbc"}]},{name:"Named Trigger",value:"seq3"}],portsOut:[]},{opId:"ce1eaf2b-943b-4dc0-ab5e-ee11b63c9ed0",objName:"Ops.Trigger.TriggerSend",id:"e4b730ca-9201-4f42-af2f-cfc42c0320d2",uiAttribs:{title:">seq2",translate:{x:588,y:-540},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Trigger",links:[{portIn:"Trigger",portOut:"trigger 12",objIn:"e4b730ca-9201-4f42-af2f-cfc42c0320d2",objOut:"e962b868-4c07-43f4-879c-405ff720ecbc"}]},{name:"Named Trigger",value:"seq2"}],portsOut:[]},{opId:"ce1eaf2b-943b-4dc0-ab5e-ee11b63c9ed0",objName:"Ops.Trigger.TriggerSend",id:"7c462171-0970-4f46-9777-c9982bc39f5e",uiAttribs:{title:">seq4",translate:{x:468,y:-540},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Trigger",links:[{portIn:"Trigger",portOut:"trigger 10",objIn:"7c462171-0970-4f46-9777-c9982bc39f5e",objOut:"e962b868-4c07-43f4-879c-405ff720ecbc"}]},{name:"Named Trigger",value:"seq4"}],portsOut:[]},{opId:"ce1eaf2b-943b-4dc0-ab5e-ee11b63c9ed0",objName:"Ops.Trigger.TriggerSend",id:"8e6d2996-976a-4d90-a259-ee2b21c56fba",uiAttribs:{title:">seq1",translate:{x:648,y:-540},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Trigger",links:[{portIn:"Trigger",portOut:"trigger 13",objIn:"8e6d2996-976a-4d90-a259-ee2b21c56fba",objOut:"e962b868-4c07-43f4-879c-405ff720ecbc"}]},{name:"Named Trigger",value:"seq1"}],portsOut:[]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"41943c09-1035-4660-a007-5497c18e6880",uiAttribs:{title:">seq3",translate:{x:264,y:460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"seq3"}],portsOut:[{name:"Triggered"}]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"07931797-9a77-49bb-acb9-5d9525d4ed3d",uiAttribs:{title:">seq2",translate:{x:480,y:440},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"seq2"}],portsOut:[{name:"Triggered"}]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"0042fa84-c754-418b-8831-a350a985931a",uiAttribs:{title:">seq1",translate:{x:756,y:500},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"seq1"}],portsOut:[{name:"Triggered"}]},{opId:"18a6d1f4-a7f8-4a3e-ab1d-0c2d2efe3861",objName:"Ops.Gl.Textures.CopyTexture",id:"0c5c81de-ee55-430e-b2ae-c2ef541388ab",uiAttribs:{translate:{x:144,y:620},subPatch:0,notWorkingMsg:null,hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"0c5c81de-ee55-430e-b2ae-c2ef541388ab",objOut:"41943c09-1035-4660-a007-5497c18e6880"}]},{name:"Texture",links:[{portIn:"Texture",portOut:"texture_out",objIn:"0c5c81de-ee55-430e-b2ae-c2ef541388ab",objOut:"dbb10b06-c6d0-45d7-a4ef-88c296989d0a"}]},{name:"use original size",value:!0},{name:"width",value:788},{name:"height",value:750},{name:"filter index",value:0},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"HDR",value:!1}],portsOut:[{name:"trigger",value:0},{name:"texture_out"},{name:"Aspect Ratio",value:1.0506666666666666}]},{opId:"f94b5136-61fd-4558-8348-e7c8db5a6348",objName:"Ops.Gl.TextureEffects.DrawImage_v2",id:"1d8b61bd-d8bc-46df-8cf8-a60c76b8129e",uiAttribs:{translate:{x:96,y:720},subPatch:0,notWorkingMsg:null,extendTitle:"add"},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"1d8b61bd-d8bc-46df-8cf8-a60c76b8129e",objOut:"dbb10b06-c6d0-45d7-a4ef-88c296989d0a"}]},{name:"blendMode index",value:0},{name:"blendMode",value:"add"},{name:"amount",value:.98},{name:"image",links:[{portIn:"image",portOut:"texture_out",objIn:"1d8b61bd-d8bc-46df-8cf8-a60c76b8129e",objOut:"0c5c81de-ee55-430e-b2ae-c2ef541388ab"}]},{name:"removeAlphaSrc",value:!1},{name:"imageAlpha",value:0},{name:"alphaSrc index",value:0},{name:"alphaSrc",value:"alpha channel"},{name:"invert alpha channel",value:!1},{name:"Aspect Ratio",value:!1},{name:"Stretch Axis index",value:0},{name:"Stretch Axis",value:"X"},{name:"Position",value:0},{name:"Crop",value:!1},{name:"flip x",value:!1},{name:"flip y",value:!1},{name:"Transform",value:!1},{name:"Scale X",value:1},{name:"Scale Y",value:1},{name:"Position X",value:0},{name:"Position Y",value:0},{name:"Rotation",value:0},{name:"Clip Repeat",value:!1}],portsOut:[{name:"trigger"}]},{opId:"f94b5136-61fd-4558-8348-e7c8db5a6348",objName:"Ops.Gl.TextureEffects.DrawImage_v2",id:"c4d6b6a0-6080-4730-826e-fceeb10c2088",uiAttribs:{translate:{x:96,y:900},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"c4d6b6a0-6080-4730-826e-fceeb10c2088",objOut:"84b0c5c0-10db-4bd4-b39a-42dcd61ea2d4"}]},{name:"blendMode index",value:0},{name:"blendMode",value:"normal"},{name:"amount",value:1},{name:"image",links:[{portIn:"image",portOut:"texture",objIn:"c4d6b6a0-6080-4730-826e-fceeb10c2088",objOut:"a8b0a13c-fdc1-4514-8933-c6687d65fecb"}]},{name:"removeAlphaSrc",value:!1},{name:"imageAlpha",value:0},{name:"alphaSrc index",value:0},{name:"alphaSrc",value:"alpha channel"},{name:"invert alpha channel",value:!1},{name:"Aspect Ratio",value:!1},{name:"Stretch Axis index",value:0},{name:"Stretch Axis",value:"X"},{name:"Position",value:0},{name:"Crop",value:!1},{name:"flip x",value:!1},{name:"flip y",value:!1},{name:"Transform",value:!1},{name:"Scale X",value:1},{name:"Scale Y",value:1},{name:"Position X",value:0},{name:"Position Y",value:0},{name:"Rotation",value:0},{name:"Clip Repeat",value:!1}],portsOut:[{name:"trigger",value:0}]},{opId:"42ad6bbe-df17-48c7-89dd-bd7022113897",objName:"Ops.Gl.TextureEffects.Levels",id:"7f94123e-7a86-4c5f-aa7d-b133f7b8a206",uiAttribs:{translate:{x:96,y:780},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"7f94123e-7a86-4c5f-aa7d-b133f7b8a206",objOut:"1d8b61bd-d8bc-46df-8cf8-a60c76b8129e"}]},{name:"In Min",value:.002},{name:"Midpoint",value:.5},{name:"In Max",value:1},{name:"Out Min",value:0},{name:"Out Max",value:1}],portsOut:[{name:"Next"}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"906a02ae-3994-44de-b10d-dac8a4055945",uiAttribs:{translate:{x:480,y:700},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"906a02ae-3994-44de-b10d-dac8a4055945",objOut:"e8d0dafb-9fa7-44ad-bd9f-b0ec9b3d31d9"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"906a02ae-3994-44de-b10d-dac8a4055945",objOut:"e8d0dafb-9fa7-44ad-bd9f-b0ec9b3d31d9"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!0},{name:"Width",value:788},{name:"Height",value:750},{name:"Floating Point",value:!0}],portsOut:[{name:"Next"},{name:"Texture"}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"e8d0dafb-9fa7-44ad-bd9f-b0ec9b3d31d9",uiAttribs:{title:"Over",translate:{x:480,y:620},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"e8d0dafb-9fa7-44ad-bd9f-b0ec9b3d31d9",objOut:"15f3e937-d997-4e5d-8132-45ed3b4de575"}]},{name:"fragment",value:"\n\nUNI sampler2D uTop;\nUNI sampler2D uBottom;\nIN vec2 texCoord;\n\n\n{{MODULES_HEAD}}\nvoid main()\n{\n \n vec4 top = texture2D(uTop,texCoord);\n vec4 bottom = texture2D(uBottom,texCoord);\n \n float avg = (top.r + top.g + top.b) / 3.0;\n\n top.rgb = (top.rgb * top.a) + (bottom.rgb * (1.0-top.a));\n\n top.a = clamp(top.a + bottom.a,0.1,1.0);\n \n \n // if (avg < 0.01){\n \n // top.rgb += bottom.rgb;\n \n // }\n\n // if (top.a == 0.0){\n // top = bottom;\n // }else{\n \n \n // }\n\n {{MODULE_COLOR}}\n outColor = top;\n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"uTop",links:[{portIn:"uTop",portOut:"texture",objIn:"e8d0dafb-9fa7-44ad-bd9f-b0ec9b3d31d9",objOut:"407c726e-d5a0-4508-ad2d-ad99ec3a7bd6"}]},{name:"uBottom",links:[{portIn:"uBottom",portOut:"texture_out",objIn:"e8d0dafb-9fa7-44ad-bd9f-b0ec9b3d31d9",objOut:"dbb10b06-c6d0-45d7-a4ef-88c296989d0a"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"f94b5136-61fd-4558-8348-e7c8db5a6348",objName:"Ops.Gl.TextureEffects.DrawImage_v2",id:"802
721066d-e6a8-4fc6-a613-955114e19339",uiAttribs:{translate:{x:468,y:920},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Next",objIn:"8021066d-e6a8-4fc6-a613-955114e19339",objOut:"906a02ae-3994-44de-b10d-dac8a4055945"}]},{name:"blendMode index",value:0},{name:"blendMode",value:"normal"},{name:"amount",value:1},{name:"image",links:[{portIn:"image",portOut:"Texture",objIn:"8021066d-e6a8-4fc6-a613-955114e19339",objOut:"906a02ae-3994-44de-b10d-dac8a4055945"}]},{name:"removeAlphaSrc",value:!1},{name:"imageAlpha",value:0},{name:"alphaSrc index",value:0},{name:"alphaSrc",value:"alpha channel"},{name:"invert alpha channel",value:!1},{name:"Aspect Ratio",value:!1},{name:"Stretch Axis index",value:0},{name:"Stretch Axis",value:"X"},{name:"Position",value:0},{name:"Crop",value:!1},{name:"flip x",value:!1},{name:"flip y",value:!1},{name:"Transform",value:!1},{name:"Scale X",value:1},{name:"Scale Y",value:1},{name:"Position X",value:0},{name:"Position Y",value:0},{name:"Rotation",value:0},{name:"Clip Repeat",value:!1}],portsOut:[{name:"trigger",value:0}]},{opId:"54f26f53-f637-44c1-9bfb-a2f2b722e998",objName:"Ops.Gl.TextureEffects.Blur",id:"84b0c5c0-10db-4bd4-b39a-42dcd61ea2d4",uiAttribs:{translate:{x:96,y:840},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Next",objIn:"84b0c5c0-10db-4bd4-b39a-42dcd61ea2d4",objOut:"7f94123e-7a86-4c5f-aa7d-b133f7b8a206"}]},{name:"amount",value:.02},{name:"direction index",value:0},{name:"direction",value:"both"},{name:"Fast",value:!0},{name:"mask",value:0}],portsOut:[{name:"trigger"}]},{opId:"eb3232e5-e947-4683-a17f-27a72d464b2c",objName:"Ops.Sidebar.Slider",id:"e1999d4f-062f-4c05-acaa-fed5233c4e74",uiAttribs:{title:"Slider: Spawn Rate",translate:{x:1224,y:-1380},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"e1999d4f-062f-4c05-acaa-fed5233c4e74",objOut:"0d5b9a64-6587-432e-aefe-afafb2f18e43"}]},{name:"Text",value:"Spawn Rate"},{name:"Min",value:0},{name:"Max",value:1},{name:"Step",value:1e-5},{name:"Grey Out",value:!1},{name:"Visible",value:!0},{name:"Input",value:.6},{name:"Set Default",value:0},{name:"Reset",value:0},{name:"Default",value:.6}],portsOut:[{name:"childs"},{name:"Result"}]},{opId:"2617b407-60a0-4ff6-b4a7-18136cfa7817",objName:"Ops.Math.MapRange",id:"0efa208a-5fe5-4982-b57c-df14d96f8eaf",uiAttribs:{translate:{x:1236,y:-1240},subPatch:0,notWorkingMsg:null},portsIn:[{name:"value",links:[{portIn:"value",portOut:"result",objIn:"0efa208a-5fe5-4982-b57c-df14d96f8eaf",objOut:"4a9370f7-22d4-41e6-9a39-93af1ad2a1d0"}]},{name:"old min",value:0},{name:"old max",value:1},{name:"new min",value:.001},{name:"new max",value:.01},{name:"Easing index",value:0},{name:"Easing",value:"Linear"}],portsOut:[{name:"result"}]},{opId:"f94b5136-61fd-4558-8348-e7c8db5a6348",objName:"Ops.Gl.TextureEffects.DrawImage_v2",id:"eb6412b7-e7ac-42f6-8608-5b7a98fa5c18",uiAttribs:{translate:{x:792,y:680},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"eb6412b7-e7ac-42f6-8608-5b7a98fa5c18",objOut:"660a1563-a9a3-4429-822a-f13a334e0f34"}]},{name:"blendMode index",value:0},{name:"blendMode",value:"normal"},{name:"amount",value:1},{name:"image",links:[{portIn:"image",portOut:"texture_out",objIn:"eb6412b7-e7ac-42f6-8608-5b7a98fa5c18",objOut:"15f3e937-d997-4e5d-8132-45ed3b4de575"}]},{name:"removeAlphaSrc",value:!1},{name:"imageAlpha",value:0},{name:"alphaSrc index",value:0},{name:"alphaSrc",value:"alpha channel"},{name:"invert alpha channel",value:!1},{name:"Aspect Ratio",value:!1},{name:"Stretch Axis index",value:0},{name:"Stretch Axis",value:"X"},{name:"Position",value:0},{name:"Crop",value:!1},{name:"flip x",value:!1},{name:"flip y",value:!1},{name:"Transform",value:!1},{name:"Scale X",value:1},{name:"Scale Y",value:1},{name:"Position X",value:0},{name:"Position Y",value:0},{name:"Rotation",value:0},{name:"Clip Repeat",value:!1}],portsOut:[{name:"trigger"}]},{opId:"5c04608d-1e42-4e36-be00-1be4a81fc309",objName:"Ops.Gl.TextureEffects.ImageCompose",id:"660a1563-a9a3-4429-822a-f13a334e0f34",uiAttribs:{hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null,translate:{x:792,y:560},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"660a1563-a9a3-4429-822a-f13a334e0f34",objOut:"0042fa84-c754-418b-8831-a350a985931a"}]},{name:"use viewport size",value:!1},{name:"width",links:[{portIn:"width",portOut:"result",objIn:"660a1563-a9a3-4429-822a-f13a334e0f34",objOut:"1f91767a-efcc-4758-a281-640fefb35c6b"}]},{name:"height",links:[{portIn:"height",portOut:"result",objIn:"660a1563-a9a3-4429-822a-f13a334e0f34",objOut:"f4bcc5e5-a917-4c62-aa37-41b224c2a20b"}]},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"repeat"},{name:"HDR",value:!1}
72,{name:"Background Alpha",value:1}],portsOut:[{name:"trigger"},{name:"texture_out"},{name:"Aspect Ratio",value:1.0506666666666666}]},{opId:"86fcfd8c-038d-4b91-9820-a08114f6b7eb",objName:"Ops.Math.Divide",id:"f4bcc5e5-a917-4c62-aa37-41b224c2a20b",uiAttribs:{title:"Divide height by 4",translate:{x:828,y:460},subPatch:0,notWorkingMsg:null,comment:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"height",objIn:"f4bcc5e5-a917-4c62-aa37-41b224c2a20b",objOut:"0418de19-cced-4e42-abe6-89f3c44e6222"}]},{name:"number2",value:2}],portsOut:[{name:"result"}]},{opId:"86fcfd8c-038d-4b91-9820-a08114f6b7eb",objName:"Ops.Math.Divide",id:"1f91767a-efcc-4758-a281-640fefb35c6b",uiAttribs:{title:"Divide width by 4",translate:{x:816,y:380},subPatch:0,notWorkingMsg:null,comment:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"width",objIn:"1f91767a-efcc-4758-a281-640fefb35c6b",objOut:"0418de19-cced-4e42-abe6-89f3c44e6222"}]},{name:"number2",value:2}],portsOut:[{name:"result"}]},{opId:"2175ae00-989c-4045-a52e-742d5c30bf4e",objName:"Ops.Gl.TextureEffects.LumaKey",id:"eeaf41e4-1a02-4285-89ec-e76a00016474",uiAttribs:{translate:{x:792,y:780},subPatch:0,notWorkingMsg:null,comment:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"eeaf41e4-1a02-4285-89ec-e76a00016474",objOut:"5709b664-43af-4691-b68e-0c43cd79439f"}]},{name:"Invert",value:!1},{name:"Black White",value:!1},{name:"Threshold",value:.05}],portsOut:[{name:"trigger"}]},{opId:"54f26f53-f637-44c1-9bfb-a2f2b722e998",objName:"Ops.Gl.TextureEffects.Blur",id:"3fca5c95-3775-48bb-aed0-dee1bd2aa87d",uiAttribs:{translate:{x:792,y:840},subPatch:0,notWorkingMsg:null,comment:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"3fca5c95-3775-48bb-aed0-dee1bd2aa87d",objOut:"eeaf41e4-1a02-4285-89ec-e76a00016474"}]},{name:"amount",value:8},{name:"direction index",value:0},{name:"direction",value:"both"},{name:"Fast",value:!1},{name:"mask",value:0}],portsOut:[{name:"trigger"}]},{opId:"f94b5136-61fd-4558-8348-e7c8db5a6348",objName:"Ops.Gl.TextureEffects.DrawImage_v2",id:"e66a7769-bbfc-4c70-867c-a5146cfa92aa",uiAttribs:{title:"DrawImage - add bloom",translate:{x:1164,y:740},subPatch:0,notWorkingMsg:null,extendTitle:"add",comment:"add bloom "},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"e66a7769-bbfc-4c70-867c-a5146cfa92aa",objOut:"5350aef8-0f10-45c6-9044-499914bd33d1"}]},{name:"blendMode index",value:0},{name:"blendMode",value:"add"},{name:"amount",value:1},{name:"image",links:[{portIn:"image",portOut:"texture_out",objIn:"e66a7769-bbfc-4c70-867c-a5146cfa92aa",objOut:"660a1563-a9a3-4429-822a-f13a334e0f34"}]},{name:"removeAlphaSrc",value:!1},{name:"imageAlpha",value:0},{name:"alphaSrc index",value:0},{name:"alphaSrc",value:"alpha channel"},{name:"invert alpha channel",value:!1},{name:"Aspect Ratio",value:!1},{name:"Stretch Axis index",value:0},{name:"Stretch Axis",value:"X"},{name:"Position",value:0},{name:"Crop",value:!1},{name:"flip x",value:!1},{name:"flip y",value:!1},{name:"Transform",value:!1},{name:"Scale X",value:1},{name:"Scale Y",value:1},{name:"Position X",value:0},{name:"Position Y",value:0},{name:"Rotation",value:0},{name:"Clip Repeat",value:!1}],portsOut:[{name:"trigger"}]},{opId:"5c04608d-1e42-4e36-be00-1be4a81fc309",objName:"Ops.Gl.TextureEffects.ImageCompose",id:"3ecb0ba2-2b70-4b79-9a11-4aecad67ebf1",uiAttribs:{hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null,translate:{x:1152,y:580},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"3ecb0ba2-2b70-4b79-9a11-4aecad67ebf1",objOut:"f3fb3242-b10e-44ee-9a28-8ac450a3beec"}]},{name:"use viewport size",value:!0},{name:"width",value:788},{name:"height",value:750},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"repeat"},{name:"HDR",value:!1},{name:"Background Alpha",value:1}],portsOut:[{name:"trigger"},{name:"texture_out"},{name:"Aspect Ratio",value:1.0506666666666666}]},{opId:"ce1eaf2b-943b-4dc0-ab5e-ee11b63c9ed0",objName:"Ops.Trigger.TriggerSend",id:"9c80919d-8d32-4e9d-abfa-62aa9877471b",uiAttribs:{title:">seq0",translate:{x:708,y:-540},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Trigger",links:[{portIn:"Trigger",portOut:"trigger 15",objIn:"9c80919d-8d32-4e9d-abfa-62aa9877471b",objOut:"e962b868-4c07-43f4-879c-405ff720ecbc"}]},{name:"Named Trigger",value:"seq0"}],portsOut:[]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"f3fb3242-b10e-44ee-9a28-8ac450a3beec",uiAttribs:{title:">seq0",translate:{x:1152,y:480},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"seq0"}],portsOut:[{name:"Triggered"}]},{opId:"94e499e5-b4ee-4861-ab48-6ab5098b2cc3",objName:"Ops.Gl.CanvasInfo",id:"0418de19-cced-4e42-abe6-89f3c44e6222",uiAttribs:{translate:{x:816,y:300},subPatch:0,notWorkingMsg:null},portsIn:[],portsOut:[{name:"width"},{name:"height"},{name:"Pixel Ratio",value:1},{name:"Aspect Ratio",value:1.0506666666666666},{name:"Landscape",value:!0}]},{opId:"f94b5136-61fd-4558-8348-e7c8db5a6348",objName:"Ops.Gl.TextureEffects.DrawImage_v2",id:"5350aef8-0f10-45c6-9044-499914bd33d1",uiAttribs:{title:"DrawImage original image",translate:{x:1164,y:660},subPatch:0,notWorkingMsg:null,comment:"draw original image"},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"5350aef8-0f10-45c6-9044-499914bd33d1",objOut:"3ecb0ba2-2b70-4b79-9a11-4aecad6
727ebf1"}]},{name:"blendMode index",value:0},{name:"blendMode",value:"normal"},{name:"amount",value:1},{name:"image",links:[{portIn:"image",portOut:"texture_out",objIn:"5350aef8-0f10-45c6-9044-499914bd33d1",objOut:"15f3e937-d997-4e5d-8132-45ed3b4de575"}]},{name:"removeAlphaSrc",value:!1},{name:"imageAlpha",value:0},{name:"alphaSrc index",value:0},{name:"alphaSrc",value:"alpha channel"},{name:"invert alpha channel",value:!1},{name:"Aspect Ratio",value:!1},{name:"Stretch Axis index",value:0},{name:"Stretch Axis",value:"X"},{name:"Position",value:0},{name:"Crop",value:!1},{name:"flip x",value:!1},{name:"flip y",value:!1},{name:"Transform",value:!1},{name:"Scale X",value:1},{name:"Scale Y",value:1},{name:"Position X",value:0},{name:"Position Y",value:0},{name:"Rotation",value:0},{name:"Clip Repeat",value:!1}],portsOut:[{name:"trigger"}]},{opId:"54b89199-c594-4dff-bc48-82d6c7a55e8a",objName:"Ops.Gl.TextureEffects.BrightnessContrast",id:"5709b664-43af-4691-b68e-0c43cd79439f",uiAttribs:{translate:{x:792,y:720},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"5709b664-43af-4691-b68e-0c43cd79439f",objOut:"eb6412b7-e7ac-42f6-8608-5b7a98fa5c18"}]},{name:"contrast",value:.552},{name:"brightness",value:.969}],portsOut:[{name:"trigger"}]},{opId:"c0acfc80-16f9-4f17-978d-bad650f3ed1c",objName:"Ops.Gl.TextureEffects.Color",id:"6c9736fe-3dd4-4e4d-874c-339cbed1d647",uiAttribs:{translate:{x:792,y:900},subPatch:0,notWorkingMsg:null,extendTitle:"mul",comment:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"6c9736fe-3dd4-4e4d-874c-339cbed1d647",objOut:"3fca5c95-3775-48bb-aed0-dee1bd2aa87d"}]},{name:"Blend Mode index",value:0},{name:"Blend Mode",value:"multiply"},{name:"Amount",value:1},{name:"Mask",value:0},{name:"Mask Invert",value:!1},{name:"r",value:.555},{name:"g",value:.815},{name:"b",value:.948}],portsOut:[{name:"trigger"}]},{opId:"54b89199-c594-4dff-bc48-82d6c7a55e8a",objName:"Ops.Gl.TextureEffects.BrightnessContrast",id:"0768b1b2-a541-4e4b-bcca-d5da53fa43bd",uiAttribs:{translate:{x:792,y:980},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"0768b1b2-a541-4e4b-bcca-d5da53fa43bd",objOut:"6c9736fe-3dd4-4e4d-874c-339cbed1d647"}]},{name:"contrast",value:.5},{name:"brightness",value:.804}],portsOut:[{name:"trigger",value:0}]},{opId:"7059501e-31a6-46cd-8939-4d4b82229086",objName:"Ops.Gl.Phong.PhongMaterial_v4",id:"8fc3cece-aa47-4351-8021-500db995e0e1",uiAttribs:{translate:{x:-384,y:240},subPatch:0,error:null,notWorkingMsg:null},portsIn:[{name:"Trigger In",links:[{portIn:"Trigger In",portOut:"Trigger Out",objIn:"8fc3cece-aa47-4351-8021-500db995e0e1",objOut:"4e3463ac-b244-4214-996f-3ab36556db3f"}]},{name:"R",value:1},{name:"G",value:1},{name:"B",value:1},{name:"A",value:1},{name:"Enable",value:!1},{name:"Albedo",value:.784},{name:"Roughness",value:.579},{name:"Active",value:!1},{name:"Fresnel Intensity",value:.7},{name:"Fresnel Width",value:1},{name:"Fresnel Exponent",value:6},{name:"Fresnel R",value:1},{name:"Fresnel G",value:1},{name:"Fresnel B",value:1},{name:"Shininess",value:28.78},{name:"Specular Amount",value:0},{name:"Specular Model index",value:0},{name:"Specular Model",value:"Blinn"},{name:"Energy Conservation",value:!0},{name:"Double Sided Material",value:!1},{name:"Diffuse Texture",value:0},{name:"Specular Texture",value:0},{name:"Normal Map",value:0},{name:"AO Texture",value:0},{name:"Emissive Texture",value:0},{name:"Opacity Texture",value:0},{name:"Colorize Texture",value:!1},{name:"Diffuse Repeat X",value:1},{name:"Diffuse Repeat Y",value:1},{name:"Texture Offset X",value:0},{name:"Texture Offset Y",value:0},{name:"Specular Intensity",value:1},{name:"Normal Map Intensity",value:.5},{name:"AO Intensity",value:0},{name:"Emissive Intensity",value:1},{name:"Alpha Mask Source index",value:0},{name:"Alpha Mask Source",value:"Luminance"},{name:"Opacity TexCoords Transform",value:!1},{name:"Discard Transparent Pixels",value:!1}],portsOut:[{name:"Trigger Out"},{name:"Shader"}]},{opId:"235a18d1-a8de-4034-962d-2848017e27cd",objName:"Ops.Gl.Phong.AmbientLight_v4",id:"88e6b932-6166-4c82-83b3-ba49c1fea600",uiAttribs:{translate:{x:-384,y:160},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Trigger In",links:[{portIn:"Trigger In",portOut:"trigger",objIn:"88e6b932-6166-4c82-83b3-ba49c1fea600",objOut:"407c726e-d5a0-4508-ad2d-ad99ec3a7bd6"}]},{name:"R",value:1},{name:"G",value:1},{name:"B",value:1},{name:"Intensity",value:.323}],portsOut:[{name:"Trigger Out"}]},{opId:"8d7dc3dc-b71d-4ba8-830f-83dca2638359",objName:"Ops.Gl.Phong.PointLight_v4",id:"4e3463ac-b244-4214-996f-3ab36556db3f",uiAttribs:{translate:{x:-384,y:200},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Trigger In",links:[{portIn:"Trigger In",portOut:"Trigger Out",objIn:"4e3463ac-b244-4214-996f-3ab36556db3f",objOut:"88e6b932-6166-4c82-83b3-ba49c1fea600"}]},{name:"Intensity",value:.51},{name:"Radius",value:34},{name:"X",value:0},{name:"Y",value:0},{name:"Z",value:5.64},{name:"R",value:.8},{name:"G",value:.8},{name:"B",value:.8},{name:"Specular R",value:1},{name:"Specular G",value:1},{name:"Specular B",value:1},{name:"Falloff",value:.078}],portsOut:[{name:"Trigger Out"}]},{opId:"7b3f93d6-4de1-41fd-aa26-e74c8285c662",objName:"Ops.Sidebar.DropDown_v2",id:"1875548f-e693-455a-90f1-acb54e8a7a45",uiAttribs:{title:"Dropdown: Amount",translate:{x:1224,y:-1120},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Link",links:[{portIn:"Link",portOut:"childs",objIn:"1875548f-e693-455a-90f1-acb54e8a7a45",objOut:"e1999d4f-062f-4c05-acaa-fed5233c4e74"}]},{name:"Text",value:"Amount"},{name:"Values",links:[{portIn:"Values",portOut:"Result",objIn:"1875548f-e693-455a-90f1-acb54e8a7a45",objOut:"e42f4ee7-8075-4579-bd31-cae4245ad0bb"}]},{name:"Default",value:"50"},{name:"Grey Out",value:!1},{name:"Visible",value:!0}],portsOut:[{name:"Children"},{name:"Result"},{name:"Index",value:-1}]},{opId:"ca9219d2-9f06-4516-9cf2-98e61f84d4bb",objName:"Ops.Array.Array_v2",id:"7a743c9b-fd36-41c6-96aa-b7032f305b12",uiAttribs:{extendTitle:"1,2,3,4",translate:{x:1368,y:-1300},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Mode select index",value:0},{name:"Mode select",value:"1,2,3,4"},{name:"Array length",value:4},{name:"Default Value",value:0}],portsOut:[{name:"Array"},{name:"Array length out",value:4}]},{opId:"a01c344b-4129-4b01-9c8f-36cefe86d7cc",objName:"Ops.Array.ArrayMultiply",id:"e42f4ee7-8075-4579-bd31-cae4245ad0bb",uiAttribs:{translate:{x:1368,y:-1200},subPatch:0,notWorkingMsg:null},portsIn:[{name:"In",links:[{portIn:"In",portOut:"Result",objIn:"e42f4ee7-8075-4579-bd31-cae4245ad0bb",objOut:"f94b18e7-61e7-4ac9-8a16-c3b0d2d1b5e5"}]},{name:"Value",value:25}],portsOut:[{name:"Result"}]},{opId:"c6b5bf63-0be8-4eea-acc0-9d32973e665a",objName:"Ops.Array.ArraySum",id:"f94b18e7-61e7-4ac9-8a16-c3b0d2d1b5e5",uiAttribs:{translate:{x:1368,y:-1260},subPatch:0,notWorkingMsg:null},portsIn:[{name:"In",links:[{portIn:"In",portOut:"Array",objIn:"f94b18e7-61e7-4ac9-8a16-c3b0d2d1b5e5",objOut:"7a743c9b-fd36-41c6-96aa-b7032f305b12"}]},{name:"Value",value:1}],portsOut:[{name:"Result"}]},{opId:"6d208424-daf2-4a2b-874f-daac406c1f66",objName:"Ops.String.ParseInt_v2",id:"a0861770-d2dd-404c-968c-241d500ebbd7",uiAttribs:{translate:{x:1344,y:-1040},subPatch:0,notWorkingMsg:null},portsIn:[{name:"String",links:[{portIn:"String",portOut:"Result",objIn:"a0861770-d2dd-404c-968c-241d500ebbd7",objOut:"1875548f-e693-455a-90f1-acb54e8a7a45"}]}],portsOut:[{name:"Number"}]},{opId:"cc591cc3-ff23-4817-907c-e5be7d5c059d",objName:"Ops.Sidebar.SidebarText_v2",id:"76e4739d-2ecd-43fe-abbc-7ab34351852d",uiAttribs:{title:"Text: Note: incr",translate:{x:1224,y:-1040},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"Children",objIn:"76e4739d-2ecd-43fe-abbc-7ab34351852d",objOut:"1875548f-e693-455a-90f1-acb54e8a7a45"}]},{name:"Text",value:"Note: increasing the amount may affect performance"},{name:"Id",value:""}],portsOut:[{name:"childs"}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"130b53c5-6024-4e5c-a609-8b1f0c7a59a4",uiAttribs:{translate:{x:2244,y:-100},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"130b53c5-6024-4e5c-a609-8b1f0c7a59a4",objOut:"114a4a87-206c-4b49-a5f0-b43ae393ba97"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"130b53c5-6024-4e5c-a609-8b1f0c7a59a4",objOut:"114a4a87-206c-4b49-a5f0-b43ae393ba97"}]},{name:"filter index",value:0},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!1},{name:"Width",links:[{portIn:"Width",portOut:"Result",objIn:"130b53c5-6024-4e5c-a609-8b1f0c7a59a4",objOut:"1b43d5a8-1dd1-47fd-a1dd-307202b740d9"}]},{name:"Height",links:[{portIn:"Height",portOut:"Result",objIn:"130b53c5-6024-4e5c-a609-8b1f0c7a59a4",objOut:"1b43d5a8-1dd1-47fd-a1dd-307202b740d9"}]},{name:"Floating Point",value:!0}],portsOut:[{name:"Next"},{name:"Texture"}]},{opId:"18a6d1f4-a7f8-4a3e-ab1d-0c2d2efe3861",objName:"Ops.Gl.Textures.CopyTexture",id:"46c5be21-fe3c-4fde-8cbe-df1ca809e533",uiAttribs:{translate:{x:2388,y:-260},subPatch:0,notWorkingMsg:null,hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"46c5be21-fe3c-4fde-8cbe-df1ca809e533",objOut:"69489a94-2712-48f9-83e7-db7051341b0e"}]},{name:"Texture",links:[{portIn:"Texture",portOut:"texture",objIn:"46c5be21-fe3c-4fde-8cbe-df1ca809e533",objOut:"e61c32fb-e112-4b4b-aff1-dce4c00
7251215"}]},{name:"use original size",value:!0},{name:"width",value:640},{name:"height",value:480},{name:"filter index",value:0},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"HDR",value:!0}],portsOut:[{name:"trigger",value:0},{name:"texture_out"},{name:"Aspect Ratio",value:1.3333333333333333}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"114a4a87-206c-4b49-a5f0-b43ae393ba97",uiAttribs:{title:"OpticalFlow",translate:{x:2244,y:-160},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"114a4a87-206c-4b49-a5f0-b43ae393ba97",objOut:"f7158fd8-888f-407a-b1d5-78cde2de8653"}]},{name:"fragment",value:"\nUNI sampler2D uTex;\nUNI sampler2D uLast;\n\nUNI float uForce;\nUNI float uOffset;\nUNI float uLambda;\nUNI float uThreshold;\nUNI float uInversex;\nUNI float uInversey;\n\nUNI float resX;\nUNI float resY;\n\nIN vec2 texCoord;\n{{MODULES_HEAD}}\nvoid main()\n{\n \n vec2 vUV = texCoord;\n \n texture2D(uTex,texCoord);\n texture2D(uLast,texCoord);\n \n vec2 pixelOffset = vec2((1.0/resX)*uOffset,(1.0/resY)*uOffset);\n\tvec2 offX = vec2(pixelOffset.x,0.0);\n\tvec2 offY = vec2(0.0,pixelOffset.y);\n\n\t// difference calculation\n\tfloat texDiff = texture2D(uLast,texCoord).r - texture2D(uTex, vUV.st).r;\n\n\t// gradient calculation\n\tfloat gradX = texture2D(uLast, vUV.st + offX).r - texture2D(uLast, vUV.st - offX).r;\n\t\t gradX += texture2D(uTex, vUV.st + offX).r - texture2D(uTex, vUV.st - offX).r;\n\n\tfloat gradY = texture2D(uLast, vUV.st + offY).r - texture2D(uLast, vUV.st - offY).r;\n\t\t gradY += texture2D(uTex, vUV.st + offY).r - texture2D(uTex, vUV.st - offY).r;\n\n\tfloat gradMag = sqrt((gradX*gradX)+(gradY*gradY)+uLambda);\n\n\tfloat vx = texDiff*(gradX/gradMag);\n\tfloat vy = texDiff*(gradY/gradMag);\n\n\tvec2 flow = vec2(0.0);\n\tflow.x = -vx * uInversex;\n\tflow.y = -vy * uInversey;\n\n\t// apply treshold\n\tfloat strength = length(flow);\n\tif (strength * uThreshold > 0.0) {\n\t\tif (strength < uThreshold) {\n\t\t\tflow = vec2(0.0);\n\t\t}\n\t\telse {\n\t\t\tstrength = (strength - uThreshold) / (1.0 - uThreshold);\n\t\t\tflow = normalize(flow) * vec2(strength);\n\t\t}\n\t}\n\n\t// apply force\n\tflow *= vec2(uForce);\n \n {{MODULE_COLOR}}\n outColor = vec4(flow, 0.0, 1.0);\n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"uForce",value:1},{name:"uOffset",value:3},{name:"uLambda",value:.1},{name:"uThreshold",value:0},{name:"uInversex",value:1},{name:"uInversey",value:-1.5},{name:"resX",links:[{portIn:"resX",portOut:"Result",objIn:"114a4a87-206c-4b49-a5f0-b43ae393ba97",objOut:"1b43d5a8-1dd1-47fd-a1dd-307202b740d9"}]},{name:"resY",links:[{portIn:"resY",portOut:"Result",objIn:"114a4a87-206c-4b49-a5f0-b43ae393ba97",objOut:"1b43d5a8-1dd1-47fd-a1dd-307202b740d9"}]},{name:"uTex",links:[{portIn:"uTex",portOut:"texture_out",objIn:"114a4a87-206c-4b49-a5f0-b43ae393ba97",objOut:"f7158fd8-888f-407a-b1d5-78cde2de8653"}]},{name:"uLast",links:[{portIn:"uLast",portOut:"texture_out",objIn:"114a4a87-206c-4b49-a5f0-b43ae393ba97",objOut:"46c5be21-fe3c-4fde-8cbe-df1ca809e533"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"ce1eaf2b-943b-4dc0-ab5e-ee11b63c9ed0",objName:"Ops.Trigger.TriggerSend",id:"7b9b7c0f-946d-4233-ad5f-f9da45dee595",uiAttribs:{title:">post",translate:{x:372,y:-460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Trigger",links:[{portIn:"Trigger",portOut:"trigger 4",objIn:"7b9b7c0f-946d-4233-ad5f-f9da45dee595",objOut:"e962b868-4c07-43f4-879c-405ff720ecbc"}]},{name:"Named Trigger",value:"post"}],portsOut:[]},{opId:"ce1eaf2b-943b-4dc0-ab5e-ee11b63c9ed0",objName:"Ops.Trigger.TriggerSend",id:"4d73592a-95e1-4f65-8aa8-d045a7c868eb",uiAttribs:{title:">init",translate:{x:300,y:-460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Trigger",links:[{portIn:"Trigger",portOut:"trigger 3",objIn:"4d73592a-95e1-4f65-8aa8-d045a7c868eb",objOut:"e962b868-4c07-43f4-879c-405ff720ecbc"}]},{name:"Named Trigger",value:"init"}],portsOut:[]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"e565302a-3604-4094-9ba8-d873763c1bdb",uiAttribs:{title:">init",translate:{x:360,y:-400},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"init"}],portsOut:[{name:"Triggered"}]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"bd889c8e-b70b-484a-aef3-22cdea1f3a91",uiAttribs:{title:">post",translate:{x:480,y:-240},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"post"}],portsOut:[{name:"Triggered"}]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"d5726eeb-5949-4109-842a-67e052d2db5f",uiAttribs:{title:">init",translate:{x:1176,y:-400},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"init"}],portsOut:[{name:"Triggered"}]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"b82620a1-23f8-49b9-ad85-d2689fc67a5f",uiAttribs:{title:">init",translate:{x:1428,y:-180},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"init"}],portsOut:[{name:"Triggered"}]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"8529265d-daec-4699-ae7e-81573ef45a04",uiAttribs:{title:">post",translate:{x:1584,y:-180},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"post"}],portsOut:[{name:"Triggered"}]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"69489a94-2712-48f9-83e7-db7051341b0e",uiAttribs:{title:">post",translate:{x:2520,y:-320},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"post"}],portsOut:[{name:"Triggered"}]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"0ed27529-c09a-4a51-829d-c5fc28e79b88",uiAttribs:{title:">init",translate:{x:2160,y:-420},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"init"}],portsOut:[{name:"Triggered"}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"40560f72-365a-43ed-9d16-795f7b4c2796",uiAttribs:{title:"Add",translate:{x:1800,y:320},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"40560f72-365a-43ed-9d16-795f7b4c2796",objOut:"2629559f-d549-4a30-9890-ede9d6959765"}]},{name:"fragment",value:"\n\nUNI sampler2D uTop;\nUNI sampler2D uBottom;\n\n\nUNI float reset;\nUNI float level;\n\nIN vec2 texCoord;\n\n\n{{MODULES_HEAD}}\nvoid main()\n{\n \n vec4 top = texture2D(uTop,texCoord);\n vec4 bottom = texture2D(uBottom,texCoord);\n \n vec4 col = vec4(top.rgb+bottom.rgb * level,1.0);\n \n col = clamp(col,-1.0,1.0);\n\n if (reset == 1.0){\n col = vec4(0.0,0.0,0.0,1.0);\n }\n\n\n {{MODULE_COLOR}}\n outColor = col;\n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"reset",links:[{portIn:"reset",portOut:"number",objIn:"40560f72-365a-43ed-9d16-795f7b4c2796",objOut:"856563b1-dc6d-4053-b61a-f44010d719aa"}]},{name:"level",value:1},{name:"uTop",links:[{portIn:"uTop",portOut:"texture_out",objIn:"40560f72-365a-43ed-9d16-795f7b4c2796",objOut:"1ce7426b-37e6-4e05-b228-3f5d8d4a626b"}]},{name:"uBottom",links:[{portIn:"uBottom",portOut:"texture_out",objIn:"40560f72-365a-43ed-9d16-795f7b4c2796",objOut:"45c9e425-07dc-4b15-a54e-7a9a5098f410"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"28ce8c8f-df8f-4751-9e80-6b22dc355b55",uiAttribs:{translate:{x:1800,y:420},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"28ce8c8f-df8f-4751-9e80-6b22dc355b55",objOut:"40560f72-365a-43ed-9d16-795f7b4c2796"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"28ce8c8f-df8f-4751-9e80-6b22dc355b55",objOut:"40560f72-365a-43ed-9d16-795f7b4c2796"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!1},{name:"Width",value:512},{name:"Height",value:512},{name:"Floating Point",value:!0}],portsOut:[{name:"Next",value:0},{name:"Texture"}]},{opId:"18a6d1f4-a7f8-4a3e-ab1d-0c2d2efe3861",objName:"Ops.Gl.Textures.CopyTexture",id:"45c9e425-07dc-4b15-a54e-7a9a5098f410",uiAttribs:{translate:{x:1920,y:320},subPatch:0,notWorkingMsg:null,hint:null,warning:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"45c9e425-07dc-4b15-a54e-7a9a5098f410",objOut:"dece4e5b-7f3f-4917-85f2-f930f
7269ad1e0"}]},{name:"Texture",links:[{portIn:"Texture",portOut:"Texture",objIn:"45c9e425-07dc-4b15-a54e-7a9a5098f410",objOut:"28ce8c8f-df8f-4751-9e80-6b22dc355b55"}]},{name:"use original size",value:!0},{name:"width",value:512},{name:"height",value:512},{name:"filter index",value:0},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"HDR",value:!0}],portsOut:[{name:"trigger",value:0},{name:"texture_out"},{name:"Aspect Ratio",value:1}]},{opId:"ef451374-cbc2-49f1-a51c-5df5d71dc03d",objName:"Ops.Gl.Textures.WebcamTexture",id:"e61c32fb-e112-4b4b-aff1-dce4c0051215",uiAttribs:{translate:{x:2460,y:-400},subPatch:0,notWorkingMsg:null},portsIn:[{name:"flip",value:!0},{name:"fps",value:30},{name:"Active",value:!0}],portsOut:[{name:"texture"},{name:"Ratio",value:1.3333333333333333},{name:"Available"},{name:"Element Id",value:"webcamb17cc43c-4fd8-40a3-9624-2cacb3cd1884"}]},{opId:"eb3232e5-e947-4683-a17f-27a72d464b2c",objName:"Ops.Sidebar.Slider",id:"0daf6f7a-9bd6-40cd-a8fd-303ac2d72ba9",uiAttribs:{title:"Slider: Intensity",translate:{x:924,y:-1260},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"0daf6f7a-9bd6-40cd-a8fd-303ac2d72ba9",objOut:"de593143-45e7-4eb7-ab6b-5117124ff8b8"}]},{name:"Text",value:"Intensity"},{name:"Min",value:0},{name:"Max",value:1},{name:"Step",value:1e-5},{name:"Grey Out",links:[{portIn:"Grey Out",portOut:"out bool",objIn:"0daf6f7a-9bd6-40cd-a8fd-303ac2d72ba9",objOut:"531d597e-8388-4430-ad64-4c3bef2ce096"}]},{name:"Visible",value:!0},{name:"Input",value:.3},{name:"Set Default",value:0},{name:"Reset",value:0},{name:"Default",value:.3}],portsOut:[{name:"childs"},{name:"Result"}]},{opId:"18a6d1f4-a7f8-4a3e-ab1d-0c2d2efe3861",objName:"Ops.Gl.Textures.CopyTexture",id:"f7158fd8-888f-407a-b1d5-78cde2de8653",uiAttribs:{translate:{x:2256,y:-260},subPatch:0,notWorkingMsg:null,hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"f7158fd8-888f-407a-b1d5-78cde2de8653",objOut:"0ed27529-c09a-4a51-829d-c5fc28e79b88"}]},{name:"Texture",links:[{portIn:"Texture",portOut:"texture",objIn:"f7158fd8-888f-407a-b1d5-78cde2de8653",objOut:"e61c32fb-e112-4b4b-aff1-dce4c0051215"}]},{name:"use original size",value:!0},{name:"width",value:640},{name:"height",value:480},{name:"filter index",value:0},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"HDR",value:!0}],portsOut:[{name:"trigger"},{name:"texture_out"},{name:"Aspect Ratio",value:1.3333333333333333}]},{opId:"5c04608d-1e42-4e36-be00-1be4a81fc309",objName:"Ops.Gl.TextureEffects.ImageCompose",id:"1ce7426b-37e6-4e05-b228-3f5d8d4a626b",uiAttribs:{hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null,translate:{x:1800,y:60},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Next",objIn:"1ce7426b-37e6-4e05-b228-3f5d8d4a626b",objOut:"b97b414d-0af1-4832-96e0-85c6ab58eefe"}]},{name:"use viewport size",value:!0},{name:"width",value:788},{name:"height",value:750},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"repeat"},{name:"HDR",value:!0},{name:"Background Alpha",value:1}],portsOut:[{name:"trigger"},{name:"texture_out"},{name:"Aspect Ratio",value:1.0506666666666666}]},{opId:"f94b5136-61fd-4558-8348-e7c8db5a6348",objName:"Ops.Gl.TextureEffects.DrawImage_v2",id:"077689c2-19c7-4ec0-aded-f936ba492e8a",uiAttribs:{translate:{x:2220,y:160},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"077689c2-19c7-4ec0-aded-f936ba492e8a",objOut:"d9188294-1dc1-4b97-93c3-491a29cb0967"}]},{name:"blendMode index",value:0},{name:"blendMode",value:"normal"},{name:"amount",value:1},{name:"image",links:[{portIn:"image",portOut:"Texture",objIn:"077689c2-19c7-4ec0-aded-f936ba492e8a",objOut:"285daa37-5ba8-4d70-903c-0ff423a577f5"}]},{name:"removeAlphaSrc",value:!1},{name:"imageAlpha",value:0},{name:"alphaSrc index",value:0},{name:"alphaSrc",value:"alpha channel"},{name:"invert alpha channel",value:!1},{name:"Aspect Ratio",value:!1},{name:"Stretch Axis index",value:0},{name:"Stretch Axis",value:"X"},{name:"Position",value:0},{name:"Crop",value:!1},{name:"flip x",value:!1},{name:"flip y",value:!1},{name:"Transform",value:!1},{name:"Scale X",value:1},{name:"Scale Y",value:1},{name:"Position X",value:0},{name:"Position Y",value:0},{name:"Rotation",value:0},{name:"Clip Repeat",value:!1}],portsOut:[{name:"trigger"}]},{opId:"54f26f53-f637-44c1-9bfb-a2f2b722e998",objName:"Ops.Gl.TextureEffects.Blur",id:"2629559f-d549-4a30-9890-ede9d6959765",uiAttribs:{translate:{x:1800,y:220},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"2629559f-d549-4a30-9890-ede9d6959765",objOut:"b630159a-1535-43f1-a870-38a34ce5fc71"}]},{name:"amount",value:3},{name:"direction index",value:0},{name:"direction",value:"both"},{name:"Fast",value:!0},{name:"mask",value:0}],portsOut:[{name:"trigger"}]},{opId:"eb3232e5-e947-4683-a17f-27a72d464b2c",objName:"Ops.Sidebar.Slider",id:"75
72af24b2-60bd-4cf7-bd75-3fb3954d11d1",uiAttribs:{title:"Slider: Brush Size",translate:{x:540,y:-1480},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"75af24b2-60bd-4cf7-bd75-3fb3954d11d1",objOut:"a1bc5786-048f-4876-8b29-26925515dd5b"}]},{name:"Text",value:"Brush Size"},{name:"Min",value:.1},{name:"Max",value:.5},{name:"Step",value:1e-5},{name:"Grey Out",value:!1},{name:"Visible",value:!0},{name:"Input",value:.1},{name:"Set Default",value:0},{name:"Reset",value:0},{name:"Default",value:.1}],portsOut:[{name:"childs"},{name:"Result"}]},{opId:"cf3544e4-e392-432b-89fd-fcfb5c974388",objName:"Ops.Trigger.TriggerOnce",id:"3e2612fb-5325-41a5-b316-ed30abc1303e",uiAttribs:{translate:{x:396,y:-1100},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Exec",links:[{portIn:"Exec",portOut:"trigger",objIn:"3e2612fb-5325-41a5-b316-ed30abc1303e",objOut:"4aceec49-3577-4bef-a66b-ac7bf6bacf8e"}]},{name:"Reset",value:0}],portsOut:[{name:"Next"},{name:"Was Triggered",value:!0}]},{opId:"7ef594f3-4907-47b0-a2d3-9854eda1679d",objName:"Ops.Trigger.TriggerExtender",id:"7a656ecd-c83e-4659-83db-f6a9d7ac361a",uiAttribs:{translate:{x:588,y:-1020},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Execute",links:[{portIn:"Execute",portOut:"Pressed Trigger",objIn:"7a656ecd-c83e-4659-83db-f6a9d7ac361a",objOut:"a560f219-d2d9-410a-a519-ce904fd572fb"},{portIn:"Execute",portOut:"Next",objIn:"7a656ecd-c83e-4659-83db-f6a9d7ac361a",objOut:"3e2612fb-5325-41a5-b316-ed30abc1303e"}]}],portsOut:[{name:"Next"}]},{opId:"20f3c4e7-04d1-44e0-b868-05756d1c66c6",objName:"Ops.Gl.Meshes.Rectangle",id:"c577011e-9519-40a3-b16c-24c31921bc8b",uiAttribs:{translate:{x:-876,y:840},subPatch:0,notWorkingMsg:null,error:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"c577011e-9519-40a3-b16c-24c31921bc8b",objOut:"5252a7e2-d561-40c7-b44e-6d4bed8ebeb8"}]},{name:"width",value:14},{name:"height",value:14},{name:"pivot x index",value:0},{name:"pivot x",value:"center"},{name:"pivot y index",value:0},{name:"pivot y",value:"center"},{name:"num columns",value:1},{name:"num rows",value:1},{name:"axis index",value:0},{name:"axis",value:"xy"},{name:"Active",value:!0}],portsOut:[{name:"trigger",value:0},{name:"geometry"}]},{opId:"51f2207b-daaa-447f-bdbe-87fdd72f0c40",objName:"Ops.Gl.Shader.BasicMaterial_v2",id:"5252a7e2-d561-40c7-b44e-6d4bed8ebeb8",uiAttribs:{translate:{x:-888,y:720},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Next",objIn:"5252a7e2-d561-40c7-b44e-6d4bed8ebeb8",objOut:"f6d926d0-8ac4-4472-862d-a68f628d5ee2"}]},{name:"r",value:.9564064307944671},{name:"g",value:.24761071889127528},{name:"b",value:.41679742349250715},{name:"a",value:1},{name:"texture",links:[{portIn:"texture",portOut:"texture_out",objIn:"5252a7e2-d561-40c7-b44e-6d4bed8ebeb8",objOut:"8a23ff05-3f97-48e9-840e-c26457b7bd6e"}]},{name:"colorizeTexture",value:!1},{name:"textureOpacity",value:0},{name:"Alpha Mask Source index",value:0},{name:"Alpha Mask Source",value:"Luminance"},{name:"Opacity TexCoords Transform",value:!1},{name:"Discard Transparent Pixels",value:!1},{name:"diffuseRepeatX",value:1},{name:"diffuseRepeatY",value:1},{name:"Tex Offset X",value:0},{name:"Tex Offset Y",value:0},{name:"billboard",value:!1}],portsOut:[{name:"trigger"},{name:"shader"}]},{opId:"d01fa820-396c-4cb5-9d78-6b14762852af",objName:"Ops.Gl.Render2Texture",id:"32c841ec-ae67-4501-a111-fe69053bb1ff",uiAttribs:{title:"render to texture",subPatch:0,translate:{x:-852,y:60},notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"32c841ec-ae67-4501-a111-fe69053bb1ff",objOut:"331d60bc-8040-42a8-8a4d-1ea2465a3268"}]},{name:"use viewport size",value:!0},{name:"texture width",value:788},{name:"texture height",value:750},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"MSAA index",value:0},{name:"MSAA",value:"8x"},{name:"HDR",value:!1},{name:"Depth",value:!0},{name:"Clear",value:!0}],portsOut:[{name:"trigger"},{name:"texture"},{name:"textureDepth"}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"f02fe52d-9720-4fd7-9230-756f5433c775",uiAttribs:{title:"Mono",translate:{x:-852,y:120},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"f02fe52d-9720-4fd7-9230-756f5433c775",objOut:"32c841ec-ae67-4501-a111-fe69053bb1ff"}]},{name:"fragment",value:"\n{{MODULES_HEAD}}\n\nUNI sampler2D cam;\nUNI float hue;\n\nIN vec2 texCoord;\n\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nvoid main()\n{\n\n {{MODULE_COLOR}}\n\n \tvec3 raw = abs(texture2D(cam, texCoord).rgb);\n\n \tvec3 shifted = texture2D(cam, texCoord).rgb * 0.5 + vec3(0.5);\n \n if (hue > 0.5){\n shifted = vec3(0.3,0.4,1.0);\n }\n\n float mono = (raw.r + raw.g + raw.b) / 1.0;\n //mono = map(mono,0.0,1.0,0.3,1.0);\n \n // mono = mix(0.0,mono,1.0);\n\n vec4 color = vec4(vec3(shifted),1.0) * mono;\n \n //color = vec4(vec3(mono),1.0);\n\n\toutColor = color;\n \n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"hue",value:1},{name:"cam",links:[{portIn:"cam",portOut:"Texture",objIn:"f02fe52d-9720-4fd7-9230-756f5433c775",objOut:"28ce8c8f-df8f-4751-9e80-6b22dc355b55"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"f6d926d0-8ac4-4472-862d-a68f628d5ee2",uiAttribs:{translate:{x:-852,y:180},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"f6d926d0-8ac4-4472-862d-a68f628d5ee2",objOut:"f02fe52d-9720-4fd7-9230-756f5433c775"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"f6d926d0-8ac4-4472-862d-a68f628d5ee2",objOut:"f02fe52d-9720-4fd7-9230-756f5433c775"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!0},{name:"Width",value:788},{name:"Height",value:750},{name:"Floating Point",value:!1}],portsOut:[{name:"Next"},{name:"Texture"}]},{opId:"f94b5136-61fd-4558-8348-e7c8db5a6348",objName:"Ops.Gl.TextureEffects.DrawImage_v2",id:"906010d8-9bd7-4ca0-8a5a-5e217fe138e3",uiAttribs:{title:"Add Motion",translate:{x:1164,y:800},subPatch:0,notWorkingMsg:null,extendTitle:"add"},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"906010d8-9bd7-4ca0-8a5a-5e217fe138e3",objOut:"e66a7769-bbfc-4c70-867c-a5146cfa92aa"}]},{name:"blendMode index",value:0},{name:"blendMode",value:"add"},{name:"amount",value:1},{name:"image",links:[{portIn:"image",portOut:"texture",objIn:"906010d8-9bd7-4ca0-8a5a-5e217fe138e3",objOut:"32c841ec-ae67-4501-a111-fe69053bb1ff"}]},{name:"removeAlphaSrc",value:!1},{name:"imageAlpha",value:0},{name:"alphaSrc index",value:0},{name:"alphaSrc",value:"alpha channel"},{name:"invert alpha channel",value:!1},{name:"Aspect Ratio",value:!1},{name:"Stretch Axis index",value:0},{name:"Stretch Axis",value:"X"},{name:"Position",value:0},{name:"Crop",value:!1},{name:"flip x",value:!1},{name:"flip y",value:!1},{name:"Transform",value:!1},{name:"Scale X",value:1},{name:"Scale Y",value:1},{name:"Position X",value:0},{name:"Position Y",value:0},{name:"Rotation",value:0},{name:"Clip Repeat",value:!1}],portsOut:[{name:"trigger"}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"285daa37-5ba8-4d70-903c-0ff423a577f5",uiAttribs:{translate:{x:2244,y:20},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"285daa37-5ba8-4d70-903c-0ff423a577f5",objOut:"b2c6b754-0752-45eb-bd60-c511ff72f6f2"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"285daa37-5ba8-4d70-903c-0ff423a577f5",objOut:"b2c6b754-0752-45eb-bd60-c511ff72f6f2"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!1},{name:"Width",links:[{portIn:"Width",portOut:"Result",objIn:"285daa37-5ba8-4d70-903c-0ff423a577f5",objOut:"1b43d5a8-1dd1-47fd-a1dd-307202b740d9"}]},{name:"Height",links:[{portIn:"Height",portOut:"Result",objIn:"285daa37-5ba8-4d70-903c-0ff423a577f5",objOut:"1b43d5a8-1dd1-47fd-a1dd-307202b740d9"}]},{name:"Floating Point",value:!0}],portsOut:[{name:"Next"},{name:"Texture"}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"b2c6b754-0752-45eb-bd60-c511ff72f6f2",uiAttribs:{title:"FlipX",translate:{x:2244,y:-40},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Next",objIn:"b2c6b754-0752-45eb-bd60-c511ff72f6f2",objOut:"130b53c5-6024-4e5c-a609-8b1f0c7a59a4"}]},{name:"fragment",value:"UNI sampler2D uTex;\nUNI float bypass;\nIN vec2 texCoord;\n\n\n{{MODULES_HEAD}}\nvoid main()\n{\n \n vec4 col = texture2D(uTex,texCoord);\n \n if (bypass < 1.0){\n col = texture2D(uTex,vec2(1.0-texCoord.x,texCoord.y));\n }\n\n\n {{MODULE_COLOR}}\n outColor = col;\n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"bypass",value:0},{name:"uTex",links:[{portIn:"uTex",portOut:"Texture",objIn:"b2c6b754-0752-45eb-bd60-c511ff72f6f2",objOut:"130b53c5-6024-4e5c-a609-8b1f0c7a59a4"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"334bcf18-e2d0-46ad-bf7a-0d36c3d29af9",objName:"Ops.Sidebar.Toggle",id:"3a16f34e-ec41-473e-ad7c-a0682fc2a8ac",uiAttribs:{title:"Toggle: View Paths",translate:{x:648,y:-1340},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"3a16f34e-ec41-473e-ad7c-a0682fc2a8ac",objOut:"f4d52c6f-66dc-41b2-a205-77fd42720267"}]},{name:"Text",value:"View Paths"},{name:"Input",value:!0},{name:"Set Default",value:0},{name:"Default",value:!0},{name:"Grey Out",value:!1},{name:"Visible",value:!0}],portsOut:[{name:"childs"},{name:"Value"}]},{opId:"e9fdcaca-a007-4563-8a4d-e94e08506e0f",objName:"Ops.Math.Math",id:"aa2bb1ea-c2e0-4689-9698-d8e9739f540f",uiAttribs:{translate:{x:696,y:-1260},subPatch:0,notWorkingMsg:null,extendTitle:"*"},portsIn:[{name:"number 0",links:[{portIn:"number 0",portOut:"number",objIn:"aa2bb1ea-c2e0-4689-9698-d8e9739f540f",objOut:"9ea505b2-2b66-44b1-b758-e9fa9fca8dc7"}]},{name:"number 1",value:.3},{name:"math mode index",value:0},{name:"math mode",value:"*"}],portsOut:[{name:"result"}]},{opId:"2591c495-fceb-4f6e-937f-11b190c72ee5",objName:"Ops.Boolean.BoolToNumber",id:"9ea505b2-2b66-44b1-b758-e9fa9fca8dc7",uiAttribs:{translate:{x:696,y:-1300},subPatch:0,notWorkingMsg:null},portsIn:[{name:"bool",links:[{portIn:"bool",portOut:"Value",objIn:"9ea505b2-2b66-44b1-b758-e9fa9fca8dc7",objOut:"3a16f34e-ec41-473e-ad7c-a0682fc2a8ac"}]}],portsOut:[{name:"number"}]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"41f8abbc-413d-4252-8e88-c37733a55327",uiAttribs:{title:">init",translate:{x:1800,y:-420},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"init"}],portsOut:[{name:"Triggered"}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"b97b414d-0af1-4832-96e0-85c6ab58eefe",uiAttribs:{translate:{x:1800,y:-60},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"b97b414d-0af1-4832-96e0-85c6ab58eefe",objOut:"7875835b-4314-453a-865f-bf0730efced6"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"b97b414d-0af1-4832-96e0-85c6ab58eefe",objOut:"7875835b-4314-453a-865f-bf0730efced6"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!1},{name:"Width",value:512},{name:"Height",value:512},{name:"Floating Point",value:!0}],portsOut:[{name:"Next"},{name:"Texture"}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"7875835b-4314-453a-865f-bf0730efced6",uiAttribs:{title:"MouseVel",translate:{x:1800,y:-140},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"7875835b-4314-453a-865f-bf0730efced6",objOut:"41f8abbc-413d-4252-8e88-c37733a55327"}]},{name:"fragment",value:"\nUNI float mouseX;\nUNI float mouseY;\nUNI float vx;\nUNI float vy;\n\nUNI float vMult;\nUNI float vGate;\n\nUNI float size;\n\nIN vec2 texCoord;\n{{MODULES_HEAD}}\n\nfloat circle(in vec2 _st, in float _radius){\n vec2 dist = _st-vec2(0.5);\n\treturn 1.-smoothstep(_radius-(_radius*0.01),\n _radius+(_radius*0.01),\n dot(dist,dist)*4.0);\n}\n\n\nvoid main()\n{\n \n\n vec2 vel = vec2(vx,vy);\n vec2 mouse = vec2(mouseX,mouseY) * -1.0;\n \n vec4 cd = vec4(circle(texCoord + mouse,size));
72\n \n \n //calc velocity\n\n\t\n\tcd.rg = (vel * vMult * vGate) * cd.b;\n\tcd.b = 0.0;\n\tcd.a = 1.0;\n\n \n \n {{MODULE_COLOR}}\n outColor = cd;\n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"mouseX",links:[{portIn:"mouseX",portOut:"result",objIn:"7875835b-4314-453a-865f-bf0730efced6",objOut:"8e613288-3640-4862-a608-4a1c29f3d853"}]},{name:"mouseY",links:[{portIn:"mouseY",portOut:"result",objIn:"7875835b-4314-453a-865f-bf0730efced6",objOut:"ff763948-865d-4037-933a-92d343072e8a"}]},{name:"vx",links:[{portIn:"vx",portOut:"Speed",objIn:"7875835b-4314-453a-865f-bf0730efced6",objOut:"c22842b9-fe51-4b73-b92b-60d00e9ed9ce"}]},{name:"vy",links:[{portIn:"vy",portOut:"result",objIn:"7875835b-4314-453a-865f-bf0730efced6",objOut:"0536aa09-9056-4f0b-ac8c-97427ab27e27"}]},{name:"vMult",value:1},{name:"vGate",links:[{portIn:"vGate",portOut:"number",objIn:"7875835b-4314-453a-865f-bf0730efced6",objOut:"9c0d0a8a-fb57-44f1-9420-c18f90c4187f"}]},{name:"size",links:[{portIn:"size",portOut:"result",objIn:"7875835b-4314-453a-865f-bf0730efced6",objOut:"d0e36be7-e294-4c6a-a750-ca5c16e7b491"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"f94b5136-61fd-4558-8348-e7c8db5a6348",objName:"Ops.Gl.TextureEffects.DrawImage_v2",id:"b630159a-1535-43f1-a870-38a34ce5fc71",uiAttribs:{translate:{x:1800,y:160},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"b630159a-1535-43f1-a870-38a34ce5fc71",objOut:"1ce7426b-37e6-4e05-b228-3f5d8d4a626b"}]},{name:"blendMode index",value:0},{name:"blendMode",value:"normal"},{name:"amount",value:1},{name:"image",links:[{portIn:"image",portOut:"Texture",objIn:"b630159a-1535-43f1-a870-38a34ce5fc71",objOut:"b97b414d-0af1-4832-96e0-85c6ab58eefe"}]},{name:"removeAlphaSrc",value:!1},{name:"imageAlpha",value:0},{name:"alphaSrc index",value:0},{name:"alphaSrc",value:"alpha channel"},{name:"invert alpha channel",value:!1},{name:"Aspect Ratio",value:!1},{name:"Stretch Axis index",value:0},{name:"Stretch Axis",value:"X"},{name:"Position",value:0},{name:"Crop",value:!1},{name:"flip x",value:!1},{name:"flip y",value:!1},{name:"Transform",value:!1},{name:"Scale X",value:1},{name:"Scale Y",value:1},{name:"Position X",value:0},{name:"Position Y",value:0},{name:"Rotation",value:0},{name:"Clip Repeat",value:!1}],portsOut:[{name:"trigger"}]},{opId:"1bbdae06-fbb2-489b-9bcc-36c9d65bd441",objName:"Ops.Math.Multiply",id:"d0e36be7-e294-4c6a-a750-ca5c16e7b491",uiAttribs:{translate:{x:2064,y:-340},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"Result",objIn:"d0e36be7-e294-4c6a-a750-ca5c16e7b491",objOut:"75af24b2-60bd-4cf7-bd75-3fb3954d11d1"}]},{name:"number2",value:.01}],portsOut:[{name:"result"}]},{objName:"Ops.User.sealex.Velocity",id:"c22842b9-fe51-4b73-b92b-60d00e9ed9ce",uiAttribs:{title:"VelocityX",translate:{x:1872,y:-360},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Update",links:[{portIn:"Update",portOut:"Triggered",objIn:"c22842b9-fe51-4b73-b92b-60d00e9ed9ce",objOut:"41f8abbc-413d-4252-8e88-c37733a55327"}]},{name:"Value",links:[{portIn:"Value",portOut:"x",objIn:"c22842b9-fe51-4b73-b92b-60d00e9ed9ce",objOut:"9f7f74b8-2693-4349-b55d-395aee2e04ed"}]}],portsOut:[{name:"Speed"}]},{objName:"Ops.User.sealex.Velocity",id:"6ad3ff98-9138-4d73-8006-2bd5536eea5a",uiAttribs:{title:"VelocityY",translate:{x:1968,y:-360},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Update",links:[{portIn:"Update",portOut:"Triggered",objIn:"6ad3ff98-9138-4d73-8006-2bd5536eea5a",objOut:"41f8abbc-413d-4252-8e88-c37733a55327"}]},{name:"Value",links:[{portIn:"Value",portOut:"y",objIn:"6ad3ff98-9138-4d73-8006-2bd5536eea5a",objOut:"9f7f74b8-2693-4349-b55d-395aee2e04ed"}]}],portsOut:[{name:"Speed"}]},{opId:"1bbdae06-fbb2-489b-9bcc-36c9d65bd441",objName:"Ops.Math.Multiply",id:"0536aa09-9056-4f0b-ac8c-97427ab27e27",uiAttribs:{translate:{x:1968,y:-320},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"Speed",objIn:"0536aa09-9056-4f0b-ac8c-97427ab27e27",objOut:"6ad3ff98-9138-4d73-8006-2bd5536eea5a"}]},{name:"number2",value:-1}],portsOut:[{name:"result"}]},{opId:"86ea2333-b51c-48ed-94c2-8b7b6e9ff34c",objName:"Ops.Sidebar.Group",id:"0360191f-2992-4f9c-a9bf-780a51f7481f",uiAttribs:{title:"Group: Particle Settings",translate:{x:1224,y:-1560},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"next",objIn:"0360191f-2992-4f9c-a9bf-780a51f7481f",objOut:"af9a829a-a0a9-4b47-9654-1401dbce0fbf"}]},{name:"Text",value:"Particle Settings"},{name:"Default Minimized",value:!1},{name:"Visible",value:!0}],portsOut:[{name:"next"},{name:"childs"}]},{opId:"86ea2333-b51c-48ed-94c2-8b7b6e9ff34c",objName:"Ops.Sidebar.Group",id:"72077743-5607-4034-8fe0-49b70b3a374b",uiAttribs:{title:"Group: FLOW",translate:{x:672,y:-1660},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"next",objIn:"72077743-5607-4034-8fe0-49b70b3a374b",objOut:"58f75a9f-26dc-4ac0-8bed-7986493e1b80"}]},{name:"Text",value:"FLOW"},{name:"Default Minimized",value:!1},{name:"Visible",value:!0}],portsOut:[{name:"next"},{name:"childs"}]},{opId:"86ea2333-b51c-48ed-94c2-8b7b6e9ff34c",objName:"Ops.Sidebar.Group",id:"ada4581a-a35a-4321-8853-f27be45e01ba",uiAttribs:{title:"Group: FORCE",translate:{x:924,y:-1640},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"next",objIn:"ada4581a-a35a-4321-8853-f27be45e01ba",objOut:"72077743-5607-4034-8fe0-49b70b3a374b"}]},{name:"Text",value:"FORCE"},{name:"Default Minimized",value:!1},{name:"Visible",value:!0}],portsOut:[{name:"next"},{name:"childs"}]},{opId:"2617b407-60a0-4ff6-b4a7-18136cfa7817",objName:"Ops.Math.MapRange",id:"4a9370f7-22d4-41e6-9a39-93af1ad2a1d0",uiAttribs:{translate:{x:1236,y:-1300},subPatch:0,notWorkingMsg:null},portsIn:[{name:"value",links:[{portIn:"value",portOut:"Result",objIn:"4a9370f7-22d4-41e6-9a39-93af1ad2a1d0",objOut:"e1999d4f-062f-4c05-acaa-fed5233c4e74"}]},{name:"old min",value:0},{name:"old max",value:1},{name:"new min",value:1},{name:"new max",value:0},{name:"Easing index",value:0},{name:"Easing",value:"Linear"}],portsOut:[{name:"result"}]},{opId:"86ea2333-b51c-48ed-94c2-8b7b6e9ff34c",objName:"Ops.Sidebar.Group",id:"58f75a9f-26dc-4ac0-8bed-7986493e1b80",uiAttribs:{title:"Group: Actions",translate:{x:348,y:-1680},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"58f75a9f-26dc-4ac0-8bed-7986493e1b80",objOut:"09080f02-6893-4b40-a9a6-4a459bc511d4"}]},{name:"Text",value:"Actions"},{name:"Default Minimized",value:!1},{name:"Visible",value:!0}],portsOut:[{name:"next"},{name:"childs"}]},{opId:"334bcf18-e2d0-46ad-bf7a-0d36c3d29af9",objName:"Ops.Sidebar.Toggle",id:"f4d52c6f-66dc-41b2-a205-77fd42720267",uiAttribs:{title:"Toggle: Enable Brush",translate:{x:540,y:-1420},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"f4d52c6f-66dc-41b2-a205-77fd42720267",objOut:"75af24b2-60bd-4cf7-bd75-3fb3954d11d1"}]},{name:"Text",value:"Enable Brush"},{name:"Input",value:!0},{name:"Set Default",value:0},{name:"Default",value:!0},{name:"Grey Out",value:!1},{name:"Visible",value:!0}],portsOut:[{name:"childs"},{name:"Value"}]},{opId:"2591c495-fceb-4f6e-937f-11b190c72ee5",objName:"Ops.Boolean.BoolToNumber",id:"9c0d0a8a-fb57-44f1-9420-c18f90c4187f",uiAttribs:{translate:{x:1872,y:-560},subPatch:0,notWorkingMsg:null},portsIn:[{name:"bool",links:[{portIn:"bool",portOut:"result",objIn:"9c0d0a8a-fb57-44f1-9420-c18f90c4187f",objOut:"aee92414-114f-41f1-b140-46a91947754c"}]}],portsOut:[{name:"number"}]},{opId:"eb3232e5-e947-4683-a17f-27a72d464b2c",objName:"Ops.Sidebar.Slider",id:"e7d3d3d6-cf09-4493-bd6c-bd72d43fdfba",uiAttribs:{title:"Slider: Attraction",translate:{x:948,y:-1460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"e7d3d3d6-cf09-4493-bd6c-bd72d43fdfba",objOut:"96d0a57e-6f36-48ed-95e8-44da590d5e02"}]},{name:"Text",value:"Attraction"},{name:"Min",value:0},{name:"Max",value:.5},{name:"Step",value:1e-5},{name:"Grey Out",value:!1},{name:"Visible",value:!0},{name:"Input",value:.1},{name:"Set Default",value:0},{name:"Reset",value:0},{name:"Default",value:.1}],portsOut:[{name:"childs"},{name:"Result"}]},{opId:"5c04608d-1e42-4e36-be00-1be4a81fc309",objName:"Ops.Gl.TextureEffects.ImageCompose",id:"d9188294-1dc1-4b97-93c3-491a29cb0967",uiAttribs:{hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null,translate:{x:2220,y:100},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Next",objIn:"d9188294-1dc1-4b97-93c3-491a29cb0967",objOut:"285da
72a37-5ba8-4d70-903c-0ff423a577f5"}]},{name:"use viewport size",value:!0},{name:"width",links:[{portIn:"width",portOut:"Result",objIn:"d9188294-1dc1-4b97-93c3-491a29cb0967",objOut:"1b43d5a8-1dd1-47fd-a1dd-307202b740d9"}]},{name:"height",links:[{portIn:"height",portOut:"Result",objIn:"d9188294-1dc1-4b97-93c3-491a29cb0967",objOut:"1b43d5a8-1dd1-47fd-a1dd-307202b740d9"}]},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"repeat"},{name:"HDR",value:!0},{name:"Background Alpha",value:1}],portsOut:[{name:"trigger"},{name:"texture_out"},{name:"Aspect Ratio",value:1.0506666666666666}]},{opId:"54f26f53-f637-44c1-9bfb-a2f2b722e998",objName:"Ops.Gl.TextureEffects.Blur",id:"c9fcdf29-7902-4291-b0f3-10ea6e444b95",uiAttribs:{translate:{x:2220,y:220},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"c9fcdf29-7902-4291-b0f3-10ea6e444b95",objOut:"077689c2-19c7-4ec0-aded-f936ba492e8a"}]},{name:"amount",value:2},{name:"direction index",value:0},{name:"direction",value:"both"},{name:"Fast",value:!0},{name:"mask",value:0}],portsOut:[{name:"trigger"}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"6b03fbb8-0a4e-48e1-a097-1b86a3cd4035",uiAttribs:{title:"Add",translate:{x:2220,y:300},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"6b03fbb8-0a4e-48e1-a097-1b86a3cd4035",objOut:"c9fcdf29-7902-4291-b0f3-10ea6e444b95"}]},{name:"fragment",value:"\n\nUNI sampler2D uTop;\nUNI sampler2D uBottom;\n\n\nUNI float reset;\nUNI float level;\n\nIN vec2 texCoord;\n\n\n{{MODULES_HEAD}}\nvoid main()\n{\n \n vec4 top = texture2D(uTop,texCoord);\n vec4 bottom = texture2D(uBottom,texCoord);\n \n vec4 col = vec4(top.rgb+bottom.rgb * level,1.0);\n \n col = clamp(col,-1.0,1.0);\n\n if (reset == 1.0){\n col = vec4(0.0,0.0,0.0,1.0);\n }\n\n\n {{MODULE_COLOR}}\n outColor = col;\n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"reset",links:[{portIn:"reset",portOut:"number",objIn:"6b03fbb8-0a4e-48e1-a097-1b86a3cd4035",objOut:"856563b1-dc6d-4053-b61a-f44010d719aa"}]},{name:"level",value:.98},{name:"uTop",links:[{portIn:"uTop",portOut:"texture_out",objIn:"6b03fbb8-0a4e-48e1-a097-1b86a3cd4035",objOut:"d9188294-1dc1-4b97-93c3-491a29cb0967"}]},{name:"uBottom",links:[{portIn:"uBottom",portOut:"texture_out",objIn:"6b03fbb8-0a4e-48e1-a097-1b86a3cd4035",objOut:"1a198dbc-ae19-4076-be45-9bccd22ccb3f"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"18a6d1f4-a7f8-4a3e-ab1d-0c2d2efe3861",objName:"Ops.Gl.Textures.CopyTexture",id:"1a198dbc-ae19-4076-be45-9bccd22ccb3f",uiAttribs:{translate:{x:2352,y:340},subPatch:0,notWorkingMsg:null,hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"1a198dbc-ae19-4076-be45-9bccd22ccb3f",objOut:"69489a94-2712-48f9-83e7-db7051341b0e"}]},{name:"Texture",links:[{portIn:"Texture",portOut:"Texture",objIn:"1a198dbc-ae19-4076-be45-9bccd22ccb3f",objOut:"96343d31-f564-45cd-bfcc-4a5497b87251"}]},{name:"use original size",value:!0},{name:"width",value:300},{name:"height",value:300},{name:"filter index",value:0},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"HDR",value:!0}],portsOut:[{name:"trigger",value:0},{name:"texture_out"},{name:"Aspect Ratio",value:1}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"96343d31-f564-45cd-bfcc-4a5497b87251",uiAttribs:{translate:{x:2220,y:400},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"96343d31-f564-45cd-bfcc-4a5497b87251",objOut:"6b03fbb8-0a4e-48e1-a097-1b86a3cd4035"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"96343d31-f564-45cd-bfcc-4a5497b87251",objOut:"6b03fbb8-0a4e-48e1-a097-1b86a3cd4035"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!1},{name:"Width",links:[{portIn:"Width",portOut:"Result",objIn:"96343d31-f564-45cd-bfcc-4a5497b87251",objOut:"1b43d5a8-1dd1-47fd-a1dd-307202b740d9"}]},{name:"Height",links:[{portIn:"Height",portOut:"Result",objIn:"96343d31-f564-45cd-bfcc-4a5497b87251",objOut:"1b43d5a8-1dd1-47fd-a1dd-307202b740d9"}]},{name:"Floating Point",value:!0}],portsOut:[{name:"Next",value:0},{name:"Texture"}]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"dece4e5b-7f3f-4917-85f2-f930f
7269ad1e0",uiAttribs:{title:">post",translate:{x:1920,y:240},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"post"}],portsOut:[{name:"Triggered"}]},{opId:"ff9bc6a6-2cb3-4a85-8fd7-c9c61f402869",objName:"Ops.Value.ValueOrAssignment",id:"1b43d5a8-1dd1-47fd-a1dd-307202b740d9",uiAttribs:{title:"camRes",translate:{x:2148,y:-260},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Value"},{name:"Default Value",value:300}],portsOut:[{name:"Result"}]},{opId:"2591c495-fceb-4f6e-937f-11b190c72ee5",objName:"Ops.Boolean.BoolToNumber",id:"856563b1-dc6d-4053-b61a-f44010d719aa",uiAttribs:{translate:{x:636,y:-700},subPatch:0,notWorkingMsg:null},portsIn:[{name:"bool",links:[{portIn:"bool",portOut:"result",objIn:"856563b1-dc6d-4053-b61a-f44010d719aa",objOut:"dbb742da-5d46-4c65-a4f1-1ee0db35a693"}]}],portsOut:[{name:"number"}]},{opId:"c26e6ce0-8047-44bb-9bc8-5a4f911ed8ad",objName:"Ops.Boolean.And",id:"aee92414-114f-41f1-b140-46a91947754c",uiAttribs:{translate:{x:1872,y:-620},subPatch:0,notWorkingMsg:null},portsIn:[{name:"bool 1",links:[{portIn:"bool 1",portOut:"Value",objIn:"aee92414-114f-41f1-b140-46a91947754c",objOut:"f4d52c6f-66dc-41b2-a205-77fd42720267"}]},{name:"bool 2",links:[{portIn:"bool 2",portOut:"button down",objIn:"aee92414-114f-41f1-b140-46a91947754c",objOut:"9f7f74b8-2693-4349-b55d-395aee2e04ed"}]}],portsOut:[{name:"result"}]},{opId:"eb3232e5-e947-4683-a17f-27a72d464b2c",objName:"Ops.Sidebar.Slider",id:"a1bc5786-048f-4876-8b29-26925515dd5b",uiAttribs:{title:"Slider: Flow Speed",translate:{x:672,y:-1540},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"a1bc5786-048f-4876-8b29-26925515dd5b",objOut:"f31a0668-200e-420d-af1a-e77a04cadf3a"}]},{name:"Text",value:"Flow Speed"},{name:"Min",value:0},{name:"Max",value:1},{name:"Step",value:1e-5},{name:"Grey Out",value:!1},{name:"Visible",value:!0},{name:"Input",value:.5},{name:"Set Default",value:0},{name:"Reset",value:0},{name:"Default",value:.5}],portsOut:[{name:"childs"},{name:"Result"}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"b1889788-8313-4c5a-97d5-69716208b0ce",uiAttribs:{title:"MouseVel",translate:{x:1956,y:-140},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"b1889788-8313-4c5a-97d5-69716208b0ce",objOut:"41f8abbc-413d-4252-8e88-c37733a55327"}]},{name:"fragment",value:"\nUNI float mouseX;\nUNI float mouseY;\n\nUNI float size;\n\nIN vec2 texCoord;\n{{MODULES_HEAD}}\n\nfloat circle(in vec2 _st, in float _radius){\n vec2 dist = _st-vec2(0.5);\n\treturn 1.-smoothstep(_radius-(_radius*0.01),\n _radius+(_radius*0.01),\n dot(dist,dist)*4.0);\n}\n\n\nvoid main()\n{\n \n\n vec2 mouse = vec2(mouseX,mouseY) * -1.0;\n \n vec4 cd = vec4(circle(texCoord + mouse,size));\n \n \n \n {{MODULE_COLOR}}\n outColor = cd;\n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"mouseX",links:[{portIn:"mouseX",portOut:"result",objIn:"b1889788-8313-4c5a-97d5-69716208b0ce",objOut:"8e613288-3640-4862-a608-4a1c29f3d853"}]},{name:"mouseY",links:[{portIn:"mouseY",portOut:"result",objIn:"b1889788-8313-4c5a-97d5-69716208b0ce",objOut:"ff763948-865d-4037-933a-92d343072e8a"}]},{name:"size",links:[{portIn:"size",portOut:"result",objIn:"b1889788-8313-4c5a-97d5-69716208b0ce",objOut:"d0e36be7-e294-4c6a-a750-ca5c16e7b491"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"6402c230-0cad-4638-babf-62d2eb520089",uiAttribs:{translate:{x:1956,y:-60},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"6402c230-0cad-4638-babf-62d2eb520089",objOut:"b1889788-8313-4c5a-97d5-69716208b0ce"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"6402c230-0cad-4638-babf-62d2eb520089",objOut:"b1889788-8313-4c5a-97d5-69716208b0ce"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!1},{name:"Width",value:512},{name:"Height",value:512},{name:"Floating Point",value:!0}],portsOut:[{name:"Next",value:0},{name:"Texture"}]},{opId:"5c04608d-1e42-4e36-be00-1be4a81fc309",objName:"Ops.Gl.TextureEffects.ImageCompose",id:"8a23ff05-3f97-48e9-840e-c26457b7bd6e",uiAttribs:{hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null,translate:{x:-804,y:260},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Next",objIn:"8a23ff05-3f97-48e9-840e-c26457b7bd6e",objOut:"f6d926d0-8ac4-4472-862d-a68f628d5ee2"}]},{name:"use viewport size",value:!0},{name:"width",value:788},{name:"height",value:750},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"repeat"},{name:"HDR",value:!1}
72,{name:"Background Alpha",value:1}],portsOut:[{name:"trigger"},{name:"texture_out"},{name:"Aspect Ratio",value:1.0506666666666666}]},{opId:"f94b5136-61fd-4558-8348-e7c8db5a6348",objName:"Ops.Gl.TextureEffects.DrawImage_v2",id:"f01d6724-3ba0-4e40-87a9-3697ec701485",uiAttribs:{title:"DrawTrail",translate:{x:-804,y:320},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"f01d6724-3ba0-4e40-87a9-3697ec701485",objOut:"8a23ff05-3f97-48e9-840e-c26457b7bd6e"}]},{name:"blendMode index",value:0},{name:"blendMode",value:"normal"},{name:"amount",links:[{portIn:"amount",portOut:"result",objIn:"f01d6724-3ba0-4e40-87a9-3697ec701485",objOut:"aa2bb1ea-c2e0-4689-9698-d8e9739f540f"}]},{name:"image",links:[{portIn:"image",portOut:"Texture",objIn:"f01d6724-3ba0-4e40-87a9-3697ec701485",objOut:"f6d926d0-8ac4-4472-862d-a68f628d5ee2"}]},{name:"removeAlphaSrc",value:!1},{name:"imageAlpha",value:0},{name:"alphaSrc index",value:0},{name:"alphaSrc",value:"alpha channel"},{name:"invert alpha channel",value:!1},{name:"Aspect Ratio",value:!1},{name:"Stretch Axis index",value:0},{name:"Stretch Axis",value:"X"},{name:"Position",value:0},{name:"Crop",value:!1},{name:"flip x",value:!1},{name:"flip y",value:!1},{name:"Transform",value:!1},{name:"Scale X",value:1},{name:"Scale Y",value:1},{name:"Position X",value:0},{name:"Position Y",value:0},{name:"Rotation",value:0},{name:"Clip Repeat",value:!1}],portsOut:[{name:"trigger"}]},{opId:"f94b5136-61fd-4558-8348-e7c8db5a6348",objName:"Ops.Gl.TextureEffects.DrawImage_v2",id:"36c6ef55-3873-44ea-a6ee-10f41fe5e271",uiAttribs:{title:"DrawBrush",translate:{x:-804,y:380},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"36c6ef55-3873-44ea-a6ee-10f41fe5e271",objOut:"f01d6724-3ba0-4e40-87a9-3697ec701485"}]},{name:"blendMode index",value:0},{name:"blendMode",value:"normal"},{name:"amount",links:[{portIn:"amount",portOut:"result",objIn:"36c6ef55-3873-44ea-a6ee-10f41fe5e271",objOut:"1e457a00-4adc-4710-8806-cb15d369330e"}]},{name:"image",links:[{portIn:"image",portOut:"Texture",objIn:"36c6ef55-3873-44ea-a6ee-10f41fe5e271",objOut:"6402c230-0cad-4638-babf-62d2eb520089"}]},{name:"removeAlphaSrc",value:!1},{name:"imageAlpha",value:0},{name:"alphaSrc index",value:0},{name:"alphaSrc",value:"alpha channel"},{name:"invert alpha channel",value:!1},{name:"Aspect Ratio",value:!1},{name:"Stretch Axis index",value:0},{name:"Stretch Axis",value:"X"},{name:"Position",value:0},{name:"Crop",value:!1},{name:"flip x",value:!1},{name:"flip y",value:!1},{name:"Transform",value:!1},{name:"Scale X",value:1},{name:"Scale Y",value:1},{name:"Position X",value:0},{name:"Position Y",value:0},{name:"Rotation",value:0},{name:"Clip Repeat",value:!1}],portsOut:[{name:"trigger"}]},{opId:"2591c495-fceb-4f6e-937f-11b190c72ee5",objName:"Ops.Boolean.BoolToNumber",id:"921c9b19-6de9-4a57-84e7-38ca6bbdbcf8",uiAttribs:{translate:{x:816,y:-1380},subPatch:0,notWorkingMsg:null},portsIn:[{name:"bool",links:[{portIn:"bool",portOut:"Value",objIn:"921c9b19-6de9-4a57-84e7-38ca6bbdbcf8",objOut:"f4d52c6f-66dc-41b2-a205-77fd42720267"}]}],portsOut:[{name:"number"}]},{opId:"e9fdcaca-a007-4563-8a4d-e94e08506e0f",objName:"Ops.Math.Math",id:"1e457a00-4adc-4710-8806-cb15d369330e",uiAttribs:{translate:{x:816,y:-1320},subPatch:0,notWorkingMsg:null,extendTitle:"*"},portsIn:[{name:"number 0",links:[{portIn:"number 0",portOut:"number",objIn:"1e457a00-4adc-4710-8806-cb15d369330e",objOut:"921c9b19-6de9-4a57-84e7-38ca6bbdbcf8"}]},{name:"number 1",value:.3},{name:"math mode index",value:0},{name:"math mode",value:"*"}],portsOut:[{name:"result"}]},{opId:"e9fdcaca-a007-4563-8a4d-e94e08506e0f",objName:"Ops.Math.Math",id:"35048f81-0f8c-428f-8df6-a38429c266c1",uiAttribs:{translate:{x:696,y:-1460},subPatch:0,extendTitle:"*",notWorkingMsg:null},portsIn:[{name:"number 0",links:[{portIn:"number 0",portOut:"Result",objIn:"35048f81-0f8c-428f-8df6-a38429c266c1",objOut:"a1bc5786-048f-4876-8b29-26925515dd5b"}]},{name:"number 1",value:.2},{name:"math mode index",value:0},{name:"math mode",value:"*"}],portsOut:[{name:"result"}]},{opId:"f069c0db-4051-4eae-989e-6ef7953787fd",objName:"Ops.Devices.Keyboard.KeyPressLearn",id:"885ebef6-3528-45fe-808d-2056e84c8512",uiAttribs:{title:"Press S",translate:{x:360,y:-1280},subPatch:0,notWorkingMsg:null},portsIn:[{name:"key code",value:83},{name:"canvas only",value:!1},{name:"Mod Key index",value:0},{name:"Mod Key",value:"none"},{name:"Enabled",value:!0},{name:"Prevent Default",value:!1},{name:"learn",value:0}],portsOut:[{name:"on press"},{name:"on release",value:0},{name:"Pressed",value:!1}]},{opId:"118df748-16d1-46f4-b8fc-38d7cc5a0aab",objName:"Ops.Sidebar.Button",id:"f7b14164-bfa5-4d3d-bf22-dd5a1e5a613d",uiAttribs:{title:"Button: Save Image [ S ]",translate:{x:360,y:-1420},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"f7b14164-bfa5-4d3d-bf22-dd5a1e5a613d",objOut:"a560f219-d2d9-410a-a519-ce904fd572fb"}]},{name:"Text",value:"Save Image [ S ]"},{name:"Grey Out",value:!1},{name:"Visible",value:!0}],portsOut:[{name:"childs"},{name:"Pressed Trigger"}]},{opId:"7eb9a1ec-daf2-445c-a364-0bffa626a84b",objName:"Ops.Gl.SaveScreenShot",id:"459b22ae-aaa5-440e-a
72d88-176821152f9d",uiAttribs:{translate:{x:348,y:-1240},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Screenshot",links:[{portIn:"Screenshot",portOut:"Pressed Trigger",objIn:"459b22ae-aaa5-440e-ad88-176821152f9d",objOut:"f7b14164-bfa5-4d3d-bf22-dd5a1e5a613d"},{portIn:"Screenshot",portOut:"on press",objIn:"459b22ae-aaa5-440e-ad88-176821152f9d",objOut:"885ebef6-3528-45fe-808d-2056e84c8512"}]},{name:"Filename",value:"Submerge"},{name:"Use Canvas Size",value:!0},{name:"Width",value:0},{name:"Height",value:0}],portsOut:[{name:"Finished",value:0}]},{opId:"ff6b8c7b-00c6-48f2-9b43-d059e52143fe",objName:"Ops.Math.Speed",id:"19503a67-c4d9-4ce8-a221-f446a4b5c86f",uiAttribs:{translate:{x:2292,y:-960},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Update",links:[{portIn:"Update",portOut:"Triggered",objIn:"19503a67-c4d9-4ce8-a221-f446a4b5c86f",objOut:"fe160e18-30a9-4df5-ad92-a4430cb740cf"}]},{name:"Value",links:[{portIn:"Value",portOut:"x",objIn:"19503a67-c4d9-4ce8-a221-f446a4b5c86f",objOut:"9f7f74b8-2693-4349-b55d-395aee2e04ed"}]}],portsOut:[{name:"Speed"}]},{opId:"ff6b8c7b-00c6-48f2-9b43-d059e52143fe",objName:"Ops.Math.Speed",id:"078ac15c-840c-4e75-a4d4-b6305584efe3",uiAttribs:{translate:{x:2352,y:-960},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Update",links:[{portIn:"Update",portOut:"Triggered",objIn:"078ac15c-840c-4e75-a4d4-b6305584efe3",objOut:"fe160e18-30a9-4df5-ad92-a4430cb740cf"}]},{name:"Value",links:[{portIn:"Value",portOut:"y",objIn:"078ac15c-840c-4e75-a4d4-b6305584efe3",objOut:"9f7f74b8-2693-4349-b55d-395aee2e04ed"}]}],portsOut:[{name:"Speed"}]},{opId:"c8fb181e-0b03-4b41-9e55-06b6267bc634",objName:"Ops.Math.Sum",id:"73cc309c-280c-4f0c-9596-dfbc5cfd8828",uiAttribs:{translate:{x:2328,y:-900},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"Speed",objIn:"73cc309c-280c-4f0c-9596-dfbc5cfd8828",objOut:"19503a67-c4d9-4ce8-a221-f446a4b5c86f"}]},{name:"number2",links:[{portIn:"number2",portOut:"Speed",objIn:"73cc309c-280c-4f0c-9596-dfbc5cfd8828",objOut:"078ac15c-840c-4e75-a4d4-b6305584efe3"}]}],portsOut:[{name:"result"}]},{opId:"0816c999-f2db-466b-9777-2814573574c5",objName:"Ops.Trigger.TriggerReceive",id:"fe160e18-30a9-4df5-ad92-a4430cb740cf",uiAttribs:{title:">init",translate:{x:2316,y:-1060},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Named Trigger index",value:0},{name:"Named Trigger",value:"init"}],portsOut:[{name:"Triggered"}]},{opId:"5677b5b5-753a-4fbf-9e91-64c81ec68a2f",objName:"Ops.Anim.Smooth",id:"7dfc126f-37b5-464d-aa63-c71fea63620b",uiAttribs:{translate:{x:2304,y:-840},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Update",links:[{portIn:"Update",portOut:"Triggered",objIn:"7dfc126f-37b5-464d-aa63-c71fea63620b",objOut:"fe160e18-30a9-4df5-ad92-a4430cb740cf"}]},{name:"Separate inc/dec",value:!1},{name:"Value",links:[{portIn:"Value",portOut:"result",objIn:"7dfc126f-37b5-464d-aa63-c71fea63620b",objOut:"73cc309c-280c-4f0c-9596-dfbc5cfd8828"}]},{name:"Inc factor",value:30},{name:"Dec factor",value:4}],portsOut:[{name:"Next"},{name:"Result",value:3560277544663744e-21}]},{opId:"53fdbf4a-bc8d-4c5d-a698-f34fdeb53827",objName:"Ops.WebAudio.Output",id:"a542f9c0-bedf-4c16-b663-25ee371c54fe",uiAttribs:{translate:{x:2520,y:-460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Audio In",links:[{portIn:"Audio In",portOut:"audio out",objIn:"a542f9c0-bedf-4c16-b663-25ee371c54fe",objOut:"4820b039-e15f-47bb-b1ae-c410314f09a9"}]},{name:"Volume",value:1},{name:"Mute",value:!1}],portsOut:[]},{opId:"334bcf18-e2d0-46ad-bf7a-0d36c3d29af9",objName:"Ops.Sidebar.Toggle",id:"62c384e2-7f3d-4121-84ec-026d06450b8c",uiAttribs:{title:"Toggle: Enable Audio",translate:{x:360,y:-1360},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"62c384e2-7f3d-4121-84ec-026d06450b8c",objOut:"f7b14164-bfa5-4d3d-bf22-dd5a1e5a613d"}]},{name:"Text",value:"Enable Audio"},{name:"Input",value:!0},{name:"Set Default",value:0},{name:"Default",value:!0},{name:"Grey Out",value:!1},{name:"Visible",value:!0}],portsOut:[{name:"childs"},{name:"Value"}]},{opId:"29402bba-48ee-4f28-94f0-bdc345e6bb67",objName:"Ops.WebAudio.Gain",id:"4820b039-e15f-47bb-b1ae-c410314f09a9",uiAttribs:{translate:{x:2520,y:-520},subPatch:0,notWorkingMsg:null},portsIn:[{name:"audio in",links:[{portIn:"audio in",portOut:"audio out",objIn:"4820b039-e15f-47bb-b1ae-c410314f09a9",objOut:"cd048bfe-8add-4890-8234-5fedb754cb7a"}]},{name:"gain",links:[{portIn:"gain",portOut:"number",objIn:"4820b039-e15f-47bb-b1ae-c410314f09a9",objOut:"81
72a5177f-b37e-43c3-9ea5-4c44a6def98e"}]}],portsOut:[{name:"audio out"}]},{opId:"2591c495-fceb-4f6e-937f-11b190c72ee5",objName:"Ops.Boolean.BoolToNumber",id:"81a5177f-b37e-43c3-9ea5-4c44a6def98e",uiAttribs:{translate:{x:2532,y:-560},subPatch:0,notWorkingMsg:null},portsIn:[{name:"bool",links:[{portIn:"bool",portOut:"Value",objIn:"81a5177f-b37e-43c3-9ea5-4c44a6def98e",objOut:"62c384e2-7f3d-4121-84ec-026d06450b8c"}]}],portsOut:[{name:"number"}]},{opId:"5677b5b5-753a-4fbf-9e91-64c81ec68a2f",objName:"Ops.Anim.Smooth",id:"09027210-eb24-4ebe-bdcb-f5ab2205ef9b",uiAttribs:{translate:{x:2328,y:-460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Update",links:[{portIn:"Update",portOut:"Next",objIn:"09027210-eb24-4ebe-bdcb-f5ab2205ef9b",objOut:"7dfc126f-37b5-464d-aa63-c71fea63620b"}]},{name:"Separate inc/dec",value:!1},{name:"Value",links:[{portIn:"Value",portOut:"result",objIn:"09027210-eb24-4ebe-bdcb-f5ab2205ef9b",objOut:"4671f8cc-9b21-493e-a54f-6066b76ec563"}]},{name:"Inc factor",value:10},{name:"Dec factor",value:4}],portsOut:[{name:"Next",value:0},{name:"Result"}]},{opId:"29402bba-48ee-4f28-94f0-bdc345e6bb67",objName:"Ops.WebAudio.Gain",id:"9e778548-38de-4275-a04b-da585dca2d75",uiAttribs:{translate:{x:2520,y:-700},subPatch:0,notWorkingMsg:null},portsIn:[{name:"audio in",links:[{portIn:"audio in",portOut:"Audio Out",objIn:"9e778548-38de-4275-a04b-da585dca2d75",objOut:"15fbb243-6a82-43b9-9a6c-4e1e4d76913c"}]},{name:"gain",links:[{portIn:"gain",portOut:"Result",objIn:"9e778548-38de-4275-a04b-da585dca2d75",objOut:"09027210-eb24-4ebe-bdcb-f5ab2205ef9b"}]}],portsOut:[{name:"audio out"}]},{opId:"45cc0011-ada8-4423-8f5b-39a3810b8389",objName:"Ops.Math.Incrementor",id:"73d9ce27-5bb7-4c25-a757-96c61d3800fe",uiAttribs:{translate:{x:2340,y:-580},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Increment",links:[{portIn:"Increment",portOut:"Trigger out",objIn:"73d9ce27-5bb7-4c25-a757-96c61d3800fe",objOut:"84a0a754-7a4a-4513-b763-193a4fa4e342"}]},{name:"Decrement",links:[{portIn:"Decrement",portOut:"Trigger out",objIn:"73d9ce27-5bb7-4c25-a757-96c61d3800fe",objOut:"3f523312-20ed-4840-b8d9-7c8b0e54c34c"}]},{name:"Length",value:40},{name:"Reset",value:0},{name:"Mode index",value:0},{name:"Mode",value:"Stop at Max"}],portsOut:[{name:"Value"},{name:"Restarted",value:0}]},{opId:"65e8b8a2-ba13-485f-883a-2bcf377989da",objName:"Ops.Trigger.GateTrigger",id:"84a0a754-7a4a-4513-b763-193a4fa4e342",uiAttribs:{translate:{x:2340,y:-740},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Execute",links:[{portIn:"Execute",portOut:"Next",objIn:"84a0a754-7a4a-4513-b763-193a4fa4e342",objOut:"7dfc126f-37b5-464d-aa63-c71fea63620b"}]},{name:"Pass Through",links:[{portIn:"Pass Through",portOut:"button down",objIn:"84a0a754-7a4a-4513-b763-193a4fa4e342",objOut:"9f7f74b8-2693-4349-b55d-395aee2e04ed"}]}],portsOut:[{name:"Trigger out"}]},{opId:"65e8b8a2-ba13-485f-883a-2bcf377989da",objName:"Ops.Trigger.GateTrigger",id:"3f523312-20ed-4840-b8d9-7c8b0e54c34c",uiAttribs:{translate:{x:2364,y:-640},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Execute",links:[{portIn:"Execute",portOut:"Next",objIn:"3f523312-20ed-4840-b8d9-7c8b0e54c34c",objOut:"7dfc126f-37b5-464d-aa63-c71fea63620b"}]},{name:"Pass Through",links:[{portIn:"Pass Through",portOut:"out bool",objIn:"3f523312-20ed-4840-b8d9-7c8b0e54c34c",objOut:"d843080f-b834-4446-9a48-11b319bce04e"}]}],portsOut:[{name:"Trigger out"}]},{opId:"7b1abd02-3aad-4106-9848-7f4c3cfab6a9",objName:"Ops.Boolean.ToggleBoolValue",id:"d843080f-b834-4446-9a48-11b319bce04e",uiAttribs:{translate:{x:2376,y:-700},subPatch:0,notWorkingMsg:null},portsIn:[{name:"in bool",links:[{portIn:"in bool",portOut:"button down",objIn:"d843080f-b834-4446-9a48-11b319bce04e",objOut:"9f7f74b8-2693-4349-b55d-395aee2e04ed"}]}],portsOut:[{name:"out bool"}]},{opId:"2617b407-60a0-4ff6-b4a7-18136cfa7817",objName:"Ops.Math.MapRange",id:"4671f8cc-9b21-493e-a54f-6066b76ec563",uiAttribs:{translate:{x:2340,y:-520},subPatch:0,notWorkingMsg:null},portsIn:[{name:"value",links:[{portIn:"value",portOut:"Value",objIn:"4671f8cc-9b21-493e-a54f-6066b76ec563",objOut:"73d9ce27-5bb7-4c25-a757-96c61d3800fe"}]},{name:"old min",value:0},{name:"old max",value:40},{name:"new min",value:0},{name:"new max",value:1},{name:"Easing index",value:0},{name:"Easing",value:"Linear"}],portsOut:[{name:"result"}]},{opId:"3e28f86a-4f74-49a2-a1a6-f8943c00352d",objName:"Ops.WebAudio.BiquadFilter",id:"15fbb243-6a82-43b9-9a6c-4e1e4d76913c",uiAttribs:{translate:{x:2520,y:-760},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Audio In",links:[{portIn:"Audio In",portOut:"Audio Out",objIn:"15fbb243-6a82-43b9-9a6c-4e1e4d76913c",objOut:"425f9485-eac5-49be-a4c6-c2b41fbddf59"}]},{name:"type index",value:0},{name:"type",value:"bandpass"},{name:"frequency",links:[{portIn:"frequency",portOut:"result",objIn:"15fbb243-6a82-43b9-9a6c-4e1e4d76913c",objOut:"ee33a1a5-8246-4f3b-974a-94ee3edf8e58"}]},{name:"detune",value:0},{name:"q",value:.549},{name:"gain",value:.6}],portsOut:[{name:"Audio Out"}]},{opId:"2617b407-60a0-4ff6-b4a7-18136cfa7817",objName:"Ops.Math.MapRange",id:"ee33a1a5-8246-4f3b-974a-94ee3edf8e58",uiAttribs:{translate:{x:2580,y:-820},subPatch:0,notWorkingMsg:null},portsIn:[{name:"value",links:[{portIn:"value",portOut:"y",objIn:"ee33a1a5-8246-4f3b-974a-94ee3edf8e58",objOut:"9f7f74b8-2693-4349-b55d-395aee2e04ed"}]},{name:"old min",value:1},{name:"old max",value:-1},{name:"new min",value:300},{name:"new max",value:1e4},{name:"Easing index",value:0},{name:"Easing",value:"Linear"}],portsOut:[{name:"result"}]},{opId:"fd3ee2e6-e632-4013-b548-d380c14ffa7d",objName:"Ops.WebAudio.MultiIn",id:"cd048bfe-8add-4890-8234-5fedb754cb7a",uiAttribs:{translate:{x:2520,y:-620},subPatch:0,notWorkingMsg:null},portsIn:[{name:"audio in 0",links:[{portIn:"audio in 0",portOut:"audio out",objIn:"cd048bfe-8add-4890-8234-5fedb754cb7a",objOut:"9e778548-38de-4275-a04b-da585dca2d75"}]},{name:"audio in 1",links:[{portIn:"audio in 1",portOut:"audio out",objIn:"cd048bfe-8add-4890-8234-5fedb754cb7a",objOut:"7cd5e391-1590-47dd-8656-e3a689a796c1"}]},{name:"audio in 2",value:0},{name:"audio in 3",value:0},{name:"audio in 4",value:0},{name:"audio in 5",value:0},{name:"audio in 6",value:0},{name:"audio in 7",value:0}],portsOut:[{name:"audio out"}]},{opId:"05385277-92fc-4d49-b730-11f9ed5e5c0d",objName:"Ops.WebAudio.AudioBufferPlayer",id:"425f9485-eac5-49be-a4c6-c2b41fbddf59",uiAttribs:{translate:{x:2520,y:-880},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Audio Buffer",links:[{portIn:"Audio Buffer",portOut:"Audio Buffer",objIn:"425f9485-eac5-49be-a4c6-c2b41fbddf59",objOut:"40035df2-3898-4d48-90d0-8ad3eb3cd0cb"}]},{name:"Start / Stop",links:[{portIn:"Start / Stop",portOut:"Value",objIn:"425f9485-eac5-49be-a4c6-c2b41fbddf59",objOut:"62c384e2-7f3d-4121-84ec-026d06450b8c"}]},{name:"Start Time",value:0},{name:"Stop Time",value:0}
72,{name:"Offset",value:0},{name:"Autoplay",value:!1},{name:"Loop",value:!0},{name:"Detune",value:0},{name:"Playback Rate",value:1}],portsOut:[{name:"Audio Out"}]},{opId:"2cf4b0a1-b657-405b-8bf9-8555dbd5c231",objName:"Ops.WebAudio.AudioBuffer",id:"40035df2-3898-4d48-90d0-8ad3eb3cd0cb",uiAttribs:{title:"Pitch",translate:{x:2520,y:-1e3},subPatch:0,notWorkingMsg:null},portsIn:[{name:"URL",value:"assets/pitch_fixed_v2.ogg",display:"file"}],portsOut:[{name:"Audio Buffer"},{name:"Finished Loading",value:!0},{name:"Sample Rate",value:48e3},{name:"Length",value:3003245},{name:"Duration",value:62.56760416666667},{name:"Number of Channels",value:2}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"d438debe-8c79-442c-8c97-c745ab670a41",uiAttribs:{title:"Add Logo",translate:{x:1164,y:920},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"d438debe-8c79-442c-8c97-c745ab670a41",objOut:"906010d8-9bd7-4ca0-8a5a-5e217fe138e3"}]},{name:"fragment",value:"\n{{MODULES_HEAD}}\n\nUNI sampler2D tex;\nUNI sampler2D logo;\n\nUNI float aspect;\n\n\nIN vec2 texCoord;\n\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nvoid main()\n{\n\n {{MODULE_COLOR}}\n\n \tvec4 raw = texture2D(tex, texCoord);\n \n vec2 st = clamp((texCoord * vec2(aspect,1.0) - vec2(aspect-.18,0.0) )* 5.5,0.0,1.0);\n \n vec4 logo = texture2D(logo, st);\n\n vec4 result = raw + logo;\n\n\n \n\toutColor = result;\n \n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"aspect",links:[{portIn:"aspect",portOut:"Aspect Ratio",objIn:"d438debe-8c79-442c-8c97-c745ab670a41",objOut:"09a45ec1-9523-4924-a5b3-164c056aa67c"}]},{name:"tex",links:[{portIn:"tex",portOut:"texture_out",objIn:"d438debe-8c79-442c-8c97-c745ab670a41",objOut:"3ecb0ba2-2b70-4b79-9a11-4aecad67ebf1"}]},{name:"logo",links:[{portIn:"logo",portOut:"texture",objIn:"d438debe-8c79-442c-8c97-c745ab670a41",objOut:"57f15d07-b5b6-4bc5-904f-870eb75bf6ab"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"4d5de490-34bd-4f33-ac18-03bc5eca66
725f",uiAttribs:{translate:{x:1164,y:980},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"4d5de490-34bd-4f33-ac18-03bc5eca665f",objOut:"d438debe-8c79-442c-8c97-c745ab670a41"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"4d5de490-34bd-4f33-ac18-03bc5eca665f",objOut:"d438debe-8c79-442c-8c97-c745ab670a41"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!0},{name:"Width",value:788},{name:"Height",value:750},{name:"Floating Point",value:!1}],portsOut:[{name:"Next"},{name:"Texture"}]},{opId:"466394d4-6c1a-4e5d-a057-0063ab0f096a",objName:"Ops.Gl.Texture",id:"57f15d07-b5b6-4bc5-904f-870eb75bf6ab",uiAttribs:{title:"Texture: logo_square.png",translate:{x:1284,y:880},subPatch:0,error:null,hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null,notWorkingMsg:null},portsIn:[{name:"file",value:"assets/5e764c6b007c505be6f28141_logo_square.png",display:"file"},{name:"filter index",value:0},{name:"filter",value:"mipmap"},{name:"wrap index",value:2},{name:"wrap",value:"repeat"},{name:"flip",value:!1},{name:"unpackPreMultipliedAlpha",value:!1},{name:"Anisotropic index",value:0},{name:"Anisotropic",value:0}],portsOut:[{name:"texture"},{name:"width",value:650},{name:"height",value:650},{name:"loading",value:!0},{name:"Aspect Ratio",value:1}]},{opId:"94e499e5-b4ee-4861-ab48-6ab5098b2cc3",objName:"Ops.Gl.CanvasInfo",id:"09a45ec1-9523-4924-a5b3-164c056aa67c",uiAttribs:{translate:{x:1188,y:840},subPatch:0,notWorkingMsg:null},portsIn:[],portsOut:[{name:"width",value:788},{name:"height",value:750},{name:"Pixel Ratio",value:1},{name:"Aspect Ratio"},{name:"Landscape",value:!0}]},{opId:"334bcf18-e2d0-46ad-bf7a-0d36c3d29af9",objName:"Ops.Sidebar.Toggle",id:"229c4c0f-98d8-4b72-8231-1e6fefee4c05",uiAttribs:{title:"Toggle: View Motion",translate:{x:924,y:-1160},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"229c4c0f-98d8-4b72-8231-1e6fefee4c05",objOut:"0daf6f7a-9bd6-40cd-a8fd-303ac2d72ba9"}]},{name:"Text",value:"View Motion"},{name:"Input",value:!0},{name:"Set Default",value:0},{name:"Default",value:!0},{name:"Grey Out",links:[{portIn:"Grey Out",portOut:"out bool",objIn:"229c4c0f-98d8-4b72-8231-1e6fefee4c05",objOut:"531d597e-8388-4430-ad64-4c3bef2ce096"}]},{name:"Visible",value:!0}],portsOut:[{name:"childs"},{name:"Value"}]},{opId:"f94b5136-61fd-4558-8348-e7c8db5a6348",objName:"Ops.Gl.TextureEffects.DrawImage_v2",id:"9ead2056-e8e6-4b5c-82bf-3da0a7ba8aba",uiAttribs:{translate:{x:-804,y:580},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"9ead2056-e8e6-4b5c-82bf-3da0a7ba8aba",objOut:"36c6ef55-3873-44ea-a6ee-10f41fe5e271"}]},{name:"blendMode index",value:0},{name:"blendMode",value:"normal"},{name:"amount",links:[{portIn:"amount",portOut:"result",objIn:"9ead2056-e8e6-4b5c-82bf-3da0a7ba8aba",objOut:"253abfbb-6f41-4c3b-b1f8-9782357b5760"}]},{name:"image",links:[{portIn:"image",portOut:"Texture",objIn:"9ead2056-e8e6-4b5c-82bf-3da0a7ba8aba",objOut:"aacca987-8604-459d-b79a-e4caf81c05f0"}]},{name:"removeAlphaSrc",value:!1},{name:"imageAlpha",value:0},{name:"alphaSrc index",value:0},{name:"alphaSrc",value:"alpha channel"},{name:"invert alpha channel",value:!1},{name:"Aspect Ratio",value:!1},{name:"Stretch Axis index",value:0},{name:"Stretch Axis",value:"X"},{name:"Position",value:0},{name:"Crop",value:!1},{name:"flip x",value:!1},{name:"flip y",value:!1},{name:"Transform",value:!1},{name:"Scale X",value:1},{name:"Scale Y",value:1},{name:"Position X",value:0},{name:"Position Y",value:0},{name:"Rotation",value:0},{name:"Clip Repeat",value:!1}],portsOut:[{name:"trigger"}]},{opId:"86565630-2092-4d16-b177-ffb1d4040f4e",objName:"Ops.Gl.Shader.CustomShader",id:"ab3d824b-0ecb-46ce-acc1-433436db2fb4",uiAttribs:{title:"CameraGhost",translate:{x:-756,y:460},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"ab3d824b-0ecb-46ce-acc1-433436db2fb4",objOut:"36c6ef55-3873-44ea-a6ee-10f41fe5e271"}]},{name:"fragment",value:"\n{{MODULES_HEAD}}\n\nUNI sampler2D cam;\nUNI float hue;\n\nIN vec2 texCoord;\n\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nvoid main()\n{\n\n {{MODULE_COLOR}}\n\n \tvec3 raw = abs(texture2D(cam, texCoord).rgb);\n\n \tvec3 shifted = texture2D(cam, texCoord).rgb * 0.5 + vec3(0.5);\n \n if (hue > 0.5){\n shifted = vec3(0.3,0.4,1.0);\n }\n\n float mono = (raw.r + raw.g + raw.b) / 1.0;\n //mono = map(mono,0.0,1.0,0.3,1.0);\n \n // mono = mix(0.0,mono,1.0);\n\n vec4 color = vec4(vec3(shifted),1.0) * mono;\n \n //color = vec4(vec3(mono),1.0);\n\n\toutColor = color;\n \n}"},{name:"vertex",value:"\n{{MODULES_HEAD}}\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nOUT vec2 texCoord;\nOUT vec3 norm;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mMatrix=modelMatrix;\n {{MODULE_VERTEX_POSITION}}\n gl_Position = projMatrix * (viewMatrix*mMatrix) * pos;\n}"},{name:"hue",value:1},{name:"cam",links:[{portIn:"cam",portOut:"Texture",objIn:"ab3d824b-0ecb-46ce-acc1-433436db2fb4",objOut:"96343d31-f564-45cd-bfcc-4a5497b87251"}]}],portsOut:[{name:"trigger"},{name:"Shader"}]},{opId:"a3debb76-7d84-4548-9e7b-24891423dcce",objName:"Ops.Gl.Shader.Shader2Texture",id:"aacca987-8604-459d-b79a-e4caf81c05f0",uiAttribs:{translate:{x:-756,y:520},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Render",links:[{portIn:"Render",portOut:"trigger",objIn:"aacca987-8604-459d-b79a-e4caf81c05f0",objOut:"ab3d824b-0ecb-46ce-acc1-433436db2fb4"}]},{name:"Shader",links:[{portIn:"Shader",portOut:"Shader",objIn:"aacca987-8604-459d-b79a-e4caf81c05f0",objOut:"ab3d824b-0ecb-46ce-acc1-433436db2fb4"}]},{name:"filter index",value:0},{name:"filter",value:"nearest"},{name:"wrap index",value:0},{name:"wrap",value:"clamp to edge"},{name:"Use Viewport Size",value:!0},{name:"Width",value:788},{name:"Height",value:750},{name:"Floating Point",value:!1}],portsOut:[{name:"Next",value:0},{name:"Texture"}]},{opId:"2591c495-fceb-4f6e-937f-11b190c72ee5",objName:"Ops.Boolean.BoolToNumber",id:"cb083778-0eae-4cef-a703-02d653f9ec12",uiAttribs:{translate:{x:924,y:-1040},subPatch:0,notWorkingMsg:null},portsIn:[{name:"bool",links:[{portIn:"bool",portOut:"Value",objIn:"cb083778-0eae-4cef-a703-02d653f9ec12",objOut:"229c4c0f-98d8-4b72-8231-1e6fefee4c05"}]}],portsOut:[{name:"number"}]},{opId:"1bbdae06-fbb2-489b-9bcc-36c9d65bd441",objName:"Ops.Math.Multiply",id:"253abfbb-6f41-4c3b-b1f8-9782357b5760",uiAttribs:{translate:{x:912,y:-880},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"result",objIn:"253abfbb-6f41-4c3b-b1f8-9782357b5760",objOut:"90a69063-8a54-41d4-9e39-5d5f849b8285"}]},{name:"number2",links:[{portIn:"number2",portOut:"number",objIn:"253abfbb-6f41-4c3b-b1f8-9782357b5760",objOut:"cb083778-0eae-4cef-a703-02d653f9ec12"}]}],portsOut:[{name:"result"}]},{opId:"2617b407-60a0-4ff6-b4a7-18136cfa7817",objName:"Ops.Math.MapRange",id:"90a69063-8a54-41d4-9e39-5d5f849b8285",uiAttribs:{translate:{x:984,y:-960},subPatch:0,notWorkingMsg:null},portsIn:[{name:"value",links:[{portIn:"value",portOut:"Result",objIn:"90a69063-8a54-41d4-9e39-5d5f849b8285",objOut:"0daf6f7a-9bd6-40cd-a8fd-303ac2d72ba9"}]},{name:"old min",value:0},{name:"old max",value:1},{name:"new min",value:.5},{name:"new max",value:1},{name:"Easing index",value:0},{name:"Easing",value:"Linear"}],portsOut:[{name:"result"}]},{opId:"54f26f53-f637-44c1-9bfb-a2f2b722e998",objName:"Ops.Gl.TextureEffects.Blur",id:"d34e8334-2ae6-492e-be02-069bf1cab089",uiAttribs:{translate:{x:-804,y:620},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"d34e8334-2ae6-492e-be02-069bf1cab089",objOut:"9ead2056-e8e6-4b5c-82bf-3da0a7ba8aba"}]},{name:"amount",value:.2},{name:"direction index",value:0},{name:"direction",value:"both"},{name:"Fast",value:!0},{name:"mask",value:0}],portsOut:[{name:"trigger",value:0}]},{opId:"5c04608d-1e42-4e36-be00-1be4a81fc309",objName:"Ops.Gl.TextureEffects.ImageCompose",id:"f397a443-97f9-42a5-9f7a-61e59353848f",uiAttribs:{hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null,translate:{x:180,y:-280},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"Triggered",objIn:"f397a443-97f9-42a5-9f7a-61e59353848f",objOut:"e565302a-3604-4094-9ba8-d873763c1bdb"}]},{name:"use viewport size",value:!1},{name:"width",links:[{portIn:"width",portOut:"Result",objIn:"f397a443-97f9-42a5-9f7a-61e59353848f",objOut:"6d9867bf-e7c2-4bac-98e0-19c44b5cac80"}]},{name:"height",links:[{portIn:"height",portOut:"Result",objIn:"f397a443-97f9-42a5-9f7a-61e59353848f",objOut:"69557558-8953-49f1-b1c3-13856ee5f752"}]},{name:"filter index",value:1},{name:"filter",value:"linear"},{name:"wrap index",value:0},{name:"wrap",value:"repeat"},{name:"HDR",value:!0}
72,{name:"Background Alpha",value:1}],portsOut:[{name:"trigger"},{name:"texture_out"},{name:"Aspect Ratio",value:1}]},{opId:"85b0d8e5-f417-4349-aa35-fe45a6698183",objName:"Ops.Gl.TextureEffects.Noise.SimplexNoise",id:"bf6eef42-bda3-457a-bc46-bbc71b8a8b17",uiAttribs:{translate:{x:180,y:-200},subPatch:0,notWorkingMsg:null},portsIn:[{name:"render",links:[{portIn:"render",portOut:"trigger",objIn:"bf6eef42-bda3-457a-bc46-bbc71b8a8b17",objOut:"f397a443-97f9-42a5-9f7a-61e59353848f"}]},{name:"Blend Mode index",value:0},{name:"Blend Mode",value:"normal"},{name:"Amount",value:1},{name:"smoothness",value:1.5},{name:"scale",value:10},{name:"x",value:0},{name:"y",value:0},{name:"time",links:[{portIn:"time",portOut:"result",objIn:"bf6eef42-bda3-457a-bc46-bbc71b8a8b17",objOut:"ec96074a-afee-411f-a111-fa5a11c47a69"}]}],portsOut:[{name:"trigger",value:0}]},{opId:"1bbdae06-fbb2-489b-9bcc-36c9d65bd441",objName:"Ops.Math.Multiply",id:"ec96074a-afee-411f-a111-fa5a11c47a69",uiAttribs:{translate:{x:180,y:-240},subPatch:0,notWorkingMsg:null},portsIn:[{name:"number1",links:[{portIn:"number1",portOut:"Time",objIn:"ec96074a-afee-411f-a111-fa5a11c47a69",objOut:"f214ef72-eef8-4f4c-9c43-02dc7bdf3c91"}]},{name:"number2",value:15}],portsOut:[{name:"result"}]},{opId:"7b1abd02-3aad-4106-9848-7f4c3cfab6a9",objName:"Ops.Boolean.ToggleBoolValue",id:"531d597e-8388-4430-ad64-4c3bef2ce096",uiAttribs:{translate:{x:1056,y:-1400},subPatch:0,notWorkingMsg:null},portsIn:[{name:"in bool",links:[{portIn:"in bool",portOut:"Available",objIn:"531d597e-8388-4430-ad64-4c3bef2ce096",objOut:"e61c32fb-e112-4b4b-aff1-dce4c0051215"}]}],portsOut:[{name:"out bool"}]},{opId:"cc591cc3-ff23-4817-907c-e5be7d5c059d",objName:"Ops.Sidebar.SidebarText_v2",id:"de593143-45e7-4eb7-ab6b-5117124ff8b8",uiAttribs:{title:"Text: Move in fr",translate:{x:948,y:-1360},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"de593143-45e7-4eb7-ab6b-5117124ff8b8",objOut:"af9a829a-a0a9-4b47-9654-1401dbce0fbf"}]},{name:"Text",links:[{portIn:"Text",portOut:"Result",objIn:"de593143-45e7-4eb7-ab6b-5117124ff8b8",objOut:"66a29cbe-fd75-4116-b762-36fb00aa106e"}]},{name:"Id",value:""}],portsOut:[{name:"childs"}]},{opId:"2a7a0c68-f7c9-4249-b19a-d2de5cb4862c",objName:"Ops.String.SwitchString",id:"66a29cbe-fd75-4116-b762-36fb00aa106e",uiAttribs:{translate:{x:1068,y:-1320},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Index",links:[{portIn:"Index",portOut:"number",objIn:"66a29cbe-fd75-4116-b762-36fb00aa106e",objOut:"f8fbc936-bc1c-4815-be57-c804ce2b39da"}]},{name:"String 0",value:"Move in front of the camera to repel particles"},{name:"String 1",value:"No camera detected"},{name:"String 2",value:""},{name:"String 3",value:""},{name:"String 4",value:""},{name:"String 5",value:""},{name:"String 6",value:""},{name:"String 7",value:""},{name:"String 8",value:""},{name:"String 9",value:""}],portsOut:[{name:"Result"}]},{opId:"2591c495-fceb-4f6e-937f-11b190c72ee5",objName:"Ops.Boolean.BoolToNumber",id:"f8fbc936-bc1c-4815-be57-c804ce2b39da",uiAttribs:{translate:{x:1068,y:-1360},subPatch:0,notWorkingMsg:null},portsIn:[{name:"bool",links:[{portIn:"bool",portOut:"out bool",objIn:"f8fbc936-bc1c-4815-be57-c804ce2b39da",objOut:"531d597e-8388-4430-ad64-4c3bef2ce096"}]}],portsOut:[{name:"number"}]},{opId:"2cf4b0a1-b657-405b-8bf9-8555dbd5c231",objName:"Ops.WebAudio.AudioBuffer",id:"30d8ab5a-6852-4d2d-b2c6-d2a68f4926f0",uiAttribs:{title:"ambient",translate:{x:2676,y:-1e3},subPatch:0,notWorkingMsg:null},portsIn:[{name:"URL",value:"assets/submerge.ogg",display:"file"}],portsOut:[{name:"Audio Buffer"},{name:"Finished Loading",value:!0},{name:"Sample Rate",value:48e3},{name:"Length",value:8832801},{name:"Duration",value:184.0166875},{name:"Number of Channels",value:2}]},{opId:"05385277-92fc-4d49-b730-11f9ed5e5c0d",objName:"Ops.WebAudio.AudioBufferPlayer",id:"ea95929d-ce5e-421e-a8e5-caf9deea627a",uiAttribs:{translate:{x:2676,y:-880},subPatch:0,notWorkingMsg:null},portsIn:[{name:"Audio Buffer",links:[{portIn:"Audio Buffer",portOut:"Audio Buffer",objIn:"ea95929d-ce5e-421e-a8e5-caf9deea627a",objOut:"30d8ab5a-6852-4d2d-b2c6-d2a68f4926f0"}]},{name:"Start / Stop",links:[{portIn:"Start / Stop",portOut:"Value",objIn:"ea95929d-ce5e-421e-a8e5-caf9deea627a",objOut:"62c384e2-7f3d-4121-84ec-026d06450b8c"}]},{name:"Start Time",value:0},{name:"Stop Time",value:0}
72,{name:"Offset",value:0},{name:"Autoplay",value:!1},{name:"Loop",value:!0},{name:"Detune",value:0},{name:"Playback Rate",value:1}],portsOut:[{name:"Audio Out"}]},{opId:"29402bba-48ee-4f28-94f0-bdc345e6bb67",objName:"Ops.WebAudio.Gain",id:"7cd5e391-1590-47dd-8656-e3a689a796c1",uiAttribs:{translate:{x:2664,y:-700},subPatch:0,notWorkingMsg:null},portsIn:[{name:"audio in",links:[{portIn:"audio in",portOut:"Audio Out",objIn:"7cd5e391-1590-47dd-8656-e3a689a796c1",objOut:"ea95929d-ce5e-421e-a8e5-caf9deea627a"}]},{name:"gain",value:.6}],portsOut:[{name:"audio out"}]},{opId:"cc591cc3-ff23-4817-907c-e5be7d5c059d",objName:"Ops.Sidebar.SidebarText_v2",id:"f31a0668-200e-420d-af1a-e77a04cadf3a",uiAttribs:{title:"Text: Use your m",translate:{x:684,y:-1600},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"f31a0668-200e-420d-af1a-e77a04cadf3a",objOut:"72077743-5607-4034-8fe0-49b70b3a374b"}]},{name:"Text",value:"Use your mouse to create paths"},{name:"Id",value:""}],portsOut:[{name:"childs"}]},{opId:"cc591cc3-ff23-4817-907c-e5be7d5c059d",objName:"Ops.Sidebar.SidebarText_v2",id:"96d0a57e-6f36-48ed-95e8-44da590d5e02",uiAttribs:{title:"Text: Click and ",translate:{x:936,y:-1520},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"childs",objIn:"96d0a57e-6f36-48ed-95e8-44da590d5e02",objOut:"ada4581a-a35a-4321-8853-f27be45e01ba"}]},{name:"Text",value:"Click and hold the left mouse button to attract particles"},{name:"Id",value:""}],portsOut:[{name:"childs"}]},{opId:"86ea2333-b51c-48ed-94c2-8b7b6e9ff34c",objName:"Ops.Sidebar.Group",id:"af9a829a-a0a9-4b47-9654-1401dbce0fbf",uiAttribs:{title:"Group: Camera",translate:{x:1140,y:-1640},subPatch:0,notWorkingMsg:null},portsIn:[{name:"link",links:[{portIn:"link",portOut:"next",objIn:"af9a829a-a0a9-4b47-9654-1401dbce0fbf",objOut:"ada4581a-a35a-4321-8853-f27be45e01ba"}]},{name:"Text",value:"Camera"},{name:"Default Minimized",value:!1},{name:"Visible",value:!0}],portsOut:[{name:"next"},{name:"childs"}]}],users:[],userOps:[],tags:[],_id:"5e839ea746bbd417b36db906",name:"Painting with Particles v2",userId:"5d3a6396a0d0623c690592ec",created:"2020-03-31T19:48:55.678Z",updated:"2020-04-10T23:12:50.143Z",__v:33,shortId:"KZX8O4",opsHash:"f8b0eb7f10a8b6e8f6880311127fc0744a5da6f2",ui:{viewBox:{x:-111.87602385306911,y:-1899.4416808997476,w:1457.5565428670986,h:1305.959536023097},timeLineLength:20,bookmarks:[],subPatchViewBoxes:[],renderer:{w:788,h:750,s:1}},updatedByUser:"sealex",cachedUsername:"sealex",views:0,cachedNumComments:0,cachedNumFavs:0,statsAdmin:{filenameScreenshots:["_screenshots/screenshot.png","_screenshots/screenshot_1585684233799.png","_screenshots/screenshot_1585684240723.png","_screenshots/screenshot_1585685069519.png","_screenshots/screenshot_1585685071179.png","_screenshots/screenshot_1585685275464.png","_screenshots/screenshot_1585686227826.png","_screenshots/screenshot_1585688891473.png","_screenshots/screenshot_1585688933755.png","_screenshots/screenshot_1585689114316.png","_screenshots/screenshot_1585779252473.png","_screenshots/screenshot_1585779394048.png","_screenshots/screenshot_1585779722681.png","_screenshots/screenshot_1585835499803.png","_screenshots/screenshot_1585934687328.png"],filenameExports:["_exports/cables_Painting_with_Particles_v21.zip","_exports/cables_Painting_with_Particles_v22.zip","_exports/cables_Painting_with_Particles_v23.zip","_exports/cables_Painting_with_Particles_v24.zip","_exports/cables_Painting_with_Particles_v25.zip"],filenameAssets:["pitch_fixed_v2.mp3","pitch_fixed_v2.ogg","submerge.mp3","submerge.ogg"],hasOldScreenshots:!1,hasOldExports:!1,sizeScreenshots:682.3779296875,sizeExports:22337.072265625,sizeAssets:12779.8779296875},exports:9};var CABLES=CABLES||{};CABLES.OPS=CABLES.OPS||{};var Ops=Ops||{};Ops.Gl=Ops.Gl||{},Ops.User=Ops.User||{},Ops.Time=Ops.Time||{},Ops.Math=Ops.Math||{},Ops.Anim=Ops.Anim||{},Ops.Value=Ops.Value||{},Ops.Array=Ops.Array||{},Ops.String=Ops.String||{},Ops.Devices=Ops.Devices||{},Ops.Trigger=Ops.Trigger||{},Ops.Sidebar=Ops.Sidebar||{},Ops.Boolean=Ops.Boolean||{},Ops.Gl.Phong=Ops.Gl.Phong||{},Ops.WebAudio=Ops.WebAudio||{},Ops.Gl.Meshes=Ops.Gl.Meshes||{},Ops.Gl.Shader=Ops.Gl.Shader||{}
72,Ops.Gl.Matrix=Ops.Gl.Matrix||{},Ops.User.sealex=Ops.User.sealex||{},Ops.Gl.Textures=Ops.Gl.Textures||{},Ops.Math.Compare=Ops.Math.Compare||{},Ops.Devices.Mouse=Ops.Devices.Mouse||{},Ops.Devices.Keyboard=Ops.Devices.Keyboard||{},Ops.Gl.TextureEffects=Ops.Gl.TextureEffects||{},Ops.Gl.TextureEffects.Noise=Ops.Gl.TextureEffects.Noise||{},Ops.Gl.MainLoop=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inValue("FPS Limit",0),n=e.outTrigger("trigger"),a=e.outValue("width"),r=e.outValue("height"),o=e.inValueBool("Reduce FPS loading"),i=e.inValueBool("Clear",!0),l=e.inValueBool("ClearAlpha",!0),s=e.inValueBool("Fullscreen Button",!1),u=e.inValueBool("Active",!0),d=e.inValueBool("Hires Displays",!1);e.onAnimFrame=h,d.onChange=function(){d.get()?e.patch.cgl.pixelDensity=window.devicePixelRatio:e.patch.cgl.pixelDensity=1,e.patch.cgl.updateSize(),CABLES.UI&&gui.setLayout()},u.onChange=function(){e.patch.removeOnAnimFrame(e),u.get()?(e.setUiAttrib({extendTitle:""}),e.onAnimFrame=h,e.patch.addOnAnimFrame(e),e.log("adding again!")):e.setUiAttrib({extendTitle:"Inactive"})};var c=e.patch.cgl,b=0,f=0;e.patch.cgl||e.uiAttr({error:"No webgl cgl context"});var p=vec3.create();vec3.set(p,0,0,0);var m=vec3.create();vec3.set(m,0,0,-2),s.onChange=v,setTimeout(v,100);var g=null;function v(){function t(){g&&(g.style.display="block")}if(e.patch.cgl.canvas.addEventListener("mouseleave",function(){g&&(g.style.display="none")}),e.patch.cgl.canvas.addEventListener("mouseenter",t),s.get()){if(!g){g=document.createElement("div");var n=e.patch.cgl.canvas.parentElement;n&&n.appendChild(g),g.addEventListener("mouseenter",t),g.addEventListener("click",function(e){CABLES.UI&&!e.shiftKey?gui.cycleRendererSize():c.fullScreen()})}g.style.padding="10px",g.style.position="absolute",g.style.right="5px",g.style.top="5px",g.style.width="20px",g.style.height="20px",g.style.cursor="pointer",g.style["border-radius"]="40px",g.style.background="#444",g.style["z-index"]="9999",g.style.display="none",g.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 490 490" style="width:20px;height:20px;" xml:space="preserve" width="512px" height="512px"><g><path d="M173.792,301.792L21.333,454.251v-80.917c0-5.891-4.776-10.667-10.667-10.667C4.776,362.667,0,367.442,0,373.333V480 c0,5.891,4.776,10.667,10.667,10.667h106.667c5.891,0,10.667-4.776,10.667-10.667s-4.776-10.667-10.667-10.667H36.416 l152.459-152.459c4.093-4.237,3.975-10.99-0.262-15.083C184.479,297.799,177.926,297.799,173.792,301.792z" fill="#FFFFFF"/><path d="M480,0H373.333c-5.891,0-10.667,4.776-10.667,10.667c0,5.891,4.776,10.667,10.667,10.667h80.917L301.792,173.792 c-4.237,4.093-4.354,10.845-0.262,15.083c4.093,4.237,10.845,4.354,15.083,0.262c0.089-0.086,0.176-0.173,0.262-0.262 L469.333,36.416v80.917c0,5.891,4.776,10.667,10.667,10.667s10.667-4.776,10.667-10.667V10.667C490.667,4.776,485.891,0,480,0z" fill="#FFFFFF"/><path d="M36.416,21.333h80.917c5.891,0,10.667-4.776,10.667-10.667C128,4.776,123.224,0,117.333,0H10.667 C4.776,0,0,4.776,0,10.667v106.667C0,123.224,4.776,128,10.667,128c5.891,0,10.667-4.776,10.667-10.667V36.416l152.459,152.459 c4.237,4.093,10.99,3.975,15.083-0.262c3.992-4.134,3.992-10.687,0-14.82L36.416,21.333z" fill="#FFFFFF"/><path d="M480,362.667c-5.891,0-10.667,4.776-10.667,10.667v80.917L316.875,301.792c-4.237-4.093-10.99-3.976-15.083,0.261 c-3.993,4.134-3.993,10.688,0,14.821l152.459,152.459h-80.917c-5.891,0-10.667,4.776-10.667,10.667s4.776,10.667,10.667,10.667 H480c5.891,0,10.667-4.776,10.667-10.667V373.333C490.667,367.442,485.891,362.667,480,362.667z" fill="#FFFFFF"/></g></svg>'}else g&&(g.style.display="none",g.remove(),g=null)}function h(t){u.get()&&(c.aborted||0===c.canvas.clientWidth||0===c.canvas.clientHeight||(e.patch.loading.getProgress()<1&&o.get()&&(e.patch.config.fpsLimit=5),-1!=c.canvasWidth?(c.canvasWidth==a.get()&&c.canvasHeight==r.get()||(a.set(c.canvasWidth),r.set(c.canvasHeight)),CABLES.now()-f>1e3&&(CGL.fpsReport=CGL.fpsReport||[],e.patch.loading.getProgress()>=1&&0!==f&&CGL.fpsReport.push(b),b=0,f=CABLES.now()),CGL.MESH.lastShader=null,CGL.MESH.lastMesh=null,c.renderStart(c,p,m),i.get()&&(c.gl.clearColor(0,0,0,1),c.gl.clear(c.gl.COLOR_BUFFER_BIT|c.gl.DEPTH_BUFFER_BIT)),n.trigger(),CGL.MESH.lastMesh&&CGL.MESH.lastMesh.unBind(),CGL.Texture.previewTexture&&(CGL.Texture.texturePreviewer||(CGL.Texture.texturePreviewer=new CGL.Texture.texturePreview(c)),CGL.Texture.texturePreviewer.render(CGL.Texture.previewTexture)),c.renderEnd(c),l.get()&&(c.gl.clearColor(1,1,1,1),c.gl.colorMask(!1,!1,!1,!0),c.gl.clear(c.gl.COLOR_BUFFER_BIT),c.gl.colorMask(!0,!0,
72!0,!0)),c.frameStore.phong||(c.frameStore.phong={}),b++):c.setCanvas(e.patch.config.glCanvasId)))}t.onChange=function(){e.patch.config.fpsLimit=t.get()||0},e.onDelete=function(){c.gl.clearColor(0,0,0,0),c.gl.clear(c.gl.COLOR_BUFFER_BIT|c.gl.DEPTH_BUFFER_BIT)},e.patch.loading.setOnFinishedLoading(function(n){e.patch.config.fpsLimit=t.get()})},Ops.Gl.MainLoop.prototype=new CABLES.Op,CABLES.OPS["b0472a1d-db16-4ba6-8787-f300fbdc77bb"]={f:Ops.Gl.MainLoop,objName:"Ops.Gl.MainLoop"},Ops.Trigger.TriggerOnce=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inTriggerButton("Exec"),n=e.inTriggerButton("Reset"),a=e.outTrigger("Next");var r=e.outValue("Was Triggered"),o=!1;e.toWorkPortsNeedToBeLinked(t,a),n.onTriggered=function(){o=!1,r.set(o)},t.onTriggered=function(){o||(o=!0,a.trigger(),r.set(o))}},Ops.Trigger.TriggerOnce.prototype=new CABLES.Op,CABLES.OPS["cf3544e4-e392-432b-89fd-fcfb5c974388"]={f:Ops.Trigger.TriggerOnce,objName:"Ops.Trigger.TriggerOnce"},Ops.Sequence=function(){CABLES.Op.apply(this,arguments);const e=this,t=[],n=[];function a(){for(var e=0;e<n.length;e++)n[e].trigger()}e.inTrigger("exe").onTriggered=a;for(var r=0;r<16;r++)if(n.push(e.outTrigger("trigger "+r)),r<15){var o=e.inTrigger("exe "+r);o.onTriggered=a,t.push(o)}},Ops.Sequence.prototype=new CABLES.Op,CABLES.OPS["a466bc1f-06e9-4595-8849-bffb9fe22f99"]={f:Ops.Sequence,objName:"Ops.Sequence"},Ops.Array.ArrayMath=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inArray("array 0"),n=e.inValueFloat("Number for math",0),a=e.inSwitch("Math function",["+","-","*","/","%","min","max"],"+"),r=e.outArray("Array result"),o=e.outNumber("Array length");var i=[],l=0;a.onChange=n.onChange=m;const s=0,u=1,d=2,c=3,b=4,f=5,p=6;function m(){var t=a.get();"+"===t?l=s:"-"===t?l=u:"*"===t?l=d:"/"===t?l=c:"%"===t?l=b:"min"===t?l=f:"max"===t&&(l=p),g(),e.setUiAttrib({extendTitle:t})}function g(){var e=t.get();if(i.length=0,e){var a=n.get();i.length=e.length;var m=0;if(l===s)for(m=0;m<e.length;m++)i[m]=e[m]+a;else if(l===u)for(m=0;m<e.length;m++)i[m]=e[m]-a;else if(l===d)for(m=0;m<e.length;m++)i[m]=e[m]*a;else if(l===c)for(m=0;m<e.length;m++)i[m]=e[m]/a;else if(l===b)for(m=0;m<e.length;m++)i[m]=e[m]%a;else if(l===f)for(m=0;m<e.length;m++)i[m]=Math.min(e[m],a);else if(l===p)for(m=0;m<e.length;m++)i[m]=Math.max(e[m],a);r.set(null),r.set(i),o.set(i.length)}else o.set(0)}m(),t.onChange=g,g()},Ops.Array.ArrayMath.prototype=new CABLES.Op,CABLES.OPS["c7617717-3114-452f-9625-e4fefd841e88"]={f:Ops.Array.ArrayMath,objName:"Ops.Array.ArrayMath"},Ops.Value.ValueOrAssignment=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.addInPort(new CABLES.Port(e,"Value",CABLES.OP_PORT_TYPE_VALUE)),n=e.addInPort(new CABLES.Port(e,"Default Value",CABLES.OP_PORT_TYPE_VALUE)),a=e.addOutPort(new CABLES.Port(e,"Result",CABLES.OP_PORT_TYPE_VALUE));function r(){t.get()?a.set(t.get()):a.set(n.get())}t.ignoreValueSerialize=!0,t.onChange=r,n.onChange=r},Ops.Value.ValueOrAssignment.prototype=new CABLES.Op,CABLES.OPS["ff9bc6a6-2cb3-4a85-8fd7-c9c61f402869"]={f:Ops.Value.ValueOrAssignment,objName:"Ops.Value.ValueOrAssignment"},Ops.Math.Multiply=function(){CABLES.Op.apply(this,arguments);const e=this.inValueFloat("number1"),t=this.inValueFloat("number2"),n=this.outValue("result");function a(){const a=e.get(),r=t.get();isNaN(a)&&(a=0),isNaN(r)&&(r=0),n.set(a*r)}e.set(1),t.set(2),e.onChange=a,t.onChange=a,a()},Ops.Math.Multiply.prototype=new CABLES.Op,CABLES.OPS["1bbdae06-fbb2-489b-9bcc-36c9d65bd441"]={f:Ops.Math.Multiply,objName:"Ops.Math.Multiply"},Ops.Gl.Shader.CustomShader=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inTrigger("render"),n=e.addInPort(new CABLES.Port(e,"fragment",CABLES.OP_PORT_TYPE_VALUE,{display:"editor",editorSyntax:"glsl"})),a=e.addInPort(new CABLES.Port(e,"vertex",CABLES.OP_PORT_TYPE_VALUE,{display:"editor",editorSyntax:"glsl"})),r=e.outTrigger("trigger"),o=e.outObject("Shader"),i=e.patch.cgl,l=[],s=[];e.toWorkPortsNeedToBeLinked(o);var u=new CGL.Shader(i,"shaderMaterial");u.setModules(["MODULE_VERTEX_POSITION","MODULE_COLOR","MODULE_BEGIN_FRAG"]),e.setPortGroup("Source Code",[n,a]),n.set(CGL.Shader.getDefaultFragmentShader()),a.set(CGL.Shader.getDefaultVertexShader()),u.setModules(["MODULE_VERTEX_POSITION","MODULE_COLOR","MODULE_BEGIN_FRAG"]),n.onChange=c,a.onChange=c,t.onTriggered=function(){d&&m();r.trigger()};var d=!0;function c(){d=!0}function b(e){var t=0;for(t=0;t<l.length;t++)if(l[t].name==e)return!0;for(t=0;t<s.length;t++)if(s[t].name==e)return!0;return!1}e.onLoadedValueSet=function(e){m();for(var t=0;t<l.length;t++)for(var n=0;n<e.portsIn.length;n++)l[t].name==e.portsIn[n].name&&l[t].set(e.portsIn[n].value)},e.init=function(){m()};var f=mat4.create();const p=["modelMatrix","viewMatrix","normalMatrix","mvMatrix","projMatrix","inverseViewMatrix","camPos"];function m(){if(u){d=!1,u.bindTextures=function(){for(var e=0;e<s.length;e++)s[e]&&s[e].get()&&s[e].get().tex&&i.setTexture(0+e+3,s[e].get().tex)}.bind(this),u.setSource(a.get(),n.get()),u.compile();var t=i.gl.getProgramParameter(u.getProgram(),i.gl.ACTIVE_UNIFORMS),r=0,c=0;for(r=0;r<t;r++){var m=i.gl.getActiveUniform(u.getProgram(),r);if(!b(m.name)&&0!=m.name.indexOf("mod")&&-1==p.indexOf(m.name))if(m.type==i.gl.FLOAT){var g=null;m.size>1?((g=e.inArray(m.name,[])).uniform=new CGL.Uniform(u,"f[]",m.name,new Float32Array(22)),g.onChange=function(e){e.uniform.needsUpdate=!0,e.uniform.setValue(new Float32Array(e.get()))}
72):((g=e.inValue(m.name,0)).uniform=new CGL.Uniform(u,"f",m.name,g),g.onChange=function(e){e.uniform.needsUpdate=!0,e.uniform.setValue(e.get())}),l.push(g)}else if(m.type==i.gl.FLOAT_MAT4){var v=e.inArray(m.name);v.onChange=function(e){e.get()&&e.isLinked()&&(mat4.copy(f,e.get()),e.uniform.needsUpdate=!0,e.uniform.setValue(f))},l.push(v),v.uniform=new CGL.Uniform(u,"m4",m.name,mat4.create())}else if(m.type==i.gl.SAMPLER_2D){var h=e.inObject(m.name);h.uniform=new CGL.Uniform(u,"t",m.name,3+c),s.push(h),c++}else console.log("unsupported uniform type",m.type,m)}for(r=0;r<l.length;r++)l[r].uniform.needsUpdate=!0;CABLES.UI&&gui.patch().showOpParams(e),o.set(null),o.set(u)}}m()},Ops.Gl.Shader.CustomShader.prototype=new CABLES.Op,CABLES.OPS["86565630-2092-4d16-b177-ffb1d4040f4e"]={f:Ops.Gl.Shader.CustomShader,objName:"Ops.Gl.Shader.CustomShader"},Ops.Gl.Textures.CopyTexture=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inTrigger("render"),n=e.inTexture("Texture"),a=e.inValueBool("use original size"),r=e.inValueInt("width"),o=e.inValueInt("height"),i=e.inSwitch("filter",["nearest","linear","mipmap"]),l=e.inValueSelect("wrap",["clamp to edge","repeat","mirrored repeat"]),s=e.inValueBool("HDR"),u=e.outTrigger("trigger"),d=e.outTexture("texture_out"),c=e.outValue("Aspect Ratio");d.set(null);var b=e.patch.cgl,f=null,p=null,m=8,g=8,v=[0,0,0,0],h=!0;e.setPortGroup("Size",[a,r,o]);var x=new CGL.Shader(b,"imgcompose bg");x.setSource(x.getDefaultVertexShader(),"UNI float a;\nUNI sampler2D tex;\nIN vec2 texCoord;\n\nvoid main()\n{\n vec4 col=texture(tex,texCoord);\n outColor= col;\n}");new CGL.Uniform(x,"t","tex",0);var I=CGL.Texture.FILTER_LINEAR,O=CGL.Texture.WRAP_CLAMP_TO_EDGE;function A(){f&&f.delete(),p&&p.delete(),f=new CGL.TextureEffect(b,{isFloatingPointTexture:s.get()}),p=new CGL.Texture(b,{name:"copytexture",isFloatingPointTexture:s.get(),filter:I,wrap:O,width:Math.floor(r.get()),height:Math.floor(o.get())}),f.setSourceTexture(p),d.set(null),h=!1}function T(){f||A(),n.get()&&(a.get()?(m=n.get().width,g=n.get().height):(m=Math.floor(r.get()),g=Math.floor(o.get())),m==p.width&&g==p.height||0===m||0===g||(o.set(g),r.set(m),p.filter=I,p.setSize(m,g),c.set(m/g),f.setSourceTexture(p)),d.get()&&(d.get().isPowerOfTwo()?e.uiAttribs.hint&&e.uiAttr({hint:null,warning:null}):e.uiAttribs.hint||e.uiAttr({hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null})))}function S(){a.get()?(r.setUiAttribs({greyout:!0}),o.setUiAttribs({greyout:!0})):(r.setUiAttribs({greyout:!1}),o.setUiAttribs({greyout:!1}))}s.onChange=function(){h=!0},a.onChange=function(){S(),a.get()?(r.onChange=null,o.onChange=null):(r.onChange=T,o.onChange=T),T()};var C=null;l.set("clamp to edge"),l.onChange=function(){"repeat"==l.get()&&(O=CGL.Texture.WRAP_REPEAT),"mirrored repeat"==l.get()&&(O=CGL.Texture.WRAP_MIRRORED_REPEAT),"clamp to edge"==l.get()&&(O=CGL.Texture.WRAP_CLAMP_TO_EDGE),h=!0,T()},i.set("linear"),i.onChange=function(){"nearest"==i.get()?I=CGL.Texture.FILTER_NEAREST:"linear"==i.get()?I=CGL.Texture.FILTER_LINEAR:"mipmap"==i.get()&&(I=CGL.Texture.FILTER_MIPMAP),h=!0,T()},a.set(!0),t.onTriggered=function(){f&&!h&&C==n.get()||A();var e=b.getViewPort();if(v[0]=e[0],v[1]=e[1],v[2]=e[2],v[3]=e[3],T(),n.get()){C=n.get();var t=b.currentTextureEffect;b.currentTextureEffect=f,f.setSourceTexture(p),f.startEffect(),b.setShader(x),b.currentTextureEffect.bind(),b.setTexture(0,n.get().tex),b.currentTextureEffect.finish(),b.setPreviousShader(),d.set(f.getCurrentSourceTexture()),f.endEffect(),b.setViewPort(v[0],v[1],v[2],v[3]),b.currentTextureEffect=t,u.trigger()}},r.set(640),o.set(360),S()},Ops.Gl.Textures.CopyTexture.prototype=new CABLES.Op,CABLES.OPS["18a6d1f4-a7f8-4a3e-ab1d-0c2d2efe3861"]={f:Ops.Gl.Textures.CopyTexture,objName:"Ops.Gl.Textures.CopyTexture"},Ops.Gl.Shader.Shader2Texture=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inTrigger("Render"),n=e.inObject("Shader"),a=e.inValueSelect("filter",["nearest","linear","mipmap"]),r=e.inValueSelect("wrap",["clamp to edge","repeat","mirrored repeat"],"clamp to edge"),o=e.inValueBool("Use Viewport Size",!0),i=e.inValueInt("Width",512),l=e.inValueInt("Height",512),s=e.inValueBool("Floating Point",!1),u=e.outTrigger("Next"),d=e.outTexture("Texture"),c=e.patch.cgl;var b=[0,0,0,0];i.onChange=l.onChange=s.onChange=o.onChange=a.onChange=r.onChange=function(){p=!0};
72var f=null,p=!0,m=CGL.MESHES.getSimpleRect(c,"shader2texture rect");function g(){p=!1,f&&f.delete(),f=null;var e=i.get(),t=l.get(),n=CGL.Texture.FILTER_NEAREST;"linear"==a.get()?n=CGL.Texture.FILTER_LINEAR:"mipmap"==a.get()&&(n=CGL.Texture.FILTER_MIPMAP);var u=CGL.Texture.WRAP_CLAMP_TO_EDGE;"repeat"==r.get()&&(u=CGL.Texture.WRAP_REPEAT),"mirrored repeat"==r.get()&&(u=CGL.Texture.WRAP_MIRRORED_REPEAT),o.get()?(i.setUiAttribs({greyout:!0}),l.setUiAttribs({greyout:!0}),e=c.getViewPort()[2],t=c.getViewPort()[3],i.set(e),l.set(t)):i.uiAttribs.hidePort&&(i.setUiAttribs({greyout:!1}),l.setUiAttribs({greyout:!1})),f=c.glVersion>=2?new CGL.Framebuffer2(c,e,t,{isFloatingPointTexture:s.get(),multisampling:!1,wrap:u,filter:n,depth:!0,multisamplingSamples:0,clear:!0}):new CGL.Framebuffer(c,i.get(),l.get(),{isFloatingPointTexture:s.get(),filter:n,wrap:u})}e.toWorkPortsNeedToBeLinked(n),a.set("nearest"),t.onTriggered=function(){var e=c.getViewPort(),t=n.get();t?(f&&!p||g(),o.get()&&f&&(e[2]!=f.getTextureColor().width||e[3]!=f.getTextureColor().height)&&g(),b[0]=e[0],b[1]=e[1],b[2]=e[2],b[3]=e[3],f.renderStart(c),c.pushPMatrix(),mat4.identity(c.pMatrix),c.pushViewMatrix(),mat4.identity(c.vMatrix),c.pushModelMatrix(),mat4.identity(c.mMatrix),c.setShader(n.get()),t.bindTextures&&t.bindTextures(),m.render(n.get()),c.popPMatrix(),c.popModelMatrix(),c.popViewMatrix(),f.renderEnd(c),d.set(f.getTextureColor()),c.setPreviousShader(),c.gl.viewport(b[0],b[1],b[2],b[3]),u.trigger()):d.set(null)}},Ops.Gl.Shader.Shader2Texture.prototype=new CABLES.Op,CABLES.OPS["a3debb76-7d84-4548-9e7b-24891423dcce"]={f:Ops.Gl.Shader.Shader2Texture,objName:"Ops.Gl.Shader.Shader2Texture"},Ops.Devices.Keyboard.KeyPressLearn=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inValueInt("key code"),n=e.inValueBool("canvas only"),a=e.inValueSelect("Mod Key",["none","alt"],"none"),r=e.inValueBool("Enabled",!0),o=e.inValueBool("Prevent Default"),i=e.inTriggerButton("learn"),l=e.outTrigger("on press"),s=e.outTrigger("on release"),u=e.outValue("Pressed",!1);const d=e.patch.cgl;var c=!1;function b(n){c?(t.set(n.keyCode),CABLES.UI&&gui.patch().showOpParams(e),c=!1,m(),p()):n.keyCode==t.get()&&("alt"==a.get()?!0===n.altKey&&
72(l.trigger(),u.set(!0),o.get()&&n.preventDefault()):(l.trigger(),u.set(!0),o.get()&&n.preventDefault()))}function f(e){e.keyCode==t.get()&&(s.trigger(),u.set(!1))}function p(){!0===n.get()?g():v()}function m(){document.removeEventListener("keydown",b,!1),document.removeEventListener("keyup",f,!1),d.canvas.removeEventListener("keydown",b,!1),d.canvas.removeEventListener("keyup",f,!1),u.set(!1)}function g(){d.canvas.addEventListener("keydown",b,!1),d.canvas.addEventListener("keyup",f,!1)}function v(){document.addEventListener("keydown",b,!1),document.addEventListener("keyup",f,!1)}e.onDelete=function(){d.canvas.removeEventListener("keyup",f,!1),d.canvas.removeEventListener("keydown",b,!1),document.removeEventListener("keyup",f,!1),document.removeEventListener("keydown",b,!1)},i.onTriggered=function(){c=!0,v(),setTimeout(function(){c=!1,m(),p()},3e3)},r.onChange=function(){r.get()?p():m()},n.onChange=function(){m(),p()},n.set(!0),g()},Ops.Devices.Keyboard.KeyPressLearn.prototype=new CABLES.Op,CABLES.OPS["f069c0db-4051-4eae-989e-6ef7953787fd"]={f:Ops.Devices.Keyboard.KeyPressLearn,objName:"Ops.Devices.Keyboard.KeyPressLearn"},Ops.Gl.Meshes.Sphere_v2=function(){CABLES.Op.apply(this,arguments);const e=this,t=2*Math.PI,n=e.patch.cgl,a=e.inTrigger("render"),r=e.inValue("radius",1),o=e.inValue("stacks",32),i=e.inValue("slices",32),l=e.inValueSlider("Filloffset",1),s=e.inValueBool("Render",!0),u=e.outTrigger("trigger"),d=e.outObject("geometry"),c=vec3.fromValues(0,1,0),b=vec3.fromValues(1,0,0);var f,p=new CGL.Geometry("Sphere"),m=vec3.create(),g=vec3.create(),v=!0;a.onTriggered=function(){v&&function(){const e=Math.max(o.get(),2),a=Math.max(i.get(),3),s=Math.min(Math.max(l.get()*e,1),e),u=r.get();var h,x,I,O,A,T,S,C,E,y,M,L=[],N=[],j=[],P=[],w=[],_=[];for(y=S=0;y<e+1;y++){for(E=(y/e-.5)*Math.PI,x=Math.sin(E),T=Math.cos(E),M=0;M<a+1;M++)C=M/a*t,h=Math.cos(C)*T,I=Math.sin(C)*T,L.push(h*u,x*u,I*u),N.push(M/a,y/(e+1)),O=Math.sqrt(h*h+x*x+I*I),j.push(m[0]=h/O,m[1]=x/O,m[2]=I/O),A=x==O?b:c,vec3.cross(g,m,A),vec3.normalize(g,g),Array.prototype.push.apply(P,g),vec3.cross(g,g,m),Array.prototype.push.apply(w,g);if(!(0==y||y>s)){for(M=0;M<a;M++,S++)_.push(S,S+1,S+a+1,S+1,S+a+2,S+a+1);S++}}p.clear(),p.vertices=L,p.texCoords=N,p.vertexNormals=j,p.tangents=P,p.biTangents=w,p.verticesIndices=_,d.set(null),d.set(p),f?f.setGeom(p):f=new CGL.Mesh(n,p),v=!1}(),s.get()&&f.render(n.getShader()),u.trigger()},o.onChange=i.onChange=l.onChange=r.onChange=function(){v=!0},e.onDelete=function(){f&&f.dispose()}},Ops.Gl.Meshes.Sphere_v2.prototype=new CABLES.Op,CABLES.OPS["450b4d68-2278-4d9f-9849-0abdfa37ef69"]={f:Ops.Gl.Meshes.Sphere_v2,objName:"Ops.Gl.Meshes.Sphere_v2"},Ops.Gl.TextureEffects.ImageCompose=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inTrigger("render"),n=e.inBool("use viewport size"),a=e.inValueInt("width"),r=e.inValueInt("height"),o=e.inSwitch("filter",["nearest","linear","mipmap"],"linear"),i=e.inValueSelect("wrap",["clamp to edge","repeat","mirrored repeat"]),l=e.inValueBool("HDR"),s=e.outTrigger("trigger"),u=e.outTexture("texture_out"),d=e.inValueSlider("Background Alpha",1),c=e.outValue("Aspect Ratio");e.setPortGroup("Texture Size",[n,a,r]),e.setPortGroup("Texture Settings",[i,o,l]);const b=e.patch.cgl;u.set(CGL.Texture.getEmptyTexture(b));var f=null,p=null,m=8,g=8,v=[0,0,0,0],h=!0,x="".endl()+"uniform float a;".endl()+"void main()".endl()+"{".endl()+" outColor= vec4(0.0,0.0,0.0,a);".endl()+"}",I=new CGL.Shader(b,"imgcompose bg");I.setSource(I.getDefaultVertexShader(),x);new CGL.Uniform(I,"f","a",d);var O=CGL.Texture.FILTER_LINEAR,A=CGL.Texture.WRAP_CLAMP_TO_EDGE;function T(){f&&f.delete(),p&&p.delete(),f=new CGL.TextureEffect(b,{isFloatingPointTexture:l.get()}),p=new CGL.Texture(b,{name:"image compose",isFloatingPointTexture:l.get(),filter:O,wrap:A,width:Math.ceil(a.get()),height:Math.ceil(r.get())}),f.setSourceTexture(p),u.set(CGL.Texture.getEmptyTexture(b)),h=!1}function S(){f||T(),n.get()?(m=b.getViewPort()[2],g=b.getViewPort()[3]):(m=Math.ceil(a.get()),g=Math.ceil(r.get())),m==p.width&&g==p.height||0===m||0===g||(r.set(g),a.set(m),p.setSize(m,g),c.set(m/g),f.setSourceTexture(p),u.set(CGL.Texture.getEmptyTexture(b)),u.set(p)),u.get()&&(u.get().isPowerOfTwo()?e.uiAttribs.hint&&e.uiAttr({hint:null,warning:null}):e.uiAttribs.hint||e.uiAttr({hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null}))}function C(){n.get()?(a.setUiAttribs({greyout:!0}),r.setUiAttribs({greyout:!0})):(a.setUiAttribs({greyout:!1}),r.setUiAttribs({greyout:!1}))}l.onChange=function(){h=!0},n.onChange=function(){C(),n.get()?(a.onChange=null,r.onChange=null):(a.onChange=S,r.onCh
72ange=S),S()},e.preRender=function(){E(),I.bind()};var E=function(){f&&!h||T();var e=b.getViewPort();v[0]=e[0],v[1]=e[1],v[2]=e[2],v[3]=e[3],b.gl.blendFunc(b.gl.SRC_ALPHA,b.gl.ONE_MINUS_SRC_ALPHA),S(),b.currentTextureEffect=f,f.setSourceTexture(p),f.startEffect(),b.setShader(I),b.currentTextureEffect.bind(),b.setTexture(0,b.currentTextureEffect.getCurrentSourceTexture().tex),b.currentTextureEffect.finish(),b.setPreviousShader(),s.trigger(),u.set(f.getCurrentSourceTexture()),f.endEffect(),b.setViewPort(v[0],v[1],v[2],v[3]),b.gl.blendFunc(b.gl.SRC_ALPHA,b.gl.ONE_MINUS_SRC_ALPHA),b.currentTextureEffect=null};function y(){"repeat"==i.get()&&(A=CGL.Texture.WRAP_REPEAT),"mirrored repeat"==i.get()&&(A=CGL.Texture.WRAP_MIRRORED_REPEAT),"clamp to edge"==i.get()&&(A=CGL.Texture.WRAP_CLAMP_TO_EDGE),h=!0,S()}function M(){"nearest"==o.get()&&(O=CGL.Texture.FILTER_NEAREST),"linear"==o.get()&&(O=CGL.Texture.FILTER_LINEAR),"mipmap"==o.get()&&(O=CGL.Texture.FILTER_MIPMAP),h=!0,S()}i.set("repeat"),i.onChange=y,o.set("linear"),o.onChange=M,n.set(!0),t.onTriggered=E,e.preRender=E,a.set(640),r.set(360),M(),y(),C()},Ops.Gl.TextureEffects.ImageCompose.prototype=new CABLES.Op,CABLES.OPS["5c04608d-1e42-4e36-be00-1be4a81fc309"]={f:Ops.Gl.TextureEffects.ImageCompose,objName:"Ops.Gl.TextureEffects.ImageCompose"},Ops.Gl.TextureEffects.Noise.SimplexNoise=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inTrigger("render"),n=CGL.TextureEffect.AddBlendSelect(e,"Blend Mode","normal"),a=e.inValueSlider("Amount",1),r=e.inValue("smoothness",1),o=e.inValue("scale",1),i=e.outTrigger("trigger"),l=e.inValue("x"),s=e.inValue("y"),u=e.inValue("time",.314),d=e.patch.cgl,c=new CGL.Shader(d);c.setSource(c.getDefaultVertexShader(),"IN vec2 texCoord;\nUNI sampler2D tex;\nUNI float amount;
72\nUNI float smoothness;\nUNI float scale;\nUNI float seed;\nUNI float x;\nUNI float y;\nUNI float time;\n\n{{CGL.BLENDMODES}}\n\nvoid FAST32_hash_3D( vec3 gridcell,\n vec3 v1_mask, // user definable v1 and v2. ( 0s and 1s )\n vec3 v2_mask,\n out vec4 hash_0,\n out vec4 hash_1,\n out vec4 hash_2 ) // generates 3 random numbers for each of the 4 3D cell corners. cell corners: v0=0,0,0 v3=1,1,1 the other two are user definable\n{\n // gridcell is assumed to be an integer coordinate\n\n // TODO: these constants need tweaked to find the best possible noise.\n // probably requires some kind of brute force computational searching or something....\n const vec2 OFFSET = vec2( 50.0, 161.0 );\n const float DOMAIN = 69.0;\n const vec3 SOMELARGEFLOATS = vec3( 635.298681, 682.357502, 668.926525 );\n const vec3 ZINC = vec3( 48.500388, 65.294118, 63.934599 );\n\n // truncate the domain\n gridcell.xyz = gridcell.xyz - floor(gridcell.xyz * ( 1.0 / DOMAIN )) * DOMAIN;\n vec3 gridcell_inc1 = step( gridcell, vec3( DOMAIN - 1.5 ) ) * ( gridcell + 1.0 );\n\n // compute x*x*y*y for the 4 corners\n vec4 P = vec4( gridcell.xy, gridcell_inc1.xy ) + OFFSET.xyxy;\n P *= P;\n vec4 V1xy_V2xy = mix( P.xyxy, P.zwzw, vec4( v1_mask.xy, v2_mask.xy ) ); // appl y mask for v1 and v2\n P = vec4( P.x, V1xy_V2xy.xz, P.z ) * vec4( P.y, V1xy_V2xy.yw, P.w );\n\n // get the lowz and highz mods\n vec3 lowz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + gridcell.zzz * ZINC.xyz ) );\n vec3 highz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + gridcell_inc1.zzz * ZINC.xyz ) );\n\n // appl mask for v1 and v2 mod values\n v1_mask = ( v1_mask.z < 0.5 ) ? lowz_mods : highz_mods;\n v2_mask = ( v2_mask.z < 0.5 ) ? lowz_mods : highz_mods;\n\n // compute the final hash\n hash_0 = fract( P * vec4( lowz_mods.x, v1_mask.x, v2_mask.x, highz_mods.x ) );\n hash_1 = fract( P * vec4( lowz_mods.y, v1_mask.y, v2_mask.y, highz_mods.y ) );\n hash_2 = fract( P * vec4( lowz_mods.z, v1_mask.z, v2_mask.z, highz_mods.z ) );\n}\n\n\n//\n// Given an arbitrary 3D point this calculates the 4 vectors from the corners of the simplex pyramid to the point\n// It also returns the integer grid index information for the corners\n//\nvoid Simplex3D_GetCornerVectors( vec3 P, // input point\n out vec3 Pi, // integer grid index for the origin\n out vec3 Pi_1, // offsets for the 2nd and 3rd corners. ( the 4th = Pi + 1.0 )\n out vec3 Pi_2,\n out vec4 v1234_x, // vectors from the 4 corners to the intput point\n out vec4 v1234_y,\n out vec4 v1234_z )\n{\n //\n // Simplex math from Stefan Gustavsons and Ian McEwans work at...\n // http://github.com/ashima/webgl-noise\n //\n\n // simplex math constants\n const float SKEWFACTOR = 1.0/3.0;\n const float UNSKEWFACTOR = 1.0/6.0;\n const float SIMPLEX_CORNER_POS = 0.5;\n const float SIMPLEX_PYRAMID_HEIGHT = 0.70710678118654752440084436210485; // sqrt( 0.5 ) height of simplex pyramid.\n\n P *= SIMPLEX_PYRAMID_HEIGHT; // scale space so we can have an approx feature size of 1.0 ( optional )\n\n // Find the vectors to the corners of our simplex pyramid\n Pi = floor( P + dot( P, vec3( SKEWFACTOR) ) );\n vec3 x0 = P - Pi + dot(Pi, vec3( UNSKEWFACTOR ) );\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n Pi_1 = min( g.xyz, l.zxy );\n Pi_2 = max( g.xyz, l.zxy );\n vec3 x1 = x0 - Pi_1 + UNSKEWFACTOR;\n vec3 x2 = x0 - Pi_2 + SKEWFACTOR;\n vec3 x3 = x0 - SIMPLEX_CORNER_POS;\n\n // pack them into a parallel-friendly arrangement\n v1234_x = vec4( x0.x, x1.x, x2.x, x3.x );\n v1234_y = vec4( x0.y, x1.y, x2.y, x3.y );\n v1234_z = vec4( x0.z, x1.z, x2.z, x3.z );\n}
72\n\n//\n// Calculate the weights for the 3D simplex surflet\n//\nvec4 Simplex3D_GetSurfletWeights( vec4 v1234_x,\n vec4 v1234_y,\n vec4 v1234_z )\n{\n // perlins original implementation uses the surlet falloff formula of (0.6-x*x)^4.\n // This is buggy as it can cause discontinuities along simplex faces. (0.5-x*x)^3 solves this and gives an almost identical curve\n\n // evaluate surflet. f(x)=(0.5-x*x)^3\n vec4 surflet_weights = v1234_x * v1234_x + v1234_y * v1234_y + v1234_z * v1234_z;\n surflet_weights = max(0.5 - surflet_weights, 0.0); // 0.5 here represents the closest distance (squared) of any simplex pyramid corner to any of its planes. ie, SIMPLEX_PYRAMID_HEIGHT^2\n return surflet_weights*surflet_weights*surflet_weights;\n}\n\n\n\n//\n// SimplexPerlin3D ( simplex gradient noise )\n// Perlin noise over a simplex (tetrahedron) grid\n// Return value range of -1.0->1.0\n// http://briansharpe.files.wordpress.com/2012/01/simplexperlinsample.jpg\n//\n// Implementation originally based off Stefan Gustavsons and Ian McEwans work at...\n// http://github.com/ashima/webgl-noise\n//\nfloat SimplexPerlin3D(vec3 P)\n{\n // calculate the simplex vector and index math\n vec3 Pi;\n vec3 Pi_1;\n vec3 Pi_2;\n vec4 v1234_x;\n vec4 v1234_y;\n vec4 v1234_z;\n Simplex3D_GetCornerVectors( P, Pi, Pi_1, Pi_2, v1234_x, v1234_y, v1234_z );\n\n // generate the random vectors\n // ( various hashing methods listed in order of speed )\n vec4 hash_0;\n vec4 hash_1;\n vec4 hash_2;\n FAST32_hash_3D( Pi, Pi_1, Pi_2, hash_0, hash_1, hash_2 );\n //SGPP_hash_3D( Pi, Pi_1, Pi_2, hash_0, hash_1, hash_2 );\n hash_0 -= 0.49999;\n hash_1 -= 0.49999;\n hash_2 -= 0.49999;\n\n // evaluate gradients\n vec4 grad_results = inversesqrt( hash_0 * hash_0 + hash_1 * hash_1 + hash_2 * hash_2 ) * ( hash_0 * v1234_x + hash_1 * v1234_y + hash_2 * v1234_z );\n\n // Normalization factor to scale the final result to a strict 1.0->-1.0 range\n // x = sqrt( 0.75 ) * 0.5\n // NF = 1.0 / ( x * ( ( 0.5 * x*x ) ^ 3 ) * 2.0 )\n // http://briansharpe.wordpress.com/2012/01/13/simplex-noise/#comment-36\n float FINAL_NORMALIZATION = 37.837227241611314102871574478976*smoothness;\n\n // sum with the surflet and return\n return dot( Simplex3D_GetSurfletWeights( v1234_x, v1234_y, v1234_z ), grad_results ) * FINAL_NORMALIZATION;\n}\n\nvoid main()\n{\n\n vec2 p=vec2(texCoord.x-0.5,texCoord.y-0.5);\n p=p*scale;\n\n p=vec2(p.x+0.5-x,p.y+0.5-y);\n\n float v=SimplexPerlin3D(vec3(p.x,p.y,time))*0.5+0.5;\n\n //blend section\n vec4 col=vec4(v,v,v,1.0);\n\n vec4 base=texture(tex,texCoord);\n\n outColor=cgl_blend(base,col,amount);\n}");new CGL.Uniform(c,"t","tex",0),new CGL.Uniform(c,"f","amount",a),new CGL.Uniform(c,"f","smoothness",r),new CGL.Uniform(c,"f","scale",o),new CGL.Uniform(c,"f","x",l),new CGL.Uniform(c,"f","y",s),new CGL.Uniform(c,"f","time",u);CGL.TextureEffect.setupBlending(e,c,n,a),t.onTriggered=function(){CGL.TextureEffect.checkOpInEffect(e)&&(d.setShader(c),d.currentTextureEffect.bind(),d.setTexture(0,d.currentTextureEffect.getCurrentSourceTexture().tex),d.currentTextureEffect.finish(),d.setPreviousShader(),i.trigger())}},Ops.Gl.TextureEffects.Noise.SimplexNoise.prototype=new CABLES.Op,CABLES.OPS["85b0d8e5-f417-4349-aa35-fe45a6698183"]={f:Ops.Gl.TextureEffects.Noise.SimplexNoise,objName:"Ops.Gl.TextureEffects.Noise.SimplexNoise"},Ops.Anim.Timer=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inValueBool("Play",!0),n=e.inTriggerButton("Reset"),a=e.outValue("Time"),r=e.inValue("Speed",1),o=new CABLES.Timer;
72function i(){t.get()?(o.play(),e.patch.addOnAnimFrame(e)):(o.pause(),e.patch.removeOnAnimFrame(e))}t.onChange=i,i(),n.onTriggered=function(){o.setTime(0),a.set(0)},e.onAnimFrame=function(){o.update(),a.set(o.get()*r.get())}},Ops.Anim.Timer.prototype=new CABLES.Op,CABLES.OPS["65ae3c2e-90d7-48fe-93df-30245f0bcf34"]={f:Ops.Anim.Timer,objName:"Ops.Anim.Timer"},Ops.Gl.MeshInstancer_v3=function(){CABLES.Op.apply(this,arguments);const e=this,t="col.xyz *= frag_instColor.xyz;\ncol.a = frag_instColor.a;",n="#ifdef INSTANCING\n mMatrix*=instMat;\n pos.xyz*=MOD_scale;\n frag_instColor = instColor;\n#endif\n",a="#ifdef INSTANCING\n IN vec4 frag_instColor;\n#endif",r="UNI float do_instancing;\nUNI float MOD_scale;\n\n#ifdef INSTANCING\n IN mat4 instMat;\n IN vec4 instColor;\n OUT mat4 instModelMat;\n OUT vec4 frag_instColor;\n#endif",o=e.inTrigger("exe"),i=e.inObject("geom"),l=e.inValue("Scale",1),s=e.inValueBool("Limit Instances",!1),u=e.inValueInt("Limit",100),d=e.inArray("positions"),c=e.inArray("Scale Array"),b=e.inArray("Rotations"),f=e.inArray("Colors"),p=e.outTrigger("Trigger Out"),m=e.outValue("Num"),g=r,v=n,h=a,x=t,I=e.patch.cgl;i.ignoreValueSerialize=!0;var O=null,A=null,T=null,S=null,C=!0,E=0,y=null;e.setPortGroup("Limit Number of Instances",[u,s]),e.setPortGroup("Parameters",[c,b,d]),e.toWorkPortsNeedToBeLinked(i),s.onChange=w,o.onTriggered=function(){if(!T)return;C&&function(){if(!T)return;var e=d.get();e||(e=[0,0,0]);E=Math.floor(e.length/3);var t=f.get();y!=t&&null!=t&&(j(),y=t);var n=c.get();M.length!=16*E&&(M=new Float32Array(16*E));L.length!=4*E&&(L=new Float32Array(4*E));const a=b.get();for(var r=0;r<E;r++){mat4.identity(N),mat4.translate(N,N,[e[3*r],e[3*r+1],e[3*r+2]]),a&&(mat4.rotateX(N,N,a[3*r+0]*CGL.DEG2RAD),mat4.rotateY(N,N,a[3*r+1]*CGL.DEG2RAD),mat4.rotateZ(N,N,a[3*r+2]*CGL.DEG2RAD)),t&&(L[4*r+0]=t[4*r+0],L[4*r+1]=t[4*r+1],L[4*r+2]=t[4*r+2],L[4*r+3]=t[4*r+3]),n&&n.length>r?mat4.scale(N,N,[n[3*r],n[3*r+1],n[3*r+2]]):mat4.scale(N,N,[1,1,1]);for(var o=0;o<16;o++)M[16*r+o]=N[o]}T.numInstances=E,T.addAttribute("instMat",M,16),T.addAttribute("instColor",L,4,{instanced:!0}),C=!1}();if(C)return;if(M.length<=1)return;I.getShader()&&I.getShader()!=S&&(j(),(S=I.getShader()).hasDefine("INSTANCING")||(O=S.addModule({name:"MODULE_VERTEX_POSITION",title:e.objName,priority:-2,srcHeadVert:g,srcBodyVert:v}),f.get()&&(A=S.addModule({name:"MODULE_COLOR",priority:-2,title:e.objName,srcHeadFrag:h,srcBodyFrag:x})),S.define("INSTANCING"),l.uniform=new CGL.Uniform(S,"f",O.prefix+"scale",l)));s.get()?T.numInstances=Math.min(E,u.get()):T.numInstances=E;m.set(T.numInstances),T.numInstances>0&&T.render(S);p.trigger()},o.onLinkChanged=function(){o.isLinked()||j()};var M=new Float32Array(1),L=new Float32Array(1),N=mat4.create();function j(){S&&O&&(S.removeDefine("INSTANCING"),S.removeModule(O),S.removeModule(A),S=null)}function P(){C=!0}function w(){s.get()?u.setUiAttribs({hidePort:!1,greyout:!1}):u.setUiAttribs({hidePort:!0,greyout:!0})}w(),b.onChange=f.onChange=d.onChange=c.onChange=P,i.onChange=function(){T&&T.dispose(),i.get()?(T=new CGL.Mesh(I,i.get()),P()):T=null}},Ops.Gl.MeshInstancer_v3.prototype=new CABLES.Op,CABLES.OPS["322d8c8d-851b-481d-9bee-ec1cf7d57a35"]={f:Ops.Gl.MeshInstancer_v3,objName:"Ops.Gl.MeshInstancer_v3"},Ops.User.sealex.TextureToPointsRGBv2=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.patch.cgl,n=e.inTriggerButton("update"),a=e.inValueInt("Num Points",2e3),r=(e.inValueFloat("Seed",1),e.inSwitch("Z Position",["None","Red","Green","Blue","Alpha"],"Red"),e.inValueFloat("Z Multiply",1),e.inObject("texture")),o=e.outTrigger("trigger"),i=e.outArray("Points"),l=e.outValue("NumPoints");var s=null,u=null,d=!1;e.toWorkPortsNeedToBeLinked(r,i),r.onChange=function(){d=!0};var c=e.patch.cgl.gl.FLOAT,b=[];n.onTriggered=function(){var e=r.get(),n=t.gl;if(!e)return;s||(s=n.createFramebuffer());n.bindFramebuffer(n.FRAMEBUFFER,s),d&&(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.tex,0),c=n.FLOAT,u=new Float32Array(e.width*e.height*f),d=!1);n.bindFramebuffer(n.FRAMEBUFFER,s),n.readPixels(0,0,e.width,e.height,n.RGBA,c,u),n.bindFramebuffer(n.FRAMEBUFFER,null);var p=a.get();u.length;3*p!=b.length&&(b.length=3*p);var m=1/e.width,g=1/e.height,v=(e.width,e.height,0),h=0;for(;v<3*p;){if(++h>3*p*100)return;var x=h%e.width-1,I=Math.floor(h/e.width);b[v++]=u[(x+I*e.width)*f+0],b[v++]=u[(x+I*e.width)*f+1],b[v++]=u[(x+I*e.width)*f+2]}l.set(v/3),i.set(null),i.set(b),n.bindFramebuffer(n.FRAMEBUFFER,null),o.trigger()};const f=4},Ops.User.sealex.TextureToPointsRGBv2.prototype=new CABLES.Op,Ops.Gl.GradientTexture=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inGradient("Gradient"),n=e.inValueBool("Smoothstep",!0),a=e.inValueInt("Size",256),r=e.inArray("Gradient Array"),o=e.outTexture("Texture"),i=e.inValueSelect("Direction",["X","Y"],"X"),l=e.patch.cgl;function s(){var s=Math.round(a.get());s<4&&(s=4);var u=null;if(Array.isArray(r.get()))u=r.get();else{var d=null;if(!t.get()||""==t.get())return void e.error("gradient no data");try{d=JSON.parse(t.get())}catch(t){e.error("could not parse gradient data")}if(!d||!d.keys)return void e.error("gradient no data");u=d.keys}for(var c=new Uint8Array(4*s),b=0;b<u.length-1;b++)for(var f=u[b],p=u[b+1],m=f.pos*s;m<p.pos*s;m++){var g=CABLES.map(m,f.pos*s,p.pos*s,0,1);if(n.get()&&(g=CABLES.smoothStep(g)),c[4*(m=Math.round(m))+0]=Math.round(255*(g*p.r+(1-g)*f.r)),c[4*m+1]=Math.round(255*(g*p.g+(1-g)*f.g)),c[4*m+2]=Math.round(255*(g*p.b+(1-g)*f.b)),void 0!==f.a&&void 0!==p.a){const e=Math.round(255*(g*p.a+(1-g)*f.a));c[4*m+3]=e}else c[4*m+3]=Math.round(255)}var v=new CGL.Texture(l);"X"==i.get()&&v.initFromData(c,s,1),"Y"==i.get()&&v.initFromData(c,1,s),o.set(null),o.set(v)}a.onChange=t.onChange=n.onChange=i.onChange=r.onChange=s,t.set('{"keys" : [{"pos":0,"r":0,"g":0,"b":0},{"pos":0.25,"r":0,"g":0,"b":0},{"pos":0.75,"r":1,"g":1,"b":1},{"pos":1,"r":1,"g":1,"b":1}]}'),e.onLoaded=s},Ops.Gl.GradientTexture.prototype=new CABLES.Op,CABLES.OPS["01380a50-2dbb-4465-ae80-86349b0b717a"]={f:Ops.Gl.GradientTexture,objName:"Ops.Gl.GradientTexture"},Ops.User.sealex.TextureToPointsRGBA=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.patch.cgl,n=e.inTriggerButton("update"),a=e.inValueInt("Num Points",2e3),r=(e.inValueFloat("Seed",1),e.inSwitch("Z Position",["None","Red","Green","Blue","Alpha"],"Red"),e.inValueFloat("Z Multiply",1),e.
72inObject("texture")),o=e.outTrigger("trigger"),i=e.outArray("Points"),l=e.outValue("NumPoints");var s=null,u=null,d=!1;e.toWorkPortsNeedToBeLinked(r,i),r.onChange=function(){d=!0};var c=e.patch.cgl.gl.FLOAT,b=[];n.onTriggered=function(){var e=r.get(),n=t.gl;if(!e)return;s||(s=n.createFramebuffer());n.bindFramebuffer(n.FRAMEBUFFER,s),d&&(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.tex,0),c=n.FLOAT,u=new Float32Array(e.width*e.height*f),d=!1);n.bindFramebuffer(n.FRAMEBUFFER,s),n.readPixels(0,0,e.width,e.height,n.RGBA,c,u),n.bindFramebuffer(n.FRAMEBUFFER,null);var p=a.get();u.length;4*p!=b.length&&(b.length=4*p);var m=1/e.width,g=1/e.height,v=(e.width,e.height,0),h=0;for(;v<4*p;){if(++h>4*p*100)return;var x=h%e.width-1,I=Math.floor(h/e.width);b[v++]=u[(x+I*e.width)*f+0],b[v++]=u[(x+I*e.width)*f+1],b[v++]=u[(x+I*e.width)*f+2],b[v++]=1}l.set(v/4),i.set(null),i.set(b),n.bindFramebuffer(n.FRAMEBUFFER,null),o.trigger()};const f=4},Ops.User.sealex.TextureToPointsRGBA.prototype=new CABLES.Op,Ops.Devices.Mouse.Mouse=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inValueBool("relative"),n=e.inValueBool("normalize"),a=e.inValueBool("Active",!0),r=e.inValueBool("smooth"),o=e.inValueFloat("smoothSpeed",20),i=e.inValueSelect("Area",["Canvas","Document","Parent Element"],"Canvas"),l=e.inValueFloat("multiply",1),s=e.inValueBool("flip y",!0),u=e.outValue("x"),d=e.outValue("y"),c=e.inBool("right click prevent default",!0),b=e.outValueBool("button down"),f=e.outTrigger("click"),p=e.outTrigger("Button Up"),m=e.outTrigger("click right"),g=e.outValueBool("mouseOver"),v=e.outValue("button");var h=0,x=e.patch.cgl,I=null;function O(e,t){if(n.get()){var a=x.canvas.width/x.pixelDensity,r=x.canvas.height/x.pixelDensity;I==document.body&&(a=I.clientWidth/x.pixelDensity,r=I.clientHeight/x.pixelDensity),u.set((e/a*2-1)*l.get()),d.set((t/r*2-1)*l.get())}else u.set(e*l.get()),d.set(t*l.get())}r.onChange=function(){r.get()?h=setInterval(j,5):h&&clearTimeout(h)};var A=0,T=0;n.onChange=function(){O(S=0,C=0)};var S=x.canvas.width/2,C=x.canvas.height/2;A=S,T=C,u.set(S),d.set(C);var E=0,y=0,M=0,L=0;W(),i.onChange=W;var N=0;function j(){(N=o.get())<=0&&(N=.01);var e=Math.abs(S-A),t=Math.round(e/N,0);A=A<S?A+t:A-t;var n=Math.abs(C-T),a=Math.round(n/N,0);O(A,T=T<C?T+a:T-a)}function P(e){b.set(!1),g.set(!0),N=o.get()}function w(e){v.set(e.which),b.set(!0)}function _(e){v.set(0),b.set(!1),p.trigger()}function k(e){m.trigger(),c.get()&&e.preventDefault()}function D(e){f.trigger()}function B(e){E=0,y=0,N=100,"Document"!=i.get()&&r.get()&&(S=x.canvas.width/2,C=x.canvas.height/2),g.set(!1),b.set(!1)}function U(e){g.set(!0),t.get()?(0!=E&&0!=y&&(M=e.offsetX-E,L=e.offsetY-y),E=e.offsetX,y=e.offsetY,S+=M,(C+=L)>460&&(C=460)):("Document"!=i.get()?(M=e.offsetX,L=e.offsetY):(M=e.clientX,L=e.clientY),r.get()?(S=M,C=s.get()?I.clientHeight-L:L):s.get()?O(M,I.clientHeight-L):O(M,L))}function R(e){b.set(!0),e.touches&&e.touches.length>0&&w(e.touches[0])}function G(e){b.set(!1),_()}function V(){I.removeEventListener("touchend",G),I.removeEventListener("touchstart",R),I.removeEventListener("click",D),I.removeEventListener("mousemove",U),I.removeEventListener("mouseleave",B),I.removeEventListener("mousedown",w),I.removeEventListener("mouseup",_),I.removeEventListener("mouseenter",P),I.removeEventListener("contextmenu",k),I=null}function W(){I&&V(),I=x.canvas,"Document"==i.get()&&(I=document.body),"Parent Element"==i.get()&&(I=x.canvas.parentElement),I.addEventListener("touchend",G),I.addEventListener("touchstart",R),I.addEventListener("click",D),I.addEventListener("mousemove",U),I.addEventListener("mouseleave",B),I.addEventListener("mousedown",w),I.addEventListener("mouseup",_),I.addEventListener("mouseenter",P),I.addEventListener("contextmenu",k)}t.onChange=function(){M=0,L=0},a.onChange=function(){I&&V(),a.get()&&W()},e.onDelete=function(){V()},W()},Ops.Devices.Mouse.Mouse.prototype=new CABLES.Op,CABLES.OPS["0bf51f3e-3161-4cc5-aecf-6e9160089fd2"]={f:Ops.Devices.Mouse.Mouse,objName:"Ops.Devices.Mouse.Mouse"},Ops.Boolean.BoolToNumber=function(){CABLES.Op.apply(this,arguments);const e=this.inValueBool("bool"),t=this.outValue("number");e.onChange=function(){e.get()?t.set(1):t.set(0)}},Ops.Boolean.BoolToNumber.prototype=new CABLES.Op,CABLES.OPS["2591c495-fceb-4f6e-937f-11b190c72ee5"]={f:Ops.Boolean.BoolToNumber,objName:"Ops.Boolean.BoolToNumber"},Ops.Gl.Orthogonal_v2=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inTrigger("render"),n=e.inValue("bounds",2),a=e.inSwitch("Axis",["X","Y"],"X"),r=e.inValue("frustum near",.01),o=e.inValue("frustum far",100),i=e.outTrigger("trigger"),l=e.outValue("Ratio"),s=e.outValue("Width"),u=e.outValue("Height"),d=e.patch.cgl;t.onTriggered=function(){const e=d.getViewPort();if("X"==a.get()){const t=e[3]/e[2];d.pushPMatrix(),mat4.ortho(d.pMatrix,-n.get(),n.get(),-n.get()*t,n.get()*t,parseFloat(r.get()),parseFloat(o.get())),s.set(2*n.get()),u.set(n.get()*t*2),l.set(t)}else{const t=e[2]/e[3];d.pushPMatrix(),mat4.ortho(d.pMatrix,-n.get()*t,n.get()*t,-n.get(),n.get(),parseFloat(r.get()),parseFloat(o.get())),s.set(n.get()*t*2),u.set(2*n.get()),l.set(t)}i.trigger(),d.popPMatrix()}},Ops.Gl.Orthogonal_v2.prototype=new CABLES.Op,CABLES.OPS["b9235490-eaf2-4960-b1be-4279a4051ec6"]={f:Ops.Gl.Orthogonal_v2,objName:"Ops.Gl.Orthogonal_v2"}
72,Ops.Gl.Matrix.TransformView=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inTrigger("render"),n=e.inValueFloat("posX"),a=e.inValueFloat("posY"),r=e.inValueFloat("posZ"),o=e.inValueFloat("scale"),i=e.inValueFloat("rotX"),l=e.inValueFloat("rotY"),s=e.inValueFloat("rotZ"),u=e.outTrigger("trigger");e.setPortGroup("Position",[n,a,r]),e.setPortGroup("Scale",[o]),e.setPortGroup("Rotation",[i,s,l]);var d=e.patch.cgl,c=vec3.create(),b=vec3.create(),f=mat4.create();mat4.identity(f);var p=!1,m=!1,g=!0,v=!0,h=!0;t.onTriggered=function(){var t=!1;g&&(!function(){m=!1,(0!==n.get()||0!==a.get()||0!==r.get())&&(m=!0);vec3.set(c,n.get(),a.get(),r.get()),g=!1}(),t=!0),v&&(!function(){p=!1,0!==o.get()&&(p=!0);vec3.set(b,o.get(),o.get(),o.get()),v=!1}(),t=!0),h&&(t=!0),t&&x(),d.pushViewMatrix(),mat4.multiply(d.vMatrix,d.vMatrix,f),u.trigger(),d.popViewMatrix(),CABLES.UI&&gui.patch().isCurrentOp(e)&&gui.setTransformGizmo({posX:n,posY:a,posZ:r})},e.transform3d=function(){return{pos:[n,a,r]}};var x=function(){mat4.identity(f),m&&mat4.translate(f,f,c),0!==i.get()&&mat4.rotateX(f,f,i.get()*CGL.DEG2RAD),0!==l.get()&&mat4.rotateY(f,f,l.get()*CGL.DEG2RAD),0!==s.get()&&mat4.rotateZ(f,f,s.get()*CGL.DEG2RAD),p&&mat4.scale(f,f,b),h=!1};var I=function(){g=!0};v=function(){v=!0},h=function(){h=!0};i.onChange=h,l.onChange=h,s.onChange=h,o.onChange=v,n.onChange=I,a.onChange=I,r.onChange=I,i.set(0),l.set(0),s.set(0),o.set(1),n.set(0),a.set(0),r.set(0),x()},Ops.Gl.Matrix.TransformView.prototype=new CABLES.Op,CABLES.OPS["0b3e04f7-323e-4ac8-8a22-a21e2f36e0e9"]={f:Ops.Gl.Matrix.TransformView,objName:"Ops.Gl.Matrix.TransformView"},Ops.Math.Compare.GreaterThan=function(){CABLES.Op.apply(this,arguments);const e=this.outValue("result"),t=this.inValueFloat("number1"),n=this.inValueFloat("number2");t.onChange=n.onChange=function(){e.set(t.get()>n.get())}},Ops.Math.Compare.GreaterThan.prototype=new CABLES.Op,CABLES.OPS["b250d606-f7f8-44d3-b099-c29efff2608a"]={f:Ops.Math.Compare.GreaterThan,objName:"Ops.Math.Compare.GreaterThan"},Ops.Math.MapRange=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.outValue("result");var n=e.inValueFloat("value"),a=e.inValueFloat("old min"),r=e.inValueFloat("old max"),o=e.inValueFloat("new min"),i=e.inValueFloat("new max"),l=e.inValueSelect("Easing",["Linear","Smoothstep","Smootherstep"],"Linear");e.setPortGroup("Input Range",[a,r]),e.setPortGroup("Output Range",[o,i]);var s=0,u=0;function d(){if(n.get()>=Math.max(r.get(),a.get()))t.set(i.get());else if(n.get()<=Math.min(r.get(),a.get()))t.set(o.get());else{var e=o.get(),l=i.get(),d=a.get(),c=r.get(),b=n.get(),f=!1,p=Math.min(d,c),m=Math.max(d,c);p!=d&&(f=!0);var g=!1,v=Math.min(e,l),h=Math.max(e,l);v!=e&&(g=!0);var x=0;x=f?(m-b)*(h-v)/(m-p):(b-p)*(h-v)/(m-p),u=g?h-x:x+v,0===s?t.set(u):1==s?(b=Math.max(0,Math.min(1,(u-e)/(l-e))),t.set(e+b*b*(3-2*b)*(l-e))):2==s&&(b=Math.max(0,Math.min(1,(u-e)/(l-e))),t.set(e+b*b*b*(b*(6*b-15)+10)*(l-e)))}}l.onChange=function(){s="Smoothstep"==l.get()?1:"Smootherstep"==l.get()?2:0},n.set(0),a.set(0),r.set(1),o.set(-1),i.set(1),n.onChange=d,a.onChange=d,r.onChange=d,o.onChange=d,i.onChange=d,t.set(0),d()},Ops.Math.MapRange.prototype=new CABLES.Op,CABLES.OPS["2617b407-60a0-4ff6-b4a7-18136cfa7817"]={f:Ops.Math.MapRange,objName:"Ops.Math.MapRange"},Ops.Gl.CanvasInfo=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.outValue("width"),n=e.outValue("height"),a=e.outValue("Pixel Ratio"),r=e.outValue("Aspect Ratio"),o=e.outValueBool("Landscape");var i=e.patch.cgl;function l(){n.set(i.canvasHeight),t.set(i.canvasWidth),a.set(window.devicePixelRatio),r.set(i.canvasWidth/i.canvasHeight),o.set(i.canvasWidth>i.canvasHeight)}i.addEventListener("resize",l),l()},Ops.Gl.CanvasInfo.prototype=new CABLES.Op,CABLES.OPS["94e499e5-b4ee-4861-ab48-6ab5098b2cc3"]={f:Ops.Gl.CanvasInfo,objName:"Ops.Gl.CanvasInfo"},Ops.Math.Clamp=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inValueFloat("val",.5),n=e.inValueFloat("min",0),a=e.inValueFloat("max",1),r=e.inValueBool("ignore outside values"),o=e.outValue("result");t.onChange=n.onChange=a.onChange=function(){if(r.get()){if(t.get()>a.get())return;if(t.get()<n.get())return}o.set(Math.min(Math.max(t.get(),n.get()),a.get()))}},Ops.Math.Clamp.prototype=new CABLES.Op,CABLES.OPS["cda1a98e-5e16-40bd-9b18-a67e9eaad5a1"]={f:Ops.Math.Clamp,objName:"Ops.Math.Clamp"},Ops.Math.Divide=function(){CABLES.Op.apply(this,arguments);const e=this.inValueFloat("number1",1),t=this.inValueFloat("number2",2),n=this.outValue("result");function a(){n.set(e.get()/t.get())}e.onChange=t.onChange=a,a()},Ops.Math.Divide.prototype=new CABLES.Op,CABLES.OPS["86fcfd8c-038d-4b91-9820-a08114f6b7eb"]={f:Ops.Math.Divide,objName:"Ops.Math.Divide"},Ops.Sidebar.Slider=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inObject("link"),n=e.inValueString("Text","Slider"),a=e.inValue("Min",0),r=e.inValue("Max",1),o=e.inValue("Step",1e-5),i=e.inBool("Grey Out",!1),l=e.inBool("Visible",!0),s=e.inValue("Input",.5),u=e.inTriggerButton("Set Default"),d=e.inTriggerButton("Reset"),c=e.inValue("Default",.5);c.setUiAttribs({hidePort:!0,greyout:!0});const b=e.outObject("childs"),f=e.outValue("Result",c.get());e.toWorkNeedsParent("Ops.Sidebar.Sidebar"),e.setPortGroup("Range",[a,r,o]),e.setPortGroup("Visibility",[i,l]);var p=document.createElement("div");p.classList.add("sidebar__item"),p.classList.add("sidebar__slider");var m=document.createElement("div");m.classList.add("sidebar__item-label");var g=document.createElement("div");g.classList.add("sidebar__greyout"),p.appendChild(g),g.style.display="none";var v=document.createTextNode(n.get());m.appendChild(v),p.appendChild(m);var h=document.createElement("input");h.value=c.get(),h.classList.add("sidebar__text-input-input"),h.setAttribute("type","text"),h.oninput=function(t){let n=parseFloat(t.target.value);isNaN(n)&&(n=0);const o=a.get(),i=r.get();n<o?n=o:n>i&&(n=i);f.set(n),A(),s.set(n),CABLES.UI&&gui.patch().isCurrentOp(e)&&gui.patch().showOpParams(e)},p.appendChild(h);var x=document.createElement("div");
72x.classList.add("sidebar__slider-input-wrapper"),p.appendChild(x);var I=document.createElement("div");I.classList.add("sidebar__slider-input-active-track"),x.appendChild(I);var O=document.createElement("input");function A(e){let t=parseFloat(O.value);void 0!==e&&(t=e);let n=O.offsetWidth;0===n&&(n=206);var a=CABLES.map(t,parseFloat(O.min),parseFloat(O.max),0,n-16);I.style.width=a+"px"}function T(){var e=a.get();O.setAttribute("min",e),A()}function S(){var e=r.get();O.setAttribute("max",e),A()}O.classList.add("sidebar__slider-input"),O.setAttribute("min",a.get()),O.setAttribute("max",r.get()),O.setAttribute("type","range"),O.setAttribute("step",o.get()),O.setAttribute("value",c.get()),O.style.display="block",x.appendChild(O),A(),O.addEventListener("input",function(t){t.preventDefault(),t.stopPropagation(),h.value=t.target.value;const n=parseFloat(t.target.value);f.set(n),s.set(n),CABLES.UI&&gui.patch().isCurrentOp(e)&&gui.patch().showOpParams(e);return A(),!1}),t.onChange=function(){var e=t.get();e&&e.parentElement?(e.parentElement.appendChild(p),b.set(null),b.set(e)):p.parentElement&&p.parentElement.removeChild(p)},n.onChange=function(){var t=n.get();m.textContent=t,CABLES.UI&&e.setTitle("Slider: "+t)},s.onChange=function(){let e=parseFloat(s.get());const t=a.get(),n=r.get();e>n?e=n:e<t&&(e=t);h.value=e,O.value=e,f.set(e),A()},c.onChange=function(){var e=c.get();f.set(parseFloat(e)),T(),S(),O.value=e,h.value=e,A(e)},u.onTriggered=function(){let t=parseFloat(s.get());const n=a.get(),o=r.get();t>o?t=o:t<n&&(t=n);h.value=t,O.value=t,f.set(t),c.set(t),CABLES.UI&&gui.patch().isCurrentOp(e)&&gui.patch().showOpParams(e);A()},a.onChange=T,r.onChange=S,o.onChange=function(){var e=o.get();O.setAttribute("step",e),A()},e.onDelete=function(){!function(e){e&&e.parentNode&&e.parentNode.removeChild&&e.parentNode.removeChild(e)}(p)},e.onLoaded=e.onInit=function(){e.patch.config.sidebar?(e.patch.config.sidebar[n.get()],f.set(e.patch.config.sidebar[n.get()])):(f.set(parseFloat(c.get())),s.set(parseFloat(c.get())))},d.onTriggered=function(){const e=parseFloat(c.get());f.set(e),h.value=e,O.value=e,s.set(e),A()},i.onChange=function(){g.style.display=i.get()?"block":"none"},l.onChange=function(){p.style.display=l.get()?"block":"none"}},Ops.Sidebar.Slider.prototype=new CABLES.Op,CABLES.OPS["eb3232e5-e947-4683-a17f-27a72d464b2c"]={f:Ops.Sidebar.Slider,objName:"Ops.Sidebar.Slider"},Ops.Sidebar.Sidebar=function(){CABLES.Op.apply(this,arguments);const e=this,t={style_css:'/*\n * SIDEBAR\n http://danielstern.ca/range.css/#/\n https://developer.mozilla.org/en-US/docs/Web/CSS/::-webkit-progress-value\n */\n\n\n.icon-chevron-down {\n top: 2px;\n right: 9px;\n}\n\n.iconsidebar-chevron-up {\n\tbackground-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiM4ODg4ODgiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLWNoZXZyb24tdXAiPjxwb2x5bGluZSBwb2ludHM9IjE4IDE1IDEyIDkgNiAxNSI+PC9wb2x5bGluZT48L3N2Zz4=);\n top: 2px;\n right: 9px;\n}\n\n.sidebar-cables-right\n{\n right: 0px;\n left: initial !important;\n}\n\n.sidebar-cables {\n position: absolute;\n top: 15px;\n left: 15px;\n border-radius: 10px;\n /*border:10px solid #1a1a1a;*/\n z-index: 100000;\n color: #BBBBBB;\n width: 220px;\n max-height: 100%;\n box-sizing: border-box;\n overflow-y: auto;\n overflow-x: hidden;\n font-size: 13px;\n font-family: Arial;\n line-height: 1em; /* prevent emojis from breaking height of the title */\n --sidebar-border-radius: 4px;\n --sidebar-monospace-font-stack: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;\n --sidebar-hover-transition-time: .2s;\n}\n\n.sidebar-cables::selection {\n background-color: #24baa7;\n color: #EEEEEE;\n}\n\n.sidebar-cables::-webkit-scrollbar {\n background-color: transparent;\n --cables-scrollbar-width: 8px;\n width: var(--cables-scrollbar-width);\n}\n\n.sidebar-cables::-webkit-scrollbar-track {\n background-color: transparent;\n width: var(--cables-scrollbar-width);\n}\n\n.sidebar-cables::-webkit-scrollbar-thumb {\n background-color: #333333;\n border-radius: 4px;\n width: var(--cables-scrollbar-width);\n}\n\n.sidebar-cables--closed {\n width: auto;\n}\n\n.sidebar__close-button {\n background-color: #222;\n -webkit-user-select: none; /* Chrome all / Safari all */\n -moz-user-select: none;
72 /* Firefox all */\n -ms-user-select: none; /* IE 10+ */\n user-select: none; /* Likely future */\n transition: background-color var(--sidebar-hover-transition-time);\n color: #CCCCCC;\n height: 12px;\n box-sizing: border-box;\n padding-top: 2px;\n text-align: center;\n cursor: pointer;\n /*border-top: 1px solid #272727;*/\n border-radius: 0 0 var(--sidebar-border-radius) var(--sidebar-border-radius);\n opacity: 1.0;\n transition: opacity 0.3s;\n overflow: hidden;\n}\n\n.sidebar__close-button-icon {\n display: inline-block;\n /*opacity: 0;*/\n width: 21px;\n height: 20px;\n position: relative;\n top: -1px;\n /*background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiM4ODg4ODgiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLWNoZXZyb24tdXAiPjxwb2x5bGluZSBwb2ludHM9IjE4IDE1IDEyIDkgNiAxNSI+PC9wb2x5bGluZT48L3N2Zz4=);*/\n /*background-size: cover;*/\n /*background-repeat: no-repeat;*/\n /*background-repeat: no-repeat;*/\n /*background-position: 0 -1px;*/\n}\n\n.sidebar--closed .sidebar__close-button {\n margin-top: 8px;\n margin-left: 8px;\n padding-top: 13px;\n padding-left: 11px;\n padding-right: 11px;\n width: 46px;\n height: 46px;\n border-radius: 50%;\n cursor: pointer;\n opacity: 0.3;\n}\n\n.sidebar--closed .sidebar__group\n{\n display:none;\n\n}\n.sidebar--closed .sidebar__close-button-icon {\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIyMnB4IiBoZWlnaHQ9IjE3cHgiIHZpZXdCb3g9IjAgMCAyMiAxNyIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4gICAgICAgIDx0aXRsZT5Hcm91cCAzPC90aXRsZT4gICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+ICAgIDxkZWZzPjwvZGVmcz4gICAgPGcgaWQ9IkNhbnZhcy1TaWRlYmFyIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4gICAgICAgIDxnIGlkPSJEZXNrdG9wLWdyZWVuLWJsdWlzaC1Db3B5LTkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMC4wMDAwMDAsIC0yMi4wMDAwMDApIj4gICAgICAgICAgICA8ZyBpZD0iR3JvdXAtMyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjAuMDAwMDAwLCAyMi4wMDAwMDApIj4gICAgICAgICAgICAgICAgPHBhdGggZD0iTTAuNSwyLjUgTDIuNSwyLjUiIGlkPSJMaW5lLTIiIHN0cm9rZT0iIzk3OTc5NyIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSI+PC9wYXRoPiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTAuNSwyLjUgTDIxLjUsMi41IiBpZD0iTGluZS0yIiBzdHJva2U9IiM5Nzk3OTciIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiPjwvcGF0aD4gICAgICAgICAgICAgICAgPHBhdGggZD0iTTAuNSw4LjUgTDExLjUsOC41IiBpZD0iTGluZS0yIiBzdHJva2U9IiM5Nzk3OTciIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiPjwvcGF0aD4gICAgICAgICAgICAgICAgPHBhdGggZD0iTTE5LjUsOC41IEwyMS41LDguNSIgaWQ9IkxpbmUtMiIgc3Ryb2tlPSIjOTc5Nzk3IiBzdHJva2UtbGluZWNhcD0ic3F1YXJlIj48L3BhdGg+ICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLjUsMTQuNSBMNS41LDE0LjUiIGlkPSJMaW5lLTIiIHN0cm9rZT0iIzk3OTc5NyIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSI+PC9wYXRoPiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTMuNSwxNC41IEwyMS41LDE0LjUiIGlkPSJMaW5lLTIiIHN0cm9rZT0iIzk3OTc5NyIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSI+PC9wYXRoPiAgICAgICAgICAgICAgICA8Y2lyY2xlIGlkPSJPdmFsLTMiIGZpbGw9IiM5Nzk3OTciIGN4PSI2LjUiIGN5PSIyLjUiIHI9IjIuNSI+PC9jaXJjbGU+ICAgICAgICAgICAgICAgIDxjaXJjbGUgaWQ9Ik92YWwtMyIgZmlsbD0iIzk3OTc5NyIgY3g9IjE1LjUiIGN5PSI4LjUiIHI9IjIuNSI+PC9jaXJjbGU+ICAgICAgICAgICAgICAgIDxjaXJjbGUgaWQ9Ik92YWwtMyIgZmlsbD0iIzk3OTc5NyIgY3g9IjkuNSIgY3k9IjE0LjUiIHI9IjIuNSI+PC9jaXJjbGU+ICAgICAgICAgICAgPC9nPiAgICAgICAgPC9nPiAgICA8L2c+PC9zdmc+);\n background-position: 0px 0px;\n}\n\n.sidebar__close-button:hover {\n background-color: #111111;\n opacity: 1.0 !important;\n}\n\n/*\n * SIDEBAR ITEMS\n */\n\n.sidebar__items {\n /* max-height: 1000px; */\n /* transition: max-height 0.5;*/\n background-color: #222;\n}\n\n.sidebar--closed .sidebar__items {\n /* max-height: 0; */\n height: 0;\n display: none;\n pointer-interactions: none;\n}\n\n/*\n * SIDEBAR GROUP\n */\n\n.sidebar__group {\n /*background-color: #1A1A1A;*/\n overflow: hidden;\n box-sizing: border-box;\n animate: height;\n /* max-height: 1000px; */\n /* transition: max-height 0.5s; */\n --sidebar-group-header-height: 28px;\n}\n\n.sidebar__group--closed {\n /* max-height: 13px; */\n height: var(--sidebar-group-header-height);\n}\n\n.sidebar__group-header {\n box-sizing: border-box;\n color: #EEEEEE;\n background-color: #151515;\n -webkit-user-select: none; /* Chrome all / Safari all */\n -moz-user-select: none;
72 /* Firefox all */\n -ms-user-select: none; /* IE 10+ */\n user-select: none; /* Likely future */\n height: var(--sidebar-group-header-height);\n padding-top: 7px;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n cursor: pointer;\n transition: background-color var(--sidebar-hover-transition-time);\n position: relative;\n}\n\n.sidebar__group-header:hover {\n background-color: #111111;\n}\n\n.sidebar__group-header-title {\n /*text-align: center;*/\n overflow: hidden;\n padding: 0 15px;\n padding-top:2px;\n font-weight:bold;\n}\n\n.sidebar__group-header-icon {\n width: 17px;\n height: 14px;\n background-repeat: no-repeat;\n display: inline-block;\n position: absolute;\n background-size: cover;\n\n /* icon open */\n /* feather icon: chevron up */\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiM4ODg4ODgiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLWNoZXZyb24tdXAiPjxwb2x5bGluZSBwb2ludHM9IjE4IDE1IDEyIDkgNiAxNSI+PC9wb2x5bGluZT48L3N2Zz4=);\n top: 4px;\n right: 5px;\n opacity: 0.0;\n transition: opacity 0.3;\n}\n\n.sidebar__group-header:hover .sidebar__group-header-icon {\n opacity: 1.0;\n}\n\n/* icon closed */\n.sidebar__group--closed .sidebar__group-header-icon {\n /* feather icon: chevron down */\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiM4ODg4ODgiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLWNoZXZyb24tZG93biI+PHBvbHlsaW5lIHBvaW50cz0iNiA5IDEyIDE1IDE4IDkiPjwvcG9seWxpbmU+PC9zdmc+);\n top: 4px;\n right: 5px;\n}\n\n/*\n * SIDEBAR ITEM\n */\n\n.sidebar__item\n{\n box-sizing: border-box;\n padding: 7px;\n padding-left:15px;\n padding-right:15px;\n\n overflow: hidden;\n position: relative;\n}\n\n.sidebar__item-label {\n display: inline-block;\n -webkit-user-select: none; /* Chrome all / Safari all */\n -moz-user-select: none;
72 /* Firefox all */\n -ms-user-select: none; /* IE 10+ */\n user-select: none; /* Likely future */\n width: calc(50% - 7px);\n margin-right: 7px;\n margin-top: 2px;\n max-height: 1em;\n text-overflow: ellipsis;\n /* overflow: hidden; */\n}\n\n.sidebar__item-value-label {\n font-family: var(--sidebar-monospace-font-stack);\n display: inline-block;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n max-width: 60%;\n}\n\n.sidebar__item-value-label::selection {\n background-color: #24baa7;\n color: #EEEEEE;\n}\n\n.sidebar__item + .sidebar__item,\n.sidebar__item + .sidebar__group,\n.sidebar__group + .sidebar__item,\n.sidebar__group + .sidebar__group {\n border-top: 1px solid #272727;\n}\n\n/*\n * SIDEBAR ITEM TOGGLE\n */\n\n.sidebar__toggle {\n cursor: pointer;\n}\n\n.sidebar__toggle-input {\n --sidebar-toggle-input-color: #CCCCCC;\n --sidebar-toggle-input-color-hover: #EEEEEE;\n --sidebar-toggle-input-border-size: 2px;\n display: inline;\n float: right;\n box-sizing: border-box;\n border-radius: 50%;\n cursor: pointer;\n --toggle-size: 11px;\n margin-top: 2px;\n background-color: transparent !important;\n border: var(--sidebar-toggle-input-border-size) solid var(--sidebar-toggle-input-color);\n width: var(--toggle-size);\n height: var(--toggle-size);\n transition: background-color var(--sidebar-hover-transition-time);\n transition: border-color var(--sidebar-hover-transition-time);\n}\n.sidebar__toggle:hover .sidebar__toggle-input {\n border-color: var(--sidebar-toggle-input-color-hover);\n}\n\n.sidebar__toggle .sidebar__item-value-label {\n -webkit-user-select: none; /* Chrome all / Safari all */\n -moz-user-select: none;
72 /* Firefox all */\n -ms-user-select: none; /* IE 10+ */\n user-select: none; /* Likely future */\n max-width: calc(50% - 12px);\n}\n.sidebar__toggle-input::after { clear: both; }\n\n.sidebar__toggle--active .icon_toggle\n{\n\n background-image: url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE1cHgiIHdpZHRoPSIzMHB4IiBmaWxsPSIjMDZmNzhiIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTAwIDEwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PGcgZGlzcGxheT0ibm9uZSI+PGcgZGlzcGxheT0iaW5saW5lIj48Zz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iIzA2Zjc4YiIgZD0iTTMwLDI3QzE3LjM1LDI3LDcsMzcuMzUsNyw1MGwwLDBjMCwxMi42NSwxMC4zNSwyMywyMywyM2g0MCBjMTIuNjUsMCwyMy0xMC4zNSwyMy0yM2wwLDBjMC0xMi42NS0xMC4zNS0yMy0yMy0yM0gzMHogTTcwLDY3Yy05LjM4OSwwLTE3LTcuNjEtMTctMTdzNy42MTEtMTcsMTctMTdzMTcsNy42MSwxNywxNyAgICAgUzc5LjM4OSw2Nyw3MCw2N3oiPjwvcGF0aD48L2c+PC9nPjwvZz48Zz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMwLDI3QzE3LjM1LDI3LDcsMzcuMzUsNyw1MGwwLDBjMCwxMi42NSwxMC4zNSwyMywyMywyM2g0MCAgIGMxMi42NSwwLDIzLTEwLjM1LDIzLTIzbDAsMGMwLTEyLjY1LTEwLjM1LTIzLTIzLTIzSDMweiBNNzAsNjdjLTkuMzg5LDAtMTctNy42MS0xNy0xN3M3LjYxMS0xNywxNy0xN3MxNyw3LjYxLDE3LDE3ICAgUzc5LjM4OSw2Nyw3MCw2N3oiPjwvcGF0aD48L2c+PGcgZGlzcGxheT0ibm9uZSI+PGcgZGlzcGxheT0iaW5saW5lIj48cGF0aCBmaWxsPSIjMDZmNzhiIiBzdHJva2U9IiMwNmY3OGIiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNNyw1MGMwLDEyLjY1LDEwLjM1LDIzLDIzLDIzaDQwICAgIGMxMi42NSwwLDIzLTEwLjM1LDIzLTIzbDAsMGMwLTEyLjY1LTEwLjM1LTIzLTIzLTIzSDMwQzE3LjM1LDI3LDcsMzcuMzUsNyw1MEw3LDUweiI+PC9wYXRoPjwvZz48Y2lyY2xlIGRpc3BsYXk9ImlubGluZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiMwNmY3OGIiIHN0cm9rZT0iIzA2Zjc4YiIgc3Ryb2tlLXdpZHRoPSI0IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIGN4PSI3MCIgY3k9IjUwIiByPSIxNyI+PC9jaXJjbGU+PC9nPjxnIGRpc3BsYXk9Im5vbmUiPjxwYXRoIGRpc3BsYXk9ImlubGluZSIgZD0iTTcwLDI1SDMwQzE2LjIxNSwyNSw1LDM2LjIxNSw1LDUwczExLjIxNSwyNSwyNSwyNWg0MGMxMy43ODUsMCwyNS0xMS4yMTUsMjUtMjVTODMuNzg1LDI1LDcwLDI1eiBNNzAsNzEgICBIMzBDMTguNDIxLDcxLDksNjEuNTc5LDksNTBzOS40MjEtMjEsMjEtMjFoNDBjMTEuNTc5LDAsMjEsOS40MjEsMjEsMjFTODEuNTc5LDcxLDcwLDcxeiBNNzAsMzFjLTEwLjQ3NywwLTE5LDguNTIzLTE5LDE5ICAgczguNTIzLDE5LDE5LDE5czE5LTguNTIzLDE5LTE5UzgwLjQ3NywzMSw3MCwzMXogTTcwLDY1Yy04LjI3MSwwLTE1LTYuNzI5LTE1LTE1czYuNzI5LTE1LDE1LTE1czE1LDYuNzI5LDE1LDE1Uzc4LjI3MSw2NSw3MCw2NXoiPjwvcGF0aD48L2c+PC9zdmc+);\n opacity: 1;\n transform: rotate(0deg);\n}\n\n\n.icon_toggle\n{\n float: right;\n width:40px;\n height:18px;\n background-image: url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE1cHgiIHdpZHRoPSIzMHB4IiBmaWxsPSIjYWFhYWFhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTAwIDEwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PGcgZGlzcGxheT0ibm9uZSI+PGcgZGlzcGxheT0iaW5saW5lIj48Zz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI2FhYWFhYSIgZD0iTTMwLDI3QzE3LjM1LDI3LDcsMzcuMzUsNyw1MGwwLDBjMCwxMi42NSwxMC4zNSwyMywyMywyM2g0MCBjMTIuNjUsMCwyMy0xMC4zNSwyMy0yM2wwLDBjMC0xMi42NS0xMC4zNS0yMy0yMy0yM0gzMHogTTcwLDY3Yy05LjM4OSwwLTE3LTcuNjEtMTctMTdzNy42MTEtMTcsMTctMTdzMTcsNy42MSwxNywxNyAgICAgUzc5LjM4OSw2Nyw3MCw2N3oiPjwvcGF0aD48L2c+PC9nPjwvZz48Zz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMwLDI3QzE3LjM1LDI3LDcsMzcuMzUsNyw1MGwwLDBjMCwxMi42NSwxMC4zNSwyMywyMywyM2g0MCAgIGMxMi42NSwwLDIzLTEwLjM1LDIzLTIzbDAsMGMwLTEyLjY1LTEwLjM1LTIzLTIzLTIzSDMweiBNNzAsNjdjLTkuMzg5LDAtMTctNy42MS0xNy0xN3M3LjYxMS0xNywxNy0xN3MxNyw3LjYxLDE3LDE3ICAgUzc5LjM4OSw2Nyw3MCw2N3oiPjwvcGF0aD48L2c+PGcgZGlzcGxheT0ibm9uZSI+PGcgZGlzcGxheT0iaW5saW5lIj48cGF0aCBmaWxsPSIjYWFhYWFhIiBzdHJva2U9IiNhYWFhYWEiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNNyw1MGMwLDEyLjY1LDEwLjM1LDIzLDIzLDIzaDQwICAgIGMxMi42NSwwLDIzLTEwLjM1LDIzLTIzbDAsMGMwLTEyLjY1LTEwLjM1LTIzLTIzLTIzSDMwQzE3LjM1LDI3LDcsMzcuMzUsNyw1MEw3LDUweiI+PC9wYXRoPjwvZz48Y2lyY2xlIGRpc3BsYXk9ImlubGluZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiNhYWFhYWEiIHN0cm9rZT0iI2FhYWFhYSIgc3Ryb2tlLXdpZHRoPSI0IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIGN4PSI3MCIgY3k9IjUwIiByPSIxNyI+PC9jaXJjbGU+PC9nPjxnIGRpc3BsYXk9Im5vbmUiPjxwYXRoIGRpc3BsYXk9ImlubGluZSIgZD0iTTcwLDI1SDMwQzE2LjIxNSwyNSw1LDM2LjI
72xNSw1LDUwczExLjIxNSwyNSwyNSwyNWg0MGMxMy43ODUsMCwyNS0xMS4yMTUsMjUtMjVTODMuNzg1LDI1LDcwLDI1eiBNNzAsNzEgICBIMzBDMTguNDIxLDcxLDksNjEuNTc5LDksNTBzOS40MjEtMjEsMjEtMjFoNDBjMTEuNTc5LDAsMjEsOS40MjEsMjEsMjFTODEuNTc5LDcxLDcwLDcxeiBNNzAsMzFjLTEwLjQ3NywwLTE5LDguNTIzLTE5LDE5ICAgczguNTIzLDE5LDE5LDE5czE5LTguNTIzLDE5LTE5UzgwLjQ3NywzMSw3MCwzMXogTTcwLDY1Yy04LjI3MSwwLTE1LTYuNzI5LTE1LTE1czYuNzI5LTE1LDE1LTE1czE1LDYuNzI5LDE1LDE1Uzc4LjI3MSw2NSw3MCw2NXoiPjwvcGF0aD48L2c+PC9zdmc+);\n background-size: 50px 37px;\n background-position: -6px -10px;\n transform: rotate(180deg);\n opacity: 0.4;\n}\n\n\n\n/*.sidebar__toggle--active .sidebar__toggle-input {*/\n/* transition: background-color var(--sidebar-hover-transition-time);*/\n/* background-color: var(--sidebar-toggle-input-color);*/\n/*}*/\n/*.sidebar__toggle--active .sidebar__toggle-input:hover*/\n/*{*/\n/* background-color: var(--sidebar-toggle-input-color-hover);*/\n/* border-color: var(--sidebar-toggle-input-color-hover);*/\n/* transition: background-color var(--sidebar-hover-transition-time);*/\n/* transition: border-color var(--sidebar-hover-transition-time);*/\n/*}*/\n\n/*\n * SIDEBAR ITEM BUTTON\n */\n\n.sidebar__button {}\n\n.sidebar__button-input {\n -webkit-user-select: none; /* Chrome all / Safari all */\n -moz-user-select: none;
72 /* Firefox all */\n -ms-user-select: none; /* IE 10+ */\n user-select: none; /* Likely future */\n height: 24px;\n background-color: transparent;\n color: #CCCCCC;\n box-sizing: border-box;\n padding-top: 3px;\n text-align: center;\n border-radius: 125px;\n border:2px solid #555;\n cursor: pointer;\n}\n\n.sidebar__button-input:hover {\n background-color: #333;\n border:2px solid #07f78c;\n}\n\n/*\n * VALUE DISPLAY (shows a value)\n */\n\n.sidebar__value-display {}\n\n/*\n * SLIDER\n */\n\n.sidebar__slider {\n --sidebar-slider-input-height: 3px;\n}\n\n.sidebar__slider-input-wrapper {\n width: 100%;\n margin-top: 8px;\n position: relative;\n}\n\n.sidebar__slider-input {\n -webkit-appearance: none;\n appearance: none;\n margin: 0;\n width: 100%;\n height: var(--sidebar-slider-input-height);\n background: #555;\n cursor: pointer;\n outline: 0;\n\n -webkit-transition: .2s;\n transition: background-color .2s;\n border: none;\n}\n\n.sidebar__slider-input:focus, .sidebar__slider-input:hover {\n border: none;\n}\n\n.sidebar__slider-input-active-track {\n user-select: none;\n position: absolute;\n z-index: 11;\n top: 0;\n left: 0;\n background-color: #07f78c;\n pointer-events: none;\n height: var(--sidebar-slider-input-height);\n\n /* width: 10px; */\n}\n\n/* Mouse-over effects */\n.sidebar__slider-input:hover {\n /*background-color: #444444;*/\n}\n\n/*.sidebar__slider-input::-webkit-progress-value {*/\n/* background-color: green;*/\n/* color:green;*/\n\n/* }*/\n\n/* The slider handle (use -webkit- (Chrome, Opera, Safari, Edge) and -moz- (Firefox) to override default look) */\n\n.sidebar__slider-input::-moz-range-thumb\n{\n position: absolute;\n height: 15px;\n width: 15px;\n z-index: 900 !important;\n border-radius: 20px !important;\n cursor: pointer;\n background: #07f78c !important;\n user-select: none;\n\n}\n\n.sidebar__slider-input::-webkit-slider-thumb\n{\n position: relative;\n appearance: none;\n -webkit-appearance: none;\n user-select: none;\n height: 15px;\n width: 15px;\n display: block;\n z-index: 900 !important;\n border: 0;\n border-radius: 20px !important;\n cursor: pointer;\n background: #777 !important;\n}\n\n.sidebar__slider-input:hover ::-webkit-slider-thumb {\n background-color: #EEEEEE !important;\n}\n\n/*.sidebar__slider-input::-moz-range-thumb {*/\n\n/* width: 0 !important;*/\n/* height: var(--sidebar-slider-input-height);*/\n/* background: #EEEEEE;*/\n/* cursor: pointer;*/\n/* border-radius: 0 !important;*/\n/* border: none;*/\n/* outline: 0;*/\n/* z-index: 100 !important;*/\n/*}*/\n\n.sidebar__slider-input::-moz-range-track {\n background-color: transparent;\n z-index: 11;\n}\n\n/*.sidebar__slider-input::-moz-range-thumb:hover {*/\n /* background-color: #EEEEEE; */\n/*}*/\n\n\n/*.sidebar__slider-input-wrapper:hover .sidebar__slider-input-active-track {*/\n/* background-color: #EEEEEE;*/\n/*}*/\n\n/*.sidebar__slider-input-wrapper:hover .sidebar__slider-input::-moz-range-thumb {*/\n/* background-color: #fff !important;*/\n/*}*/\n\n/*.sidebar__slider-input-wrapper:hover .sidebar__slider-input::-webkit-slider-thumb {*/\n/* background-color: #EEEEEE;*/\n/*}*/\n\n.sidebar__slider input[type=text] {\n box-sizing: border-box;\n /*background-color: #333333;*/\n text-align: right;\n color: #BBBBBB;\n display: inline-block;\n background-color: transparent !important;\n\n width: 40%;\n height: 18px;\n outline: none;\n border: none;\n border-radius: 0;\n padding: 0 0 0 4px !important;\n margin: 0;\n}\n\n.sidebar__slider input[type=text]:active,\n.sidebar__slider input[type=text]:focus,\n.sidebar__slider input[type=text]:hover {\n\n color: #EEEEEE;\n}\n\n/*\n * TEXT / DESCRIPTION\n */\n\n.sidebar__text .sidebar__item-label {\n width: auto;\n display: block;\n max-height: none;\n margin-right: 0;\n line-height: 1.1em;\n}\n\n/*\n * SIDEBAR INPUT\n */\n.sidebar__text-input textarea,\n.sidebar__text-input input[type=text] {\n box-sizing: border-box;\n background-color: #333333;\n color: #BBBBBB;\n display: inline-block;\n width: 50%;\n height: 18px;\n outline: none;\n border: none;\n border-radius: 0;\n border:1px solid #666;\n padding: 0 0 0 4px !important;\n margin: 0;\n}\n\n.sidebar__color-picker .sidebar__item-label\n{\n width:45%;\n}\n\n.sidebar__text-input textarea,\n.sidebar__text-input input[type=text]:active,\n.sidebar__text-input input[type=text]:focus,\n.sidebar__text-input input[type=text]:hover {\n background-color: transparent;\n color: #EEEEEE;\n}\n\n.sidebar__text-input textarea\n{\n margin-top:10px;\n height:60px;\n width:100%;\n}\n\n/*\n * SIDEBAR SELECT\n */\n\n\n\n .sidebar__select {}\n .sidebar__select-select {\n color: #BBBBBB;\n /*-webkit-appearance: none;*/\n /*-moz-appearance: none;*/\n appearance: none;\n /*box-sizing: border-box;*/\n width: 50%;\n height: 20px;\n background-color: #333333;\n /*background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiM4ODg4ODgiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLWNoZXZyb24tZG93biI+PHBvbHlsaW5lIHBvaW50cz0iNiA5IDEyIDE1IDE4IDkiPjwvcG9seWxpbmU+PC9zdmc+);*/\n background-repeat: no-repeat;\n background-position: right center;\n background-size: 16px 16px;\n margin: 0;\n /*padding: 0 2 2 6px;*/\n border-radius: 5px;\n border: 1px solid #777;\n background-color: #444;\n cursor: pointer;\n outline: none;\n\n }\n\n.sidebar__select-select:hover,\n.sidebar__select-select:active,\n.sidebar__select-select:active {\n background-color: #444444;\n color: #EEEEEE;\n}\n\n/*\n * COLOR PICKER\n */\n\n .sidebar__color-picker-color-input {}\n\n .sidebar__color-picker input[type=text] {\n box-sizing: border-box;\n background-color: #333333;\n color: #BBBBBB;\n display: inline-block;\n width: calc(50% - 21px); /* 50% minus space of picker circle */\n height: 18px;\n outline: none;\n border: none;\n border-radius: 0;\n padding: 0 0 0 4px !important;\n margin: 0;\n margin-right: 7px;\n}\n\n.sidebar__color-picker input[type=text]:active,\n.sidebar__color-picker input[type=text]:focus,\n.sidebar__color-picker input[type=text]:hover {\n background-color: #444444;\n color: #EEEEEE;\n}\n\n.sidebar__color-picker input[type=color],\n.sidebar__palette-picker input[type=color] {\n display: inline-block;\n border-radius: 100%;\n height: 14px;\n width: 14px;\n padding: 0;\n border: none;\n border-color: transparent;\n outline: none;\n background: none;\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n cursor: pointer;\n position: relative;\n top: 3px;\n}\n.sidebar__color-picker input[type=color]:focus,\n.sidebar__palette-picker input[type=color]:focus {\n outline: none;\n}\n.sidebar__color-picker input[type=color]::-moz-color-swatch,\n.sidebar__palette-picker input[type=color]::-moz-color-swatch {\n border: none;\n}\n.sidebar__color-picker input[type=color]::-webkit-color-swatch-wrapper,\n.sidebar__palette-picker input[type=color]::-webkit-color-swatch-wrapper {\n padding: 0;\n}\n.sidebar__color-picker input[type=color]::-webkit-color-swatch,\n.sidebar__palette-picker input[type=color]::-webkit-color-swatch {\n border: none;\n border-radius: 100%;\n}\n\n/*\n * Palette Picker\n */\n.sidebar__palette-picker .sidebar__palette-picker-color-input.first {\n margin-left: 0;\n}\n.sidebar__palette-picker .sidebar__palette-picker-color-input.last {\n margin-right: 0;\n}\n.sidebar__palette-picker .sidebar__palette-picker-color-input {\n margin: 0 4px;\n}\n\n.sidebar__palette-picker .circlebutton {\n width: 14px;\n height: 14px;\n border-radius: 1em;\n display: inline-block;\n top: 3px;\n position: relative;\n}\n\n/*\n * Preset\n */\n.sidebar__item-presets-preset\n{\n padding:4px;\n cursor:pointer;\n padding-left:8px;\n padding-right:8px;\n margin-right:4px;\n background-color:#444;\n}\n\n.sidebar__item-presets-preset:hover\n{\n background-color:#666;\n}\n\n.sidebar__greyout\n{\n background: #222;\n opacity: 0.8;\n width: 100%;\n height: 100%;\n position: absolute;\n z-index: 1000;\n right: 0;\n top: 0;\n}\n'},n="cables-sidebar-style",a="cables-sidebar-dynamic-style",r="sidebar-cables",o="sidebar"+CABLES.uuid(),i="sidebar__items",l="sidebar__close-button",s="sidebar__close-button-icon",u="",d="";let c=null,b=null;var f=null,p=e.inValueBool("Visible",!0),m=e.inValueSlider("Opacity",1),g=e.inValueBool("Default Minimized"),v=e.inValueSlider("Minimized Opacity",.5),h=e.inString("Title","Sidebar"),x=e.inValueBool("Side"),I=e.outObject("childs"),O=document.querySelector("."+o);O||(O=function(){var t=document.createElement("div");t.classList.add(r),t.classList.add(o);var n=e.patch.cgl.canvas.parentElement,a=document.createElement("div");a.classList.add("sidebar__group"),t.appendChild(a);var u=document.createElement("div");u.classList.add("sidebar__group-header"),t.appendChild(u);var d=document.createElement("div");if(d.classList.add("sidebar__group-header-title"),(f=document.createElement("span")).classList.add("sidebar__group-header-title-text"),f.innerHTML=h.get(),d.appendChild(f),u.appendChild(d),a.appendChild(u),t.appendChild(a),a.addEventListener("click",C),!n)return void console.warn("[sidebar] no canvas parentelement found...");
72n.appendChild(t);var p=document.createElement("div");return p.classList.add(i),t.appendChild(p),(c=document.createElement("div")).classList.add(l),c.addEventListener("click",C),t.appendChild(c),(b=document.createElement("span")).classList.add(s),c.appendChild(b),t}());var A=O.querySelector("."+i);function T(){c&&(g.get()?O.classList.add("sidebar--closed"):O.classList.remove("sidebar--closed"))}function S(){let e=document.querySelectorAll("."+a);e&&e.forEach(function(e){e.parentNode.removeChild(e)});let t=document.createElement("style");t.classList.add(a);let n=".sidebar--closed .sidebar__close-button { ";n+="opacity: "+v.get(),n+="}";let r=document.createTextNode(n);t.appendChild(r),document.body.appendChild(t)}function C(e){if(e.stopPropagation(),!O)return void console.error("Sidebar could not be closed...");O.classList.toggle("sidebar--closed");e.target;let t=u;O.classList.contains("sidebar--closed")&&(t=d)}I.set({parentElement:A,parentOp:e}),T(),function(){var e=document.querySelectorAll("."+n);e&&e.forEach(function(e){e.parentNode.removeChild(e)});var a=document.createElement("style");a.innerHTML=t.style_css,a.classList.add(n),document.body.appendChild(a)}(),S(),p.onChange=function(){p.get()?O.style.display="block":O.style.display="none"},m.onChange=function(){var e=m.get();O.style.opacity=e},g.onChange=T,v.onChange=function(){S()},e.onDelete=function(){e=O,e&&e.parentNode&&e.parentNode.removeChild&&e.parentNode.removeChild(e);var e},x.onChange=function(){x.get()?O.classList.add("sidebar-cables-right"):O.classList.remove("sidebar-cables-right")},x.onChanged=function(){},h.onChange=function(){f&&(f.innerHTML=h.get())}},Ops.Sidebar.Sidebar.prototype=new CABLES.Op,CABLES.OPS["5a681c35-78ce-4cb3-9858-bc79c34c6819"]={f:Ops.Sidebar.Sidebar,objName:"Ops.Sidebar.Sidebar"},Ops.Sidebar.Button=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inObject("link"),n=e.inValueString("Text","Button"),a=e.outObject("childs"),r=e.outTrigger("Pressed Trigger");const o=e.inBool("Grey Out",!1),i=e.inBool("Visible",!0);var l=document.createElement("div");l.classList.add("sidebar__item"),l.classList.add("sidebar--button");var s=document.createElement("div");s.classList.add("sidebar__button-input"),l.appendChild(s),s.addEventListener("click",function(){r.trigger()});var u=document.createTextNode(n.get());s.appendChild(u),e.toWorkNeedsParent("Ops.Sidebar.Sidebar"),t.onChange=function(){var e=t.get();e&&e.parentElement?(e.parentElement.appendChild(l),a.set(null),a.set(e)):l.parentElement&&l.parentElement.removeChild(l)},n.onChange=function(){var t=n.get();s.textContent=t,CABLES.UI&&e.setTitle("Button: "+t)},e.onDelete=function(){!function(e){e&&e.parentNode&&e.parentNode.removeChild&&e.parentNode.removeChild(e)}(l)};var d=document.createElement("div");d.classList.add("sidebar__greyout"),l.appendChild(d),d.style.display="none",o.onChange=function(){d.style.display=o.get()?"block":"none"},i.onChange=function(){l.style.display=i.get()?"block":"none"}},Ops.Sidebar.Button.prototype=new CABLES.Op,CABLES.OPS["118df748-16d1-46f4-b8fc-38d7cc5a0aab"]={f:Ops.Sidebar.Button,objName:"Ops.Sidebar.Button"},Ops.Trigger.TriggerExtender=function(){CABLES.Op.apply(this,arguments);var e=this.inTriggerButton("Execute"),t=this.outTrigger("Next");e.onTriggered=function(){t.trigger()}},Ops.Trigger.TriggerExtender.prototype=new CABLES.Op,CABLES.OPS["7ef594f3-4907-47b0-a2d3-9854eda1679d"]={f:Ops.Trigger.TriggerExtender,objName:"Ops.Trigger.TriggerExtender"},Ops.Boolean.Or=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inValueBool("bool 1"),n=e.inValueBool("bool 2"),a=e.inValueBool("bool 3"),r=e.inValueBool("bool 4"),o=e.inValueBool("bool 5"),i=e.inValueBool("bool 6"),l=e.inValueBool("bool 7"),s=e.inValueBool("bool 8"),u=e.outValueBool("result");t.onChange=n.onChange=a.onChange=r.onChange=o.onChange=i.onChange=l.onChange=s.onChange=function(){u.set(t.get()||n.get()||a.get()||r.get()||o.get()||i.get()||l.get()||s.get())}},Ops.Boolean.Or.prototype=new CABLES.Op,CABLES.OPS["b3b36238-4592-4e11-afe3-8361c4fd6be5"]={f:Ops.Boolean.Or,objName:"Ops.Boolean.Or"},Ops.Boolean.ToggleBool=function(){CABLES.Op.apply(this,arguments);const e=this.inTriggerButton("trigger"),t=this.inTriggerButton("reset"),n=this.outValue("result");var a=!1;n.set(a),n.ignoreValueSerialize=!0,e.onTriggered=function(){a=!a,n.set(a)},t.onTriggered=function(){a=!1,n.set(a)}},Ops.Boolean.ToggleBool.prototype=new CABLES.Op,CABLES.OPS["712a25f4-3a93-4042-b8c5-2f56169186cc"]={f:Ops.Boolean.ToggleBool,objName:"Ops.Boolean.ToggleBool"},Ops.Time.DelayedTrigger=function(){CABLES.Op.apply(this,arguments);const e=this.inTrigger("exe"),t=this.inValueFloat("delay",1),n=this.outTrigger("next");var a=null;e.onTriggered=function(){a&&clearTimeout(a),a=setTimeout(function(){a=null,n.trigger()},1e3*t.get())}},Ops.Time.DelayedTrigger.prototype=new CABLES.Op,CABLES.OPS["f4ff66b0-8500-46f7-9117-832aea0c2750"]={f:Ops.Time.DelayedTrigger,objName:"Ops.Time.DelayedTrigger"},Ops.Gl.Render2Texture=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.patch.cgl,n=e.inTrigger("render"),a=e.inValueBool("use viewport size",!0),r=e.inValueInt("texture width",512),o=e.inValueInt("texture height",512),i=e.inSwitch("filter",["nearest","linear","mipmap"],"linear"),l=e.inSwitch("MSAA",["
72none","2x","4x","8x"],"none"),s=e.outTrigger("trigger"),u=e.outTexture("texture"),d=e.outTexture("textureDepth"),c=e.inValueBool("HDR"),b=e.inValueBool("Depth",!0),f=e.inValueBool("Clear",!0);var p=null,m=!0;function g(){a.get()?(r.setUiAttribs({greyout:!0}),o.setUiAttribs({greyout:!0})):(r.setUiAttribs({greyout:!1}),o.setUiAttribs({greyout:!1}))}function v(){if(!p||m){if(p&&p.delete(),t.glVersion>=2){var n=!0,g=4;"none"==l.get()&&(g=0,n=!1),"2x"==l.get()&&(g=2),"4x"==l.get()&&(g=4),"8x"==l.get()&&(g=8),p=new CGL.Framebuffer2(t,8,8,{isFloatingPointTexture:c.get(),multisampling:n,depth:b.get(),multisamplingSamples:g,clear:f.get()})}else p=new CGL.Framebuffer(t,8,8,{isFloatingPointTexture:c.get()});"nearest"==i.get()?p.setFilter(CGL.Texture.FILTER_NEAREST):"linear"==i.get()?p.setFilter(CGL.Texture.FILTER_LINEAR):"mipmap"==i.get()&&p.setFilter(CGL.Texture.FILTER_MIPMAP),d.set(p.getTextureDepth()),m=!1}a.val&&(r.set(t.getViewPort()[2]),o.set(t.getViewPort()[3])),p.getWidth()==Math.ceil(r.get())&&p.getHeight()==Math.ceil(o.get())||p.setSize(Math.max(1,Math.ceil(r.get())),Math.max(1,Math.ceil(o.get()))),p.renderStart(t),s.trigger(),p.renderEnd(t),t.resetViewPort(),u.set(CGL.Texture.getEmptyTexture(e.patch.cgl)),u.set(p.getTextureColor())}u.set(CGL.Texture.getEmptyTexture(t)),e.setPortGroup("Alignment",[a,r,o,i]),a.onChange=g,c.onChange=b.onChange=f.onChange=i.onChange=l.onChange=function(){m=!0},n.onTriggered=v,e.preRender=v,g()},Ops.Gl.Render2Texture.prototype=new CABLES.Op,CABLES.OPS["d01fa820-396c-4cb5-9d78-6b14762852af"]={f:Ops.Gl.Render2Texture,objName:"Ops.Gl.Render2Texture"},Ops.Gl.Meshes.FullscreenRectangle=function(){CABLES.Op.apply(this,arguments);const e=this,t="UNI sampler2D tex;\nIN vec2 texCoord;\n\nvoid main()\n{\n outColor= texture(tex,vec2(texCoord.x,(1.0-texCoord.y)));\n}\n",n="{{MODULES_HEAD}}\n\nIN vec3 vPosition;\nUNI mat4 projMatrix;\nUNI mat4 mvMatrix;\n\nOUT vec2 texCoord;\nIN vec2 attrTexCoord;\n\nvoid main()\n{\n vec4 pos=vec4(vPosition, 1.0);\n\n texCoord=attrTexCoord;\n\n gl_Position = projMatrix * mvMatrix * pos;\n}\n",a=e.inTrigger("render"),r=e.inValueBool("Center in Canvas"),o=e.inValueBool("Flip Y"),i=e.inValueBool("Flip X"),l=e.inTexture("Texture"),s=e.outTrigger("trigger"),u=e.patch.cgl;var d=null,c=new CGL.Geometry("fullscreen rectangle"),b=0,f=0;r.onChange=I,i.onChange=x,o.onChange=x;const p=new CGL.Shader(u,"fullscreenrectangle");p.setModules(["MODULE_VERTEX_POSITION","MODULE_COLOR","MODULE_BEGIN_FRAG"]),p.setSource(n,t),p.fullscreenRectUniform=new CGL.Uniform(p,"t","tex",0);var m=!1,g=!0;function v(){var e=l.get();m=!!e}function h(){if(u.getViewPort()[2]==b&&u.getViewPort()[3]==f&&d||I(),g&&v(),u.pushPMatrix(),mat4.identity(u.pMatrix),mat4.ortho(u.pMatrix,0,b,f,0,-10,1e3),u.pushModelMatrix(),mat4.identity(u.mMatrix),u.pushViewMatrix(),mat4.identity(u.vMatrix),r.get()){var e=0,t=0;b<u.canvasWidth&&(e=(u.canvasWidth-b)/2),f<u.canvasHeight&&(t=(u.canvasHeight-f)/2),u.setViewPort(e,t,b,f)}m?(l.get()&&u.setTexture(0,l.get().tex),d.render(p)):d.render(u.getShader()),u.gl.clear(u.gl.DEPTH_BUFFER_BIT),u.popPMatrix(),u.popModelMatrix(),u.popViewMatrix(),s.trigger()}function x(){d=null}function I(){const e=u.getViewPort();if(e[2]!=b||e[3]!=f||!d){b=e[2],f=e[3],c.vertices=new Float32Array([0+b,0+f,0,0,0+f,0,0+b,0,0,0,0,0]);var t=null;t=o.get()?new Float32Array([1,0,0,0,1,1,0,1]):new Float32Array([1,1,0,1,1,0,0,0]),i.get()&&(t[0]=0,t[2]=1,t[4]=0,t[6]=1),c.setTexCoords(t),c.verticesIndices=new Float32Array([2,1,0,3,1,2]),c.vertexNormals=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1]),c.tangents=new Float32Array([-1,0,0,-1,0,0,-1,0,0,-1,0,0]),c.biTangents,new Float32Array([0,-1,0,0,-1,0,0,-1,0,0,-1,0]),d?d.setGeom(c):d=new CGL.Mesh(u,c)}}a.onTriggered=h,e.toWorkPortsNeedToBeLinked(a),l.onChange=function(){g=!0},e.preRender=function(){v(),p.bind(),d&&d.render(p),h()}},Ops.Gl.Meshes.FullscreenRectangle.prototype=new CABLES.Op,CABLES.OPS["255bd15b-cc91-4a12-9b4e-53c710cbb282"]={f:Ops.Gl.Meshes.FullscreenRectangle,objName:"Ops.Gl.Meshes.FullscreenRectangle"},Ops.Trigger.TriggerReceive=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.outTrigger("Triggered");var n=e.inValueSelect("Named Trigger");o(),e.patch.addEventListener("namedTriggersChanged",o);var a=null;function r(){t.trigger()}function o(){if(CABLES.UI){var t=[],a=e.patch.namedTriggers;for(var r in t.push("+ create new one"),a)t.push(r);n.uiAttribs.values=t}}n.onChange=function(){if(a){var t=e.patch.namedTriggers[a],o=t.indexOf(r);-1!=o&&t.splice(o,1)}e.setTitle(">"+n.get()),e.patch.namedTriggers[n.get()]=e.patch.namedTriggers[n.get()]||[],e.patch.namedTriggers[n.get()].push(r),a=n.get()}},Ops.Trigger.TriggerReceive.prototype=new CABLES.Op,CABLES.OPS["0816c999-f2db-466b-9777-2814573574c5"]={f:Ops.Trigger.TriggerReceive,objName:"Ops.Trigger.TriggerReceive"},Ops.Trigger.TriggerSend=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inTrigger("Trigger"),n=e.inValueSelect("Named Trigger",[],"",!0);function a(){if(CABLES.UI){var t=[],a=e.patch.namedTriggers;for(var r in t.push("+ create new one"),a)t.push(r);n.uiAttribs.values=t}}n.onChange=function(){if(CABLES.UI){if("+ create new one"==n.get())return void CABLES.UI.MODAL.prompt("New Trigger","enter a name for the new trigger","",function(t){n.set(t),e.patch.namedTriggers[t]=e.patch.namedTriggers[t]||[],a()});gui.patch().showOpParams(e)}e.patch.namedTriggers[n.get()]||(e.patch.namedTriggers[n.get()]=e.patch.namedTriggers[n.get()]||[],e.patch.emitEvent("namedTriggersChanged"));e.setTitle(">"+n.get()),CABLES.UI&&gui.patch().showOpParams(e)},t.onTriggered=function(){var t=e.patch.namedTriggers[n.get()];if(!t)return void console.log("unknown trigger array!",n.get());for(var a=0;a<t.length;a++)t[a]()},e.patch.addEventListener("namedTriggersChanged",a),a()},Ops.Trigger.TriggerSend.prototype=new CABLES.Op,CABLES.OPS["ce1eaf2b-943b-4dc0-ab5e-ee11b63c9ed0"]={f:Ops.Trigger.TriggerSend,objName:"Ops.Trigger.TriggerSend"},Ops.Gl.TextureEffects.DrawImage_v2=function(){CABLES.Op.apply(this,arguments);const e=this,t="#ifdef HAS_TEXTURES\n IN vec2 texCoord;\n UNI sampler2D tex;\n UNI sampler2D image;\n#endif\n\nIN mat3 transform;\nUNI float rotate;\n\n{{CGL.BLENDMODES}}\n\n#ifdef HAS_TEXTUREALPHA\n UNI sampler2D imageAlpha;\n#endif\n\nUNI float amount;
72\n\n#ifdef ASPECT_RATIO\n UNI float aspectTex;\n UNI float aspectPos;\n#endif\n\nvoid main()\n{\n vec4 blendRGBA=vec4(0.0,0.0,0.0,1.0);\n #ifdef HAS_TEXTURES\n vec2 tc=texCoord;\n\n #ifdef TEX_FLIP_X\n tc.x=1.0-tc.x;\n #endif\n #ifdef TEX_FLIP_Y\n tc.y=1.0-tc.y;\n #endif\n\n #ifdef ASPECT_RATIO\n #ifdef ASPECT_AXIS_X\n tc.y=(1.0-aspectPos)-(((1.0-aspectPos)-tc.y)*aspectTex);\n #endif\n #ifdef ASPECT_AXIS_Y\n tc.x=(1.0-aspectPos)-(((1.0-aspectPos)-tc.x)/aspectTex);\n #endif\n #endif\n\n #ifdef TEX_TRANSFORM\n vec3 coordinates=vec3(tc.x, tc.y,1.0);\n tc=(transform * coordinates ).xy;\n #endif\n\n blendRGBA=texture(image,tc);\n\n vec3 blend=blendRGBA.rgb;\n vec4 baseRGBA=texture(tex,texCoord);\n vec3 base=baseRGBA.rgb;\n vec3 colNew=_blend(base,blend);\n\n #ifdef REMOVE_ALPHA_SRC\n blendRGBA.a=1.0;\n #endif\n\n #ifdef HAS_TEXTUREALPHA\n vec4 colImgAlpha=texture(imageAlpha,tc);\n float colImgAlphaAlpha=colImgAlpha.a;\n\n #ifdef ALPHA_FROM_LUMINANCE\n vec3 gray = vec3(dot(vec3(0.2126,0.7152,0.0722), colImgAlpha.rgb ));\n colImgAlphaAlpha=(gray.r+gray.g+gray.b)/3.0;\n #endif\n\n #ifdef ALPHA_FROM_INV_UMINANCE\n vec3 gray = vec3(dot(vec3(0.2126,0.7152,0.0722), colImgAlpha.rgb ));\n colImgAlphaAlpha=1.0-(gray.r+gray.g+gray.b)/3.0;\n #endif\n\n blendRGBA.a=colImgAlphaAlpha*blendRGBA.a;\n #endif\n #endif\n\n #ifdef CLIP_REPEAT\n if(tc.y>1.0 || tc.y<0.0 || tc.x>1.0 || tc.x<0.0)colNew.rgb=vec3(0.0);\n #endif\n\n #ifdef ASPECT_RATIO\n #ifdef ASPECT_CROP\n if(tc.y>1.0 || tc.y<0.0 || tc.x>1.0 || tc.x<0.0) colNew.rgb=base.rgb;//vec3(0.0);\n #endif\n #endif\n\n blendRGBA.rgb=mix( colNew, base ,1.0-blendRGBA.a*amount);\n blendRGBA.a=1.0;\n\n outColor= blendRGBA;\n\n}",n="IN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\n\nUNI mat4 projMatrix;\nUNI mat4 mvMatrix;\n\nUNI float posX;\nUNI float posY;\nUNI float scaleX;\nUNI float scaleY;\nUNI float rotate;\n\nOUT vec2 texCoord;\nOUT vec3 norm;\nOUT mat3 transform;\n\nvoid main()\n{\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n\n #ifdef TEX_TRANSFORM\n vec3 coordinates=vec3(attrTexCoord.x, attrTexCoord.y,1.0);\n float angle = radians( rotate );\n vec2 scale= vec2(scaleX,scaleY);\n vec2 translate= vec2(posX,posY);\n\n transform = mat3( scale.x * cos( angle ), scale.x * sin( angle ), 0.0,\n - scale.y * sin( angle ), scale.y * cos( angle ), 0.0,\n - 0.5 * scale.x * cos( angle ) + 0.5 * scale.y * sin( angle ) - 0.5 * translate.x*2.0 + 0.5, - 0.5 * scale.x * sin( angle ) - 0.5 * scale.y * cos( angle ) - 0.5 * translate.y*2.0 + 0.5, 1.0);\n #endif\n\n gl_Position = projMatrix * mvMatrix * vec4(vPosition, 1.0);\n}\n";var a=e.inTrigger("render"),r=CGL.TextureEffect.AddBlendSelect(e,"blendMode"),o=e.inValueSlider("amount",1),i=e.inTexture("image"),l=e.inValueBool("removeAlphaSrc",!1),s=e.inTexture("imageAlpha"),u=e.inValueSelect("alphaSrc",["alpha channel","luminance","luminance inv"]),d=e.inValueBool("invert alpha channel");const c=e.inValueBool("Aspect Ratio",!1),b=e.inValueSelect("Stretch Axis",["X","Y"],"X"),f=e.inValueSlider("Position",0),p=e.inValueBool("Crop",!1);var m=e.outTrigger("trigger");r.set("normal");var g=e.patch.cgl,v=new CGL.Shader(g,"drawimage");function h(){s.isLinked()?(l.setUiAttribs({greyout:!0}),u.setUiAttribs({greyout:!1}),d.setUiAttribs({greyout:!1})):(l.setUiAttribs({greyout:!1}),u.setUiAttribs({greyout:!0}),d.setUiAttribs({greyout:!0}))}s.onLinkChanged=h,e.setPortGroup("Mask",[s,u,d]),e.setPortGroup("Aspect Ratio",[c,f,p,b]),l.onChange=O,e.toWorkPortsNeedToBeLinked(i),v.setSource(n,t);new CGL.Uniform(v,"t","tex",0),new CGL.Uniform(v,"t","image",1),new CGL.Uniform(v,"t","imageAlpha",2);const x=new CGL.Uniform(v,"f","aspectTex",1);new CGL.Uniform(v,"f","aspectPos",f);function I(){v.removeDefine("ASPECT_AXIS_X"),v.removeDefine("ASPECT_AXIS_Y"),c.get()?(v.define("ASPECT_RATIO"),p.get()?v.define("ASPECT_CROP"):v.removeDefine("ASPECT_CROP"),"X"==b.get()&&v.define("ASPECT_AXIS_X"),"Y"==b.get()&&v.define("ASPECT_AXIS_Y"),f.setUiAttribs({greyout:!1}),p.setUiAttribs({greyout:!1}),b.setUiAttribs({greyout:!1})):(v.removeDefine("ASPECT_RATIO"),p.get()?v.define("ASPECT_CROP"):v.removeDefine("ASPECT_CROP"),"X"==b.get()&&v.define("ASPECT_AXIS_X"),"Y"==b.get()&&v.define("ASPECT_AXIS_Y"),f.setUiAttribs({greyout:!0}),p.setUiAttribs({greyout:!0}),b.setUiAttribs({greyout:!0}))}function O(){l.get()?v.define("REMOVE_ALPHA_SRC"):v.removeDefine("REMOVE_ALPHA_SRC")}d.onChange=function(){d.get()?v.define("INVERT_ALPHA"):v.removeDefine("INVERT_ALPHA")},c.onChange=I,p.onChange=I,b.onChange=I,u.onChange=function(){v.toggleDefine("ALPHA_FROM_LUMINANCE","luminance"==u.get()),v.toggleDefine("ALPHA_FROM_INV_UMINANCE","luminance_inv"==u.get())},u.set("alpha channel");var A=e.inValueBool("flip x"),T=e.inValueBool("flip y");A.onChange=function(){A.get()?v.define("TEX_FLIP_X"):v.removeDefine("TEX_FLIP_X")},T.onChange=function(){T.get()?v.define("TEX_FLIP_Y"):v.removeDefine("TEX_FLIP_Y")};var S=e.inValueBool("Transform"),C=e.inValueSlider("Scale X",1),E=e.inValueSlider("Scale Y",1),y=e.inValue("Position X",0),M=e.inValue("Position Y",0),L=e.inValue("Rotation",0),N=e.inValueBool("Clip Repeat",!1);N.onChange=function(){N.get()?v.define("CLIP_REPEAT"):v.removeDefine("CLIP_REPEAT")};new CGL.Uniform(v,"f","scaleX",C),new CGL.Uniform(v,"f","scaleY",E),new CGL.Uniform(v,"f","posX",y),new CGL.Uniform(v,"f","posY",M),new CGL.Uniform(v,"f","rotate",L);S.onChange=j;function j(){v.toggleDefine("TEX_TRANSFORM",S.get()),S.get()?(C.setUiAttribs({greyout:!1}),E.setUiAttribs({greyout:!1}),y.setUiAttribs({greyout:!1}),M.setUiAttribs({greyout:!1}),L.setUiAttribs({greyout:!1})):(C.setUiAttribs({greyout:!0}),E.setUiAttribs({greyout:!0}),y.setUiAttribs({greyout:!0}),M.setUiAttribs({greyout:!0}),L.setUiAttribs({greyout:!0}))}CGL.TextureEffect.setupBlending(e,v,r,o);new CGL.Uniform(v,"f","amount",o);s.onChange=function(){s.get()&&s.get().tex?v.define("HAS_TEXTUREALPHA"):v.removeDefine("HAS_TEXTUREALPHA")},a.onTriggered=function(){if(CGL.TextureEffect.checkOpInEffect(e)){var t=i.get();if(t&&t.tex&&o.get()>0){g.setShader(v),g.currentTextureEffect.bind();const e=g.currentTextureEffect.getCurrentSourceTexture();g.setTexture(0,e.tex),x.setValue(1/(t.height/t.width*e.width/e.height)),g.setTexture(1,t.tex),s.get()&&s.get().tex&&g.setTexture(2,s.get().tex),g.currentTextureEffect.finish(),g.setPreviousShader()}m.trigger()}},j(),O(),h(),I()},Ops.Gl.TextureEffects.DrawImage_v2.prototype=new CABLES.Op,CABLES.OPS["f94b5136-61fd-4558-8348-e7c8db5a6348"]={f:Ops.Gl.TextureEffects.DrawImage_v2,objName:"Ops.Gl.TextureEffects.DrawImage_v2"},Ops.Gl.TextureEffects.Levels=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inTrigger("Render"),n=e.inValueSlider("In Min",0),a=e.inValueSlider("Midpoint",.5),r=e.inValueSlider("In Max",1),o=e.inValueSlider("Out Min",0),i=e.inValueSlider("Out Max",1),l=e.addOutPort(new CABLES.Port(e,"Next",CABLES.OP_PORT_TYPE_FUNCTION)),s=e.patch.cgl,u=new CGL.Shader(s);new CGL.Uniform(u,"f","inMin",n),new CGL.Uniform(u,"f","midPoint",a),new CGL.Uniform(u,"f","inMax",r),new CGL.Uniform(u,"f","outMin",o),new CGL.Uniform(u,"f","outMax",i);u.setSource(u.getDefaultVertexShader(),"IN vec2 texCoord;\nUNI sampler2D tex;\nUNI float inMin;\nUNI float inMax;\nUNI float midPoint;\nUNI float outMax;\nUNI float outMin;\n\nvoid main()\n{\n vec3 base=texture(tex,texCoord).rgb;\n vec3 inputRange = min(max(base - vec3(inMin), vec3(0.0)) / (vec3(inMax) - vec3(inMin)), vec3(outMax));\n\n inputRange = pow(inputRange, vec3(1.0 / (1.5 - midPoint)));\n\n outColor.a=1.0;\n outColor.rgb= mix(vec3(outMin), vec3(1.0), inputRange);\n}");new CGL.Uniform(u,"t","tex",0);t.onTriggered=function(){CGL.TextureEffect.checkOpInEffect(e)&&(s.setShader(u),s.currentTextureEffect.bind(),s.setTexture(0,s.currentTextureEffect.getCurrentSourceTexture().tex),s.currentTextureEffect.finish(),s.setPreviousShader(),l.trigger())}},Ops.Gl.TextureEffects.Levels.prototype=new CABLES.Op,CABLES.OPS["42ad6bbe-df17-48c7-89dd-bd7022113897"]={f:Ops.Gl.TextureEffects.Levels,objName:"Ops.Gl.TextureEffects.Levels"},Ops.Gl.TextureEffects.Blur=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inTrigger("render"),n=e.outTrigger("trigger"),a=e.inValueFloat("amount"),r=e.inSwitch("direction",["both","vertical","horizontal"],"both"),o=e.inValueBool("Fast",!0),i=e.patch.cgl;a.set(10);var l=new CGL.Shader(i);l.define("FASTBLUR"),o.onChange=function(){o.get()?l.define("FASTBLUR"):l.removeDefine("FASTBLUR")},l.setSource(l.getDefaultVertexShader(),"IN vec2 texCoord;\nUNI sampler2D tex;\nUNI float dirX;\nUNI float dirY;\nUNI float amount;
72\n\n#ifdef HAS_MASK\n UNI sampler2D imageMask;\n#endif\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main()\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float am=amount;\n #ifdef HAS_MASK\n am=amount*texture(imageMask,texCoord).r;\n if(am<=0.02)\n {\n outColor=texture(tex, texCoord);\n return;\n }\n #endif\n\n vec2 delta=vec2(dirX*am*0.01,dirY*am*0.01);\n\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n #ifdef MOBILE\n offset = 0.1;\n #endif\n\n #if defined(FASTBLUR) && !defined(MOBILE)\n const float range=5.0;\n #else\n const float range=20.0;\n #endif\n\n for (float t = -range; t <= range; t+=1.0)\n {\n float percent = (t + offset - 0.5) / range;\n float weight = 1.0 - abs(percent);\n vec4 smpl = texture(tex, texCoord + delta * percent);\n\n smpl.rgb *= smpl.a;\n\n color += smpl * weight;\n total += weight;\n }\n\n outColor= color / total;\n\n outColor.rgb /= outColor.a + 0.00001;\n\n\n\n}\n");new CGL.Uniform(l,"t","tex",0);var s=new CGL.Uniform(l,"f","dirX",0),u=new CGL.Uniform(l,"f","dirY",0),d=new CGL.Uniform(l,"f","width",0),c=new CGL.Uniform(l,"f","height",0),b=new CGL.Uniform(l,"f","amount",a.get());a.onChange=function(){b.setValue(a.get())};new CGL.Uniform(l,"t","imageMask",1);var f=0;r.onChange=function(){"both"==r.get()&&(f=0),"horizontal"==r.get()&&(f=1),"vertical"==r.get()&&(f=2)};var p=e.inTexture("mask");p.onChange=function(){p.get()&&p.get().tex?l.define("HAS_MASK"):l.removeDefine("HAS_MASK")},t.onTriggered=function(){CGL.TextureEffect.checkOpInEffect(e)&&(i.setShader(l),d.setValue(i.currentTextureEffect.getCurrentSourceTexture().width),c.setValue(i.currentTextureEffect.getCurrentSourceTexture().height),0!==f&&2!=f||(i.currentTextureEffect.bind(),i.setTexture(0,i.currentTextureEffect.getCurrentSourceTexture().tex),p.get()&&p.get().tex&&i.setTexture(1,p.get().tex),s.setValue(0),u.setValue(1),i.currentTextureEffect.finish()),0!==f&&1!=f||(i.currentTextureEffect.bind(),i.setTexture(0,i.currentTextureEffect.getCurrentSourceTexture().tex),p.get()&&p.get().tex&&i.setTexture(1,p.get().tex),s.setValue(1),u.setValue(0),i.currentTextureEffect.finish()),i.setPreviousShader(),n.trigger())}},Ops.Gl.TextureEffects.Blur.prototype=new CABLES.Op,CABLES.OPS["54f26f53-f637-44c1-9bfb-a2f2b722e998"]={f:Ops.Gl.TextureEffects.Blur,objName:"Ops.Gl.TextureEffects.Blur"},Ops.Gl.TextureEffects.LumaKey=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inTrigger("render"),n=e.outTrigger("trigger"),a=e.inValueBool("Invert"),r=e.inValueBool("Black White"),o=e.inValueSlider("Threshold",.5),i=e.patch.cgl,l=new CGL.Shader(i,"lumakey");l.setSource(l.getDefaultVertexShader(),"IN vec2 texCoord;\n// UNI sampler2D tex;\nUNI float threshhold;\nUNI sampler2D text;\n\nvoid main()\n{\n vec4 col = texture(text, texCoord );\n\n float gray = dot(vec3(0.2126,0.7152,0.0722), col.rgb );\n\n #ifndef INVERT\n if(gray < threshhold) col.r=col.g=col.b=col.a=0.0;\n #ifdef BLACKWHITE\n else col.r=col.g=col.b=col.a=1.0;\n #endif\n #endif\n\n #ifdef INVERT\n if(gray > threshhold) col.r=col.g=col.b=col.a=0.0;\n #ifdef BLACKWHITE\n else col.r=col.g=col.b=col.a=1.0;\n #endif\n #endif\n\n outColor= col;\n}");new CGL.Uniform(l,"t","tex",0),new CGL.Uniform(l,"f","threshhold",o);r.onChange=function(){r.get()?l.define("BLACKWHITE"):l.removeDefine("BLACKWHITE")},a.onChange=function(){a.get()?l.define("INVERT"):l.removeDefine("INVERT")},t.onTriggered=function(){CGL.TextureEffect.checkOpInEffect(e)&&(i.setShader(l),i.currentTextureEffect.bind(),i.setTexture(0,i.currentTextureEffect.getCurrentSourceTexture().tex),i.currentTextureEffect.finish(),i.setPreviousShader(),n.trigger())}},Ops.Gl.TextureEffects.LumaKey.prototype=new CABLES.Op,CABLES.OPS["2175ae00-989c-4045-a52e-742d5c30bf4e"]={f:Ops.Gl.TextureEffects.LumaKey,objName:"Ops.Gl.TextureEffects.LumaKey"},Ops.Gl.TextureEffects.BrightnessContrast=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inTrigger("render"),n=e.inValueSlider("contrast",.5),a=e.inValueSlider("brightness",.5),r=e.outTrigger("trigger"),o=e.patch.cgl,i=new CGL.Shader(o,"brightnesscontrast");i.setSource(i.getDefaultVertexShader(),"IN vec2 texCoord;\nUNI sampler2D tex;\nUNI float amount;
72\nUNI float amountbright;\n\nvoid main()\n{\n vec4 col=vec4(1.0,0.0,0.0,1.0);\n col=texture(tex,texCoord);\n\n // apply contrast\n col.rgb = ((col.rgb - 0.5) * max(amount*2.0, 0.0))+0.5;\n\n // apply brightness\n col.rgb *= amountbright*2.0;\n\n outColor = col;\n}");new CGL.Uniform(i,"t","tex",0),new CGL.Uniform(i,"f","amount",n),new CGL.Uniform(i,"f","amountbright",a);t.onTriggered=function(){CGL.TextureEffect.checkOpInEffect(e)&&o.currentTextureEffect.getCurrentSourceTexture()&&CGL.TextureEffect.checkOpInEffect(e)&&(o.setShader(i),o.currentTextureEffect.bind(),o.setTexture(0,o.currentTextureEffect.getCurrentSourceTexture().tex),o.currentTextureEffect.finish(),o.setPreviousShader(),r.trigger())}},Ops.Gl.TextureEffects.BrightnessContrast.prototype=new CABLES.Op,CABLES.OPS["54b89199-c594-4dff-bc48-82d6c7a55e8a"]={f:Ops.Gl.TextureEffects.BrightnessContrast,objName:"Ops.Gl.TextureEffects.BrightnessContrast"},Ops.Gl.TextureEffects.Color=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inTrigger("render"),n=CGL.TextureEffect.AddBlendSelect(e,"Blend Mode","normal"),a=e.inValueSlider("Amount",1),r=e.inTexture("Mask"),o=e.inValueBool("Mask Invert"),i=e.inValueSlider("r",Math.random()),l=e.inValueSlider("g",Math.random()),s=e.inValueSlider("b",Math.random()),u=e.outTrigger("trigger");i.setUiAttribs({colorPick:!0}),e.setPortGroup("Color",[i,l,s]);const d=e.patch.cgl,c=new CGL.Shader(d,"textureeffect color");c.setSource(c.getDefaultVertexShader(),"IN vec2 texCoord;\nUNI sampler2D tex;\nUNI float r;\nUNI float g;\nUNI float b;\nUNI float amount;
72\n\n#ifdef MASK\n UNI sampler2D mask;\n#endif\n\n{{CGL.BLENDMODES}}\n\nvoid main()\n{\n vec4 col=vec4(r,g,b,1.0);\n vec4 base=texture(tex,texCoord);\n\n float am=amount;\n #ifdef MASK\n float msk=texture(mask,texCoord).r;\n #ifdef INVERTMASK\n msk=1.0-msk;\n #endif\n am*=1.0-msk;\n #endif\n\n outColor= cgl_blend(base,col,am);\n outColor.a*=base.a;\n\n}\n");new CGL.Uniform(c,"t","tex",0),new CGL.Uniform(c,"t","mask",1),new CGL.Uniform(c,"f","r",i),new CGL.Uniform(c,"f","g",l),new CGL.Uniform(c,"f","b",s),new CGL.Uniform(c,"f","amount",a);r.onChange=function(){r.get()?c.define("MASK"):c.removeDefine("MASK")},o.onChange=function(){o.get()?c.define("INVERTMASK"):c.removeDefine("INVERTMASK")},CGL.TextureEffect.setupBlending(e,c,n,a),t.onTriggered=function(){CGL.TextureEffect.checkOpInEffect(e)&&(d.setShader(c),d.currentTextureEffect.bind(),d.setTexture(0,d.currentTextureEffect.getCurrentSourceTexture().tex),r.get()&&d.setTexture(1,r.get().tex),d.currentTextureEffect.finish(),d.setPreviousShader(),u.trigger())}},Ops.Gl.TextureEffects.Color.prototype=new CABLES.Op,CABLES.OPS["c0acfc80-16f9-4f17-978d-bad650f3ed1c"]={f:Ops.Gl.TextureEffects.Color,objName:"Ops.Gl.TextureEffects.Color"},Ops.Gl.Phong.PhongMaterial_v4=function(){CABLES.Op.apply(this,arguments);const e=this,t="\n// https://www.mathematik.uni-marburg.de/~thormae/lectures/graphics1/code/WebGLShaderLightMat/ShaderLightMat.html\nstruct Material {\n\tvec3 diffuse;\n\tfloat shininess;\n\tfloat specularCoefficient;\n};\n\nstruct Light {\n vec3 position;\n vec3 color;\n vec3 specular;\n int type;\n vec3 lightProperties; // x - intensity, y - radius, z - falloff\n vec3 spotProperties; // x - spotExponent, y - cosConeAngle, z - cosConeAngleInner\n float intensity;\n float radius;\n float falloff;\n float cosConeAngle;\n float cosConeAngleInner;\n float spotExponent;\n vec3 conePointAt;\n};\n\n#ifdef HAS_TEXTURES\n UNI vec4 inTextureIntensities;\n #ifdef HAS_TEXTURE_DIFFUSE\n UNI sampler2D texDiffuse;\n #endif\n\n #ifdef HAS_TEXTURE_SPECULAR\n UNI sampler2D texSpecular;\n #endif\n\n #ifdef HAS_TEXTURE_NORMAL\n UNI sampler2D texNormal;\n #endif\n\n #ifdef HAS_TEXTURE_AO\n UNI sampler2D texAO;\n #endif\n\n #ifdef HAS_TEXTURE_EMISSIVE\n UNI sampler2D texEmissive;\n #endif\n #ifdef HAS_TEXTURE_ALPHA\n UNI sampler2D texAlpha;\n #endif\n#endif\n\nUNI vec3 camPos;\nUNI mat4 viewMatrix;\nUNI Light lights[MAX_LIGHTS];\nUNI vec4 inDiffuseColor;\nUNI vec4 inMaterialProperties;\n\n\n#ifdef ENABLE_FRESNEL\n UNI vec4 inFresnel;\n UNI vec2 inFresnelWidthExponent;\n#endif\n\n\nIN vec2 texCoord;\nIN vec3 normInterpolated;\nIN vec3 fragPos;\nIN mat3 TBN_Matrix;\nIN vec4 cameraSpace_pos;\nIN vec3 v_viewDirection;\n\n\n/* CONSTANTS */\n#define PI 3.1415926535897932384626433832795\n#define NONE -1\n#define AMBIENT 0\n#define POINT 1\n#define DIRECTIONAL 2\n#define SPOT 3\n#define ALBEDO x;\n#define ROUGHNESS y;\n#define SHININESS z;\n#define SPECULAR_AMT w;\n#define NORMAL x;\n#define AO y;\n#define SPECULAR z;\n#define EMISSIVE w;\nconst float TWO_PI = 2.*PI;\nconst float EIGHT_PI = 8.*PI;\n\n{{MODULES_HEAD}}\n\nfloat when_gt(float x, float y) { return max(sign(x - y), 0.0); } // comparator function\nfloat when_eq(float x, float y) { return 1. - abs(sign(x - y)); } // comparator function\nfloat when_neq(float x, float y) { return abs(sign(x - y)); } // comparator function\n\n#ifdef CONSERVE_ENERGY\n // http://www.rorydriscoll.com/2009/01/25/energy-conservation-in-games/\n // http://www.farbrausch.de/~fg/articles/phong.pdf\n float EnergyConservation(float shininess) {\n #ifdef SPECULAR_PHONG\n return (shininess + 2.)/TWO_PI;\n #endif\n #ifdef SPECULAR_BLINN\n return (shininess + 8.)/EIGHT_PI;\n #endif\n\n #ifdef SPECULAR_SCHLICK\n return (shininess + 8.)/EIGHT_PI;\n #endif\n\n #ifdef SPECULAR_GAUSS\n return (shininess + 8.)/EIGHT_PI;\n #endif\n }\n#endif\n\n#ifdef ENABLE_OREN_NAYAR_DIFFUSE\n float CalculateOrenNayar(vec3 lightDirection, vec3 viewDirection, vec3 normal) {\n float LdotV = dot(lightDirection, viewDirection);
72\n float NdotL = dot(lightDirection, normal);\n float NdotV = dot(normal, viewDirection);\n\n float albedo = inMaterialProperties.ALBEDO;\n albedo *= 1.8;\n float s = LdotV - NdotL * NdotV;\n float t = mix(1., max(NdotL, NdotV), step(0., s));\n\n float roughness = inMaterialProperties.ROUGHNESS;\n float sigma2 = roughness * roughness;\n float A = 1. + sigma2 * (albedo / (sigma2 + 0.13) + 0.5 / (sigma2 + 0.33));\n float B = 0.45 * sigma2 / (sigma2 + 0.09);\n\n float factor = albedo * max(0., NdotL) * (A + B * s / t) / PI;\n\n return factor;\n\n }\n#endif\n\n#ifdef ENABLE_FRESNEL\n float CalculateFresnel(vec3 direction, vec3 normal)\n {\n\n vec3 nDirection = normalize( direction );\n vec3 nNormal = normalize( mat3(viewMatrix) * normal );\n vec3 halfDirection = normalize( nNormal + nDirection );\n\n float cosine = dot( halfDirection, nDirection );\n float product = max( cosine, 0.0 );\n float factor = pow(product, inFresnelWidthExponent.y);\n\n return 5. * factor;\n\n }\n#endif\n\n\nfloat CalculateFalloff(Light light, float distance) {\n float denom = distance / light.radius + 1.0;\n float attenuation = 1.0 / (denom*denom);\n float t = (attenuation - light.falloff) / (1.0 - light.falloff);\n return max(t, 0.0);\n}\n\nvec4 CalculateDiffuseColor(Material material, Light light, vec3 lightDirection, vec3 viewDirection, vec3 normal) {\n #ifndef ENABLE_OREN_NAYAR_DIFFUSE\n float lambertian = clamp(dot(lightDirection, normal), 0., 1.);\n #endif\n\n #ifdef ENABLE_OREN_NAYAR_DIFFUSE\n float lambertian = CalculateOrenNayar(lightDirection, viewDirection, normal);\n #endif\n\n vec3 diffuseColor = lambertian*material.diffuse*light.color;\n return vec4(diffuseColor, lambertian);\n}\n\nvec3 CalculateSpecularColor(Material material, Light light, vec3 lightDirection, vec3 viewDirection, vec3 normal, float lambertian) {\n vec3 specularColor = vec3(0.);\n\n #ifdef SPECULAR_PHONG\n vec3 reflectDirection = reflect(-lightDirection, normal);\n float specularAngle = max(dot(reflectDirection, viewDirection), 0.);\n float specularFactor = pow(specularAngle, max(0., material.shininess));\n specularColor = lambertian * specularFactor * material.specularCoefficient * light.specular;\n #endif\n\n #ifdef SPECULAR_BLINN\n vec3 halfDirection = normalize(lightDirection + viewDirection);\n float specularAngle = max(dot(halfDirection, normal), 0.);\n float specularFactor = pow(specularAngle, max(0., material.shininess));\n specularColor = lambertian * specularFactor * material.specularCoefficient * light.specular;\n #endif\n\n #ifdef SPECULAR_SCHLICK\n vec3 halfDirection = normalize(lightDirection + viewDirection);\n float specularAngle = dot(halfDirection, normal);\n float shininess = max(0., material.shininess);\n float specularFactor = specularAngle / (shininess - shininess*specularAngle + specularAngle);\n specularColor = lambertian * specularFactor * material.specularCoefficient * light.specular;\n #endif\n\n #ifdef SPECULAR_GAUSS\n vec3 halfDirection = normalize(lightDirection + viewDirection);\n float specularAngle = acos(max(dot(halfDirection, normal), 0.));\n float exponent = specularAngle * material.shininess * 0.17;\n exponent = -(exponent*exponent);\n float specularFactor = exp(exponent);\n\n specularColor = lambertian*specularFactor * material.specularCoefficient * light.specular;\n #endif\n\n #ifdef CONSERVE_ENERGY\n float conserveEnergyFactor = EnergyConservation(material.shininess);\n specularColor = conserveEnergyFactor * specularColor;\n #endif\n\n return specularColor;\n}\n\nfloat CalculateSpotLightEffect(Light light, vec3 lightDirection) {\n vec3 spotLightDirection = normalize(light.position-light.conePointAt);\n float spotAngle = dot(-lightDirection, spotLightDirection);\n float epsilon = light.cosConeAngle - light.cosConeAngleInner;\n\n float spotIntensity = clamp((spotAngle - light.cosConeAngle)/epsilon, 0.0, 1.0);\n spotIntensity = pow(spotIntensity, max(0.01, light.spotExponent));\n\n return max(0., spotIntensity);\n}\n\nvoid main() {\n {{MODULE_BEGIN_FRAG}}\n\n vec3 normal = normalize(normInterpolated);\n vec2 uv = texCoord;\n\n #ifdef DOUBLE_SIDED\n if(!gl_FrontFacing) normal = normal*-1.0;\n #endif\n\n Material material;\n material.diffuse = inDiffuseColor.rgb;\n material.shininess = inMaterialProperties.SHININESS;\n material.specularCoefficient = inMaterialProperties.SPECULAR_AMT;\n\n float alpha = inDiffuseColor.a;\n\n #ifdef HAS_TEXTURES\n #ifdef HAS_TEXTURE_DIFFUSE\n material.diffuse = texture(texDiffuse, texCoord).rgb;\n\n #ifdef COLORIZE_TEXTURE\n material.diffuse *= inDiffuseColor.rgb;\n #endif\n #endif\n\n #ifdef HAS_TEXTURE_NORMAL\n normal = texture(texNormal, texCoord).rgb;\n normal = normalize(normal * 2. - 1.);\n float normalIntensity = inTextureIntensities.NORMAL;\n normal = normalize(mix(vec3(0., 0., 1.), normal, 2. * normalIntensity));
72\n normal =normalize(TBN_Matrix * normal);\n #endif\n #endif\n\n vec3 color = vec3(0.);\n vec4 col = vec4(0.);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n Light light = lights[i];\n light.intensity = light.lightProperties.x;\n\n if (light.type == NONE) continue;\n\n else if (light.type == AMBIENT) {\n color = light.intensity*light.color;\n }\n else {\n\n // lightProperties; // x - intensity, y - radius, z - falloff\n light.radius = light.lightProperties.y;\n light.falloff = light.lightProperties.z;\n\n // spotProperties; // x - spotExponent, y - cosConeAngle, z - cosConeAngleInner\n light.spotExponent = light.spotProperties.x;\n light.cosConeAngle = light.spotProperties.y;\n light.cosConeAngleInner = light.spotProperties.z;\n\n // when light is not directional, we subtract fragpos, if it is we just use position\n vec3 lightDirection = normalize(light.position - when_neq(float(light.type), float(DIRECTIONAL)) * fragPos);\n vec3 viewDirection = normalize(v_viewDirection);\n\n\n #ifdef HAS_TEXTURES\n #ifdef HAS_TEXTURE_AO\n float aoIntensity = inTextureIntensities.AO;\n light.color *= mix(vec3(1.), texture(texAO, texCoord).rgb, aoIntensity);\n #endif\n\n #ifdef HAS_TEXTURE_SPECULAR\n float specularIntensity = inTextureIntensities.SPECULAR;\n light.specular *= mix(1., texture(texSpecular, texCoord).r, specularIntensity);\n #endif\n #endif\n\n vec4 diffuseColorLambert = CalculateDiffuseColor(material, light, lightDirection, viewDirection, normal);\n vec3 diffuseColor = diffuseColorLambert.rgb;\n float lambertian = diffuseColorLambert.w;\n\n // attenuation\n float distanceLightFrag = length(light.position - fragPos);\n float attenuation = CalculateFalloff(light, distanceLightFrag);\n attenuation *= when_gt(lambertian, 0.);\n\n // when_eq returns 1 when light type == DIRECTIONAL, 0 else, we take the max -> dirLight gets attenuation of 1.\n attenuation = max(attenuation, when_eq(float(light.type), float(DIRECTIONAL)));\n\n vec3 specularColor = CalculateSpecularColor(material, light, lightDirection, viewDirection, normal, lambertian);\n\n color = light.intensity * (diffuseColor + specularColor);\n\n color *= attenuation;\n\n if (light.type == SPOT) {\n float spotIntensity = CalculateSpotLightEffect(light, lightDirection);\n color *= spotIntensity;\n }\n\n }\n\n #ifdef ENABLE_FRESNEL\n color += inFresnel.rgb * (CalculateFresnel(vec3(cameraSpace_pos), normal) * inFresnel.w * inFresnelWidthExponent.x);\n #endif\n\n col += vec4(clamp(color, 0.0, 1.0), alph
72a);\n }\n\n col.a = alpha;\n\n #ifdef HAS_TEXTURE_ALPHA\n #ifdef TRANSFORMALPHATEXCOORDS\n uv=vec2(texCoord.s,1.0-texCoord.t);\n #endif\n #ifdef ALPHA_MASK_ALPHA\n col.a*=texture(texAlpha,uv).a;\n #endif\n #ifdef ALPHA_MASK_LUMI\n col.a*= dot(vec3(0.2126,0.7152,0.0722), texture(texAlpha,uv).rgb);\n #endif\n #ifdef ALPHA_MASK_R\n col.a*=texture(texAlpha,uv).r;\n #endif\n #ifdef ALPHA_MASK_G\n col.a*=texture(texAlpha,uv).g;\n #endif\n #ifdef ALPHA_MASK_B\n col.a*=texture(texAlpha,uv).b;\n #endif\n #endif\n\n #ifdef HAS_TEXTURE_EMISSIVE\n float emissiveIntensity = inTextureIntensities.EMISSIVE;\n col.rgb += emissiveIntensity * material.diffuse * texture(texEmissive, texCoord).r;\n #endif\n\n\n {{MODULE_COLOR}}\n\n #ifdef DISCARDTRANS\n if(col.a<0.2) discard;\n #endif\n\n // outColor = vec4(1., 0., 0., 1.);\n outColor = clamp(col, 0., 1.);\n //outColor = vec4()\n}",n="\n{{MODULES_HEAD}}\n\n#define NONE -1\n#define AMBIENT 0\n#define POINT 1\n#define DIRECTIONAL 2\n#define SPOT 3\n\n#define TEX_REPEAT_X x;\n#define TEX_REPEAT_Y y;\n#define TEX_OFFSET_X z;\n#define TEX_OFFSET_Y w;\n\nIN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\nIN vec3 attrTangent;\nIN vec3 attrBiTangent;\n\nOUT vec2 texCoord;\nOUT vec3 norm;\nOUT vec3 normInterpolated;\nOUT vec3 tangent;\nOUT vec3 bitangent;\nOUT vec3 fragPos;\n\n\nOUT mat3 TBN_Matrix; // tangent bitangent normal space transform matrix\nOUT vec4 cameraSpace_pos;\nOUT vec3 v_viewDirection;\n\n#ifdef HAS_TEXTURES\n UNI vec4 inTextureRepeatOffset;\n#endif\n\nstruct Light {\n vec3 position;\n int type;\n};\n\nUNI vec3 camPos;\nUNI mat4 projMatrix;\nUNI mat4 viewMatrix;\nUNI mat4 modelMatrix;\nUNI mat4 normalMatrix;\n\n\nmat3 transposeMat3(mat3 m)\n{\n return mat3(m[0][0], m[1][0], m[2][0],\n m[0][1], m[1][1], m[2][1],\n m[0][2], m[1][2], m[2][2]);\n}\n\nmat3 inverseMat3(mat3 m)\n{\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nvoid main()\n{\n mat4 mMatrix=modelMatrix;\n vec4 pos=vec4(vPosition, 1.0);\n mat4 mvMatrix;\n texCoord=attrTexCoord;\n norm=attrVertNormal;\n\n tangent = attrTangent;\n bitangent = attrBiTangent;\n {{MODULE_VERTEX_POSITION}}\n\n mvMatrix = (viewMatrix * mMatrix);\n\n\n\n cameraSpace_pos = mvMatrix * pos;\n\n #ifdef HAS_TEXTURES\n float repeatX = inTextureRepeatOffset.TEX_REPEAT_X;\n float offsetX = inTextureRepeatOffset.TEX_OFFSET_X;\n float repeatY = inTextureRepeatOffset.TEX_REPEAT_Y;\n float offsetY = inTextureRepeatOffset.TEX_OFFSET_Y;\n\n texCoord.x *= repeatX;\n texCoord.x += offsetX;\n texCoord.y *= repeatY;\n texCoord.y += offsetY;\n #endif\n\n normInterpolated = vec3(normalMatrix*vec4(norm, 1.));\n\n vec3 normCameraSpace = normalize((vec4(normInterpolated, 0.0)).xyz);\n vec3 tangCameraSpace = normalize((mMatrix * vec4(attrTangent, 0.0)).xyz);\n vec3 bitangCameraSpace = normalize((mMatrix * vec4(attrBiTangent, 0.0)).xyz);\n\n // re orthogonalization for smoother normals\n tangCameraSpace = normalize(tangCameraSpace - dot(tangCameraSpace, normCameraSpace) * normCameraSpace);\n bitangCameraSpace = cross(normCameraSpace, tangCameraSpace);\n\n TBN_Matrix = mat3(tangCameraSpace, bitangCameraSpace, normCameraSpace);\n\n\n fragPos = vec3((mMatrix) * pos);\n v_viewDirection = normalize(camPos - fragPos);\n\n gl_Position = projMatrix * mvMatrix * pos;\n}";const a=e.patch.cgl,r=e.inTrigger("Trigger In"),o=e.inFloat("R",Math.random()),i=e.inFloat("G",Math.random()),l=e.inFloat("B",Math.random()),s=e.inFloatSlider("A",1),u=[o,i,l,s];e.setPortGroup("Diffuse Color",u);const d=e.inBool("Enable",!1),c=e.inFloatSlider("Albedo",.707),b=e.inFloatSlider("Roughness",.835);d.setUiAttribs({hidePort:!0}),c.setUiAttribs({greyout:!0}),b.setUiAttribs({greyout:!0}),o.setUiAttribs({colorPick:!0}),e.setPortGroup("Oren-Nayar Diffuse",[d,c,b]),d.onChange=function(){d.get()?(Z.define("ENABLE_OREN_NAYAR_DIFFUSE"),c.setUiAttribs({greyout:!1}),b.setUiAttribs({greyout:!1})):(Z.removeDefine("ENABLE_OREN_NAYAR_DIFFUSE"),c.setUiAttribs({greyout:!0}),b.setUiAttribs({greyout:!0}))};const f=e.inValueBool("Active",!1);f.setUiAttribs({hidePort:!0});const p=e.inValueSlider("Fresnel Intensity",.7),m=e.inFloat("Fresnel Width",1),g=e.inFloat("Fresnel Exponent",6),v=e.inFloat("Fresnel R",1),h=e.inFloat("Fresnel G",1),x=e.inFloat("Fresnel B",1);v.setUiAttribs({colorPick:!0});const I=[p,m,g,v,h,x];I.forEach(function(e){e.setUiAttribs({greyout:!0})}),e.setPortGroup("Fresnel",I.concat([f])),f.onChange=function(){f.get()?(Z.define("ENABLE_FRESNEL"),I.forEach(function(e){e.setUiAttribs({greyout:!1})})):(Z.removeDefine("ENABLE_FRESNEL"),I.forEach(function(e){e.setUiAttribs({greyout:!0})}))};const O=e.inFloat("Shininess",4),A=e.inFloatSlider("Specular Amount",1),T=e.inSwitch("Specular Model",["Blinn","Schlick","Phong","Gauss"],"Blinn");T.setUiAttribs({hidePort:!0});const S=[O,A,T];e.setPortGroup("Specular",S);const C=e.inValueBool("Energy Conservation",!1),E=e.inBool("Double Sided Material",!1);C.setUiAttribs({hidePort:!0}),E.setUiAttribs({hidePort:!0});const y=[C,E];e.setPortGroup("Light Options",y);const M=e.inTexture("Diffuse Texture"),L=e.inTexture("Specular Texture"),N=e.inTexture("Normal Map"),j=e.inTexture("AO Texture"),P=e.inTexture("Emissive Texture"),w=e.inTexture("Opacity Texture");e.setPortGroup("Textures",[M,L,N,j,P,w]);const _=e.inBool("Colorize Texture",!1),k=e.inFloat("Diffuse Repeat X",1),D=e.inFloat("Diffuse Repeat Y",1),B=e.inFloat("Texture Offset X",0),U=e.inFloat("Texture Offset Y",0),R=e.inFloatSlider("Specular Intensity",1),G=e.inFloatSlider("Normal Map Intensity",.5),V=e.inFloatSlider("AO Intensity",1),W=e.inFloat("Emissive Intensity",1);_.setUiAttribs({hidePort:!0}),e.setPortGroup("Texture Transforms",[G,V,R,W,_,D,k,U,B]);
72const F=e.inSwitch("Alpha Mask Source",["Luminance","R","G","B","A"],"Luminance");F.setUiAttribs({greyout:!0});const z=e.inValueBool("Opacity TexCoords Transform",!1),H=e.inValueBool("Discard Transparent Pixels");z.setUiAttribs({hidePort:!0}),H.setUiAttribs({hidePort:!0}),e.setPortGroup("Opacity Texture",[F,z,H]);const X=e.outTrigger("Trigger Out"),Y=e.outObject("Shader");Y.ignoreValueSerialize=!0;const Z=new CGL.Shader(a,"simosphong");Z.setModules(["MODULE_VERTEX_POSITION","MODULE_COLOR","MODULE_BEGIN_FRAG"]),Z.setSource(n,t),Y.set(Z);let J=null,K=null,q=null,Q=null,$=null,ee=null;function te(){M.get()?Z.hasDefine("HAS_TEXTURE_DIFFUSE")||(Z.define("HAS_TEXTURE_DIFFUSE"),J||(J=new CGL.Uniform(Z,"t","texDiffuse",0))):(Z.removeUniform("texDiffuse"),Z.removeDefine("HAS_TEXTURE_DIFFUSE"),J=null)}function ne(){L.get()?Z.hasDefine("HAS_TEXTURE_SPECULAR")||(Z.define("HAS_TEXTURE_SPECULAR"),K||(K=new CGL.Uniform(Z,"t","texSpecular",1))):(Z.removeUniform("texSpecular"),Z.removeDefine("HAS_TEXTURE_SPECULAR"),K=null)}function ae(){N.get()?Z.hasDefine("HAS_TEXTURE_NORMAL")||(Z.define("HAS_TEXTURE_NORMAL"),q||(q=new CGL.Uniform(Z,"t","texNormal",2))):(Z.removeUniform("texNormal"),Z.removeDefine("HAS_TEXTURE_NORMAL"),q=null)}function re(){j.get()?Z.hasDefine("HAS_TEXTURE_AO")||(Z.define("HAS_TEXTURE_AO"),Q||(Q=new CGL.Uniform(Z,"t","texAO",3))):(Z.removeUniform("texAO"),Z.removeDefine("HAS_TEXTURE_AO"),Q=null)}function oe(){"Alpha Channel"==F.get()?Z.define("ALPHA_MASK_ALPHA"):Z.removeDefine("ALPHA_MASK_ALPHA"),"Luminance"==F.get()?Z.define("ALPHA_MASK_LUMI"):Z.removeDefine("ALPHA_MASK_LUMI"),"R"==F.get()?Z.define("ALPHA_MASK_R"):Z.removeDefine("ALPHA_MASK_R"),"G"==F.get()?Z.define("ALPHA_MASK_G"):Z.removeDefine("ALPHA_MASK_G"),"B"==F.get()?Z.define("ALPHA_MASK_B"):Z.removeDefine("ALPHA_MASK_B")}function ie(){if(w.get()){if(null!==ee)return;Z.removeUniform("texAlpha"),Z.define("HAS_TEXTURE_ALPHA"),ee||(ee=new CGL.Uniform(Z,"t","texAlpha",5)),F.setUiAttribs({greyout:!1}),H.setUiAttribs({greyout:!1}),z.setUiAttribs({greyout:!1})}else Z.removeUniform("texAlpha"),Z.removeDefine("HAS_TEXTURE_ALPHA"),ee=null,F.setUiAttribs({greyout:!0}),H.setUiAttribs({greyout:!0}),z.setUiAttribs({greyout:!0});oe()}_.onChange=function(){Z.toggleDefine("COLORIZE_TEXTURE",_.get())},F.onChange=oe,H.onChange=function(){H.get()?Z.define("DISCARDTRANS"):Z.removeDefine("DISCARDTRANS")},z.onChange=function(){z.get()?Z.define("TRANSFORMALPHATEXCOORDS"):Z.removeDefine("TRANSFORMALPHATEXCOORDS")},M.onChange=te,L.onChange=ne,N.onChange=ae,j.onChange=re,P.onChange=function(){P.get()?Z.hasDefine("HAS_TEXTURE_EMISSIVE")||(Z.define("HAS_TEXTURE_EMISSIVE"),$||($=new CGL.Uniform(Z,"t","texEmissive",4))):(Z.removeUniform("texEmissive"),Z.removeDefine("HAS_TEXTURE_EMISSIVE"),$=null)},w.onChange=ie;const le=64===a.gl.getParameter(a.gl.MAX_FRAGMENT_UNIFORM_VECTORS)?6:16;Z.define("MAX_LIGHTS",le.toString()),Z.define("SPECULAR_PHONG");const se={none:-1,ambient:0,point:1,directional:2,spot:3};T.onChange=function(){"Phong"===T.get()?(Z.define("SPECULAR_PHONG"),Z.removeDefine("SPECULAR_BLINN"),Z.removeDefine("SPECULAR_GAUSS"),Z.removeDefine("SPECULAR_SCHLICK")):"Blinn"===T.get()?(Z.define("SPECULAR_BLINN"),Z.removeDefine("SPECULAR_PHONG"),Z.removeDefine("SPECULAR_GAUSS"),Z.removeDefine("SPECULAR_SCHLICK")):"Gauss"===T.get()?(Z.define("SPECULAR_GAUSS"),Z.removeDefine("SPECULAR_BLINN"),Z.removeDefine("SPECULAR_PHONG"),Z.removeDefine("SPECULAR_SCHLICK")):"Schlick"===T.get()&&(Z.define("SPECULAR_SCHLICK"),Z.removeDefine("SPECULAR_BLINN"),Z.removeDefine("SPECULAR_PHONG"),Z.removeDefine("SPECULAR_GAUSS"))},C.onChange=function(){Z.toggleDefine("CONSERVE_ENERGY",C.get())},E.onChange=function(){Z.toggleDefine("DOUBLE_SIDED",E.get())};new CGL.Uniform(Z,"4f","inMaterialProperties",c,b,O,A),new CGL.Uniform(Z,"4f","inDiffuseColor",o,i,l,s),new CGL.Uniform(Z,"4f","inTextureIntensities",G,V,R,W),new CGL.Uniform(Z,"4f","inTextureRepeatOffset",k,D,B,U),new CGL.Uniform(Z,"4f","inFresnel",v,h,x,p),new CGL.Uniform(Z,"2f","inFresnelWidthExponent",m,g);const ue=[],de=new function(e){return this.type=e.type||"point",this.color=e.color||[1,1,1],this.specular=e.specular||[0,0,0],this.position=e.position||null,this.intensity=e.intensity||1,this.radius=e.radius||1,this.falloff=e.falloff||1,this.spotExponent=e.spotExponent||1,this.cosConeAngleInner=Math.cos(CGL.DEG2RAD*e.coneAngleInner)||0,this.cosConeAngle=e.cosConeAngle||0,this.conePointAt=e.conePointAt||[0,0,0],this}({type:"point",color:[.8,.8,.8],specular:[1,1,1],position:[0,2,2.75],intensity:1,radius:15,falloff:.2,cosConeAngleInner:null,spotExponent:null,coneAngle:null,conePointAt:null});for(let e=0;e<le;e+=1){const t=[0===e?de.intensity:0,0===e?de.radius:0,0===e?de.falloff:0],n=new CGL.Uniform(Z,"3f","lights["+e+"].lightProperties",t),a=[null,null,null],r=new CGL.Uniform(Z,"3f","lights["+e+"].spotProperties",a);ue.push({color:new CGL.Uniform(Z,"3f","lights["+e+"].color",0===e?de.color:[0,0,0]),specular:new CGL.Uniform(Z,"3f","lights["+e+"].specular",0===e?de.specular:[1,1,1]),position:new CGL.Uniform(Z,"3f","lights["+e+"].position",0===e?de.position:[0,0,0]),type:new CGL.Uniform(Z,"i","lights["+e+"].type",0===e?se.point:se.none),lightProperties:n,intensity:!0,radius:!0,falloff:!0,spotProperties:r,spotExponent:!0,cosConeAngle:!0,cosConeAngleInner:!0,conePointAt:new CGL.Uniform(Z,"3f","lights["+e+"].conePointAt",null)})}const ce=function(){Z?a.shadowPass?X.trigger():(a.setShader(Z),Z.popTextures(),M.get()&&Z.pushTexture(J,M.get().tex),L.get()&&Z.pushTexture(K,L.get().tex),N.get()&&Z.pushTexture(q,N.get().tex),j.get()&&Z.pushTexture(Q,j.get().tex),P.get()&&Z.pushTexture($,P.get().tex),w.get()&&Z.pushTexture(ee,w.get().tex),X.trigger(),a.setPreviousShader()):e.log("NO SHADER")};e.preRender=function(){Z.bind(),ce()};const be=mat4.create(),fe=vec3.create(),pe=vec3.create();r.onTriggered=function(){if(a.lightStack)if(0===a.lightStack.length){e.setError("Default light is enabled. Please add lights to your patch to make this warning disappear.");for(let e=0;e<ue.length;e+=1)if(0===e){const t=Object.keys(de);for(let n=0;n<t.length;n+=1){const r=t[n];"type"===r?ue[e][r].setValue(se[de[r]]):ue[e][r]&&("radius"===r||"intensity"===r||"falloff"===r?ue[e].lightProperties.setValue([de.intensity,de.radius,de.falloff]):"spotExponent"===r||"cosConeAngle"===r||"cosConeAngleInner"===r?ue[e].spotProperties.setValue([null,
72null,null]):"position"===r?(mat4.invert(be,a.vMatrix),vec3.transformMat4(pe,fe,be),ue[e].position.setValue(pe)):ue[e][r].setValue(de[r]))}}else ue[e].type.setValue(se.none);ce()}else{e.setError(null);for(let e=0;e<le;e+=1){const t=a.lightStack[e];if(!t){ue[e].type.setValue(se.none);continue}const n=Object.keys(t);for(let a=0;a<n.length;a+=1){const r=n[a];"type"===r?ue[e][r].setValue(se[t[r]]):ue[e][r]&&("radius"===r||"intensity"===r||"falloff"===r?ue[e].lightProperties.setValue([t.intensity,t.radius,t.falloff]):"spotExponent"===r||"cosConeAngle"===r||"cosConeAngleInner"===r?ue[e].spotProperties.setValue([t.spotExponent,t.cosConeAngle,t.cosConeAngleInner]):ue[e][r].setValue(t[r]))}}ce()}else a.lightStack=[]},te(),ne(),ae(),re(),ie()},Ops.Gl.Phong.PhongMaterial_v4.prototype=new CABLES.Op,CABLES.OPS["7059501e-31a6-46cd-8939-4d4b82229086"]={f:Ops.Gl.Phong.PhongMaterial_v4,objName:"Ops.Gl.Phong.PhongMaterial_v4"},Ops.Gl.Phong.AmbientLight_v4=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inTrigger("Trigger In"),n=e.inValueSlider("R",.1);n.setUiAttribs({colorPick:!0});const a=e.inValueSlider("G",.125),r=e.inValueSlider("B",.15),o=e.inValueSlider("Intensity",1),i=[n,a,r];e.setPortGroup("Color",i);const l=e.outTrigger("Trigger Out");const s=e.patch.cgl,u=new function(e){return this.type=e.type||"point",this.color=e.color||[1,1,1],this.specular=e.specular||[0,0,0],this.position=e.position||null,this.intensity=e.intensity||1,this.constantAttenuation=e.constantAttenuation||0,this.linearAttenuation=e.linearAttenuation||0,this.quadraticAttenuation=e.quadraticAttenuation||0,this.radius=e.radius||1,this.falloff=e.falloff||1,this.spotExponent=e.spotExponent||1,this.coneAngleInner=e.coneAngleInner||0,this.coneAngle=e.coneAngle||0,this.cosConeAngle=Math.cos(CGL.DEG2RAD*this.coneAngle),this.conePointAt=e.conePointAt||[0,0,0],this}({type:"ambient",color:[0,1,2].map(function(e){return i[e].get()}),intensity:o.get()}),d={color:[n,a,r],intensity:o};Object.keys(d).forEach(function(e){if(d[e].length)for(let t=0;t<d[e].length;t+=1)d[e][t].onChange=function(){u[e][t]=d[e][t].get()};else d[e].onChange=function(){u[e]=d[e].get()}}),t.onTriggered=function(){s.lightStack||(s.lightStack=[]),s.lightStack.push(u),l.trigger(),s.lightStack.pop()}},Ops.Gl.Phong.AmbientLight_v4.prototype=new CABLES.Op,CABLES.OPS["235a18d1-a8de-4034-962d-2848017e27cd"]={f:Ops.Gl.Phong.AmbientLight_v4,objName:"Ops.Gl.Phong.AmbientLight_v4"},Ops.Gl.Phong.PointLight_v4=function(){CABLES.Op.apply(this,arguments);const e=this;const t=e.inTrigger("Trigger In"),n=e.inFloat("Intensity",2),a=e.inFloat("Radius",15),r=e.inFloat("X",0),o=e.inFloat("Y",1),i=e.inFloat("Z",.75),l=[r,o,i];e.setPortGroup("Position",l);const s=e.inFloat("R",.8),u=e.inFloat("G",.8),d=e.inFloat("B",.8);s.setUiAttribs({colorPick:!0});const c=[s,u,d];e.setPortGroup("Color",c);const b=e.inFloat("Specular R",1),f=e.inFloat("Specular G",1),p=e.inFloat("Specular B",1);b.setUiAttribs({colorPick:!0});const m=[b,f,p];e.setPortGroup("Specular Color",m);const g=e.inFloatSlider("Falloff",.5),v=[n,a];e.setPortGroup("Light Attributes",v);const h=e.outTrigger("Trigger Out"),x={position:[r,o,i],color:[s,u,d],specular:[b,f,p],intensity:n,radius:a,falloff:g},I=e.patch.cgl,O=new function(e){return this.type=e.type||"point",this.color=e.color||[1,1,1],this.specular=e.specular||[0,0,0],this.position=e.position||null,this.intensity=e.intensity||1,this.radius=e.radius||1,this.falloff=e.falloff||1,this.spotExponent=e.spotExponent||1,this.cosConeAngle=Math.cos(CGL.DEG2RAD*this.coneAngle),this.conePointAt=e.conePointAt||[0,0,0],this}({type:"point",position:[0,1,2].map(function(e){return l[e].get()}),color:[0,1,2].map(function(e){return c[e].get()}),specular:[0,1,2].map(function(e){return m[e].get()}),intensity:n.get(),radius:a.get(),falloff:g.get()});Object.keys(x).forEach(function(e){if(x[e].length)for(let t=0;t<x[e].length;t+=1)x[e][t].onChange=function(){O[e][t]=x[e][t].get()};else x[e].onChange=function(){O[e]=x[e].get()}});vec3.create(),vec3.create();const A=vec3.create(),T=vec3.create();t.onTriggered=function(){I.lightStack||(I.lightStack=[]),vec3.set(T,r.get(),o.get(),i.get()),vec3.transformMat4(A,T,I.mMatrix),O.position=A,CABLES.UI&&gui.patch().isCurrentOp(e)&&(gui.setTransformGizmo({posX:r,posY:o,posZ:i}),I.pushModelMatrix(),mat4.translate(I.mMatrix,I.mMatrix,T),CABLES.GL_MARKER.drawSphere(e,a.get()),I.popModelMatrix()),I.lightStack.push(O),h.trigger(),I.lightStack.pop()}},Ops.Gl.Phong.PointLight_v4.prototype=new CABLES.Op,CABLES.OPS["8d7dc3dc-b71d-4ba8-830f-83dca2638359"]={f:Ops.Gl.Phong.PointLight_v4,objName:"Ops.Gl.Phong.PointLight_v4"},Ops.Sidebar.DropDown_v2=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inObject("Link"),n=e.inValueString("Text","Value"),a=e.inArray("Values"),r=e.inValueString("Default",""),o=e.inBool("Grey Out",!1),i=e.inBool("Visible",!0),l=e.outObject("Children"),s=e.outString("Result",r.get()),u=e.outNumber("Index");var d=document.createElement("div");d.classList.add("sidebar__item"),d.classList.add("sidebar__select");var c=document.createElement("div");c.classList.add("sidebar__item-label");var b=document.createTextNode(n.get());c.appendChild(b),d.appendChild(c);var f=document.createElement("select");f.classList.add("sidebar__select-select"),d.appendChild(f),f.addEventListener("input",function(e){s.set(e.target.value),u.set(m.indexOf(e.target.value))});var p=document.createElement("div");p.classList.add("sidebar__greyout"),d.appendChild(p),p.style.display="none",o.onChange=function(){p.style.display=o.get()?"block":"none"},i.onChange=function(){d.style.display=i.get()?"block":"none"},t.onChange=function(){var e=t.get();e&&e.parentElement?(e.parentElement.appendChild(d),l.set(null),l.set(e)):d.parentElement&&d.parentElement.removeChild(d)},n.onChange=function(){var t=n.get();c.textContent=t,CABLES.UI&&e.setTitle("Dropdown: "+t)},r.onChange=function(){var e=r.get();s.set(e),g()},e.onDelete=function(){!function(e){e&&e.parentNode&&e.parentNode.removeChild&&e.parentNode.removeChild(e)}(d)},a.onChange=function(){for(;f.lastChild;)f.removeChild(f.lastChild);m=a.get();var e=r.get();m?m.forEach(function(t){const n=document.createElement("option");n.setAttribute("value",t),t===e&&n.setAttribute("selected","");const a=document.createTextNode(t);n.appendChild(a),f.appendChild(n)}):s.set("");g()};var m=[];function g(){const e=r.get();f.querySelectorAll("option").forEach(function(t){t.value===e?t.setAttribute("selected",""):t.removeAttribute("selected")})}e.onLoaded=function(){s.set(r.get())}},Ops.Sidebar.DropDown_v2.prototype=new CABLES.Op,CABLES.OPS["7b3f93d6-4de1-41fd-aa26-e74c8285c662"]={f:Ops.Sidebar.DropDown_v2,objName:"Ops.Sidebar.DropDown_v2"},Ops.Array.Array_v2=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inSwitch("Mode select",["Number","1,2,3,4","0-1","1-0"],"Number"),n=e.inValueInt("Array length",10),a=e.inValueFloat("Default Value"),r=e.outArray("Array"),o=e.outNumber("Array length out");var i=[],l=0;const s=0,u=1,d=2,c=3;function b(){var n=t.get();"Number"===n?l=s:"1,2,3,4"===n?l=u:"0-1"===n?l=d:"1-0"===n&&(l=c),l===s?a.setUiAttribs({greyout:!1}):l===u?a.setUiAttribs({greyout:!0}):l===d?a.setUiAttribs({greyout:!0}):l===c&&a.setUiAttribs({greyout:!0}),e.setUiAttrib({extendTitle:t.get()}),f()}function f(){i.length=0;var e,t=n.get(),b=a.get();if(o.set(t),l===s)for(e=0;e<t;e++)i[e]=b;else if(l===u)for(e=0;e<t;e++)i[e]=e;else if(l===d)for(e=0;e<t;e++)i[e]=e/t;else if(l===c)for(e=0;e<t;e++)i[e]=1-e/t;r.set(null),r.set(i)}b(),a.onChange=n.onChange=function(){f()},t.onChange=b,f()},Ops.Array.Array_v2.prototype=new CABLES.Op,CABLES.OPS["ca9219d2-9f06-4516-9cf2-98e61f84d4bb"]={f:Ops.Array.Array_v2,objName:"Ops.Array.Array_v2"},Ops.Array.ArrayMultiply=function(){CABLES.Op.apply(this,arguments);var e=this.inArray("In"),t=this.inValue("Value",1),n=this.outArray("Result"),a=[];n.set(a),e.onChange=t.onChange=e.onChange=function(){var r=e.get();if(r){var o=t.get();a.length!=r.length&&(a.length=r.length);for(var i=0;i<r.length;i++)a[i]=r[i]*o;n.set(null),n.set(a)}}},Ops.Array.ArrayMultiply.prototype=new CABLES.Op,CABLES.OPS["a01c344b-4129-4b01-9c8f-36cefe86d7cc"]={f:Ops.Array.ArrayMultiply,objName:"Ops.Array.ArrayMultiply"},Ops.Array.ArraySum=function(){CABLES.Op.apply(this,arguments);var e=this.inArray("In"),t=this.inValue("Value",1),n=this.outArray("Result"),a=[];n.set(a),t.onChange=e.onChange=function(){var r=e.get();if(r){var o=t.get();a.length!=r.length&&(a.length=r.length);for(var i=0;i<r.length;i++)a[i]=r[i]+o;n.set(null),n.set(a)}}},Ops.Array.ArraySum.prototype=new CABLES.Op,CABLES.OPS["c6b5bf63-0be8-4eea-acc0-9d32973e665a"]={f:Ops.Array.ArraySum,objName:"Ops.Array.ArraySum"},Ops.String.ParseInt_v2=function(){CABLES.Op.apply(this,arguments);const e=this.inString("String",5711),t=this.outValue("Number");e.onChange=function(){var n=parseInt(e.get());n!=n&&(n=0),t.set(n)}},Ops.String.ParseInt_v2.prototype=new CABLES.Op,CABLES.OPS["6d208424-daf2-4a2b-874f-daac406c1f66"]={f:Ops.String.ParseInt_v2,objName:"Ops.String.ParseInt_v2"},Ops.Sidebar.SidebarText_v2=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inObject("link"),n=e.inString("Text","Value"),a=e.inValueString("Id",""),r=e.outObject("childs"),o=document.createElement("div");o.classList.add("sidebar__item"),o.classList.add("sidebar__text");var i=document.createElement("div");i.classList.add("sidebar__item-label");var l=document.createTextNode(n.get());i.appendChild(l),o.appendChild(i),t.onChange=function(){var e=t.get();e&&e.parentElement?(e.parentElement.appendChild(o),r.set(null),r.set(e)):o.parentElement&&o.parentElement.removeChild(o)},n.onChange=function(){var t=n.get();i.textContent=t,CABLES.UI&&(t&&"string"==typeof t?e.setTitle("Text: "+t.substring(0,10)):e.setTitle("Text"))},a.onChange=function(){o.id=a.get()},e.onDelete=function(){!function(e){e&&e.parentNode&&e.parentNode.removeChild&&e.parentNode.removeChild(e)}(o)},e.toWorkNeedsParent("Ops.Sidebar.Sidebar")},Ops.Sidebar.SidebarText_v2.prototype=new CABLES.Op,CABLES.OPS["cc591cc3-ff23-4817-907c-e5be7d5c059d"]={f:Ops.Sidebar.SidebarText_v2,objName:"Ops.Sidebar.SidebarText_v2"},Ops.Gl.Textures.WebcamTexture=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inValueBool("flip"),n=e.inValueInt("fps"),a=e.inValueBool("Active",!0),r=e.outTexture("texture"),o=e.outValue("Ratio"),i=e.outValue("Available"),l=e.outString("Element Id");n.set(30),t.set(!0);var s=e.patch.cgl,u=document.createElement("video");const d="webcam"+CABLES.uuid();u.setAttribute("id",d),u.style.display="none",l.set(d),e.patch.cgl.canvas.parentElement.appendChild(u);var c=new CGL.Texture(s);c.setSize(8,8),r.set(c);var b=null,f=!1;function p(){s.gl.bindTexture(s.gl.TEXTURE_2D,c.tex),s.gl.pixelStorei(s.gl.UNPACK_FLIP_Y_WEBGL,t.get()),s.gl.texImage2D(s.gl.TEXTURE_2D,0,s.gl.RGBA,s.gl.RGBA,s.gl.UNSIGNED_BYTE,u),s.gl.bindTexture(s.gl.TEXTURE_2D,null),f||(b=setTimeout(p,1e3/n.get()))}a.onChange=function(){a.get()?(f=!1,p()):f=!0},n.onChange=function(){n.get()<1&&n.set(1),clearTimeout(b),b=setTimeout(p,1e3/n.get())},navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia,navigator.getUserMedia({audio:!1,video:!0},function(e){c.videoElement=u,u.srcObject=e,u.onloadedmetadata=function(e){i.set(!0),c.setSize(u.videoWidth,u.videoHeight),o.set(u.videoWidth/u.videoHeight),u.play(),p()}},function(){i.set(!1)})},Ops.Gl.Textures.WebcamTexture.prototype=new CABLES.Op,CABLES.OPS["ef451374-cbc2-49f1-a51c-5df5d71dc03d"]={f:Ops.Gl.Textures.WebcamTexture,objName:"Ops.Gl.Textures.WebcamTexture"},Ops.Gl.Meshes.Rectangle=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inTrigger("render"),n=e.outTrigger("trigger"),a=e.inValue("width",1),r=e.inValue("height",1),o=e.inSwitch("pivot x",["left","center","right"]),i=e.inSwitch("pivot y",["top","center","bottom"]),l=e.inValueInt("num columns",1),s=e.inValueInt("num rows",1),u=e.inSwitch("axis",["xy","xz"],"xy"),d=e.inValueBool("Active",!0),c=e.outObject("geometry");c.ignoreValueSerialize=!0;var b=e.patch.cgl;u.set("xy"),o.set("center"),i.set("center"),e.setPortGroup("Pivot",[o,i]),e.setPortGroup("Size",[a,r]),e.setPortGroup("Structure",[l,s]);var f=new CGL.Geometry("rectangle"),p=null;function m(){var e=a.get(),t=r.get(),n=0,d=0;"string"==typeof e&&(e=parseFloat(e)),"string"==typeof t&&(t=parseFloat(t)),"center"==o.get()?n=0:"right"==o.get()?n=-e/2:"left"
72==o.get()&&(n=+e/2),"center"==i.get()?d=0:"top"==i.get()?d=-t/2:"bottom"==i.get()&&(d=+t/2);var m,g,v,h=[],x=[],I=[],O=[],A=[],T=[],S=Math.round(s.get()),C=Math.round(l.get()),E=e/C,y=t/S;for(v=u.get(),g=0;g<=S;g++)for(m=0;m<=C;m++)h.push(m*E-a.get()/2+n),"xz"==v&&h.push(0),h.push(g*y-r.get()/2+d),"xy"==v&&h.push(0),x.push(m/C),x.push(1-g/S),"xz"==v?(I.push(0,1,0),O.push(1,0,0),A.push(0,0,1)):"xy"==v&&(I.push(0,0,1),O.push(-1,0,0),A.push(0,-1,0));for(m=0;m<C;m++)for(g=0;g<S;g++){var M=m+(C+1)*g,L=M,N=M+1,j=M+C+1,P=M+1+C+1;T.push(L),T.push(j),T.push(N),T.push(N),T.push(j),T.push(P)}f.clear(),f.vertices=h,f.texCoords=x,f.verticesIndices=T,f.vertexNormals=I,f.tangents=O,f.biTangents=A,C*S>64e3&&f.unIndex(),p?p.setGeom(f):p=new CGL.Mesh(b,f),c.set(null),c.set(f)}u.onChange=m,o.onChange=m,i.onChange=m,a.onChange=m,r.onChange=m,s.onChange=m,l.onChange=m,m(),e.preRender=t.onTriggered=function(){CGL.TextureEffect.checkOpNotInTextureEffect(e)&&(d.get()&&p&&p.render(b.getShader()),n.trigger())},e.onDelete=function(){p&&p.dispose()}},Ops.Gl.Meshes.Rectangle.prototype=new CABLES.Op,CABLES.OPS["20f3c4e7-04d1-44e0-b868-05756d1c66c6"]={f:Ops.Gl.Meshes.Rectangle,objName:"Ops.Gl.Meshes.Rectangle"},Ops.Gl.Shader.BasicMaterial_v2=function(){CABLES.Op.apply(this,arguments);const e=this,t="{{MODULES_HEAD}}\n\nIN vec2 texCoord;\nUNI vec4 color;\n// UNI float r;\n// UNI float g;\n// UNI float b;\n// UNI float a;\n\n#ifdef HAS_TEXTURES\n IN vec2 texCoordOrig;\n #ifdef HAS_TEXTURE_DIFFUSE\n UNI sampler2D tex;\n #endif\n #ifdef HAS_TEXTURE_OPACITY\n UNI sampler2D texOpacity;\n #endif\n#endif\n\nvoid main()\n{\n {{MODULE_BEGIN_FRAG}}\n vec4 col=color;\n\n #ifdef HAS_TEXTURES\n vec2 uv=vec2(texCoord.s,1.0-texCoord.t);\n\n #ifdef HAS_TEXTURE_DIFFUSE\n col=texture(tex,uv);\n\n #ifdef COLORIZE_TEXTURE\n col.r*=color.r;\n col.g*=color.g;\n col.b*=color.b;\n #endif\n #endif\n col.a*=color.a;\n #ifdef HAS_TEXTURE_OPACITY\n #ifdef TRANSFORMALPHATEXCOORDS\n uv=vec2(texCoordOrig.s,1.0-texCoordOrig.t);\n #endif\n #ifdef ALPHA_MASK_ALPHA\n col.a*=texture(texOpacity,uv).a;\n #endif\n #ifdef ALPHA_MASK_LUMI\n col.a*=dot(vec3(0.2126,0.7152,0.0722), texture(texOpacity,uv).rgb);\n #endif\n #ifdef ALPHA_MASK_R\n col.a*=texture(texOpacity,uv).r;\n #endif\n #ifdef ALPHA_MASK_G\n col.a*=texture(texOpacity,uv).g;\n #endif\n #ifdef ALPHA_MASK_B\n col.a*=texture(texOpacity,uv).b;\n #endif\n // #endif\n #endif\n #endif\n\n {{MODULE_COLOR}}\n\n #ifdef DISCARDTRANS\n if(col.a<0.2) discard;\n #endif\n\n outColor = col;\n}\n",n="IN vec3 vPosition;\nIN vec2 attrTexCoord;\nIN vec3 attrVertNormal;\nIN float attrVertIndex;\n\n{{MODULES_HEAD}}\n\nOUT vec3 norm;\nOUT vec2 texCoord;\nOUT vec2 texCoordOrig;\n\nUNI mat4 projMatrix;\nUNI mat4 modelMatrix;\nUNI mat4 viewMatrix;\n\n#ifdef HAS_TEXTURES\n UNI float diffuseRepeatX;\n UNI float diffuseRepeatY;\n UNI float texOffsetX;\n UNI float texOffsetY;\n#endif\n\nvoid main()\n{\n mat4 mMatrix=modelMatrix;\n mat4 mvMatrix;\n\n norm=attrVertNormal;\n texCoordOrig=attrTexCoord;\n texCoord=attrTexCoord;\n #ifdef HAS_TEXTURES\n texCoord.x=texCoord.x*diffuseRepeatX+texOffsetX;\n texCoord.y=texCoord.y*diffuseRepeatY+texOffsetY;
72\n #endif\n\n vec4 pos = vec4(vPosition, 1.0);\n\n #ifdef BILLBOARD\n vec3 position=vPosition;\n mvMatrix=viewMatrix*modelMatrix;\n\n gl_Position = projMatrix * mvMatrix * vec4((\n position.x * vec3(\n mvMatrix[0][0],\n mvMatrix[1][0],\n mvMatrix[2][0] ) +\n position.y * vec3(\n mvMatrix[0][1],\n mvMatrix[1][1],\n mvMatrix[2][1]) ), 1.0);\n #endif\n\n {{MODULE_VERTEX_POSITION}}\n\n #ifndef BILLBOARD\n mvMatrix=viewMatrix * mMatrix;\n #endif\n\n\n #ifndef BILLBOARD\n // gl_Position = projMatrix * viewMatrix * modelMatrix * pos;\n gl_Position = projMatrix * mvMatrix * pos;\n #endif\n}\n",a=e.inTrigger("render"),r=e.outTrigger("trigger"),o=e.outObject("shader");o.ignoreValueSerialize=!0;const i=e.patch.cgl;e.toWorkPortsNeedToBeLinked(a);const l=new CGL.Shader(i,"basicmaterialnew");function s(){l&&(i.setShader(l),l.popTextures(),p&&f.get()&&l.pushTexture(p,f.get().tex),h&&v.get()&&l.pushTexture(h,v.get().tex),r.trigger(),i.setPreviousShader())}l.setModules(["MODULE_VERTEX_POSITION","MODULE_COLOR","MODULE_BEGIN_FRAG"]),l.setSource(n,t),o.set(l),a.onTriggered=s,e.preRender=function(){l.bind(),s()};const u=e.inValueSlider("r",Math.random()),d=e.inValueSlider("g",Math.random()),c=e.inValueSlider("b",Math.random()),b=e.inValueSlider("a",1);u.setUiAttribs({colorPick:!0});new CGL.Uniform(l,"4f","color",u,d,c,b);e.setPortGroup("Color",[u,d,c,b]);var f=e.inTexture("texture"),p=null;function m(){f.get()?(l.hasDefine("HAS_TEXTURE_DIFFUSE")||l.define("HAS_TEXTURE_DIFFUSE"),p||(p=new CGL.Uniform(l,"t","texDiffuse",0)),T.setUiAttribs({greyout:!1}),S.setUiAttribs({greyout:!1}),C.setUiAttribs({greyout:!1}),E.setUiAttribs({greyout:!1}),g.setUiAttribs({greyout:!1})):(l.removeUniform("texDiffuse"),l.removeDefine("HAS_TEXTURE_DIFFUSE"),p=null,T.setUiAttribs({greyout:!0}),S.setUiAttribs({greyout:!0}),C.setUiAttribs({greyout:!0}),E.setUiAttribs({greyout:!0}),g.setUiAttribs({greyout:!0}))}f.onChange=m;const g=e.inValueBool("colorizeTexture",!1);e.setPortGroup("Color Texture",[f,g]);var v=e.inTexture("textureOpacity"),h=null;function x(){"Alpha Channel"==e.alphaMaskSource.get()?l.define("ALPHA_MASK_ALPHA"):l.removeDefine("ALPHA_MASK_ALPHA"),"Luminance"==e.alphaMaskSource.get()?l.define("ALPHA_MASK_LUMI"):l.removeDefine("ALPHA_MASK_LUMI"),"R"==e.alphaMaskSource.get()?l.define("ALPHA_MASK_R"):l.removeDefine("ALPHA_MASK_R"),"G"==e.alphaMaskSource.get()?l.define("ALPHA_MASK_G"):l.removeDefine("ALPHA_MASK_G"),"B"==e.alphaMaskSource.get()?l.define("ALPHA_MASK_B"):l.removeDefine("ALPHA_MASK_B")}function I(){if(v.get()){if(null!==h)return;l.removeUniform("texOpacity"),l.define("HAS_TEXTURE_OPACITY"),h||(h=new CGL.Uniform(l,"t","texOpacity",1)),e.alphaMaskSource.setUiAttribs({greyout:!1}),A.setUiAttribs({greyout:!1}),O.setUiAttribs({greyout:!1})}else l.removeUniform("texOpacity"),l.removeDefine("HAS_TEXTURE_OPACITY"),h=null,e.alphaMaskSource.setUiAttribs({greyout:!0}),A.setUiAttribs({greyout:!0}),O.setUiAttribs({greyout:!0});x()}e.alphaMaskSource=e.inSwitch("Alpha Mask Source",["Luminance","R","G","B","A"],"Luminance"),e.alphaMaskSource.onChange=x,e.alphaMaskSource.setUiAttribs({greyout:!0}),v.onChange=I;var O=e.inValueBool("Opacity TexCoords Transform",!1);const A=e.inValueBool("Discard Transparent Pixels");A.onChange=function(){A.get()?l.define("DISCARDTRANS"):l.removeDefine("DISCARDTRANS")},O.onChange=function(){O.get()?l.define("TRANSFORMALPHATEXCOORDS"):l.removeDefine("TRANSFORMALPHATEXCOORDS")},e.setPortGroup("Opacity",[v,e.alphaMaskSource,A,O]),g.onChange=function(){g.get()?l.define("COLORIZE_TEXTURE"):l.removeDefine("COLORIZE_TEXTURE")};const T=e.inValue("diffuseRepeatX",1),S=e.inValue("diffuseRepeatY",1),C=e.inValue("Tex Offset X",0),E=e.inValue("Tex Offset Y",0);new CGL.Uniform(l,"f","diffuseRepeatX",T),new CGL.Uniform(l,"f","diffuseRepeatY",S),new CGL.Uniform(l,"f","texOffsetX",C),new CGL.Uniform(l,"f","texOffsetY",E);e.setPortGroup("Texture Transform",[T,S,C,E]);const y=e.inValueBool("billboard",!1);y.onChange=function(){y.get()?l.define("BILLBOARD"):l.removeDefine("BILLBOARD")},I(),m()},Ops.Gl.Shader.BasicMaterial_v2.prototype=new CABLES.Op,CABLES.OPS["51f2207b-daaa-447f-bdbe-87fdd72f0c40"]={f:Ops.Gl.Shader.BasicMaterial_v2,objName:"Ops.Gl.Shader.BasicMaterial_v2"},Ops.Sidebar.Toggle=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inObject("link"),n=e.inValueString("Text","Toggle");const a=e.inValueBool("Input",!0),r=e.inTriggerButton("Set Default");var o=e.inValueBool("Default",!0);o.setUiAttribs({hidePort:!0,greyout:!0});const i=e.inBool("Grey Out",!1),l=e.inBool("Visible",!0);var s=e.outObject("childs"),u=e.outValue("Value",o.get()),d=document.createElement("div");d.classList.add("sidebar__item"),d.classList.add("sidebar__toggle"),d.classList.add("sidebar__toggle--active"),d.addEventListener("click",function(){d.classList.toggle("sidebar__toggle--active"),d.classList.contains("sidebar__toggle--active")?(u.set(!0),a.set(!0),f.classList.add("icon_toggle_true"),f.classList.remove("icon_toggle_false")):(f.classList.remove("icon_toggle_true"),f.classList.add("icon_toggle_false"),u.set(!1),a.set(!1));CABLES.UI&&gui.patch().isCurrentOp(e)&&gui.patch().showOpParams(e)});var c=document.createElement("div");c.classList.add("sidebar__item-label");var b=document.createTextNode(n.get());c.appendChild(b),d.appendChild(c);var f=document.createElement("div");f.classList.add("icon_toggle"),d.appendChild(f);var p=document.createElement("div");p.classList.add("sidebar__greyout"),d.appendChild(p),p.style.display="none",t.onChange=function(){var e=t.get();e&&e.parentElement?(e.parentElement.appendChild(d),s.set(null),s.set(e)):d.parentElement&&d.parentElement.removeChild(d)},n.onChange=function(){var t=n.get();c.textContent=t,CABLES.UI&&e.setTitle("Toggle: "+t)},o.onChange=function(){},a.onChange=function(){a.get()?(d.classList.add("sidebar__toggle--active"),u.set(!0)):(d.classList.remove("sidebar__toggle--active"),u.set(!1))},e.onDelete=function(){!function(e){e&&e.parentNode&&e.parentNode.removeChild&&e.parentNode.removeChild(e)}(d)},r.onTriggered=function(){const t=a.get();o.set(t),u.set(t),CABLES.UI&&gui.patch().isCurrentOp(e)&&gui.patch().showOpParams(e)},i.onChange=function(){p.style.display=i.get()?"block":"none"},l.onChange=function(){d.style.display=l.get()?"block":"none"}},Ops.Sidebar.Toggle.prototype=new CABLES.Op,CABLES.OPS["334bcf18-e2d0-46ad-bf7a-0d36c3d29af9"]={f:Ops.Sidebar.Toggle,objName:"Ops.Sidebar.Toggle"},Ops.Math.Math=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inFloat("number 0",0),n=e.inFloat("number 1",0),a=e.inSwitch("math mode",["+","-","*","/","%","min","max"],"+"),r=e.outNumber("result");function o(){var e=a.get(),o=t.get(),i=n.get();"+"===e?r.set(o+i):"-"===e?r.set(o-i):"*"===e?r.set(o*i):"/"===e?r.set(o/i):"%"===e?r.set(o%i):"min"===e?r.set(Math.min(o,i)):"max"===e&&r.set(Math.max(o,i))}t.onChange=n.onChange=a.onChange=o,a.onChange=function(){var t=a.get();e.setUiAttrib({extendTitle:t}),o()}},Ops.Math.Math.prototype=new CABLES.Op,CABLES.OPS["e9fdcaca-a007-4563-8a4d-e94e08506e0f"]={f:Ops.Math.Math,objName:"Ops.Math.Math"},Ops.User.sealex.Velocity=function(){CABLES.Op.apply(this,arguments);var e=this.inTrigger("Update"),t=this.inValue("Value"),n=this.outValue("Speed");t.alwaysChange=!0;var a=0,r=CABLES.now();e.onTriggered=function(){var e=t.get()-a,o=CABLES.now()-r,i=e*(1e3/o);
72n.set(i),a=t.get(),r=CABLES.now()}},Ops.User.sealex.Velocity.prototype=new CABLES.Op,Ops.Sidebar.Group=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inObject("link"),n=e.inString("Text","Group"),a=e.inValueBool("Default Minimized");const r=e.inBool("Visible",!0);var o=e.outObject("next"),i=e.outObject("childs");r.onChange=function(){l.style.display=r.get()?"block":"none"};var l=document.createElement("div");l.classList.add("sidebar__group"),f();var s=document.createElement("div");s.classList.add("sidebar__group-header"),l.appendChild(s),s.addEventListener("click",function(e){e.stopPropagation(),l.classList.toggle("sidebar__group--closed")});var u=document.createElement("div");u.classList.add("sidebar__group-header-title"),s.appendChild(u);var d=document.createElement("span");d.textContent=n.get(),d.classList.add("sidebar__group-header-title-text"),u.appendChild(d);var c=document.createElement("span");c.classList.add("sidebar__group-header-icon"),c.classList.add("iconsidebar-chevron-up"),u.appendChild(c);var b=document.createElement("div");function f(){a.get()?l.classList.add("sidebar__group--closed"):l.classList.remove("sidebar__group--closed")}b.classList.add("sidebar__group-items"),l.appendChild(b),e.toWorkPortsNeedToBeLinked(t),t.onChange=function(){var n=t.get();n&&n.parentElement?(n.parentElement.appendChild(l),i.set(null),i.set({parentElement:b,parentOp:e}),o.set(n)):l.parentElement&&l.parentElement.removeChild(l)},n.onChange=function(){var t=n.get();d.textContent=t,CABLES.UI&&e.setTitle("Group: "+t)},a.onChange=f,e.onDelete=function(){!function(e){e&&e.parentNode&&e.parentNode.removeChild&&e.parentNode.removeChild(e)}(l)}},Ops.Sidebar.Group.prototype=new CABLES.Op,CABLES.OPS["86ea2333-b51c-48ed-94c2-8b7b6e9ff34c"]={f:Ops.Sidebar.Group,objName:"Ops.Sidebar.Group"},Ops.Boolean.And=function(){CABLES.Op.apply(this,arguments);const e=this.inValueBool("bool 1"),t=this.inValueBool("bool 2"),n=this.outValueBool("result");function a(){n.set(t.get()&&e.get())}e.onChange=a,t.onChange=a},Ops.Boolean.And.prototype=new CABLES.Op,CABLES.OPS["c26e6ce0-8047-44bb-9bc8-5a4f911ed8ad"]={f:Ops.Boolean.And,objName:"Ops.Boolean.And"},Ops.Gl.SaveScreenShot=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inTriggerButton("Screenshot"),n=e.inValueString("Filename","cables"),a=e.inValueBool("Use Canvas Size",!0),r=e.outTrigger("Finished"),o=e.inValueInt("Width",0),i=e.inValueInt("Height",0);a.onChange=s;var l=e.patch.cgl;function s(){a.get()?(o.setUiAttribs({hidePort:!0,greyout:!0}),i.setUiAttribs({hidePort:!0,greyout:!0})):(o.set(e.patch.cgl.canvasWidth),i.set(e.patch.cgl.canvasHeight),o.setUiAttribs({hidePort:!1,greyout:!1}),i.setUiAttribs({hidePort:!1,greyout:!1}))}s(),t.onTriggered=function(){var t=l.canvasHeight,s=l.canvasWidth;a.get()||(e.patch.pause(),e.patch.cgl.setSize(o.get(),i.get()),e.patch.renderOneFrame()),l.saveScreenshot(n.get(),function(){r.trigger()}),a.get()||e.patch.cgl.setSize(s,t),e.patch.resume()}},Ops.Gl.SaveScreenShot.prototype=new CABLES.Op,CABLES.OPS["7eb9a1ec-daf2-445c-a364-0bffa626a84b"]={f:Ops.Gl.SaveScreenShot,objName:"Ops.Gl.SaveScreenShot"},Ops.Math.Speed=function(){CABLES.Op.apply(this,arguments);var e=this.inTrigger("Update"),t=this.inValue("Value"),n=this.outValue("Speed");t.alwaysChange=!0;var a=0,r=CABLES.now();e.onTriggered=function(){var e=Math.abs(t.get()-a),o=CABLES.now()-r,i=e*(1e3/o);n.set(i),a=t.get(),r=CABLES.now()}},Ops.Math.Speed.prototype=new CABLES.Op,CABLES.OPS["ff6b8c7b-00c6-48f2-9b43-d059e52143fe"]={f:Ops.Math.Speed,objName:"Ops.Math.Speed"},Ops.Math.Sum=function(){CABLES.Op.apply(this,arguments);const e=this.inValueFloat("number1",1),t=this.inValueFloat("number2",1),n=this.outValue("result");function a(){var a=e.get()+t.get();isNaN(a)||n.set(a)}e.onChange=t.onChange=a,a()},Ops.Math.Sum.prototype=new CABLES.Op,CABLES.OPS["c8fb181e-0b03-4b41-9e55-06b6267bc634"]={f:Ops.Math.Sum,objName:"Ops.Math.Sum"},Ops.Anim.Smooth=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inTrigger("Update"),n=e.inBool("Separate inc/dec",!1),a=e.inValue("Value"),r=e.outTrigger("Next"),o=e.inValue("Inc factor",4),i=e.inValue("Dec factor",4),l=e.outValue("Result",0);var s,u,d=0,c=0,b=0,f=0;e.toWorkPortsNeedToBeLinked(t);var p=4,m=0;const g=0,v=1;function h(){var e=n.get();!1===e?m=g:!0===e&&(m=v),m==g?(i.setUiAttribs({greyout:!0}),o.setUiAttribs({title:"Inc/Dec factor"})):m==v&&(i.setUiAttribs({greyout:!1}),o.setUiAttribs({title:"Inc factor"})),x(),I()}function x(){m==g?(s=o.get(),u=o.get()):m==v&&(s=o.get(),u=i.get()),(s<=.2||s!=s)&&(s=.2),(u<=.2||u!=u)&&(u=.2)}function I(){var e=1;CABLES.now()-f>500||0===f?d=a.get():e=(CABLES.now()-f)/16,f=CABLES.now(),p<=0&&(p=1e-4);var t=c-d;(d+=t>=0?t/(u*e):t/(s*e))>0&&d<1e-9&&(d=0),p!=p&&(d=0),d==d&&d!=-1/0&&d!=1/0||(d=a.get()),b!=d&&(l.set(d),b=d),r.trigger()}h(),x(),n.setUiAttribs({hidePort:!0}),o.onChange=i.onChange=x,n.onChange=h,I(),a.onChange=function(){c=a.get()},o.onChange=function(){x()},t.onTriggered=function(){I()}},Ops.Anim.Smooth.prototype=new CABLES.Op,CABLES.OPS["5677b5b5-753a-4fbf-9e91-64c81ec68a2f"]={f:Ops.Anim.Smooth,objName:"Ops.Anim.Smooth"},Ops.WebAudio.Output=function(){CABLES.Op.apply(this,arguments);const e=this;e.requirements=[CABLES.Requirements.WEBAUDIO];var t=CABLES.WEBAUDIO.createAudioContext(e),n=1,a=0,r=1,o=t.createGain(),i=t.destination;o.connect(i);var l=1,s=(CABLES.WEBAUDIO.createAudioInPort(e,"Audio In",o),e.inValueSlider("Volume",n)),u=e.inValueBool("Mute",!1);function d(){var e=s.get()*l;e>=a&&e<=r?o.gain.setValueAtTime(e,t.currentTime):o.gain.setValueAtTime(n*l,t.currentTime)}u.onChange=function(){u.get()?o.gain.setValueAtTime(0,t.currentTime):d()},s.onChange=function(){u.get()||d()},e.onMasterVolumeChanged=function(e){l=e,d()}},Ops.WebAudio.Output.prototype=new CABLES.Op,CABLES.OPS["53fdbf4a-bc8d-4c5d-a698-f34fdeb53827"]={f:Ops.WebAudio.Output,objName:"Ops.WebAudio.Output"},Ops.WebAudio.Gain=function(){CABLES.Op.apply(this,arguments);var e=this.addInPort(new CABLES.Port(this,"audio in",CABLES.OP_PORT_TYPE_OBJECT)),t=this.addInPort(new CABLES.Port(this,"gain",CABLES.OP_PORT_TYPE_VALUE));t.onChange=function(){a.gain.setValueAtTime(parseFloat(t.get())||0,window.audioContext.currentTime)};var n=this.addOutPort(new CABLES.Port(this,"audio out",CABLES.OP_PORT_TYPE_OBJECT));window.audioContext||(audioContext=new AudioContext);var a=audioContext.createGain();var r=null;e.onChange=function(){if(e.get())e.val.connect(a);else if(r)try{r.disconnect(a)}catch(e){console.log(e)}r=e.get()},t.set(1),n.set(a)},Ops.WebAudio.Gain.prototype=new CABLES.Op,CABLES.OPS["29402bba-48ee-4f28-94f0-bdc345e6bb67"]={f:Ops.WebAudio.Gain,objName:"Ops.WebAudio.Gain"},Ops.Math.Incrementor=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inTriggerButton("Increment"),n=e.inTriggerButton("Decrement"),a=e.inValueInt("Length"),r=e.inTriggerButton("Reset"),o=e.inValueSelect("Mode",["Rewind","Stop at Max"]),i=e.outValue("Value"),l=e.outTrigger("Restarted");i.ignoreValueSerialize=!0,a.set(10);var s=0;i.set(0),a.onTriggered=r,r.onTriggered=function(){i.set(null),s=0,i.set(s),l.trigger()};var u=0;o.onChange=function(){"Rewind"==o.get()&&(u=0),"Stop at Max"==o.get()&&(u=1)},n.onTriggered=function(){s--,0==u&&s<0&&(s=a.get()-1),1==u&&s<0&&(s=0),i.set(s)},t.onTriggered=function(){s++,0==u&&s>=a.get()&&(s=0,l.trigger()),1==u&&s>=a.get()&&(s=a.get()-1),i.set(s)}},Ops.Math.Incrementor.prototype=new CABLES.Op,CABLES.OPS["45cc0011-ada8-4423-8f5b-39a3810b8389"]={f:Ops.Math.Incrementor,objName:"Ops.Math.Incrementor"},Ops.Trigger.GateTrigger=function(){CABLES.Op.apply(this,arguments);const e=this.inTrigger("Execute"),t=this.inValueBool("Pass Through",!0),n=this.outTrigger("Trigger out");e.onTriggered=function(){t.get()&&n.trigger()}},Ops.Trigger.GateTrigger.prototype=new CABLES.Op,CABLES.OPS["65e8b8a2-ba13-485f-883a-2bcf377989da"]={f:Ops.Trigger.GateTrigger,objName:"Ops.Trigger.GateTrigger"},Ops.Boolean.ToggleBoolValue=function(){CABLES.Op.apply(this,arguments);const e=this.inValueBool("in bool"),t=this.outValueBool("out bool");e.changeAlways=!0,e.onChange=function(){t.set(!(1==e.get()))}},Ops.Boolean.ToggleBoolValue.prototype=new CABLES.Op,CABLES.OPS["7b1abd02-3aad-4106-9848-7f4c3cfab6a9"]={f:Ops.Boolean.ToggleBoolValue,objName:"Ops.Boolean.ToggleBoolValue"},Ops.WebAudio.BiquadFilter=function(){CABLES.Op.apply(this,arguments);const e=this;this.name="BiquadFilter";var t=CABLES.WEBAUDIO.createAudioContext(e),n=t.sampleRate/2,a=t.createBiquadFilter(),r=(CABLES.WEBAUDIO.createAudioInPort(e,"Audio In",a),CABLES.WEBAUDIO.createAudioOutPort(e,"Audio Out",a),e.inValueSelect("type",["allpass","lowpass","highpass","bandpass","lowshelf","highshelf","peaking","notch"],"allpass")),o=e.inFloat("frequency",1e3),i=e.inFloatSlider("detune",0),l=e.inFloatSlider("q",0),s=e.inFloatSlider("gain",.5),u=function(){a.type=r.get()};r.onChange=u,o.onChange=function(){var e=o.get();e&&e>=10&&e<=n&&a.frequency.setValueAtTime(o.get(),window.audioContext.currentTime)},i.onChange=function(){a.detune.setValueAtTime(i.get(),window.audioContext.currentTime)},l.onChange=function(){a.Q.setValueAtTime(l.get(),window.audioContext.currentTime)},s.onChange=function(){a.gain.setValueAtTime(s.get(),window.audioContext.currentTime)},u()},Ops.WebAudio.BiquadFilter.prototype=new CABLES.Op,CABLES.OPS["3e28f86a-4f74-49a2-a1a6-f8943c00352d"]={f:Ops.WebAudio.BiquadFilter,objName:"Ops.WebAudio.BiquadFilter"},Ops.WebAudio.MultiIn=function(){CABLES.Op.apply(this,arguments);const e=this;window.audioContext||(audioContext=new AudioContext);var t=this.addOutPort(new CABLES.Port(this,"audio out",CABLES.OP_PORT_TYPE_OBJECT)),n=audioContext.createGain();t.set(n);for(var a=[],r=[],o=function(t){return function(){if(a[t].get()){r[t]=a[t].get();try{a[t].get().connect(n)}catch(t){e.log("[Error] "+t)}}else if(!a[t].isLinked())try{r[t].disconnect(n)}catch(t){e.log("[Error] "+t)}}},i=0;i<8;i++){var l=this.addInPort(new CABLES.Port(this,"audio in "+i,CABLES.OP_PORT_TYPE_OBJECT));l.audioInPortNr=i,l.onChange=o(i),a.push(l)}},Ops.WebAudio.MultiIn.prototype=new CABLES.Op,CABLES.OPS["fd3ee2e6-e632-4013-b548-d380c14ffa7d"]={f:Ops.WebAudio.MultiIn,objName:"Ops.WebAudio.MultiIn"},Ops.WebAudio.AudioBufferPlayer=function(){CABLES.Op.apply(this,arguments);const e=this;var t=CABLES.WEBAUDIO.createAudioContext(e),n=e.inObject("Audio Buffer"),a=e.inValueBool("Start / Stop",!1),r=e.inValue("Start Time",0),o=e.inValue("Stop Time",0),i=e.inValue("Offset",0),l=e.inValueBool("Autoplay",!1),s=e.inValueBool("Loop",!1),u=e.inValue("Detune",0),d=e.inValue("Playback Rate",1),c=e.outObject("Audio Out"),b=null;function f(){if(b){var e=u.get()||0;b.detune&&b.detune.setValueAtTime(e,t.currentTime)}}function p(){if(b){var e=d.get()||0;e>=b.playbackRate.minValue&&e<=b.playbackRate.maxValue&&b.playbackRate.setValueAtTime(e,t.currentTime)}}function m(){b&&v(0),b=t.createBufferSource();var e=n.get();e&&(b.buffer=e),b.onended=h,b.loop=s.get(),p(),f(),c.set(b)}function g(e){try{b.start(e,i.get())}catch(e){}}function v(e){try{b.stop(e)}catch(e){}}function h(){m()}n.onChange=function(){m(),(l.get()&&n.get()||a.get()&&n.get())&&g(r.get())},a.onChange=function(){b&&(a.get()?g(r.get()||0):v(o.get()||0))},s.onChange=function(){b&&(b.loop=!!s.get())},u.onChange=f,d.onChange=p},Ops.WebAudio.AudioBufferPlayer.prototype=new CABLES.Op,CABLES.OPS["05385277-92fc-4d49-b730-11f9ed5e5c0d"]={f:Ops.WebAudio.AudioBufferPlayer,objName:"Ops.WebAudio.AudioBufferPlayer"},Ops.WebAudio.AudioBuffer=function(){CABLES.Op.apply(this,arguments);const e=this,t=(CABLES.WEBAUDIO.createAudioContext(e),e.inFile("URL","audio")),n=e.outObject("Audio Buffer"),a=e.outValue("Finished Loading",!1),r=e.outValue("Sample Rate",0),o=e.outValue("Length",0),i=e.outValue("Duration",0),l=e.outValue("Number of Channels",0);function s(t){o.set(t.length),i.set(t.duration),l.set(t.numberOfChannels),r.set(t.sampleRate),n.set(t),a.set(!0),e.log("AudioBuffer loaded: ",t)}function u(e){console.error("Error: Loading audio file failed: ",e),o.set(0),i.set(0),l.set(0),r.set(0),n.set(0),a.set(!1)}t.onChange=function(){var n=e.patch.getFilePath(t.get());"string"==typeof n&&n.length>1&&CABLES.WEBAUDIO.loadAudioFile(e.patch,n,s,u)}},Ops.WebAudio.AudioBuffer.prototype=new CABLES.Op,CABLES.OPS["2cf4b0a1-b657-405b-8bf9-8555dbd5c231"]={f:Ops.WebAudio.AudioBuffer,objName:"Ops.WebAudio.AudioBuffer"},Ops.Gl.Texture=function(){CABLES.Op.apply(this,arguments);const e=this;var t=e.inFile("file","image"),n=e.inSwitch("filter",["nearest","linear","mipmap"]),a=e.inValueSelect("wrap",["repeat","mirrored repeat","clamp to edge"],"clamp to edge"),r=e.inValueBool("flip",!1),o=e.inValueBool("unpackPreMultipliedAlpha",!1),i=e.inSwitch("Anisotropic",[0,1,2,4,8,16],0),l=e.outTexture("texture"),s=e.outValue("width"),u=e.outValue("height"),d=e.outValue("loading"),c=e.outValue("Aspect Ratio");e.setPortGroup("Size",[s,u]),o.hidePort(),e.toWorkPortsNeedToBeLinked(l);const b=e.patch.cgl;var f=0,p=0,m=0;
72t.onChange=r.onChange=function(){I()},i.onChange=n.onChange=function(){"nearest"==n.get()?f=CGL.Texture.FILTER_NEAREST:"linear"==n.get()?f=CGL.Texture.FILTER_LINEAR:"mipmap"==n.get()?f=CGL.Texture.FILTER_MIPMAP:"Anisotropic"==n.get()&&(f=CGL.Texture.FILTER_ANISOTROPIC);m=parseFloat(i.get()),I()},a.onChange=function(){"repeat"==a.get()&&(p=CGL.Texture.WRAP_REPEAT);"mirrored repeat"==a.get()&&(p=CGL.Texture.WRAP_MIRRORED_REPEAT);"clamp to edge"==a.get()&&(p=CGL.Texture.WRAP_CLAMP_TO_EDGE);I()},o.onChange=function(){I()};var g=0;n.set("mipmap"),a.set("repeat"),l.set(CGL.Texture.getEmptyTexture(b));var v=function(){var e=CGL.Texture.getTempTexture(b);l.set(e)},h=null,x=null;function I(e){clearTimeout(g),g=setTimeout(function(){O(e)},30)}function O(n){h||(h=b.patch.loading.start("textureOp",t.get()));var a=e.patch.getFilePath(String(t.get()));n&&(a+="?rnd="+CABLES.generateUUID()),t.get()&&t.get().length>1?(d.set(!0),x&&x.delete(),x=CGL.Texture.load(b,a,function(n){if(n)return v(),e.uiAttr({error:'could not load texture "'+t.get()+'"'}),void b.patch.loading.finished(h);e.uiAttr({error:null}),l.set(x),s.set(x.width),u.set(x.height),c.set(x.width/x.height),x.isPowerOfTwo()?e.uiAttr({hint:null,warning:null}):e.uiAttr({hint:"texture dimensions not power of two! - texture filtering will not work.",warning:null}),l.set(null),l.set(x)},{anisotropic:m,wrap:p,flip:r.get(),unpackAlpha:o.get(),filter:f}),l.set(null),l.set(x),l.get(),b.patch.loading.finished(h)):(b.patch.loading.finished(h),v())}e.onFileChanged=function(e){t.get()&&t.get().indexOf(e)>-1&&(l.set(null),l.set(CGL.Texture.getTempTexture(b)),O(!0))}},Ops.Gl.Texture.prototype=new CABLES.Op,CABLES.OPS["466394d4-6c1a-4e5d-a057-0063ab0f096a"]={f:Ops.Gl.Texture,objName:"Ops.Gl.Texture"},Ops.String.SwitchString=function(){CABLES.Op.apply(this,arguments);const e=this,t=e.inValueInt("Index"),n=e.outString("Result"),a=[];t.onChange=i;for(var r=0;r<10;r++){var o=e.inString("String "+r);a.push(o),o.onChange=i}function i(){t.get()>=0&&a[t.get()]&&n.set(a[t.get()].get())}},Ops.String.SwitchString.prototype=new CABLES.Op,CABLES.OPS["2a7a0c68-f7c9-4249-b19a-d2de5cb4862c"]={f:Ops.String.SwitchString,objName:"Ops.String.SwitchString"},window.addEventListener("load",function(e){CABLES.jsLoaded=new Event("CABLES.jsLoaded"),document.dispatchEvent(CABLES.jsLoaded)});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.